@thisisagile/easy 8.36.0 → 8.37.0

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.
@@ -5,6 +5,6 @@ export declare class UseCase extends Enum {
5
5
  readonly app: App;
6
6
  readonly scopes: List<Scope>;
7
7
  constructor(app: App, name: string, id?: Text, scopes?: List<Scope>);
8
- with: (...s: Scope[]) => this;
8
+ with(...s: Scope[]): this;
9
9
  static byScopes<U extends UseCase>(...s: Scope[]): List<U>;
10
10
  }
@@ -7,10 +7,10 @@ class UseCase extends types_1.Enum {
7
7
  super(name, id.toString());
8
8
  this.app = app;
9
9
  this.scopes = scopes;
10
- this.with = (...s) => {
11
- this.scopes.add(...s);
12
- return this;
13
- };
10
+ }
11
+ with(...s) {
12
+ this.scopes.add(...s);
13
+ return this;
14
14
  }
15
15
  static byScopes(...s) {
16
16
  return this.filter(u => u.scopes.some(us => (0, types_1.isIn)(us, s)));
@@ -1 +1 @@
1
- {"version":3,"file":"UseCase.js","sourceRoot":"","sources":["../../src/process/UseCase.ts"],"names":[],"mappings":";;;AAAA,oCAAgE;AAIhE,MAAa,OAAQ,SAAQ,YAAI;IAC/B,YAAqB,GAAQ,EAAE,IAAY,EAAE,KAAW,IAAA,YAAI,EAAC,IAAI,CAAC,CAAC,KAAK,EAAW,SAAsB,IAAA,cAAM,GAAS;QACtH,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QADR,QAAG,GAAH,GAAG,CAAK;QAAsD,WAAM,GAAN,MAAM,CAA+B;QAIxH,SAAI,GAAG,CAAC,GAAG,CAAU,EAAQ,EAAE;YAC7B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;YACtB,OAAO,IAAI,CAAC;QACd,CAAC,CAAC;IALF,CAAC;IAOD,MAAM,CAAC,QAAQ,CAAoB,GAAG,CAAU;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,YAAI,EAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;CAOF;AAnBD,0BAmBC"}
1
+ {"version":3,"file":"UseCase.js","sourceRoot":"","sources":["../../src/process/UseCase.ts"],"names":[],"mappings":";;;AAAA,oCAAgE;AAIhE,MAAa,OAAQ,SAAQ,YAAI;IAC/B,YAAqB,GAAQ,EAAE,IAAY,EAAE,KAAW,IAAA,YAAI,EAAC,IAAI,CAAC,CAAC,KAAK,EAAW,SAAsB,IAAA,cAAM,GAAS;QACtH,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;QADR,QAAG,GAAH,GAAG,CAAK;QAAsD,WAAM,GAAN,MAAM,CAA+B;IAExH,CAAC;IAED,IAAI,CAAC,GAAG,CAAU;QAChB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;QACtB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,CAAC,QAAQ,CAAoB,GAAG,CAAU;QAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,IAAA,YAAI,EAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5D,CAAC;CAOF;AAnBD,0BAmBC"}
@@ -8,5 +8,7 @@ export declare const tuple: {
8
8
  3: <F_1, S_1, T>(first: Pro<F_1>, second: Pro<S_1>, third: Pro<T>) => Promise<[Awaited<F_1>, Awaited<S_1>, Awaited<T>]>;
9
9
  4: <F_2, S_2, T_1, Fo>(first: Pro<F_2>, second: Pro<S_2>, third: Pro<T_1>, forth: Pro<Fo>) => Promise<[Awaited<F_2>, Awaited<S_2>, Awaited<T_1>, Awaited<Fo>]>;
10
10
  5: <F_3, S_3, T_2, Fo_1, Fi>(first: Pro<F_3>, second: Pro<S_3>, third: Pro<T_2>, forth: Pro<Fo_1>, fifth: Pro<Fi>) => Promise<[Awaited<F_3>, Awaited<S_3>, Awaited<T_2>, Awaited<Fo_1>, Awaited<Fi>]>;
11
+ all: <F_4, S_4>(first: Pro<F_4>, second: Pro<S_4>[]) => Promise<[Awaited<F_4>, S_4[]]>;
12
+ spread: <F_5, S_5>(first: Pro<F_5>, ...second: Pro<S_5>[]) => Promise<[Awaited<F_5>, S_5[]]>;
11
13
  };
12
14
  export {};
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tuple = exports.reject = exports.resolve = void 0;
4
+ const types_1 = require("../types");
4
5
  const resolve = (subject) => Promise.resolve(subject);
5
6
  exports.resolve = resolve;
6
7
  const reject = (e) => Promise.reject(e);
@@ -10,5 +11,7 @@ exports.tuple = {
10
11
  3: (first, second, third) => Promise.all([first, second, third]),
11
12
  4: (first, second, third, forth) => Promise.all([first, second, third, forth]),
12
13
  5: (first, second, third, forth, fifth) => Promise.all([first, second, third, forth, fifth]),
14
+ all: (first, second) => Promise.all([first, Promise.all(second)]),
15
+ spread: (first, ...second) => Promise.all([first, Promise.all((0, types_1.toArray)(second))]),
13
16
  };
14
17
  //# sourceMappingURL=Promise.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Promise.js","sourceRoot":"","sources":["../../src/utils/Promise.ts"],"names":[],"mappings":";;;AAKO,MAAM,OAAO,GAAG,CAAc,OAA2B,EAAc,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAA7F,QAAA,OAAO,WAAsF;AACnG,MAAM,MAAM,GAAG,CAAY,CAAc,EAAc,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAAtE,QAAA,MAAM,UAAgE;AAEtE,QAAA,KAAK,GAAG;IACnB,CAAC,EAAE,CA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AE,KAAK,CAAC,CAAC;IACjI,CAAC,EAAE,CAAc,KAAa,EAAE,MAAc,EAAE,KAAa,EAAE,KAAc,EAA0C,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACpK,CAAC,EAAE,CAAkB,KAAa,EAAE,MAAc,EAAE,KAAa,EAAE,KAAc,EAAE,KAAc,EAAkD,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IACvM,GAAG,EAAE,CAAO,KAAa,EAAE,MAAgB,EAA6B,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IACpH,MAAM,EAAE,CAAO,KAAa,EAAE,GAAG,MAAgB,EAA6B,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,IAAA,eAAO,EAAC,MAAM,CAAC,CAAC,CAAC,CAAC;CACpI,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thisisagile/easy",
3
- "version": "8.36.0",
3
+ "version": "8.37.0",
4
4
  "description": "Straightforward library for building domain-driven microservice architectures",
5
5
  "author": "Sander Hoogendoorn",
6
6
  "license": "MIT",
@@ -31,10 +31,10 @@
31
31
  "access": "public"
32
32
  },
33
33
  "devDependencies": {
34
- "@thisisagile/easy-test": "8.36.0",
34
+ "@thisisagile/easy-test": "8.37.0",
35
35
  "@types/form-urlencoded": "^4.4.0",
36
36
  "@types/jsonwebtoken": "^8.5.8",
37
- "@types/validator": "^13.7.0"
37
+ "@types/validator": "^13.7.1"
38
38
  },
39
39
  "dependencies": {
40
40
  "@types/uuid": "^8.3.3",
@@ -7,10 +7,10 @@ export class UseCase extends Enum {
7
7
  super(name, id.toString());
8
8
  }
9
9
 
10
- with = (...s: Scope[]): this => {
10
+ with(...s: Scope[]): this {
11
11
  this.scopes.add(...s);
12
12
  return this;
13
- };
13
+ }
14
14
 
15
15
  static byScopes<U extends UseCase>(...s: Scope[]): List<U> {
16
16
  return this.filter(u => u.scopes.some(us => isIn(us, s)));
@@ -1,4 +1,4 @@
1
- import { ErrorOrigin } from '../types';
1
+ import { ErrorOrigin, toArray } from '../types';
2
2
 
3
3
  type Pro<A> = A | PromiseLike<A>;
4
4
  type Aw<A> = Awaited<A>;
@@ -11,5 +11,7 @@ export const tuple = {
11
11
  3: <F, S, T>(first: Pro<F>, second: Pro<S>, third: Pro<T>): Promise<[Aw<F>, Aw<S>, Aw<T>]> => Promise.all([first, second, third]),
12
12
  4: <F, S, T, Fo>(first: Pro<F>, second: Pro<S>, third: Pro<T>, forth: Pro<Fo>): Promise<[Aw<F>, Aw<S>, Aw<T>, Aw<Fo>]> => Promise.all([first, second, third, forth]),
13
13
  5: <F, S, T, Fo, Fi>(first: Pro<F>, second: Pro<S>, third: Pro<T>, forth: Pro<Fo>, fifth: Pro<Fi>): Promise<[Aw<F>, Aw<S>, Aw<T>, Aw<Fo>, Aw<Fi>]> => Promise.all([first, second, third, forth, fifth]),
14
+ all: <F, S>(first: Pro<F>, second: Pro<S>[]): Promise<[Aw<F>, Aw<S[]>]> => Promise.all([first, Promise.all(second)]),
15
+ spread: <F, S>(first: Pro<F>, ...second: Pro<S>[]): Promise<[Aw<F>, Aw<S[]>]> => Promise.all([first, Promise.all(toArray(second))]),
14
16
  };
15
17