@artstesh/postboy 1.4.3 → 1.4.5
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/lib/i-postboy-depending.service.d.ts +5 -0
- package/lib/i-postboy-depending.service.d.ts.map +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +10 -701
- package/lib/index.d.ts.map +1 -0
- package/lib/index.mjs +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-namespace.executor.d.ts +19 -0
- package/lib/messages/add-namespace.executor.d.ts.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-handler.executor.d.ts +25 -0
- package/lib/messages/connect-handler.executor.d.ts.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/disconnect-message.executor.d.ts +19 -0
- package/lib/messages/disconnect-message.executor.d.ts.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/index.d.ts +11 -0
- package/lib/messages/index.d.ts.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/remove-middleware.executor.d.ts +17 -0
- package/lib/messages/remove-middleware.executor.d.ts.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/models/index.d.ts +8 -0
- package/lib/models/index.d.ts.map +1 -0
- package/lib/models/postboy-callback.message.d.ts +48 -0
- package/lib/models/postboy-callback.message.d.ts.map +1 -0
- package/lib/models/postboy-execution.handler.d.ts +21 -0
- package/lib/models/postboy-execution.handler.d.ts.map +1 -0
- package/lib/models/postboy-executor.d.ts +5 -0
- package/lib/models/postboy-executor.d.ts.map +1 -0
- package/lib/models/postboy-generic-message.d.ts +8 -0
- package/lib/models/postboy-generic-message.d.ts.map +1 -0
- 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.context.d.ts +9 -0
- package/lib/models/postboy-message.context.d.ts.map +1 -0
- package/lib/models/postboy-middleware.d.ts +5 -0
- package/lib/models/postboy-middleware.d.ts.map +1 -0
- package/lib/models/postboy-subscription.d.ts +39 -0
- package/lib/models/postboy-subscription.d.ts.map +1 -0
- package/lib/models/postboy.message.d.ts +7 -0
- package/lib/models/postboy.message.d.ts.map +1 -0
- package/lib/models/postboy.settings.d.ts +13 -0
- package/lib/models/postboy.settings.d.ts.map +1 -0
- package/lib/postboy-abstract.registrator.d.ts +97 -0
- package/lib/postboy-abstract.registrator.d.ts.map +1 -0
- package/lib/postboy.service.d.ts +157 -0
- package/lib/postboy.service.d.ts.map +1 -0
- package/lib/services/index.d.ts +4 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/namespace-registrator.d.ts +14 -0
- package/lib/services/namespace-registrator.d.ts.map +1 -0
- 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-dependency.resolver.d.ts +32 -0
- package/lib/services/postboy-dependency.resolver.d.ts.map +1 -0
- package/lib/services/postboy-message.store.d.ts +20 -0
- package/lib/services/postboy-message.store.d.ts.map +1 -0
- package/lib/services/postboy-middleware.service.d.ts +37 -0
- package/lib/services/postboy-middleware.service.d.ts.map +1 -0
- package/lib/services/postboy-namespace.store.d.ts +34 -0
- package/lib/services/postboy-namespace.store.d.ts.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-executor.d.ts +7 -0
- package/lib/tests/integration/models/test-executor.d.ts.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-message.d.ts +6 -0
- package/lib/tests/integration/models/test-message.d.ts.map +1 -0
- package/lib/tests/integration/models/test-middleware.d.ts +7 -0
- package/lib/tests/integration/models/test-middleware.d.ts.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-registry.d.ts +8 -0
- package/lib/tests/integration/models/test-registry.d.ts.map +1 -0
- package/lib/utils/id.generator.d.ts +5 -0
- package/lib/utils/id.generator.d.ts.map +1 -0
- package/package.json +2 -2
- package/lib/index.d.mts +0 -701
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC"}
|
package/lib/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {ReplaySubject,BehaviorSubject,Subject,Observable}from'rxjs';import {tap,first}from'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
|
|
1
|
+
import {ReplaySubject,BehaviorSubject,Subject,Observable}from'rxjs';import {tap,first}from'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 ReplaySubject(t)),this}recordBehavior(e,t){return this.record(e,new BehaviorSubject(t)),this}recordSubject(e){return this.record(e,new 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(tap(t)):e.result,d=new 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(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 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{};export{y as AddMiddleware,u as AddNamespace,p as ConnectExecutor,n as ConnectHandler,a as ConnectMessage,c as DisconnectMessage,m as EliminateNamespace,h as LockMessage,v as PostboyAbstractRegistrator,D as PostboyCallbackMessage,k as PostboyExecutionHandler,o as PostboyExecutor,f as PostboyGenericMessage,b as PostboyMessage,M as PostboyMessageStore,P as PostboyMiddlewareService,T as PostboyNamespaceStore,I as PostboyService,l as PostboySubscription,g as RemoveMiddleware,x as UnlockMessage,i as checkId};//# sourceMappingURL=index.mjs.map
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PostboyMiddleware } from '../models/postboy-middleware';
|
|
2
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a {@link PostboyMiddleware} addition operation for Postboy.
|
|
5
|
+
* This class extends the functionality of the PostboyExecutor to add middleware to the processing chain.
|
|
6
|
+
*
|
|
7
|
+
* The middleware to be added is provided during instantiation.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AddMiddleware extends PostboyExecutor<void> {
|
|
10
|
+
middleware: PostboyMiddleware;
|
|
11
|
+
static readonly ID = "0a8cfe0a-6193-4082-8440-d0793367b21d";
|
|
12
|
+
/**
|
|
13
|
+
* Initializes a new instance of the class with the specified middleware.
|
|
14
|
+
*
|
|
15
|
+
* @param {PostboyMiddleware} middleware - The {@link PostboyMiddleware} to be used for processing.
|
|
16
|
+
*/
|
|
17
|
+
constructor(middleware: PostboyMiddleware);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=add-middleware.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-middleware.executor.d.ts","sourceRoot":"","sources":["../../src/messages/add-middleware.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,eAAe,CAAC,IAAI,CAAC;IAQnC,UAAU,EAAE,iBAAiB;IAPhD,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;OAIG;gBACgB,UAAU,EAAE,iBAAiB;CAGjD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PostboyAbstractRegistrator } from '../postboy-abstract.registrator';
|
|
2
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
3
|
+
/**
|
|
4
|
+
* AddNamespace is a class that extends the PostboyExecutor with a specific implementation
|
|
5
|
+
* for adding namespaces to a PostboyService instance.
|
|
6
|
+
*
|
|
7
|
+
* This class is identified uniquely by its static ID property for tracking and referencing purposes.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AddNamespace extends PostboyExecutor<PostboyAbstractRegistrator> {
|
|
10
|
+
space: string;
|
|
11
|
+
static readonly ID = "6d1a6f7d-6b6e-4c4d-8af8-9cc9a32e850c";
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of the class with the specified space identifier.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} space - The identifier for the space.
|
|
16
|
+
*/
|
|
17
|
+
constructor(space: string);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=add-namespace.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-namespace.executor.d.ts","sourceRoot":"","sources":["../../src/messages/add-namespace.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAK7D;;;;;GAKG;AACH,qBAAa,YAAa,SAAQ,eAAe,CAAC,0BAA0B,CAAC;IAQxD,KAAK,EAAE,MAAM;IAPhC,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;OAIG;gBACgB,KAAK,EAAE,MAAM;CAGjC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
2
|
+
import { MessageType } from '../postboy-abstract.registrator';
|
|
3
|
+
/**
|
|
4
|
+
* Registers an executor that connects to a specific type of message handler.
|
|
5
|
+
* This class extends the functionality of `PostboyExecutor` and is designed to manage
|
|
6
|
+
* the execution of a handler defined by a specific message type and an execution function.
|
|
7
|
+
*
|
|
8
|
+
* @template E The type of the executor extending {@link PostboyExecutor}.
|
|
9
|
+
* @template T The return type of the execution function.
|
|
10
|
+
*
|
|
11
|
+
* @extends {PostboyExecutor<void>}
|
|
12
|
+
*/
|
|
13
|
+
export declare class ConnectExecutor<E extends PostboyExecutor<T>, T> extends PostboyExecutor<void> {
|
|
14
|
+
type: MessageType<E>;
|
|
15
|
+
exec: (e: E) => T;
|
|
16
|
+
static readonly ID = "cb80e8ad-b68c-4b2d-8c44-617ea6017cb3";
|
|
17
|
+
/**
|
|
18
|
+
* Constructs an instance of the class with the specified type and execution function.
|
|
19
|
+
*
|
|
20
|
+
* @param {MessageType<E>} type - The type of the message.
|
|
21
|
+
* @param {(e: E) => T} exec - The function to be executed with the input of type E that returns a value of type T.
|
|
22
|
+
*/
|
|
23
|
+
constructor(type: MessageType<E>, exec: (e: E) => T);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=connect-executor.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-executor.executor.d.ts","sourceRoot":"","sources":["../../src/messages/connect-executor.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;;;;;;GASG;AACH,qBAAa,eAAe,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,eAAe,CAAC,IAAI,CAAC;IAUhF,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IACpB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;IAV1B,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;;OAKG;gBAEM,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC;CAI3B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
2
|
+
import { PostboyExecutionHandler } from '../models/postboy-execution.handler';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a connection handler that extends the PostboyExecutor class.
|
|
5
|
+
*
|
|
6
|
+
* This class encapsulates logic associated with executing a handler in a structured way.
|
|
7
|
+
* It is generic and operates on the provided executor and handler types.
|
|
8
|
+
*
|
|
9
|
+
* Type Parameters:
|
|
10
|
+
* E - Represents an extension of the PostboyExecutor class with a specific type parameter R.
|
|
11
|
+
* R - Represents the type of the result that the executor is expected to operate on.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ConnectHandler<E extends PostboyExecutor<R>, R> extends PostboyExecutor<void> {
|
|
14
|
+
executor: new (...args: any[]) => E;
|
|
15
|
+
handler: PostboyExecutionHandler<R, E>;
|
|
16
|
+
static readonly ID = "bf618cea-6f32-417c-9548-8eafe937378b";
|
|
17
|
+
/**
|
|
18
|
+
* Constructs an instance of the class.
|
|
19
|
+
*
|
|
20
|
+
* @param {new (...args: any[]) => E} executor - A constructor function for the executor object.
|
|
21
|
+
* @param {PostboyExecutionHandler<R, E>} handler - A handler that processes the execution logic.
|
|
22
|
+
*/
|
|
23
|
+
constructor(executor: new (...args: any[]) => E, handler: PostboyExecutionHandler<R, E>);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=connect-handler.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-handler.executor.d.ts","sourceRoot":"","sources":["../../src/messages/connect-handler.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAE9E;;;;;;;;;GASG;AACH,qBAAa,cAAc,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,CAAE,SAAQ,eAAe,CAAC,IAAI,CAAC;IAU/E,QAAQ,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC;IACnC,OAAO,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;IAV/C,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;;OAKG;gBAEM,QAAQ,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,EACnC,OAAO,EAAE,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC;CAIhD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
2
|
+
import { PostboyGenericMessage } from '../models/postboy-generic-message';
|
|
3
|
+
import { MessageType } from '../postboy-abstract.registrator';
|
|
4
|
+
import { Observable, Subject } from 'rxjs';
|
|
5
|
+
/**
|
|
6
|
+
* Represents a message that facilitates connection functionality
|
|
7
|
+
* within the application's messaging system.
|
|
8
|
+
*
|
|
9
|
+
* @template T - A type that extends {@link PostboyGenericMessage}, representing
|
|
10
|
+
* the structure of the message being handled.
|
|
11
|
+
*
|
|
12
|
+
* @extends PostboyExecutor<void>
|
|
13
|
+
*/
|
|
14
|
+
export declare class ConnectMessage<T extends PostboyGenericMessage> extends PostboyExecutor<void> {
|
|
15
|
+
type: MessageType<T>;
|
|
16
|
+
sub: Subject<T>;
|
|
17
|
+
pipe?: ((s: Subject<T>) => Observable<T>) | undefined;
|
|
18
|
+
static readonly ID = "aa03a192-bdc7-402d-9f2f-bf3748229ea2";
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a new instance of the class.
|
|
21
|
+
*
|
|
22
|
+
* @param {MessageType<T>} type - The type of the message.
|
|
23
|
+
* @param {Subject<T>} sub - The subject to be used for message handling.
|
|
24
|
+
* @param {(s: Subject<T>) => Observable<T>} [pipe] - An optional function to transform the subject.
|
|
25
|
+
*/
|
|
26
|
+
constructor(type: MessageType<T>, sub: Subject<T>, pipe?: ((s: Subject<T>) => Observable<T>) | undefined);
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=connect-message.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect-message.executor.d.ts","sourceRoot":"","sources":["../../src/messages/connect-message.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE3C;;;;;;;;GAQG;AACH,qBAAa,cAAc,CAAC,CAAC,SAAS,qBAAqB,CAAE,SAAQ,eAAe,CAAC,IAAI,CAAC;IAW/E,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IACpB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACf,IAAI,CAAC,OAAM,QAAQ,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC;IAZhD,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;;;OAMG;gBAEM,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EACpB,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EACf,IAAI,CAAC,OAAM,QAAQ,CAAC,CAAC,KAAK,WAAW,CAAC,CAAC,aAAA;CAIjD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a message signaling a disconnection event. This class is used
|
|
4
|
+
* within the framework to manage and process disconnection notifications.
|
|
5
|
+
* Extends the {@link PostboyExecutor} base class.
|
|
6
|
+
*
|
|
7
|
+
* @extends {PostboyExecutor<void>}
|
|
8
|
+
*/
|
|
9
|
+
export declare class DisconnectMessage extends PostboyExecutor<void> {
|
|
10
|
+
messageId: string;
|
|
11
|
+
static readonly ID = "94579e43-5bc9-4517-bcda-b595bcda1ae7";
|
|
12
|
+
/**
|
|
13
|
+
* Creates an instance of the class with the specified message identifier.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} messageId - The unique identifier for the message.
|
|
16
|
+
*/
|
|
17
|
+
constructor(messageId: string);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=disconnect-message.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disconnect-message.executor.d.ts","sourceRoot":"","sources":["../../src/messages/disconnect-message.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;GAMG;AACH,qBAAa,iBAAkB,SAAQ,eAAe,CAAC,IAAI,CAAC;IAQvC,SAAS,EAAE,MAAM;IAPpC,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;OAIG;gBACgB,SAAS,EAAE,MAAM;CAGrC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an executor that eliminates a specific namespace.
|
|
4
|
+
* This class extends the PostboyExecutor with a void return type.
|
|
5
|
+
*/
|
|
6
|
+
export declare class EliminateNamespace extends PostboyExecutor<void> {
|
|
7
|
+
space: string;
|
|
8
|
+
static readonly ID = "03bb03bb-53e0-4b74-9aad-64d5c54a8972";
|
|
9
|
+
/**
|
|
10
|
+
* Creates an instance of the class with the specified space value.
|
|
11
|
+
*
|
|
12
|
+
* @param {string} space - The string value representing the space configuration.
|
|
13
|
+
*/
|
|
14
|
+
constructor(space: string);
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=eliminate-namespace.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eliminate-namespace.executor.d.ts","sourceRoot":"","sources":["../../src/messages/eliminate-namespace.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,eAAe,CAAC,IAAI,CAAC;IAQxC,KAAK,EAAE,MAAM;IAPhC,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;OAIG;gBACgB,KAAK,EAAE,MAAM;CAGjC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export { AddMiddleware } from './add-middleware.executor';
|
|
2
|
+
export { RemoveMiddleware } from './remove-middleware.executor';
|
|
3
|
+
export { LockMessage } from './lock-message.executor';
|
|
4
|
+
export { UnlockMessage } from './unlock-message.executor';
|
|
5
|
+
export { AddNamespace } from './add-namespace.executor';
|
|
6
|
+
export { EliminateNamespace } from './eliminate-namespace.executor';
|
|
7
|
+
export { ConnectHandler } from './connect-handler.executor';
|
|
8
|
+
export { ConnectExecutor } from './connect-executor.executor';
|
|
9
|
+
export { DisconnectMessage } from './disconnect-message.executor';
|
|
10
|
+
export { ConnectMessage } from './connect-message.executor';
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '../models/postboy-generic-message';
|
|
2
|
+
import { MessageType } from '../postboy-abstract.registrator';
|
|
3
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
4
|
+
/**
|
|
5
|
+
* Locks a specific message type to prevent firing of them.
|
|
6
|
+
*
|
|
7
|
+
* This class is used to handle operations associated with locking mechanisms
|
|
8
|
+
* for a specified message type.
|
|
9
|
+
*
|
|
10
|
+
* @template T - A type that extends {@link PostboyGenericMessage}.
|
|
11
|
+
*/
|
|
12
|
+
export declare class LockMessage<T extends PostboyGenericMessage> extends PostboyExecutor<void> {
|
|
13
|
+
type: MessageType<T>;
|
|
14
|
+
static readonly ID = "477df3e2-1f99-4476-9a3b-afd1fa426436";
|
|
15
|
+
/**
|
|
16
|
+
* Constructs an instance of the class with the specified message type.
|
|
17
|
+
*
|
|
18
|
+
* @param {MessageType<T>} type - The type of the message to be used for the instance.
|
|
19
|
+
*/
|
|
20
|
+
constructor(type: MessageType<T>);
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=lock-message.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lock-message.executor.d.ts","sourceRoot":"","sources":["../../src/messages/lock-message.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;;;;;GAOG;AACH,qBAAa,WAAW,CAAC,CAAC,SAAS,qBAAqB,CAAE,SAAQ,eAAe,CAAC,IAAI,CAAC;IAQlE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IAPvC,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;OAIG;gBACgB,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;CAGxC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { PostboyMiddleware } from '../models/postboy-middleware';
|
|
2
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a class responsible for removing {@link PostboyMiddleware} in execution flow.
|
|
5
|
+
* This class extends PostboyExecutor and operates with a void return type.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RemoveMiddleware extends PostboyExecutor<void> {
|
|
8
|
+
middleware: PostboyMiddleware;
|
|
9
|
+
static readonly ID = "c25c708c-53c9-498d-a28b-936fbaf68b91";
|
|
10
|
+
/**
|
|
11
|
+
* Constructs an instance of the class with the specified middleware.
|
|
12
|
+
*
|
|
13
|
+
* @param {PostboyMiddleware} middleware - The {@link PostboyMiddleware} instance to be removed.
|
|
14
|
+
*/
|
|
15
|
+
constructor(middleware: PostboyMiddleware);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=remove-middleware.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-middleware.executor.d.ts","sourceRoot":"","sources":["../../src/messages/remove-middleware.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAE7D;;;GAGG;AACH,qBAAa,gBAAiB,SAAQ,eAAe,CAAC,IAAI,CAAC;IAQtC,UAAU,EAAE,iBAAiB;IAPhD,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;OAIG;gBACgB,UAAU,EAAE,iBAAiB;CAGjD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '../models/postboy-generic-message';
|
|
2
|
+
import { PostboyExecutor } from '../models/postboy-executor';
|
|
3
|
+
import { MessageType } from '../postboy-abstract.registrator';
|
|
4
|
+
/**
|
|
5
|
+
* A specialized executor that handles the unlocking process for messages of a specified type.
|
|
6
|
+
* Unlocks a previously locked message, making it available for processing again.
|
|
7
|
+
*
|
|
8
|
+
* @template T - The type parameter extending {@link PostboyGenericMessage}, representing the message type handled by the executor.
|
|
9
|
+
* @extends {PostboyExecutor<void>}
|
|
10
|
+
*/
|
|
11
|
+
export declare class UnlockMessage<T extends PostboyGenericMessage> extends PostboyExecutor<void> {
|
|
12
|
+
type: MessageType<T>;
|
|
13
|
+
static readonly ID = "d71d25e3-90ac-4009-b972-9e6c6b05611e";
|
|
14
|
+
/**
|
|
15
|
+
* Creates an instance of the class with the specified message type.
|
|
16
|
+
*
|
|
17
|
+
* @param {MessageType<T>} type - The message type for this instance.
|
|
18
|
+
*/
|
|
19
|
+
constructor(type: MessageType<T>);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=unlock-message.executor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlock-message.executor.d.ts","sourceRoot":"","sources":["../../src/messages/unlock-message.executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D;;;;;;GAMG;AACH,qBAAa,aAAa,CAAC,CAAC,SAAS,qBAAqB,CAAE,SAAQ,eAAe,CAAC,IAAI,CAAC;IAQpE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;IAPvC,MAAM,CAAC,QAAQ,CAAC,EAAE,0CAA0C;IAE5D;;;;OAIG;gBACgB,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;CAGxC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { PostboyMessage } from './postboy.message';
|
|
2
|
+
export { PostboyCallbackMessage } from './postboy-callback.message';
|
|
3
|
+
export { PostboyExecutionHandler } from './postboy-execution.handler';
|
|
4
|
+
export { PostboyExecutor } from './postboy-executor';
|
|
5
|
+
export { PostboyGenericMessage, checkId } from './postboy-generic-message';
|
|
6
|
+
export { PostboyMiddleware } from './postboy-middleware';
|
|
7
|
+
export { PostboySubscription } from './postboy-subscription';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Observable, Subject } from 'rxjs';
|
|
2
|
+
import { PostboyGenericMessage } from './postboy-generic-message';
|
|
3
|
+
/**
|
|
4
|
+
* An abstract class extending PostboyGenericMessage that provides mechanisms for managing
|
|
5
|
+
* asynchronous data communication using RxJS observables. It is designed to work with
|
|
6
|
+
* callback-based operations that emit a result of type T.
|
|
7
|
+
*
|
|
8
|
+
* @template T - The type of the data emitted by the observables in this class.
|
|
9
|
+
*
|
|
10
|
+
* @extends PostboyGenericMessage
|
|
11
|
+
*
|
|
12
|
+
* @property {Observable<T>} result - An observable that emits the result of the operation
|
|
13
|
+
* and completes once the operation is finished.
|
|
14
|
+
*
|
|
15
|
+
* @method next - Emits the next value for the result observable.
|
|
16
|
+
* @param {T} value - The value to be emitted by the result observable.
|
|
17
|
+
*
|
|
18
|
+
* @method finish - Emits the final value for the result observable and completes it.
|
|
19
|
+
* @param {T} value - The final value for the observable emission.
|
|
20
|
+
*/
|
|
21
|
+
export declare abstract class PostboyCallbackMessage<T> extends PostboyGenericMessage {
|
|
22
|
+
protected result$: Subject<T>;
|
|
23
|
+
result: Observable<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Emits the provided value.
|
|
26
|
+
*
|
|
27
|
+
* @template T - The type of the value to emit.
|
|
28
|
+
* @param {T} value - The value to emit through the `result$` observable.
|
|
29
|
+
* @returns {void}
|
|
30
|
+
*/
|
|
31
|
+
next: (value: T) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Marks the operation as complete by emitting the provided value and then completing the result stream.
|
|
34
|
+
*
|
|
35
|
+
* @param {T} value - The value to emit prior to completing the result stream.
|
|
36
|
+
* @return {void} This method does not return a value.
|
|
37
|
+
*/
|
|
38
|
+
finish(value: T): void;
|
|
39
|
+
/**
|
|
40
|
+
* Completes the current observable result stream.
|
|
41
|
+
* This method marks the result observable as complete, ensuring no further values
|
|
42
|
+
* or events will be emitted from it.
|
|
43
|
+
*
|
|
44
|
+
* @return {void} No value is returned from this method.
|
|
45
|
+
*/
|
|
46
|
+
complete(): void;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=postboy-callback.message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-callback.message.d.ts","sourceRoot":"","sources":["../../src/models/postboy-callback.message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3C,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,sBAAsB,CAAC,CAAC,CAAE,SAAQ,qBAAqB;IAC3E,SAAS,CAAC,OAAO,aAAoB;IAC9B,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,CAA+B;IAE3D;;;;;;OAMG;IACI,IAAI,UAAW,CAAC,KAAG,IAAI,CAA6B;IAE3D;;;;;OAKG;IACI,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;IAK7B;;;;;;OAMG;IACI,QAAQ,IAAI,IAAI;CAGxB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { PostboyExecutor } from './postboy-executor';
|
|
2
|
+
/**
|
|
3
|
+
* Abstract class representing a handler for executing a Postboy task.
|
|
4
|
+
*
|
|
5
|
+
* This class is intended to manage the execution flow of a PostboyExecutor instance.
|
|
6
|
+
* Subclasses must implement the `handle` method, which executes a given PostboyExecutor
|
|
7
|
+
* and returns a result of type R.
|
|
8
|
+
*
|
|
9
|
+
* @template R The type of the result returned by the `handle` method.
|
|
10
|
+
* @template E The type of the executor extending the PostboyExecutor.
|
|
11
|
+
*/
|
|
12
|
+
export declare abstract class PostboyExecutionHandler<R, E extends PostboyExecutor<R>> {
|
|
13
|
+
/**
|
|
14
|
+
* Abstract method to handle the specified executor and return a result.
|
|
15
|
+
*
|
|
16
|
+
* @param {E} executor - The executor that will be processed by the method.
|
|
17
|
+
* @return {R} The result obtained after handling the executor.
|
|
18
|
+
*/
|
|
19
|
+
abstract handle(executor: E): R;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=postboy-execution.handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-execution.handler.d.ts","sourceRoot":"","sources":["../../src/models/postboy-execution.handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;GASG;AACH,8BAAsB,uBAAuB,CAAC,CAAC,EAAE,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC;IAC3E;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-executor.d.ts","sourceRoot":"","sources":["../../src/models/postboy-executor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,8BAAsB,eAAe,CAAC,CAAC,CAAE,SAAQ,cAAc;IAC7D,mBAA2B,kBAAkB,CAAC,EAAE,CAAC,CAAC;CACnD"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostboyMessage } from './postboy.message';
|
|
2
|
+
/**
|
|
3
|
+
* An inheritor should have a static ID field
|
|
4
|
+
*/
|
|
5
|
+
export declare abstract class PostboyGenericMessage extends PostboyMessage {
|
|
6
|
+
}
|
|
7
|
+
export declare function checkId(message: new (...args: any[]) => any): string;
|
|
8
|
+
//# sourceMappingURL=postboy-generic-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-generic-message.d.ts","sourceRoot":"","sources":["../../src/models/postboy-generic-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD;;GAEG;AACH,8BAAsB,qBAAsB,SAAQ,cAAc;CAAG;AACrE,wBAAgB,OAAO,CAAC,OAAO,EAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,MAAM,CAGpE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents metadata associated with a Postboy message.
|
|
3
|
+
*
|
|
4
|
+
* This interface can be used to store optional metadata that provides
|
|
5
|
+
* additional context or tracking information for a message. It supports
|
|
6
|
+
* flexible extension by allowing additional properties through an index signature.
|
|
7
|
+
*
|
|
8
|
+
* Properties:
|
|
9
|
+
* - `correlationId` (optional): A unique identifier used to correlate
|
|
10
|
+
* related messages or operations across systems.
|
|
11
|
+
* - `causationId` (optional): The identifier of the preceding message
|
|
12
|
+
* or event that caused the current message to be produced.
|
|
13
|
+
* - `source` (optional): The origin or source of the message, such as
|
|
14
|
+
* a particular service or system.
|
|
15
|
+
* - `tags` (optional): An array of tags or labels that can be attached
|
|
16
|
+
* to the message for categorization, filtering, or logging purposes.
|
|
17
|
+
* - `[key: string]` (optional): Additional custom properties can be
|
|
18
|
+
* added to capture specific metadata not covered by the predefined fields.
|
|
19
|
+
*/
|
|
20
|
+
export interface PostboyMessageMetadata {
|
|
21
|
+
correlationId?: string;
|
|
22
|
+
causationId?: string;
|
|
23
|
+
tags?: Set<string>;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=postboy-message-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-message-metadata.d.ts","sourceRoot":"","sources":["../../src/models/postboy-message-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,WAAW,sBAAsB;IACrC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-message.context.d.ts","sourceRoot":"","sources":["../../src/models/postboy-message.context.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;CACpB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-middleware.d.ts","sourceRoot":"","sources":["../../src/models/postboy-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,iBAAiB;IAChC,MAAM,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;CACvC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Observable, Subject } from 'rxjs';
|
|
2
|
+
/**
|
|
3
|
+
* A class that manages a reactive subscription using a provided Subject and transformation pipe.
|
|
4
|
+
* Offers methods to interact with the subscription, such as emitting data, completing the subscription,
|
|
5
|
+
* and accessing the transformed observable.
|
|
6
|
+
*
|
|
7
|
+
* @template T The type of data managed by the subscription.
|
|
8
|
+
*/
|
|
9
|
+
export declare class PostboySubscription<T> {
|
|
10
|
+
private subscription;
|
|
11
|
+
private readonly _subscription;
|
|
12
|
+
/**
|
|
13
|
+
* Constructs an instance of the class with a given subscription and a transformation pipe.
|
|
14
|
+
*
|
|
15
|
+
* @param {Subject<T>} subscription - The source Subject that will be transformed.
|
|
16
|
+
* @param {(s: Subject<T>) => Observable<T>} pipe - A function that applies a transformation to the subscription.
|
|
17
|
+
*/
|
|
18
|
+
constructor(subscription: Subject<T>, pipe?: (s: Subject<T>) => Observable<T>);
|
|
19
|
+
/**
|
|
20
|
+
* Returns an observable subscription.
|
|
21
|
+
*
|
|
22
|
+
* @return {Observable<T>} An observable instance of type T.
|
|
23
|
+
*/
|
|
24
|
+
sub(): Observable<T>;
|
|
25
|
+
/**
|
|
26
|
+
* Triggers an event by emitting the provided data to all subscribers.
|
|
27
|
+
*
|
|
28
|
+
* @param {T} data - The data to emit to the subscribers.
|
|
29
|
+
* @return {void} - Does not return any value.
|
|
30
|
+
*/
|
|
31
|
+
fire(data: T): void;
|
|
32
|
+
/**
|
|
33
|
+
* Completes the subscription, signaling that no further values will be sent.
|
|
34
|
+
* This is typically used to finalize or clean up resources.
|
|
35
|
+
* @return {void} This method does not return any value.
|
|
36
|
+
*/
|
|
37
|
+
finish(): void;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=postboy-subscription.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy-subscription.d.ts","sourceRoot":"","sources":["../../src/models/postboy-subscription.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE3C;;;;;;GAMG;AACH,qBAAa,mBAAmB,CAAC,CAAC;IAU9B,OAAO,CAAC,YAAY;IATtB,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAgB;IAE9C;;;;;OAKG;gBAEO,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,EAChC,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;IAKzC;;;;OAIG;IACI,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC;IAI3B;;;;;OAKG;IACI,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAI1B;;;;OAIG;IACI,MAAM,IAAI,IAAI;CAGtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PostboyMessageMetadata } from './postboy-message-metadata';
|
|
2
|
+
export declare abstract class PostboyMessage {
|
|
3
|
+
metadata: PostboyMessageMetadata;
|
|
4
|
+
get id(): string;
|
|
5
|
+
setMetadata(metadata: Partial<PostboyMessageMetadata>): this;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=postboy.message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy.message.d.ts","sourceRoot":"","sources":["../../src/models/postboy.message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,8BAAsB,cAAc;IAC3B,QAAQ,EAAE,sBAAsB,CAAM;IAC7C,IAAW,EAAE,IAAI,MAAM,CAEtB;IAED,WAAW,CAAC,QAAQ,EAAE,OAAO,CAAC,sBAAsB,CAAC,GAAG,IAAI;CAI7D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents configurable settings for the Postboy system.
|
|
3
|
+
*/
|
|
4
|
+
export declare class PostboySettings {
|
|
5
|
+
metadata: boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Constructs an instance of the class with optional settings.
|
|
8
|
+
*
|
|
9
|
+
* @param {Partial<PostboySettings>} [settings] - Optional settings to configure the instance. Can include partial metadata or other configurations.
|
|
10
|
+
*/
|
|
11
|
+
constructor(settings?: Partial<PostboySettings>);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=postboy.settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy.settings.d.ts","sourceRoot":"","sources":["../../src/models/postboy.settings.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,eAAe;IACnB,QAAQ,EAAE,OAAO,CAAS;IAEjC;;;;OAIG;gBACS,QAAQ,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC;CAGhD"}
|