@artstesh/postboy 1.2.3 → 1.3.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/README.md +1 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +3 -2
- package/lib/index.js.map +1 -1
- package/lib/messages/add-middleware.executor.d.ts +19 -0
- package/lib/messages/add-middleware.executor.d.ts.map +1 -0
- package/lib/messages/add-middleware.executor.js +24 -0
- package/lib/messages/add-middleware.executor.js.map +1 -0
- package/lib/messages/add-namespace.executor.d.ts +19 -0
- package/lib/messages/add-namespace.executor.d.ts.map +1 -0
- package/lib/messages/add-namespace.executor.js +24 -0
- package/lib/messages/add-namespace.executor.js.map +1 -0
- package/lib/messages/connect-executor.executor.d.ts +25 -0
- package/lib/messages/connect-executor.executor.d.ts.map +1 -0
- package/lib/messages/connect-executor.executor.js +30 -0
- package/lib/messages/connect-executor.executor.js.map +1 -0
- package/lib/messages/connect-handler.executor.d.ts +25 -0
- package/lib/messages/connect-handler.executor.d.ts.map +1 -0
- package/lib/messages/connect-handler.executor.js +30 -0
- package/lib/messages/connect-handler.executor.js.map +1 -0
- package/lib/messages/connect-message.executor.d.ts +28 -0
- package/lib/messages/connect-message.executor.d.ts.map +1 -0
- package/lib/messages/connect-message.executor.js +31 -0
- package/lib/messages/connect-message.executor.js.map +1 -0
- package/lib/messages/connect.message.executor.d.ts +28 -0
- package/lib/messages/connect.message.executor.d.ts.map +1 -0
- package/lib/messages/connect.message.executor.js +31 -0
- package/lib/messages/connect.message.executor.js.map +1 -0
- package/lib/messages/disconnect-message.executor.d.ts +19 -0
- package/lib/messages/disconnect-message.executor.d.ts.map +1 -0
- package/lib/messages/disconnect-message.executor.js +25 -0
- package/lib/messages/disconnect-message.executor.js.map +1 -0
- package/lib/messages/eliminate-namespace.executor.d.ts +16 -0
- package/lib/messages/eliminate-namespace.executor.d.ts.map +1 -0
- package/lib/messages/eliminate-namespace.executor.js +22 -0
- package/lib/messages/eliminate-namespace.executor.js.map +1 -0
- package/lib/messages/index.d.ts +11 -0
- package/lib/messages/index.d.ts.map +1 -0
- package/lib/messages/index.js +24 -0
- package/lib/messages/index.js.map +1 -0
- package/lib/messages/lock-message.executor.d.ts +22 -0
- package/lib/messages/lock-message.executor.d.ts.map +1 -0
- package/lib/messages/lock-message.executor.js +26 -0
- package/lib/messages/lock-message.executor.js.map +1 -0
- package/lib/messages/remove-middleware.executor.d.ts +17 -0
- package/lib/messages/remove-middleware.executor.d.ts.map +1 -0
- package/lib/messages/remove-middleware.executor.js +22 -0
- package/lib/messages/remove-middleware.executor.js.map +1 -0
- package/lib/messages/unlock-message.executor.d.ts +21 -0
- package/lib/messages/unlock-message.executor.d.ts.map +1 -0
- package/lib/messages/unlock-message.executor.js +25 -0
- package/lib/messages/unlock-message.executor.js.map +1 -0
- package/lib/models/cancel-details.d.ts +9 -0
- package/lib/models/cancel-details.d.ts.map +1 -0
- package/lib/models/cancel-details.js +3 -0
- package/lib/models/cancel-details.js.map +1 -0
- package/lib/models/cancel-error.d.ts +7 -0
- package/lib/models/cancel-error.d.ts.map +1 -0
- package/lib/models/cancel-error.js +18 -0
- package/lib/models/cancel-error.js.map +1 -0
- package/lib/models/middleware-decision.enum.d.ts +5 -0
- package/lib/models/middleware-decision.enum.d.ts.map +1 -0
- package/lib/models/middleware-decision.enum.js +9 -0
- package/lib/models/middleware-decision.enum.js.map +1 -0
- package/lib/models/middleware-stage.enum.d.ts +6 -0
- package/lib/models/middleware-stage.enum.d.ts.map +1 -0
- package/lib/models/middleware-stage.enum.js +10 -0
- package/lib/models/middleware-stage.enum.js.map +1 -0
- package/lib/models/pipeline-context.d.ts +7 -0
- package/lib/models/pipeline-context.d.ts.map +1 -0
- package/lib/models/pipeline-context.js +3 -0
- package/lib/models/pipeline-context.js.map +1 -0
- package/lib/models/pipeline-result.d.ts +6 -0
- package/lib/models/pipeline-result.d.ts.map +1 -0
- package/lib/models/pipeline-result.js +3 -0
- package/lib/models/pipeline-result.js.map +1 -0
- package/lib/models/postboy-callback.message.d.ts +21 -0
- package/lib/models/postboy-callback.message.d.ts.map +1 -1
- package/lib/models/postboy-callback.message.js +23 -0
- package/lib/models/postboy-callback.message.js.map +1 -1
- package/lib/models/postboy-execution.handler.d.ts +6 -0
- package/lib/models/postboy-execution.handler.d.ts.map +1 -1
- package/lib/models/postboy-execution.handler.js.map +1 -1
- package/lib/models/postboy-message-metadata.d.ts +26 -0
- package/lib/models/postboy-message-metadata.d.ts.map +1 -0
- package/lib/models/postboy-message-metadata.js +3 -0
- package/lib/models/postboy-message-metadata.js.map +1 -0
- package/lib/models/postboy-message.context.d.ts +9 -0
- package/lib/models/postboy-message.context.d.ts.map +1 -0
- package/lib/models/postboy-message.context.js +3 -0
- package/lib/models/postboy-message.context.js.map +1 -0
- package/lib/models/postboy-subscription.d.ts +31 -2
- package/lib/models/postboy-subscription.d.ts.map +1 -1
- package/lib/models/postboy-subscription.js +31 -2
- package/lib/models/postboy-subscription.js.map +1 -1
- package/lib/models/postboy.message.d.ts +3 -0
- package/lib/models/postboy.message.d.ts.map +1 -1
- package/lib/models/postboy.message.js +7 -0
- package/lib/models/postboy.message.js.map +1 -1
- package/lib/models/postboy.settings.d.ts +13 -0
- package/lib/models/postboy.settings.d.ts.map +1 -0
- package/lib/models/postboy.settings.js +20 -0
- package/lib/models/postboy.settings.js.map +1 -0
- package/lib/postboy-abstract.registrator.d.ts +15 -32
- package/lib/postboy-abstract.registrator.d.ts.map +1 -1
- package/lib/postboy-abstract.registrator.js +68 -73
- package/lib/postboy-abstract.registrator.js.map +1 -1
- package/lib/postboy.service.d.ts +73 -39
- package/lib/postboy.service.d.ts.map +1 -1
- package/lib/postboy.service.js +135 -63
- package/lib/postboy.service.js.map +1 -1
- package/lib/services/namespace-registrator.d.ts +13 -13
- package/lib/services/namespace-registrator.js +20 -20
- package/lib/services/postboy-context.service.d.ts +13 -0
- package/lib/services/postboy-context.service.d.ts.map +1 -0
- package/lib/services/postboy-context.service.js +50 -0
- package/lib/services/postboy-context.service.js.map +1 -0
- package/lib/services/postboy-dependency.resolver.d.ts +25 -0
- package/lib/services/postboy-dependency.resolver.d.ts.map +1 -1
- package/lib/services/postboy-dependency.resolver.js +25 -0
- package/lib/services/postboy-dependency.resolver.js.map +1 -1
- package/lib/services/postboy-message.store.d.ts +5 -1
- package/lib/services/postboy-message.store.d.ts.map +1 -1
- package/lib/services/postboy-message.store.js +23 -7
- package/lib/services/postboy-message.store.js.map +1 -1
- package/lib/services/postboy-middleware.d.ts +35 -0
- package/lib/services/postboy-middleware.d.ts.map +1 -0
- package/lib/services/postboy-middleware.js +47 -0
- package/lib/services/postboy-middleware.js.map +1 -0
- package/lib/services/postboy-middleware.service.d.ts +28 -0
- package/lib/services/postboy-middleware.service.d.ts.map +1 -1
- package/lib/services/postboy-middleware.service.js +30 -0
- package/lib/services/postboy-middleware.service.js.map +1 -1
- package/lib/services/postboy-namespace.store.d.ts +33 -34
- package/lib/services/postboy-namespace.store.d.ts.map +1 -1
- package/lib/services/postboy-namespace.store.js +53 -53
- package/lib/services/postboy-namespace.store.js.map +1 -1
- package/lib/utils/id.generator.d.ts +4 -4
- package/lib/utils/id.generator.js +17 -17
- package/lib/utils/id.generator.js.map +1 -1
- package/package.json +5 -10
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostboySettings = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Represents configurable settings for the Postboy system.
|
|
6
|
+
*/
|
|
7
|
+
class PostboySettings {
|
|
8
|
+
/**
|
|
9
|
+
* Constructs an instance of the class with optional settings.
|
|
10
|
+
*
|
|
11
|
+
* @param {Partial<PostboySettings>} [settings] - Optional settings to configure the instance. Can include partial metadata or other configurations.
|
|
12
|
+
*/
|
|
13
|
+
constructor(settings) {
|
|
14
|
+
var _a;
|
|
15
|
+
this.metadata = false;
|
|
16
|
+
this.metadata = (_a = settings === null || settings === void 0 ? void 0 : settings.metadata) !== null && _a !== void 0 ? _a : this.metadata;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.PostboySettings = PostboySettings;
|
|
20
|
+
//# sourceMappingURL=postboy.settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy.settings.js","sourceRoot":"","sources":["../../src/models/postboy.settings.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,MAAa,eAAe;IAG1B;;;;OAIG;IACH,YAAY,QAAmC;;QAPxC,aAAQ,GAAY,KAAK,CAAC;QAQ/B,IAAI,CAAC,QAAQ,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,QAAQ,mCAAI,IAAI,CAAC,QAAQ,CAAC;IACtD,CAAC;CACF;AAXD,0CAWC"}
|
|
@@ -7,9 +7,11 @@ import { PostboyExecutionHandler } from './models/postboy-execution.handler';
|
|
|
7
7
|
export type MessageType<T extends PostboyGenericMessage> = new (...args: any[]) => T;
|
|
8
8
|
export declare abstract class PostboyAbstractRegistrator {
|
|
9
9
|
protected postboy: PostboyService;
|
|
10
|
+
get namespace(): string;
|
|
10
11
|
private ids;
|
|
11
12
|
private services;
|
|
12
|
-
|
|
13
|
+
private readonly _namespace;
|
|
14
|
+
constructor(postboy: PostboyService, namespace?: string | null);
|
|
13
15
|
/**
|
|
14
16
|
* Registers a list of services to be used by the application.
|
|
15
17
|
*
|
|
@@ -17,32 +19,13 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
17
19
|
* @return {void} This method does not return a value.
|
|
18
20
|
*/
|
|
19
21
|
registerServices(services: IPostboyDependingService[]): void;
|
|
20
|
-
up(): void;
|
|
21
|
-
protected abstract _up(): void;
|
|
22
|
-
/**
|
|
23
|
-
* @deprecated The method should be replaced with recordExecutor<T>
|
|
24
|
-
*/
|
|
25
|
-
registerExecutor<E extends PostboyExecutor<T>, T>(id: string, exec: (e: E) => T): void;
|
|
26
|
-
/**
|
|
27
|
-
* @deprecated The method should be replaced with record<T>
|
|
28
|
-
*/
|
|
29
|
-
register<T>(id: string, sub: Subject<T>): void;
|
|
30
|
-
/**
|
|
31
|
-
* @deprecated The method should be replaced with recordWithPipe<T>
|
|
32
|
-
*/
|
|
33
|
-
registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
|
|
34
22
|
/**
|
|
35
|
-
*
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* @deprecated The method should be replaced with recordBehavior<T>
|
|
40
|
-
*/
|
|
41
|
-
registerBehavior: <T>(id: string, initial: T) => void;
|
|
42
|
-
/**
|
|
43
|
-
* @deprecated The method should be replaced with recordSubject<T>
|
|
23
|
+
* Initiates the 'up' process for the current instance and all associated services.
|
|
24
|
+
*
|
|
25
|
+
* @return {void} Does not return a value.
|
|
44
26
|
*/
|
|
45
|
-
|
|
27
|
+
up(): void;
|
|
28
|
+
protected abstract _up(): void;
|
|
46
29
|
down(): void;
|
|
47
30
|
/**
|
|
48
31
|
* Records a type and its corresponding Subject<T> into the Postboy system and updates the internal identifiers.
|
|
@@ -51,7 +34,7 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
51
34
|
* @param {Subject<T>} sub - The subject associated with the generic message type.
|
|
52
35
|
* @return {this} Returns the current instance for method chaining.
|
|
53
36
|
*/
|
|
54
|
-
record<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>):
|
|
37
|
+
record<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>): PostboyAbstractRegistrator;
|
|
55
38
|
/**
|
|
56
39
|
* Records a message type with a specific subject and applies a transformation pipe to the subject.
|
|
57
40
|
*
|
|
@@ -60,7 +43,7 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
60
43
|
* @param {(s: Subject<T>) => Observable<T>} pipe - A function that takes the subject as input and returns an Observable with transformations applied.
|
|
61
44
|
* @return {this} The current instance of the class for chaining.
|
|
62
45
|
*/
|
|
63
|
-
recordWithPipe<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>):
|
|
46
|
+
recordWithPipe<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): PostboyAbstractRegistrator;
|
|
64
47
|
/**
|
|
65
48
|
* Records an executor associated with a specific type and execution logic.
|
|
66
49
|
*
|
|
@@ -68,7 +51,7 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
68
51
|
* @param exec A callback function that executes the logic using an instance of the specified executor type.
|
|
69
52
|
* @return void
|
|
70
53
|
*/
|
|
71
|
-
recordExecutor<E extends PostboyExecutor<T>, T>(type: new (...args: any[]) => E, exec: (e: E) => T):
|
|
54
|
+
recordExecutor<E extends PostboyExecutor<T>, T>(type: new (...args: any[]) => E, exec: (e: E) => T): PostboyAbstractRegistrator;
|
|
72
55
|
/**
|
|
73
56
|
* Records a handler for a specific executor type.
|
|
74
57
|
*
|
|
@@ -76,7 +59,7 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
76
59
|
* @param handler The execution handler associated with the given executor type.
|
|
77
60
|
* @return void
|
|
78
61
|
*/
|
|
79
|
-
recordHandler<E extends PostboyExecutor<R>, R>(executor: new (...args: any[]) => E, handler: PostboyExecutionHandler<R, E>):
|
|
62
|
+
recordHandler<E extends PostboyExecutor<R>, R>(executor: new (...args: any[]) => E, handler: PostboyExecutionHandler<R, E>): PostboyAbstractRegistrator;
|
|
80
63
|
/**
|
|
81
64
|
* A utility function that facilitates the recording and replaying of messages
|
|
82
65
|
* using a ReplaySubject. This function is designed to handle messages of a
|
|
@@ -90,7 +73,7 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
90
73
|
* Defaults to 1 if not specified.
|
|
91
74
|
* @returns The result of invoking the `record` method with the given message type and configured ReplaySubject.
|
|
92
75
|
*/
|
|
93
|
-
recordReplay
|
|
76
|
+
recordReplay<T extends PostboyGenericMessage>(type: MessageType<T>, bufferSize?: number): PostboyAbstractRegistrator;
|
|
94
77
|
/**
|
|
95
78
|
* Represents a method that records a specific behavior associated with a message type.
|
|
96
79
|
* It creates a `BehaviorSubject` initialized with the provided initial message
|
|
@@ -101,7 +84,7 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
101
84
|
* @param {T} initial - The initial value of the message that will be set in the `BehaviorSubject`.
|
|
102
85
|
* @returns {void} - This function does not return a value; instead, it modifies the internal state.
|
|
103
86
|
*/
|
|
104
|
-
recordBehavior
|
|
87
|
+
recordBehavior<T extends PostboyGenericMessage>(type: MessageType<T>, initial: T): PostboyAbstractRegistrator;
|
|
105
88
|
/**
|
|
106
89
|
* A function that creates and returns a new generic message recorder for a specific message type.
|
|
107
90
|
*
|
|
@@ -109,6 +92,6 @@ export declare abstract class PostboyAbstractRegistrator {
|
|
|
109
92
|
* @param {MessageType<T>} type - The constructor for the message type being recorded.
|
|
110
93
|
* @returns {Subject<T>} A new instance of `Subject<T>` bound to the specified message type.
|
|
111
94
|
*/
|
|
112
|
-
recordSubject
|
|
95
|
+
recordSubject<T extends PostboyGenericMessage>(type: MessageType<T>): this;
|
|
113
96
|
}
|
|
114
97
|
//# sourceMappingURL=postboy-abstract.registrator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-abstract.registrator.d.ts","sourceRoot":"","sources":["../src/postboy-abstract.registrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAmB,UAAU,
|
|
1
|
+
{"version":3,"file":"postboy-abstract.registrator.d.ts","sourceRoot":"","sources":["../src/postboy-abstract.registrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAmB,UAAU,EAAuB,OAAO,EAAE,MAAM,MAAM,CAAC;AACjF,OAAO,EAAE,wBAAwB,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,CAAC,EACnD,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EAC/B,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAChB,0BAA0B;IAM7B;;;;;;OAMG;IACI,aAAa,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAClD,QAAQ,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACnC,OAAO,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,GACrC,0BAA0B;IAM7B;;;;;;;;;;;;OAYG;IACI,YAAY,CAAC,CAAC,SAAS,qBAAqB,EACjD,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,UAAU,SAAI,GACb,0BAA0B;IAK7B;;;;;;;;;OASG;IACI,cAAc,CAAC,CAAC,SAAS,qBAAqB,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,GAAG,0BAA0B;IAKpH;;;;;;OAMG;IACI,aAAa,CAAC,CAAC,SAAS,qBAAqB,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;CAI3E"}
|
|
@@ -3,56 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PostboyAbstractRegistrator = void 0;
|
|
4
4
|
const rxjs_1 = require("rxjs");
|
|
5
5
|
const postboy_generic_message_1 = require("./models/postboy-generic-message");
|
|
6
|
+
const id_generator_1 = require("./utils/id.generator");
|
|
7
|
+
const connect_message_executor_1 = require("./messages/connect-message.executor");
|
|
8
|
+
const disconnect_message_executor_1 = require("./messages/disconnect-message.executor");
|
|
9
|
+
const connect_executor_executor_1 = require("./messages/connect-executor.executor");
|
|
10
|
+
const connect_handler_executor_1 = require("./messages/connect-handler.executor");
|
|
6
11
|
class PostboyAbstractRegistrator {
|
|
7
|
-
|
|
12
|
+
get namespace() {
|
|
13
|
+
return this._namespace;
|
|
14
|
+
}
|
|
15
|
+
constructor(postboy, namespace = null) {
|
|
8
16
|
this.postboy = postboy;
|
|
9
17
|
this.ids = [];
|
|
10
18
|
this.services = [];
|
|
11
|
-
|
|
12
|
-
* @deprecated The method should be replaced with recordReplay<T>
|
|
13
|
-
*/
|
|
14
|
-
this.registerReplay = (id, bufferSize = 1) => this.register(id, new rxjs_1.ReplaySubject(bufferSize));
|
|
15
|
-
/**
|
|
16
|
-
* @deprecated The method should be replaced with recordBehavior<T>
|
|
17
|
-
*/
|
|
18
|
-
this.registerBehavior = (id, initial) => this.register(id, new rxjs_1.BehaviorSubject(initial));
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated The method should be replaced with recordSubject<T>
|
|
21
|
-
*/
|
|
22
|
-
this.registerSubject = (id) => this.register(id, new rxjs_1.Subject());
|
|
23
|
-
/**
|
|
24
|
-
* A utility function that facilitates the recording and replaying of messages
|
|
25
|
-
* using a ReplaySubject. This function is designed to handle messages of a
|
|
26
|
-
* specific type and allows specifying a buffer size to determine how many
|
|
27
|
-
* of the most recent messages should be replayed.
|
|
28
|
-
*
|
|
29
|
-
* @template T Extends the PostboyGenericMessage type, representing the type of message
|
|
30
|
-
* to be recorded and replayed.
|
|
31
|
-
* @param {MessageType<T>} type The constructor of the message type to be recorded and replayed.
|
|
32
|
-
* @param {number} [bufferSize=1] The number of recent messages to retain in the ReplaySubject's buffer.
|
|
33
|
-
* Defaults to 1 if not specified.
|
|
34
|
-
* @returns The result of invoking the `record` method with the given message type and configured ReplaySubject.
|
|
35
|
-
*/
|
|
36
|
-
this.recordReplay = (type, bufferSize = 1) => this.record(type, new rxjs_1.ReplaySubject(bufferSize));
|
|
37
|
-
/**
|
|
38
|
-
* Represents a method that records a specific behavior associated with a message type.
|
|
39
|
-
* It creates a `BehaviorSubject` initialized with the provided initial message
|
|
40
|
-
* and associates it with the given message type using the `record` method.
|
|
41
|
-
*
|
|
42
|
-
* @template T - A type parameter extending `PostboyGenericMessage` that defines the message structure.
|
|
43
|
-
* @param {MessageType<T>} type - The constructor function of the message type to be recorded.
|
|
44
|
-
* @param {T} initial - The initial value of the message that will be set in the `BehaviorSubject`.
|
|
45
|
-
* @returns {void} - This function does not return a value; instead, it modifies the internal state.
|
|
46
|
-
*/
|
|
47
|
-
this.recordBehavior = (type, initial) => this.record(type, new rxjs_1.BehaviorSubject(initial));
|
|
48
|
-
/**
|
|
49
|
-
* A function that creates and returns a new generic message recorder for a specific message type.
|
|
50
|
-
*
|
|
51
|
-
* @template T - A type parameter extending from `PostboyGenericMessage`.
|
|
52
|
-
* @param {MessageType<T>} type - The constructor for the message type being recorded.
|
|
53
|
-
* @returns {Subject<T>} A new instance of `Subject<T>` bound to the specified message type.
|
|
54
|
-
*/
|
|
55
|
-
this.recordSubject = (type) => this.record(type, new rxjs_1.Subject());
|
|
19
|
+
this._namespace = namespace !== null && namespace !== void 0 ? namespace : id_generator_1.IdGenerator.get();
|
|
56
20
|
}
|
|
57
21
|
/**
|
|
58
22
|
* Registers a list of services to be used by the application.
|
|
@@ -63,36 +27,21 @@ class PostboyAbstractRegistrator {
|
|
|
63
27
|
registerServices(services) {
|
|
64
28
|
this.services = services;
|
|
65
29
|
}
|
|
66
|
-
up() {
|
|
67
|
-
this._up();
|
|
68
|
-
this.services.forEach((s) => s.up());
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* @deprecated The method should be replaced with recordExecutor<T>
|
|
72
|
-
*/
|
|
73
|
-
registerExecutor(id, exec) {
|
|
74
|
-
this.postboy.registerExecutor(id, exec);
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* @deprecated The method should be replaced with record<T>
|
|
78
|
-
*/
|
|
79
|
-
register(id, sub) {
|
|
80
|
-
this.ids.push(id);
|
|
81
|
-
this.postboy.register(id, sub);
|
|
82
|
-
}
|
|
83
30
|
/**
|
|
84
|
-
*
|
|
31
|
+
* Initiates the 'up' process for the current instance and all associated services.
|
|
32
|
+
*
|
|
33
|
+
* @return {void} Does not return a value.
|
|
85
34
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this.
|
|
35
|
+
up() {
|
|
36
|
+
var _a;
|
|
37
|
+
(_a = this._up) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
38
|
+
this.services.forEach((s) => s.up());
|
|
89
39
|
}
|
|
90
40
|
down() {
|
|
91
41
|
this.services.forEach((s) => !!s.down && s.down());
|
|
92
42
|
this.services = [];
|
|
93
|
-
this.ids.forEach((id) => this.postboy.
|
|
43
|
+
this.ids.forEach((id) => this.postboy.exec(new disconnect_message_executor_1.DisconnectMessage(id)));
|
|
94
44
|
}
|
|
95
|
-
// future
|
|
96
45
|
/**
|
|
97
46
|
* Records a type and its corresponding Subject<T> into the Postboy system and updates the internal identifiers.
|
|
98
47
|
*
|
|
@@ -102,7 +51,7 @@ class PostboyAbstractRegistrator {
|
|
|
102
51
|
*/
|
|
103
52
|
record(type, sub) {
|
|
104
53
|
this.ids.push((0, postboy_generic_message_1.checkId)(type));
|
|
105
|
-
this.postboy.
|
|
54
|
+
this.postboy.exec(new connect_message_executor_1.ConnectMessage(type, sub));
|
|
106
55
|
return this;
|
|
107
56
|
}
|
|
108
57
|
/**
|
|
@@ -115,7 +64,7 @@ class PostboyAbstractRegistrator {
|
|
|
115
64
|
*/
|
|
116
65
|
recordWithPipe(type, sub, pipe) {
|
|
117
66
|
this.ids.push((0, postboy_generic_message_1.checkId)(type));
|
|
118
|
-
this.postboy.
|
|
67
|
+
this.postboy.exec(new connect_message_executor_1.ConnectMessage(type, sub, pipe));
|
|
119
68
|
return this;
|
|
120
69
|
}
|
|
121
70
|
/**
|
|
@@ -126,7 +75,9 @@ class PostboyAbstractRegistrator {
|
|
|
126
75
|
* @return void
|
|
127
76
|
*/
|
|
128
77
|
recordExecutor(type, exec) {
|
|
129
|
-
this.
|
|
78
|
+
this.ids.push((0, postboy_generic_message_1.checkId)(type));
|
|
79
|
+
this.postboy.exec(new connect_executor_executor_1.ConnectExecutor(type, exec));
|
|
80
|
+
return this;
|
|
130
81
|
}
|
|
131
82
|
/**
|
|
132
83
|
* Records a handler for a specific executor type.
|
|
@@ -136,7 +87,51 @@ class PostboyAbstractRegistrator {
|
|
|
136
87
|
* @return void
|
|
137
88
|
*/
|
|
138
89
|
recordHandler(executor, handler) {
|
|
139
|
-
this.
|
|
90
|
+
this.ids.push((0, postboy_generic_message_1.checkId)(executor));
|
|
91
|
+
this.postboy.exec(new connect_handler_executor_1.ConnectHandler(executor, handler));
|
|
92
|
+
return this;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A utility function that facilitates the recording and replaying of messages
|
|
96
|
+
* using a ReplaySubject. This function is designed to handle messages of a
|
|
97
|
+
* specific type and allows specifying a buffer size to determine how many
|
|
98
|
+
* of the most recent messages should be replayed.
|
|
99
|
+
*
|
|
100
|
+
* @template T Extends the PostboyGenericMessage type, representing the type of message
|
|
101
|
+
* to be recorded and replayed.
|
|
102
|
+
* @param {MessageType<T>} type The constructor of the message type to be recorded and replayed.
|
|
103
|
+
* @param {number} [bufferSize=1] The number of recent messages to retain in the ReplaySubject's buffer.
|
|
104
|
+
* Defaults to 1 if not specified.
|
|
105
|
+
* @returns The result of invoking the `record` method with the given message type and configured ReplaySubject.
|
|
106
|
+
*/
|
|
107
|
+
recordReplay(type, bufferSize = 1) {
|
|
108
|
+
this.record(type, new rxjs_1.ReplaySubject(bufferSize));
|
|
109
|
+
return this;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Represents a method that records a specific behavior associated with a message type.
|
|
113
|
+
* It creates a `BehaviorSubject` initialized with the provided initial message
|
|
114
|
+
* and associates it with the given message type using the `record` method.
|
|
115
|
+
*
|
|
116
|
+
* @template T - A type parameter extending `PostboyGenericMessage` that defines the message structure.
|
|
117
|
+
* @param {MessageType<T>} type - The constructor function of the message type to be recorded.
|
|
118
|
+
* @param {T} initial - The initial value of the message that will be set in the `BehaviorSubject`.
|
|
119
|
+
* @returns {void} - This function does not return a value; instead, it modifies the internal state.
|
|
120
|
+
*/
|
|
121
|
+
recordBehavior(type, initial) {
|
|
122
|
+
this.record(type, new rxjs_1.BehaviorSubject(initial));
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A function that creates and returns a new generic message recorder for a specific message type.
|
|
127
|
+
*
|
|
128
|
+
* @template T - A type parameter extending from `PostboyGenericMessage`.
|
|
129
|
+
* @param {MessageType<T>} type - The constructor for the message type being recorded.
|
|
130
|
+
* @returns {Subject<T>} A new instance of `Subject<T>` bound to the specified message type.
|
|
131
|
+
*/
|
|
132
|
+
recordSubject(type) {
|
|
133
|
+
this.record(type, new rxjs_1.Subject());
|
|
134
|
+
return this;
|
|
140
135
|
}
|
|
141
136
|
}
|
|
142
137
|
exports.PostboyAbstractRegistrator = PostboyAbstractRegistrator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-abstract.registrator.js","sourceRoot":"","sources":["../src/postboy-abstract.registrator.ts"],"names":[],"mappings":";;;AACA,+
|
|
1
|
+
{"version":3,"file":"postboy-abstract.registrator.js","sourceRoot":"","sources":["../src/postboy-abstract.registrator.ts"],"names":[],"mappings":";;;AACA,+BAAiF;AAGjF,8EAAkF;AAElF,uDAAmD;AACnD,kFAAqE;AACrE,wFAA2E;AAC3E,oFAAuE;AACvE,kFAAqE;AAIrE,MAAsB,0BAA0B;IAC9C,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAKD,YACY,OAAuB,EACjC,YAA2B,IAAI;QADrB,YAAO,GAAP,OAAO,CAAgB;QAL3B,QAAG,GAAa,EAAE,CAAC;QACnB,aAAQ,GAA+B,EAAE,CAAC;QAOhD,IAAI,CAAC,UAAU,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,0BAAW,CAAC,GAAG,EAAE,CAAC;IACnD,CAAC;IAED;;;;;OAKG;IACI,gBAAgB,CAAC,QAAoC;QAC1D,IAAI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;QAEjB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,iCAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,2CAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACI,aAAa,CAClB,QAAmC,EACnC,OAAsC;QAEtC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,iCAAO,EAAC,QAAQ,CAAC,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,yCAAc,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,YAAY,CACjB,IAAoB,EACpB,UAAU,GAAG,CAAC;QAEd,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,oBAAa,CAAI,UAAU,CAAC,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;;;;OASG;IACI,cAAc,CAAkC,IAAoB,EAAE,OAAU;QACrF,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,sBAAe,CAAI,OAAO,CAAC,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACI,aAAa,CAAkC,IAAoB;QACxE,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,cAAO,EAAK,CAAC,CAAC;QACpC,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAzJD,gEAyJC"}
|
package/lib/postboy.service.d.ts
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
import { Observable, Subject } from 'rxjs';
|
|
2
2
|
import { PostboyGenericMessage } from './models/postboy-generic-message';
|
|
3
|
-
import { PostboyLocker } from './models/postboy.locker';
|
|
4
3
|
import { PostboyExecutor } from './models/postboy-executor';
|
|
5
4
|
import { PostboyCallbackMessage } from './models/postboy-callback.message';
|
|
6
|
-
import { MessageType } from './postboy-abstract.registrator';
|
|
5
|
+
import { MessageType, PostboyAbstractRegistrator } from './postboy-abstract.registrator';
|
|
7
6
|
import { PostboyExecutionHandler } from './models/postboy-execution.handler';
|
|
8
|
-
import { PostboyDependencyResolver } from './services/postboy-dependency.resolver';
|
|
9
7
|
import { PostboyMiddleware } from './models/postboy-middleware';
|
|
8
|
+
import { PostboyDependencyResolver } from './services/postboy-dependency.resolver';
|
|
10
9
|
export declare class PostboyService {
|
|
11
|
-
private locker;
|
|
12
10
|
protected locked: Set<string>;
|
|
13
11
|
private middleware;
|
|
14
12
|
private store;
|
|
13
|
+
private namespaceStore;
|
|
14
|
+
private dependencyResolver;
|
|
15
15
|
constructor(resolver?: PostboyDependencyResolver);
|
|
16
|
-
|
|
17
|
-
* @deprecated The method should be replaced with lock<T>/unlock<T>
|
|
18
|
-
*/
|
|
19
|
-
addLocker(locker: PostboyLocker): void;
|
|
16
|
+
private registerInfrastructureMessages;
|
|
20
17
|
/**
|
|
21
18
|
* Locks a specific message type to prevent further modifications or actions.
|
|
22
19
|
*
|
|
20
|
+
* @deprecated The method should be replaced with firing {@link LockMessage} message.
|
|
23
21
|
* @param {MessageType<T>} type - The message type to be locked. It must extend from the `PostboyGenericMessage`.
|
|
24
22
|
* @return {void} This method does not return a value.
|
|
25
23
|
*/
|
|
@@ -27,33 +25,35 @@ export declare class PostboyService {
|
|
|
27
25
|
/**
|
|
28
26
|
* Unlocks a previously locked message type by removing its ID from the locked set.
|
|
29
27
|
*
|
|
28
|
+
* @deprecated The method should be replaced with firing {@link UnlockMessage} message.
|
|
30
29
|
* @param {MessageType<T>} type - The message type to unlock, which is a generic type extending PostboyGenericMessage.
|
|
31
30
|
* @return {void} This method does not return any value.
|
|
32
31
|
*/
|
|
33
32
|
unlock<T extends PostboyGenericMessage>(type: MessageType<T>): void;
|
|
34
|
-
addMiddleware(middleware: PostboyMiddleware): void;
|
|
35
|
-
removeMiddleware(middleware: PostboyMiddleware): void;
|
|
36
33
|
/**
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
* @
|
|
34
|
+
* Adds a middleware to the middleware stack.
|
|
35
|
+
*
|
|
36
|
+
* @deprecated The method should be replaced with firing {@link AddMiddleware} message.
|
|
37
|
+
* @param {PostboyMiddleware} middleware - The middleware instance to be added.
|
|
38
|
+
* @return {void}
|
|
42
39
|
*/
|
|
43
|
-
|
|
40
|
+
addMiddleware(middleware: PostboyMiddleware): void;
|
|
44
41
|
/**
|
|
45
|
-
*
|
|
42
|
+
* Removes a middleware from the current middleware stack.
|
|
43
|
+
*
|
|
44
|
+
* @deprecated The method should be replaced with firing {@link RemoveMiddleware} message.
|
|
45
|
+
* @param {PostboyMiddleware} middleware - The middleware instance to be removed.
|
|
46
|
+
* @return {void} No return value.
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
+
removeMiddleware(middleware: PostboyMiddleware): void;
|
|
48
49
|
/**
|
|
49
|
-
*
|
|
50
|
+
* Unregisters a message identified by the given ID from the store.
|
|
51
|
+
*
|
|
52
|
+
* @deprecated The method should be replaced with firing {@link DisconnectMessage} message.
|
|
53
|
+
* @param {string} id - The unique identifier of the item to unregister.
|
|
54
|
+
* @return {void} No value is returned.
|
|
50
55
|
*/
|
|
51
|
-
registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
|
|
52
56
|
unregister(id: string): void;
|
|
53
|
-
/**
|
|
54
|
-
* @deprecated The method should be replaced with sub<T>
|
|
55
|
-
*/
|
|
56
|
-
subscribe<T>(id: string): Observable<T>;
|
|
57
57
|
/**
|
|
58
58
|
* Fires a registered event and passes the message to its subscribers.
|
|
59
59
|
*
|
|
@@ -71,6 +71,14 @@ export declare class PostboyService {
|
|
|
71
71
|
* @return {void} This method does not return any value.
|
|
72
72
|
*/
|
|
73
73
|
fireCallback<T>(message: PostboyCallbackMessage<T>, action?: (e: T) => void): Observable<T>;
|
|
74
|
+
/**
|
|
75
|
+
* Executes the provided executor function and returns its result.
|
|
76
|
+
*
|
|
77
|
+
* @param {PostboyExecutor<T>} executor The executor to be executed, which includes its identifier and logic.
|
|
78
|
+
* @return {T} The resulting output from the executed executor function.
|
|
79
|
+
* @throws {Error} If the specified executor is not registered.
|
|
80
|
+
*/
|
|
81
|
+
exec<T>(executor: PostboyExecutor<T>): T;
|
|
74
82
|
/**
|
|
75
83
|
* Subscribes to a specific message type and returns an observable of that type.
|
|
76
84
|
*
|
|
@@ -78,9 +86,17 @@ export declare class PostboyService {
|
|
|
78
86
|
* @return An Observable of the specified generic message type.
|
|
79
87
|
*/
|
|
80
88
|
sub<T extends PostboyGenericMessage>(type: MessageType<T>): Observable<T>;
|
|
89
|
+
/**
|
|
90
|
+
* Subscribes to a specific message type and automatically unsubscribes after receiving the first message.
|
|
91
|
+
*
|
|
92
|
+
* @param type The type of message to subscribe to.
|
|
93
|
+
* @return An observable that emits the first message of the specified type and then completes.
|
|
94
|
+
*/
|
|
95
|
+
once<T extends PostboyGenericMessage>(type: MessageType<T>): Observable<T>;
|
|
81
96
|
/**
|
|
82
97
|
* Registers a given message type and its associated subject subscription with the system.
|
|
83
98
|
*
|
|
99
|
+
* @deprecated The method should be replaced with firing {@link ConnectMessage} message.
|
|
84
100
|
* @param type The constructor function of the message type that extends the PostboyGenericMessage.
|
|
85
101
|
* @param sub The Subject instance for the provided message type, used for managing subscriptions.
|
|
86
102
|
* @return {void} No return value.
|
|
@@ -89,6 +105,7 @@ export declare class PostboyService {
|
|
|
89
105
|
/**
|
|
90
106
|
* Registers a generic message type with a Subject and a transformation pipe.
|
|
91
107
|
*
|
|
108
|
+
* @deprecated The method should be replaced with firing {@link ConnectMessage} message.
|
|
92
109
|
* @param {MessageType<T>} type - The constructor of the message type being registered.
|
|
93
110
|
* @param {Subject<T>} sub - The Subject instance used to handle incoming messages of the specified type.
|
|
94
111
|
* @param {(s: Subject<T>) => Observable<T>} pipe - A function that applies a transformation or processing logic to the Subject and returns an Observable.
|
|
@@ -96,28 +113,45 @@ export declare class PostboyService {
|
|
|
96
113
|
*/
|
|
97
114
|
recordWithPipe<T extends PostboyGenericMessage>(type: MessageType<T>, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
|
|
98
115
|
/**
|
|
99
|
-
*
|
|
116
|
+
* Registers an executor for a specified message type.
|
|
100
117
|
*
|
|
101
|
-
* @
|
|
102
|
-
* @param {
|
|
103
|
-
* @
|
|
118
|
+
* @deprecated The method should be replaced with firing {@link ConnectExecutor} message.
|
|
119
|
+
* @param {MessageType<E>} type - The message type for which the executor is being registered.
|
|
120
|
+
* @param {(e: E) => T} exec - The executor function that will handle messages of the specified type.
|
|
121
|
+
* @return {void} This method does not return any value.
|
|
104
122
|
*/
|
|
105
|
-
recordExecutor<E extends PostboyExecutor<T>, T>(type:
|
|
123
|
+
recordExecutor<E extends PostboyExecutor<T>, T>(type: MessageType<E>, exec: (e: E) => T): void;
|
|
106
124
|
/**
|
|
107
|
-
*
|
|
125
|
+
* Registers a handler for a specific executor type.
|
|
108
126
|
*
|
|
109
|
-
* @
|
|
110
|
-
* @
|
|
111
|
-
* @
|
|
127
|
+
* @deprecated The method should be replaced with firing {@link ConnectHandler} message.
|
|
128
|
+
* @param executor The constructor of the executor class that extends `PostboyExecutor<R>`.
|
|
129
|
+
* @param handler An instance of `PostboyExecutionHandler<R, E>` that defines the logic for handling the executor.
|
|
130
|
+
* @return void
|
|
112
131
|
*/
|
|
113
|
-
|
|
132
|
+
recordHandler<E extends PostboyExecutor<R>, R>(executor: new (...args: any[]) => E, handler: PostboyExecutionHandler<R, E>): void;
|
|
114
133
|
/**
|
|
115
|
-
*
|
|
134
|
+
* Adds a namespace to the namespace store.
|
|
116
135
|
*
|
|
117
|
-
* @
|
|
118
|
-
* @param {
|
|
119
|
-
* @return {
|
|
136
|
+
* @deprecated The method should be replaced with firing {@link AddNamespace} message.
|
|
137
|
+
* @param {string} space - The name of the namespace to be added.
|
|
138
|
+
* @return {PostboyAbstractRegistrator} The instance of the namespace after adding the specified namespace.
|
|
120
139
|
*/
|
|
121
|
-
|
|
140
|
+
addNamespace(space: string): PostboyAbstractRegistrator;
|
|
141
|
+
/**
|
|
142
|
+
* Removes the specified namespace from the namespace store.
|
|
143
|
+
*
|
|
144
|
+
* @deprecated The method should be replaced with firing {@link EliminateNamespace} message.
|
|
145
|
+
* @param {string} space - The name of the namespace to be removed.
|
|
146
|
+
* @return {void} This method does not return a value.
|
|
147
|
+
*/
|
|
148
|
+
eliminateNamespace(space: string): void;
|
|
149
|
+
/**
|
|
150
|
+
* Disposes of resources and cleans up any internal components or stores associated with the instance.
|
|
151
|
+
* This method ensures that all resources are properly released to avoid memory leaks.
|
|
152
|
+
*
|
|
153
|
+
* @return {void} This method does not return a value.
|
|
154
|
+
*/
|
|
155
|
+
dispose(): void;
|
|
122
156
|
}
|
|
123
157
|
//# sourceMappingURL=postboy.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy.service.d.ts","sourceRoot":"","sources":["../src/postboy.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAW,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"postboy.service.d.ts","sourceRoot":"","sources":["../src/postboy.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAW,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAElF,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,0BAA0B,EAAE,MAAM,g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