@thisisagile/easy 8.31.1 → 8.36.1
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/dist/process/UseCase.d.ts +1 -1
- package/dist/process/UseCase.js +4 -4
- package/dist/process/UseCase.js.map +1 -1
- package/dist/utils/Promise.d.ts +6 -1
- package/dist/utils/Promise.js +6 -2
- package/dist/utils/Promise.js.map +1 -1
- package/package.json +2 -2
- package/src/process/UseCase.ts +2 -2
- package/src/utils/Promise.ts +7 -1
|
@@ -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
|
|
8
|
+
with(...s: Scope[]): this;
|
|
9
9
|
static byScopes<U extends UseCase>(...s: Scope[]): List<U>;
|
|
10
10
|
}
|
package/dist/process/UseCase.js
CHANGED
|
@@ -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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
|
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"}
|
package/dist/utils/Promise.d.ts
CHANGED
|
@@ -3,5 +3,10 @@ declare type Pro<A> = A | PromiseLike<A>;
|
|
|
3
3
|
declare type Aw<A> = Awaited<A>;
|
|
4
4
|
export declare const resolve: <S = unknown>(subject: S | PromiseLike<S>) => Promise<S>;
|
|
5
5
|
export declare const reject: <S = never>(e: ErrorOrigin) => Promise<S>;
|
|
6
|
-
export declare const tuple:
|
|
6
|
+
export declare const tuple: {
|
|
7
|
+
2: <F, S>(first: Pro<F>, second: Pro<S>) => Promise<[Awaited<F>, Awaited<S>]>;
|
|
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
|
+
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
|
+
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
|
+
};
|
|
7
12
|
export {};
|
package/dist/utils/Promise.js
CHANGED
|
@@ -5,6 +5,10 @@ const resolve = (subject) => Promise.resolve(subject);
|
|
|
5
5
|
exports.resolve = resolve;
|
|
6
6
|
const reject = (e) => Promise.reject(e);
|
|
7
7
|
exports.reject = reject;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
exports.tuple = {
|
|
9
|
+
2: (first, second) => Promise.all([first, second]),
|
|
10
|
+
3: (first, second, third) => Promise.all([first, second, third]),
|
|
11
|
+
4: (first, second, third, forth) => Promise.all([first, second, third, forth]),
|
|
12
|
+
5: (first, second, third, forth, fifth) => Promise.all([first, second, third, forth, fifth]),
|
|
13
|
+
};
|
|
10
14
|
//# 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;
|
|
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,CAAO,KAAa,EAAE,MAAc,EAA2B,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACjG,CAAC,EAAE,CAAU,KAAa,EAAE,MAAc,EAAE,KAAa,EAAkC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,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;CACxM,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.36.1",
|
|
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": "8.
|
|
34
|
+
"@thisisagile/easy-test": "8.36.1",
|
|
35
35
|
"@types/form-urlencoded": "^4.4.0",
|
|
36
36
|
"@types/jsonwebtoken": "^8.5.8",
|
|
37
37
|
"@types/validator": "^13.7.0"
|
package/src/process/UseCase.ts
CHANGED
|
@@ -7,10 +7,10 @@ export class UseCase extends Enum {
|
|
|
7
7
|
super(name, id.toString());
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
with
|
|
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)));
|
package/src/utils/Promise.ts
CHANGED
|
@@ -6,4 +6,10 @@ type Aw<A> = Awaited<A>;
|
|
|
6
6
|
export const resolve = <S = unknown>(subject: S | PromiseLike<S>): Promise<S> => Promise.resolve(subject);
|
|
7
7
|
export const reject = <S = never>(e: ErrorOrigin): Promise<S> => Promise.reject(e);
|
|
8
8
|
|
|
9
|
-
export const tuple =
|
|
9
|
+
export const tuple = {
|
|
10
|
+
2: <F, S>(first: Pro<F>, second: Pro<S>): Promise<[Aw<F>, Aw<S>]> => Promise.all([first, second]),
|
|
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
|
+
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
|
+
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
|
+
};
|
|
15
|
+
|