@artstesh/postboy 1.1.6 → 1.2.0
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 +27 -68
- package/lib/index.d.ts +2 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -1
- package/lib/index.js.map +1 -1
- package/lib/mocks/message-history-mock.d.ts.map +1 -1
- package/lib/mocks/message-history-mock.js +4 -5
- package/lib/mocks/message-history-mock.js.map +1 -1
- package/lib/mocks/postboy-service-mock.d.ts +1 -1
- package/lib/mocks/postboy-service-mock.d.ts.map +1 -1
- package/lib/models/postboy-callback.message.d.ts +18 -0
- package/lib/models/postboy-callback.message.d.ts.map +1 -1
- package/lib/models/postboy-callback.message.js +18 -0
- package/lib/models/postboy-callback.message.js.map +1 -1
- package/lib/models/postboy-executor.d.ts +2 -2
- package/lib/models/postboy-executor.d.ts.map +1 -1
- package/lib/models/postboy-executor.js +2 -2
- package/lib/models/postboy-executor.js.map +1 -1
- package/lib/models/postboy-generic-message.d.ts +2 -2
- package/lib/models/postboy-generic-message.d.ts.map +1 -1
- package/lib/models/postboy-generic-message.js +2 -4
- package/lib/models/postboy-generic-message.js.map +1 -1
- package/lib/models/postboy-middleware.d.ts +5 -0
- package/lib/models/postboy-middleware.d.ts.map +1 -0
- package/lib/models/{postboy-bbb.js → postboy-middleware.js} +3 -3
- package/lib/models/postboy-middleware.js.map +1 -0
- package/lib/models/postboy-subscription.d.ts +6 -3
- package/lib/models/postboy-subscription.d.ts.map +1 -1
- package/lib/models/postboy-subscription.js +11 -2
- package/lib/models/postboy-subscription.js.map +1 -1
- package/lib/models/postboy.message.d.ts +4 -0
- package/lib/models/postboy.message.d.ts.map +1 -0
- package/lib/models/postboy.message.js +10 -0
- package/lib/models/postboy.message.js.map +1 -0
- package/lib/postboy.service.d.ts +23 -6
- package/lib/postboy.service.d.ts.map +1 -1
- package/lib/postboy.service.js +50 -40
- package/lib/postboy.service.js.map +1 -1
- package/lib/services/postboy-dependency.resolver.d.ts +7 -0
- package/lib/services/postboy-dependency.resolver.d.ts.map +1 -0
- package/lib/services/postboy-dependency.resolver.js +13 -0
- package/lib/services/postboy-dependency.resolver.js.map +1 -0
- package/lib/services/postboy-message.store.d.ts +16 -0
- package/lib/services/postboy-message.store.d.ts.map +1 -0
- package/lib/services/postboy-message.store.js +39 -0
- package/lib/services/postboy-message.store.js.map +1 -0
- package/lib/services/postboy-middleware.service.d.ts +9 -0
- package/lib/services/postboy-middleware.service.d.ts.map +1 -0
- package/lib/services/postboy-middleware.service.js +20 -0
- package/lib/services/postboy-middleware.service.js.map +1 -0
- package/lib/tests/integration/models/test-callback-message.d.ts +6 -0
- package/lib/tests/integration/models/test-callback-message.d.ts.map +1 -0
- package/lib/tests/integration/models/test-callback-message.js +13 -0
- package/lib/tests/integration/models/test-callback-message.js.map +1 -0
- package/lib/tests/integration/models/test-executor.d.ts +7 -0
- package/lib/tests/integration/models/test-executor.d.ts.map +1 -0
- package/lib/tests/integration/models/test-executor.js +13 -0
- package/lib/tests/integration/models/test-executor.js.map +1 -0
- package/lib/tests/integration/models/test-handler.d.ts +8 -0
- package/lib/tests/integration/models/test-handler.d.ts.map +1 -0
- package/lib/tests/integration/models/test-handler.js +15 -0
- package/lib/tests/integration/models/test-handler.js.map +1 -0
- package/lib/tests/integration/models/test-message.d.ts +6 -0
- package/lib/tests/integration/models/test-message.d.ts.map +1 -0
- package/lib/tests/integration/models/test-message.js +13 -0
- package/lib/tests/integration/models/test-message.js.map +1 -0
- package/lib/tests/integration/models/test-postboy.d.ts +4 -0
- package/lib/tests/integration/models/test-postboy.d.ts.map +1 -0
- package/lib/tests/integration/models/test-postboy.js +8 -0
- package/lib/tests/integration/models/test-postboy.js.map +1 -0
- package/lib/tests/integration/models/test-registry.d.ts +8 -0
- package/lib/tests/integration/models/test-registry.d.ts.map +1 -0
- package/lib/tests/integration/models/test-registry.js +15 -0
- package/lib/tests/integration/models/test-registry.js.map +1 -0
- package/package.json +2 -3
- package/lib/models/dictionary.d.ts +0 -18
- package/lib/models/dictionary.d.ts.map +0 -1
- package/lib/models/dictionary.js +0 -59
- package/lib/models/dictionary.js.map +0 -1
- package/lib/models/id-generator.d.ts +0 -4
- package/lib/models/id-generator.d.ts.map +0 -1
- package/lib/models/id-generator.js +0 -14
- package/lib/models/id-generator.js.map +0 -1
- package/lib/models/postboy-bbb.d.ts +0 -4
- package/lib/models/postboy-bbb.d.ts.map +0 -1
- package/lib/models/postboy-bbb.js.map +0 -1
package/lib/postboy.service.js
CHANGED
|
@@ -4,61 +4,78 @@ exports.PostboyService = void 0;
|
|
|
4
4
|
const postboy_generic_message_1 = require("./models/postboy-generic-message");
|
|
5
5
|
const locker_store_1 = require("./locker.store");
|
|
6
6
|
const postboy_subscription_1 = require("./models/postboy-subscription");
|
|
7
|
-
const
|
|
7
|
+
const postboy_dependency_resolver_1 = require("./services/postboy-dependency.resolver");
|
|
8
8
|
class PostboyService {
|
|
9
|
-
constructor() {
|
|
10
|
-
this.applications = new collections_1.Dictionary();
|
|
9
|
+
constructor(resolver) {
|
|
11
10
|
this.locker = new locker_store_1.LockerStore();
|
|
12
|
-
this.
|
|
11
|
+
this.locked = new Set();
|
|
12
|
+
const rsv = resolver || new postboy_dependency_resolver_1.PostboyDependencyResolver();
|
|
13
|
+
this.middleware = rsv.getMiddlewareService();
|
|
14
|
+
this.store = rsv.getMessageStore();
|
|
13
15
|
}
|
|
14
16
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* @param {PostboyLocker} locker - The locker object to be added.
|
|
18
|
-
* @return {void} This method does not return a value.
|
|
17
|
+
* @deprecated The method should be replaced with lock<T>/unlock<T>
|
|
19
18
|
*/
|
|
20
19
|
addLocker(locker) {
|
|
21
20
|
this.locker.addLocker(locker);
|
|
22
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Locks a specific message type to prevent further modifications or actions.
|
|
24
|
+
*
|
|
25
|
+
* @param {MessageType<T>} type - The message type to be locked. It must extend from the `PostboyGenericMessage`.
|
|
26
|
+
* @return {void} This method does not return a value.
|
|
27
|
+
*/
|
|
28
|
+
lock(type) {
|
|
29
|
+
this.locked.add((0, postboy_generic_message_1.checkId)(type));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Unlocks a previously locked message type by removing its ID from the locked set.
|
|
33
|
+
*
|
|
34
|
+
* @param {MessageType<T>} type - The message type to unlock, which is a generic type extending PostboyGenericMessage.
|
|
35
|
+
* @return {void} This method does not return any value.
|
|
36
|
+
*/
|
|
37
|
+
unlock(type) {
|
|
38
|
+
this.locked.delete((0, postboy_generic_message_1.checkId)(type));
|
|
39
|
+
}
|
|
40
|
+
addMiddleware(middleware) {
|
|
41
|
+
return this.middleware.addMiddleware(middleware);
|
|
42
|
+
}
|
|
43
|
+
removeMiddleware(middleware) {
|
|
44
|
+
return this.middleware.removeMiddleware(middleware);
|
|
45
|
+
}
|
|
23
46
|
/**
|
|
24
47
|
* @deprecated The method should be replaced with recordExecutor<T>
|
|
25
48
|
*/
|
|
26
49
|
registerExecutor(id, exec) {
|
|
27
|
-
this.
|
|
50
|
+
this.store.registerExecutor(id, exec);
|
|
28
51
|
}
|
|
29
52
|
/**
|
|
30
53
|
* @deprecated The method should be replaced with exec<T>
|
|
31
54
|
*/
|
|
32
55
|
execute(executor) {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
return this.executors.take(executor.id)(executor);
|
|
56
|
+
this.middleware.manage(executor);
|
|
57
|
+
return this.store.getExecutor(executor.id)(executor);
|
|
36
58
|
}
|
|
37
59
|
/**
|
|
38
60
|
* @deprecated The method should be replaced with record<T>
|
|
39
61
|
*/
|
|
40
62
|
register(id, sub) {
|
|
41
|
-
this.
|
|
63
|
+
this.store.registerMessage(id, new postboy_subscription_1.PostboySubscription(sub, (s) => s.asObservable()));
|
|
42
64
|
}
|
|
43
65
|
/**
|
|
44
66
|
* @deprecated The method should be replaced with recordWithPipe<T>
|
|
45
67
|
*/
|
|
46
68
|
registerWithPipe(id, sub, pipe) {
|
|
47
|
-
this.
|
|
69
|
+
this.store.registerMessage(id, new postboy_subscription_1.PostboySubscription(sub, pipe));
|
|
48
70
|
}
|
|
49
71
|
unregister(id) {
|
|
50
|
-
|
|
51
|
-
(_b = (_a = this.applications.take(id)) === null || _a === void 0 ? void 0 : _a.sub) === null || _b === void 0 ? void 0 : _b.complete();
|
|
52
|
-
this.applications.rmv(id);
|
|
72
|
+
return this.store.unregister(id);
|
|
53
73
|
}
|
|
54
74
|
/**
|
|
55
75
|
* @deprecated The method should be replaced with sub<T>
|
|
56
76
|
*/
|
|
57
77
|
subscribe(id) {
|
|
58
|
-
|
|
59
|
-
if (!application)
|
|
60
|
-
throw new Error(`There is no event with id ${id}`);
|
|
61
|
-
return application.pipe(application.sub);
|
|
78
|
+
return this.store.getMessage(id, id).sub();
|
|
62
79
|
}
|
|
63
80
|
/**
|
|
64
81
|
* Fires a registered event and passes the message to its subscribers.
|
|
@@ -68,11 +85,9 @@ class PostboyService {
|
|
|
68
85
|
* @throws {Error} Throws an error if no registered event is found for the provided message ID.
|
|
69
86
|
*/
|
|
70
87
|
fire(message) {
|
|
71
|
-
|
|
72
|
-
if (!((_a = this.applications.take(message.id)) === null || _a === void 0 ? void 0 : _a.sub))
|
|
73
|
-
throw new Error(`There is no registered event ${message.constructor.name}`);
|
|
88
|
+
this.middleware.manage(message);
|
|
74
89
|
if (this.locker.check(message.id))
|
|
75
|
-
|
|
90
|
+
this.store.getMessage(message.id, message.constructor.name).fire(message);
|
|
76
91
|
}
|
|
77
92
|
/**
|
|
78
93
|
* Triggers a callback function associated with a given message.
|
|
@@ -83,12 +98,11 @@ class PostboyService {
|
|
|
83
98
|
* @return {void} This method does not return any value.
|
|
84
99
|
*/
|
|
85
100
|
fireCallback(message, action) {
|
|
86
|
-
|
|
87
|
-
if (!((_a = this.applications.take(message.id)) === null || _a === void 0 ? void 0 : _a.sub))
|
|
88
|
-
throw new Error(`There is no registered event ${message.constructor.name}`);
|
|
101
|
+
this.middleware.manage(message);
|
|
89
102
|
message.result.subscribe(action);
|
|
90
103
|
if (this.locker.check(message.id))
|
|
91
|
-
(
|
|
104
|
+
setTimeout(() => this.store.getMessage(message.id, message.constructor.name).fire(message));
|
|
105
|
+
return message.result;
|
|
92
106
|
}
|
|
93
107
|
// future
|
|
94
108
|
/**
|
|
@@ -98,10 +112,7 @@ class PostboyService {
|
|
|
98
112
|
* @return An Observable of the specified generic message type.
|
|
99
113
|
*/
|
|
100
114
|
sub(type) {
|
|
101
|
-
|
|
102
|
-
if (!application)
|
|
103
|
-
throw new Error(`There is no registered event ${type.name}`);
|
|
104
|
-
return application.pipe(application.sub);
|
|
115
|
+
return this.store.getMessage((0, postboy_generic_message_1.checkId)(type), type.name).sub();
|
|
105
116
|
}
|
|
106
117
|
/**
|
|
107
118
|
* Registers a given message type and its associated subject subscription with the system.
|
|
@@ -111,7 +122,7 @@ class PostboyService {
|
|
|
111
122
|
* @return {void} No return value.
|
|
112
123
|
*/
|
|
113
124
|
record(type, sub) {
|
|
114
|
-
this.
|
|
125
|
+
this.store.registerMessage((0, postboy_generic_message_1.checkId)(type), new postboy_subscription_1.PostboySubscription(sub, (s) => s.asObservable()));
|
|
115
126
|
}
|
|
116
127
|
/**
|
|
117
128
|
* Registers a generic message type with a Subject and a transformation pipe.
|
|
@@ -122,7 +133,7 @@ class PostboyService {
|
|
|
122
133
|
* @return {void} No return value.
|
|
123
134
|
*/
|
|
124
135
|
recordWithPipe(type, sub, pipe) {
|
|
125
|
-
this.
|
|
136
|
+
this.store.registerMessage((0, postboy_generic_message_1.checkId)(type), new postboy_subscription_1.PostboySubscription(sub, pipe));
|
|
126
137
|
}
|
|
127
138
|
/**
|
|
128
139
|
* Records an executor instance and its corresponding execution function.
|
|
@@ -132,7 +143,7 @@ class PostboyService {
|
|
|
132
143
|
* @return {void} No return value.
|
|
133
144
|
*/
|
|
134
145
|
recordExecutor(type, exec) {
|
|
135
|
-
this.
|
|
146
|
+
this.store.registerExecutor((0, postboy_generic_message_1.checkId)(type), exec);
|
|
136
147
|
}
|
|
137
148
|
/**
|
|
138
149
|
* Executes the provided executor function and returns its result.
|
|
@@ -142,9 +153,8 @@ class PostboyService {
|
|
|
142
153
|
* @throws {Error} If the specified executor is not registered.
|
|
143
154
|
*/
|
|
144
155
|
exec(executor) {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return this.executors.take(executor.id)(executor);
|
|
156
|
+
this.middleware.manage(executor);
|
|
157
|
+
return this.store.getExecutor(executor.id)(executor);
|
|
148
158
|
}
|
|
149
159
|
/**
|
|
150
160
|
* Manages the recording of an executor and its corresponding handler into internal storage.
|
|
@@ -154,7 +164,7 @@ class PostboyService {
|
|
|
154
164
|
* @return {void} No return value.
|
|
155
165
|
*/
|
|
156
166
|
recordHandler(executor, handler) {
|
|
157
|
-
this.
|
|
167
|
+
this.store.registerExecutor((0, postboy_generic_message_1.checkId)(executor), (e) => handler.handle(e));
|
|
158
168
|
}
|
|
159
169
|
}
|
|
160
170
|
exports.PostboyService = PostboyService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy.service.js","sourceRoot":"","sources":["../src/postboy.service.ts"],"names":[],"mappings":";;;AACA,8EAAkF;AAClF,iDAA6C;AAE7C,wEAAoE;
|
|
1
|
+
{"version":3,"file":"postboy.service.js","sourceRoot":"","sources":["../src/postboy.service.ts"],"names":[],"mappings":";;;AACA,8EAAkF;AAClF,iDAA6C;AAE7C,wEAAoE;AAOpE,wFAAmF;AAGnF,MAAa,cAAc;IAMzB,YAAY,QAAoC;QALxC,WAAM,GAAG,IAAI,0BAAW,EAAE,CAAC;QACzB,WAAM,GAAG,IAAI,GAAG,EAAU,CAAC;QAKnC,MAAM,GAAG,GAAG,QAAQ,IAAI,IAAI,uDAAyB,EAAE,CAAC;QACxD,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC,oBAAoB,EAAE,CAAC;QAC7C,IAAI,CAAC,KAAK,GAAG,GAAG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,CAAC;IAChF,CAAC;CACF;AA9LD,wCA8LC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PostboyMiddlewareService } from './postboy-middleware.service';
|
|
2
|
+
import { PostboyMessageStore } from './postboy-message.store';
|
|
3
|
+
export declare class PostboyDependencyResolver {
|
|
4
|
+
getMiddlewareService: () => PostboyMiddlewareService;
|
|
5
|
+
getMessageStore: () => PostboyMessageStore;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=postboy-dependency.resolver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-dependency.resolver.d.ts","sourceRoot":"","sources":["../../src/services/postboy-dependency.resolver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,qBAAa,yBAAyB;IACpC,oBAAoB,iCAAwC;IAC5D,eAAe,4BAAmC;CACnD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostboyDependencyResolver = void 0;
|
|
4
|
+
const postboy_middleware_service_1 = require("./postboy-middleware.service");
|
|
5
|
+
const postboy_message_store_1 = require("./postboy-message.store");
|
|
6
|
+
class PostboyDependencyResolver {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.getMiddlewareService = () => new postboy_middleware_service_1.PostboyMiddlewareService();
|
|
9
|
+
this.getMessageStore = () => new postboy_message_store_1.PostboyMessageStore();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.PostboyDependencyResolver = PostboyDependencyResolver;
|
|
13
|
+
//# sourceMappingURL=postboy-dependency.resolver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-dependency.resolver.js","sourceRoot":"","sources":["../../src/services/postboy-dependency.resolver.ts"],"names":[],"mappings":";;;AAAA,6EAAwE;AACxE,mEAA8D;AAE9D,MAAa,yBAAyB;IAAtC;QACE,yBAAoB,GAAG,GAAG,EAAE,CAAC,IAAI,qDAAwB,EAAE,CAAC;QAC5D,oBAAe,GAAG,GAAG,EAAE,CAAC,IAAI,2CAAmB,EAAE,CAAC;IACpD,CAAC;CAAA;AAHD,8DAGC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PostboySubscription } from '../models/postboy-subscription';
|
|
2
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
3
|
+
/**
|
|
4
|
+
* The PostboyMessageStore is a utility class for managing message subscriptions and executors.
|
|
5
|
+
* It provides functionality to register, retrieve, and unregister subscription-based messages and executors.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PostboyMessageStore {
|
|
8
|
+
protected applications: Map<string, PostboySubscription<any>>;
|
|
9
|
+
protected executors: Map<string, (e: PostboyExecutor<any>) => any>;
|
|
10
|
+
registerMessage(id: string, sub: PostboySubscription<any>): void;
|
|
11
|
+
registerExecutor(id: string, executor: (e: PostboyExecutor<any>) => any): void;
|
|
12
|
+
getMessage(id: string, name: string): PostboySubscription<any>;
|
|
13
|
+
getExecutor<T>(id: string): (e: PostboyExecutor<T>) => T;
|
|
14
|
+
unregister(id: string): void;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=postboy-message.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-message.store.d.ts","sourceRoot":"","sources":["../../src/services/postboy-message.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;GAGG;AACH,qBAAa,mBAAmB;IAC9B,SAAS,CAAC,YAAY,wCAA+C;IACrE,SAAS,CAAC,SAAS,kBAAuB,gBAAgB,GAAG,CAAC,KAAK,GAAG,EAAI;IAEnE,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,mBAAmB,CAAC,GAAG,CAAC,GAAG,IAAI;IAIhE,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,eAAe,CAAC,GAAG,CAAC,KAAK,GAAG,GAAG,IAAI;IAI9E,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,mBAAmB,CAAC,GAAG,CAAC;IAM9D,WAAW,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC,CAAC,KAAK,CAAC;IAMxD,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI;CAKpC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostboyMessageStore = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The PostboyMessageStore is a utility class for managing message subscriptions and executors.
|
|
6
|
+
* It provides functionality to register, retrieve, and unregister subscription-based messages and executors.
|
|
7
|
+
*/
|
|
8
|
+
class PostboyMessageStore {
|
|
9
|
+
constructor() {
|
|
10
|
+
this.applications = new Map();
|
|
11
|
+
this.executors = new Map();
|
|
12
|
+
}
|
|
13
|
+
registerMessage(id, sub) {
|
|
14
|
+
this.applications.set(id, sub);
|
|
15
|
+
}
|
|
16
|
+
registerExecutor(id, executor) {
|
|
17
|
+
this.executors.set(id, executor);
|
|
18
|
+
}
|
|
19
|
+
getMessage(id, name) {
|
|
20
|
+
const msg = this.applications.get(id);
|
|
21
|
+
if (!msg)
|
|
22
|
+
throw new Error(`There is no registered event ${name}`);
|
|
23
|
+
return msg;
|
|
24
|
+
}
|
|
25
|
+
getExecutor(id) {
|
|
26
|
+
const executorFunction = this.executors.get(id);
|
|
27
|
+
if (!executorFunction)
|
|
28
|
+
throw new Error(`There is no registered executor with id ${id}`);
|
|
29
|
+
return executorFunction;
|
|
30
|
+
}
|
|
31
|
+
unregister(id) {
|
|
32
|
+
var _a;
|
|
33
|
+
(_a = this.applications.get(id)) === null || _a === void 0 ? void 0 : _a.finish();
|
|
34
|
+
this.applications.delete(id);
|
|
35
|
+
this.executors.delete(id);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.PostboyMessageStore = PostboyMessageStore;
|
|
39
|
+
//# sourceMappingURL=postboy-message.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-message.store.js","sourceRoot":"","sources":["../../src/services/postboy-message.store.ts"],"names":[],"mappings":";;;AAGA;;;GAGG;AACH,MAAa,mBAAmB;IAAhC;QACY,iBAAY,GAAG,IAAI,GAAG,EAAoC,CAAC;QAC3D,cAAS,GAAG,IAAI,GAAG,EAA4C,CAAC;IA2B5E,CAAC;IAzBQ,eAAe,CAAC,EAAU,EAAE,GAA6B;QAC9D,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IACjC,CAAC;IAEM,gBAAgB,CAAC,EAAU,EAAE,QAA0C;QAC5E,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;IACnC,CAAC;IAEM,UAAU,CAAC,EAAU,EAAE,IAAY;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QACtC,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,IAAI,EAAE,CAAC,CAAC;QAClE,OAAO,GAAG,CAAC;IACb,CAAC;IAEM,WAAW,CAAI,EAAU;QAC9B,MAAM,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChD,IAAI,CAAC,gBAAgB;YAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,EAAE,EAAE,CAAC,CAAC;QACxF,OAAO,gBAAgB,CAAC;IAC1B,CAAC;IAEM,UAAU,CAAC,EAAU;;QAC1B,MAAA,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,EAAE,CAAC,0CAAE,MAAM,EAAE,CAAC;QACpC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IAC5B,CAAC;CACF;AA7BD,kDA6BC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PostboyMiddleware } from '../models/postboy-middleware';
|
|
2
|
+
import { PostboyMessage } from '../models/postboy.message';
|
|
3
|
+
export declare class PostboyMiddlewareService {
|
|
4
|
+
protected middlewares: PostboyMiddleware[];
|
|
5
|
+
addMiddleware(middleware: PostboyMiddleware): void;
|
|
6
|
+
removeMiddleware(middleware: PostboyMiddleware): void;
|
|
7
|
+
manage(msg: PostboyMessage): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=postboy-middleware.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-middleware.service.d.ts","sourceRoot":"","sources":["../../src/services/postboy-middleware.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,qBAAa,wBAAwB;IACnC,SAAS,CAAC,WAAW,EAAE,iBAAiB,EAAE,CAAM;IAEzC,aAAa,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAIlD,gBAAgB,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAIrD,MAAM,CAAC,GAAG,EAAE,cAAc,GAAG,IAAI;CAGzC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostboyMiddlewareService = void 0;
|
|
4
|
+
class PostboyMiddlewareService {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.middlewares = [];
|
|
7
|
+
}
|
|
8
|
+
addMiddleware(middleware) {
|
|
9
|
+
this.middlewares.push(middleware);
|
|
10
|
+
}
|
|
11
|
+
removeMiddleware(middleware) {
|
|
12
|
+
this.middlewares = this.middlewares.filter((m) => m !== middleware);
|
|
13
|
+
}
|
|
14
|
+
manage(msg) {
|
|
15
|
+
for (const item of this.middlewares)
|
|
16
|
+
item.handle(msg);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.PostboyMiddlewareService = PostboyMiddlewareService;
|
|
20
|
+
//# sourceMappingURL=postboy-middleware.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-middleware.service.js","sourceRoot":"","sources":["../../src/services/postboy-middleware.service.ts"],"names":[],"mappings":";;;AAGA,MAAa,wBAAwB;IAArC;QACY,gBAAW,GAAwB,EAAE,CAAC;IAalD,CAAC;IAXQ,aAAa,CAAC,UAA6B;QAChD,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACpC,CAAC;IAEM,gBAAgB,CAAC,UAA6B;QACnD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC;IACtE,CAAC;IAEM,MAAM,CAAC,GAAmB;QAC/B,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,WAAW;YAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACxD,CAAC;CACF;AAdD,4DAcC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PostboyCallbackMessage } from '../../../models/postboy-callback.message';
|
|
2
|
+
export declare class TestCallbackMessage extends PostboyCallbackMessage<string> {
|
|
3
|
+
static ID: string;
|
|
4
|
+
type: typeof TestCallbackMessage;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=test-callback-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-callback-message.d.ts","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-callback-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,0CAA0C,CAAC;AAElF,qBAAa,mBAAoB,SAAQ,sBAAsB,CAAC,MAAM,CAAC;IACrE,MAAM,CAAC,EAAE,SAA2B;IACpC,IAAI,6BAAuB;CAC5B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestCallbackMessage = void 0;
|
|
4
|
+
const postboy_callback_message_1 = require("../../../models/postboy-callback.message");
|
|
5
|
+
class TestCallbackMessage extends postboy_callback_message_1.PostboyCallbackMessage {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.type = TestCallbackMessage;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.TestCallbackMessage = TestCallbackMessage;
|
|
12
|
+
TestCallbackMessage.ID = 'test-callback-message';
|
|
13
|
+
//# sourceMappingURL=test-callback-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-callback-message.js","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-callback-message.ts"],"names":[],"mappings":";;;AAAA,uFAAkF;AAElF,MAAa,mBAAoB,SAAQ,iDAA8B;IAAvE;;QAEE,SAAI,GAAG,mBAAmB,CAAC;IAC7B,CAAC;;AAHD,kDAGC;AAFQ,sBAAE,GAAG,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '../../../models/postboy-generic-message';
|
|
2
|
+
export declare class TestExecutor extends PostboyGenericMessage {
|
|
3
|
+
value: string;
|
|
4
|
+
static readonly ID = "TestExecutor";
|
|
5
|
+
constructor(value: string);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=test-executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-executor.d.ts","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF,qBAAa,YAAa,SAAQ,qBAAqB;IAGlC,KAAK,EAAE,MAAM;IAFhC,MAAM,CAAC,QAAQ,CAAC,EAAE,kBAAkB;gBAEjB,KAAK,EAAE,MAAM;CAGjC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestExecutor = void 0;
|
|
4
|
+
const postboy_generic_message_1 = require("../../../models/postboy-generic-message");
|
|
5
|
+
class TestExecutor extends postboy_generic_message_1.PostboyGenericMessage {
|
|
6
|
+
constructor(value) {
|
|
7
|
+
super();
|
|
8
|
+
this.value = value;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.TestExecutor = TestExecutor;
|
|
12
|
+
TestExecutor.ID = 'TestExecutor';
|
|
13
|
+
//# sourceMappingURL=test-executor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-executor.js","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-executor.ts"],"names":[],"mappings":";;;AAAA,qFAAgF;AAEhF,MAAa,YAAa,SAAQ,+CAAqB;IAGrD,YAAmB,KAAa;QAC9B,KAAK,EAAE,CAAC;QADS,UAAK,GAAL,KAAK,CAAQ;IAEhC,CAAC;;AALH,oCAMC;AALiB,eAAE,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostboyExecutionHandler } from '../../../models/postboy-execution.handler';
|
|
2
|
+
import { TestExecutor } from './test-executor';
|
|
3
|
+
export declare class TestHandler extends PostboyExecutionHandler<string, TestExecutor> {
|
|
4
|
+
toReturn: string;
|
|
5
|
+
constructor(toReturn: string);
|
|
6
|
+
handle(executor: TestExecutor): string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=test-handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-handler.d.ts","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,qBAAa,WAAY,SAAQ,uBAAuB,CAAC,MAAM,EAAE,YAAY,CAAC;IACzD,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM;IAInC,MAAM,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM;CAGvC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestHandler = void 0;
|
|
4
|
+
const postboy_execution_handler_1 = require("../../../models/postboy-execution.handler");
|
|
5
|
+
class TestHandler extends postboy_execution_handler_1.PostboyExecutionHandler {
|
|
6
|
+
constructor(toReturn) {
|
|
7
|
+
super();
|
|
8
|
+
this.toReturn = toReturn;
|
|
9
|
+
}
|
|
10
|
+
handle(executor) {
|
|
11
|
+
return this.toReturn;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TestHandler = TestHandler;
|
|
15
|
+
//# sourceMappingURL=test-handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-handler.js","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-handler.ts"],"names":[],"mappings":";;;AAAA,yFAAoF;AAGpF,MAAa,WAAY,SAAQ,mDAA6C;IAC5E,YAAmB,QAAgB;QACjC,KAAK,EAAE,CAAC;QADS,aAAQ,GAAR,QAAQ,CAAQ;IAEnC,CAAC;IAED,MAAM,CAAC,QAAsB;QAC3B,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;CACF;AARD,kCAQC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-message.d.ts","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF,qBAAa,WAAY,SAAQ,qBAAqB;IACpD,MAAM,CAAC,EAAE,SAAkB;IAC3B,IAAI,qBAAe;CACpB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestMessage = void 0;
|
|
4
|
+
const postboy_generic_message_1 = require("../../../models/postboy-generic-message");
|
|
5
|
+
class TestMessage extends postboy_generic_message_1.PostboyGenericMessage {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.type = TestMessage;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
exports.TestMessage = TestMessage;
|
|
12
|
+
TestMessage.ID = 'test-message';
|
|
13
|
+
//# sourceMappingURL=test-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-message.js","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-message.ts"],"names":[],"mappings":";;;AAAA,qFAAgF;AAEhF,MAAa,WAAY,SAAQ,+CAAqB;IAAtD;;QAEE,SAAI,GAAG,WAAW,CAAC;IACrB,CAAC;;AAHD,kCAGC;AAFQ,cAAE,GAAG,cAAc,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-postboy.d.ts","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-postboy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,qBAAa,WAAY,SAAQ,cAAc;CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestPostboy = void 0;
|
|
4
|
+
const postboy_service_1 = require("../../../postboy.service");
|
|
5
|
+
class TestPostboy extends postboy_service_1.PostboyService {
|
|
6
|
+
}
|
|
7
|
+
exports.TestPostboy = TestPostboy;
|
|
8
|
+
//# sourceMappingURL=test-postboy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-postboy.js","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-postboy.ts"],"names":[],"mappings":";;;AAAA,8DAA0D;AAE1D,MAAa,WAAY,SAAQ,gCAAc;CAAG;AAAlD,kCAAkD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostboyAbstractRegistrator } from '../../../postboy-abstract.registrator';
|
|
2
|
+
import { TestPostboy } from './test-postboy';
|
|
3
|
+
export declare class TestReg extends PostboyAbstractRegistrator {
|
|
4
|
+
ups: ((r: this) => void)[];
|
|
5
|
+
constructor(postboy: TestPostboy);
|
|
6
|
+
protected _up(): void;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=test-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-registry.d.ts","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,qBAAa,OAAQ,SAAQ,0BAA0B;IACrD,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,CAAC,EAAE,CAAM;gBAEpB,OAAO,EAAE,WAAW;IAIhC,SAAS,CAAC,GAAG,IAAI,IAAI;CAGtB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TestReg = void 0;
|
|
4
|
+
const postboy_abstract_registrator_1 = require("../../../postboy-abstract.registrator");
|
|
5
|
+
class TestReg extends postboy_abstract_registrator_1.PostboyAbstractRegistrator {
|
|
6
|
+
constructor(postboy) {
|
|
7
|
+
super(postboy);
|
|
8
|
+
this.ups = [];
|
|
9
|
+
}
|
|
10
|
+
_up() {
|
|
11
|
+
this.ups.forEach((up) => up(this));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.TestReg = TestReg;
|
|
15
|
+
//# sourceMappingURL=test-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-registry.js","sourceRoot":"","sources":["../../../../src/tests/integration/models/test-registry.ts"],"names":[],"mappings":";;;AAAA,wFAAmF;AAGnF,MAAa,OAAQ,SAAQ,yDAA0B;IAGrD,YAAY,OAAoB;QAC9B,KAAK,CAAC,OAAO,CAAC,CAAC;QAHjB,QAAG,GAA0B,EAAE,CAAC;IAIhC,CAAC;IAES,GAAG;QACX,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IACrC,CAAC;CACF;AAVD,0BAUC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@artstesh/postboy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"author": "artstesh",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -29,8 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"rxjs": ">6.0.0",
|
|
32
|
-
"typescript": "^4.0.0"
|
|
33
|
-
"@artstesh/collections": "^1.0.4"
|
|
32
|
+
"typescript": "^4.0.0"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"rxjs": "^6.0.0",
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export declare class Dictionary<T> {
|
|
2
|
-
collection: DictionaryType<T>;
|
|
3
|
-
private _keys;
|
|
4
|
-
get keys(): string[];
|
|
5
|
-
get size(): number;
|
|
6
|
-
static clone<T>(dic: Dictionary<T>, action?: (e: T, k: string) => T): Dictionary<T>;
|
|
7
|
-
static create<T>(dic: DictionaryType<T>, action?: (e: T, k: string) => T): Dictionary<T>;
|
|
8
|
-
find(predicate: (value: T) => boolean): T | null;
|
|
9
|
-
has: (key: string) => boolean;
|
|
10
|
-
take(key: string): T | null;
|
|
11
|
-
put(key: string, value?: T | null): void;
|
|
12
|
-
rmv(key: string): void;
|
|
13
|
-
forEach(callback: (value: T, index: number) => void): void;
|
|
14
|
-
}
|
|
15
|
-
export type DictionaryType<T> = {
|
|
16
|
-
[id: string]: T;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=dictionary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","sourceRoot":"","sources":["../../src/models/dictionary.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAU,CAAC,CAAC;IAChB,UAAU,EAAE,cAAc,CAAC,CAAC,CAAC,CAAM;IAC1C,OAAO,CAAC,KAAK,CAAqB;IAElC,IAAW,IAAI,IAAI,MAAM,EAAE,CAE1B;IAED,IAAW,IAAI,IAAI,MAAM,CAExB;WAEa,KAAK,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;WAI5E,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,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