@backstage/plugin-events-backend-test-utils 0.1.8 → 0.1.9

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,19 @@
1
1
  # @backstage/plugin-events-backend-test-utils
2
2
 
3
+ ## 0.1.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/plugin-events-node@0.2.8
9
+
10
+ ## 0.1.9-next.0
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @backstage/plugin-events-node@0.2.8-next.0
16
+
3
17
  ## 0.1.8
4
18
 
5
19
  ### Patch Changes
package/dist/index.cjs.js CHANGED
@@ -2,10 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
+ var __defProp$1 = Object.defineProperty;
6
+ var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
7
+ var __publicField$1 = (obj, key, value) => {
8
+ __defNormalProp$1(obj, typeof key !== "symbol" ? key + "" : key, value);
9
+ return value;
10
+ };
5
11
  class TestEventBroker {
6
12
  constructor() {
7
- this.published = [];
8
- this.subscribed = [];
13
+ __publicField$1(this, "published", []);
14
+ __publicField$1(this, "subscribed", []);
9
15
  }
10
16
  async publish(params) {
11
17
  this.published.push(params);
@@ -47,9 +53,17 @@ class TestEventPublisher {
47
53
  }
48
54
  _eventBroker = new WeakMap();
49
55
 
56
+ var __defProp = Object.defineProperty;
57
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
58
+ var __publicField = (obj, key, value) => {
59
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
60
+ return value;
61
+ };
50
62
  class TestEventSubscriber {
51
63
  constructor(name, topics) {
52
- this.receivedEvents = {};
64
+ __publicField(this, "name");
65
+ __publicField(this, "topics");
66
+ __publicField(this, "receivedEvents", {});
53
67
  this.name = name;
54
68
  this.topics = topics;
55
69
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/testUtils/TestEventBroker.ts","../src/testUtils/TestEventPublisher.ts","../src/testUtils/TestEventSubscriber.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 EventBroker,\n EventParams,\n EventSubscriber,\n} from '@backstage/plugin-events-node';\n\n/** @public */\nexport class TestEventBroker implements EventBroker {\n readonly published: EventParams[] = [];\n readonly subscribed: EventSubscriber[] = [];\n\n async publish(params: EventParams): Promise<void> {\n this.published.push(params);\n }\n\n subscribe(\n ...subscribers: Array<EventSubscriber | Array<EventSubscriber>>\n ): void {\n this.subscribed.push(...subscribers.flat());\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 { EventBroker, EventPublisher } from '@backstage/plugin-events-node';\n\n/** @public */\nexport class TestEventPublisher implements EventPublisher {\n #eventBroker?: EventBroker;\n\n async setEventBroker(eventBroker: EventBroker): Promise<void> {\n this.#eventBroker = eventBroker;\n }\n\n get eventBroker() {\n return this.#eventBroker;\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 { EventParams, EventSubscriber } from '@backstage/plugin-events-node';\n\n/** @public */\nexport class TestEventSubscriber implements EventSubscriber {\n readonly name: string;\n readonly topics: string[];\n\n readonly receivedEvents: Record<string, EventParams[]> = {};\n\n constructor(name: string, topics: string[]) {\n this.name = name;\n this.topics = topics;\n }\n\n supportsEventTopics(): string[] {\n return this.topics;\n }\n\n async onEvent(params: EventParams): Promise<void> {\n this.receivedEvents[params.topic] = this.receivedEvents[params.topic] ?? [];\n this.receivedEvents[params.topic].push(params);\n }\n}\n"],"names":[],"mappings":";;;;AAuBO,MAAM,eAAuC,CAAA;AAAA,EAA7C,WAAA,GAAA;AACL,IAAA,IAAA,CAAS,YAA2B,EAAC,CAAA;AACrC,IAAA,IAAA,CAAS,aAAgC,EAAC,CAAA;AAAA,GAAA;AAAA,EAE1C,MAAM,QAAQ,MAAoC,EAAA;AAChD,IAAK,IAAA,CAAA,SAAA,CAAU,KAAK,MAAM,CAAA,CAAA;AAAA,GAC5B;AAAA,EAEA,aACK,WACG,EAAA;AACN,IAAA,IAAA,CAAK,UAAW,CAAA,IAAA,CAAK,GAAG,WAAA,CAAY,MAAM,CAAA,CAAA;AAAA,GAC5C;AACF;;;;;;;;;;;;;;;;;;;;ACpCA,IAAA,YAAA,CAAA;AAmBO,MAAM,kBAA6C,CAAA;AAAA,EAAnD,WAAA,GAAA;AACL,IAAA,YAAA,CAAA,IAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAEA,MAAM,eAAe,WAAyC,EAAA;AAC5D,IAAA,YAAA,CAAA,IAAA,EAAK,YAAe,EAAA,WAAA,CAAA,CAAA;AAAA,GACtB;AAAA,EAEA,IAAI,WAAc,GAAA;AAChB,IAAA,OAAO,YAAK,CAAA,IAAA,EAAA,YAAA,CAAA,CAAA;AAAA,GACd;AACF,CAAA;AATE,YAAA,GAAA,IAAA,OAAA,EAAA;;ACDK,MAAM,mBAA+C,CAAA;AAAA,EAM1D,WAAA,CAAY,MAAc,MAAkB,EAAA;AAF5C,IAAA,IAAA,CAAS,iBAAgD,EAAC,CAAA;AAGxD,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AACZ,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA,CAAA;AAAA,GAChB;AAAA,EAEA,mBAAgC,GAAA;AAC9B,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GACd;AAAA,EAEA,MAAM,QAAQ,MAAoC,EAAA;AAlCpD,IAAA,IAAA,EAAA,CAAA;AAmCI,IAAK,IAAA,CAAA,cAAA,CAAe,MAAO,CAAA,KAAK,CAAI,GAAA,CAAA,EAAA,GAAA,IAAA,CAAK,eAAe,MAAO,CAAA,KAAK,CAAhC,KAAA,IAAA,GAAA,EAAA,GAAqC,EAAC,CAAA;AAC1E,IAAA,IAAA,CAAK,cAAe,CAAA,MAAA,CAAO,KAAK,CAAA,CAAE,KAAK,MAAM,CAAA,CAAA;AAAA,GAC/C;AACF;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/testUtils/TestEventBroker.ts","../src/testUtils/TestEventPublisher.ts","../src/testUtils/TestEventSubscriber.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 EventBroker,\n EventParams,\n EventSubscriber,\n} from '@backstage/plugin-events-node';\n\n/** @public */\nexport class TestEventBroker implements EventBroker {\n readonly published: EventParams[] = [];\n readonly subscribed: EventSubscriber[] = [];\n\n async publish(params: EventParams): Promise<void> {\n this.published.push(params);\n }\n\n subscribe(\n ...subscribers: Array<EventSubscriber | Array<EventSubscriber>>\n ): void {\n this.subscribed.push(...subscribers.flat());\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 { EventBroker, EventPublisher } from '@backstage/plugin-events-node';\n\n/** @public */\nexport class TestEventPublisher implements EventPublisher {\n #eventBroker?: EventBroker;\n\n async setEventBroker(eventBroker: EventBroker): Promise<void> {\n this.#eventBroker = eventBroker;\n }\n\n get eventBroker() {\n return this.#eventBroker;\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 { EventParams, EventSubscriber } from '@backstage/plugin-events-node';\n\n/** @public */\nexport class TestEventSubscriber implements EventSubscriber {\n readonly name: string;\n readonly topics: string[];\n\n readonly receivedEvents: Record<string, EventParams[]> = {};\n\n constructor(name: string, topics: string[]) {\n this.name = name;\n this.topics = topics;\n }\n\n supportsEventTopics(): string[] {\n return this.topics;\n }\n\n async onEvent(params: EventParams): Promise<void> {\n this.receivedEvents[params.topic] = this.receivedEvents[params.topic] ?? [];\n this.receivedEvents[params.topic].push(params);\n }\n}\n"],"names":["__publicField"],"mappings":";;;;;;;;;;AAuBO,MAAM,eAAuC,CAAA;AAAA,EAA7C,WAAA,GAAA;AACL,IAAAA,eAAA,CAAA,IAAA,EAAS,aAA2B,EAAC,CAAA,CAAA;AACrC,IAAAA,eAAA,CAAA,IAAA,EAAS,cAAgC,EAAC,CAAA,CAAA;AAAA,GAAA;AAAA,EAE1C,MAAM,QAAQ,MAAoC,EAAA;AAChD,IAAK,IAAA,CAAA,SAAA,CAAU,KAAK,MAAM,CAAA,CAAA;AAAA,GAC5B;AAAA,EAEA,aACK,WACG,EAAA;AACN,IAAA,IAAA,CAAK,UAAW,CAAA,IAAA,CAAK,GAAG,WAAA,CAAY,MAAM,CAAA,CAAA;AAAA,GAC5C;AACF;;;;;;;;;;;;;;;;;;;;ACpCA,IAAA,YAAA,CAAA;AAmBO,MAAM,kBAA6C,CAAA;AAAA,EAAnD,WAAA,GAAA;AACL,IAAA,YAAA,CAAA,IAAA,EAAA,YAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AAAA,GAAA;AAAA,EAEA,MAAM,eAAe,WAAyC,EAAA;AAC5D,IAAA,YAAA,CAAA,IAAA,EAAK,YAAe,EAAA,WAAA,CAAA,CAAA;AAAA,GACtB;AAAA,EAEA,IAAI,WAAc,GAAA;AAChB,IAAA,OAAO,YAAK,CAAA,IAAA,EAAA,YAAA,CAAA,CAAA;AAAA,GACd;AACF,CAAA;AATE,YAAA,GAAA,IAAA,OAAA,EAAA;;;;;;;;ACDK,MAAM,mBAA+C,CAAA;AAAA,EAM1D,WAAA,CAAY,MAAc,MAAkB,EAAA;AAL5C,IAAS,aAAA,CAAA,IAAA,EAAA,MAAA,CAAA,CAAA;AACT,IAAS,aAAA,CAAA,IAAA,EAAA,QAAA,CAAA,CAAA;AAET,IAAA,aAAA,CAAA,IAAA,EAAS,kBAAgD,EAAC,CAAA,CAAA;AAGxD,IAAA,IAAA,CAAK,IAAO,GAAA,IAAA,CAAA;AACZ,IAAA,IAAA,CAAK,MAAS,GAAA,MAAA,CAAA;AAAA,GAChB;AAAA,EAEA,mBAAgC,GAAA;AAC9B,IAAA,OAAO,IAAK,CAAA,MAAA,CAAA;AAAA,GACd;AAAA,EAEA,MAAM,QAAQ,MAAoC,EAAA;AAlCpD,IAAA,IAAA,EAAA,CAAA;AAmCI,IAAK,IAAA,CAAA,cAAA,CAAe,MAAO,CAAA,KAAK,CAAI,GAAA,CAAA,EAAA,GAAA,IAAA,CAAK,eAAe,MAAO,CAAA,KAAK,CAAhC,KAAA,IAAA,GAAA,EAAA,GAAqC,EAAC,CAAA;AAC1E,IAAA,IAAA,CAAK,cAAe,CAAA,MAAA,CAAO,KAAK,CAAA,CAAE,KAAK,MAAM,CAAA,CAAA;AAAA,GAC/C;AACF;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-backend-test-utils",
3
3
  "description": "The plugin-events-backend-test-utils for @backstage/plugin-events-node",
4
- "version": "0.1.8",
4
+ "version": "0.1.9",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -23,10 +23,10 @@
23
23
  "postpack": "backstage-cli package postpack"
24
24
  },
25
25
  "dependencies": {
26
- "@backstage/plugin-events-node": "^0.2.7"
26
+ "@backstage/plugin-events-node": "^0.2.8"
27
27
  },
28
28
  "devDependencies": {
29
- "@backstage/cli": "^0.22.8"
29
+ "@backstage/cli": "^0.22.9"
30
30
  },
31
31
  "files": [
32
32
  "dist"