@backstage/plugin-notifications-common 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/index.cjs.js +8 -0
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +61 -2
- package/dist/index.esm.js +7 -0
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @backstage/plugin-notifications-common
|
|
2
2
|
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0d99528: Notification processor functions are now renamed to `preProcess` and `postProcess`.
|
|
8
|
+
Additionally, processor name is now required to be returned by `getName`.
|
|
9
|
+
A new processor functionality `processOptions` was added to process options before sending the notification.
|
|
10
|
+
- e003e0e: The ordered list of notifications' severities is exported by notifications-common for reusability.
|
|
11
|
+
|
|
3
12
|
## 0.0.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/constants.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { NotificationSeverity } from './types';\n\n/** Ordered list of severities used by the Notifications.\n *\n * @public */\nexport const notificationSeverities: NotificationSeverity[] = [\n 'critical',\n 'high',\n 'normal',\n 'low',\n];\n"],"names":[],"mappings":";;AAoBO,MAAM,sBAAiD,GAAA;AAAA,EAC5D,UAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AACF;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,28 +2,82 @@
|
|
|
2
2
|
type NotificationSeverity = 'critical' | 'high' | 'normal' | 'low';
|
|
3
3
|
/** @public */
|
|
4
4
|
type NotificationPayload = {
|
|
5
|
+
/**
|
|
6
|
+
* Notification title
|
|
7
|
+
*/
|
|
5
8
|
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* Optional longer description for the notification
|
|
11
|
+
*/
|
|
6
12
|
description?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional link where the notification is pointing to
|
|
15
|
+
*/
|
|
7
16
|
link?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Notification severity, defaults to 'normal'
|
|
19
|
+
*/
|
|
8
20
|
severity?: NotificationSeverity;
|
|
21
|
+
/**
|
|
22
|
+
* Optional notification topic
|
|
23
|
+
*/
|
|
9
24
|
topic?: string;
|
|
25
|
+
/**
|
|
26
|
+
* Notification scope, can be used to re-send same notifications in case
|
|
27
|
+
* the scope and origin matches.
|
|
28
|
+
*/
|
|
10
29
|
scope?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Optional notification icon
|
|
32
|
+
*/
|
|
11
33
|
icon?: string;
|
|
12
34
|
};
|
|
13
35
|
/** @public */
|
|
14
36
|
type Notification = {
|
|
37
|
+
/**
|
|
38
|
+
* Unique identifier for the notification
|
|
39
|
+
*/
|
|
15
40
|
id: string;
|
|
16
|
-
|
|
41
|
+
/**
|
|
42
|
+
* The user entity reference that the notification is targeted to or null
|
|
43
|
+
* for broadcast notifications
|
|
44
|
+
*/
|
|
45
|
+
user: string | null;
|
|
46
|
+
/**
|
|
47
|
+
* Notification creation date
|
|
48
|
+
*/
|
|
17
49
|
created: Date;
|
|
50
|
+
/**
|
|
51
|
+
* If user has saved the notification, the date when it was saved
|
|
52
|
+
*/
|
|
18
53
|
saved?: Date;
|
|
54
|
+
/**
|
|
55
|
+
* If user has read the notification, the date when it was read
|
|
56
|
+
*/
|
|
19
57
|
read?: Date;
|
|
58
|
+
/**
|
|
59
|
+
* If the notification has been updated due to it being in the same scope
|
|
60
|
+
* and from same origin as previous notification, the date when it was updated
|
|
61
|
+
*/
|
|
20
62
|
updated?: Date;
|
|
63
|
+
/**
|
|
64
|
+
* Origin of the notification as in the reference to sender
|
|
65
|
+
*/
|
|
21
66
|
origin: string;
|
|
67
|
+
/**
|
|
68
|
+
* Actual notification payload
|
|
69
|
+
*/
|
|
22
70
|
payload: NotificationPayload;
|
|
23
71
|
};
|
|
24
72
|
/** @public */
|
|
25
73
|
type NotificationStatus = {
|
|
74
|
+
/**
|
|
75
|
+
* Total number of unread notifications for the user
|
|
76
|
+
*/
|
|
26
77
|
unread: number;
|
|
78
|
+
/**
|
|
79
|
+
* Total number of read notifications for the user
|
|
80
|
+
*/
|
|
27
81
|
read: number;
|
|
28
82
|
};
|
|
29
83
|
/** @public */
|
|
@@ -39,4 +93,9 @@ type NotificationReadSignal = {
|
|
|
39
93
|
/** @public */
|
|
40
94
|
type NotificationSignal = NewNotificationSignal | NotificationReadSignal;
|
|
41
95
|
|
|
42
|
-
|
|
96
|
+
/** Ordered list of severities used by the Notifications.
|
|
97
|
+
*
|
|
98
|
+
* @public */
|
|
99
|
+
declare const notificationSeverities: NotificationSeverity[];
|
|
100
|
+
|
|
101
|
+
export { type NewNotificationSignal, type Notification, type NotificationPayload, type NotificationReadSignal, type NotificationSeverity, type NotificationSignal, type NotificationStatus, notificationSeverities };
|
package/dist/index.esm.js
CHANGED
package/dist/index.esm.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/constants.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { NotificationSeverity } from './types';\n\n/** Ordered list of severities used by the Notifications.\n *\n * @public */\nexport const notificationSeverities: NotificationSeverity[] = [\n 'critical',\n 'high',\n 'normal',\n 'low',\n];\n"],"names":[],"mappings":"AAoBO,MAAM,sBAAiD,GAAA;AAAA,EAC5D,UAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACA,KAAA;AACF;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-notifications-common",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Common functionalities for the notifications plugin",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "common-library"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@material-ui/icons": "^4.9.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@backstage/cli": "^0.26.
|
|
38
|
+
"@backstage/cli": "^0.26.3"
|
|
39
39
|
},
|
|
40
40
|
"module": "dist/index.esm.js"
|
|
41
41
|
}
|