@artstesh/postboy 1.0.9 → 1.0.10

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/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './postboy.service';
2
+ export * from './mocks/postboy-service-mock';
2
3
  export * from './i-postboy-depending.service';
3
4
  export * from './postboy-abstract.registrator';
4
5
  export * from './models/postboy-generic-message';
@@ -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
@@ -18,6 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
20
  __exportStar(require("./postboy.service"), exports);
21
+ __exportStar(require("./mocks/postboy-service-mock"), exports);
21
22
  __exportStar(require("./i-postboy-depending.service"), exports);
22
23
  __exportStar(require("./postboy-abstract.registrator"), exports);
23
24
  __exportStar(require("./models/postboy-generic-message"), exports);
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"}
@@ -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,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,EAAU,EAAE,QAAgB,CAAC;QACjC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACzC,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,QAAQ,CAAC,EAAU,EAAE,QAAgB,CAAC;QACpC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC9C,OAAO,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,KAAK,IAAI,KAAK,KAAK,KAAK,CAAC,CAAC;IAChD,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,OAAO,CAAkC,QAAW;QAClD,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAClC,OAAO,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACjC,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;IAED,IAAI,CAAkC,OAAU;QAC9C,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACtB,CAAC;CACF;AA1CD,gDA0CC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artstesh/postboy",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "author": "artstesh",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",