@backstage/plugin-signals-node 0.1.0-next.2 → 0.1.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,30 @@
1
1
  # @backstage/plugin-signals-node
2
2
 
3
+ ## 0.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 6c1547a: **BREAKING** Type definition added to signal recipients
8
+
9
+ Update to use `{type: 'broadcast'}` instead `null` and `{type: 'user', entityRef: ''}`
10
+ instead string entity references
11
+
12
+ - daf85dc: BREAKING CHANGE: Migrates signals to use the `EventsService` and makes it mandatory
13
+
14
+ ### Patch Changes
15
+
16
+ - 6d84ee6: Renamed `SignalService` to `SignalsService` and `signalService` to `signalServiceRef`
17
+ to follow the naming scheme of services and their references
18
+ - 0fb419b: Updated dependency `uuid` to `^9.0.0`.
19
+ Updated dependency `@types/uuid` to `^9.0.0`.
20
+ - Updated dependencies
21
+ - @backstage/plugin-events-node@0.3.0
22
+ - @backstage/backend-common@0.21.4
23
+ - @backstage/plugin-auth-node@0.4.9
24
+ - @backstage/config@1.2.0
25
+ - @backstage/backend-plugin-api@0.6.14
26
+ - @backstage/types@1.1.1
27
+
3
28
  ## 0.1.0-next.2
4
29
 
5
30
  ### Patch Changes
package/README.md CHANGED
@@ -91,13 +91,13 @@ To allow connections from the frontend, you should also install the `@backstage/
91
91
 
92
92
  Once you have both of the backend plugins installed, you can utilize the signal service by calling the
93
93
  `publish` method. This will publish the message to all subscribers in the frontend. To send message to
94
- all subscribers, you can use `null` as `recipients` parameter.
94
+ all subscribers, you can use `broadcast` type:
95
95
 
96
96
  ```ts
97
97
  // Periodic sending example
98
98
  setInterval(async () => {
99
99
  await signals.publish({
100
- recipients: null,
100
+ recipients: { type: 'broadcast' },
101
101
  channel: 'my_plugin',
102
102
  message: {
103
103
  message: 'hello world',
@@ -118,7 +118,7 @@ to work:
118
118
  eventBroker.publish({
119
119
  topic: 'signals',
120
120
  eventPayload: {
121
- recipients: ['user:default/user1'],
121
+ recipients: { type: 'user', entityRef: 'user:default/user1' },
122
122
  message: {
123
123
  message: 'hello world',
124
124
  },
package/dist/index.d.ts CHANGED
@@ -10,7 +10,12 @@ type SignalsServiceOptions = {
10
10
  };
11
11
  /** @public */
12
12
  type SignalPayload<TMessage extends JsonObject = JsonObject> = {
13
- recipients: string[] | string | null;
13
+ recipients: {
14
+ type: 'user';
15
+ entityRef: string | string[];
16
+ } | {
17
+ type: 'broadcast';
18
+ };
14
19
  channel: string;
15
20
  message: TMessage;
16
21
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-signals-node",
3
3
  "description": "Node.js library for the signals plugin",
4
- "version": "0.1.0-next.2",
4
+ "version": "0.1.0",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -27,18 +27,18 @@
27
27
  "postpack": "backstage-cli package postpack"
28
28
  },
29
29
  "devDependencies": {
30
- "@backstage/cli": "^0.25.3-next.2",
30
+ "@backstage/cli": "^0.26.0",
31
31
  "@types/express": "^4.17.21"
32
32
  },
33
33
  "files": [
34
34
  "dist"
35
35
  ],
36
36
  "dependencies": {
37
- "@backstage/backend-common": "^0.21.4-next.2",
38
- "@backstage/backend-plugin-api": "^0.6.14-next.2",
39
- "@backstage/config": "^1.2.0-next.1",
40
- "@backstage/plugin-auth-node": "^0.4.9-next.2",
41
- "@backstage/plugin-events-node": "^0.3.0-next.2",
37
+ "@backstage/backend-common": "^0.21.4",
38
+ "@backstage/backend-plugin-api": "^0.6.14",
39
+ "@backstage/config": "^1.2.0",
40
+ "@backstage/plugin-auth-node": "^0.4.9",
41
+ "@backstage/plugin-events-node": "^0.3.0",
42
42
  "@backstage/types": "^1.1.1",
43
43
  "express": "^4.17.1",
44
44
  "uuid": "^9.0.0",