@backstage/plugin-signals-node 0.0.1-next.0 → 0.0.1-next.2
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 +25 -0
- package/dist/index.cjs.js +1 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @backstage/plugin-signals-node
|
|
2
2
|
|
|
3
|
+
## 0.0.1-next.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 447d210: Fix disconnect loop on server start
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-common@0.21.0-next.2
|
|
10
|
+
- @backstage/backend-plugin-api@0.6.10-next.2
|
|
11
|
+
- @backstage/plugin-auth-node@0.4.4-next.2
|
|
12
|
+
- @backstage/plugin-events-node@0.2.19-next.2
|
|
13
|
+
- @backstage/config@1.1.1
|
|
14
|
+
- @backstage/types@1.1.1
|
|
15
|
+
|
|
16
|
+
## 0.0.1-next.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @backstage/backend-plugin-api@0.6.10-next.1
|
|
22
|
+
- @backstage/backend-common@0.21.0-next.1
|
|
23
|
+
- @backstage/config@1.1.1
|
|
24
|
+
- @backstage/types@1.1.1
|
|
25
|
+
- @backstage/plugin-auth-node@0.4.4-next.1
|
|
26
|
+
- @backstage/plugin-events-node@0.2.19-next.1
|
|
27
|
+
|
|
3
28
|
## 0.0.1-next.0
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/dist/index.cjs.js
CHANGED
|
@@ -27,14 +27,9 @@ class DefaultSignalService {
|
|
|
27
27
|
*/
|
|
28
28
|
async publish(signal) {
|
|
29
29
|
var _a;
|
|
30
|
-
const { recipients, channel, message } = signal;
|
|
31
30
|
await ((_a = this.eventBroker) == null ? void 0 : _a.publish({
|
|
32
31
|
topic: "signals",
|
|
33
|
-
eventPayload:
|
|
34
|
-
recipients,
|
|
35
|
-
message,
|
|
36
|
-
channel
|
|
37
|
-
}
|
|
32
|
+
eventPayload: signal
|
|
38
33
|
}));
|
|
39
34
|
}
|
|
40
35
|
}
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/DefaultSignalService.ts","../src/lib.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 */\nimport { EventBroker } from '@backstage/plugin-events-node';\nimport { SignalPayload, SignalServiceOptions } from './types';\nimport { SignalService } from './SignalService';\n\n/** @public */\nexport class DefaultSignalService implements SignalService {\n // TODO: Remove this to be optional when events-backend has eventBroker as service\n private eventBroker?: EventBroker;\n\n static create(options: SignalServiceOptions) {\n return new DefaultSignalService(options);\n }\n\n private constructor(options: SignalServiceOptions) {\n ({ eventBroker: this.eventBroker } = options);\n }\n\n /**\n * Publishes a message to user refs to specific topic\n * @param recipients - string or array of user ref strings to publish message to\n * @param topic - message topic\n * @param message - message to publish\n */\n async publish(signal: SignalPayload) {\n
|
|
1
|
+
{"version":3,"file":"index.cjs.js","sources":["../src/DefaultSignalService.ts","../src/lib.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 */\nimport { EventBroker } from '@backstage/plugin-events-node';\nimport { SignalPayload, SignalServiceOptions } from './types';\nimport { SignalService } from './SignalService';\n\n/** @public */\nexport class DefaultSignalService implements SignalService {\n // TODO: Remove this to be optional when events-backend has eventBroker as service\n private eventBroker?: EventBroker;\n\n static create(options: SignalServiceOptions) {\n return new DefaultSignalService(options);\n }\n\n private constructor(options: SignalServiceOptions) {\n ({ eventBroker: this.eventBroker } = options);\n }\n\n /**\n * Publishes a message to user refs to specific topic\n * @param recipients - string or array of user ref strings to publish message to\n * @param topic - message topic\n * @param message - message to publish\n */\n async publish(signal: SignalPayload) {\n await this.eventBroker?.publish({\n topic: 'signals',\n eventPayload: signal,\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 createServiceFactory,\n createServiceRef,\n} from '@backstage/backend-plugin-api';\nimport { DefaultSignalService } from './DefaultSignalService';\nimport { SignalService } from './SignalService';\n\n/** @public */\nexport const signalService = createServiceRef<SignalService>({\n id: 'signals.service',\n scope: 'plugin',\n defaultFactory: async service =>\n createServiceFactory({\n service,\n deps: {\n // TODO: EventBroker. It is optional for now but it's actually required so waiting for the new backend system\n // for the events-backend for this to work.\n },\n factory({}) {\n return DefaultSignalService.create({});\n },\n }),\n});\n"],"names":["createServiceRef","createServiceFactory"],"mappings":";;;;;;;;;;;;AAoBO,MAAM,oBAA8C,CAAA;AAAA,EAQjD,YAAY,OAA+B,EAAA;AANnD;AAAA,IAAQ,aAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AAON,IAAA,CAAC,EAAE,WAAA,EAAa,IAAK,CAAA,WAAA,EAAgB,GAAA,OAAA,EAAA;AAAA,GACvC;AAAA,EANA,OAAO,OAAO,OAA+B,EAAA;AAC3C,IAAO,OAAA,IAAI,qBAAqB,OAAO,CAAA,CAAA;AAAA,GACzC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAYA,MAAM,QAAQ,MAAuB,EAAA;AAtCvC,IAAA,IAAA,EAAA,CAAA;AAuCI,IAAM,OAAA,CAAA,EAAA,GAAA,IAAA,CAAK,WAAL,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAkB,OAAQ,CAAA;AAAA,MAC9B,KAAO,EAAA,SAAA;AAAA,MACP,YAAc,EAAA,MAAA;AAAA,KAChB,CAAA,CAAA,CAAA;AAAA,GACF;AACF;;ACrBO,MAAM,gBAAgBA,iCAAgC,CAAA;AAAA,EAC3D,EAAI,EAAA,iBAAA;AAAA,EACJ,KAAO,EAAA,QAAA;AAAA,EACP,cAAA,EAAgB,OAAM,OAAA,KACpBC,qCAAqB,CAAA;AAAA,IACnB,OAAA;AAAA,IACA,IAAM,EAAA;AAAA;AAAA;AAAA,KAGN;AAAA,IACA,OAAA,CAAQ,EAAI,EAAA;AACV,MAAO,OAAA,oBAAA,CAAqB,MAAO,CAAA,EAAE,CAAA,CAAA;AAAA,KACvC;AAAA,GACD,CAAA;AACL,CAAC;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -10,18 +10,18 @@ type SignalServiceOptions = {
|
|
|
10
10
|
};
|
|
11
11
|
/** @public */
|
|
12
12
|
type SignalPayload = {
|
|
13
|
-
recipients: string[] | null;
|
|
13
|
+
recipients: string[] | string | null;
|
|
14
14
|
channel: string;
|
|
15
15
|
message: JsonObject;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/** @public */
|
|
19
|
-
|
|
19
|
+
interface SignalService {
|
|
20
20
|
/**
|
|
21
21
|
* Publishes a message to user refs to specific topic
|
|
22
22
|
*/
|
|
23
23
|
publish(signal: SignalPayload): Promise<void>;
|
|
24
|
-
}
|
|
24
|
+
}
|
|
25
25
|
|
|
26
26
|
/** @public */
|
|
27
27
|
declare const signalService: _backstage_backend_plugin_api.ServiceRef<SignalService, "plugin">;
|
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.0.1-next.
|
|
4
|
+
"version": "0.0.1-next.2",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -22,18 +22,18 @@
|
|
|
22
22
|
"postpack": "backstage-cli package postpack"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"@backstage/cli": "^0.25.2-next.
|
|
25
|
+
"@backstage/cli": "^0.25.2-next.2",
|
|
26
26
|
"@types/express": "^4.17.21"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@backstage/backend-common": "^0.21.0-next.
|
|
33
|
-
"@backstage/backend-plugin-api": "^0.6.10-next.
|
|
32
|
+
"@backstage/backend-common": "^0.21.0-next.2",
|
|
33
|
+
"@backstage/backend-plugin-api": "^0.6.10-next.2",
|
|
34
34
|
"@backstage/config": "^1.1.1",
|
|
35
|
-
"@backstage/plugin-auth-node": "^0.4.4-next.
|
|
36
|
-
"@backstage/plugin-events-node": "^0.2.19-next.
|
|
35
|
+
"@backstage/plugin-auth-node": "^0.4.4-next.2",
|
|
36
|
+
"@backstage/plugin-events-node": "^0.2.19-next.2",
|
|
37
37
|
"@backstage/types": "^1.1.1",
|
|
38
38
|
"express": "^4.17.1",
|
|
39
39
|
"uuid": "^8.0.0",
|