@backstage/plugin-events-backend-module-gerrit 0.1.4 → 0.1.5-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 +17 -0
- package/alpha/package.json +3 -3
- package/dist/alpha.cjs.js +40 -0
- package/dist/alpha.cjs.js.map +1 -0
- package/dist/alpha.d.ts +12 -0
- package/dist/index.cjs.js +0 -19
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +3 -14
- package/package.json +25 -15
- package/dist/index.alpha.d.ts +0 -33
- package/dist/index.beta.d.ts +0 -26
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage/plugin-events-backend-module-gerrit
|
|
2
2
|
|
|
3
|
+
## 0.1.5-next.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
- @backstage/backend-plugin-api@0.4.1-next.1
|
|
9
|
+
- @backstage/plugin-events-node@0.2.4-next.1
|
|
10
|
+
|
|
11
|
+
## 0.1.5-next.0
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 928a12a9b3: Internal refactor of `/alpha` exports.
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
- @backstage/backend-plugin-api@0.4.1-next.0
|
|
18
|
+
- @backstage/plugin-events-node@0.2.4-next.0
|
|
19
|
+
|
|
3
20
|
## 0.1.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/alpha/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
6
|
+
var alpha = require('@backstage/plugin-events-node/alpha');
|
|
7
|
+
var pluginEventsNode = require('@backstage/plugin-events-node');
|
|
8
|
+
|
|
9
|
+
class GerritEventRouter extends pluginEventsNode.SubTopicEventRouter {
|
|
10
|
+
constructor() {
|
|
11
|
+
super("gerrit");
|
|
12
|
+
}
|
|
13
|
+
determineSubTopic(params) {
|
|
14
|
+
if ("type" in params.eventPayload) {
|
|
15
|
+
const payload = params.eventPayload;
|
|
16
|
+
return payload.type;
|
|
17
|
+
}
|
|
18
|
+
return void 0;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const gerritEventRouterEventsModule = backendPluginApi.createBackendModule({
|
|
23
|
+
pluginId: "events",
|
|
24
|
+
moduleId: "gerritEventRouter",
|
|
25
|
+
register(env) {
|
|
26
|
+
env.registerInit({
|
|
27
|
+
deps: {
|
|
28
|
+
events: alpha.eventsExtensionPoint
|
|
29
|
+
},
|
|
30
|
+
async init({ events }) {
|
|
31
|
+
const eventRouter = new GerritEventRouter();
|
|
32
|
+
events.addPublishers(eventRouter);
|
|
33
|
+
events.addSubscribers(eventRouter);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
exports.gerritEventRouterEventsModule = gerritEventRouterEventsModule;
|
|
40
|
+
//# sourceMappingURL=alpha.cjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alpha.cjs.js","sources":["../src/router/GerritEventRouter.ts","../src/service/GerritEventRouterEventsModule.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 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() {\n super('gerrit');\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","/*\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 { createBackendModule } from '@backstage/backend-plugin-api';\nimport { eventsExtensionPoint } from '@backstage/plugin-events-node/alpha';\nimport { GerritEventRouter } from '../router/GerritEventRouter';\n\n/**\n * Module for the events-backend plugin, adding an event router for Gerrit.\n *\n * Registers the `GerritEventRouter`.\n *\n * @alpha\n */\nexport const gerritEventRouterEventsModule = createBackendModule({\n pluginId: 'events',\n moduleId: 'gerritEventRouter',\n register(env) {\n env.registerInit({\n deps: {\n events: eventsExtensionPoint,\n },\n async init({ events }) {\n const eventRouter = new GerritEventRouter();\n\n events.addPublishers(eventRouter);\n events.addSubscribers(eventRouter);\n },\n });\n },\n});\n"],"names":["SubTopicEventRouter","createBackendModule","eventsExtensionPoint"],"mappings":";;;;;;;;AA4BO,MAAM,0BAA0BA,oCAAoB,CAAA;AAAA,EACzD,WAAc,GAAA;AACZ,IAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAAA,GAChB;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;;ACdO,MAAM,gCAAgCC,oCAAoB,CAAA;AAAA,EAC/D,QAAU,EAAA,QAAA;AAAA,EACV,QAAU,EAAA,mBAAA;AAAA,EACV,SAAS,GAAK,EAAA;AACZ,IAAA,GAAA,CAAI,YAAa,CAAA;AAAA,MACf,IAAM,EAAA;AAAA,QACJ,MAAQ,EAAAC,0BAAA;AAAA,OACV;AAAA,MACA,MAAM,IAAA,CAAK,EAAE,MAAA,EAAU,EAAA;AACrB,QAAM,MAAA,WAAA,GAAc,IAAI,iBAAkB,EAAA,CAAA;AAE1C,QAAA,MAAA,CAAO,cAAc,WAAW,CAAA,CAAA;AAChC,QAAA,MAAA,CAAO,eAAe,WAAW,CAAA,CAAA;AAAA,OACnC;AAAA,KACD,CAAA,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
|
package/dist/alpha.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Module for the events-backend plugin, adding an event router for Gerrit.
|
|
5
|
+
*
|
|
6
|
+
* Registers the `GerritEventRouter`.
|
|
7
|
+
*
|
|
8
|
+
* @alpha
|
|
9
|
+
*/
|
|
10
|
+
declare const gerritEventRouterEventsModule: () => _backstage_backend_plugin_api.BackendFeature;
|
|
11
|
+
|
|
12
|
+
export { gerritEventRouterEventsModule };
|
package/dist/index.cjs.js
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var pluginEventsNode = require('@backstage/plugin-events-node');
|
|
6
|
-
var backendPluginApi = require('@backstage/backend-plugin-api');
|
|
7
6
|
|
|
8
7
|
class GerritEventRouter extends pluginEventsNode.SubTopicEventRouter {
|
|
9
8
|
constructor() {
|
|
@@ -18,23 +17,5 @@ class GerritEventRouter extends pluginEventsNode.SubTopicEventRouter {
|
|
|
18
17
|
}
|
|
19
18
|
}
|
|
20
19
|
|
|
21
|
-
const gerritEventRouterEventsModule = backendPluginApi.createBackendModule({
|
|
22
|
-
pluginId: "events",
|
|
23
|
-
moduleId: "gerritEventRouter",
|
|
24
|
-
register(env) {
|
|
25
|
-
env.registerInit({
|
|
26
|
-
deps: {
|
|
27
|
-
events: pluginEventsNode.eventsExtensionPoint
|
|
28
|
-
},
|
|
29
|
-
async init({ events }) {
|
|
30
|
-
const eventRouter = new GerritEventRouter();
|
|
31
|
-
events.addPublishers(eventRouter);
|
|
32
|
-
events.addSubscribers(eventRouter);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
20
|
exports.GerritEventRouter = GerritEventRouter;
|
|
39
|
-
exports.gerritEventRouterEventsModule = gerritEventRouterEventsModule;
|
|
40
21
|
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs.js","sources":["../src/router/GerritEventRouter.ts"
|
|
1
|
+
{"version":3,"file":"index.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 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() {\n super('gerrit');\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":";;;;;;AA4BO,MAAM,0BAA0BA,oCAAoB,CAAA;AAAA,EACzD,WAAc,GAAA;AACZ,IAAA,KAAA,CAAM,QAAQ,CAAA,CAAA;AAAA,GAChB;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.d.ts
CHANGED
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* The module `gerrit` for the Backstage backend plugin "events-backend"
|
|
3
|
-
* adding an event router for Gerrit.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { BackendFeature } from '@backstage/backend-plugin-api';
|
|
9
|
-
import { EventParams } from '@backstage/plugin-events-node';
|
|
10
|
-
import { SubTopicEventRouter } from '@backstage/plugin-events-node';
|
|
1
|
+
import { SubTopicEventRouter, EventParams } from '@backstage/plugin-events-node';
|
|
11
2
|
|
|
12
3
|
/**
|
|
13
4
|
* Subscribes to the generic `gerrit` topic
|
|
@@ -16,11 +7,9 @@ import { SubTopicEventRouter } from '@backstage/plugin-events-node';
|
|
|
16
7
|
*
|
|
17
8
|
* @public
|
|
18
9
|
*/
|
|
19
|
-
|
|
10
|
+
declare class GerritEventRouter extends SubTopicEventRouter {
|
|
20
11
|
constructor();
|
|
21
12
|
protected determineSubTopic(params: EventParams): string | undefined;
|
|
22
13
|
}
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
export { }
|
|
15
|
+
export { GerritEventRouter };
|
package/package.json
CHANGED
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-events-backend-module-gerrit",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"main": "dist/index.cjs.js",
|
|
5
|
-
"types": "dist/index.d.ts",
|
|
3
|
+
"version": "0.1.5-next.1",
|
|
4
|
+
"main": "./dist/index.cjs.js",
|
|
5
|
+
"types": "./dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"publishConfig": {
|
|
8
|
-
"access": "public"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"require": "./dist/index.cjs.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.cjs.js"
|
|
15
|
+
},
|
|
16
|
+
"./alpha": {
|
|
17
|
+
"require": "./dist/alpha.cjs.js",
|
|
18
|
+
"types": "./dist/alpha.d.ts",
|
|
19
|
+
"default": "./dist/alpha.cjs.js"
|
|
20
|
+
},
|
|
21
|
+
"./package.json": "./package.json"
|
|
12
22
|
},
|
|
13
23
|
"backstage": {
|
|
14
24
|
"role": "backend-plugin-module"
|
|
15
25
|
},
|
|
16
26
|
"scripts": {
|
|
17
27
|
"start": "backstage-cli package start",
|
|
18
|
-
"build": "backstage-cli package build
|
|
28
|
+
"build": "backstage-cli package build",
|
|
19
29
|
"lint": "backstage-cli package lint",
|
|
20
30
|
"test": "backstage-cli package test",
|
|
21
31
|
"clean": "backstage-cli package clean",
|
|
@@ -23,18 +33,18 @@
|
|
|
23
33
|
"postpack": "backstage-cli package postpack"
|
|
24
34
|
},
|
|
25
35
|
"dependencies": {
|
|
26
|
-
"@backstage/backend-plugin-api": "^0.4.
|
|
27
|
-
"@backstage/plugin-events-node": "^0.2.
|
|
36
|
+
"@backstage/backend-plugin-api": "^0.4.1-next.1",
|
|
37
|
+
"@backstage/plugin-events-node": "^0.2.4-next.1",
|
|
28
38
|
"winston": "^3.2.1"
|
|
29
39
|
},
|
|
30
40
|
"devDependencies": {
|
|
31
|
-
"@backstage/backend-test-utils": "^0.1.
|
|
32
|
-
"@backstage/cli": "^0.22.
|
|
33
|
-
"@backstage/plugin-events-backend-test-utils": "^0.1.
|
|
41
|
+
"@backstage/backend-test-utils": "^0.1.35-next.1",
|
|
42
|
+
"@backstage/cli": "^0.22.4-next.1",
|
|
43
|
+
"@backstage/plugin-events-backend-test-utils": "^0.1.5-next.1",
|
|
34
44
|
"supertest": "^6.1.3"
|
|
35
45
|
},
|
|
36
46
|
"files": [
|
|
37
|
-
"
|
|
38
|
-
"
|
|
47
|
+
"dist",
|
|
48
|
+
"alpha"
|
|
39
49
|
]
|
|
40
50
|
}
|
package/dist/index.alpha.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The module `gerrit` for the Backstage backend plugin "events-backend"
|
|
3
|
-
* adding an event router for Gerrit.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { BackendFeature } from '@backstage/backend-plugin-api';
|
|
9
|
-
import { EventParams } from '@backstage/plugin-events-node';
|
|
10
|
-
import { SubTopicEventRouter } from '@backstage/plugin-events-node';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Subscribes to the generic `gerrit` topic
|
|
14
|
-
* and publishes the events under the more concrete sub-topic
|
|
15
|
-
* depending on the `$.type` field provided.
|
|
16
|
-
*
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare class GerritEventRouter extends SubTopicEventRouter {
|
|
20
|
-
constructor();
|
|
21
|
-
protected determineSubTopic(params: EventParams): string | undefined;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Module for the events-backend plugin, adding an event router for Gerrit.
|
|
26
|
-
*
|
|
27
|
-
* Registers the {@link GerritEventRouter}.
|
|
28
|
-
*
|
|
29
|
-
* @alpha
|
|
30
|
-
*/
|
|
31
|
-
export declare const gerritEventRouterEventsModule: () => BackendFeature;
|
|
32
|
-
|
|
33
|
-
export { }
|
package/dist/index.beta.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The module `gerrit` for the Backstage backend plugin "events-backend"
|
|
3
|
-
* adding an event router for Gerrit.
|
|
4
|
-
*
|
|
5
|
-
* @packageDocumentation
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { BackendFeature } from '@backstage/backend-plugin-api';
|
|
9
|
-
import { EventParams } from '@backstage/plugin-events-node';
|
|
10
|
-
import { SubTopicEventRouter } from '@backstage/plugin-events-node';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Subscribes to the generic `gerrit` topic
|
|
14
|
-
* and publishes the events under the more concrete sub-topic
|
|
15
|
-
* depending on the `$.type` field provided.
|
|
16
|
-
*
|
|
17
|
-
* @public
|
|
18
|
-
*/
|
|
19
|
-
export declare class GerritEventRouter extends SubTopicEventRouter {
|
|
20
|
-
constructor();
|
|
21
|
-
protected determineSubTopic(params: EventParams): string | undefined;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/* Excluded from this release type: gerritEventRouterEventsModule */
|
|
25
|
-
|
|
26
|
-
export { }
|