@adaas/a-concept 0.1.24 → 0.1.25
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/index.cjs +3 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +3952 -0
- package/dist/index.d.ts +3952 -50
- package/dist/index.mjs +3 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +5 -6
- package/src/global/A-Abstraction/A-Abstraction-Extend.decorator.ts +2 -1
- package/src/global/A-Context/A-Context.class.ts +81 -7
- package/src/global/A-Context/A-Context.error.ts +4 -0
- package/src/global/A-Dependency/A-Dependency-Default.decorator.ts +75 -0
- package/src/global/A-Dependency/A-Dependency-Load.decorator.ts +80 -0
- package/src/global/A-Dependency/A-Dependency-Require.decorator.ts +68 -0
- package/src/global/A-Dependency/A-Dependency.class.ts +33 -0
- package/src/global/A-Dependency/A-Dependency.error.ts +13 -0
- package/src/global/A-Dependency/A-Dependency.types.ts +28 -0
- package/src/global/A-Feature/A-Feature-Define.decorator.ts +2 -1
- package/src/global/A-Feature/A-Feature-Extend.decorator.ts +2 -1
- package/src/global/A-Feature/A-Feature.class.ts +11 -0
- package/src/global/A-Inject/A-Inject.decorator.ts +4 -2
- package/src/global/A-Inject/A-Inject.types.ts +5 -3
- package/src/global/A-Scope/A-Scope.class.ts +85 -57
- package/src/global/A-Stage/A-Stage.class.ts +22 -2
- package/src/global/A-Stage/A-Stage.error.ts +2 -0
- package/src/helpers/A_Common.helper.ts +101 -0
- package/src/helpers/A_TypeGuards.helper.ts +8 -0
- package/src/index.ts +88 -0
- package/tests/A-Component.test.ts +1 -1
- package/tests/A-Concept.test.ts +5 -6
- package/tests/A-Dependency.test.ts +93 -0
- package/tests/A-Feature.test.ts +7 -7
- package/tests/A-Scope.test.ts +10 -10
- package/tsconfig.json +2 -2
- package/tsup.config.ts +32 -0
- package/dist/index.js +0 -112
- package/dist/index.js.map +0 -1
- package/dist/src/constants/env.constants.d.ts +0 -33
- package/dist/src/constants/env.constants.js +0 -47
- package/dist/src/constants/env.constants.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.d.ts +0 -23
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js +0 -96
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +0 -74
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js +0 -130
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.error.d.ts +0 -7
- package/dist/src/global/A-Abstraction/A-Abstraction.error.js +0 -12
- package/dist/src/global/A-Abstraction/A-Abstraction.error.js.map +0 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +0 -38
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js +0 -3
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +0 -1
- package/dist/src/global/A-Caller/A_Caller.class.d.ts +0 -33
- package/dist/src/global/A-Caller/A_Caller.class.js +0 -44
- package/dist/src/global/A-Caller/A_Caller.class.js.map +0 -1
- package/dist/src/global/A-Caller/A_Caller.error.d.ts +0 -7
- package/dist/src/global/A-Caller/A_Caller.error.js +0 -12
- package/dist/src/global/A-Caller/A_Caller.error.js.map +0 -1
- package/dist/src/global/A-Caller/A_Caller.types.d.ts +0 -18
- package/dist/src/global/A-Caller/A_Caller.types.js +0 -3
- package/dist/src/global/A-Caller/A_Caller.types.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.class.d.ts +0 -34
- package/dist/src/global/A-Component/A-Component.class.js +0 -56
- package/dist/src/global/A-Component/A-Component.class.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.constants.d.ts +0 -6
- package/dist/src/global/A-Component/A-Component.constants.js +0 -11
- package/dist/src/global/A-Component/A-Component.constants.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.meta.d.ts +0 -34
- package/dist/src/global/A-Component/A-Component.meta.js +0 -78
- package/dist/src/global/A-Component/A-Component.meta.js.map +0 -1
- package/dist/src/global/A-Component/A-Component.types.d.ts +0 -76
- package/dist/src/global/A-Component/A-Component.types.js +0 -4
- package/dist/src/global/A-Component/A-Component.types.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.class.d.ts +0 -153
- package/dist/src/global/A-Concept/A-Concept.class.js +0 -260
- package/dist/src/global/A-Concept/A-Concept.class.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.constants.d.ts +0 -33
- package/dist/src/global/A-Concept/A-Concept.constants.js +0 -39
- package/dist/src/global/A-Concept/A-Concept.constants.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.meta.d.ts +0 -6
- package/dist/src/global/A-Concept/A-Concept.meta.js +0 -12
- package/dist/src/global/A-Concept/A-Concept.meta.js.map +0 -1
- package/dist/src/global/A-Concept/A-Concept.types.d.ts +0 -66
- package/dist/src/global/A-Concept/A-Concept.types.js +0 -3
- package/dist/src/global/A-Concept/A-Concept.types.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.class.d.ts +0 -52
- package/dist/src/global/A-Container/A-Container.class.js +0 -78
- package/dist/src/global/A-Container/A-Container.class.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.constants.d.ts +0 -6
- package/dist/src/global/A-Container/A-Container.constants.js +0 -11
- package/dist/src/global/A-Container/A-Container.constants.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.meta.d.ts +0 -35
- package/dist/src/global/A-Container/A-Container.meta.js +0 -76
- package/dist/src/global/A-Container/A-Container.meta.js.map +0 -1
- package/dist/src/global/A-Container/A-Container.types.d.ts +0 -75
- package/dist/src/global/A-Container/A-Container.types.js +0 -4
- package/dist/src/global/A-Container/A-Container.types.js.map +0 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +0 -361
- package/dist/src/global/A-Context/A-Context.class.js +0 -603
- package/dist/src/global/A-Context/A-Context.class.js.map +0 -1
- package/dist/src/global/A-Context/A-Context.error.d.ts +0 -20
- package/dist/src/global/A-Context/A-Context.error.js +0 -25
- package/dist/src/global/A-Context/A-Context.error.js.map +0 -1
- package/dist/src/global/A-Context/A-Context.types.d.ts +0 -5
- package/dist/src/global/A-Context/A-Context.types.js +0 -3
- package/dist/src/global/A-Context/A-Context.types.js.map +0 -1
- package/dist/src/global/A-Dependency/A-DependencyReference.class.d.ts +0 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js +0 -49
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +0 -1
- package/dist/src/global/A-Dependency/A-DependencyReference.types.d.ts +0 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js +0 -58
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +0 -214
- package/dist/src/global/A-Entity/A-Entity.class.js +0 -282
- package/dist/src/global/A-Entity/A-Entity.class.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.constants.d.ts +0 -11
- package/dist/src/global/A-Entity/A-Entity.constants.js +0 -17
- package/dist/src/global/A-Entity/A-Entity.constants.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.error.d.ts +0 -7
- package/dist/src/global/A-Entity/A-Entity.error.js +0 -12
- package/dist/src/global/A-Entity/A-Entity.error.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.meta.d.ts +0 -11
- package/dist/src/global/A-Entity/A-Entity.meta.js +0 -18
- package/dist/src/global/A-Entity/A-Entity.meta.js.map +0 -1
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +0 -56
- package/dist/src/global/A-Entity/A-Entity.types.js +0 -5
- package/dist/src/global/A-Entity/A-Entity.types.js.map +0 -1
- package/dist/src/global/A-Error/A_Error.class.d.ts +0 -229
- package/dist/src/global/A-Error/A_Error.class.js +0 -296
- package/dist/src/global/A-Error/A_Error.class.js.map +0 -1
- package/dist/src/global/A-Error/A_Error.constants.d.ts +0 -5
- package/dist/src/global/A-Error/A_Error.constants.js +0 -9
- package/dist/src/global/A-Error/A_Error.constants.js.map +0 -1
- package/dist/src/global/A-Error/A_Error.types.d.ts +0 -93
- package/dist/src/global/A-Error/A_Error.types.js +0 -3
- package/dist/src/global/A-Error/A_Error.types.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.d.ts +0 -15
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.js +0 -76
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.d.ts +0 -56
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js +0 -128
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +0 -175
- package/dist/src/global/A-Feature/A-Feature.class.js +0 -318
- package/dist/src/global/A-Feature/A-Feature.class.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature.error.d.ts +0 -25
- package/dist/src/global/A-Feature/A-Feature.error.js +0 -33
- package/dist/src/global/A-Feature/A-Feature.error.js.map +0 -1
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +0 -334
- package/dist/src/global/A-Feature/A-Feature.types.js +0 -26
- package/dist/src/global/A-Feature/A-Feature.types.js.map +0 -1
- package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +0 -36
- package/dist/src/global/A-Fragment/A-Fragment.class.js +0 -46
- package/dist/src/global/A-Fragment/A-Fragment.class.js.map +0 -1
- package/dist/src/global/A-Fragment/A-Fragment.types.d.ts +0 -21
- package/dist/src/global/A-Fragment/A-Fragment.types.js +0 -6
- package/dist/src/global/A-Fragment/A-Fragment.types.js.map +0 -1
- package/dist/src/global/A-Inject/A-Inject.decorator.d.ts +0 -80
- package/dist/src/global/A-Inject/A-Inject.decorator.js +0 -49
- package/dist/src/global/A-Inject/A-Inject.decorator.js.map +0 -1
- package/dist/src/global/A-Inject/A-Inject.error.d.ts +0 -5
- package/dist/src/global/A-Inject/A-Inject.error.js +0 -10
- package/dist/src/global/A-Inject/A-Inject.error.js.map +0 -1
- package/dist/src/global/A-Inject/A-Inject.types.d.ts +0 -42
- package/dist/src/global/A-Inject/A-Inject.types.js +0 -3
- package/dist/src/global/A-Inject/A-Inject.types.js.map +0 -1
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +0 -97
- package/dist/src/global/A-Meta/A-Meta.class.js +0 -164
- package/dist/src/global/A-Meta/A-Meta.class.js.map +0 -1
- package/dist/src/global/A-Meta/A-Meta.types.d.ts +0 -14
- package/dist/src/global/A-Meta/A-Meta.types.js +0 -3
- package/dist/src/global/A-Meta/A-Meta.types.js.map +0 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +0 -466
- package/dist/src/global/A-Scope/A-Scope.class.js +0 -791
- package/dist/src/global/A-Scope/A-Scope.class.js.map +0 -1
- package/dist/src/global/A-Scope/A-Scope.error.d.ts +0 -8
- package/dist/src/global/A-Scope/A-Scope.error.js +0 -13
- package/dist/src/global/A-Scope/A-Scope.error.js.map +0 -1
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +0 -81
- package/dist/src/global/A-Scope/A-Scope.types.js +0 -3
- package/dist/src/global/A-Scope/A-Scope.types.js.map +0 -1
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +0 -112
- package/dist/src/global/A-Stage/A-Stage.class.js +0 -240
- package/dist/src/global/A-Stage/A-Stage.class.js.map +0 -1
- package/dist/src/global/A-Stage/A-Stage.error.d.ts +0 -4
- package/dist/src/global/A-Stage/A-Stage.error.js +0 -11
- package/dist/src/global/A-Stage/A-Stage.error.js.map +0 -1
- package/dist/src/global/A-Stage/A-Stage.types.d.ts +0 -101
- package/dist/src/global/A-Stage/A-Stage.types.js +0 -43
- package/dist/src/global/A-Stage/A-Stage.types.js.map +0 -1
- package/dist/src/global/A-StepManager/A-StepManager.class.d.ts +0 -20
- package/dist/src/global/A-StepManager/A-StepManager.class.js +0 -112
- package/dist/src/global/A-StepManager/A-StepManager.class.js.map +0 -1
- package/dist/src/global/A-StepManager/A-StepManager.error.d.ts +0 -4
- package/dist/src/global/A-StepManager/A-StepManager.error.js +0 -9
- package/dist/src/global/A-StepManager/A-StepManager.error.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.class.d.ts +0 -130
- package/dist/src/global/ASEID/ASEID.class.js +0 -167
- package/dist/src/global/ASEID/ASEID.class.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.constants.d.ts +0 -0
- package/dist/src/global/ASEID/ASEID.constants.js +0 -2
- package/dist/src/global/ASEID/ASEID.constants.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.error.d.ts +0 -5
- package/dist/src/global/ASEID/ASEID.error.js +0 -10
- package/dist/src/global/ASEID/ASEID.error.js.map +0 -1
- package/dist/src/global/ASEID/ASEID.types.d.ts +0 -65
- package/dist/src/global/ASEID/ASEID.types.js +0 -5
- package/dist/src/global/ASEID/ASEID.types.js.map +0 -1
- package/dist/src/helpers/A_Common.helper.d.ts +0 -28
- package/dist/src/helpers/A_Common.helper.js +0 -170
- package/dist/src/helpers/A_Common.helper.js.map +0 -1
- package/dist/src/helpers/A_Formatter.helper.d.ts +0 -35
- package/dist/src/helpers/A_Formatter.helper.js +0 -62
- package/dist/src/helpers/A_Formatter.helper.js.map +0 -1
- package/dist/src/helpers/A_Identity.helper.d.ts +0 -29
- package/dist/src/helpers/A_Identity.helper.js +0 -43
- package/dist/src/helpers/A_Identity.helper.js.map +0 -1
- package/dist/src/helpers/A_TypeGuards.helper.d.ts +0 -207
- package/dist/src/helpers/A_TypeGuards.helper.js +0 -296
- package/dist/src/helpers/A_TypeGuards.helper.js.map +0 -1
- package/dist/src/types/A_Common.types.d.ts +0 -36
- package/dist/src/types/A_Common.types.js +0 -3
- package/dist/src/types/A_Common.types.js.map +0 -1
- package/index.ts +0 -81
- package/src/global/A-Dependency/A-DependencyReference.class.ts +0 -61
- package/src/global/A-Dependency/A-DependencyReference.types.ts +0 -61
- package/trace-require.js +0 -46
- package/tsconfig.build.json +0 -58
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_TYPES__A_Stage_Status = void 0;
|
|
4
|
-
var A_TYPES__A_Stage_Status;
|
|
5
|
-
(function (A_TYPES__A_Stage_Status) {
|
|
6
|
-
/**
|
|
7
|
-
* The stage is currently being processed
|
|
8
|
-
*/
|
|
9
|
-
A_TYPES__A_Stage_Status["PROCESSING"] = "PROCESSING";
|
|
10
|
-
/**
|
|
11
|
-
* The stage has been completed
|
|
12
|
-
*/
|
|
13
|
-
A_TYPES__A_Stage_Status["COMPLETED"] = "COMPLETED";
|
|
14
|
-
/**
|
|
15
|
-
* The stage has failed
|
|
16
|
-
*/
|
|
17
|
-
A_TYPES__A_Stage_Status["FAILED"] = "FAILED";
|
|
18
|
-
/**
|
|
19
|
-
* The stage has been skipped
|
|
20
|
-
*/
|
|
21
|
-
A_TYPES__A_Stage_Status["SKIPPED"] = "SKIPPED";
|
|
22
|
-
/**
|
|
23
|
-
* The stage has been paused
|
|
24
|
-
*/
|
|
25
|
-
// PAUSED = 'PAUSED',
|
|
26
|
-
/**
|
|
27
|
-
* The stage has been stopped
|
|
28
|
-
*/
|
|
29
|
-
// STOPPED = 'STOPPED',
|
|
30
|
-
/**
|
|
31
|
-
* The stage has been started
|
|
32
|
-
*/
|
|
33
|
-
// STARTED = 'STARTED',
|
|
34
|
-
/**
|
|
35
|
-
* The stage has been initialized
|
|
36
|
-
*/
|
|
37
|
-
A_TYPES__A_Stage_Status["INITIALIZED"] = "INITIALIZED";
|
|
38
|
-
/**
|
|
39
|
-
* The stage has been aborted
|
|
40
|
-
*/
|
|
41
|
-
A_TYPES__A_Stage_Status["ABORTED"] = "ABORTED";
|
|
42
|
-
})(A_TYPES__A_Stage_Status || (exports.A_TYPES__A_Stage_Status = A_TYPES__A_Stage_Status = {}));
|
|
43
|
-
//# sourceMappingURL=A-Stage.types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-Stage.types.js","sourceRoot":"","sources":["../../../../src/global/A-Stage/A-Stage.types.ts"],"names":[],"mappings":";;;AAKA,IAAY,uBAqCX;AArCD,WAAY,uBAAuB;IAC/B;;OAEG;IACH,oDAAyB,CAAA;IACzB;;OAEG;IACH,kDAAuB,CAAA;IACvB;;OAEG;IACH,4CAAiB,CAAA;IACjB;;OAEG;IACH,8CAAmB,CAAA;IACnB;;OAEG;IACH,qBAAqB;IACrB;;OAEG;IACH,uBAAuB;IACvB;;OAEG;IACH,uBAAuB;IACvB;;OAEG;IACH,sDAA2B,CAAA;IAC3B;;OAEG;IACH,8CAAmB,CAAA;AACvB,CAAC,EArCW,uBAAuB,uCAAvB,uBAAuB,QAqClC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
2
|
-
import { A_TYPES__FeatureDefineDecoratorTemplateItem } from "../A-Feature/A-Feature.types";
|
|
3
|
-
import { A_Stage } from "../A-Stage/A-Stage.class";
|
|
4
|
-
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
|
|
5
|
-
export declare class A_StepsManager {
|
|
6
|
-
entities: A_TYPES__A_StageStep[];
|
|
7
|
-
graph: Map<string, Set<string>>;
|
|
8
|
-
visited: Set<string>;
|
|
9
|
-
tempMark: Set<string>;
|
|
10
|
-
sortedEntities: string[];
|
|
11
|
-
private _isBuilt;
|
|
12
|
-
constructor(entities: Array<A_TYPES__FeatureDefineDecoratorTemplateItem>);
|
|
13
|
-
private prepareSteps;
|
|
14
|
-
private ID;
|
|
15
|
-
private buildGraph;
|
|
16
|
-
private matchEntities;
|
|
17
|
-
private visit;
|
|
18
|
-
toSortedArray(): Array<string>;
|
|
19
|
-
toStages(feature: A_Feature): Array<A_Stage>;
|
|
20
|
-
}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_StepsManager = void 0;
|
|
4
|
-
const A_Stage_class_1 = require("../A-Stage/A-Stage.class");
|
|
5
|
-
const A_StepManager_error_1 = require("./A-StepManager.error");
|
|
6
|
-
class A_StepsManager {
|
|
7
|
-
constructor(entities) {
|
|
8
|
-
this._isBuilt = false;
|
|
9
|
-
this.entities = this.prepareSteps(entities);
|
|
10
|
-
this.graph = new Map();
|
|
11
|
-
this.visited = new Set();
|
|
12
|
-
this.tempMark = new Set();
|
|
13
|
-
this.sortedEntities = [];
|
|
14
|
-
}
|
|
15
|
-
prepareSteps(entities) {
|
|
16
|
-
return entities
|
|
17
|
-
.map(step => (Object.assign(Object.assign({}, step), { behavior: step.behavior || 'sync', before: step.before || '', after: step.after || '', override: step.override || '', throwOnError: false })));
|
|
18
|
-
}
|
|
19
|
-
ID(step) {
|
|
20
|
-
return `${typeof step.component === 'string' ? step.component : step.component.name}.${step.handler}`;
|
|
21
|
-
}
|
|
22
|
-
buildGraph() {
|
|
23
|
-
if (this._isBuilt)
|
|
24
|
-
return;
|
|
25
|
-
this._isBuilt = true;
|
|
26
|
-
// Filter override
|
|
27
|
-
this.entities = this.entities
|
|
28
|
-
.filter((step, i, self) => !self.some(s => s.override ? new RegExp(s.override).test(this.ID(step)) : false));
|
|
29
|
-
// Initialize graph nodes
|
|
30
|
-
this.entities.forEach(entity => this.graph.set(this.ID(entity), new Set()));
|
|
31
|
-
// Add directed edges based on 'before' and 'after'
|
|
32
|
-
this.entities.forEach(entity => {
|
|
33
|
-
const entityId = this.ID(entity);
|
|
34
|
-
// Add edges for 'before' dependencies
|
|
35
|
-
// If entity should execute before targets, then targets depend on entity
|
|
36
|
-
// So we add edges: target -> entity (target depends on entity)
|
|
37
|
-
if (entity.before) {
|
|
38
|
-
const targets = this.matchEntities(entityId, entity.before);
|
|
39
|
-
targets.forEach(target => {
|
|
40
|
-
if (!this.graph.has(target))
|
|
41
|
-
this.graph.set(target, new Set());
|
|
42
|
-
this.graph.get(target).add(entityId); // target depends on entity
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
// Add edges for 'after' dependencies
|
|
46
|
-
// If entity should execute after sources, then entity depends on sources
|
|
47
|
-
// So we add edges: entity -> source (entity depends on source)
|
|
48
|
-
if (entity.after) {
|
|
49
|
-
const sources = this.matchEntities(entityId, entity.after);
|
|
50
|
-
sources.forEach(source => {
|
|
51
|
-
if (!this.graph.has(entityId))
|
|
52
|
-
this.graph.set(entityId, new Set());
|
|
53
|
-
this.graph.get(entityId).add(source); // entity depends on source
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
// Match entities by name or regex
|
|
59
|
-
matchEntities(entityId, pattern) {
|
|
60
|
-
const regex = new RegExp(pattern);
|
|
61
|
-
return this.entities
|
|
62
|
-
.filter(entity => regex.test(this.ID(entity)) && this.ID(entity) !== entityId)
|
|
63
|
-
.map(entity => this.ID(entity));
|
|
64
|
-
}
|
|
65
|
-
// Topological sort with cycle detection
|
|
66
|
-
visit(node) {
|
|
67
|
-
if (this.tempMark.has(node)) {
|
|
68
|
-
return;
|
|
69
|
-
// TODO: maybe we have to keep this error but only for partial cases
|
|
70
|
-
throw new A_StepManager_error_1.A_StepManagerError(A_StepManager_error_1.A_StepManagerError.CircularDependencyError, `Circular dependency detected involving step: ${node}. Make sure that your 'before' and 'after' dependencies do not create cycles.`);
|
|
71
|
-
}
|
|
72
|
-
if (!this.visited.has(node)) {
|
|
73
|
-
this.tempMark.add(node);
|
|
74
|
-
(this.graph.get(node) || []).forEach(neighbor => this.visit(neighbor));
|
|
75
|
-
this.tempMark.delete(node);
|
|
76
|
-
this.visited.add(node);
|
|
77
|
-
this.sortedEntities.push(node);
|
|
78
|
-
// // Visit neighbors in stable order (preserving original order)
|
|
79
|
-
// const neighbors = Array.from(this.graph.get(node) || []);
|
|
80
|
-
// // neighbors.sort((a, b) => {
|
|
81
|
-
// // const orderA = this.originalOrder.get(a) || 0;
|
|
82
|
-
// // const orderB = this.originalOrder.get(b) || 0;
|
|
83
|
-
// // return orderA - orderB;
|
|
84
|
-
// // });
|
|
85
|
-
// neighbors.forEach(neighbor => this.visit(neighbor));
|
|
86
|
-
// this.tempMark.delete(node);
|
|
87
|
-
// this.visited.add(node);
|
|
88
|
-
// this.sortedEntities.push(node);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
toSortedArray() {
|
|
92
|
-
this.buildGraph();
|
|
93
|
-
// Start topological sort
|
|
94
|
-
this.entities.forEach(entity => {
|
|
95
|
-
if (!this.visited.has(this.ID(entity)))
|
|
96
|
-
this.visit(this.ID(entity));
|
|
97
|
-
});
|
|
98
|
-
return this.sortedEntities;
|
|
99
|
-
}
|
|
100
|
-
// Sort the entities based on dependencies
|
|
101
|
-
toStages(feature) {
|
|
102
|
-
const sortedNames = this.toSortedArray();
|
|
103
|
-
// Map sorted names back to entity objects
|
|
104
|
-
return sortedNames
|
|
105
|
-
.map(id => {
|
|
106
|
-
const step = this.entities.find(entity => this.ID(entity) === id);
|
|
107
|
-
return new A_Stage_class_1.A_Stage(feature, step);
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
exports.A_StepsManager = A_StepsManager;
|
|
112
|
-
//# sourceMappingURL=A-StepManager.class.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-StepManager.class.js","sourceRoot":"","sources":["../../../../src/global/A-StepManager/A-StepManager.class.ts"],"names":[],"mappings":";;;AAEA,4DAAmD;AAEnD,+DAA2D;AAE3D,MAAa,cAAc;IAWvB,YAAY,QAA4D;QAFhE,aAAQ,GAAY,KAAK,CAAC;QAG9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QAE5C,IAAI,CAAC,KAAK,GAAG,IAAI,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,E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,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAE/B,iEAAiE;YACjE,4DAA4D;YAC5D,gCAAgC;YAChC,wDAAwD;YACxD,wDAAwD;YACxD,iCAAiC;YACjC,SAAS;YAET,uDAAuD;YACvD,8BAA8B;YAC9B,0BAA0B;YAC1B,kCAAkC;QACtC,CAAC;IACL,CAAC;IAGD,aAAa;QACT,IAAI,CAAC,UAAU,EAAE,CAAC;QAElB,yBAAyB;QACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;YAC3B,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;gBAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC;QACxE,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,0CAA0C;IAC1C,QAAQ,CAAC,OAAkB;QAGvB,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC;QAGzC,0CAA0C;QAC1C,OAAO,WAAW;aACb,GAAG,CAAC,EAAE,CAAC,EAAE;YACN,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,CAAE,CAAC;YAGnE,OAAO,IAAI,uBAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;QACtC,CAAC,CAAC,CAAC;IACX,CAAC;CACJ;AA1JD,wCA0JC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.A_StepManagerError = void 0;
|
|
4
|
-
const A_Error_class_1 = require("../A-Error/A_Error.class");
|
|
5
|
-
class A_StepManagerError extends A_Error_class_1.A_Error {
|
|
6
|
-
}
|
|
7
|
-
exports.A_StepManagerError = A_StepManagerError;
|
|
8
|
-
A_StepManagerError.CircularDependencyError = 'A-StepManager Circular Dependency Error';
|
|
9
|
-
//# sourceMappingURL=A-StepManager.error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"A-StepManager.error.js","sourceRoot":"","sources":["../../../../src/global/A-StepManager/A-StepManager.error.ts"],"names":[],"mappings":";;;AAAA,4DAAmD;AAInD,MAAa,kBAAmB,SAAQ,uBAAO;;AAA/C,gDAKC;AAFmB,0CAAuB,GAAG,yCAAyC,CAAC"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { A_TYPES__ASEID_Constructor, A_TYPES__ASEID_JSON } from "./ASEID.types";
|
|
2
|
-
import { A_TYPES__Required } from "../../types/A_Common.types";
|
|
3
|
-
export declare class ASEID {
|
|
4
|
-
/**
|
|
5
|
-
* ASEID Regular Expression
|
|
6
|
-
*/
|
|
7
|
-
static readonly regexp: RegExp;
|
|
8
|
-
/**
|
|
9
|
-
* Tests if the identity string is an ASEID
|
|
10
|
-
*
|
|
11
|
-
* @param identity
|
|
12
|
-
* @returns
|
|
13
|
-
*/
|
|
14
|
-
static isASEID(identity: string): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Concept for the ASEID
|
|
17
|
-
* Generally it is the application name or code, should correspond to the concept where the entity is used
|
|
18
|
-
* Could be ID or ASEID
|
|
19
|
-
*/
|
|
20
|
-
private _concept;
|
|
21
|
-
/**
|
|
22
|
-
* Entity Scope the primary location of the resource
|
|
23
|
-
* Organization, or organization Unit
|
|
24
|
-
* Could be ID or ASEID
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
private _scope;
|
|
28
|
-
/**
|
|
29
|
-
* Entity Type the type of the resource
|
|
30
|
-
*/
|
|
31
|
-
private _entity;
|
|
32
|
-
/**
|
|
33
|
-
* Entity ID the unique identifier of the resource
|
|
34
|
-
*/
|
|
35
|
-
private _id;
|
|
36
|
-
/**
|
|
37
|
-
* Version of the entity (optional)
|
|
38
|
-
*/
|
|
39
|
-
private _version?;
|
|
40
|
-
/**
|
|
41
|
-
* Shard of the entity (optional)
|
|
42
|
-
*/
|
|
43
|
-
private _shard?;
|
|
44
|
-
/**
|
|
45
|
-
* ASEID is a structured identifier for entities in the A-Concept system.
|
|
46
|
-
* using the format:
|
|
47
|
-
* A - A-Concept
|
|
48
|
-
* S - System
|
|
49
|
-
* E - Entity
|
|
50
|
-
* I - Identifier
|
|
51
|
-
* D - iDentifier
|
|
52
|
-
*
|
|
53
|
-
* Structure: CONCEPT_NAME + @ + SCOPE + : ENTITY_NAME + : + ID + @ + VERSION
|
|
54
|
-
*
|
|
55
|
-
* Example:
|
|
56
|
-
* - root@core:usr:0000000001
|
|
57
|
-
*
|
|
58
|
-
* [!] Concept is optional, if not provided will be used the current concept name
|
|
59
|
-
* [!] Scope is optional, if not provided will be used the root scope of the current concept
|
|
60
|
-
* [!] Version is optional, if not provided will be considered as latest version
|
|
61
|
-
*
|
|
62
|
-
* @param aseid - ASEID string representation or ASEID components as object
|
|
63
|
-
*/
|
|
64
|
-
constructor(
|
|
65
|
-
/**
|
|
66
|
-
* ASEID string representation
|
|
67
|
-
*/
|
|
68
|
-
aseid: string);
|
|
69
|
-
constructor(
|
|
70
|
-
/**
|
|
71
|
-
* ASEID components as object
|
|
72
|
-
*/
|
|
73
|
-
props: A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>);
|
|
74
|
-
/**
|
|
75
|
-
* Getters for ASEID components
|
|
76
|
-
*/
|
|
77
|
-
get concept(): string;
|
|
78
|
-
/**
|
|
79
|
-
* Get the scope of the ASEID
|
|
80
|
-
*/
|
|
81
|
-
get scope(): string;
|
|
82
|
-
/**
|
|
83
|
-
* Get the entity of the ASEID
|
|
84
|
-
*/
|
|
85
|
-
get entity(): string;
|
|
86
|
-
/**
|
|
87
|
-
* Get the id of the ASEID
|
|
88
|
-
*/
|
|
89
|
-
get id(): string;
|
|
90
|
-
/**
|
|
91
|
-
* Get the version of the ASEID (if any)
|
|
92
|
-
*/
|
|
93
|
-
get version(): string | undefined;
|
|
94
|
-
/**
|
|
95
|
-
* Get the shard of the ASEID (if any)
|
|
96
|
-
*/
|
|
97
|
-
get shard(): string | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* get Internal Initializer based on the type of the parameter provided
|
|
100
|
-
*
|
|
101
|
-
* @param param1
|
|
102
|
-
* @returns
|
|
103
|
-
*/
|
|
104
|
-
private getInitializer;
|
|
105
|
-
/**
|
|
106
|
-
* Initialize ASEID from string
|
|
107
|
-
*
|
|
108
|
-
* @param param1
|
|
109
|
-
*/
|
|
110
|
-
private fromString;
|
|
111
|
-
/**
|
|
112
|
-
* Initialize ASEID from object
|
|
113
|
-
*
|
|
114
|
-
* @param param1
|
|
115
|
-
*/
|
|
116
|
-
private fromObject;
|
|
117
|
-
/**
|
|
118
|
-
* String representation of the ASEID
|
|
119
|
-
*
|
|
120
|
-
* @returns
|
|
121
|
-
*/
|
|
122
|
-
toString(): string;
|
|
123
|
-
/**
|
|
124
|
-
* JSON representation of the ASEID
|
|
125
|
-
*
|
|
126
|
-
* @returns
|
|
127
|
-
*/
|
|
128
|
-
toJSON(): A_TYPES__ASEID_JSON;
|
|
129
|
-
protected verifyInput(param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>): void;
|
|
130
|
-
}
|
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ASEID = void 0;
|
|
4
|
-
const A_Identity_helper_1 = require("../../helpers/A_Identity.helper");
|
|
5
|
-
const A_TypeGuards_helper_1 = require("../../helpers/A_TypeGuards.helper");
|
|
6
|
-
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
7
|
-
const ASEID_error_1 = require("./ASEID.error");
|
|
8
|
-
class ASEID {
|
|
9
|
-
/**
|
|
10
|
-
* Tests if the identity string is an ASEID
|
|
11
|
-
*
|
|
12
|
-
* @param identity
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
static isASEID(identity) {
|
|
16
|
-
return this.regexp.test(identity);
|
|
17
|
-
}
|
|
18
|
-
constructor(param1) {
|
|
19
|
-
this.verifyInput(param1);
|
|
20
|
-
const initializer = this.getInitializer(param1);
|
|
21
|
-
// the returned initializer is already bound to `this` (we used .bind(this)),
|
|
22
|
-
// so calling it will run the appropriate logic on this instance:
|
|
23
|
-
initializer.call(this, param1);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Getters for ASEID components
|
|
27
|
-
*/
|
|
28
|
-
get concept() {
|
|
29
|
-
return this._concept || A_Context_class_1.A_Context.concept;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Get the scope of the ASEID
|
|
33
|
-
*/
|
|
34
|
-
get scope() {
|
|
35
|
-
return this._scope || A_Context_class_1.A_Context.root.name;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get the entity of the ASEID
|
|
39
|
-
*/
|
|
40
|
-
get entity() {
|
|
41
|
-
return this._entity;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Get the id of the ASEID
|
|
45
|
-
*/
|
|
46
|
-
get id() {
|
|
47
|
-
return this._id;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Get the version of the ASEID (if any)
|
|
51
|
-
*/
|
|
52
|
-
get version() {
|
|
53
|
-
return this._version;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Get the shard of the ASEID (if any)
|
|
57
|
-
*/
|
|
58
|
-
get shard() {
|
|
59
|
-
return this._shard;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* get Internal Initializer based on the type of the parameter provided
|
|
63
|
-
*
|
|
64
|
-
* @param param1
|
|
65
|
-
* @returns
|
|
66
|
-
*/
|
|
67
|
-
getInitializer(param1) {
|
|
68
|
-
switch (true) {
|
|
69
|
-
case A_TypeGuards_helper_1.A_TypeGuards.isString(param1):
|
|
70
|
-
return this.fromString;
|
|
71
|
-
case A_TypeGuards_helper_1.A_TypeGuards.isObject(param1):
|
|
72
|
-
return this.fromObject;
|
|
73
|
-
default:
|
|
74
|
-
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDInitializationError, 'Invalid parameters provided to ASEID constructor');
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Initialize ASEID from string
|
|
79
|
-
*
|
|
80
|
-
* @param param1
|
|
81
|
-
*/
|
|
82
|
-
fromString(param1) {
|
|
83
|
-
const [concept, body, version] = param1.split('@');
|
|
84
|
-
const [scope, entity, idCandidate] = body.split(':');
|
|
85
|
-
const shard = idCandidate.includes('.') ? idCandidate.split('.')[0] : undefined;
|
|
86
|
-
const id = idCandidate.includes('.') ? idCandidate.split('.')[1] : idCandidate;
|
|
87
|
-
this._concept = concept || A_Context_class_1.A_Context.root.name;
|
|
88
|
-
this._scope = scope || A_Context_class_1.A_Context.root.name;
|
|
89
|
-
this._entity = entity;
|
|
90
|
-
this._id = id;
|
|
91
|
-
this._version = version;
|
|
92
|
-
this._shard = shard;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Initialize ASEID from object
|
|
96
|
-
*
|
|
97
|
-
* @param param1
|
|
98
|
-
*/
|
|
99
|
-
fromObject(param1) {
|
|
100
|
-
this._concept = param1.concept
|
|
101
|
-
? ASEID.isASEID(param1.concept)
|
|
102
|
-
? new ASEID(param1.concept).id
|
|
103
|
-
: param1.concept
|
|
104
|
-
: A_Context_class_1.A_Context.concept;
|
|
105
|
-
this._scope = param1.scope
|
|
106
|
-
? A_TypeGuards_helper_1.A_TypeGuards.isNumber(param1.scope)
|
|
107
|
-
? A_Identity_helper_1.A_IdentityHelper.formatWithLeadingZeros(param1.scope) :
|
|
108
|
-
ASEID.isASEID(param1.scope)
|
|
109
|
-
? new ASEID(param1.scope).id
|
|
110
|
-
: param1.scope
|
|
111
|
-
: A_Context_class_1.A_Context.root.name;
|
|
112
|
-
this._entity = param1.entity;
|
|
113
|
-
this._id = A_TypeGuards_helper_1.A_TypeGuards.isNumber(param1.id)
|
|
114
|
-
? A_Identity_helper_1.A_IdentityHelper.formatWithLeadingZeros(param1.id)
|
|
115
|
-
: param1.id;
|
|
116
|
-
this._version = param1.version;
|
|
117
|
-
this._shard = param1.shard;
|
|
118
|
-
}
|
|
119
|
-
/**
|
|
120
|
-
* String representation of the ASEID
|
|
121
|
-
*
|
|
122
|
-
* @returns
|
|
123
|
-
*/
|
|
124
|
-
toString() {
|
|
125
|
-
return `${this.concept}@${this.scope}:${this.entity}:${this.shard ? (this.shard + '.' + this.id) : this.id}${this.version ? ('@' + this.version) : ''}`;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* JSON representation of the ASEID
|
|
129
|
-
*
|
|
130
|
-
* @returns
|
|
131
|
-
*/
|
|
132
|
-
toJSON() {
|
|
133
|
-
return {
|
|
134
|
-
concept: this._concept,
|
|
135
|
-
scope: this._scope,
|
|
136
|
-
entity: this._entity,
|
|
137
|
-
id: this._id,
|
|
138
|
-
version: this._version,
|
|
139
|
-
shard: this._shard
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
// --------------------------------------------------------------------------
|
|
143
|
-
// ----------------------- PROTECTED HELPERS --------------------------------
|
|
144
|
-
// --------------------------------------------------------------------------
|
|
145
|
-
verifyInput(param1) {
|
|
146
|
-
switch (true) {
|
|
147
|
-
// 1) check for string and validate it as ASEID
|
|
148
|
-
case A_TypeGuards_helper_1.A_TypeGuards.isString(param1) && !ASEID.isASEID(param1):
|
|
149
|
-
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDValidationError, 'Invalid ASEID format provided');
|
|
150
|
-
// 2) check for object and validate required fields
|
|
151
|
-
case A_TypeGuards_helper_1.A_TypeGuards.isObject(param1) && !param1.id:
|
|
152
|
-
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDValidationError, 'ASEID id is required');
|
|
153
|
-
// 3) check for object and validate required fields
|
|
154
|
-
case A_TypeGuards_helper_1.A_TypeGuards.isObject(param1) && !param1.entity:
|
|
155
|
-
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDValidationError, 'ASEID entity is required');
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.ASEID = ASEID;
|
|
160
|
-
//==========================================================================
|
|
161
|
-
//============================= STATIC METHODS ===========================
|
|
162
|
-
//==========================================================================
|
|
163
|
-
/**
|
|
164
|
-
* ASEID Regular Expression
|
|
165
|
-
*/
|
|
166
|
-
ASEID.regexp = new RegExp(`^[a-z|A-Z|0-9|-]+@[a-z|A-Z|0-9|\-]+:[a-z|A-Z|0-9|\-]+:[a-z|A-Z|0-9|\\.|-]+(@v[0-9|\\.]+|@lts)?$`);
|
|
167
|
-
//# sourceMappingURL=ASEID.class.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ASEID.class.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.class.ts"],"names":[],"mappings":";;;AAIA,kFAA8E;AAC9E,sFAA4E;AAC5E,kEAAyD;AACzD,+CAA4C;AAK5C,MAAa,KAAK;IAUd;;;;;OAKG;IACH,MAAM,CAAC,OAAO,CAAC,QAAgB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC;IA0ED,YAAY,MAAyF;QACjG,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;QAEzB,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAChD,6EAA6E;QAC7E,iEAAiE;QACjE,WAAW,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC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,+CAA+C;YAC/C,KAAK,kCAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;gBACxD,MAAM,IAAI,yBAAW,CAAC,yBAAW,CAAC,oBAAoB,EAAE,+BAA+B,CAAC,CAAA;YAE5F,mDAAmD;YACnD,KAAK,kCAAY,CAAC,QAAQ,CAA6B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBACxE,MAAM,IAAI,yBAAW,CAAC,yBAAW,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAA;YAEnF,mDAAmD;YACnD,KAAK,kCAAY,CAAC,QAAQ,CAA6B,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;gBAC5E,MAAM,IAAI,yBAAW,CAAC,yBAAW,CAAC,oBAAoB,EAAE,0BAA0B,CAAC,CAAA;QAE3F,CAAC;IACL,CAAC;;AAnQL,sBAoQC;AAjQG,4EAA4E;AAC5E,0EAA0E;AAC1E,4EAA4E;AAC5E;;GAEG;AACa,YAAM,GAAW,IAAI,MAAM,CAAC,iGAAiG,CAAC,CAAA"}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ASEID.constants.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.constants.ts"],"names":[],"mappings":""}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ASEID_Error = void 0;
|
|
4
|
-
const A_Error_class_1 = require("../A-Error/A_Error.class");
|
|
5
|
-
class ASEID_Error extends A_Error_class_1.A_Error {
|
|
6
|
-
}
|
|
7
|
-
exports.ASEID_Error = ASEID_Error;
|
|
8
|
-
ASEID_Error.ASEIDInitializationError = 'ASEID Initialization Error';
|
|
9
|
-
ASEID_Error.ASEIDValidationError = 'ASEID Validation Error';
|
|
10
|
-
//# sourceMappingURL=ASEID.error.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ASEID.error.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.error.ts"],"names":[],"mappings":";;;AAAA,4DAAmD;AAInD,MAAa,WAAY,SAAQ,uBAAO;;AAAxC,kCAOC;AAJmB,oCAAwB,GAAG,4BAA4B,CAAC;AAExD,gCAAoB,GAAG,wBAAwB,CAAC"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export interface A_TYPES__ASEID_Constructor {
|
|
2
|
-
/**
|
|
3
|
-
* Concept for the ASEID
|
|
4
|
-
* Generally it is the application name or code, should correspond to the concept where the entity is used
|
|
5
|
-
* Could be ID or ASEID
|
|
6
|
-
*/
|
|
7
|
-
concept?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Entity Scope the primary location of the resource
|
|
10
|
-
* Organization, or organization Unit or Internal/External
|
|
11
|
-
* Could be ID or ASEID
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
scope: number | string;
|
|
15
|
-
/**
|
|
16
|
-
* Entity Type the type of the resource
|
|
17
|
-
*/
|
|
18
|
-
entity: string;
|
|
19
|
-
/**
|
|
20
|
-
* Entity ID the unique identifier of the resource
|
|
21
|
-
*/
|
|
22
|
-
id: number | string;
|
|
23
|
-
/**
|
|
24
|
-
* Version of the entity (optional)
|
|
25
|
-
*/
|
|
26
|
-
version?: string;
|
|
27
|
-
/**
|
|
28
|
-
* Shard of the entity (optional)
|
|
29
|
-
*/
|
|
30
|
-
shard?: string;
|
|
31
|
-
}
|
|
32
|
-
export interface A_TYPES__ASEID_ConstructorConfig {
|
|
33
|
-
/**
|
|
34
|
-
* If true, the entity ASEID will be distributed across multiple shards.
|
|
35
|
-
* In this case SHARD should be provided via Environment Variables (A_SHARD) or Configurations
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
38
|
-
sharding?: boolean;
|
|
39
|
-
}
|
|
40
|
-
export type A_TYPES__ASEID_JSON = {
|
|
41
|
-
/**
|
|
42
|
-
* Concept for the ASEID
|
|
43
|
-
*/
|
|
44
|
-
concept: string;
|
|
45
|
-
/**
|
|
46
|
-
* Entity Scope the primary location of the resource
|
|
47
|
-
*/
|
|
48
|
-
scope: string;
|
|
49
|
-
/**
|
|
50
|
-
* Entity Type the type of the resource
|
|
51
|
-
*/
|
|
52
|
-
entity: string;
|
|
53
|
-
/**
|
|
54
|
-
* Entity ID the unique identifier of the resource
|
|
55
|
-
*/
|
|
56
|
-
id: string;
|
|
57
|
-
/**
|
|
58
|
-
* Version of the entity (optional)
|
|
59
|
-
*/
|
|
60
|
-
version?: string;
|
|
61
|
-
/**
|
|
62
|
-
* Shard of the entity (optional)
|
|
63
|
-
*/
|
|
64
|
-
shard?: string;
|
|
65
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ASEID.types.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.types.ts"],"names":[],"mappings":";;AA8BC,CAAC;AAYD,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { A_TYPES__DeepPartial } from "../types/A_Common.types";
|
|
2
|
-
export declare class A_CommonHelper {
|
|
3
|
-
/**
|
|
4
|
-
* A simple promise that resolves immediately.
|
|
5
|
-
* Can be used in async functions to create a resolved promise.
|
|
6
|
-
*/
|
|
7
|
-
static resolve(): Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
* Check if a class is inherited from another class
|
|
10
|
-
*
|
|
11
|
-
* @param childClass
|
|
12
|
-
* @param parentClass
|
|
13
|
-
* @returns
|
|
14
|
-
*/
|
|
15
|
-
static isInheritedFrom(childClass: any, parentClass: any): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Omit properties from an object or array with nested objects
|
|
18
|
-
*
|
|
19
|
-
* @param input
|
|
20
|
-
* @param paths
|
|
21
|
-
* @returns
|
|
22
|
-
*/
|
|
23
|
-
static omitProperties<T, S extends string>(input: T, paths: string[]): Omit<T, S>;
|
|
24
|
-
static isObject(item: unknown): item is Record<string, any>;
|
|
25
|
-
static deepMerge<T = any>(target: any, source: any, visited?: Map<any, any>): T;
|
|
26
|
-
static deepClone<T>(target: T): T;
|
|
27
|
-
static deepCloneAndMerge<T>(target: A_TYPES__DeepPartial<T>, source: T): T;
|
|
28
|
-
}
|