@backstage/plugin-notifications-node 0.2.30-next.0 → 0.2.30-next.1

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,14 @@
1
1
  # @backstage/plugin-notifications-node
2
2
 
3
+ ## 0.2.30-next.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 80a548a: Added `resolveNotificationLink` utility function that resolves relative notification links to absolute URLs using a provided base URL. This can be used by notification processor modules to ensure links are absolute before forwarding them to external systems.
8
+ - Updated dependencies
9
+ - @backstage/backend-plugin-api@1.10.1-next.1
10
+ - @backstage/plugin-notifications-common@0.2.4-next.0
11
+
3
12
  ## 0.2.30-next.0
4
13
 
5
14
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -3,10 +3,12 @@
3
3
  var DefaultNotificationService = require('./service/DefaultNotificationService.cjs.js');
4
4
  var lib = require('./lib.cjs.js');
5
5
  var extensions = require('./extensions.cjs.js');
6
+ var utils = require('./utils.cjs.js');
6
7
 
7
8
 
8
9
 
9
10
  exports.DefaultNotificationService = DefaultNotificationService.DefaultNotificationService;
10
11
  exports.notificationService = lib.notificationService;
11
12
  exports.notificationsProcessingExtensionPoint = extensions.notificationsProcessingExtensionPoint;
13
+ exports.resolveNotificationLink = utils.resolveNotificationLink;
12
14
  //# 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":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -148,5 +148,11 @@ declare const notificationsProcessingExtensionPoint: _backstage_backend_plugin_a
148
148
  */
149
149
  type NotificationProcessorFilters = NotificationProcessorFilters$1;
150
150
 
151
- export { DefaultNotificationService, notificationService, notificationsProcessingExtensionPoint };
151
+ /**
152
+ * Resolves a relative notification link to an absolute URL using the provided base URL.
153
+ * @public
154
+ */
155
+ declare function resolveNotificationLink(link: string | undefined, baseUrl: string): string | undefined;
156
+
157
+ export { DefaultNotificationService, notificationService, notificationsProcessingExtensionPoint, resolveNotificationLink };
152
158
  export type { NotificationProcessor, NotificationProcessorFilters, NotificationRecipientResolver, NotificationRecipients, NotificationSendOptions, NotificationService, NotificationServiceOptions, NotificationsProcessingExtensionPoint };
@@ -0,0 +1,18 @@
1
+ 'use strict';
2
+
3
+ function resolveNotificationLink(link, baseUrl) {
4
+ if (!link) return void 0;
5
+ const stripLeadingSlash = (s) => s.replace(/^\/+/, "");
6
+ const ensureTrailingSlash = (s) => s.replace(/\/?$/, "/");
7
+ try {
8
+ return new URL(
9
+ stripLeadingSlash(link),
10
+ ensureTrailingSlash(baseUrl)
11
+ ).toString();
12
+ } catch {
13
+ return link;
14
+ }
15
+ }
16
+
17
+ exports.resolveNotificationLink = resolveNotificationLink;
18
+ //# sourceMappingURL=utils.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.cjs.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2026 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\n/**\n * Resolves a relative notification link to an absolute URL using the provided base URL.\n * @public\n */\nexport function resolveNotificationLink(\n link: string | undefined,\n baseUrl: string,\n): string | undefined {\n if (!link) return undefined;\n const stripLeadingSlash = (s: string) => s.replace(/^\\/+/, '');\n const ensureTrailingSlash = (s: string) => s.replace(/\\/?$/, '/');\n try {\n return new URL(\n stripLeadingSlash(link),\n ensureTrailingSlash(baseUrl),\n ).toString();\n } catch {\n return link;\n }\n}\n"],"names":[],"mappings":";;AAoBO,SAAS,uBAAA,CACd,MACA,OAAA,EACoB;AACpB,EAAA,IAAI,CAAC,MAAM,OAAO,MAAA;AAClB,EAAA,MAAM,oBAAoB,CAAC,CAAA,KAAc,CAAA,CAAE,OAAA,CAAQ,QAAQ,EAAE,CAAA;AAC7D,EAAA,MAAM,sBAAsB,CAAC,CAAA,KAAc,CAAA,CAAE,OAAA,CAAQ,QAAQ,GAAG,CAAA;AAChE,EAAA,IAAI;AACF,IAAA,OAAO,IAAI,GAAA;AAAA,MACT,kBAAkB,IAAI,CAAA;AAAA,MACtB,oBAAoB,OAAO;AAAA,MAC3B,QAAA,EAAS;AAAA,EACb,CAAA,CAAA,MAAQ;AACN,IAAA,OAAO,IAAA;AAAA,EACT;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-notifications-node",
3
- "version": "0.2.30-next.0",
3
+ "version": "0.2.30-next.1",
4
4
  "description": "Node.js library for the notifications plugin",
5
5
  "backstage": {
6
6
  "role": "node-library",
@@ -37,13 +37,13 @@
37
37
  "test": "backstage-cli package test"
38
38
  },
39
39
  "dependencies": {
40
- "@backstage/backend-plugin-api": "1.10.1-next.0",
41
- "@backstage/plugin-notifications-common": "0.2.3"
40
+ "@backstage/backend-plugin-api": "1.10.1-next.1",
41
+ "@backstage/plugin-notifications-common": "0.2.4-next.0"
42
42
  },
43
43
  "devDependencies": {
44
- "@backstage/backend-test-utils": "1.11.7-next.0",
45
- "@backstage/cli": "0.36.6-next.0",
46
- "@backstage/test-utils": "1.7.22-next.1",
44
+ "@backstage/backend-test-utils": "1.11.7-next.1",
45
+ "@backstage/cli": "0.36.6-next.1",
46
+ "@backstage/test-utils": "1.7.22-next.2",
47
47
  "msw": "^2.0.0"
48
48
  },
49
49
  "typesVersions": {