@thisisagile/easy 10.10.3 → 10.10.4

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,5 +1,5 @@
1
1
  import { ErrorOrigin } from '../types';
2
- export declare class Retry<T = any> {
2
+ export declare class Rerun<T = any> {
3
3
  readonly subject: () => Promise<T>;
4
4
  readonly times: number;
5
5
  readonly interval: number;
@@ -7,4 +7,4 @@ export declare class Retry<T = any> {
7
7
  constructor(subject: () => Promise<T>, times?: number, interval?: number, prevError?: ErrorOrigin | undefined);
8
8
  run: () => Promise<T>;
9
9
  }
10
- export declare const retry: <T>(subject: () => Promise<T>, times?: number | undefined, interval?: number | undefined, prevError?: ErrorOrigin | undefined) => Promise<T>;
10
+ export declare const rerun: <T>(subject: () => Promise<T>, times?: number | undefined, interval?: number | undefined, prevError?: ErrorOrigin | undefined) => Promise<T>;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.retry = exports.Retry = void 0;
3
+ exports.rerun = exports.Rerun = void 0;
4
4
  const types_1 = require("../types");
5
- const validation_1 = require("../validation");
6
5
  const Wait_1 = require("./Wait");
7
- class Retry {
6
+ const validation_1 = require("../validation");
7
+ class Rerun {
8
8
  constructor(subject, times = 3, interval = 1000, prevError) {
9
9
  this.subject = subject;
10
10
  this.times = times;
@@ -14,11 +14,11 @@ class Retry {
14
14
  .not.isTrue.reject(this.prevError ?? types_1.Exception.CouldNotExecute)
15
15
  .then(() => this.subject().catch(async (e) => {
16
16
  await (0, Wait_1.wait)(this.interval);
17
- return new Retry(this.subject, this.times - 1, this.interval, e).run();
17
+ return new Rerun(this.subject, this.times - 1, this.interval, e).run();
18
18
  }));
19
19
  }
20
20
  }
21
- exports.Retry = Retry;
22
- const retry = (subject, times, interval, prevError) => new Retry(subject, times, interval, prevError).run();
23
- exports.retry = retry;
24
- //# sourceMappingURL=Retry.js.map
21
+ exports.Rerun = Rerun;
22
+ const rerun = (subject, times, interval, prevError) => new Rerun(subject, times, interval, prevError).run();
23
+ exports.rerun = rerun;
24
+ //# sourceMappingURL=Rerun.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Retry.js","sourceRoot":"","sources":["../../src/utils/Retry.ts"],"names":[],"mappings":";;;AAAA,oCAAkD;AAClD,8CAAqC;AACrC,iCAA8B;AAE9B,MAAa,KAAK;IAChB,YAAqB,OAAyB,EAAW,QAAQ,CAAC,EAAW,WAAW,IAAI,EAAW,SAAuB;QAAzG,YAAO,GAAP,OAAO,CAAkB;QAAW,UAAK,GAAL,KAAK,CAAI;QAAW,aAAQ,GAAR,QAAQ,CAAO;QAAW,cAAS,GAAT,SAAS,CAAc;QAE9H,QAAG,GAAG,GAAe,EAAE,CACrB,IAAA,iBAAI,EAAC,IAAI,CAAC,KAAK,CAAC;aACb,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,iBAAS,CAAC,eAAe,CAAC;aAC9D,IAAI,CAAC,GAAG,EAAE,CACT,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;YAC7B,MAAM,IAAA,WAAI,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO,IAAI,KAAK,CAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QAC5E,CAAC,CAAC,CACH,CAAC;IAV2H,CAAC;CAWnI;AAZD,sBAYC;AAEM,MAAM,KAAK,GAAG,CAAI,OAAyB,EAAE,KAAc,EAAE,QAAiB,EAAE,SAAuB,EAAc,EAAE,CAC5H,IAAI,KAAK,CAAI,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC;AAD7C,QAAA,KAAK,SACwC"}
1
+ {"version":3,"file":"Rerun.js","sourceRoot":"","sources":["../../src/utils/Rerun.ts"],"names":[],"mappings":";;;AAAA,oCAAkD;AAClD,iCAA8B;AAC9B,8CAAqC;AAErC,MAAa,KAAK;IAChB,YAAqB,OAAyB,EAAW,QAAQ,CAAC,EAAW,WAAW,IAAI,EAAW,SAAuB;QAAzG,YAAO,GAAP,OAAO,CAAkB;QAAW,UAAK,GAAL,KAAK,CAAI;QAAW,aAAQ,GAAR,QAAQ,CAAO;QAAW,cAAS,GAAT,SAAS,CAAc;QAE9H,QAAG,GAAG,GAAe,EAAE,CACrB,IAAA,iBAAI,EAAC,IAAI,CAAC,KAAK,CAAC;aACb,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,IAAI,iBAAS,CAAC,eAAe,CAAC;aAC9D,IAAI,CAAC,GAAG,EAAE,CACT,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,KAAK,EAAC,CAAC,EAAC,EAAE;YAC7B,MAAM,IAAA,WAAI,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC1B,OAAO,IAAI,KAAK,CAAI,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;QAC5E,CAAC,CAAC,CACH,CAAC;IAV2H,CAAC;CAWnI;AAZD,sBAYC;AAEM,MAAM,KAAK,GAAG,CAAI,OAAyB,EAAE,KAAc,EAAE,QAAiB,EAAE,SAAuB,EAAc,EAAE,CAC5H,IAAI,KAAK,CAAI,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC,GAAG,EAAE,CAAC;AAD7C,QAAA,KAAK,SACwC"}
@@ -4,7 +4,7 @@ export * from './Log';
4
4
  export * from './Mapper';
5
5
  export * from './Promise';
6
6
  export * from './Property';
7
- export * from './Retry';
7
+ export * from './Rerun';
8
8
  export * from './State';
9
9
  export * from './Sentence';
10
10
  export * from './Traverse';
@@ -20,7 +20,7 @@ __exportStar(require("./Log"), exports);
20
20
  __exportStar(require("./Mapper"), exports);
21
21
  __exportStar(require("./Promise"), exports);
22
22
  __exportStar(require("./Property"), exports);
23
- __exportStar(require("./Retry"), exports);
23
+ __exportStar(require("./Rerun"), exports);
24
24
  __exportStar(require("./State"), exports);
25
25
  __exportStar(require("./Sentence"), exports);
26
26
  __exportStar(require("./Traverse"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisisagile/easy",
3
- "version": "10.10.3",
3
+ "version": "10.10.4",
4
4
  "description": "Straightforward library for building domain-driven microservice architectures",
5
5
  "author": "Sander Hoogendoorn",
6
6
  "license": "MIT",
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "devDependencies": {
34
- "@thisisagile/easy-test": "10.10.3",
34
+ "@thisisagile/easy-test": "10.10.4",
35
35
  "@types/form-urlencoded": "^4.4.0",
36
36
  "@types/jsonwebtoken": "^8.5.8",
37
37
  "@types/validator": "^13.7.2"
@@ -1,8 +1,8 @@
1
1
  import { ErrorOrigin, Exception } from '../types';
2
- import { when } from '../validation';
3
2
  import { wait } from './Wait';
3
+ import { when } from '../validation';
4
4
 
5
- export class Retry<T = any> {
5
+ export class Rerun<T = any> {
6
6
  constructor(readonly subject: () => Promise<T>, readonly times = 3, readonly interval = 1000, readonly prevError?: ErrorOrigin) {}
7
7
 
8
8
  run = (): Promise<T> =>
@@ -11,10 +11,10 @@ export class Retry<T = any> {
11
11
  .then(() =>
12
12
  this.subject().catch(async e => {
13
13
  await wait(this.interval);
14
- return new Retry<T>(this.subject, this.times - 1, this.interval, e).run();
14
+ return new Rerun<T>(this.subject, this.times - 1, this.interval, e).run();
15
15
  })
16
16
  );
17
17
  }
18
18
 
19
- export const retry = <T>(subject: () => Promise<T>, times?: number, interval?: number, prevError?: ErrorOrigin): Promise<T> =>
20
- new Retry<T>(subject, times, interval, prevError).run();
19
+ export const rerun = <T>(subject: () => Promise<T>, times?: number, interval?: number, prevError?: ErrorOrigin): Promise<T> =>
20
+ new Rerun<T>(subject, times, interval, prevError).run();
@@ -4,7 +4,7 @@ export * from './Log';
4
4
  export * from './Mapper';
5
5
  export * from './Promise';
6
6
  export * from './Property';
7
- export * from './Retry';
7
+ export * from './Rerun';
8
8
  export * from './State';
9
9
  export * from './Sentence';
10
10
  export * from './Traverse';