@artstesh/postboy 1.4.5 → 1.5.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.
Files changed (88) hide show
  1. package/lib/index.cjs +849 -1
  2. package/lib/index.cjs.map +1 -1
  3. package/lib/index.d.mts +703 -0
  4. package/lib/index.d.ts +703 -10
  5. package/lib/index.mjs +823 -1
  6. package/lib/index.mjs.map +1 -1
  7. package/package.json +5 -5
  8. package/lib/i-postboy-depending.service.d.ts +0 -5
  9. package/lib/i-postboy-depending.service.d.ts.map +0 -1
  10. package/lib/index.d.ts.map +0 -1
  11. package/lib/messages/add-middleware.executor.d.ts +0 -19
  12. package/lib/messages/add-middleware.executor.d.ts.map +0 -1
  13. package/lib/messages/add-namespace.executor.d.ts +0 -19
  14. package/lib/messages/add-namespace.executor.d.ts.map +0 -1
  15. package/lib/messages/connect-executor.executor.d.ts +0 -25
  16. package/lib/messages/connect-executor.executor.d.ts.map +0 -1
  17. package/lib/messages/connect-handler.executor.d.ts +0 -25
  18. package/lib/messages/connect-handler.executor.d.ts.map +0 -1
  19. package/lib/messages/connect-message.executor.d.ts +0 -28
  20. package/lib/messages/connect-message.executor.d.ts.map +0 -1
  21. package/lib/messages/disconnect-message.executor.d.ts +0 -19
  22. package/lib/messages/disconnect-message.executor.d.ts.map +0 -1
  23. package/lib/messages/eliminate-namespace.executor.d.ts +0 -16
  24. package/lib/messages/eliminate-namespace.executor.d.ts.map +0 -1
  25. package/lib/messages/index.d.ts +0 -11
  26. package/lib/messages/index.d.ts.map +0 -1
  27. package/lib/messages/lock-message.executor.d.ts +0 -22
  28. package/lib/messages/lock-message.executor.d.ts.map +0 -1
  29. package/lib/messages/remove-middleware.executor.d.ts +0 -17
  30. package/lib/messages/remove-middleware.executor.d.ts.map +0 -1
  31. package/lib/messages/unlock-message.executor.d.ts +0 -21
  32. package/lib/messages/unlock-message.executor.d.ts.map +0 -1
  33. package/lib/models/index.d.ts +0 -8
  34. package/lib/models/index.d.ts.map +0 -1
  35. package/lib/models/postboy-callback.message.d.ts +0 -48
  36. package/lib/models/postboy-callback.message.d.ts.map +0 -1
  37. package/lib/models/postboy-execution.handler.d.ts +0 -21
  38. package/lib/models/postboy-execution.handler.d.ts.map +0 -1
  39. package/lib/models/postboy-executor.d.ts +0 -5
  40. package/lib/models/postboy-executor.d.ts.map +0 -1
  41. package/lib/models/postboy-generic-message.d.ts +0 -8
  42. package/lib/models/postboy-generic-message.d.ts.map +0 -1
  43. package/lib/models/postboy-message-metadata.d.ts +0 -26
  44. package/lib/models/postboy-message-metadata.d.ts.map +0 -1
  45. package/lib/models/postboy-message.context.d.ts +0 -9
  46. package/lib/models/postboy-message.context.d.ts.map +0 -1
  47. package/lib/models/postboy-middleware.d.ts +0 -5
  48. package/lib/models/postboy-middleware.d.ts.map +0 -1
  49. package/lib/models/postboy-subscription.d.ts +0 -39
  50. package/lib/models/postboy-subscription.d.ts.map +0 -1
  51. package/lib/models/postboy.message.d.ts +0 -7
  52. package/lib/models/postboy.message.d.ts.map +0 -1
  53. package/lib/models/postboy.settings.d.ts +0 -13
  54. package/lib/models/postboy.settings.d.ts.map +0 -1
  55. package/lib/postboy-abstract.registrator.d.ts +0 -97
  56. package/lib/postboy-abstract.registrator.d.ts.map +0 -1
  57. package/lib/postboy.service.d.ts +0 -157
  58. package/lib/postboy.service.d.ts.map +0 -1
  59. package/lib/services/index.d.ts +0 -4
  60. package/lib/services/index.d.ts.map +0 -1
  61. package/lib/services/namespace-registrator.d.ts +0 -14
  62. package/lib/services/namespace-registrator.d.ts.map +0 -1
  63. package/lib/services/postboy-context.service.d.ts +0 -13
  64. package/lib/services/postboy-context.service.d.ts.map +0 -1
  65. package/lib/services/postboy-dependency.resolver.d.ts +0 -32
  66. package/lib/services/postboy-dependency.resolver.d.ts.map +0 -1
  67. package/lib/services/postboy-message.store.d.ts +0 -20
  68. package/lib/services/postboy-message.store.d.ts.map +0 -1
  69. package/lib/services/postboy-middleware.service.d.ts +0 -37
  70. package/lib/services/postboy-middleware.service.d.ts.map +0 -1
  71. package/lib/services/postboy-namespace.store.d.ts +0 -34
  72. package/lib/services/postboy-namespace.store.d.ts.map +0 -1
  73. package/lib/tests/integration/models/test-callback-message.d.ts +0 -6
  74. package/lib/tests/integration/models/test-callback-message.d.ts.map +0 -1
  75. package/lib/tests/integration/models/test-executor.d.ts +0 -7
  76. package/lib/tests/integration/models/test-executor.d.ts.map +0 -1
  77. package/lib/tests/integration/models/test-handler.d.ts +0 -8
  78. package/lib/tests/integration/models/test-handler.d.ts.map +0 -1
  79. package/lib/tests/integration/models/test-message.d.ts +0 -6
  80. package/lib/tests/integration/models/test-message.d.ts.map +0 -1
  81. package/lib/tests/integration/models/test-middleware.d.ts +0 -7
  82. package/lib/tests/integration/models/test-middleware.d.ts.map +0 -1
  83. package/lib/tests/integration/models/test-postboy.d.ts +0 -4
  84. package/lib/tests/integration/models/test-postboy.d.ts.map +0 -1
  85. package/lib/tests/integration/models/test-registry.d.ts +0 -8
  86. package/lib/tests/integration/models/test-registry.d.ts.map +0 -1
  87. package/lib/utils/id.generator.d.ts +0 -5
  88. package/lib/utils/id.generator.d.ts.map +0 -1
package/lib/index.cjs CHANGED
@@ -1,2 +1,850 @@
1
- 'use strict';var rxjs=require('rxjs'),operators=require('rxjs/operators');var b=class{constructor(){this.metadata={};}get id(){return this.constructor.ID}setMetadata(e){return this.metadata={...this.metadata,...e},this}};var f=class extends b{};function i(s){if(!s.ID)throw new Error(`${s.name} should have a static ID field`);return s.ID}var l=class{constructor(e,t){this.subscription=e;this._subscription=t?t(e):e.asObservable();}sub(){return this._subscription}fire(e){this.subscription.next(e);}finish(){this.subscription.complete();}};var P=class{constructor(){this.middlewares=[];}addMiddleware(e){this.middlewares.push(e);}removeMiddleware(e){this.middlewares=this.middlewares.filter(t=>t!==e);}manage(e){for(let t of this.middlewares)t.handle(e);}dispose(){this.middlewares=[];}};var M=class{constructor(){this.messages=new Map;this.executors=new Map;this.callbacks=new Map;}registerMessage(e,t){this.messages.has(e)&&console.warn(`Message with id ${e} already registered. Overriding...`),this.messages.set(e,t);}registerExecutor(e,t){this.executors.has(e)&&console.warn(`Executor with id ${e} already registered. Overriding...`),this.executors.set(e,t);}callbackFired(e){let t=this.callbacks.get(e.id);t?t.push(()=>e.complete()):this.callbacks.set(e.id,[()=>e.complete()]);}getMessage(e,t){let r=this.messages.get(e);if(!r)throw new Error(`There is no registered event ${t}`);return r}getExecutor(e){let t=this.executors.get(e);if(!t)throw new Error(`There is no registered executor with id ${e}`);return t}unregister(e){this.messages.get(e)?.finish(),this.messages.delete(e),this.callbacks.get(e)?.forEach(t=>t()),this.callbacks.delete(e),this.executors.delete(e);}dispose(){this.messages.forEach((e,t)=>this.unregister(t)),this.callbacks.forEach(e=>e.forEach(t=>t())),this.messages.clear(),this.executors.clear(),this.callbacks.clear();}};var E=class E{static get(){let e=[];for(let t=0;t<7;t++)e.push(E.collection.sort(()=>.5-Math.random()).slice(0,5).join(""));return e.join("-")}};E.collection="ABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789".split("");var w=E;var o=class extends b{};var a=class extends o{constructor(t,r,d){super();this.type=t;this.sub=r;this.pipe=d;}};a.ID="aa03a192-bdc7-402d-9f2f-bf3748229ea2";var c=class extends o{constructor(t){super();this.messageId=t;}};c.ID="94579e43-5bc9-4517-bcda-b595bcda1ae7";var p=class extends o{constructor(t,r){super();this.type=t;this.exec=r;}};p.ID="cb80e8ad-b68c-4b2d-8c44-617ea6017cb3";var n=class extends o{constructor(t,r){super();this.executor=t;this.handler=r;}};n.ID="bf618cea-6f32-417c-9548-8eafe937378b";var v=class{constructor(e,t=null){this.postboy=e;this.ids=[];this.services=[];this._namespace=t??w.get();}get namespace(){return this._namespace}registerServices(e){this.services=e;}up(){this._up?.(),this.services.forEach(e=>e.up());}down(){this.services.forEach(e=>!!e.down&&e.down()),this.services=[],this.ids.forEach(e=>this.postboy.exec(new c(e)));}record(e,t){return this.ids.push(i(e)),this.postboy.exec(new a(e,t)),this}recordWithPipe(e,t,r){return this.ids.push(i(e)),this.postboy.exec(new a(e,t,r)),this}recordExecutor(e,t){return this.ids.push(i(e)),this.postboy.exec(new p(e,t)),this}recordHandler(e,t){return this.ids.push(i(e)),this.postboy.exec(new n(e,t)),this}recordReplay(e,t=1){return this.record(e,new rxjs.ReplaySubject(t)),this}recordBehavior(e,t){return this.record(e,new rxjs.BehaviorSubject(t)),this}recordSubject(e){return this.record(e,new rxjs.Subject),this}};var S=class extends v{constructor(e){super(e);}_up(){}};var T=class{constructor(){this.spaces=new Map;}addSpace(e,t){if(this.spaces.has(e))return this.spaces.get(e);let r=new S(t);return this.spaces.set(e,r),r}eliminateSpace(e){this.spaces.has(e)&&(this.spaces.get(e)?.down(),this.spaces.delete(e));}dispose(){this.spaces.forEach(e=>e.down()),this.spaces.clear();}};var R=class{constructor(){this.getMiddlewareService=()=>new P;this.getMessageStore=()=>new M;this.getNamespaceStore=()=>new T;}};var u=class extends o{constructor(t){super();this.space=t;}};u.ID="6d1a6f7d-6b6e-4c4d-8af8-9cc9a32e850c";var m=class extends o{constructor(t){super();this.space=t;}};m.ID="03bb03bb-53e0-4b74-9aad-64d5c54a8972";var y=class extends o{constructor(t){super();this.middleware=t;}};y.ID="0a8cfe0a-6193-4082-8440-d0793367b21d";var g=class extends o{constructor(t){super();this.middleware=t;}};g.ID="c25c708c-53c9-498d-a28b-936fbaf68b91";var h=class extends o{constructor(t){super();this.type=t;}};h.ID="477df3e2-1f99-4476-9a3b-afd1fa426436";var x=class extends o{constructor(t){super();this.type=t;}};x.ID="d71d25e3-90ac-4009-b972-9e6c6b05611e";var I=class{constructor(e){this.locked=new Set;this.dependencyResolver=e||new R,this.middleware=this.dependencyResolver.getMiddlewareService(),this.store=this.dependencyResolver.getMessageStore(),this.namespaceStore=this.dependencyResolver.getNamespaceStore(),this.registerInfrastructureMessages();}registerInfrastructureMessages(){this.store.registerExecutor(c.ID,e=>this.store.unregister(e.messageId)),this.store.registerExecutor(x.ID,e=>this.locked.delete(i(e.type))),this.store.registerExecutor(h.ID,e=>this.locked.add(i(e.type))),this.store.registerExecutor(y.ID,e=>this.middleware.addMiddleware(e.middleware)),this.store.registerExecutor(g.ID,e=>this.middleware.removeMiddleware(e.middleware)),this.store.registerExecutor(u.ID,e=>this.namespaceStore.addSpace(e.space,this)),this.store.registerExecutor(m.ID,e=>this.namespaceStore.eliminateSpace(e.space)),this.store.registerExecutor(a.ID,e=>{let{type:t,sub:r,pipe:d}=e;this.store.registerMessage(i(t),new l(r,d));}),this.store.registerExecutor(p.ID,e=>{let{type:t,exec:r}=e;this.store.registerExecutor(i(t),r);}),this.store.registerExecutor(n.ID,e=>{let{executor:t,handler:r}=e;this.store.registerExecutor(i(t),d=>r.handle(d));});}lock(e){this.locked.add(i(e));}unlock(e){this.locked.delete(i(e));}addMiddleware(e){return this.middleware.addMiddleware(e)}removeMiddleware(e){return this.middleware.removeMiddleware(e)}unregister(e){return this.store.unregister(e)}fire(e){this.middleware.manage(e),this.locked.has(e.id)||this.store.getMessage(e.id,e.constructor.name).fire(e);}fireCallback(e,t){this.middleware.manage(e),this.store.callbackFired(e);let r=t?e.result.pipe(operators.tap(t)):e.result,d=new rxjs.Observable(G=>{let O=r.subscribe(G);return this.locked.has(e.id)||this.store.getMessage(e.id,e.constructor.name).fire(e),()=>O.unsubscribe()});return t&&d.subscribe(),d}exec(e){return this.middleware.manage(e),this.store.getExecutor(e.id)(e)}sub(e){return this.store.getMessage(i(e),e.name).sub()}once(e){return this.sub(e).pipe(operators.first())}record(e,t){this.store.registerMessage(i(e),new l(t,r=>r.asObservable()));}recordWithPipe(e,t,r){this.store.registerMessage(i(e),new l(t,r));}recordExecutor(e,t){this.store.registerExecutor(i(e),t);}recordHandler(e,t){this.store.registerExecutor(i(e),r=>t.handle(r));}addNamespace(e){return this.namespaceStore.addSpace(e,this)}eliminateNamespace(e){return this.namespaceStore?.eliminateSpace(e)}dispose(){this.namespaceStore?.dispose(),this.store.dispose(),this.middleware.dispose();}};var D=class extends f{constructor(){super(...arguments);this.result$=new rxjs.Subject;this.result=this.result$.asObservable();this.next=t=>this.result$.next(t);}finish(t){this.result$.next(t),this.result$.complete();}complete(){this.result$.complete();}};var k=class{};exports.AddMiddleware=y;exports.AddNamespace=u;exports.ConnectExecutor=p;exports.ConnectHandler=n;exports.ConnectMessage=a;exports.DisconnectMessage=c;exports.EliminateNamespace=m;exports.LockMessage=h;exports.PostboyAbstractRegistrator=v;exports.PostboyCallbackMessage=D;exports.PostboyExecutionHandler=k;exports.PostboyExecutor=o;exports.PostboyGenericMessage=f;exports.PostboyMessage=b;exports.PostboyMessageStore=M;exports.PostboyMiddlewareService=P;exports.PostboyNamespaceStore=T;exports.PostboyService=I;exports.PostboySubscription=l;exports.RemoveMiddleware=g;exports.UnlockMessage=x;exports.checkId=i;//# sourceMappingURL=index.cjs.map
1
+ 'use strict';
2
+
3
+ var rxjs = require('rxjs');
4
+ var operators = require('rxjs/operators');
5
+
6
+ // src/postboy.service.ts
7
+
8
+ // src/models/postboy.message.ts
9
+ var PostboyMessage = class {
10
+ constructor() {
11
+ this.metadata = {};
12
+ }
13
+ get id() {
14
+ return this.constructor.ID;
15
+ }
16
+ setMetadata(metadata) {
17
+ this.metadata = { ...this.metadata, ...metadata };
18
+ return this;
19
+ }
20
+ };
21
+
22
+ // src/models/postboy-generic-message.ts
23
+ var PostboyGenericMessage = class extends PostboyMessage {
24
+ };
25
+ function checkId(message) {
26
+ if (!message.ID) throw new Error(`${message.name} should have a static ID field`);
27
+ return message.ID;
28
+ }
29
+
30
+ // src/models/postboy-subscription.ts
31
+ var PostboySubscription = class {
32
+ /**
33
+ * Constructs an instance of the class with a given subscription and a transformation pipe.
34
+ *
35
+ * @param {Subject<T>} subscription - The source Subject that will be transformed.
36
+ * @param {(s: Subject<T>) => Observable<T>} pipe - A function that applies a transformation to the subscription.
37
+ */
38
+ constructor(subscription, pipe2) {
39
+ this.subscription = subscription;
40
+ this._subscription = !!pipe2 ? pipe2(subscription) : subscription.asObservable();
41
+ }
42
+ /**
43
+ * Returns an observable subscription.
44
+ *
45
+ * @return {Observable<T>} An observable instance of type T.
46
+ */
47
+ sub() {
48
+ return this._subscription;
49
+ }
50
+ /**
51
+ * Triggers an event by emitting the provided data to all subscribers.
52
+ *
53
+ * @param {T} data - The data to emit to the subscribers.
54
+ * @return {void} - Does not return any value.
55
+ */
56
+ fire(data) {
57
+ this.subscription.next(data);
58
+ }
59
+ /**
60
+ * Completes the subscription, signaling that no further values will be sent.
61
+ * This is typically used to finalize or clean up resources.
62
+ * @return {void} This method does not return any value.
63
+ */
64
+ finish() {
65
+ this.subscription.complete();
66
+ }
67
+ };
68
+
69
+ // src/models/middleware-stage.enum.ts
70
+ var MiddlewareStage = /* @__PURE__ */ ((MiddlewareStage2) => {
71
+ MiddlewareStage2[MiddlewareStage2["Publish"] = 1] = "Publish";
72
+ MiddlewareStage2[MiddlewareStage2["Callback"] = 2] = "Callback";
73
+ MiddlewareStage2[MiddlewareStage2["Execute"] = 3] = "Execute";
74
+ return MiddlewareStage2;
75
+ })(MiddlewareStage || {});
76
+
77
+ // src/models/middleware-decision.enum.ts
78
+ var MiddlewareDecisionType = /* @__PURE__ */ ((MiddlewareDecisionType2) => {
79
+ MiddlewareDecisionType2[MiddlewareDecisionType2["Continue"] = 1] = "Continue";
80
+ MiddlewareDecisionType2[MiddlewareDecisionType2["Interrupt"] = 2] = "Interrupt";
81
+ return MiddlewareDecisionType2;
82
+ })(MiddlewareDecisionType || {});
83
+
84
+ // src/models/cancel-error.ts
85
+ var CancelError = class extends Error {
86
+ constructor(details) {
87
+ super(details.reason ?? `Postboy operation was cancelled at stage "${MiddlewareStage[details.stage]}"`);
88
+ this.name = "PostboyCancelError";
89
+ this.details = details;
90
+ }
91
+ };
92
+
93
+ // src/services/postboy-middleware.service.ts
94
+ var PostboyMiddlewareService = class {
95
+ constructor() {
96
+ this.middlewares = [];
97
+ }
98
+ addMiddleware(middleware) {
99
+ this.middlewares.push(middleware);
100
+ }
101
+ removeMiddleware(middleware) {
102
+ this.middlewares = this.middlewares.filter((m) => {
103
+ if (m !== middleware) return true;
104
+ m.dispose();
105
+ return false;
106
+ });
107
+ }
108
+ dispose() {
109
+ this.middlewares.forEach((m) => m.dispose());
110
+ this.middlewares = [];
111
+ }
112
+ before(stage, message) {
113
+ for (const middleware of this.middlewares) {
114
+ const context = this.buildContext(stage, message);
115
+ if (!middleware.canHandle(context)) continue;
116
+ if (middleware.before(context).type === 2 /* Interrupt */)
117
+ this.throwIfCancelled(stage, middleware.name, message.id);
118
+ }
119
+ }
120
+ after(stage, message, result) {
121
+ for (const middleware of this.middlewares) {
122
+ const context = this.buildContext(stage, message);
123
+ if (!middleware.canHandle(context)) continue;
124
+ middleware.after(context, result);
125
+ }
126
+ }
127
+ beforePublish(message) {
128
+ this.before(1 /* Publish */, message);
129
+ }
130
+ afterPublish(message) {
131
+ this.after(1 /* Publish */, message);
132
+ }
133
+ beforeCallback(message) {
134
+ this.before(2 /* Callback */, message);
135
+ }
136
+ afterCallback(message, result) {
137
+ this.after(2 /* Callback */, message, result);
138
+ }
139
+ beforeExecute(message) {
140
+ this.before(3 /* Execute */, message);
141
+ }
142
+ afterExecute(message, result) {
143
+ this.after(3 /* Execute */, message, result);
144
+ }
145
+ buildContext(stage, message) {
146
+ return { stage, message };
147
+ }
148
+ throwIfCancelled(stage, cancelledBy, messageId, namespace) {
149
+ throw new CancelError({
150
+ stage,
151
+ middleware: cancelledBy,
152
+ messageId,
153
+ namespace,
154
+ reason: cancelledBy ? `Cancelled by middleware "${cancelledBy}"` : void 0
155
+ });
156
+ }
157
+ };
158
+
159
+ // src/services/postboy-message.store.ts
160
+ var PostboyMessageStore = class {
161
+ constructor() {
162
+ this.messages = /* @__PURE__ */ new Map();
163
+ this.executors = /* @__PURE__ */ new Map();
164
+ this.callbacks = /* @__PURE__ */ new Map();
165
+ }
166
+ registerMessage(id, sub) {
167
+ if (this.messages.has(id)) console.warn(`Message with id ${id} already registered. Overriding...`);
168
+ this.messages.set(id, sub);
169
+ }
170
+ registerExecutor(id, executor) {
171
+ if (this.executors.has(id)) console.warn(`Executor with id ${id} already registered. Overriding...`);
172
+ this.executors.set(id, executor);
173
+ }
174
+ callbackFired(message) {
175
+ const existingCallbacks = this.callbacks.get(message.id);
176
+ existingCallbacks ? existingCallbacks.push(() => message.complete()) : this.callbacks.set(message.id, [() => message.complete()]);
177
+ }
178
+ getMessage(id, name) {
179
+ const msg = this.messages.get(id);
180
+ if (!msg) throw new Error(`There is no registered event ${name}`);
181
+ return msg;
182
+ }
183
+ getExecutor(id) {
184
+ const executorFunction = this.executors.get(id);
185
+ if (!executorFunction) throw new Error(`There is no registered executor with id ${id}`);
186
+ return executorFunction;
187
+ }
188
+ unregister(id) {
189
+ this.messages.get(id)?.finish();
190
+ this.messages.delete(id);
191
+ this.callbacks.get(id)?.forEach((c) => c());
192
+ this.callbacks.delete(id);
193
+ this.executors.delete(id);
194
+ }
195
+ dispose() {
196
+ this.messages.forEach((m, id) => this.unregister(id));
197
+ this.callbacks.forEach((fs) => fs.forEach((f) => f()));
198
+ this.messages.clear();
199
+ this.executors.clear();
200
+ this.callbacks.clear();
201
+ }
202
+ };
203
+
204
+ // src/utils/id.generator.ts
205
+ var _IdGenerator = class _IdGenerator {
206
+ static get() {
207
+ const result = [];
208
+ for (let i = 0; i < 7; i++) {
209
+ result.push(
210
+ _IdGenerator.collection.sort(() => 0.5 - Math.random()).slice(0, 5).join("")
211
+ );
212
+ }
213
+ return result.join("-");
214
+ }
215
+ };
216
+ _IdGenerator.collection = "ABCDEFGHIJKLMNOPQRSTUVWXTZ0123456789".split("");
217
+ var IdGenerator = _IdGenerator;
218
+
219
+ // src/models/postboy-executor.ts
220
+ var PostboyExecutor = class extends PostboyMessage {
221
+ };
222
+
223
+ // src/messages/connect-message.executor.ts
224
+ var ConnectMessage = class extends PostboyExecutor {
225
+ /**
226
+ * Constructs a new instance of the class.
227
+ *
228
+ * @param {MessageType<T>} type - The type of the message.
229
+ * @param {Subject<T>} sub - The subject to be used for message handling.
230
+ * @param {(s: Subject<T>) => Observable<T>} [pipe] - An optional function to transform the subject.
231
+ */
232
+ constructor(type, sub, pipe2) {
233
+ super();
234
+ this.type = type;
235
+ this.sub = sub;
236
+ this.pipe = pipe2;
237
+ }
238
+ };
239
+ ConnectMessage.ID = "aa03a192-bdc7-402d-9f2f-bf3748229ea2";
240
+
241
+ // src/messages/disconnect-message.executor.ts
242
+ var DisconnectMessage = class extends PostboyExecutor {
243
+ /**
244
+ * Creates an instance of the class with the specified message identifier.
245
+ *
246
+ * @param {string} messageId - The unique identifier for the message.
247
+ */
248
+ constructor(messageId) {
249
+ super();
250
+ this.messageId = messageId;
251
+ }
252
+ };
253
+ DisconnectMessage.ID = "94579e43-5bc9-4517-bcda-b595bcda1ae7";
254
+
255
+ // src/messages/connect-executor.executor.ts
256
+ var ConnectExecutor = class extends PostboyExecutor {
257
+ /**
258
+ * Constructs an instance of the class with the specified type and execution function.
259
+ *
260
+ * @param {MessageType<E>} type - The type of the message.
261
+ * @param {(e: E) => T} exec - The function to be executed with the input of type E that returns a value of type T.
262
+ */
263
+ constructor(type, exec) {
264
+ super();
265
+ this.type = type;
266
+ this.exec = exec;
267
+ }
268
+ };
269
+ ConnectExecutor.ID = "cb80e8ad-b68c-4b2d-8c44-617ea6017cb3";
270
+
271
+ // src/messages/connect-handler.executor.ts
272
+ var ConnectHandler = class extends PostboyExecutor {
273
+ /**
274
+ * Constructs an instance of the class.
275
+ *
276
+ * @param {new (...args: any[]) => E} executor - A constructor function for the executor object.
277
+ * @param {PostboyExecutionHandler<R, E>} handler - A handler that processes the execution logic.
278
+ */
279
+ constructor(executor, handler) {
280
+ super();
281
+ this.executor = executor;
282
+ this.handler = handler;
283
+ }
284
+ };
285
+ ConnectHandler.ID = "bf618cea-6f32-417c-9548-8eafe937378b";
286
+
287
+ // src/postboy-abstract.registrator.ts
288
+ var PostboyAbstractRegistrator = class {
289
+ constructor(postboy, namespace = null) {
290
+ this.postboy = postboy;
291
+ this.ids = [];
292
+ this.services = [];
293
+ this._namespace = namespace ?? IdGenerator.get();
294
+ }
295
+ get namespace() {
296
+ return this._namespace;
297
+ }
298
+ /**
299
+ * Registers a list of services to be used by the application.
300
+ *
301
+ * @param {IPostboyDependingService[]} services - An array of services to register.
302
+ * @return {void} This method does not return a value.
303
+ */
304
+ registerServices(services) {
305
+ this.services = services;
306
+ }
307
+ /**
308
+ * Initiates the 'up' process for the current instance and all associated services.
309
+ *
310
+ * @return {void} Does not return a value.
311
+ */
312
+ up() {
313
+ this._up?.();
314
+ this.services.forEach((s) => s.up());
315
+ }
316
+ down() {
317
+ this.services.forEach((s) => !!s.down && s.down());
318
+ this.services = [];
319
+ this.ids.forEach((id) => this.postboy.exec(new DisconnectMessage(id)));
320
+ }
321
+ /**
322
+ * Records a type and its corresponding Subject<T> into the Postboy system and updates the internal identifiers.
323
+ *
324
+ * @param {MessageType<T>} type - A constructor for the generic message type T.
325
+ * @param {Subject<T>} sub - The subject associated with the generic message type.
326
+ * @return {this} Returns the current instance for method chaining.
327
+ */
328
+ record(type, sub) {
329
+ this.ids.push(checkId(type));
330
+ this.postboy.exec(new ConnectMessage(type, sub));
331
+ return this;
332
+ }
333
+ /**
334
+ * Records a message type with a specific subject and applies a transformation pipe to the subject.
335
+ *
336
+ * @param {MessageType<T>} type - The constructor of the message type to record, which extends PostboyGenericMessage.
337
+ * @param {Subject<T>} sub - The Subject instance to associate with the message type.
338
+ * @param {(s: Subject<T>) => Observable<T>} pipe - A function that takes the subject as input and returns an Observable with transformations applied.
339
+ * @return {this} The current instance of the class for chaining.
340
+ */
341
+ recordWithPipe(type, sub, pipe2) {
342
+ this.ids.push(checkId(type));
343
+ this.postboy.exec(new ConnectMessage(type, sub, pipe2));
344
+ return this;
345
+ }
346
+ /**
347
+ * Records an executor associated with a specific type and execution logic.
348
+ *
349
+ * @param type The class constructor of the executor type to be recorded, which extends PostboyExecutor.
350
+ * @param exec A callback function that executes the logic using an instance of the specified executor type.
351
+ * @return void
352
+ */
353
+ recordExecutor(type, exec) {
354
+ this.ids.push(checkId(type));
355
+ this.postboy.exec(new ConnectExecutor(type, exec));
356
+ return this;
357
+ }
358
+ /**
359
+ * Records a handler for a specific executor type.
360
+ *
361
+ * @param executor The constructor of the executor type, which extends `PostboyExecutor`.
362
+ * @param handler The execution handler associated with the given executor type.
363
+ * @return void
364
+ */
365
+ recordHandler(executor, handler) {
366
+ this.ids.push(checkId(executor));
367
+ this.postboy.exec(new ConnectHandler(executor, handler));
368
+ return this;
369
+ }
370
+ /**
371
+ * A utility function that facilitates the recording and replaying of messages
372
+ * using a ReplaySubject. This function is designed to handle messages of a
373
+ * specific type and allows specifying a buffer size to determine how many
374
+ * of the most recent messages should be replayed.
375
+ *
376
+ * @template T Extends the PostboyGenericMessage type, representing the type of message
377
+ * to be recorded and replayed.
378
+ * @param {MessageType<T>} type The constructor of the message type to be recorded and replayed.
379
+ * @param {number} [bufferSize=1] The number of recent messages to retain in the ReplaySubject's buffer.
380
+ * Defaults to 1 if not specified.
381
+ * @returns The result of invoking the `record` method with the given message type and configured ReplaySubject.
382
+ */
383
+ recordReplay(type, bufferSize = 1) {
384
+ this.record(type, new rxjs.ReplaySubject(bufferSize));
385
+ return this;
386
+ }
387
+ /**
388
+ * Represents a method that records a specific behavior associated with a message type.
389
+ * It creates a `BehaviorSubject` initialized with the provided initial message
390
+ * and associates it with the given message type using the `record` method.
391
+ *
392
+ * @template T - A type parameter extending `PostboyGenericMessage` that defines the message structure.
393
+ * @param {MessageType<T>} type - The constructor function of the message type to be recorded.
394
+ * @param {T} initial - The initial value of the message that will be set in the `BehaviorSubject`.
395
+ * @returns {void} - This function does not return a value; instead, it modifies the internal state.
396
+ */
397
+ recordBehavior(type, initial) {
398
+ this.record(type, new rxjs.BehaviorSubject(initial));
399
+ return this;
400
+ }
401
+ /**
402
+ * A function that creates and returns a new generic message recorder for a specific message type.
403
+ *
404
+ * @template T - A type parameter extending from `PostboyGenericMessage`.
405
+ * @param {MessageType<T>} type - The constructor for the message type being recorded.
406
+ * @returns {Subject<T>} A new instance of `Subject<T>` bound to the specified message type.
407
+ */
408
+ recordSubject(type) {
409
+ this.record(type, new rxjs.Subject());
410
+ return this;
411
+ }
412
+ };
413
+
414
+ // src/services/namespace-registrator.ts
415
+ var NamespaceRegistrator = class extends PostboyAbstractRegistrator {
416
+ constructor(postboy) {
417
+ super(postboy);
418
+ }
419
+ _up() {
420
+ }
421
+ };
422
+
423
+ // src/services/postboy-namespace.store.ts
424
+ var PostboyNamespaceStore = class {
425
+ constructor() {
426
+ this.spaces = /* @__PURE__ */ new Map();
427
+ }
428
+ /**
429
+ * Adds a new space or retrieves an existing one if it already exists.
430
+ *
431
+ * @param {string} space - The name of the space to add or retrieve.
432
+ * @param {PostboyService} postboy - The PostboyService instance used to create a namespace registrator.
433
+ * @return {PostboyAbstractRegistrator} The registrator associated with the specified space.
434
+ */
435
+ addSpace(space, postboy) {
436
+ if (this.spaces.has(space)) return this.spaces.get(space);
437
+ const registrator = new NamespaceRegistrator(postboy);
438
+ this.spaces.set(space, registrator);
439
+ return registrator;
440
+ }
441
+ /**
442
+ * Removes a specified space from the spaces collection if it exists.
443
+ * If the space exists, it will be deleted after invoking its down method.
444
+ *
445
+ * @param {string} space - The name of the space to be removed.
446
+ * @return {void} This method does not return a value.
447
+ */
448
+ eliminateSpace(space) {
449
+ if (!this.spaces.has(space)) return;
450
+ this.spaces.get(space)?.down();
451
+ this.spaces.delete(space);
452
+ }
453
+ /**
454
+ * Disposes of the current instance by performing cleanup operations.
455
+ * Iterates through all spaces, performs a "down" operation on each,
456
+ * and then clears the collection of spaces.
457
+ *
458
+ * @return {void} No return value.
459
+ */
460
+ dispose() {
461
+ this.spaces.forEach((space) => space.down());
462
+ this.spaces.clear();
463
+ }
464
+ };
465
+
466
+ // src/services/postboy-dependency.resolver.ts
467
+ var PostboyDependencyResolver = class {
468
+ constructor() {
469
+ /**
470
+ * Retrieves an instance of the PostboyMiddlewareService.
471
+ *
472
+ * This function initializes and returns a new instance of the
473
+ * PostboyMiddlewareService, which can be used to configure and manage
474
+ * middleware for a specific module or application.
475
+ *
476
+ * @returns {PostboyMiddlewareService} A new instance of PostboyMiddlewareService.
477
+ */
478
+ this.getMiddlewareService = () => new PostboyMiddlewareService();
479
+ /**
480
+ * A function that instantiates and returns a new instance of PostboyMessageStore.
481
+ *
482
+ * This function serves as a factory method for creating instances
483
+ * of the PostboyMessageStore class.
484
+ *
485
+ * @returns {PostboyMessageStore} A new instance of the PostboyMessageStore class.
486
+ */
487
+ this.getMessageStore = () => new PostboyMessageStore();
488
+ /**
489
+ * Creates and initializes a new instance of PostboyNamespaceStore using the provided PostboyService instance.
490
+ *
491
+ * @function getNamespaceStore
492
+ * @returns {PostboyNamespaceStore} A new instance of PostboyNamespaceStore associated with the given PostboyService.
493
+ */
494
+ this.getNamespaceStore = () => new PostboyNamespaceStore();
495
+ }
496
+ };
497
+
498
+ // src/messages/add-namespace.executor.ts
499
+ var AddNamespace = class extends PostboyExecutor {
500
+ /**
501
+ * Creates an instance of the class with the specified space identifier.
502
+ *
503
+ * @param {string} space - The identifier for the space.
504
+ */
505
+ constructor(space) {
506
+ super();
507
+ this.space = space;
508
+ }
509
+ };
510
+ AddNamespace.ID = "6d1a6f7d-6b6e-4c4d-8af8-9cc9a32e850c";
511
+
512
+ // src/messages/eliminate-namespace.executor.ts
513
+ var EliminateNamespace = class extends PostboyExecutor {
514
+ /**
515
+ * Creates an instance of the class with the specified space value.
516
+ *
517
+ * @param {string} space - The string value representing the space configuration.
518
+ */
519
+ constructor(space) {
520
+ super();
521
+ this.space = space;
522
+ }
523
+ };
524
+ EliminateNamespace.ID = "03bb03bb-53e0-4b74-9aad-64d5c54a8972";
525
+
526
+ // src/messages/add-middleware.executor.ts
527
+ var AddMiddleware = class extends PostboyExecutor {
528
+ /**
529
+ * Initializes a new instance of the class with the specified middleware.
530
+ *
531
+ * @param {PostboyMiddleware} middleware - The {@link PostboyMiddleware} to be used for processing.
532
+ */
533
+ constructor(middleware) {
534
+ super();
535
+ this.middleware = middleware;
536
+ }
537
+ };
538
+ AddMiddleware.ID = "0a8cfe0a-6193-4082-8440-d0793367b21d";
539
+
540
+ // src/messages/remove-middleware.executor.ts
541
+ var RemoveMiddleware = class extends PostboyExecutor {
542
+ /**
543
+ * Constructs an instance of the class with the specified middleware.
544
+ *
545
+ * @param {PostboyMiddleware} middleware - The {@link PostboyMiddleware} instance to be removed.
546
+ */
547
+ constructor(middleware) {
548
+ super();
549
+ this.middleware = middleware;
550
+ }
551
+ };
552
+ RemoveMiddleware.ID = "c25c708c-53c9-498d-a28b-936fbaf68b91";
553
+
554
+ // src/messages/lock-message.executor.ts
555
+ var LockMessage = class extends PostboyExecutor {
556
+ /**
557
+ * Constructs an instance of the class with the specified message type.
558
+ *
559
+ * @param {MessageType<T>} type - The type of the message to be used for the instance.
560
+ */
561
+ constructor(type) {
562
+ super();
563
+ this.type = type;
564
+ }
565
+ };
566
+ LockMessage.ID = "477df3e2-1f99-4476-9a3b-afd1fa426436";
567
+
568
+ // src/messages/unlock-message.executor.ts
569
+ var UnlockMessage = class extends PostboyExecutor {
570
+ /**
571
+ * Creates an instance of the class with the specified message type.
572
+ *
573
+ * @param {MessageType<T>} type - The message type for this instance.
574
+ */
575
+ constructor(type) {
576
+ super();
577
+ this.type = type;
578
+ }
579
+ };
580
+ UnlockMessage.ID = "d71d25e3-90ac-4009-b972-9e6c6b05611e";
581
+
582
+ // src/postboy.service.ts
583
+ var PostboyService = class {
584
+ constructor(resolver) {
585
+ this.locked = /* @__PURE__ */ new Set();
586
+ this.dependencyResolver = resolver || new PostboyDependencyResolver();
587
+ this.middleware = this.dependencyResolver.getMiddlewareService();
588
+ this.store = this.dependencyResolver.getMessageStore();
589
+ this.namespaceStore = this.dependencyResolver.getNamespaceStore();
590
+ this.registerInfrastructureMessages();
591
+ }
592
+ registerInfrastructureMessages() {
593
+ this.store.registerExecutor(DisconnectMessage.ID, (e) => this.store.unregister(e.messageId));
594
+ this.store.registerExecutor(UnlockMessage.ID, (e) => this.locked.delete(checkId(e.type)));
595
+ this.store.registerExecutor(LockMessage.ID, (e) => this.locked.add(checkId(e.type)));
596
+ this.store.registerExecutor(
597
+ AddMiddleware.ID,
598
+ (e) => this.middleware.addMiddleware(e.middleware)
599
+ );
600
+ this.store.registerExecutor(
601
+ RemoveMiddleware.ID,
602
+ (e) => this.middleware.removeMiddleware(e.middleware)
603
+ );
604
+ this.store.registerExecutor(AddNamespace.ID, (e) => this.namespaceStore.addSpace(e.space, this));
605
+ this.store.registerExecutor(
606
+ EliminateNamespace.ID,
607
+ (e) => this.namespaceStore.eliminateSpace(e.space)
608
+ );
609
+ this.store.registerExecutor(ConnectMessage.ID, (e) => {
610
+ const { type, sub, pipe: pipe2 } = e;
611
+ this.store.registerMessage(checkId(type), new PostboySubscription(sub, pipe2));
612
+ });
613
+ this.store.registerExecutor(ConnectExecutor.ID, (e) => {
614
+ const { type, exec } = e;
615
+ this.store.registerExecutor(checkId(type), exec);
616
+ });
617
+ this.store.registerExecutor(ConnectHandler.ID, (e) => {
618
+ const { executor, handler } = e;
619
+ this.store.registerExecutor(checkId(executor), (e2) => handler.handle(e2));
620
+ });
621
+ }
622
+ /**
623
+ * Fires a registered event and passes the message to its subscribers.
624
+ *
625
+ * @param {PostboyGenericMessage} message - The message object containing the event data.
626
+ * @return {void} This method does not return a value.
627
+ * @throws {Error} Throws an error if no registered event is found for the provided message ID.
628
+ */
629
+ fire(message) {
630
+ this.middleware.beforePublish(message);
631
+ if (!this.locked.has(message.id)) {
632
+ this.store.getMessage(message.id, message.constructor.name).fire(message);
633
+ }
634
+ this.middleware.afterPublish(message);
635
+ }
636
+ /**
637
+ * Triggers a callback function associated with a given message.
638
+ *
639
+ * @param {PostboyCallbackMessage<T>} message - The message object used to trigger the callback.
640
+ * It contains details about the event and result subscription.
641
+ * @param {(e: T) => void} [action] - Optional callback function to execute when the result of the message is emitted.
642
+ * @return {void} This method does not return any value.
643
+ */
644
+ fireCallback(message, action) {
645
+ this.middleware.beforeCallback(message);
646
+ if (action) message.result.subscribe(action);
647
+ this.store.callbackFired(message);
648
+ const result$ = action ? message.result.pipe(operators.tap(action)) : message.result;
649
+ const msg = this.store.getMessage(message.id, message.constructor.name);
650
+ const observable = new rxjs.Observable((subscriber) => {
651
+ const subscription = result$.pipe(operators.tap(() => this.middleware.afterCallback(message))).subscribe(subscriber);
652
+ if (!this.locked.has(message.id)) {
653
+ msg.fire(message);
654
+ }
655
+ return () => subscription.unsubscribe();
656
+ });
657
+ if (!!action) observable.subscribe();
658
+ return observable;
659
+ }
660
+ /**
661
+ * Executes the provided executor function and returns its result.
662
+ *
663
+ * @param {PostboyExecutor<T>} executor The executor to be executed, which includes its identifier and logic.
664
+ * @return {T} The resulting output from the executed executor function.
665
+ * @throws {Error} If the specified executor is not registered.
666
+ */
667
+ exec(executor) {
668
+ this.middleware.beforeExecute(executor);
669
+ const result = this.store.getExecutor(executor.id)(executor);
670
+ this.middleware.afterExecute(executor, result);
671
+ return result;
672
+ }
673
+ /**
674
+ * Subscribes to a specific message type and returns an observable of that type.
675
+ *
676
+ * @param type The constructor function of the type that extends PostboyGenericMessage.
677
+ * @return An Observable of the specified generic message type.
678
+ */
679
+ sub(type) {
680
+ return this.store.getMessage(checkId(type), type.name).sub();
681
+ }
682
+ /**
683
+ * Subscribes to a specific message type and automatically unsubscribes after receiving the first message.
684
+ *
685
+ * @param type The type of message to subscribe to.
686
+ * @return An observable that emits the first message of the specified type and then completes.
687
+ */
688
+ once(type) {
689
+ return this.sub(type).pipe(operators.first());
690
+ }
691
+ /**
692
+ * Registers a given message type and its associated subject subscription with the system.
693
+ *
694
+ * @deprecated The method should be replaced with firing {@link ConnectMessage} message.
695
+ * @param type The constructor function of the message type that extends the PostboyGenericMessage.
696
+ * @param sub The Subject instance for the provided message type, used for managing subscriptions.
697
+ * @return {void} No return value.
698
+ */
699
+ record(type, sub) {
700
+ this.store.registerMessage(checkId(type), new PostboySubscription(sub, (s) => s.asObservable()));
701
+ }
702
+ /**
703
+ * Registers a generic message type with a Subject and a transformation pipe.
704
+ *
705
+ * @deprecated The method should be replaced with firing {@link ConnectMessage} message.
706
+ * @param {MessageType<T>} type - The constructor of the message type being registered.
707
+ * @param {Subject<T>} sub - The Subject instance used to handle incoming messages of the specified type.
708
+ * @param {(s: Subject<T>) => Observable<T>} pipe - A function that applies a transformation or processing logic to the Subject and returns an Observable.
709
+ * @return {void} No return value.
710
+ */
711
+ recordWithPipe(type, sub, pipe2) {
712
+ this.store.registerMessage(checkId(type), new PostboySubscription(sub, pipe2));
713
+ }
714
+ /**
715
+ * Registers an executor for a specified message type.
716
+ *
717
+ * @deprecated The method should be replaced with firing {@link ConnectExecutor} message.
718
+ * @param {MessageType<E>} type - The message type for which the executor is being registered.
719
+ * @param {(e: E) => T} exec - The executor function that will handle messages of the specified type.
720
+ * @return {void} This method does not return any value.
721
+ */
722
+ recordExecutor(type, exec) {
723
+ this.store.registerExecutor(checkId(type), exec);
724
+ }
725
+ /**
726
+ * Registers a handler for a specific executor type.
727
+ *
728
+ * @deprecated The method should be replaced with firing {@link ConnectHandler} message.
729
+ * @param executor The constructor of the executor class that extends `PostboyExecutor<R>`.
730
+ * @param handler An instance of `PostboyExecutionHandler<R, E>` that defines the logic for handling the executor.
731
+ * @return void
732
+ */
733
+ recordHandler(executor, handler) {
734
+ this.store.registerExecutor(checkId(executor), (e) => handler.handle(e));
735
+ }
736
+ /**
737
+ * Disposes of resources and cleans up any internal components or stores associated with the instance.
738
+ * This method ensures that all resources are properly released to avoid memory leaks.
739
+ *
740
+ * @return {void} This method does not return a value.
741
+ */
742
+ dispose() {
743
+ this.namespaceStore?.dispose();
744
+ this.store.dispose();
745
+ this.middleware.dispose();
746
+ }
747
+ };
748
+
749
+ // src/services/postboy-middleware.ts
750
+ var PostboyMiddleware = class {
751
+ /**
752
+ * Creates an instance of a class, optionally assigning a name.
753
+ *
754
+ * @param {string} [name] - An optional name to be assigned. If not provided, defaults to the class name.
755
+ */
756
+ constructor(name) {
757
+ this.name = name ?? this.constructor.name;
758
+ }
759
+ /**
760
+ * Optional filter to skip middleware for unrelated messages/stages.
761
+ */
762
+ canHandle(_context) {
763
+ return true;
764
+ }
765
+ /**
766
+ * Called before the stage is executed.
767
+ * Return Interrupt to cancel the operation.
768
+ */
769
+ before(_context) {
770
+ return { type: 1 /* Continue */ };
771
+ }
772
+ /**
773
+ * Called after the stage has finished successfully.
774
+ * `result` is typically set for execute-stage.
775
+ */
776
+ after(_context, _result) {
777
+ }
778
+ /**
779
+ * Optional cleanup hook.
780
+ */
781
+ dispose() {
782
+ }
783
+ };
784
+ var PostboyCallbackMessage = class extends PostboyGenericMessage {
785
+ constructor() {
786
+ super(...arguments);
787
+ this.result$ = new rxjs.Subject();
788
+ this.result = this.result$.asObservable();
789
+ /**
790
+ * Emits the provided value.
791
+ *
792
+ * @template T - The type of the value to emit.
793
+ * @param {T} value - The value to emit through the `result$` observable.
794
+ * @returns {void}
795
+ */
796
+ this.next = (value) => this.result$.next(value);
797
+ }
798
+ /**
799
+ * Marks the operation as complete by emitting the provided value and then completing the result stream.
800
+ *
801
+ * @param {T} value - The value to emit prior to completing the result stream.
802
+ * @return {void} This method does not return a value.
803
+ */
804
+ finish(value) {
805
+ this.result$.next(value);
806
+ this.result$.complete();
807
+ }
808
+ /**
809
+ * Completes the current observable result stream.
810
+ * This method marks the result observable as complete, ensuring no further values
811
+ * or events will be emitted from it.
812
+ *
813
+ * @return {void} No value is returned from this method.
814
+ */
815
+ complete() {
816
+ this.result$.complete();
817
+ }
818
+ };
819
+
820
+ // src/models/postboy-execution.handler.ts
821
+ var PostboyExecutionHandler = class {
822
+ };
823
+
824
+ exports.AddMiddleware = AddMiddleware;
825
+ exports.AddNamespace = AddNamespace;
826
+ exports.CancelError = CancelError;
827
+ exports.ConnectExecutor = ConnectExecutor;
828
+ exports.ConnectHandler = ConnectHandler;
829
+ exports.ConnectMessage = ConnectMessage;
830
+ exports.DisconnectMessage = DisconnectMessage;
831
+ exports.EliminateNamespace = EliminateNamespace;
832
+ exports.LockMessage = LockMessage;
833
+ exports.MiddlewareDecisionType = MiddlewareDecisionType;
834
+ exports.MiddlewareStage = MiddlewareStage;
835
+ exports.PostboyAbstractRegistrator = PostboyAbstractRegistrator;
836
+ exports.PostboyCallbackMessage = PostboyCallbackMessage;
837
+ exports.PostboyExecutionHandler = PostboyExecutionHandler;
838
+ exports.PostboyExecutor = PostboyExecutor;
839
+ exports.PostboyGenericMessage = PostboyGenericMessage;
840
+ exports.PostboyMessage = PostboyMessage;
841
+ exports.PostboyMessageStore = PostboyMessageStore;
842
+ exports.PostboyMiddleware = PostboyMiddleware;
843
+ exports.PostboyMiddlewareService = PostboyMiddlewareService;
844
+ exports.PostboyNamespaceStore = PostboyNamespaceStore;
845
+ exports.PostboyService = PostboyService;
846
+ exports.PostboySubscription = PostboySubscription;
847
+ exports.RemoveMiddleware = RemoveMiddleware;
848
+ exports.UnlockMessage = UnlockMessage;
849
+ //# sourceMappingURL=index.cjs.map
2
850
  //# sourceMappingURL=index.cjs.map