@artstesh/postboy 3.0.0 → 3.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.
- package/README.md +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/locker.store.d.ts +9 -0
- package/lib/locker.store.d.ts.map +1 -0
- package/lib/locker.store.js +27 -0
- package/lib/locker.store.js.map +1 -0
- package/lib/mocks/message-history-item-mock.d.ts +10 -0
- package/lib/mocks/message-history-item-mock.d.ts.map +1 -0
- package/lib/mocks/message-history-item-mock.js +26 -0
- package/lib/mocks/message-history-item-mock.js.map +1 -0
- package/lib/mocks/message-history-mock.d.ts +9 -0
- package/lib/mocks/message-history-mock.d.ts.map +1 -0
- package/lib/mocks/message-history-mock.js +23 -0
- package/lib/mocks/message-history-mock.js.map +1 -0
- package/lib/mocks/postboy-service-mock.d.ts +22 -0
- package/lib/mocks/postboy-service-mock.d.ts.map +1 -0
- package/lib/mocks/postboy-service-mock.js +51 -0
- package/lib/mocks/postboy-service-mock.js.map +1 -0
- package/lib/models/message-queue.model.d.ts +43 -43
- package/lib/models/message-queue.model.js +65 -65
- package/lib/models/message-queue.model.js.map +1 -1
- package/lib/models/postboy-callback.message.d.ts.map +1 -1
- package/lib/models/postboy-executor.d.ts +1 -1
- package/lib/models/postboy-executor.d.ts.map +1 -1
- package/lib/models/postboy-executor.js.map +1 -1
- package/lib/models/postboy-generic-message.d.ts +1 -1
- package/lib/models/postboy-generic-message.d.ts.map +1 -1
- package/lib/models/postboy-generic-message.js +2 -2
- package/lib/models/postboy-generic-message.js.map +1 -1
- package/lib/models/postboy-middleware.d.ts +1 -1
- package/lib/models/postboy-middleware.d.ts.map +1 -1
- package/lib/models/postboy-subscription.d.ts +6 -3
- package/lib/models/postboy-subscription.d.ts.map +1 -1
- package/lib/models/postboy-subscription.js +11 -2
- package/lib/models/postboy-subscription.js.map +1 -1
- package/lib/models/postboy.locker.d.ts +6 -0
- package/lib/models/postboy.locker.d.ts.map +1 -0
- package/lib/models/postboy.locker.js +3 -0
- package/lib/models/postboy.locker.js.map +1 -0
- package/lib/postboy-abstract.registrator.d.ts.map +1 -1
- package/lib/postboy.service.d.ts +44 -21
- package/lib/postboy.service.d.ts.map +1 -1
- package/lib/postboy.service.js +57 -49
- package/lib/postboy.service.js.map +1 -1
- package/lib/services/postboy-dependency.resolver.d.ts +7 -0
- package/lib/services/postboy-dependency.resolver.d.ts.map +1 -0
- package/lib/services/postboy-dependency.resolver.js +13 -0
- package/lib/services/postboy-dependency.resolver.js.map +1 -0
- package/lib/services/postboy-message.store.d.ts +16 -0
- package/lib/services/postboy-message.store.d.ts.map +1 -0
- package/lib/services/postboy-message.store.js +39 -0
- package/lib/services/postboy-message.store.js.map +1 -0
- package/lib/services/postboy-middleware.service.d.ts +9 -0
- package/lib/services/postboy-middleware.service.d.ts.map +1 -0
- package/lib/services/postboy-middleware.service.js +20 -0
- package/lib/services/postboy-middleware.service.js.map +1 -0
- package/lib/tests/integration/models/test-callback-message.d.ts +6 -0
- package/lib/tests/integration/models/test-callback-message.d.ts.map +1 -0
- package/lib/tests/integration/models/test-callback-message.js +13 -0
- package/lib/tests/integration/models/test-callback-message.js.map +1 -0
- package/lib/tests/integration/models/test-executor.d.ts +7 -0
- package/lib/tests/integration/models/test-executor.d.ts.map +1 -0
- package/lib/tests/integration/models/test-executor.js +13 -0
- package/lib/tests/integration/models/test-executor.js.map +1 -0
- package/lib/tests/integration/models/test-handler.d.ts +8 -0
- package/lib/tests/integration/models/test-handler.d.ts.map +1 -0
- package/lib/tests/integration/models/test-handler.js +15 -0
- package/lib/tests/integration/models/test-handler.js.map +1 -0
- package/lib/tests/integration/models/test-message.d.ts +6 -0
- package/lib/tests/integration/models/test-message.d.ts.map +1 -0
- package/lib/tests/integration/models/test-message.js +13 -0
- package/lib/tests/integration/models/test-message.js.map +1 -0
- package/lib/tests/integration/models/test-postboy.d.ts +4 -0
- package/lib/tests/integration/models/test-postboy.d.ts.map +1 -0
- package/lib/tests/integration/models/test-postboy.js +8 -0
- package/lib/tests/integration/models/test-postboy.js.map +1 -0
- package/lib/tests/integration/models/test-registry.d.ts +8 -0
- package/lib/tests/integration/models/test-registry.d.ts.map +1 -0
- package/lib/tests/integration/models/test-registry.js +15 -0
- package/lib/tests/integration/models/test-registry.js.map +1 -0
- package/package.json +1 -1
- package/lib/models/queue.d.ts +0 -11
- package/lib/models/queue.d.ts.map +0 -1
- package/lib/models/queue.js +0 -34
- package/lib/models/queue.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Introduction
|
|
2
2
|
|
|
3
|
-
## 1.1
|
|
3
|
+
## 1.1 About the Library
|
|
4
4
|
Modern web development often feels like a survival race: components are scattered across dependency trees, services communicate through layers of abstraction, and events multiply like rabbits in the Australian outback. In this chaos, managing communication isn’t just a task—it’s an art of balancing flexibility and order.
|
|
5
5
|
|
|
6
6
|
**Postboy** was born from this chaos. It’s not just another RxJS-based Event Bus—it’s an attempt to bridge the gap between the power of reactive programming and everyday simplicity. Over years of working with Angular, I’ve watched standard event-handling approaches drown in boilerplate code, while complex state managers morphed into impenetrable "black boxes." Postboy is my answer to these challenges.
|
package/lib/index.d.ts
CHANGED
|
@@ -7,4 +7,6 @@ export * from './models/postboy-execution.handler';
|
|
|
7
7
|
export * from './models/postboy-executor';
|
|
8
8
|
export * from './models/postboy-middleware';
|
|
9
9
|
export * from './models/postboy.message';
|
|
10
|
+
export * from './services/postboy-middleware.service';
|
|
11
|
+
export * from './services/postboy-message.store';
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -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,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC"}
|
|
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,oCAAoC,CAAC;AACnD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,uCAAuC,CAAC;AACtD,cAAc,kCAAkC,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -26,4 +26,6 @@ __exportStar(require("./models/postboy-execution.handler"), exports);
|
|
|
26
26
|
__exportStar(require("./models/postboy-executor"), exports);
|
|
27
27
|
__exportStar(require("./models/postboy-middleware"), exports);
|
|
28
28
|
__exportStar(require("./models/postboy.message"), exports);
|
|
29
|
+
__exportStar(require("./services/postboy-middleware.service"), exports);
|
|
30
|
+
__exportStar(require("./services/postboy-message.store"), exports);
|
|
29
31
|
//# 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,qEAAmD;AACnD,4DAA0C;AAC1C,8DAA4C;AAC5C,2DAAyC"}
|
|
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,qEAAmD;AACnD,4DAA0C;AAC1C,8DAA4C;AAC5C,2DAAyC;AACzC,wEAAsD;AACtD,mEAAiD"}
|
|
@@ -0,0 +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
|
+
}
|
|
9
|
+
//# sourceMappingURL=locker.store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locker.store.d.ts","sourceRoot":"","sources":["../src/locker.store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,qBAAa,WAAW;IACtB,OAAO,CAAC,OAAO,CAAkC;IACjD,OAAO,CAAC,SAAS,CAAkC;IACnD,OAAO,CAAC,MAAM,CAAqB;IAEnC,SAAS,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI;IAKtC,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;CAMhC"}
|
|
@@ -0,0 +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;
|
|
27
|
+
//# sourceMappingURL=locker.store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locker.store.js","sourceRoot":"","sources":["../src/locker.store.ts"],"names":[],"mappings":";;;AAEA,MAAa,WAAW;IAAxB;QACU,YAAO,GAA+B,EAAE,CAAC;QACzC,cAAS,GAA+B,EAAE,CAAC;QAC3C,WAAM,GAAG,IAAI,GAAG,EAAU,CAAC;IAarC,CAAC;IAXC,SAAS,CAAC,MAAqB;QAC7B,IAAI,MAAM,CAAC,MAAM;YAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;QAChE,IAAI,MAAM,CAAC,QAAQ;YAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC;IACxE,CAAC;IAED,KAAK,CAAC,OAAe;QACnB,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3C,IAAI,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;YAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7F,IAAI,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC;YAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;QACtF,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AAhBD,kCAgBC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '../models/postboy-generic-message';
|
|
2
|
+
export declare class MessageHistoryItemMock<T extends PostboyGenericMessage> {
|
|
3
|
+
private list;
|
|
4
|
+
add(message: T): this;
|
|
5
|
+
clear(): void;
|
|
6
|
+
get length(): number;
|
|
7
|
+
get last(): T;
|
|
8
|
+
get all(): T[];
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=message-history-item-mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-history-item-mock.d.ts","sourceRoot":"","sources":["../../src/mocks/message-history-item-mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE1E,qBAAa,sBAAsB,CAAC,CAAC,SAAS,qBAAqB;IACjE,OAAO,CAAC,IAAI,CAAW;IAEvB,GAAG,CAAC,OAAO,EAAE,CAAC;IAKd,KAAK;IAIL,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED,IAAI,IAAI,IAAI,CAAC,CAEZ;IAED,IAAI,GAAG,IAAI,CAAC,EAAE,CAEb;CACF"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageHistoryItemMock = void 0;
|
|
4
|
+
class MessageHistoryItemMock {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.list = [];
|
|
7
|
+
}
|
|
8
|
+
add(message) {
|
|
9
|
+
this.list.push(message);
|
|
10
|
+
return this;
|
|
11
|
+
}
|
|
12
|
+
clear() {
|
|
13
|
+
this.list = [];
|
|
14
|
+
}
|
|
15
|
+
get length() {
|
|
16
|
+
return this.list.length;
|
|
17
|
+
}
|
|
18
|
+
get last() {
|
|
19
|
+
return this.list[this.list.length - 1];
|
|
20
|
+
}
|
|
21
|
+
get all() {
|
|
22
|
+
return [...this.list];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.MessageHistoryItemMock = MessageHistoryItemMock;
|
|
26
|
+
//# sourceMappingURL=message-history-item-mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-history-item-mock.js","sourceRoot":"","sources":["../../src/mocks/message-history-item-mock.ts"],"names":[],"mappings":";;;AAEA,MAAa,sBAAsB;IAAnC;QACU,SAAI,GAAQ,EAAE,CAAC;IAsBzB,CAAC;IApBC,GAAG,CAAC,OAAU;QACZ,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,KAAK;QACH,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;IACjB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAC1B,CAAC;IAED,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,CAAC;IAED,IAAI,GAAG;QACL,OAAO,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;CACF;AAvBD,wDAuBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '../models/postboy-generic-message';
|
|
2
|
+
import { MessageHistoryItemMock } from './message-history-item-mock';
|
|
3
|
+
export declare class MessageHistoryMock {
|
|
4
|
+
private _items;
|
|
5
|
+
get<T extends PostboyGenericMessage>(id: string): MessageHistoryItemMock<T>;
|
|
6
|
+
add(message: PostboyGenericMessage): void;
|
|
7
|
+
reset(): void;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=message-history-mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-history-mock.d.ts","sourceRoot":"","sources":["../../src/mocks/message-history-mock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE,qBAAa,kBAAkB;IAC7B,OAAO,CAAC,MAAM,CAAkD;IAEhE,GAAG,CAAC,CAAC,SAAS,qBAAqB,EAAE,EAAE,EAAE,MAAM,GAAG,sBAAsB,CAAC,CAAC,CAAC;IAI3E,GAAG,CAAC,OAAO,EAAE,qBAAqB,GAAG,IAAI;IAKzC,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageHistoryMock = void 0;
|
|
4
|
+
const message_history_item_mock_1 = require("./message-history-item-mock");
|
|
5
|
+
class MessageHistoryMock {
|
|
6
|
+
constructor() {
|
|
7
|
+
this._items = new Map();
|
|
8
|
+
}
|
|
9
|
+
get(id) {
|
|
10
|
+
var _a;
|
|
11
|
+
return (_a = this._items.get(id)) !== null && _a !== void 0 ? _a : new message_history_item_mock_1.MessageHistoryItemMock();
|
|
12
|
+
}
|
|
13
|
+
add(message) {
|
|
14
|
+
var _a;
|
|
15
|
+
if (!((_a = this._items.get(message.id)) === null || _a === void 0 ? void 0 : _a.add(message)))
|
|
16
|
+
this._items.set(message.id, new message_history_item_mock_1.MessageHistoryItemMock().add(message));
|
|
17
|
+
}
|
|
18
|
+
reset() {
|
|
19
|
+
this._items.forEach((i) => i.clear());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.MessageHistoryMock = MessageHistoryMock;
|
|
23
|
+
//# sourceMappingURL=message-history-mock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-history-mock.js","sourceRoot":"","sources":["../../src/mocks/message-history-mock.ts"],"names":[],"mappings":";;;AACA,2EAAqE;AAErE,MAAa,kBAAkB;IAA/B;QACU,WAAM,GAAG,IAAI,GAAG,EAAuC,CAAC;IAclE,CAAC;IAZC,GAAG,CAAkC,EAAU;;QAC7C,OAAO,MAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,mCAAI,IAAI,kDAAsB,EAAE,CAAC;IAC7D,CAAC;IAED,GAAG,CAAC,OAA8B;;QAChC,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,0CAAE,GAAG,CAAC,OAAO,CAAC,CAAA;YAC5C,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,kDAAsB,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,KAAK;QACH,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC;IACxC,CAAC;CACF;AAfD,gDAeC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
import { PostboyCallbackMessage } from '../models/postboy-callback.message';
|
|
6
|
+
import { MessageHistoryItemMock } from './message-history-item-mock';
|
|
7
|
+
import { MessageType } from '../postboy-abstract.registrator';
|
|
8
|
+
export declare class PostboyServiceMock extends PostboyService {
|
|
9
|
+
private subscriptions;
|
|
10
|
+
private _history;
|
|
11
|
+
reset(): void;
|
|
12
|
+
fired(id: string, times?: number): boolean;
|
|
13
|
+
subscribed(id: string, times?: number): boolean;
|
|
14
|
+
private count;
|
|
15
|
+
exec<E extends PostboyExecutor<T>, T>(executor: E): T;
|
|
16
|
+
subscribe<T>(id: string): Observable<T>;
|
|
17
|
+
sub<T extends PostboyGenericMessage>(type: MessageType<T>): Observable<T>;
|
|
18
|
+
fire<T extends PostboyGenericMessage>(message: T): void;
|
|
19
|
+
fireCallback<T>(message: PostboyCallbackMessage<T>, action?: (e: T) => void): Observable<T>;
|
|
20
|
+
history<T extends PostboyGenericMessage>(type: MessageType<T>): MessageHistoryItemMock<T>;
|
|
21
|
+
}
|
|
22
|
+
//# 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,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAC7D,OAAO,EAAW,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAE5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,qBAAa,kBAAmB,SAAQ,cAAc;IACpD,OAAO,CAAC,aAAa,CAAgB;IACrC,OAAO,CAAC,QAAQ,CAA4B;IAE5C,KAAK,IAAI,IAAI;IAKb,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO;IAI7C,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,GAAE,MAAU,GAAG,OAAO;IAKlD,OAAO,CAAC,KAAK,CAAmF;IAEhG,IAAI,CAAC,CAAC,SAAS,eAAe,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC;IAKrD,SAAS,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAKhC,GAAG,CAAC,CAAC,SAAS,qBAAqB,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,UAAU,CAAC,CAAC,CAAC;IAKhF,IAAI,CAAC,CAAC,SAAS,qBAAqB,EAAE,OAAO,EAAE,CAAC;IAKhD,YAAY,CAAC,CAAC,EAAE,OAAO,EAAE,sBAAsB,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,UAAU,CAAC,CAAC,CAAC;IAK3F,OAAO,CAAC,CAAC,SAAS,qBAAqB,EAAE,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,sBAAsB,CAAC,CAAC,CAAC;CAG1F"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PostboyServiceMock = void 0;
|
|
4
|
+
const postboy_service_1 = require("../postboy.service");
|
|
5
|
+
const postboy_generic_message_1 = require("../models/postboy-generic-message");
|
|
6
|
+
const message_history_mock_1 = require("./message-history-mock");
|
|
7
|
+
class PostboyServiceMock extends postboy_service_1.PostboyService {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.subscriptions = [];
|
|
11
|
+
this._history = new message_history_mock_1.MessageHistoryMock();
|
|
12
|
+
this.count = (collection, el) => collection.filter((e) => e === el).length;
|
|
13
|
+
}
|
|
14
|
+
reset() {
|
|
15
|
+
this.subscriptions = [];
|
|
16
|
+
this._history.reset();
|
|
17
|
+
}
|
|
18
|
+
fired(id, times = 0) {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = this._history.get(id)) === null || _a === void 0 ? void 0 : _a.length) === times;
|
|
21
|
+
}
|
|
22
|
+
subscribed(id, times = 0) {
|
|
23
|
+
const count = this.count(this.subscriptions, id);
|
|
24
|
+
return !!count && (!times || count === times);
|
|
25
|
+
}
|
|
26
|
+
exec(executor) {
|
|
27
|
+
this._history.add(executor);
|
|
28
|
+
return super.exec(executor);
|
|
29
|
+
}
|
|
30
|
+
subscribe(id) {
|
|
31
|
+
this.subscriptions.push(id);
|
|
32
|
+
return super.subscribe(id);
|
|
33
|
+
}
|
|
34
|
+
sub(type) {
|
|
35
|
+
this.subscriptions.push((0, postboy_generic_message_1.checkId)(type));
|
|
36
|
+
return super.subscribe((0, postboy_generic_message_1.checkId)(type));
|
|
37
|
+
}
|
|
38
|
+
fire(message) {
|
|
39
|
+
this._history.add(message);
|
|
40
|
+
super.fire(message);
|
|
41
|
+
}
|
|
42
|
+
fireCallback(message, action) {
|
|
43
|
+
this._history.add(message);
|
|
44
|
+
return super.fireCallback(message, action);
|
|
45
|
+
}
|
|
46
|
+
history(type) {
|
|
47
|
+
return this._history.get((0, postboy_generic_message_1.checkId)(type));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.PostboyServiceMock = PostboyServiceMock;
|
|
51
|
+
//# 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;AAGpD,+EAAmF;AAEnF,iEAA4D;AAI5D,MAAa,kBAAmB,SAAQ,gCAAc;IAAtD;;QACU,kBAAa,GAAa,EAAE,CAAC;QAC7B,aAAQ,GAAG,IAAI,yCAAkB,EAAE,CAAC;QAgBpC,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;IA8BlG,CAAC;IA5CC,KAAK;QACH,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,EAAU,EAAE,QAAgB,CAAC;;QACjC,OAAO,CAAA,MAAA,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,0CAAE,MAAM,MAAK,KAAK,CAAC;IACjD,CAAC;IAED,UAAU,CAAC,EAAU,EAAE,QAAgB,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC;IAChD,CAAC;IAID,IAAI,CAAkC,QAAW;QAC/C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC9B,CAAC;IAED,SAAS,CAAI,EAAU;QACrB,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,OAAO,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC7B,CAAC;IAEM,GAAG,CAAkC,IAAoB;QAC9D,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAA,iCAAO,EAAC,IAAI,CAAC,CAAC,CAAC;QACvC,OAAO,KAAK,CAAC,SAAS,CAAC,IAAA,iCAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IACxC,CAAC;IAED,IAAI,CAAkC,OAAU;QAC9C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;IAED,YAAY,CAAI,OAAkC,EAAE,MAAuB;QACzE,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAC3B,OAAO,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,CAAkC,IAAoB;QAC3D,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAA,iCAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC1C,CAAC;CACF;AAhDD,gDAgDC"}
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
import { PostboyCallbackMessage } from './postboy-callback.message';
|
|
2
|
-
export declare class MessageQueue<D> {
|
|
3
|
-
private cache;
|
|
4
|
-
/**
|
|
5
|
-
* Gets the current data stored in the instance.
|
|
6
|
-
*
|
|
7
|
-
* @return {D | null} The current data or null if no data is set.
|
|
8
|
-
*/
|
|
9
|
-
get data(): D | null;
|
|
10
|
-
private queries;
|
|
11
|
-
private _requestInProgress;
|
|
12
|
-
private _data;
|
|
13
|
-
constructor(cache?: boolean);
|
|
14
|
-
/**
|
|
15
|
-
* Resets the state of the instance by clearing stored data.
|
|
16
|
-
* This method sets the internal data to null, effectively resetting the object.
|
|
17
|
-
*
|
|
18
|
-
* @return {void} Does not return a value.
|
|
19
|
-
*/
|
|
20
|
-
reset(): MessageQueue<D>;
|
|
21
|
-
/**
|
|
22
|
-
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
23
|
-
* if a request is in progress or data is missing, or completes the query immediately.
|
|
24
|
-
*
|
|
25
|
-
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
26
|
-
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
27
|
-
*/
|
|
28
|
-
tryFinish(query: PostboyCallbackMessage<D>): boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Adds a new query to the query queue.
|
|
31
|
-
*
|
|
32
|
-
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
33
|
-
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
34
|
-
*/
|
|
35
|
-
add(query: PostboyCallbackMessage<D>): MessageQueue<D>;
|
|
36
|
-
/**
|
|
37
|
-
* Marks the operation as finished by updating the internal state and handling each query.
|
|
38
|
-
*
|
|
39
|
-
* @param {D} data - The data to be set for the current operation.
|
|
40
|
-
* @return {void} This method does not return a value.
|
|
41
|
-
*/
|
|
42
|
-
finish(data: D): void;
|
|
43
|
-
}
|
|
1
|
+
import { PostboyCallbackMessage } from './postboy-callback.message';
|
|
2
|
+
export declare class MessageQueue<D> {
|
|
3
|
+
private cache;
|
|
4
|
+
/**
|
|
5
|
+
* Gets the current data stored in the instance.
|
|
6
|
+
*
|
|
7
|
+
* @return {D | null} The current data or null if no data is set.
|
|
8
|
+
*/
|
|
9
|
+
get data(): D | null;
|
|
10
|
+
private queries;
|
|
11
|
+
private _requestInProgress;
|
|
12
|
+
private _data;
|
|
13
|
+
constructor(cache?: boolean);
|
|
14
|
+
/**
|
|
15
|
+
* Resets the state of the instance by clearing stored data.
|
|
16
|
+
* This method sets the internal data to null, effectively resetting the object.
|
|
17
|
+
*
|
|
18
|
+
* @return {void} Does not return a value.
|
|
19
|
+
*/
|
|
20
|
+
reset(): MessageQueue<D>;
|
|
21
|
+
/**
|
|
22
|
+
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
23
|
+
* if a request is in progress or data is missing, or completes the query immediately.
|
|
24
|
+
*
|
|
25
|
+
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
26
|
+
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
27
|
+
*/
|
|
28
|
+
tryFinish(query: PostboyCallbackMessage<D>): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Adds a new query to the query queue.
|
|
31
|
+
*
|
|
32
|
+
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
33
|
+
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
34
|
+
*/
|
|
35
|
+
add(query: PostboyCallbackMessage<D>): MessageQueue<D>;
|
|
36
|
+
/**
|
|
37
|
+
* Marks the operation as finished by updating the internal state and handling each query.
|
|
38
|
+
*
|
|
39
|
+
* @param {D} data - The data to be set for the current operation.
|
|
40
|
+
* @return {void} This method does not return a value.
|
|
41
|
+
*/
|
|
42
|
+
finish(data: D): void;
|
|
43
|
+
}
|
|
44
44
|
//# sourceMappingURL=message-queue.model.d.ts.map
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageQueue = void 0;
|
|
4
|
-
const
|
|
5
|
-
class MessageQueue {
|
|
6
|
-
/**
|
|
7
|
-
* Gets the current data stored in the instance.
|
|
8
|
-
*
|
|
9
|
-
* @return {D | null} The current data or null if no data is set.
|
|
10
|
-
*/
|
|
11
|
-
get data() {
|
|
12
|
-
return this._data;
|
|
13
|
-
}
|
|
14
|
-
constructor(cache = true) {
|
|
15
|
-
this.cache = cache;
|
|
16
|
-
this.queries = new
|
|
17
|
-
this._requestInProgress = true;
|
|
18
|
-
this._data = null;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Resets the state of the instance by clearing stored data.
|
|
22
|
-
* This method sets the internal data to null, effectively resetting the object.
|
|
23
|
-
*
|
|
24
|
-
* @return {void} Does not return a value.
|
|
25
|
-
*/
|
|
26
|
-
reset() {
|
|
27
|
-
this._data = null;
|
|
28
|
-
return this;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
32
|
-
* if a request is in progress or data is missing, or completes the query immediately.
|
|
33
|
-
*
|
|
34
|
-
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
35
|
-
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
36
|
-
*/
|
|
37
|
-
tryFinish(query) {
|
|
38
|
-
if (this._requestInProgress || this._data === null)
|
|
39
|
-
return this.queries.put(query) && false;
|
|
40
|
-
query.finish(this._data);
|
|
41
|
-
return true;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Adds a new query to the query queue.
|
|
45
|
-
*
|
|
46
|
-
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
47
|
-
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
48
|
-
*/
|
|
49
|
-
add(query) {
|
|
50
|
-
return this.queries.put(query) && this;
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* Marks the operation as finished by updating the internal state and handling each query.
|
|
54
|
-
*
|
|
55
|
-
* @param {D} data - The data to be set for the current operation.
|
|
56
|
-
* @return {void} This method does not return a value.
|
|
57
|
-
*/
|
|
58
|
-
finish(data) {
|
|
59
|
-
if (this.cache)
|
|
60
|
-
this._data = data;
|
|
61
|
-
this._requestInProgress = false;
|
|
62
|
-
this.queries.each((q) => q.finish(data));
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.MessageQueue = MessageQueue;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageQueue = void 0;
|
|
4
|
+
const collections_1 = require("@artstesh/collections");
|
|
5
|
+
class MessageQueue {
|
|
6
|
+
/**
|
|
7
|
+
* Gets the current data stored in the instance.
|
|
8
|
+
*
|
|
9
|
+
* @return {D | null} The current data or null if no data is set.
|
|
10
|
+
*/
|
|
11
|
+
get data() {
|
|
12
|
+
return this._data;
|
|
13
|
+
}
|
|
14
|
+
constructor(cache = true) {
|
|
15
|
+
this.cache = cache;
|
|
16
|
+
this.queries = new collections_1.Queue();
|
|
17
|
+
this._requestInProgress = true;
|
|
18
|
+
this._data = null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Resets the state of the instance by clearing stored data.
|
|
22
|
+
* This method sets the internal data to null, effectively resetting the object.
|
|
23
|
+
*
|
|
24
|
+
* @return {void} Does not return a value.
|
|
25
|
+
*/
|
|
26
|
+
reset() {
|
|
27
|
+
this._data = null;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Attempts to finalize the provided query. It either queues the query for later processing
|
|
32
|
+
* if a request is in progress or data is missing, or completes the query immediately.
|
|
33
|
+
*
|
|
34
|
+
* @param {PostboyCallbackMessage<D>} query - The callback message to be finalized.
|
|
35
|
+
* @return {boolean} - Returns true if the query was successfully finalized, otherwise false.
|
|
36
|
+
*/
|
|
37
|
+
tryFinish(query) {
|
|
38
|
+
if (this._requestInProgress || this._data === null)
|
|
39
|
+
return this.queries.put(query) && false;
|
|
40
|
+
query.finish(this._data);
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Adds a new query to the query queue.
|
|
45
|
+
*
|
|
46
|
+
* @param {PostboyCallbackMessage<D>} query - The query to be added to the queue.
|
|
47
|
+
* @return {MessageQueue<D>} The updated QueryQueue instance.
|
|
48
|
+
*/
|
|
49
|
+
add(query) {
|
|
50
|
+
return this.queries.put(query) && this;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Marks the operation as finished by updating the internal state and handling each query.
|
|
54
|
+
*
|
|
55
|
+
* @param {D} data - The data to be set for the current operation.
|
|
56
|
+
* @return {void} This method does not return a value.
|
|
57
|
+
*/
|
|
58
|
+
finish(data) {
|
|
59
|
+
if (this.cache)
|
|
60
|
+
this._data = data;
|
|
61
|
+
this._requestInProgress = false;
|
|
62
|
+
this.queries.each((q) => q.finish(data));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.MessageQueue = MessageQueue;
|
|
66
66
|
//# sourceMappingURL=message-queue.model.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-queue.model.js","sourceRoot":"","sources":["../../src/models/message-queue.model.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"message-queue.model.js","sourceRoot":"","sources":["../../src/models/message-queue.model.ts"],"names":[],"mappings":";;;AACA,uDAA8C;AAE9C,MAAa,YAAY;IACvB;;;;OAIG;IACH,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;IAMD,YAAoB,QAAiB,IAAI;QAArB,UAAK,GAAL,KAAK,CAAgB;QAJjC,YAAO,GAAqC,IAAI,mBAAK,EAA6B,CAAC;QACnF,uBAAkB,GAAY,IAAI,CAAC;QACnC,UAAK,GAAa,IAAI,CAAC;IAEa,CAAC;IAE7C;;;;;OAKG;IACI,KAAK;QACV,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACI,SAAS,CAAC,KAAgC;QAC/C,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;QAC5F,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACI,GAAG,CAAC,KAAgC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC;IACzC,CAAC;IAED;;;;;OAKG;IACI,MAAM,CAAC,IAAO;QACnB,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClC,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3C,CAAC;CACF;AA7DD,oCA6DC"}
|
|
@@ -1 +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;IAEpD,IAAI,
|
|
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;IAEpD,IAAI,GAAI,OAAO,CAAC,KAAG,IAAI,CAA6B;IAEpD,MAAM,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI;CAI9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-executor.d.ts","sourceRoot":"","sources":["../../src/models/postboy-executor.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-executor.js","sourceRoot":"","sources":["../../src/models/postboy-executor.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"postboy-executor.js","sourceRoot":"","sources":["../../src/models/postboy-executor.ts"],"names":[],"mappings":";;;AAAA,uDAAmD;AAEnD,MAAsB,eAAmB,SAAQ,gCAAc;CAAG;AAAlE,0CAAkE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-generic-message.d.ts","sourceRoot":"","sources":["../../src/models/postboy-generic-message.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PostboyGenericMessage = void 0;
|
|
4
|
+
exports.checkId = checkId;
|
|
4
5
|
const postboy_message_1 = require("./postboy.message");
|
|
5
6
|
/**
|
|
6
7
|
* An inheritor should have a static ID field
|
|
@@ -13,5 +14,4 @@ function checkId(message) {
|
|
|
13
14
|
throw new Error(`${message.name} should have a static ID field`);
|
|
14
15
|
return message.ID;
|
|
15
16
|
}
|
|
16
|
-
exports.checkId = checkId;
|
|
17
17
|
//# sourceMappingURL=postboy-generic-message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-generic-message.js","sourceRoot":"","sources":["../../src/models/postboy-generic-message.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"postboy-generic-message.js","sourceRoot":"","sources":["../../src/models/postboy-generic-message.ts"],"names":[],"mappings":";;;AAMA,0BAGC;AATD,uDAAmD;AAEnD;;GAEG;AACH,MAAsB,qBAAsB,SAAQ,gCAAc;CAAG;AAArE,sDAAqE;AACrE,SAAgB,OAAO,CAAC,OAAoC;IAC1D,IAAI,CAAE,OAAe,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,gCAAgC,CAAC,CAAC;IAC3F,OAAQ,OAAe,CAAC,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-middleware.d.ts","sourceRoot":"","sources":["../../src/models/postboy-middleware.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
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"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Observable, Subject } from 'rxjs';
|
|
2
2
|
export declare class PostboySubscription<T> {
|
|
3
|
-
|
|
4
|
-
pipe
|
|
5
|
-
constructor(
|
|
3
|
+
private subscription;
|
|
4
|
+
private pipe;
|
|
5
|
+
constructor(subscription: Subject<T>, pipe: (s: Subject<T>) => Observable<T>);
|
|
6
|
+
sub(): Observable<T>;
|
|
7
|
+
fire(data: T): void;
|
|
8
|
+
finish(): void;
|
|
6
9
|
}
|
|
7
10
|
//# sourceMappingURL=postboy-subscription.d.ts.map
|
|
@@ -1 +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,qBAAa,mBAAmB,CAAC,CAAC;
|
|
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,qBAAa,mBAAmB,CAAC,CAAC;IAE9B,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,IAAI;gBADJ,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC,CAAC;IAGzC,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC;IAIpB,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAInB,MAAM,IAAI,IAAI;CAGtB"}
|
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PostboySubscription = void 0;
|
|
4
4
|
class PostboySubscription {
|
|
5
|
-
constructor(
|
|
6
|
-
this.
|
|
5
|
+
constructor(subscription, pipe) {
|
|
6
|
+
this.subscription = subscription;
|
|
7
7
|
this.pipe = pipe;
|
|
8
8
|
}
|
|
9
|
+
sub() {
|
|
10
|
+
return this.pipe(this.subscription);
|
|
11
|
+
}
|
|
12
|
+
fire(data) {
|
|
13
|
+
this.subscription.next(data);
|
|
14
|
+
}
|
|
15
|
+
finish() {
|
|
16
|
+
this.subscription.complete();
|
|
17
|
+
}
|
|
9
18
|
}
|
|
10
19
|
exports.PostboySubscription = PostboySubscription;
|
|
11
20
|
//# sourceMappingURL=postboy-subscription.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postboy-subscription.js","sourceRoot":"","sources":["../../src/models/postboy-subscription.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAC9B,
|
|
1
|
+
{"version":3,"file":"postboy-subscription.js","sourceRoot":"","sources":["../../src/models/postboy-subscription.ts"],"names":[],"mappings":";;;AAEA,MAAa,mBAAmB;IAC9B,YACU,YAAwB,EACxB,IAAsC;QADtC,iBAAY,GAAZ,YAAY,CAAY;QACxB,SAAI,GAAJ,IAAI,CAAkC;IAC7C,CAAC;IAEG,GAAG;QACR,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;IAEM,IAAI,CAAC,IAAO;QACjB,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEM,MAAM;QACX,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;IAC/B,CAAC;CACF;AAjBD,kDAiBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postboy.locker.d.ts","sourceRoot":"","sources":["../../src/models/postboy.locker.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
|