@artstesh/postboy 2.0.1 → 2.0.2

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.
@@ -1,4 +1,4 @@
1
- export interface IPostboyDependingService {
2
- up(): void;
3
- }
1
+ export interface IPostboyDependingService {
2
+ up(): void;
3
+ }
4
4
  //# sourceMappingURL=i-postboy-depending.service.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=i-postboy-depending.service.js.map
package/lib/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- export * from './postboy.service';
2
- export * from './i-postboy-depending.service';
3
- export * from './postboy-abstract.registrator';
4
- export * from './models/postboy-generic-message';
5
- export * from './models/postboy-callback.message';
6
- export * from './models/postboy.locker';
7
- export * from './models/postboy-executor';
1
+ export * from './postboy.service';
2
+ export * from './mocks/postboy-service-mock';
3
+ export * from './i-postboy-depending.service';
4
+ export * from './postboy-abstract.registrator';
5
+ export * from './models/postboy-generic-message';
6
+ export * from './models/postboy-callback.message';
7
+ export * from './models/postboy.locker';
8
+ export * from './models/postboy-executor';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAIA,cAAc,mBAAmB,CAAC;AAClC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kCAAkC,CAAC;AACjD,cAAc,mCAAmC,CAAC;AAClD,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC"}
package/lib/index.js CHANGED
@@ -1,27 +1,28 @@
1
- "use strict";
2
- /*
3
- * Public API Surface of postboy
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
- };
19
- Object.defineProperty(exports, "__esModule", { value: true });
20
- __exportStar(require("./postboy.service"), exports);
21
- __exportStar(require("./i-postboy-depending.service"), exports);
22
- __exportStar(require("./postboy-abstract.registrator"), exports);
23
- __exportStar(require("./models/postboy-generic-message"), exports);
24
- __exportStar(require("./models/postboy-callback.message"), exports);
25
- __exportStar(require("./models/postboy.locker"), exports);
26
- __exportStar(require("./models/postboy-executor"), exports);
1
+ "use strict";
2
+ /*
3
+ * Public API Surface of postboy
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ __exportStar(require("./postboy.service"), exports);
21
+ __exportStar(require("./mocks/postboy-service-mock"), exports);
22
+ __exportStar(require("./i-postboy-depending.service"), exports);
23
+ __exportStar(require("./postboy-abstract.registrator"), exports);
24
+ __exportStar(require("./models/postboy-generic-message"), exports);
25
+ __exportStar(require("./models/postboy-callback.message"), exports);
26
+ __exportStar(require("./models/postboy.locker"), exports);
27
+ __exportStar(require("./models/postboy-executor"), exports);
27
28
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC,gEAA8C;AAC9C,iEAA+C;AAC/C,mEAAiD;AACjD,oEAAkD;AAClD,0DAAwC;AACxC,4DAA0C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;AAEH,oDAAkC;AAClC,+DAA6C;AAC7C,gEAA8C;AAC9C,iEAA+C;AAC/C,mEAAiD;AACjD,oEAAkD;AAClD,0DAAwC;AACxC,4DAA0C"}
@@ -1,9 +1,9 @@
1
- import { PostboyLocker } from './models/postboy.locker';
2
- export declare class LockerStore {
3
- private lockers;
4
- private unlockers;
5
- private locked;
6
- addLocker(locker: PostboyLocker): void;
7
- check(eventId: string): boolean;
8
- }
1
+ import { PostboyLocker } from './models/postboy.locker';
2
+ export declare class LockerStore {
3
+ private lockers;
4
+ private unlockers;
5
+ private locked;
6
+ addLocker(locker: PostboyLocker): void;
7
+ check(eventId: string): boolean;
8
+ }
9
9
  //# sourceMappingURL=locker.store.d.ts.map
@@ -1,27 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LockerStore = void 0;
4
- class LockerStore {
5
- constructor() {
6
- this.lockers = {};
7
- this.unlockers = {};
8
- this.locked = new Set();
9
- }
10
- addLocker(locker) {
11
- if (locker.locker)
12
- this.lockers[locker.locker] = locker.locking;
13
- if (locker.unlocker)
14
- this.unlockers[locker.unlocker] = locker.locking;
15
- }
16
- check(eventId) {
17
- if (this.locked.has(eventId))
18
- return false;
19
- if (this.unlockers[eventId])
20
- this.unlockers[eventId].forEach((id) => this.locked.delete(id));
21
- if (this.lockers[eventId])
22
- this.lockers[eventId].forEach((id) => this.locked.add(id));
23
- return true;
24
- }
25
- }
26
- exports.LockerStore = LockerStore;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LockerStore = void 0;
4
+ class LockerStore {
5
+ constructor() {
6
+ this.lockers = {};
7
+ this.unlockers = {};
8
+ this.locked = new Set();
9
+ }
10
+ addLocker(locker) {
11
+ if (locker.locker)
12
+ this.lockers[locker.locker] = locker.locking;
13
+ if (locker.unlocker)
14
+ this.unlockers[locker.unlocker] = locker.locking;
15
+ }
16
+ check(eventId) {
17
+ if (this.locked.has(eventId))
18
+ return false;
19
+ if (this.unlockers[eventId])
20
+ this.unlockers[eventId].forEach((id) => this.locked.delete(id));
21
+ if (this.lockers[eventId])
22
+ this.lockers[eventId].forEach((id) => this.locked.add(id));
23
+ return true;
24
+ }
25
+ }
26
+ exports.LockerStore = LockerStore;
27
27
  //# sourceMappingURL=locker.store.js.map
@@ -0,0 +1,18 @@
1
+ import { PostboyService } from '../postboy.service';
2
+ import { Observable } from 'rxjs';
3
+ import { PostboyExecutor } from '../models/postboy-executor';
4
+ import { PostboyGenericMessage } from '../models/postboy-generic-message';
5
+ export declare class PostboyServiceMock extends PostboyService {
6
+ private executions;
7
+ private subscriptions;
8
+ private fires;
9
+ reset(): void;
10
+ fired(id: string, times?: number): boolean;
11
+ executed(id: string, times?: number): boolean;
12
+ subscribed(id: string, times?: number): boolean;
13
+ private count;
14
+ execute<E extends PostboyExecutor<T>, T>(executor: E): T;
15
+ subscribe<T>(id: string): Observable<T>;
16
+ fire<T extends PostboyGenericMessage>(message: T): void;
17
+ }
18
+ //# sourceMappingURL=postboy-service-mock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postboy-service-mock.d.ts","sourceRoot":"","sources":["../../src/mocks/postboy-service-mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAiB,MAAM,MAAM,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,KAAK,CAAgB;IAE7B,KAAK,IAAI,IAAI;IAMb,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO;IAK7C,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO;IAKhD,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO;IAKlD,OAAO,CAAC,KAAK,CAAmF;IAEhG,OAAO,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAKxD,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAKvC,IAAI,CAAC,CAAC,SAAS,qBAAqB,EAAE,OAAO,EAAE,CAAC;CAIjD"}
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboyServiceMock = void 0;
4
+ const postboy_service_1 = require("../postboy.service");
5
+ class PostboyServiceMock extends postboy_service_1.PostboyService {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.executions = [];
9
+ this.subscriptions = [];
10
+ this.fires = [];
11
+ this.count = (collection, el) => collection.filter((e) => e === el).length;
12
+ }
13
+ reset() {
14
+ this.executions = [];
15
+ this.subscriptions = [];
16
+ this.fires = [];
17
+ }
18
+ fired(id, times = 0) {
19
+ const count = this.count(this.fires, id);
20
+ return !!count && (!times || count === times);
21
+ }
22
+ executed(id, times = 0) {
23
+ const count = this.count(this.executions, id);
24
+ return !!count && (!times || count === times);
25
+ }
26
+ subscribed(id, times = 0) {
27
+ const count = this.count(this.subscriptions, id);
28
+ return !!count && (!times || count === times);
29
+ }
30
+ execute(executor) {
31
+ this.executions.push(executor.id);
32
+ return super.execute(executor);
33
+ }
34
+ subscribe(id) {
35
+ this.subscriptions.push(id);
36
+ return super.subscribe(id);
37
+ }
38
+ fire(message) {
39
+ this.fires.push(message.id);
40
+ super.fire(message);
41
+ }
42
+ }
43
+ exports.PostboyServiceMock = PostboyServiceMock;
44
+ //# sourceMappingURL=postboy-service-mock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postboy-service-mock.js","sourceRoot":"","sources":["../../src/mocks/postboy-service-mock.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AAKpD,MAAa,kBAAmB,SAAQ,gCAAc;IAAtD;;QACU,eAAU,GAAa,EAAE,CAAC;QAC1B,kBAAa,GAAa,EAAE,CAAC;QAC7B,UAAK,GAAa,EAAE,CAAC;QAuBrB,UAAK,GAAG,CAAC,UAAoB,EAAE,EAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;IAgBlG,CAAC;IArCC,KAAK;QACH,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IA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,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;CACF;AA1CD,gDA0CC"}
@@ -1,18 +1,18 @@
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
- };
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
18
  //# sourceMappingURL=dictionary.d.ts.map
@@ -1,59 +1,59 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Dictionary = void 0;
4
- class Dictionary {
5
- constructor() {
6
- this.collection = {};
7
- this._keys = new Set();
8
- this.has = (key) => this._keys.has(key);
9
- }
10
- get keys() {
11
- return Array.from(this._keys);
12
- }
13
- get size() {
14
- return this._keys.size;
15
- }
16
- static clone(dic, action) {
17
- return Dictionary.create(dic.collection, action);
18
- }
19
- static create(dic, action) {
20
- const keyList = Object.keys(dic);
21
- const result = new Dictionary();
22
- for (const key of keyList) {
23
- result._keys.add(key);
24
- result.collection[key] = action ? action(dic[key], key) : dic[key];
25
- }
26
- return result;
27
- }
28
- find(predicate) {
29
- let result = null;
30
- this.forEach((e) => {
31
- if (result === null && predicate(e))
32
- result = e;
33
- });
34
- return result;
35
- }
36
- take(key) {
37
- return this._keys.has(key) ? this.collection[key] : null;
38
- }
39
- put(key, value) {
40
- if (value == null)
41
- return;
42
- this.collection[key] = value;
43
- this._keys.add(key);
44
- }
45
- rmv(key) {
46
- if (!this._keys.has(key))
47
- return;
48
- delete this.collection[key];
49
- this._keys.delete(key);
50
- }
51
- forEach(callback) {
52
- const keys = Object.keys(this.collection);
53
- for (let i = 0; i < keys.length; i++) {
54
- callback(this.collection[keys[i]], i);
55
- }
56
- }
57
- }
58
- exports.Dictionary = Dictionary;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Dictionary = void 0;
4
+ class Dictionary {
5
+ constructor() {
6
+ this.collection = {};
7
+ this._keys = new Set();
8
+ this.has = (key) => this._keys.has(key);
9
+ }
10
+ get keys() {
11
+ return Array.from(this._keys);
12
+ }
13
+ get size() {
14
+ return this._keys.size;
15
+ }
16
+ static clone(dic, action) {
17
+ return Dictionary.create(dic.collection, action);
18
+ }
19
+ static create(dic, action) {
20
+ const keyList = Object.keys(dic);
21
+ const result = new Dictionary();
22
+ for (const key of keyList) {
23
+ result._keys.add(key);
24
+ result.collection[key] = action ? action(dic[key], key) : dic[key];
25
+ }
26
+ return result;
27
+ }
28
+ find(predicate) {
29
+ let result = null;
30
+ this.forEach((e) => {
31
+ if (result === null && predicate(e))
32
+ result = e;
33
+ });
34
+ return result;
35
+ }
36
+ take(key) {
37
+ return this._keys.has(key) ? this.collection[key] : null;
38
+ }
39
+ put(key, value) {
40
+ if (value == null)
41
+ return;
42
+ this.collection[key] = value;
43
+ this._keys.add(key);
44
+ }
45
+ rmv(key) {
46
+ if (!this._keys.has(key))
47
+ return;
48
+ delete this.collection[key];
49
+ this._keys.delete(key);
50
+ }
51
+ forEach(callback) {
52
+ const keys = Object.keys(this.collection);
53
+ for (let i = 0; i < keys.length; i++) {
54
+ callback(this.collection[keys[i]], i);
55
+ }
56
+ }
57
+ }
58
+ exports.Dictionary = Dictionary;
59
59
  //# sourceMappingURL=dictionary.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dictionary.js","sourceRoot":"","sources":["../../src/models/dictionary.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAU;IAAvB;QACS,eAAU,GAAsB,EAAE,CAAC;QAClC,UAAK,GAAG,IAAI,GAAG,EAAU,CAAC;QAgC3B,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAwBpD,CAAC;IAtDC,IAAW,IAAI;QACb,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAED,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;IACzB,CAAC;IAEM,MAAM,CAAC,KAAK,CAAI,GAAkB,EAAE,MAA+B;QACxE,OAAO,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;IAEM,MAAM,CAAC,MAAM,CAAI,GAAsB,EAAE,MAA+B;QAC7E,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,UAAU,EAAK,CAAC;QACnC,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE;YACzB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACtB,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,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generic-message';
3
- export declare abstract class PostboyCallbackMessage<T> extends PostboyGenericMessage {
4
- protected result$: Subject<T>;
5
- result: Observable<T>;
6
- next: (value: T) => void;
7
- finish(value: T): void;
8
- }
1
+ import { Observable, Subject } from 'rxjs';
2
+ import { PostboyGenericMessage } from './postboy-generic-message';
3
+ export declare abstract class PostboyCallbackMessage<T> extends PostboyGenericMessage {
4
+ protected result$: Subject<T>;
5
+ result: Observable<T>;
6
+ next: (value: T) => void;
7
+ finish(value: T): void;
8
+ }
9
9
  //# sourceMappingURL=postboy-callback.message.d.ts.map
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostboyCallbackMessage = void 0;
4
- const rxjs_1 = require("rxjs");
5
- const postboy_generic_message_1 = require("./postboy-generic-message");
6
- class PostboyCallbackMessage extends postboy_generic_message_1.PostboyGenericMessage {
7
- constructor() {
8
- super(...arguments);
9
- this.result$ = new rxjs_1.Subject();
10
- this.result = this.result$.asObservable();
11
- this.next = (value) => this.result$.next(value);
12
- }
13
- finish(value) {
14
- this.result$.next(value);
15
- this.result$.complete();
16
- }
17
- }
18
- exports.PostboyCallbackMessage = PostboyCallbackMessage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboyCallbackMessage = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ const postboy_generic_message_1 = require("./postboy-generic-message");
6
+ class PostboyCallbackMessage extends postboy_generic_message_1.PostboyGenericMessage {
7
+ constructor() {
8
+ super(...arguments);
9
+ this.result$ = new rxjs_1.Subject();
10
+ this.result = this.result$.asObservable();
11
+ this.next = (value) => this.result$.next(value);
12
+ }
13
+ finish(value) {
14
+ this.result$.next(value);
15
+ this.result$.complete();
16
+ }
17
+ }
18
+ exports.PostboyCallbackMessage = PostboyCallbackMessage;
19
19
  //# sourceMappingURL=postboy-callback.message.js.map
@@ -1,4 +1,4 @@
1
- export declare abstract class PostboyExecutor<T> {
2
- abstract id: string;
3
- }
1
+ export declare abstract class PostboyExecutor<T> {
2
+ abstract id: string;
3
+ }
4
4
  //# sourceMappingURL=postboy-executor.d.ts.map
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostboyExecutor = void 0;
4
- class PostboyExecutor {
5
- }
6
- exports.PostboyExecutor = PostboyExecutor;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboyExecutor = void 0;
4
+ class PostboyExecutor {
5
+ }
6
+ exports.PostboyExecutor = PostboyExecutor;
7
7
  //# sourceMappingURL=postboy-executor.js.map
@@ -1,4 +1,4 @@
1
- export declare abstract class PostboyGenericMessage {
2
- abstract id: string;
3
- }
1
+ export declare abstract class PostboyGenericMessage {
2
+ abstract id: string;
3
+ }
4
4
  //# sourceMappingURL=postboy-generic-message.d.ts.map
@@ -1,7 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostboyGenericMessage = void 0;
4
- class PostboyGenericMessage {
5
- }
6
- exports.PostboyGenericMessage = PostboyGenericMessage;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboyGenericMessage = void 0;
4
+ class PostboyGenericMessage {
5
+ }
6
+ exports.PostboyGenericMessage = PostboyGenericMessage;
7
7
  //# sourceMappingURL=postboy-generic-message.js.map
@@ -1,7 +1,7 @@
1
- import { Observable, Subject } from 'rxjs';
2
- export declare class PostboySubscription<T> {
3
- sub: Subject<T>;
4
- pipe: (s: Subject<T>) => Observable<T>;
5
- constructor(sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>);
6
- }
1
+ import { Observable, Subject } from 'rxjs';
2
+ export declare class PostboySubscription<T> {
3
+ sub: Subject<T>;
4
+ pipe: (s: Subject<T>) => Observable<T>;
5
+ constructor(sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>);
6
+ }
7
7
  //# sourceMappingURL=postboy-subscription.d.ts.map
@@ -1,11 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostboySubscription = void 0;
4
- class PostboySubscription {
5
- constructor(sub, pipe) {
6
- this.sub = sub;
7
- this.pipe = pipe;
8
- }
9
- }
10
- exports.PostboySubscription = PostboySubscription;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboySubscription = void 0;
4
+ class PostboySubscription {
5
+ constructor(sub, pipe) {
6
+ this.sub = sub;
7
+ this.pipe = pipe;
8
+ }
9
+ }
10
+ exports.PostboySubscription = PostboySubscription;
11
11
  //# sourceMappingURL=postboy-subscription.js.map
@@ -1,6 +1,6 @@
1
- export interface PostboyLocker {
2
- locker?: string;
3
- unlocker?: string;
4
- locking: string[];
5
- }
1
+ export interface PostboyLocker {
2
+ locker?: string;
3
+ unlocker?: string;
4
+ locking: string[];
5
+ }
6
6
  //# sourceMappingURL=postboy.locker.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  //# sourceMappingURL=postboy.locker.js.map
@@ -1,21 +1,21 @@
1
- import { PostboyService } from './postboy.service';
2
- import { Observable, Subject } from 'rxjs';
3
- import { IPostboyDependingService } from './i-postboy-depending.service';
4
- import { PostboyExecutor } from './models/postboy-executor';
5
- export declare abstract class PostboyAbstractRegistrator {
6
- protected postboy: PostboyService;
7
- private ids;
8
- private services;
9
- constructor(postboy: PostboyService);
10
- protected registerServices(services: IPostboyDependingService[]): void;
11
- up(): void;
12
- protected abstract _up(): void;
13
- protected registerExecutor<E extends PostboyExecutor<T>, T>(id: string, exec: (e: E) => T): void;
14
- protected register<T>(id: string, sub: Subject<T>): void;
15
- protected registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
16
- protected registerReplay: <T>(id: string, bufferSize?: number) => void;
17
- protected registerBehavior: <T>(id: string, initial: T) => void;
18
- protected registerSubject: <T>(id: string) => void;
19
- down(): void;
20
- }
1
+ import { PostboyService } from './postboy.service';
2
+ import { Observable, Subject } from 'rxjs';
3
+ import { IPostboyDependingService } from './i-postboy-depending.service';
4
+ import { PostboyExecutor } from './models/postboy-executor';
5
+ export declare abstract class PostboyAbstractRegistrator {
6
+ protected postboy: PostboyService;
7
+ private ids;
8
+ private services;
9
+ constructor(postboy: PostboyService);
10
+ protected registerServices(services: IPostboyDependingService[]): void;
11
+ up(): void;
12
+ protected abstract _up(): void;
13
+ protected registerExecutor<E extends PostboyExecutor<T>, T>(id: string, exec: (e: E) => T): void;
14
+ protected register<T>(id: string, sub: Subject<T>): void;
15
+ protected registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
16
+ protected registerReplay: <T>(id: string, bufferSize?: number) => void;
17
+ protected registerBehavior: <T>(id: string, initial: T) => void;
18
+ protected registerSubject: <T>(id: string) => void;
19
+ down(): void;
20
+ }
21
21
  //# sourceMappingURL=postboy-abstract.registrator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postboy-abstract.registrator.d.ts","sourceRoot":"","sources":["../src/postboy-abstract.registrator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAmB,UAAU,EAAiB,OAAO,EAAE,MAAM,MAAM,CAAC;AAC3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE5D,8BAAsB,0BAA0B;IAIlC,SAAS,CAAC,OAAO,EAAE,cAAc;IAH7C,OAAO,CAAC,GAAG,CAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAkC;gBAE5B,OAAO,EAAE,cAAc;IAE7C,SAAS,CAAC,gBAAgB,CAAC,QAAQ,EAAE,wBAAwB,EAAE,GAAG,IAAI;IAI/D,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QAAQ,EAAE,wBAAwB,EAAE,GAAG,IAAI;IAI/D,EAAE,IAAI,IAAI;IAKjB,SAAS,CAAC,QAAQ,CAAC,GAAG,IAAI,IAAI;IAE9B,SAAS,CAAC,gBAAgB,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI;IAIhG,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI;IAKxD,SAAS,CAAC,gBAAgB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,IAAI;IAKxG,SAAS,CAAC,cAAc,UAAW,MAAM,+BAAyE;IAElH,SAAS,CAAC,gBAAgB,UAAW,MAAM,WAAW,CAAC,UAAwD;IAE/G,SAAS,CAAC,eAAe,UAAW,MAAM,UAAyC;IAE5E,IAAI,IAAI,IAAI;CAIpB"}
@@ -1,38 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostboyAbstractRegistrator = void 0;
4
- const rxjs_1 = require("rxjs");
5
- class PostboyAbstractRegistrator {
6
- constructor(postboy) {
7
- this.postboy = postboy;
8
- this.ids = [];
9
- this.services = [];
10
- this.registerReplay = (id, bufferSize = 1) => this.register(id, new rxjs_1.ReplaySubject(bufferSize));
11
- this.registerBehavior = (id, initial) => this.register(id, new rxjs_1.BehaviorSubject(initial));
12
- this.registerSubject = (id) => this.register(id, new rxjs_1.Subject());
13
- }
14
- registerServices(services) {
15
- this.services = services;
16
- }
17
- up() {
18
- this._up();
19
- this.services.forEach((s) => s.up());
20
- }
21
- registerExecutor(id, exec) {
22
- this.postboy.registerExecutor(id, exec);
23
- }
24
- register(id, sub) {
25
- this.ids.push(id);
26
- this.postboy.register(id, sub);
27
- }
28
- registerWithPipe(id, sub, pipe) {
29
- this.ids.push(id);
30
- this.postboy.registerWithPipe(id, sub, pipe);
31
- }
32
- down() {
33
- this.services = [];
34
- this.ids.forEach((id) => this.postboy.unregister(id));
35
- }
36
- }
37
- exports.PostboyAbstractRegistrator = PostboyAbstractRegistrator;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboyAbstractRegistrator = void 0;
4
+ const rxjs_1 = require("rxjs");
5
+ class PostboyAbstractRegistrator {
6
+ constructor(postboy) {
7
+ this.postboy = postboy;
8
+ this.ids = [];
9
+ this.services = [];
10
+ this.registerReplay = (id, bufferSize = 1) => this.register(id, new rxjs_1.ReplaySubject(bufferSize));
11
+ this.registerBehavior = (id, initial) => this.register(id, new rxjs_1.BehaviorSubject(initial));
12
+ this.registerSubject = (id) => this.register(id, new rxjs_1.Subject());
13
+ }
14
+ registerServices(services) {
15
+ this.services = services;
16
+ }
17
+ up() {
18
+ this._up();
19
+ this.services.forEach((s) => s.up());
20
+ }
21
+ registerExecutor(id, exec) {
22
+ this.postboy.registerExecutor(id, exec);
23
+ }
24
+ register(id, sub) {
25
+ this.ids.push(id);
26
+ this.postboy.register(id, sub);
27
+ }
28
+ registerWithPipe(id, sub, pipe) {
29
+ this.ids.push(id);
30
+ this.postboy.registerWithPipe(id, sub, pipe);
31
+ }
32
+ down() {
33
+ this.services = [];
34
+ this.ids.forEach((id) => this.postboy.unregister(id));
35
+ }
36
+ }
37
+ exports.PostboyAbstractRegistrator = PostboyAbstractRegistrator;
38
38
  //# sourceMappingURL=postboy-abstract.registrator.js.map
@@ -1,18 +1,18 @@
1
- import { Observable, Subject } from 'rxjs';
2
- import { PostboyGenericMessage } from './models/postboy-generic-message';
3
- import { PostboyLocker } from './models/postboy.locker';
4
- import { PostboyExecutor } from './models/postboy-executor';
5
- export declare class PostboyService {
6
- private applications;
7
- private locker;
8
- private executors;
9
- addLocker(locker: PostboyLocker): void;
10
- registerExecutor<E extends PostboyExecutor<T>, T>(id: string, exec: (e: E) => T): void;
11
- execute<E extends PostboyExecutor<T>, T>(executor: E): T;
12
- register<T>(id: string, sub: Subject<T>): void;
13
- registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
14
- unregister<T>(id: string): void;
15
- subscribe<T>(id: string): Observable<T>;
16
- fire<T extends PostboyGenericMessage>(message: T): void;
17
- }
1
+ import { Observable, Subject } from 'rxjs';
2
+ import { PostboyGenericMessage } from './models/postboy-generic-message';
3
+ import { PostboyLocker } from './models/postboy.locker';
4
+ import { PostboyExecutor } from './models/postboy-executor';
5
+ export declare class PostboyService {
6
+ private applications;
7
+ private locker;
8
+ private executors;
9
+ addLocker(locker: PostboyLocker): void;
10
+ registerExecutor<E extends PostboyExecutor<T>, T>(id: string, exec: (e: E) => T): void;
11
+ execute<E extends PostboyExecutor<T>, T>(executor: E): T;
12
+ register<T>(id: string, sub: Subject<T>): void;
13
+ registerWithPipe<T>(id: string, sub: Subject<T>, pipe: (s: Subject<T>) => Observable<T>): void;
14
+ unregister<T>(id: string): void;
15
+ subscribe<T>(id: string): Observable<T>;
16
+ fire<T extends PostboyGenericMessage>(message: T): void;
17
+ }
18
18
  //# sourceMappingURL=postboy.service.d.ts.map
@@ -1,50 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PostboyService = void 0;
4
- const locker_store_1 = require("./locker.store");
5
- const postboy_subscription_1 = require("./models/postboy-subscription");
6
- const dictionary_1 = require("./models/dictionary");
7
- class PostboyService {
8
- constructor() {
9
- this.applications = new dictionary_1.Dictionary();
10
- this.locker = new locker_store_1.LockerStore();
11
- this.executors = new dictionary_1.Dictionary();
12
- }
13
- addLocker(locker) {
14
- this.locker.addLocker(locker);
15
- }
16
- registerExecutor(id, exec) {
17
- this.executors.put(id, exec);
18
- }
19
- execute(executor) {
20
- if (!this.executors.has(executor.id))
21
- throw new Error(`There is no executor with id ${executor.id}`);
22
- return this.executors.take(executor.id)(executor);
23
- }
24
- register(id, sub) {
25
- this.applications.put(id, new postboy_subscription_1.PostboySubscription(sub, (s) => s.asObservable()));
26
- }
27
- registerWithPipe(id, sub, pipe) {
28
- this.applications.put(id, new postboy_subscription_1.PostboySubscription(sub, pipe));
29
- }
30
- unregister(id) {
31
- var _a, _b;
32
- (_b = (_a = this.applications.take(id)) === null || _a === void 0 ? void 0 : _a.sub) === null || _b === void 0 ? void 0 : _b.complete();
33
- this.applications.rmv(id);
34
- }
35
- subscribe(id) {
36
- const application = this.applications.take(id);
37
- if (!application)
38
- throw new Error(`There is no event with id ${id}`);
39
- return application.pipe(application.sub);
40
- }
41
- fire(message) {
42
- var _a, _b;
43
- if (!((_a = this.applications.take(message.id)) === null || _a === void 0 ? void 0 : _a.sub))
44
- throw new Error(`There is no event with id ${message.id}`);
45
- if (this.locker.check(message.id))
46
- (_b = this.applications.take(message.id)) === null || _b === void 0 ? void 0 : _b.sub.next(message);
47
- }
48
- }
49
- exports.PostboyService = PostboyService;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PostboyService = void 0;
4
+ const locker_store_1 = require("./locker.store");
5
+ const postboy_subscription_1 = require("./models/postboy-subscription");
6
+ const dictionary_1 = require("./models/dictionary");
7
+ class PostboyService {
8
+ constructor() {
9
+ this.applications = new dictionary_1.Dictionary();
10
+ this.locker = new locker_store_1.LockerStore();
11
+ this.executors = new dictionary_1.Dictionary();
12
+ }
13
+ addLocker(locker) {
14
+ this.locker.addLocker(locker);
15
+ }
16
+ registerExecutor(id, exec) {
17
+ this.executors.put(id, exec);
18
+ }
19
+ execute(executor) {
20
+ if (!this.executors.has(executor.id))
21
+ throw new Error(`There is no executor with id ${executor.id}`);
22
+ return this.executors.take(executor.id)(executor);
23
+ }
24
+ register(id, sub) {
25
+ this.applications.put(id, new postboy_subscription_1.PostboySubscription(sub, (s) => s.asObservable()));
26
+ }
27
+ registerWithPipe(id, sub, pipe) {
28
+ this.applications.put(id, new postboy_subscription_1.PostboySubscription(sub, pipe));
29
+ }
30
+ unregister(id) {
31
+ var _a, _b;
32
+ (_b = (_a = this.applications.take(id)) === null || _a === void 0 ? void 0 : _a.sub) === null || _b === void 0 ? void 0 : _b.complete();
33
+ this.applications.rmv(id);
34
+ }
35
+ subscribe(id) {
36
+ const application = this.applications.take(id);
37
+ if (!application)
38
+ throw new Error(`There is no event with id ${id}`);
39
+ return application.pipe(application.sub);
40
+ }
41
+ fire(message) {
42
+ var _a, _b;
43
+ if (!((_a = this.applications.take(message.id)) === null || _a === void 0 ? void 0 : _a.sub))
44
+ throw new Error(`There is no event with id ${message.id}`);
45
+ if (this.locker.check(message.id))
46
+ (_b = this.applications.take(message.id)) === null || _b === void 0 ? void 0 : _b.sub.next(message);
47
+ }
48
+ }
49
+ exports.PostboyService = PostboyService;
50
50
  //# sourceMappingURL=postboy.service.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artstesh/postboy",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "author": "artstesh",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",