@backstage/plugin-notifications-node 0.1.3-next.0 → 0.1.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 CHANGED
@@ -1,5 +1,32 @@
1
1
  # @backstage/plugin-notifications-node
2
2
 
3
+ ## 0.1.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
+ - Updated dependencies
11
+ - @backstage/backend-common@0.21.7
12
+ - @backstage/plugin-notifications-common@0.0.3
13
+ - @backstage/backend-plugin-api@0.6.17
14
+ - @backstage/catalog-client@1.6.4
15
+ - @backstage/plugin-signals-node@0.1.3
16
+ - @backstage/catalog-model@1.4.5
17
+
18
+ ## 0.1.3-next.1
19
+
20
+ ### Patch Changes
21
+
22
+ - Updated dependencies
23
+ - @backstage/backend-common@0.21.7-next.1
24
+ - @backstage/backend-plugin-api@0.6.17-next.1
25
+ - @backstage/catalog-client@1.6.4-next.0
26
+ - @backstage/plugin-signals-node@0.1.3-next.1
27
+ - @backstage/catalog-model@1.4.5
28
+ - @backstage/plugin-notifications-common@0.0.2
29
+
3
30
  ## 0.1.3-next.0
4
31
 
5
32
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/service/DefaultNotificationService.ts","../src/lib.ts","../src/extensions.ts"],"sourcesContent":["/*\n * Copyright 2023 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 */\n\nimport { NotificationService } from './NotificationService';\nimport { AuthService, DiscoveryService } from '@backstage/backend-plugin-api';\nimport { NotificationPayload } from '@backstage/plugin-notifications-common';\n\n/** @public */\nexport type NotificationServiceOptions = {\n auth: AuthService;\n discovery: DiscoveryService;\n};\n\n/** @public */\nexport type NotificationRecipients =\n | {\n type: 'entity';\n entityRef: string | string[];\n }\n | { type: 'broadcast' };\n\n/** @public */\nexport type NotificationSendOptions = {\n recipients: NotificationRecipients;\n payload: NotificationPayload;\n};\n\n/** @public */\nexport class DefaultNotificationService implements NotificationService {\n private constructor(\n private readonly discovery: DiscoveryService,\n private readonly auth: AuthService,\n ) {}\n\n static create(\n options: NotificationServiceOptions,\n ): DefaultNotificationService {\n return new DefaultNotificationService(options.discovery, options.auth);\n }\n\n async send(notification: NotificationSendOptions): Promise<void> {\n try {\n const baseUrl = await this.discovery.getBaseUrl('notifications');\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'notifications',\n });\n\n const response = await fetch(`${baseUrl}/`, {\n method: 'POST',\n body: JSON.stringify(notification),\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n Authorization: `Bearer ${token}`,\n },\n });\n\n if (!response.ok) {\n throw new Error(`Request failed with status ${response.status}`);\n }\n } catch (error) {\n // TODO: Should not throw in optimal case, see BEP\n throw new Error(`Failed to send notifications: ${error}`);\n }\n }\n}\n","/*\n * Copyright 2023 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 {\n coreServices,\n createServiceFactory,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\nimport { DefaultNotificationService } from './service';\nimport { NotificationService } from './service/NotificationService';\n\n/** @public */\nexport const notificationService = createServiceRef<NotificationService>({\n id: 'notifications.service',\n scope: 'plugin',\n defaultFactory: async service =>\n createServiceFactory({\n service,\n deps: {\n auth: coreServices.auth,\n discovery: coreServices.discovery,\n },\n factory({ auth, discovery }) {\n return DefaultNotificationService.create({\n auth,\n discovery,\n });\n },\n }),\n});\n","/*\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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { Notification } from '@backstage/plugin-notifications-common';\n\n/**\n * @public\n */\nexport interface NotificationProcessor {\n /**\n * Decorate notification before sending it\n *\n * @param notification - The notification to decorate\n * @returns The same notification or a modified version of it\n */\n decorate?(notification: Notification): Promise<Notification>;\n\n /**\n * Send notification using this processor.\n *\n * @param notification - The notification to send\n */\n send?(notification: Notification): Promise<void>;\n}\n\n/**\n * @public\n */\nexport interface NotificationsProcessingExtensionPoint {\n addProcessor(\n ...processors: Array<NotificationProcessor | Array<NotificationProcessor>>\n ): void;\n}\n\n/**\n * @public\n */\nexport const notificationsProcessingExtensionPoint =\n createExtensionPoint<NotificationsProcessingExtensionPoint>({\n id: 'notifications.processing',\n });\n"],"names":["createServiceRef","createServiceFactory","coreServices","createExtensionPoint"],"mappings":";;;;AAyCO,MAAM,0BAA0D,CAAA;AAAA,EAC7D,WAAA,CACW,WACA,IACjB,EAAA;AAFiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEH,OAAO,OACL,OAC4B,EAAA;AAC5B,IAAA,OAAO,IAAI,0BAAA,CAA2B,OAAQ,CAAA,SAAA,EAAW,QAAQ,IAAI,CAAA,CAAA;AAAA,GACvE;AAAA,EAEA,MAAM,KAAK,YAAsD,EAAA;AAC/D,IAAI,IAAA;AACF,MAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,SAAA,CAAU,WAAW,eAAe,CAAA,CAAA;AAC/D,MAAA,MAAM,EAAE,KAAM,EAAA,GAAI,MAAM,IAAA,CAAK,KAAK,qBAAsB,CAAA;AAAA,QACtD,UAAY,EAAA,MAAM,IAAK,CAAA,IAAA,CAAK,wBAAyB,EAAA;AAAA,QACrD,cAAgB,EAAA,eAAA;AAAA,OACjB,CAAA,CAAA;AAED,MAAA,MAAM,QAAW,GAAA,MAAM,KAAM,CAAA,CAAA,EAAG,OAAO,CAAK,CAAA,CAAA,EAAA;AAAA,QAC1C,MAAQ,EAAA,MAAA;AAAA,QACR,IAAA,EAAM,IAAK,CAAA,SAAA,CAAU,YAAY,CAAA;AAAA,QACjC,OAAS,EAAA;AAAA,UACP,cAAgB,EAAA,kBAAA;AAAA,UAChB,MAAQ,EAAA,kBAAA;AAAA,UACR,aAAA,EAAe,UAAU,KAAK,CAAA,CAAA;AAAA,SAChC;AAAA,OACD,CAAA,CAAA;AAED,MAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,QAAA,MAAM,IAAI,KAAA,CAAM,CAA8B,2BAAA,EAAA,QAAA,CAAS,MAAM,CAAE,CAAA,CAAA,CAAA;AAAA,OACjE;AAAA,aACO,KAAO,EAAA;AAEd,MAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,KAAK,CAAE,CAAA,CAAA,CAAA;AAAA,KAC1D;AAAA,GACF;AACF;;ACvDO,MAAM,sBAAsBA,iCAAsC,CAAA;AAAA,EACvE,EAAI,EAAA,uBAAA;AAAA,EACJ,KAAO,EAAA,QAAA;AAAA,EACP,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAqB,CAAA;AAAA,IACnB,OAAA;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,MAAMC,6BAAa,CAAA,IAAA;AAAA,MACnB,WAAWA,6BAAa,CAAA,SAAA;AAAA,KAC1B;AAAA,IACA,OAAQ,CAAA,EAAE,IAAM,EAAA,SAAA,EAAa,EAAA;AAC3B,MAAA,OAAO,2BAA2B,MAAO,CAAA;AAAA,QACvC,IAAA;AAAA,QACA,SAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH;AAAA,GACD,CAAA;AACL,CAAC;;ACSM,MAAM,wCACXC,qCAA4D,CAAA;AAAA,EAC1D,EAAI,EAAA,0BAAA;AACN,CAAC;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/service/DefaultNotificationService.ts","../src/lib.ts","../src/extensions.ts"],"sourcesContent":["/*\n * Copyright 2023 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 */\n\nimport { NotificationService } from './NotificationService';\nimport { AuthService, DiscoveryService } from '@backstage/backend-plugin-api';\nimport { NotificationPayload } from '@backstage/plugin-notifications-common';\n\n/** @public */\nexport type NotificationServiceOptions = {\n auth: AuthService;\n discovery: DiscoveryService;\n};\n\n/** @public */\nexport type NotificationRecipients =\n | {\n type: 'entity';\n entityRef: string | string[];\n }\n | { type: 'broadcast' };\n\n/** @public */\nexport type NotificationSendOptions = {\n recipients: NotificationRecipients;\n payload: NotificationPayload;\n};\n\n/** @public */\nexport class DefaultNotificationService implements NotificationService {\n private constructor(\n private readonly discovery: DiscoveryService,\n private readonly auth: AuthService,\n ) {}\n\n static create(\n options: NotificationServiceOptions,\n ): DefaultNotificationService {\n return new DefaultNotificationService(options.discovery, options.auth);\n }\n\n async send(notification: NotificationSendOptions): Promise<void> {\n try {\n const baseUrl = await this.discovery.getBaseUrl('notifications');\n const { token } = await this.auth.getPluginRequestToken({\n onBehalfOf: await this.auth.getOwnServiceCredentials(),\n targetPluginId: 'notifications',\n });\n\n const response = await fetch(`${baseUrl}/`, {\n method: 'POST',\n body: JSON.stringify(notification),\n headers: {\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n Authorization: `Bearer ${token}`,\n },\n });\n\n if (!response.ok) {\n throw new Error(`Request failed with status ${response.status}`);\n }\n } catch (error) {\n // TODO: Should not throw in optimal case, see BEP\n throw new Error(`Failed to send notifications: ${error}`);\n }\n }\n}\n","/*\n * Copyright 2023 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 {\n coreServices,\n createServiceFactory,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\nimport { DefaultNotificationService } from './service';\nimport { NotificationService } from './service/NotificationService';\n\n/** @public */\nexport const notificationService = createServiceRef<NotificationService>({\n id: 'notifications.service',\n scope: 'plugin',\n defaultFactory: async service =>\n createServiceFactory({\n service,\n deps: {\n auth: coreServices.auth,\n discovery: coreServices.discovery,\n },\n factory({ auth, discovery }) {\n return DefaultNotificationService.create({\n auth,\n discovery,\n });\n },\n }),\n});\n","/*\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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport { Notification } from '@backstage/plugin-notifications-common';\nimport { NotificationSendOptions } from './service';\n\n/**\n * Notification processors are used to modify the notification parameters or sending the notifications\n * to external systems.\n *\n * Notification modules should utilize the `notificationsProcessingExtensionPoint` to add new processors\n * to the system.\n *\n * Notification processing flow:\n *\n * 1. New notification send request is received\n * 2. For all notification processors registered, processOptions function is called to process the notification options\n * 3. Notification recipients are resolved from the options\n * 4. For each recipient, preProcess function is called to pre-process the notification\n * 5. Notification is saved to the database and sent to the Backstage UI\n * 6. For each recipient, postProcess function is called to post-process the notification\n *\n * @public\n */\nexport interface NotificationProcessor {\n /**\n * Human-readable name of this processor like Email, Slack, etc.\n */\n getName(): string;\n\n /**\n * Process the notification options.\n *\n * Can be used to override the default recipient resolving, sending the notification to an\n * external service or modify other notification options necessary.\n *\n * processOptions functions are called only once for each notification before the recipient resolving,\n * pre-process, sending and post-process of the notification.\n *\n * @param options - The original options to send the notification\n */\n processOptions?(\n options: NotificationSendOptions,\n ): Promise<NotificationSendOptions>;\n\n /**\n * Pre-process notification before sending it to Backstage UI.\n *\n * Can be used to send the notification to external services or to decorate the notification with additional\n * information. The notification is saved to database and sent to Backstage UI after all pre-process functions\n * have run. The notification options passed here are already processed by processOptions functionality.\n *\n * preProcess functions are called for each notification recipient individually or once for broadcast\n * notification BEFORE the notification has been sent to the Backstage UI.\n *\n * @param notification - The notification to send\n * @param options - The options to send the notification\n * @returns The same notification or a modified version of it\n */\n preProcess?(\n notification: Notification,\n options: NotificationSendOptions,\n ): Promise<Notification>;\n\n /**\n * Post process notification after sending it to Backstage UI.\n *\n * Can be used to send the notification to external services.\n *\n * postProcess functions are called for each notification recipient individually or once for\n * broadcast notification AFTER the notification has been sent to the Backstage UI.\n *\n * @param notification - The notification to send\n * @param options - The options to send the notification\n */\n postProcess?(\n notification: Notification,\n options: NotificationSendOptions,\n ): Promise<void>;\n}\n\n/**\n * @public\n */\nexport interface NotificationsProcessingExtensionPoint {\n addProcessor(\n ...processors: Array<NotificationProcessor | Array<NotificationProcessor>>\n ): void;\n}\n\n/**\n * @public\n */\nexport const notificationsProcessingExtensionPoint =\n createExtensionPoint<NotificationsProcessingExtensionPoint>({\n id: 'notifications.processing',\n });\n"],"names":["createServiceRef","createServiceFactory","coreServices","createExtensionPoint"],"mappings":";;;;AAyCO,MAAM,0BAA0D,CAAA;AAAA,EAC7D,WAAA,CACW,WACA,IACjB,EAAA;AAFiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA,CAAA;AACA,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA,CAAA;AAAA,GAChB;AAAA,EAEH,OAAO,OACL,OAC4B,EAAA;AAC5B,IAAA,OAAO,IAAI,0BAAA,CAA2B,OAAQ,CAAA,SAAA,EAAW,QAAQ,IAAI,CAAA,CAAA;AAAA,GACvE;AAAA,EAEA,MAAM,KAAK,YAAsD,EAAA;AAC/D,IAAI,IAAA;AACF,MAAA,MAAM,OAAU,GAAA,MAAM,IAAK,CAAA,SAAA,CAAU,WAAW,eAAe,CAAA,CAAA;AAC/D,MAAA,MAAM,EAAE,KAAM,EAAA,GAAI,MAAM,IAAA,CAAK,KAAK,qBAAsB,CAAA;AAAA,QACtD,UAAY,EAAA,MAAM,IAAK,CAAA,IAAA,CAAK,wBAAyB,EAAA;AAAA,QACrD,cAAgB,EAAA,eAAA;AAAA,OACjB,CAAA,CAAA;AAED,MAAA,MAAM,QAAW,GAAA,MAAM,KAAM,CAAA,CAAA,EAAG,OAAO,CAAK,CAAA,CAAA,EAAA;AAAA,QAC1C,MAAQ,EAAA,MAAA;AAAA,QACR,IAAA,EAAM,IAAK,CAAA,SAAA,CAAU,YAAY,CAAA;AAAA,QACjC,OAAS,EAAA;AAAA,UACP,cAAgB,EAAA,kBAAA;AAAA,UAChB,MAAQ,EAAA,kBAAA;AAAA,UACR,aAAA,EAAe,UAAU,KAAK,CAAA,CAAA;AAAA,SAChC;AAAA,OACD,CAAA,CAAA;AAED,MAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,QAAA,MAAM,IAAI,KAAA,CAAM,CAA8B,2BAAA,EAAA,QAAA,CAAS,MAAM,CAAE,CAAA,CAAA,CAAA;AAAA,OACjE;AAAA,aACO,KAAO,EAAA;AAEd,MAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,KAAK,CAAE,CAAA,CAAA,CAAA;AAAA,KAC1D;AAAA,GACF;AACF;;ACvDO,MAAM,sBAAsBA,iCAAsC,CAAA;AAAA,EACvE,EAAI,EAAA,uBAAA;AAAA,EACJ,KAAO,EAAA,QAAA;AAAA,EACP,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAqB,CAAA;AAAA,IACnB,OAAA;AAAA,IACA,IAAM,EAAA;AAAA,MACJ,MAAMC,6BAAa,CAAA,IAAA;AAAA,MACnB,WAAWA,6BAAa,CAAA,SAAA;AAAA,KAC1B;AAAA,IACA,OAAQ,CAAA,EAAE,IAAM,EAAA,SAAA,EAAa,EAAA;AAC3B,MAAA,OAAO,2BAA2B,MAAO,CAAA;AAAA,QACvC,IAAA;AAAA,QACA,SAAA;AAAA,OACD,CAAA,CAAA;AAAA,KACH;AAAA,GACD,CAAA;AACL,CAAC;;ACiEM,MAAM,wCACXC,qCAA4D,CAAA;AAAA,EAC1D,EAAI,EAAA,0BAAA;AACN,CAAC;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -37,22 +37,67 @@ declare class DefaultNotificationService implements NotificationService {
37
37
  declare const notificationService: _backstage_backend_plugin_api.ServiceRef<NotificationService, "plugin">;
38
38
 
39
39
  /**
40
+ * Notification processors are used to modify the notification parameters or sending the notifications
41
+ * to external systems.
42
+ *
43
+ * Notification modules should utilize the `notificationsProcessingExtensionPoint` to add new processors
44
+ * to the system.
45
+ *
46
+ * Notification processing flow:
47
+ *
48
+ * 1. New notification send request is received
49
+ * 2. For all notification processors registered, processOptions function is called to process the notification options
50
+ * 3. Notification recipients are resolved from the options
51
+ * 4. For each recipient, preProcess function is called to pre-process the notification
52
+ * 5. Notification is saved to the database and sent to the Backstage UI
53
+ * 6. For each recipient, postProcess function is called to post-process the notification
54
+ *
40
55
  * @public
41
56
  */
42
57
  interface NotificationProcessor {
43
58
  /**
44
- * Decorate notification before sending it
59
+ * Human-readable name of this processor like Email, Slack, etc.
60
+ */
61
+ getName(): string;
62
+ /**
63
+ * Process the notification options.
64
+ *
65
+ * Can be used to override the default recipient resolving, sending the notification to an
66
+ * external service or modify other notification options necessary.
67
+ *
68
+ * processOptions functions are called only once for each notification before the recipient resolving,
69
+ * pre-process, sending and post-process of the notification.
70
+ *
71
+ * @param options - The original options to send the notification
72
+ */
73
+ processOptions?(options: NotificationSendOptions): Promise<NotificationSendOptions>;
74
+ /**
75
+ * Pre-process notification before sending it to Backstage UI.
76
+ *
77
+ * Can be used to send the notification to external services or to decorate the notification with additional
78
+ * information. The notification is saved to database and sent to Backstage UI after all pre-process functions
79
+ * have run. The notification options passed here are already processed by processOptions functionality.
80
+ *
81
+ * preProcess functions are called for each notification recipient individually or once for broadcast
82
+ * notification BEFORE the notification has been sent to the Backstage UI.
45
83
  *
46
- * @param notification - The notification to decorate
84
+ * @param notification - The notification to send
85
+ * @param options - The options to send the notification
47
86
  * @returns The same notification or a modified version of it
48
87
  */
49
- decorate?(notification: Notification): Promise<Notification>;
88
+ preProcess?(notification: Notification, options: NotificationSendOptions): Promise<Notification>;
50
89
  /**
51
- * Send notification using this processor.
90
+ * Post process notification after sending it to Backstage UI.
91
+ *
92
+ * Can be used to send the notification to external services.
93
+ *
94
+ * postProcess functions are called for each notification recipient individually or once for
95
+ * broadcast notification AFTER the notification has been sent to the Backstage UI.
52
96
  *
53
97
  * @param notification - The notification to send
98
+ * @param options - The options to send the notification
54
99
  */
55
- send?(notification: Notification): Promise<void>;
100
+ postProcess?(notification: Notification, options: NotificationSendOptions): Promise<void>;
56
101
  }
57
102
  /**
58
103
  * @public
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@backstage/plugin-notifications-node",
3
+ "version": "0.1.3",
3
4
  "description": "Node.js library for the notifications plugin",
4
- "version": "0.1.3-next.0",
5
- "main": "dist/index.cjs.js",
6
- "types": "dist/index.d.ts",
7
- "license": "Apache-2.0",
5
+ "backstage": {
6
+ "role": "node-library"
7
+ },
8
8
  "publishConfig": {
9
9
  "access": "public",
10
10
  "main": "dist/index.cjs.js",
@@ -15,34 +15,34 @@
15
15
  "url": "https://github.com/backstage/backstage",
16
16
  "directory": "plugins/notifications-node"
17
17
  },
18
- "backstage": {
19
- "role": "node-library"
20
- },
18
+ "license": "Apache-2.0",
19
+ "main": "dist/index.cjs.js",
20
+ "types": "dist/index.d.ts",
21
+ "files": [
22
+ "dist"
23
+ ],
21
24
  "scripts": {
22
25
  "build": "backstage-cli package build",
23
- "lint": "backstage-cli package lint",
24
- "test": "backstage-cli package test",
25
26
  "clean": "backstage-cli package clean",
27
+ "lint": "backstage-cli package lint",
26
28
  "prepack": "backstage-cli package prepack",
27
- "postpack": "backstage-cli package postpack"
28
- },
29
- "devDependencies": {
30
- "@backstage/backend-test-utils": "^0.3.7-next.0",
31
- "@backstage/cli": "^0.26.3-next.0",
32
- "@backstage/test-utils": "^1.5.3",
33
- "msw": "^1.0.0"
29
+ "postpack": "backstage-cli package postpack",
30
+ "test": "backstage-cli package test"
34
31
  },
35
- "files": [
36
- "dist"
37
- ],
38
32
  "dependencies": {
39
- "@backstage/backend-common": "^0.21.7-next.0",
40
- "@backstage/backend-plugin-api": "^0.6.17-next.0",
41
- "@backstage/catalog-client": "^1.6.3",
33
+ "@backstage/backend-common": "^0.21.7",
34
+ "@backstage/backend-plugin-api": "^0.6.17",
35
+ "@backstage/catalog-client": "^1.6.4",
42
36
  "@backstage/catalog-model": "^1.4.5",
43
- "@backstage/plugin-notifications-common": "^0.0.2",
44
- "@backstage/plugin-signals-node": "^0.1.3-next.0",
37
+ "@backstage/plugin-notifications-common": "^0.0.3",
38
+ "@backstage/plugin-signals-node": "^0.1.3",
45
39
  "knex": "^3.0.0",
46
40
  "uuid": "^9.0.0"
41
+ },
42
+ "devDependencies": {
43
+ "@backstage/backend-test-utils": "^0.3.7",
44
+ "@backstage/cli": "^0.26.3",
45
+ "@backstage/test-utils": "^1.5.4",
46
+ "msw": "^1.0.0"
47
47
  }
48
48
  }