@backstage/plugin-events-node 0.4.9-next.0 → 0.4.9-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 CHANGED
@@ -1,5 +1,24 @@
1
1
  # @backstage/plugin-events-node
2
2
 
3
+ ## 0.4.9-next.2
4
+
5
+ ### Patch Changes
6
+
7
+ - b95aa77: add `addHttpPostBodyParser` to events extension to allow body parse customization. This feature will enhance flexibility in handling HTTP POST requests in event-related operations.
8
+ - Updated dependencies
9
+ - @backstage/backend-plugin-api@1.2.1-next.1
10
+ - @backstage/errors@1.2.7
11
+ - @backstage/types@1.2.1
12
+
13
+ ## 0.4.9-next.1
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies
18
+ - @backstage/backend-plugin-api@1.2.1-next.1
19
+ - @backstage/errors@1.2.7
20
+ - @backstage/types@1.2.1
21
+
3
22
  ## 0.4.9-next.0
4
23
 
5
24
  ### Patch Changes
package/dist/alpha.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
2
- import { EventBroker, EventPublisher, EventSubscriber, HttpPostIngressOptions } from '@backstage/plugin-events-node';
2
+ import { EventBroker, EventPublisher, EventSubscriber, HttpPostIngressOptions, HttpBodyParserOptions } from '@backstage/plugin-events-node';
3
3
 
4
4
  /**
5
5
  * @alpha
@@ -18,6 +18,7 @@ interface EventsExtensionPoint {
18
18
  */
19
19
  addSubscribers(...subscribers: Array<EventSubscriber | Array<EventSubscriber>>): void;
20
20
  addHttpPostIngress(options: HttpPostIngressOptions): void;
21
+ addHttpPostBodyParser(options: HttpBodyParserOptions): void;
21
22
  }
22
23
  /**
23
24
  * @alpha
@@ -1 +1 @@
1
- {"version":3,"file":"extensions.cjs.js","sources":["../src/extensions.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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport {\n EventBroker,\n EventPublisher,\n EventSubscriber,\n HttpPostIngressOptions,\n} from '@backstage/plugin-events-node';\n\n/**\n * @alpha\n */\nexport interface EventsExtensionPoint {\n /**\n * @deprecated use `eventsServiceRef` and `eventsServiceFactory` instead\n */\n setEventBroker(eventBroker: EventBroker): void;\n\n /**\n * @deprecated use `EventsService.publish` instead\n */\n addPublishers(\n ...publishers: Array<EventPublisher | Array<EventPublisher>>\n ): void;\n\n /**\n * @deprecated use `EventsService.subscribe` instead\n */\n addSubscribers(\n ...subscribers: Array<EventSubscriber | Array<EventSubscriber>>\n ): void;\n\n addHttpPostIngress(options: HttpPostIngressOptions): void;\n}\n\n/**\n * @alpha\n */\nexport const eventsExtensionPoint = createExtensionPoint<EventsExtensionPoint>({\n id: 'events',\n});\n"],"names":["createExtensionPoint"],"mappings":";;;;AAqDO,MAAM,uBAAuBA,qCAA2C,CAAA;AAAA,EAC7E,EAAI,EAAA;AACN,CAAC;;;;"}
1
+ {"version":3,"file":"extensions.cjs.js","sources":["../src/extensions.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 { createExtensionPoint } from '@backstage/backend-plugin-api';\nimport {\n EventBroker,\n EventPublisher,\n EventSubscriber,\n HttpBodyParserOptions,\n HttpPostIngressOptions,\n} from '@backstage/plugin-events-node';\n\n/**\n * @alpha\n */\nexport interface EventsExtensionPoint {\n /**\n * @deprecated use `eventsServiceRef` and `eventsServiceFactory` instead\n */\n setEventBroker(eventBroker: EventBroker): void;\n\n /**\n * @deprecated use `EventsService.publish` instead\n */\n addPublishers(\n ...publishers: Array<EventPublisher | Array<EventPublisher>>\n ): void;\n\n /**\n * @deprecated use `EventsService.subscribe` instead\n */\n addSubscribers(\n ...subscribers: Array<EventSubscriber | Array<EventSubscriber>>\n ): void;\n\n addHttpPostIngress(options: HttpPostIngressOptions): void;\n\n addHttpPostBodyParser(options: HttpBodyParserOptions): void;\n}\n\n/**\n * @alpha\n */\nexport const eventsExtensionPoint = createExtensionPoint<EventsExtensionPoint>({\n id: 'events',\n});\n"],"names":["createExtensionPoint"],"mappings":";;;;AAwDO,MAAM,uBAAuBA,qCAA2C,CAAA;AAAA,EAC7E,EAAI,EAAA;AACN,CAAC;;;;"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
- /// <reference types="node" />
2
1
  import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
3
2
  import { LoggerService, RootConfigService, DiscoveryService, AuthService, LifecycleService } from '@backstage/backend-plugin-api';
3
+ import { Request } from 'express';
4
+ import { ParsedMediaType } from 'content-type';
4
5
 
5
6
  /**
6
7
  * @public
@@ -202,6 +203,27 @@ interface HttpPostIngressOptions {
202
203
  validator?: RequestValidator;
203
204
  }
204
205
 
206
+ /**
207
+ * @public
208
+ */
209
+ type HttpBodyParsed = {
210
+ bodyParsed: any;
211
+ bodyBuffer: Buffer;
212
+ encoding: string;
213
+ };
214
+ /**
215
+ * @public
216
+ */
217
+ type HttpBodyParser = (request: Request, parsedMediaType: ParsedMediaType, topic: string) => Promise<HttpBodyParsed>;
218
+
219
+ /**
220
+ * @public
221
+ */
222
+ interface HttpBodyParserOptions {
223
+ contentType: string;
224
+ parser: HttpBodyParser;
225
+ }
226
+
205
227
  /**
206
228
  * Subscribes to the provided (generic) topic
207
229
  * and publishes the events under the more concrete sub-topic
@@ -293,4 +315,4 @@ declare const eventsServiceRef: _backstage_backend_plugin_api.ServiceRef<EventsS
293
315
  /** @public */
294
316
  declare const eventsServiceFactory: _backstage_backend_plugin_api.ServiceFactory<EventsService, "plugin", "singleton">;
295
317
 
296
- export { DefaultEventsService, EVENTS_NOTIFY_TIMEOUT_HEADER, type EventBroker, type EventBusMode, type EventParams, type EventPublisher, EventRouter, type EventSubscriber, type EventsService, type EventsServiceEventHandler, type EventsServiceSubscribeOptions, type HttpPostIngressOptions, type RequestDetails, type RequestRejectionDetails, type RequestValidationContext, type RequestValidator, SubTopicEventRouter, eventsServiceFactory, eventsServiceRef };
318
+ export { DefaultEventsService, EVENTS_NOTIFY_TIMEOUT_HEADER, type EventBroker, type EventBusMode, type EventParams, type EventPublisher, EventRouter, type EventSubscriber, type EventsService, type EventsServiceEventHandler, type EventsServiceSubscribeOptions, type HttpBodyParsed, type HttpBodyParser, type HttpBodyParserOptions, type HttpPostIngressOptions, type RequestDetails, type RequestRejectionDetails, type RequestValidationContext, type RequestValidator, SubTopicEventRouter, eventsServiceFactory, eventsServiceRef };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-node",
3
- "version": "0.4.9-next.0",
3
+ "version": "0.4.9-next.2",
4
4
  "description": "The plugin-events-node module for @backstage/plugin-events-backend",
5
5
  "backstage": {
6
6
  "role": "node-library",
@@ -38,7 +38,7 @@
38
38
  "types": "./dist/index.d.ts",
39
39
  "typesVersions": {
40
40
  "*": {
41
- "index": [
41
+ "*": [
42
42
  "dist/index.d.ts"
43
43
  ],
44
44
  "alpha": [
@@ -60,15 +60,19 @@
60
60
  "test": "backstage-cli package test"
61
61
  },
62
62
  "dependencies": {
63
- "@backstage/backend-plugin-api": "1.2.1-next.0",
63
+ "@backstage/backend-plugin-api": "1.2.1-next.1",
64
64
  "@backstage/errors": "1.2.7",
65
65
  "@backstage/types": "1.2.1",
66
+ "@types/content-type": "^1.1.8",
67
+ "@types/express": "^4.17.6",
68
+ "content-type": "^1.0.5",
66
69
  "cross-fetch": "^4.0.0",
70
+ "express": "^4.17.1",
67
71
  "uri-template": "^2.0.0"
68
72
  },
69
73
  "devDependencies": {
70
- "@backstage/backend-test-utils": "1.3.1-next.0",
71
- "@backstage/cli": "0.30.0",
74
+ "@backstage/backend-test-utils": "1.3.1-next.2",
75
+ "@backstage/cli": "0.31.0-next.1",
72
76
  "msw": "^1.0.0"
73
77
  },
74
78
  "configSchema": "config.d.ts"