@webiny/app 6.6.0-alpha.10 → 6.6.0-alpha.11

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.
@@ -0,0 +1,13 @@
1
+ import { BaseEvent } from "../../features/eventPublisher/index.js";
2
+ import type { GenericRecord } from "../../types.js";
3
+ export interface WebsocketMessageData extends GenericRecord {
4
+ action: string;
5
+ }
6
+ /**
7
+ * Published for every incoming websocket message. Carries the raw message data
8
+ * (which always includes an `action`), and routes to `WebsocketEventHandler` handlers.
9
+ */
10
+ export declare class WebsocketEvent extends BaseEvent<WebsocketMessageData> {
11
+ readonly eventType: "Websockets/MessageReceived";
12
+ getHandlerAbstraction(): import("@webiny/di").Abstraction<import("~/features/eventPublisher/index.js").IEventHandler<WebsocketEvent>>;
13
+ }
@@ -0,0 +1,13 @@
1
+ import { BaseEvent } from "../eventPublisher/index.js";
2
+ import { WebsocketEventHandler } from "./abstractions.js";
3
+ class WebsocketEvent extends BaseEvent {
4
+ getHandlerAbstraction() {
5
+ return WebsocketEventHandler;
6
+ }
7
+ constructor(...args){
8
+ super(...args), this.eventType = "Websockets/MessageReceived";
9
+ }
10
+ }
11
+ export { WebsocketEvent };
12
+
13
+ //# sourceMappingURL=WebsocketEvent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/websocketEvents/WebsocketEvent.js","sources":["../../../src/features/websocketEvents/WebsocketEvent.ts"],"sourcesContent":["import { BaseEvent } from \"~/features/eventPublisher/index.js\";\nimport type { GenericRecord } from \"~/types.js\";\nimport { WebsocketEventHandler } from \"./abstractions.js\";\n\nexport interface WebsocketMessageData extends GenericRecord {\n action: string;\n}\n\n/**\n * Published for every incoming websocket message. Carries the raw message data\n * (which always includes an `action`), and routes to `WebsocketEventHandler` handlers.\n */\nexport class WebsocketEvent extends BaseEvent<WebsocketMessageData> {\n readonly eventType = \"Websockets/MessageReceived\" as const;\n\n getHandlerAbstraction() {\n return WebsocketEventHandler;\n }\n}\n"],"names":["WebsocketEvent","BaseEvent","WebsocketEventHandler"],"mappings":";;AAYO,MAAMA,uBAAuBC;IAGhC,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACM,SAAS,GAAG;;AAKzB"}
@@ -0,0 +1,16 @@
1
+ import type { IEventHandler } from "../../features/eventPublisher/index.js";
2
+ import type { WebsocketEvent } from "./WebsocketEvent.js";
3
+ /**
4
+ * Handlers registered against this abstraction receive EVERY incoming websocket message
5
+ * (published as a `WebsocketEvent` by the websockets→EventPublisher bridge in @webiny/app-websockets).
6
+ * Each handler is responsible for filtering by `event.payload.action` and reacting to the ones it
7
+ * cares about, instead of subscribing to the websocket service directly.
8
+ *
9
+ * Lives here, next to `EventPublisher`, rather than in @webiny/app-websockets, so packages that
10
+ * app-websockets depends on (such as @webiny/app-admin) can handle messages too.
11
+ */
12
+ export declare const WebsocketEventHandler: import("@webiny/di").Abstraction<IEventHandler<WebsocketEvent>>;
13
+ export declare namespace WebsocketEventHandler {
14
+ type Interface = IEventHandler<WebsocketEvent>;
15
+ type Event = WebsocketEvent;
16
+ }
@@ -0,0 +1,5 @@
1
+ import { createAbstraction } from "@webiny/feature/admin";
2
+ const WebsocketEventHandler = createAbstraction("App/WebsocketEventHandler");
3
+ export { WebsocketEventHandler };
4
+
5
+ //# sourceMappingURL=abstractions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/websocketEvents/abstractions.js","sources":["../../../src/features/websocketEvents/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/admin\";\nimport type { IEventHandler } from \"~/features/eventPublisher/index.js\";\nimport type { WebsocketEvent } from \"./WebsocketEvent.js\";\n\n/**\n * Handlers registered against this abstraction receive EVERY incoming websocket message\n * (published as a `WebsocketEvent` by the websockets→EventPublisher bridge in @webiny/app-websockets).\n * Each handler is responsible for filtering by `event.payload.action` and reacting to the ones it\n * cares about, instead of subscribing to the websocket service directly.\n *\n * Lives here, next to `EventPublisher`, rather than in @webiny/app-websockets, so packages that\n * app-websockets depends on (such as @webiny/app-admin) can handle messages too.\n */\nexport const WebsocketEventHandler = createAbstraction<IEventHandler<WebsocketEvent>>(\n \"App/WebsocketEventHandler\"\n);\n\nexport namespace WebsocketEventHandler {\n export type Interface = IEventHandler<WebsocketEvent>;\n export type Event = WebsocketEvent;\n}\n"],"names":["WebsocketEventHandler","createAbstraction"],"mappings":";AAaO,MAAMA,wBAAwBC,kBACjC"}
@@ -0,0 +1,3 @@
1
+ export { WebsocketEventHandler } from "./abstractions.js";
2
+ export { WebsocketEvent } from "./WebsocketEvent.js";
3
+ export type { WebsocketMessageData } from "./WebsocketEvent.js";
@@ -0,0 +1,2 @@
1
+ export { WebsocketEventHandler } from "./abstractions.js";
2
+ export { WebsocketEvent } from "./WebsocketEvent.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app",
3
- "version": "6.6.0-alpha.10",
3
+ "version": "6.6.0-alpha.11",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.js",
@@ -20,12 +20,12 @@
20
20
  "dependencies": {
21
21
  "@types/react": "19.3.0",
22
22
  "@webiny/di": "2.0.0",
23
- "@webiny/feature": "6.6.0-alpha.10",
24
- "@webiny/i18n": "6.6.0-alpha.10",
25
- "@webiny/i18n-react": "6.6.0-alpha.10",
26
- "@webiny/plugins": "6.6.0-alpha.10",
27
- "@webiny/react-composition": "6.6.0-alpha.10",
28
- "@webiny/react-properties": "6.6.0-alpha.10",
23
+ "@webiny/feature": "6.6.0-alpha.11",
24
+ "@webiny/i18n": "6.6.0-alpha.11",
25
+ "@webiny/i18n-react": "6.6.0-alpha.11",
26
+ "@webiny/plugins": "6.6.0-alpha.11",
27
+ "@webiny/react-composition": "6.6.0-alpha.11",
28
+ "@webiny/react-properties": "6.6.0-alpha.11",
29
29
  "graphql": "16.14.2",
30
30
  "history": "5.3.0",
31
31
  "invariant": "2.2.4",
@@ -39,7 +39,7 @@
39
39
  "devDependencies": {
40
40
  "@types/lodash": "4.17.27",
41
41
  "@types/warning": "3.0.4",
42
- "@webiny/build-tools": "6.6.0-alpha.10",
42
+ "@webiny/build-tools": "6.6.0-alpha.11",
43
43
  "rimraf": "6.1.3",
44
44
  "type-fest": "5.10.0",
45
45
  "typescript": "7.0.2",