@thisisagile/easy 15.15.2 → 15.15.3
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/Scope.d.ts +5 -2
- package/dist/process/Scope.js +9 -4
- package/dist/process/Scope.js.map +1 -1
- package/dist/process/Scope.mjs +10 -5
- package/dist/process/Scope.mjs.map +1 -1
- package/dist/types/Identity.js.map +1 -1
- package/package.json +2 -2
- package/src/process/Scope.ts +11 -5
- package/src/types/Identity.ts +1 -4
package/dist/process/Scope.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { Enum, IdName, Text } from '../types';
|
|
1
|
+
import { Enum, IdName, List, Text } from '../types';
|
|
2
2
|
export declare class Scope extends Enum {
|
|
3
3
|
readonly name: string;
|
|
4
|
-
|
|
4
|
+
readonly subs: List<Scope>;
|
|
5
|
+
protected constructor(name: string, id?: Text, subs?: List<Scope>);
|
|
5
6
|
for(item: string | IdName): Scope;
|
|
7
|
+
combines(...scopes: Scope[]): this;
|
|
8
|
+
expand(): List<Scope>;
|
|
6
9
|
}
|
package/dist/process/Scope.js
CHANGED
|
@@ -23,16 +23,21 @@ __export(Scope_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(Scope_exports);
|
|
24
24
|
var import_types = require("../types");
|
|
25
25
|
class Scope extends import_types.Enum {
|
|
26
|
-
|
|
27
|
-
// static readonly Auth = new Scope('Authorization', 'auth');
|
|
28
|
-
// static readonly Admin = new Scope('Administration', 'admin');
|
|
29
|
-
constructor(name, id = (0, import_types.text)(name).kebab) {
|
|
26
|
+
constructor(name, id = (0, import_types.text)(name).kebab, subs = (0, import_types.toList)()) {
|
|
30
27
|
super(name, id.toString());
|
|
31
28
|
this.name = name;
|
|
29
|
+
this.subs = subs;
|
|
32
30
|
}
|
|
33
31
|
for(item) {
|
|
34
32
|
return new Scope(`${this.name} ${(0, import_types.isString)(item) ? (0, import_types.text)(item).title : item.name}`, (0, import_types.kebab)(`${this.id} ${(0, import_types.isString)(item) ? item : item.id}`));
|
|
35
33
|
}
|
|
34
|
+
combines(...scopes) {
|
|
35
|
+
this.subs.add(scopes);
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
expand() {
|
|
39
|
+
return this.subs.flatMap((s) => s.expand()).add(this).distinct();
|
|
40
|
+
}
|
|
36
41
|
}
|
|
37
42
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
43
|
0 && (module.exports = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/process/Scope.ts"],"sourcesContent":["import { Enum, IdName, isString, kebab, Text, text } from '../types';\n\nexport class Scope extends Enum {\n
|
|
1
|
+
{"version":3,"sources":["../../src/process/Scope.ts"],"sourcesContent":["import { Enum, IdName, isString, kebab, List, Text, text, toList } from '../types';\n\nexport class Scope extends Enum {\n\n protected constructor(readonly name: string, id: Text = text(name).kebab, readonly subs: List<Scope> = toList()) {\n super(name, id.toString());\n }\n\n for(item: string | IdName): Scope {\n return new Scope(`${this.name} ${isString(item) ? text(item).title : item.name}`, kebab(`${this.id} ${isString(item) ? item : item.id}`));\n }\n\n combines(...scopes: Scope[]): this {\n this.subs.add(scopes);\n return this;\n }\n\n expand(): List<Scope> {\n return this.subs.flatMap(s => s.expand()).add(this).distinct();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAwE;AAEjE,MAAM,cAAc,kBAAK;AAAA,EAEpB,YAAqB,MAAc,SAAW,mBAAK,IAAI,EAAE,OAAgB,WAAoB,qBAAO,GAAG;AAC/G,UAAM,MAAM,GAAG,SAAS,CAAC;AADI;AAAoD;AAAA,EAEnF;AAAA,EAEA,IAAI,MAA8B;AAChC,WAAO,IAAI,MAAM,GAAG,KAAK,IAAI,QAAI,uBAAS,IAAI,QAAI,mBAAK,IAAI,EAAE,QAAQ,KAAK,IAAI,QAAI,oBAAM,GAAG,KAAK,EAAE,QAAI,uBAAS,IAAI,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;AAAA,EAC1I;AAAA,EAEA,YAAY,QAAuB;AACjC,SAAK,KAAK,IAAI,MAAM;AACpB,WAAO;AAAA,EACT;AAAA,EAEA,SAAsB;AACpB,WAAO,KAAK,KAAK,QAAQ,OAAK,EAAE,OAAO,CAAC,EAAE,IAAI,IAAI,EAAE,SAAS;AAAA,EAC/D;AACF;","names":[]}
|
package/dist/process/Scope.mjs
CHANGED
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import "../chunk-4N72FQFX.mjs";
|
|
2
|
-
import { Enum, isString, kebab, text } from "../types";
|
|
2
|
+
import { Enum, isString, kebab, text, toList } from "../types";
|
|
3
3
|
class Scope extends Enum {
|
|
4
|
-
|
|
5
|
-
// static readonly Auth = new Scope('Authorization', 'auth');
|
|
6
|
-
// static readonly Admin = new Scope('Administration', 'admin');
|
|
7
|
-
constructor(name, id = text(name).kebab) {
|
|
4
|
+
constructor(name, id = text(name).kebab, subs = toList()) {
|
|
8
5
|
super(name, id.toString());
|
|
9
6
|
this.name = name;
|
|
7
|
+
this.subs = subs;
|
|
10
8
|
}
|
|
11
9
|
for(item) {
|
|
12
10
|
return new Scope(`${this.name} ${isString(item) ? text(item).title : item.name}`, kebab(`${this.id} ${isString(item) ? item : item.id}`));
|
|
13
11
|
}
|
|
12
|
+
combines(...scopes) {
|
|
13
|
+
this.subs.add(scopes);
|
|
14
|
+
return this;
|
|
15
|
+
}
|
|
16
|
+
expand() {
|
|
17
|
+
return this.subs.flatMap((s) => s.expand()).add(this).distinct();
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
export {
|
|
16
21
|
Scope
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/process/Scope.ts"],"sourcesContent":["import { Enum, IdName, isString, kebab, Text, text } from '../types';\n\nexport class Scope extends Enum {\n
|
|
1
|
+
{"version":3,"sources":["../../src/process/Scope.ts"],"sourcesContent":["import { Enum, IdName, isString, kebab, List, Text, text, toList } from '../types';\n\nexport class Scope extends Enum {\n\n protected constructor(readonly name: string, id: Text = text(name).kebab, readonly subs: List<Scope> = toList()) {\n super(name, id.toString());\n }\n\n for(item: string | IdName): Scope {\n return new Scope(`${this.name} ${isString(item) ? text(item).title : item.name}`, kebab(`${this.id} ${isString(item) ? item : item.id}`));\n }\n\n combines(...scopes: Scope[]): this {\n this.subs.add(scopes);\n return this;\n }\n\n expand(): List<Scope> {\n return this.subs.flatMap(s => s.expand()).add(this).distinct();\n }\n}\n"],"mappings":";AAAA,SAAS,MAAc,UAAU,OAAmB,MAAM,cAAc;AAEjE,MAAM,cAAc,KAAK;AAAA,EAEpB,YAAqB,MAAc,KAAW,KAAK,IAAI,EAAE,OAAgB,OAAoB,OAAO,GAAG;AAC/G,UAAM,MAAM,GAAG,SAAS,CAAC;AADI;AAAoD;AAAA,EAEnF;AAAA,EAEA,IAAI,MAA8B;AAChC,WAAO,IAAI,MAAM,GAAG,KAAK,IAAI,IAAI,SAAS,IAAI,IAAI,KAAK,IAAI,EAAE,QAAQ,KAAK,IAAI,IAAI,MAAM,GAAG,KAAK,EAAE,IAAI,SAAS,IAAI,IAAI,OAAO,KAAK,EAAE,EAAE,CAAC;AAAA,EAC1I;AAAA,EAEA,YAAY,QAAuB;AACjC,SAAK,KAAK,IAAI,MAAM;AACpB,WAAO;AAAA,EACT;AAAA,EAEA,SAAsB;AACpB,WAAO,KAAK,KAAK,QAAQ,OAAK,EAAE,OAAO,CAAC,EAAE,IAAI,IAAI,EAAE,SAAS;AAAA,EAC/D;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/Identity.ts"],"sourcesContent":["import { Id } from './Id';\n\nexport type Identity = {
|
|
1
|
+
{"version":3,"sources":["../../src/types/Identity.ts"],"sourcesContent":["import { Id } from './Id';\n\nexport type Identity = { id: Id; user?: string };\n\nexport type IdName = { id: Id; name: string, slug?: string };\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thisisagile/easy",
|
|
3
|
-
"version": "15.15.
|
|
3
|
+
"version": "15.15.3",
|
|
4
4
|
"description": "Straightforward library for building domain-driven microservice architectures",
|
|
5
5
|
"author": "Sander Hoogendoorn",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"@thisisagile/easy-test": "15.15.
|
|
36
|
+
"@thisisagile/easy-test": "15.15.3",
|
|
37
37
|
"@types/form-urlencoded": "^4.4.0",
|
|
38
38
|
"@types/jsonwebtoken": "^9.0.2",
|
|
39
39
|
"@types/luxon": "3.2.0",
|
package/src/process/Scope.ts
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
|
-
import { Enum, IdName, isString, kebab, Text, text } from '../types';
|
|
1
|
+
import { Enum, IdName, isString, kebab, List, Text, text, toList } from '../types';
|
|
2
2
|
|
|
3
3
|
export class Scope extends Enum {
|
|
4
|
-
// static readonly Basic = new Scope('Basic');
|
|
5
|
-
// static readonly Auth = new Scope('Authorization', 'auth');
|
|
6
|
-
// static readonly Admin = new Scope('Administration', 'admin');
|
|
7
4
|
|
|
8
|
-
protected constructor(readonly name: string, id: Text = text(name).kebab) {
|
|
5
|
+
protected constructor(readonly name: string, id: Text = text(name).kebab, readonly subs: List<Scope> = toList()) {
|
|
9
6
|
super(name, id.toString());
|
|
10
7
|
}
|
|
11
8
|
|
|
12
9
|
for(item: string | IdName): Scope {
|
|
13
10
|
return new Scope(`${this.name} ${isString(item) ? text(item).title : item.name}`, kebab(`${this.id} ${isString(item) ? item : item.id}`));
|
|
14
11
|
}
|
|
12
|
+
|
|
13
|
+
combines(...scopes: Scope[]): this {
|
|
14
|
+
this.subs.add(scopes);
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
expand(): List<Scope> {
|
|
19
|
+
return this.subs.flatMap(s => s.expand()).add(this).distinct();
|
|
20
|
+
}
|
|
15
21
|
}
|