@backstage/plugin-notifications-common 0.0.2 → 0.0.4-next.0

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @backstage/plugin-notifications-common
2
2
 
3
+ ## 0.0.4-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - d44a20a: Added additional plugin metadata to `package.json`.
8
+
9
+ ## 0.0.3
10
+
11
+ ### Patch Changes
12
+
13
+ - 0d99528: Notification processor functions are now renamed to `preProcess` and `postProcess`.
14
+ Additionally, processor name is now required to be returned by `getName`.
15
+ A new processor functionality `processOptions` was added to process options before sending the notification.
16
+ - e003e0e: The ordered list of notifications' severities is exported by notifications-common for reusability.
17
+
3
18
  ## 0.0.2
4
19
 
5
20
  ### Patch Changes
@@ -0,0 +1,9 @@
1
+ const notificationSeverities = [
2
+ "critical",
3
+ "high",
4
+ "normal",
5
+ "low"
6
+ ];
7
+
8
+ export { notificationSeverities };
9
+ //# sourceMappingURL=constants.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.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/dist/index.cjs.js CHANGED
@@ -1,3 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ const notificationSeverities = [
4
+ "critical",
5
+ "high",
6
+ "normal",
7
+ "low"
8
+ ];
9
+
10
+ exports.notificationSeverities = notificationSeverities;
3
11
  //# sourceMappingURL=index.cjs.js.map
@@ -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
- user: string;
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
- export { NewNotificationSignal, Notification, NotificationPayload, NotificationReadSignal, NotificationSeverity, NotificationSignal, NotificationStatus };
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
@@ -1,2 +1,2 @@
1
-
1
+ export { notificationSeverities } from './constants.esm.js';
2
2
  //# sourceMappingURL=index.esm.js.map
package/package.json CHANGED
@@ -1,9 +1,16 @@
1
1
  {
2
2
  "name": "@backstage/plugin-notifications-common",
3
- "version": "0.0.2",
3
+ "version": "0.0.4-next.0",
4
4
  "description": "Common functionalities for the notifications plugin",
5
5
  "backstage": {
6
- "role": "common-library"
6
+ "role": "common-library",
7
+ "pluginId": "notifications",
8
+ "pluginPackages": [
9
+ "@backstage/plugin-notifications",
10
+ "@backstage/plugin-notifications-backend",
11
+ "@backstage/plugin-notifications-common",
12
+ "@backstage/plugin-notifications-node"
13
+ ]
7
14
  },
8
15
  "publishConfig": {
9
16
  "access": "public",
@@ -35,7 +42,7 @@
35
42
  "@material-ui/icons": "^4.9.1"
36
43
  },
37
44
  "devDependencies": {
38
- "@backstage/cli": "^0.26.0"
45
+ "@backstage/cli": "^0.26.7-next.3"
39
46
  },
40
47
  "module": "dist/index.esm.js"
41
48
  }