@kie-tools-core/notifications
v10.0.0
Published
<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to
Downloads
3,173
Readme
Apache KIE Tools Notifications
This package provides a type-safe Notifications library for a Typescript project.
Install
npm install @kie-tools-core/notifications
Usage
The library is separated into two submodules:
api All the APIs and the main classes needed are in this submodule.
to use the core:
import { NotificationsChannelApi } from "@kie-tools-core/notifications/dist/api"
import { Notification } from "@kie-tools-core/notifications/dist/api"
import { NotificationSeverity } from "@kie-tools-core/notifications/dist/api"
import { NotificationType } from "@kie-tools-core/notifications/dist/api"
API
Notifications main attributes:
- messages: The text that will be shown to the user
- path: File location.
- severity:
"INFO" | "WARNING" | "ERROR" | "SUCCESS" | "HINT"
- type:
"PROBLEM" | "ALERT"
VS Code
The VsCodeNotificationsChannelApiImpl
class is the only "public" class users have access. Under the hood it contains two different implementations depending on Notification.type
.
So if:
Notifications.type === "PROBLEM"
The notifications are going to be shown in Problems Tab.Notifications.type === "ALERT"
The notifications are going to be shown as Popups.
If, for some reason, there is not type, the default is PROBLEM
In both cases path is mandatory and it will let the user to open the file where those notifications come from.
Notification.severity
also depends on Notification.type
, if:
PROBLEM
, the supported severities are"INFO" | "WARNING" | "ERROR" | "SUCCESS" | "HINT"
.SUCCESS
converts toINFO
which is the default severity.ALERT
, the supported severities are"ERROR" | "WARNING" | "INFO"
. Any other types defaults toINFO
Apache KIE (incubating) is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the name of Apache Incubator. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
Some of the incubating project’s releases may not be fully compliant with ASF policy. For example, releases may have incomplete or un-reviewed licensing conditions. What follows is a list of known issues the project is currently aware of (note that this list, by definition, is likely to be incomplete):
Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
Hibernate, an LGPL project, is being used. Hibernate is in the process of relicensing to ASL v2
Some files, particularly test files, and those not supporting comments, may be missing the ASF Licensing Header
If you are planning to incorporate this work into your product/project, please be aware that you will need to conduct a thorough licensing review to determine the overall implications of including this work. For the current status of this project through the Apache Incubator visit: https://incubator.apache.org/projects/kie.html