@backstage/plugin-events-backend-module-gerrit 0.2.0-next.2 → 0.2.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,92 @@
1
1
  # @backstage/plugin-events-backend-module-gerrit
2
2
 
3
+ ## 0.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-events-node@0.3.1
9
+ - @backstage/backend-plugin-api@0.6.15
10
+
11
+ ## 0.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - eff3ca9: BREAKING CHANGE: Migrate `EventRouter` implementations from `EventBroker` to `EventsService`.
16
+
17
+ `EventRouter` uses the new `EventsService` instead of the `EventBroker` now,
18
+ causing a breaking change to its signature.
19
+
20
+ All of its extensions and implementations got adjusted accordingly.
21
+ (`SubTopicEventRouter`, `AzureDevOpsEventRouter`, `BitbucketCloudEventRouter`,
22
+ `GerritEventRouter`, `GithubEventRouter`, `GitlabEventRouter`)
23
+
24
+ Required adjustments were made to all backend modules for the new backend system,
25
+ now also making use of the `eventsServiceRef` instead of the `eventsExtensionPoint`.
26
+
27
+ **Migration:**
28
+
29
+ Example for implementations of `SubTopicEventRouter`:
30
+
31
+ ```diff
32
+ import {
33
+ EventParams,
34
+ + EventsService,
35
+ SubTopicEventRouter,
36
+ } from '@backstage/plugin-events-node';
37
+
38
+ export class GithubEventRouter extends SubTopicEventRouter {
39
+ - constructor() {
40
+ - super('github');
41
+ + constructor(options: { events: EventsService }) {
42
+ + super({
43
+ + events: options.events,
44
+ + topic: 'github',
45
+ + });
46
+ }
47
+
48
+ + protected getSubscriberId(): string {
49
+ + return 'GithubEventRouter';
50
+ + }
51
+ +
52
+ // ...
53
+ }
54
+ ```
55
+
56
+ Example for a direct extension of `EventRouter`:
57
+
58
+ ```diff
59
+ class MyEventRouter extends EventRouter {
60
+ - constructor(/* ... */) {
61
+ + constructor(options: {
62
+ + events: EventsService;
63
+ + // ...
64
+ + }) {
65
+ - super();
66
+ // ...
67
+ + super({
68
+ + events: options.events,
69
+ + topics: topics,
70
+ + });
71
+ }
72
+ +
73
+ + protected getSubscriberId(): string {
74
+ + return 'MyEventRouter';
75
+ + }
76
+ -
77
+ - supportsEventTopics(): string[] {
78
+ - return this.topics;
79
+ - }
80
+ }
81
+ ```
82
+
83
+ ### Patch Changes
84
+
85
+ - 2bd1410: Removed unused dependencies
86
+ - Updated dependencies
87
+ - @backstage/plugin-events-node@0.3.0
88
+ - @backstage/backend-plugin-api@0.6.14
89
+
3
90
  ## 0.2.0-next.2
4
91
 
5
92
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-backend-module-gerrit",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.1",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/dist/alpha.cjs.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var backendPluginApi = require('@backstage/backend-plugin-api');
6
6
  var pluginEventsNode = require('@backstage/plugin-events-node');
7
- var GerritEventRouter = require('./cjs/GerritEventRouter-076aa57d.cjs.js');
7
+ var GerritEventRouter = require('./cjs/GerritEventRouter-c3WlLA-X.cjs.js');
8
8
 
9
9
  const eventsModuleGerritEventRouter = backendPluginApi.createBackendModule({
10
10
  pluginId: "events",
@@ -22,6 +22,6 @@ const eventsModuleGerritEventRouter = backendPluginApi.createBackendModule({
22
22
  }
23
23
  });
24
24
 
25
- exports["default"] = eventsModuleGerritEventRouter;
25
+ exports.default = eventsModuleGerritEventRouter;
26
26
  exports.eventsModuleGerritEventRouter = eventsModuleGerritEventRouter;
27
27
  //# sourceMappingURL=alpha.cjs.js.map
@@ -22,4 +22,4 @@ class GerritEventRouter extends pluginEventsNode.SubTopicEventRouter {
22
22
  }
23
23
 
24
24
  exports.GerritEventRouter = GerritEventRouter;
25
- //# sourceMappingURL=GerritEventRouter-076aa57d.cjs.js.map
25
+ //# sourceMappingURL=GerritEventRouter-c3WlLA-X.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"GerritEventRouter-076aa57d.cjs.js","sources":["../../src/router/GerritEventRouter.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n EventParams,\n EventsService,\n SubTopicEventRouter,\n} from '@backstage/plugin-events-node';\n\n/**\n * Subscribes to the generic `gerrit` topic\n * and publishes the events under the more concrete sub-topic\n * depending on the `$.type` field provided.\n *\n * @public\n */\nexport class GerritEventRouter extends SubTopicEventRouter {\n constructor(options: { events: EventsService }) {\n super({\n events: options.events,\n topic: 'gerrit',\n });\n }\n\n protected getSubscriberId(): string {\n return 'GerritEventRouter';\n }\n\n protected determineSubTopic(params: EventParams): string | undefined {\n if ('type' in (params.eventPayload as object)) {\n const payload = params.eventPayload as { type: string };\n return payload.type;\n }\n\n return undefined;\n }\n}\n"],"names":["SubTopicEventRouter"],"mappings":";;;;AA6BO,MAAM,0BAA0BA,oCAAoB,CAAA;AAAA,EACzD,YAAY,OAAoC,EAAA;AAC9C,IAAM,KAAA,CAAA;AAAA,MACJ,QAAQ,OAAQ,CAAA,MAAA;AAAA,MAChB,KAAO,EAAA,QAAA;AAAA,KACR,CAAA,CAAA;AAAA,GACH;AAAA,EAEU,eAA0B,GAAA;AAClC,IAAO,OAAA,mBAAA,CAAA;AAAA,GACT;AAAA,EAEU,kBAAkB,MAAyC,EAAA;AACnE,IAAI,IAAA,MAAA,IAAW,OAAO,YAAyB,EAAA;AAC7C,MAAA,MAAM,UAAU,MAAO,CAAA,YAAA,CAAA;AACvB,MAAA,OAAO,OAAQ,CAAA,IAAA,CAAA;AAAA,KACjB;AAEA,IAAO,OAAA,KAAA,CAAA,CAAA;AAAA,GACT;AACF;;;;"}
1
+ {"version":3,"file":"GerritEventRouter-c3WlLA-X.cjs.js","sources":["../../src/router/GerritEventRouter.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n EventParams,\n EventsService,\n SubTopicEventRouter,\n} from '@backstage/plugin-events-node';\n\n/**\n * Subscribes to the generic `gerrit` topic\n * and publishes the events under the more concrete sub-topic\n * depending on the `$.type` field provided.\n *\n * @public\n */\nexport class GerritEventRouter extends SubTopicEventRouter {\n constructor(options: { events: EventsService }) {\n super({\n events: options.events,\n topic: 'gerrit',\n });\n }\n\n protected getSubscriberId(): string {\n return 'GerritEventRouter';\n }\n\n protected determineSubTopic(params: EventParams): string | undefined {\n if ('type' in (params.eventPayload as object)) {\n const payload = params.eventPayload as { type: string };\n return payload.type;\n }\n\n return undefined;\n }\n}\n"],"names":["SubTopicEventRouter"],"mappings":";;;;AA6BO,MAAM,0BAA0BA,oCAAoB,CAAA;AAAA,EACzD,YAAY,OAAoC,EAAA;AAC9C,IAAM,KAAA,CAAA;AAAA,MACJ,QAAQ,OAAQ,CAAA,MAAA;AAAA,MAChB,KAAO,EAAA,QAAA;AAAA,KACR,CAAA,CAAA;AAAA,GACH;AAAA,EAEU,eAA0B,GAAA;AAClC,IAAO,OAAA,mBAAA,CAAA;AAAA,GACT;AAAA,EAEU,kBAAkB,MAAyC,EAAA;AACnE,IAAI,IAAA,MAAA,IAAW,OAAO,YAAyB,EAAA;AAC7C,MAAA,MAAM,UAAU,MAAO,CAAA,YAAA,CAAA;AACvB,MAAA,OAAO,OAAQ,CAAA,IAAA,CAAA;AAAA,KACjB;AAEA,IAAO,OAAA,KAAA,CAAA,CAAA;AAAA,GACT;AACF;;;;"}
package/dist/index.cjs.js CHANGED
@@ -1,8 +1,6 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var GerritEventRouter = require('./cjs/GerritEventRouter-076aa57d.cjs.js');
3
+ var GerritEventRouter = require('./cjs/GerritEventRouter-c3WlLA-X.cjs.js');
6
4
  require('@backstage/plugin-events-node');
7
5
 
8
6
 
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-backend-module-gerrit",
3
- "version": "0.2.0-next.2",
3
+ "version": "0.2.1",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -39,13 +39,13 @@
39
39
  "postpack": "backstage-cli package postpack"
40
40
  },
41
41
  "dependencies": {
42
- "@backstage/backend-plugin-api": "^0.6.14-next.2",
43
- "@backstage/plugin-events-node": "^0.3.0-next.2"
42
+ "@backstage/backend-plugin-api": "^0.6.15",
43
+ "@backstage/plugin-events-node": "^0.3.1"
44
44
  },
45
45
  "devDependencies": {
46
- "@backstage/backend-test-utils": "^0.3.4-next.2",
47
- "@backstage/cli": "^0.25.3-next.2",
48
- "@backstage/plugin-events-backend-test-utils": "^0.1.24-next.2"
46
+ "@backstage/backend-test-utils": "^0.3.5",
47
+ "@backstage/cli": "^0.26.1",
48
+ "@backstage/plugin-events-backend-test-utils": "^0.1.25"
49
49
  },
50
50
  "files": [
51
51
  "dist",