@adaas/a-concept 0.0.59 → 0.0.61
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.d.ts +5 -0
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +2 -1
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +9 -2
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
- package/dist/src/{base/A-Command/A_Command.entity.d.ts → global/A-Command/A-Command.class.d.ts} +72 -10
- package/dist/src/{base/A-Command/A_Command.entity.js → global/A-Command/A-Command.class.js} +119 -46
- package/dist/src/global/A-Command/A-Command.class.js.map +1 -0
- package/dist/src/{base/A-Command/A_Command.constants.js → global/A-Command/A-Command.constants.js} +1 -1
- package/dist/src/global/A-Command/A-Command.constants.js.map +1 -0
- package/dist/src/global/A-Command/A-Command.meta.d.ts +11 -0
- package/dist/src/global/A-Command/A-Command.meta.js +18 -0
- package/dist/src/global/A-Command/A-Command.meta.js.map +1 -0
- package/dist/src/global/A-Command/A-Command.types.d.ts +43 -0
- package/dist/src/global/A-Command/A-Command.types.js +10 -0
- package/dist/src/global/A-Command/A-Command.types.js.map +1 -0
- package/dist/src/{base → global}/A-Command/context/A_Command.context.d.ts +1 -1
- package/dist/src/{base → global}/A-Command/context/A_Command.context.js +1 -1
- package/dist/src/global/A-Command/context/A_Command.context.js.map +1 -0
- package/dist/src/global/A-Concept/A_Concept.class.js +2 -0
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.types.d.ts +10 -0
- package/dist/src/global/A-Concept/A_Concept.types.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +3 -1
- package/dist/src/global/A-Context/A-Context.class.js +16 -6
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.class.js +1 -4
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-FeatureCaller.class.d.ts +4 -3
- package/dist/src/global/A-Feature/A-FeatureCaller.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +23 -0
- package/dist/src/global/A-Scope/A-Scope.class.js +87 -1
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +7 -0
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +1 -1
- package/index.ts +9 -0
- package/package.json +2 -2
- package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +13 -6
- package/src/{base/A-Command/A_Command.entity.ts → global/A-Command/A-Command.class.ts} +149 -35
- package/src/global/A-Command/A-Command.meta.ts +22 -0
- package/src/global/A-Command/A-Command.types.ts +71 -0
- package/src/global/A-Concept/A_Concept.class.ts +3 -0
- package/src/global/A-Concept/A_Concept.types.ts +10 -0
- package/src/global/A-Context/A-Context.class.ts +23 -5
- package/src/global/A-Entity/A-Entity.class.ts +1 -4
- package/src/global/A-Feature/A-FeatureCaller.class.ts +4 -3
- package/src/global/A-Scope/A-Scope.class.ts +119 -5
- package/src/global/A-Scope/A-Scope.types.ts +7 -0
- package/tests/A-Command.test.ts +15 -11
- package/tests/A-Concept.test.ts +110 -0
- package/tests/A-Scope.test.ts +64 -1
- package/dist/src/base/A-Command/A_Command.constants.js.map +0 -1
- package/dist/src/base/A-Command/A_Command.entity.js.map +0 -1
- package/dist/src/base/A-Command/A_Command.types.d.ts +0 -15
- package/dist/src/base/A-Command/A_Command.types.js +0 -3
- package/dist/src/base/A-Command/A_Command.types.js.map +0 -1
- package/dist/src/base/A-Command/context/A_Command.context.js.map +0 -1
- package/dist/src/base/A-Command/context/A_CommandFactory.context.d.ts +0 -0
- package/dist/src/base/A-Command/context/A_CommandFactory.context.js +0 -2
- package/dist/src/base/A-Command/context/A_CommandFactory.context.js.map +0 -1
- package/src/base/A-Command/A_Command.types.ts +0 -34
- package/src/base/A-Command/context/A_CommandFactory.context.ts +0 -0
- /package/dist/src/{base/A-Command/A_Command.constants.d.ts → global/A-Command/A-Command.constants.d.ts} +0 -0
- /package/src/{base/A-Command/A_Command.constants.ts → global/A-Command/A-Command.constants.ts} +0 -0
- /package/src/{base → global}/A-Command/context/A_Command.context.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -35,11 +35,16 @@ export { A_Connect } from './src/decorators/A-Connect/A-Connect.decorator';
|
|
|
35
35
|
export * from './src/decorators/A-Connect/A-Connect.decorator.types';
|
|
36
36
|
export { A_ConfigLoader } from './src/base/A-Config/A-Config.container';
|
|
37
37
|
export { A_Config } from './src/base/A-Config/A-Config.context';
|
|
38
|
+
export * from './src/base/A-Config/A-Config.types';
|
|
38
39
|
export { ConfigReader } from './src/base/A-Config/components/ConfigReader.component';
|
|
39
40
|
export { ENVConfigReader } from './src/base/A-Config/components/ENVConfigReader.component';
|
|
40
41
|
export { FileConfigReader } from './src/base/A-Config/components/FileConfigReader.component';
|
|
41
42
|
export * from './src/base/A-Config/A-Config.types';
|
|
42
43
|
export * from './src/base/A-Logger/A-Logger.component';
|
|
44
|
+
export { A_Command } from './src/global/A-Command/A-Command.class';
|
|
45
|
+
export * from './src/global/A-Command/A-Command.types';
|
|
46
|
+
export * from './src/global/A-Command/A-Command.constants';
|
|
47
|
+
export { A_CommandContext } from './src/global/A-Command/context/A_Command.context';
|
|
43
48
|
export { A_ErrorsManager } from './src/base/A-Errors/A-Errors.component';
|
|
44
49
|
export { A_Errors } from './src/base/A-Errors/A-Errors.context';
|
|
45
50
|
export * from './src/base/A-Errors/A-Errors.types';
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
17
17
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.A_Errors = exports.A_ErrorsManager = exports.FileConfigReader = exports.ENVConfigReader = exports.ConfigReader = exports.A_Config = exports.A_ConfigLoader = exports.A_Connect = exports.A_Abstraction_Extend = exports.A_Feature_Extend = exports.A_Feature_Define = exports.A_Inject = exports.A_Fragment = exports.A_Meta = exports.A_Scope = exports.A_Stage = exports.A_FeatureCaller = exports.A_Feature = exports.A_Channel = exports.A_Entity = exports.A_ComponentMeta = exports.A_Component = exports.A_ContainerMeta = exports.A_Container = exports.A_ConceptMeta = exports.A_Concept = exports.A_Abstraction = exports.A_Context = void 0;
|
|
20
|
+
exports.A_Errors = exports.A_ErrorsManager = exports.A_CommandContext = exports.A_Command = exports.FileConfigReader = exports.ENVConfigReader = exports.ConfigReader = exports.A_Config = exports.A_ConfigLoader = exports.A_Connect = exports.A_Abstraction_Extend = exports.A_Feature_Extend = exports.A_Feature_Define = exports.A_Inject = exports.A_Fragment = exports.A_Meta = exports.A_Scope = exports.A_Stage = exports.A_FeatureCaller = exports.A_Feature = exports.A_Channel = exports.A_Entity = exports.A_ComponentMeta = exports.A_Component = exports.A_ContainerMeta = exports.A_Container = exports.A_ConceptMeta = exports.A_Concept = exports.A_Abstraction = exports.A_Context = void 0;
|
|
21
21
|
// ---------------------- Major Components ----------------------
|
|
22
22
|
var A_Context_class_1 = require("./src/global/A-Context/A-Context.class");
|
|
23
23
|
Object.defineProperty(exports, "A_Context", { enumerable: true, get: function () { return A_Context_class_1.A_Context; } });
|
|
@@ -88,6 +88,7 @@ var A_Config_container_1 = require("./src/base/A-Config/A-Config.container");
|
|
|
88
88
|
Object.defineProperty(exports, "A_ConfigLoader", { enumerable: true, get: function () { return A_Config_container_1.A_ConfigLoader; } });
|
|
89
89
|
var A_Config_context_1 = require("./src/base/A-Config/A-Config.context");
|
|
90
90
|
Object.defineProperty(exports, "A_Config", { enumerable: true, get: function () { return A_Config_context_1.A_Config; } });
|
|
91
|
+
__exportStar(require("./src/base/A-Config/A-Config.types"), exports);
|
|
91
92
|
var ConfigReader_component_1 = require("./src/base/A-Config/components/ConfigReader.component");
|
|
92
93
|
Object.defineProperty(exports, "ConfigReader", { enumerable: true, get: function () { return ConfigReader_component_1.ConfigReader; } });
|
|
93
94
|
var ENVConfigReader_component_1 = require("./src/base/A-Config/components/ENVConfigReader.component");
|
|
@@ -97,6 +98,12 @@ Object.defineProperty(exports, "FileConfigReader", { enumerable: true, get: func
|
|
|
97
98
|
__exportStar(require("./src/base/A-Config/A-Config.types"), exports);
|
|
98
99
|
__exportStar(require("./src/base/A-Logger/A-Logger.component"), exports);
|
|
99
100
|
// export * from './src/base/A-Logger/A-Logger.types';
|
|
101
|
+
var A_Command_class_1 = require("./src/global/A-Command/A-Command.class");
|
|
102
|
+
Object.defineProperty(exports, "A_Command", { enumerable: true, get: function () { return A_Command_class_1.A_Command; } });
|
|
103
|
+
__exportStar(require("./src/global/A-Command/A-Command.types"), exports);
|
|
104
|
+
__exportStar(require("./src/global/A-Command/A-Command.constants"), exports);
|
|
105
|
+
var A_Command_context_1 = require("./src/global/A-Command/context/A_Command.context");
|
|
106
|
+
Object.defineProperty(exports, "A_CommandContext", { enumerable: true, get: function () { return A_Command_context_1.A_CommandContext; } });
|
|
100
107
|
var A_Errors_component_1 = require("./src/base/A-Errors/A-Errors.component");
|
|
101
108
|
Object.defineProperty(exports, "A_ErrorsManager", { enumerable: true, get: function () { return A_Errors_component_1.A_ErrorsManager; } });
|
|
102
109
|
var A_Errors_context_1 = require("./src/base/A-Errors/A-Errors.context");
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";AAAA,oGAAoG;AACpG,oGAAoG;AACpG,oGAAoG;;;;;;;;;;;;;;;;;AAEpG,iEAAiE;AACjE,0EAAmE;AAA1D,4GAAA,SAAS,OAAA;AAClB,0DAA0D;AAE1D,sFAA+E;AAAtE,oHAAA,aAAa,OAAA;AACtB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mE;AAEnE,oGAAyF;AAAhF,8HAAA,gBAAgB,OAAA;AACzB,oGAAyF;AAAhF,8HAAA,gBAAgB,OAAA;AACzB,uFAAqE;AAErE,gHAAqG;AAA5F,sIAAA,oBAAoB,OAAA;AAC7B,+FAA6E;AAE7E,sFAA2E;AAAlE,gHAAA,SAAS,OAAA;AAClB,uFAAqE;AAGrE,oGAAoG;AACpG,oGAAoG;AACpG,oGAAoG;AACpG,6EAAwE;AAA/D,oHAAA,cAAc,OAAA;AACvB,yEAAgE;AAAvD,4GAAA,QAAQ,OAAA;AACjB,qEAAmD;AACnD,gGAAqF;AAA5E,sHAAA,YAAY,OAAA;AACrB,sGAA2F;AAAlF,4HAAA,eAAe,OAAA;AACxB,wGAA6F;AAApF,8HAAA,gBAAgB,OAAA;AACzB,qEAAmD;AAEnD,yEAAuD;AACvD,sDAAsD;AAItD,0EAAmE;AAA1D,4GAAA,SAAS,OAAA;AAClB,yEAAuD;AACvD,6EAA2D;AAC3D,sFAAoF;AAA3E,qHAAA,gBAAgB,OAAA;AAGzB,6EAAyE;AAAhE,qHAAA,eAAe,OAAA;AACxB,yEAAgE;AAAvD,4GAAA,QAAQ,OAAA;AACjB,qEAAmD"}
|
|
@@ -2,6 +2,7 @@ import { A_TYPES__A_FeatureDecoratorConfig, A_TYPES__A_FeatureDecoratorDescripto
|
|
|
2
2
|
import { A_Entity } from "../../global/A-Entity/A-Entity.class";
|
|
3
3
|
import { A_Component } from "../../global/A-Component/A-Component.class";
|
|
4
4
|
import { A_Container } from "../../global/A-Container/A-Container.class";
|
|
5
|
+
import { A_Command } from "../../global/A-Command/A-Command.class";
|
|
5
6
|
/**
|
|
6
7
|
* A-Feature decorator
|
|
7
8
|
*
|
|
@@ -15,4 +16,4 @@ import { A_Container } from "../../global/A-Container/A-Container.class";
|
|
|
15
16
|
* @param params
|
|
16
17
|
* @returns
|
|
17
18
|
*/
|
|
18
|
-
export declare function A_Feature_Define(config?: Partial<A_TYPES__A_FeatureDecoratorConfig>): (target: A_Container | A_Entity | A_Component, propertyKey: string, descriptor: A_TYPES__A_FeatureDecoratorDescriptor) => A_TYPES__A_FeatureDecoratorDescriptor;
|
|
19
|
+
export declare function A_Feature_Define(config?: Partial<A_TYPES__A_FeatureDecoratorConfig>): (target: A_Container | A_Entity | A_Component | A_Command, propertyKey: string, descriptor: A_TYPES__A_FeatureDecoratorDescriptor) => A_TYPES__A_FeatureDecoratorDescriptor;
|
|
@@ -9,6 +9,8 @@ const A_Container_types_1 = require("../../global/A-Container/A-Container.types"
|
|
|
9
9
|
const A_Entity_types_1 = require("../../global/A-Entity/A-Entity.types");
|
|
10
10
|
const A_Component_types_1 = require("../../global/A-Component/A-Component.types");
|
|
11
11
|
const A_Meta_class_1 = require("../../global/A-Meta/A-Meta.class");
|
|
12
|
+
const A_Command_class_1 = require("../../global/A-Command/A-Command.class");
|
|
13
|
+
const A_Command_types_1 = require("../../global/A-Command/A-Command.types");
|
|
12
14
|
/**
|
|
13
15
|
* A-Feature decorator
|
|
14
16
|
*
|
|
@@ -36,8 +38,13 @@ function A_Feature_Define(config = {}) {
|
|
|
36
38
|
case target instanceof A_Component_class_1.A_Component:
|
|
37
39
|
metaKey = A_Component_types_1.A_TYPES__ComponentMetaKey.FEATURES;
|
|
38
40
|
break;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
case target instanceof A_Command_class_1.A_Command:
|
|
42
|
+
metaKey = A_Command_types_1.A_TYPES__CommandMetaKey.FEATURES;
|
|
43
|
+
break;
|
|
44
|
+
default: {
|
|
45
|
+
console.log(target);
|
|
46
|
+
throw new Error(`A-Feature cannot be defined on the ${target.constructor.name} level`);
|
|
47
|
+
}
|
|
41
48
|
}
|
|
42
49
|
// Get the existed metadata or create a new one
|
|
43
50
|
const existedMeta = meta.get(metaKey) || new A_Meta_class_1.A_Meta();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Feature-Define.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Define.decorator.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"A-Feature-Define.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature-Define.decorator.ts"],"names":[],"mappings":";;AAiCA,4CAiGC;AA7HD,oFAA2E;AAC3E,uFAA8E;AAC9E,6FAAoF;AACpF,6FAAoF;AACpF,6FAAkG;AAIlG,oFAAyF;AACzF,6FAAkG;AAClG,8EAAqE;AACrE,uFAA8E;AAC9E,uFAA4F;AAG5F;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAC5B,SAAqD,EAAE;IAEvD,OAAO,UACH,MAAwD,EACxD,WAAmB,EACnB,UAAiD;QAGjD,MAAM,IAAI,GAAqE,2BAAS,CAAC,IAAI,CAAC,MAAM,CAAC,WAAkB,CAAC,CAAC;QAEzH,IAAI,OAAO,CAAC;QAGZ,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,MAAM,YAAY,yBAAQ;gBAC3B,OAAO,GAAG,uCAAsB,CAAC,QAAQ,CAAC;gBAC1C,MAAM;YACV,KAAK,MAAM,YAAY,+BAAW;gBAC9B,OAAO,GAAG,6CAAyB,CAAC,QAAQ,CAAA;gBAC5C,MAAM;YACV,KAAK,MAAM,YAAY,+BAAW;gBAC9B,OAAO,GAAG,6CAAyB,CAAC,QAAQ,CAAA;gBAC5C,MAAM;YACV,KAAK,MAAM,YAAY,2BAAS;gBAC5B,OAAO,GAAG,yCAAuB,CAAC,QAAQ,CAAA;gBAC1C,MAAM;YACV,OAAO,CAAC,CAAC,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;gBACpB,MAAM,IAAI,KAAK,CAAC,sCAAuC,MAAc,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,CAAC;YACpG,CAAC;QACL,CAAC;QAGD,+CAA+C;QAC/C,MAAM,WAAW,GAOZ,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,IAAI,qBAAM,EAAE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OAAQ,IAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE/C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC"}
|
package/dist/src/{base/A-Command/A_Command.entity.d.ts → global/A-Command/A-Command.class.d.ts}
RENAMED
|
@@ -1,10 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { A_TYPES__Command_Constructor, A_TYPES__Command_Listener, A_TYPES__Command_Serialized } from "./A-Command.types";
|
|
2
|
+
import { A_Error, ASEID } from "@adaas/a-utils";
|
|
3
|
+
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
4
|
+
import { A_CONSTANTS__A_Command_Event, A_CONSTANTS__A_Command_Status } from "./A-Command.constants";
|
|
5
|
+
export declare class A_Command<InvokeType extends A_TYPES__Command_Constructor = A_TYPES__Command_Constructor, ResultType extends Record<string, any> = Record<string, any>> {
|
|
6
|
+
/**
|
|
7
|
+
* Command Identifier that corresponds to the class name
|
|
8
|
+
*/
|
|
9
|
+
static get code(): string;
|
|
10
|
+
/**
|
|
11
|
+
* DEFAULT Namespace of the command from environment variable A_CONCEPT_NAMESPACE
|
|
12
|
+
* [!] If environment variable is not set, it will default to 'a-concept'
|
|
13
|
+
*/
|
|
14
|
+
static get namespace(): string;
|
|
15
|
+
/**
|
|
16
|
+
* DEFAULT Scope of the command from environment variable A_CONCEPT_DEFAULT_SCOPE
|
|
17
|
+
* [!] If environment variable is not set, it will default to 'core'
|
|
18
|
+
* [!] Scope is an application specific identifier that can be used to group commands together
|
|
19
|
+
* [!] e.g. 'default', 'core', 'public', 'internal', etc
|
|
20
|
+
*/
|
|
21
|
+
static get scope(): string;
|
|
22
|
+
/**
|
|
23
|
+
* ASEID is a command identifier that is unique across the system
|
|
24
|
+
* A - A_Concept or Application
|
|
25
|
+
* S - System or Scope
|
|
26
|
+
* E - Entity
|
|
27
|
+
* ID - Identifier
|
|
28
|
+
*
|
|
29
|
+
* [!] ASEID is immutable and should not be changed after the entity is created
|
|
30
|
+
*
|
|
31
|
+
* [!] ASEID is composed of the following parts:
|
|
32
|
+
* - namespace: an application specific identifier from where the command is coming from
|
|
33
|
+
* - scope: the scope of the command from Application Namespace
|
|
34
|
+
* - entity: the name of the command from Application Namespace
|
|
35
|
+
* - id: the unique identifier of the command
|
|
36
|
+
*
|
|
37
|
+
* [!] For more information about ASEID, please refer to the ASEID class documentation
|
|
38
|
+
*/
|
|
39
|
+
aseid: ASEID;
|
|
8
40
|
protected _result?: ResultType;
|
|
9
41
|
protected _errors?: Set<A_Error>;
|
|
10
42
|
protected _params: InvokeType;
|
|
@@ -68,18 +100,39 @@ export declare class A_Command<InvokeType extends A_TYPES__Command_Constructor =
|
|
|
68
100
|
* Command invocation parameters
|
|
69
101
|
*/
|
|
70
102
|
params: InvokeType | A_TYPES__Command_Serialized<ResultType>);
|
|
103
|
+
/**
|
|
104
|
+
* Extracts the ID from the ASEID
|
|
105
|
+
* ID is the unique identifier of the entity
|
|
106
|
+
*/
|
|
107
|
+
get id(): string | number;
|
|
108
|
+
/**
|
|
109
|
+
* Extracts the namespace from the ASEID
|
|
110
|
+
* namespace is an application specific identifier from where the entity is coming from
|
|
111
|
+
*/
|
|
112
|
+
get namespace(): string;
|
|
113
|
+
/**
|
|
114
|
+
* Extracts the scope from the ASEID
|
|
115
|
+
* scope is the scope of the entity from Application Namespace
|
|
116
|
+
*/
|
|
117
|
+
get scope(): string;
|
|
118
|
+
/**
|
|
119
|
+
* Extracts the entity from the ASEID
|
|
120
|
+
* entity is the name of the entity from Application Namespace
|
|
121
|
+
*
|
|
122
|
+
*/
|
|
123
|
+
get entity(): string;
|
|
71
124
|
/**
|
|
72
125
|
* Executes the command logic.
|
|
73
126
|
*/
|
|
74
|
-
|
|
127
|
+
execute(): Promise<any>;
|
|
75
128
|
/**
|
|
76
129
|
* Marks the command as completed
|
|
77
130
|
*/
|
|
78
|
-
|
|
131
|
+
complete(): Promise<void>;
|
|
79
132
|
/**
|
|
80
133
|
* Marks the command as failed
|
|
81
134
|
*/
|
|
82
|
-
|
|
135
|
+
fail(): Promise<void>;
|
|
83
136
|
/**
|
|
84
137
|
* Registers an event listener for a specific event
|
|
85
138
|
*
|
|
@@ -120,4 +173,13 @@ export declare class A_Command<InvokeType extends A_TYPES__Command_Constructor =
|
|
|
120
173
|
* @returns
|
|
121
174
|
*/
|
|
122
175
|
toJSON(): A_TYPES__Command_Serialized<ResultType>;
|
|
176
|
+
/**
|
|
177
|
+
* Call a feature of the component with the provided scope
|
|
178
|
+
*
|
|
179
|
+
* [!] If the provided scope is not inherited from the entity scope, it will be inherited
|
|
180
|
+
*
|
|
181
|
+
* @param lifecycleMethod
|
|
182
|
+
* @param args
|
|
183
|
+
*/
|
|
184
|
+
call(feature: string, scope?: A_Scope): Promise<any>;
|
|
123
185
|
}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -14,16 +8,39 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
14
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
9
|
});
|
|
16
10
|
};
|
|
17
|
-
var _a, _b, _c;
|
|
18
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
12
|
exports.A_Command = void 0;
|
|
20
|
-
const A_Entity_class_1 = require("../../global/A-Entity/A-Entity.class");
|
|
21
13
|
const a_utils_1 = require("@adaas/a-utils");
|
|
22
|
-
const A_Scope_class_1 = require("../../global/A-Scope/A-Scope.class");
|
|
23
|
-
const A_Feature_class_1 = require("../../global/A-Feature/A-Feature.class");
|
|
24
14
|
const A_Command_context_1 = require("./context/A_Command.context");
|
|
25
|
-
const A_Command_constants_1 = require("./
|
|
26
|
-
|
|
15
|
+
const A_Command_constants_1 = require("./A-Command.constants");
|
|
16
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
17
|
+
const env_constants_1 = require("../../constants/env.constants");
|
|
18
|
+
class A_Command {
|
|
19
|
+
// ====================================================================
|
|
20
|
+
// ================== Static A-Command Information ====================
|
|
21
|
+
// ====================================================================
|
|
22
|
+
/**
|
|
23
|
+
* Command Identifier that corresponds to the class name
|
|
24
|
+
*/
|
|
25
|
+
static get code() {
|
|
26
|
+
return a_utils_1.A_CommonHelper.toKebabCase(this.name);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* DEFAULT Namespace of the command from environment variable A_CONCEPT_NAMESPACE
|
|
30
|
+
* [!] If environment variable is not set, it will default to 'a-concept'
|
|
31
|
+
*/
|
|
32
|
+
static get namespace() {
|
|
33
|
+
return A_Context_class_1.A_Context.root.name;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* DEFAULT Scope of the command from environment variable A_CONCEPT_DEFAULT_SCOPE
|
|
37
|
+
* [!] If environment variable is not set, it will default to 'core'
|
|
38
|
+
* [!] Scope is an application specific identifier that can be used to group commands together
|
|
39
|
+
* [!] e.g. 'default', 'core', 'public', 'internal', etc
|
|
40
|
+
*/
|
|
41
|
+
static get scope() {
|
|
42
|
+
return process && process.env ? process.env[env_constants_1.A_CONSTANTS__DEFAULT_ENV_VARIABLES.A_CONCEPT_DEFAULT_SCOPE] || 'core' : 'core';
|
|
43
|
+
}
|
|
27
44
|
/**
|
|
28
45
|
* Execution Duration in milliseconds
|
|
29
46
|
*/
|
|
@@ -40,7 +57,7 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
40
57
|
* Command execution context is stored in A_CommandContext fragment within this scope
|
|
41
58
|
*/
|
|
42
59
|
get Scope() {
|
|
43
|
-
return this
|
|
60
|
+
return A_Context_class_1.A_Context.scope(this);
|
|
44
61
|
}
|
|
45
62
|
/**
|
|
46
63
|
* Unique code identifying the command type
|
|
@@ -48,7 +65,7 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
48
65
|
*
|
|
49
66
|
*/
|
|
50
67
|
get Code() {
|
|
51
|
-
return this.constructor.
|
|
68
|
+
return this.constructor.code;
|
|
52
69
|
}
|
|
53
70
|
/**
|
|
54
71
|
* Current status of the command
|
|
@@ -102,8 +119,42 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
102
119
|
* Command invocation parameters
|
|
103
120
|
*/
|
|
104
121
|
params) {
|
|
105
|
-
super(params);
|
|
106
122
|
this._listeners = new Map();
|
|
123
|
+
if (params && typeof params === 'object' && 'aseid' in params) {
|
|
124
|
+
this.fromJSON(params);
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
this.fromNew(params);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Extracts the ID from the ASEID
|
|
132
|
+
* ID is the unique identifier of the entity
|
|
133
|
+
*/
|
|
134
|
+
get id() {
|
|
135
|
+
return this.aseid.id;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Extracts the namespace from the ASEID
|
|
139
|
+
* namespace is an application specific identifier from where the entity is coming from
|
|
140
|
+
*/
|
|
141
|
+
get namespace() {
|
|
142
|
+
return this.aseid.namespace;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Extracts the scope from the ASEID
|
|
146
|
+
* scope is the scope of the entity from Application Namespace
|
|
147
|
+
*/
|
|
148
|
+
get scope() {
|
|
149
|
+
return this.aseid.scope;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Extracts the entity from the ASEID
|
|
153
|
+
* entity is the name of the entity from Application Namespace
|
|
154
|
+
*
|
|
155
|
+
*/
|
|
156
|
+
get entity() {
|
|
157
|
+
return this.aseid.entity;
|
|
107
158
|
}
|
|
108
159
|
// --------------------------------------------------------------------------
|
|
109
160
|
// A-Command Core Features
|
|
@@ -111,12 +162,12 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
111
162
|
/**
|
|
112
163
|
* Executes the command logic.
|
|
113
164
|
*/
|
|
114
|
-
|
|
165
|
+
execute() {
|
|
115
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
167
|
this._status = A_Command_constants_1.A_CONSTANTS__A_Command_Status.IN_PROGRESS;
|
|
117
168
|
this._startTime = new Date();
|
|
118
169
|
try {
|
|
119
|
-
yield this.call('execute'
|
|
170
|
+
yield this.call('execute');
|
|
120
171
|
yield this.complete();
|
|
121
172
|
}
|
|
122
173
|
catch (error) {
|
|
@@ -127,23 +178,23 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
127
178
|
/**
|
|
128
179
|
* Marks the command as completed
|
|
129
180
|
*/
|
|
130
|
-
|
|
181
|
+
complete() {
|
|
131
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
183
|
this._status = A_Command_constants_1.A_CONSTANTS__A_Command_Status.COMPLETED;
|
|
133
184
|
this._endTime = new Date();
|
|
134
185
|
this._result = this.Scope.resolve(A_Command_context_1.A_CommandContext).toJSON();
|
|
135
|
-
this.call('complete'
|
|
186
|
+
this.call('complete');
|
|
136
187
|
});
|
|
137
188
|
}
|
|
138
189
|
/**
|
|
139
190
|
* Marks the command as failed
|
|
140
191
|
*/
|
|
141
|
-
|
|
192
|
+
fail() {
|
|
142
193
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
194
|
this._status = A_Command_constants_1.A_CONSTANTS__A_Command_Status.FAILED;
|
|
144
195
|
this._endTime = new Date();
|
|
145
196
|
this._errors = this.Scope.resolve(A_Command_context_1.A_CommandContext).Errors;
|
|
146
|
-
this.call('fail'
|
|
197
|
+
this.call('fail');
|
|
147
198
|
});
|
|
148
199
|
}
|
|
149
200
|
// --------------------------------------------------------------------------
|
|
@@ -168,8 +219,8 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
168
219
|
* @param listener
|
|
169
220
|
*/
|
|
170
221
|
off(event, listener) {
|
|
171
|
-
var
|
|
172
|
-
(
|
|
222
|
+
var _a;
|
|
223
|
+
(_a = this._listeners.get(event)) === null || _a === void 0 ? void 0 : _a.delete(listener);
|
|
173
224
|
}
|
|
174
225
|
/**
|
|
175
226
|
* Emits an event to all registered listeners
|
|
@@ -177,8 +228,8 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
177
228
|
* @param event
|
|
178
229
|
*/
|
|
179
230
|
emit(event) {
|
|
180
|
-
var
|
|
181
|
-
(
|
|
231
|
+
var _a;
|
|
232
|
+
(_a = this._listeners.get(event)) === null || _a === void 0 ? void 0 : _a.forEach(listener => {
|
|
182
233
|
listener(this);
|
|
183
234
|
});
|
|
184
235
|
}
|
|
@@ -193,15 +244,20 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
193
244
|
* @param newEntity
|
|
194
245
|
*/
|
|
195
246
|
fromNew(newEntity) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
247
|
+
this.aseid = new a_utils_1.ASEID({
|
|
248
|
+
namespace: this.constructor.namespace,
|
|
249
|
+
scope: this.constructor.scope,
|
|
250
|
+
entity: this.constructor.code,
|
|
251
|
+
id: `${new Date().getTime().toString()}-${Math.floor(Math.random() * 10000000).toString()}`,
|
|
252
|
+
});
|
|
253
|
+
A_Context_class_1.A_Context.allocate(this, {
|
|
200
254
|
name: `a-command-scope::${this.id}`,
|
|
201
255
|
fragments: [
|
|
202
256
|
new A_Command_context_1.A_CommandContext()
|
|
203
257
|
]
|
|
204
258
|
});
|
|
259
|
+
this._params = newEntity;
|
|
260
|
+
this._status = A_Command_constants_1.A_CONSTANTS__A_Command_Status.INITIALIZED;
|
|
205
261
|
}
|
|
206
262
|
/**
|
|
207
263
|
* Allows to convert serialized data to Command instance
|
|
@@ -211,18 +267,18 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
211
267
|
* @param serialized
|
|
212
268
|
*/
|
|
213
269
|
fromJSON(serialized) {
|
|
214
|
-
|
|
215
|
-
if (serialized.startedAt)
|
|
216
|
-
this._startTime = new Date(serialized.startedAt);
|
|
217
|
-
if (serialized.endedAt)
|
|
218
|
-
this._endTime = new Date(serialized.endedAt);
|
|
270
|
+
this.aseid = new a_utils_1.ASEID(serialized.aseid);
|
|
219
271
|
const context = new A_Command_context_1.A_CommandContext();
|
|
220
|
-
|
|
272
|
+
A_Context_class_1.A_Context.allocate(this, {
|
|
221
273
|
name: `a-command-scope::${this.id}`,
|
|
222
274
|
fragments: [
|
|
223
275
|
context
|
|
224
276
|
]
|
|
225
277
|
});
|
|
278
|
+
if (serialized.startedAt)
|
|
279
|
+
this._startTime = new Date(serialized.startedAt);
|
|
280
|
+
if (serialized.endedAt)
|
|
281
|
+
this._endTime = new Date(serialized.endedAt);
|
|
226
282
|
// Restore result and errors in the context
|
|
227
283
|
if (serialized.result) {
|
|
228
284
|
Object.entries(serialized.result).forEach(([key, value]) => {
|
|
@@ -242,18 +298,35 @@ class A_Command extends A_Entity_class_1.A_Entity {
|
|
|
242
298
|
* @returns
|
|
243
299
|
*/
|
|
244
300
|
toJSON() {
|
|
245
|
-
return
|
|
301
|
+
return {
|
|
302
|
+
aseid: this.aseid.toString(),
|
|
303
|
+
code: this.Code,
|
|
304
|
+
status: this._status,
|
|
305
|
+
startedAt: this._startTime ? this._startTime.toISOString() : undefined,
|
|
306
|
+
endedAt: this._endTime ? this._endTime.toISOString() : undefined,
|
|
307
|
+
duration: this.Duration,
|
|
308
|
+
result: this.Result,
|
|
309
|
+
errors: this.Errors ? Array.from(this.Errors).map(err => err.toJSON()) : undefined
|
|
310
|
+
};
|
|
246
311
|
}
|
|
247
312
|
;
|
|
313
|
+
/**
|
|
314
|
+
* Call a feature of the component with the provided scope
|
|
315
|
+
*
|
|
316
|
+
* [!] If the provided scope is not inherited from the entity scope, it will be inherited
|
|
317
|
+
*
|
|
318
|
+
* @param lifecycleMethod
|
|
319
|
+
* @param args
|
|
320
|
+
*/
|
|
321
|
+
call(feature_1) {
|
|
322
|
+
return __awaiter(this, arguments, void 0, function* (feature, scope = this.Scope) {
|
|
323
|
+
if (scope && !scope.isInheritedFrom(this.Scope)) {
|
|
324
|
+
scope = scope.inherit(this.Scope);
|
|
325
|
+
}
|
|
326
|
+
const newFeature = A_Context_class_1.A_Context.feature(this, feature, scope);
|
|
327
|
+
return yield newFeature.process();
|
|
328
|
+
});
|
|
329
|
+
}
|
|
248
330
|
}
|
|
249
331
|
exports.A_Command = A_Command;
|
|
250
|
-
|
|
251
|
-
A_Feature_class_1.A_Feature.Define()
|
|
252
|
-
], A_Command.prototype, _a, null);
|
|
253
|
-
__decorate([
|
|
254
|
-
A_Feature_class_1.A_Feature.Define()
|
|
255
|
-
], A_Command.prototype, _b, null);
|
|
256
|
-
__decorate([
|
|
257
|
-
A_Feature_class_1.A_Feature.Define()
|
|
258
|
-
], A_Command.prototype, _c, null);
|
|
259
|
-
//# sourceMappingURL=A_Command.entity.js.map
|
|
332
|
+
//# sourceMappingURL=A-Command.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Command.class.js","sourceRoot":"","sources":["../../../../src/global/A-Command/A-Command.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,4CAAgE;AAEhE,mEAA+D;AAC/D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WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;YACtE,OAAO,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,SAAS;YAChE,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;SACrF,CAAA;IACL,CAAC;IAAA,CAAC;IAIF;;;;;;;OAOG;IACG,IAAI;6DACN,OAAe,EACf,QAAiB,IAAI,CAAC,KAAK;YAE3B,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC9C,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtC,CAAC;YAED,MAAM,UAAU,GAAG,2BAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;YAE3D,OAAO,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC;KAAA;CAEJ;AAvYD,8BAuYC"}
|
package/dist/src/{base/A-Command/A_Command.constants.js → global/A-Command/A-Command.constants.js}
RENAMED
|
@@ -14,4 +14,4 @@ var A_CONSTANTS_A_Command_Features;
|
|
|
14
14
|
A_CONSTANTS_A_Command_Features["COMPLETE"] = "complete";
|
|
15
15
|
A_CONSTANTS_A_Command_Features["FAIL"] = "fail";
|
|
16
16
|
})(A_CONSTANTS_A_Command_Features || (exports.A_CONSTANTS_A_Command_Features = A_CONSTANTS_A_Command_Features = {}));
|
|
17
|
-
//# sourceMappingURL=
|
|
17
|
+
//# sourceMappingURL=A-Command.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Command.constants.js","sourceRoot":"","sources":["../../../../src/global/A-Command/A-Command.constants.ts"],"names":[],"mappings":";;;AAEA,IAAY,6BAKX;AALD,WAAY,6BAA6B;IACrC,4DAA2B,CAAA;IAC3B,4DAA2B,CAAA;IAC3B,wDAAuB,CAAA;IACvB,kDAAiB,CAAA;AACrB,CAAC,EALW,6BAA6B,6CAA7B,6BAA6B,QAKxC;AAED,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACtC,qDAAmB,CAAA;IACnB,uDAAqB,CAAA;IACrB,+CAAa,CAAA;AACjB,CAAC,EAJW,8BAA8B,8CAA9B,8BAA8B,QAIzC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
2
|
+
import { A_TYPES__CommandMeta } from "./A-Command.types";
|
|
3
|
+
import { A_TYPES__A_DefineDecorator_Meta } from "../../decorators/A-Feature/A-Feature.decorator.types";
|
|
4
|
+
export declare class A_CommandMeta extends A_Meta<A_TYPES__CommandMeta> {
|
|
5
|
+
/**
|
|
6
|
+
* Returns all features defined in the Container
|
|
7
|
+
*
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
features(): Array<A_TYPES__A_DefineDecorator_Meta>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_CommandMeta = void 0;
|
|
4
|
+
const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
|
|
5
|
+
const A_Command_types_1 = require("./A-Command.types");
|
|
6
|
+
class A_CommandMeta extends A_Meta_class_1.A_Meta {
|
|
7
|
+
/**
|
|
8
|
+
* Returns all features defined in the Container
|
|
9
|
+
*
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
features() {
|
|
13
|
+
const features = this.get(A_Command_types_1.A_TYPES__CommandMetaKey.FEATURES);
|
|
14
|
+
return (features === null || features === void 0 ? void 0 : features.toArray().map(([, feature]) => feature)) || [];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.A_CommandMeta = A_CommandMeta;
|
|
18
|
+
//# sourceMappingURL=A-Command.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Command.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Command/A-Command.meta.ts"],"names":[],"mappings":";;;AAAA,yDAAgD;AAChD,uDAAkF;AAIlF,MAAa,aAAc,SAAQ,qBAA4B;IAE3D;;;;OAIG;IACH,QAAQ;QAEJ,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,yCAAuB,CAAC,QAAQ,CAAC,CAAC;QAE5D,OAAO,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,OAAO,GAEnB,GAAG,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAI,EAAE,CAAC;IAC7C,CAAC;CAEJ;AAhBD,sCAgBC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { A_Command } from "./A-Command.class";
|
|
2
|
+
import { A_CONSTANTS__A_Command_Status } from "./A-Command.constants";
|
|
3
|
+
import { A_TYPES__Error } from "@adaas/a-utils";
|
|
4
|
+
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
5
|
+
import { A_TYPES__A_DefineDecorator_Meta, A_TYPES__A_ExtendDecorator_Meta } from "../../decorators/A-Feature/A-Feature.decorator.types";
|
|
6
|
+
export type A_TYPES__Command_Constructor = {};
|
|
7
|
+
export type A_TYPES__Command_Serialized<ResultType extends Record<string, any> = Record<string, any>> = {
|
|
8
|
+
aseid: string;
|
|
9
|
+
code: string;
|
|
10
|
+
status: A_CONSTANTS__A_Command_Status;
|
|
11
|
+
startedAt?: string;
|
|
12
|
+
endedAt?: string;
|
|
13
|
+
duration?: number;
|
|
14
|
+
result?: ResultType;
|
|
15
|
+
errors?: Array<A_TYPES__Error>;
|
|
16
|
+
};
|
|
17
|
+
export type A_TYPES__Command_Listener<T extends Record<string, any> = Record<string, any>> = (command?: A_Command<any, T>) => void;
|
|
18
|
+
export type A_TYPES__CommandMeta = {
|
|
19
|
+
[A_TYPES__CommandMetaKey.EXTENSIONS]: A_Meta<{
|
|
20
|
+
/**
|
|
21
|
+
* Where Key the regexp for what to apply the extension
|
|
22
|
+
* A set of container names or a wildcard, or a regexp
|
|
23
|
+
*
|
|
24
|
+
*
|
|
25
|
+
* Where value is the extension instructions
|
|
26
|
+
*/
|
|
27
|
+
[Key: string]: A_TYPES__A_ExtendDecorator_Meta[];
|
|
28
|
+
}>;
|
|
29
|
+
case: any;
|
|
30
|
+
[A_TYPES__CommandMetaKey.FEATURES]: A_Meta<{
|
|
31
|
+
/**
|
|
32
|
+
* Where Key is the name of the feature
|
|
33
|
+
*
|
|
34
|
+
* Where value is the list of features
|
|
35
|
+
*/
|
|
36
|
+
[Key: string]: A_TYPES__A_DefineDecorator_Meta;
|
|
37
|
+
}>;
|
|
38
|
+
};
|
|
39
|
+
export declare enum A_TYPES__CommandMetaKey {
|
|
40
|
+
EXTENSIONS = "a-command-extensions",
|
|
41
|
+
FEATURES = "a-command-features",
|
|
42
|
+
ABSTRACTIONS = "a-command-abstractions"
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_TYPES__CommandMetaKey = void 0;
|
|
4
|
+
var A_TYPES__CommandMetaKey;
|
|
5
|
+
(function (A_TYPES__CommandMetaKey) {
|
|
6
|
+
A_TYPES__CommandMetaKey["EXTENSIONS"] = "a-command-extensions";
|
|
7
|
+
A_TYPES__CommandMetaKey["FEATURES"] = "a-command-features";
|
|
8
|
+
A_TYPES__CommandMetaKey["ABSTRACTIONS"] = "a-command-abstractions";
|
|
9
|
+
})(A_TYPES__CommandMetaKey || (exports.A_TYPES__CommandMetaKey = A_TYPES__CommandMetaKey = {}));
|
|
10
|
+
//# sourceMappingURL=A-Command.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Command.types.js","sourceRoot":"","sources":["../../../../src/global/A-Command/A-Command.types.ts"],"names":[],"mappings":";;;AAkEA,IAAY,uBAIX;AAJD,WAAY,uBAAuB;IAC/B,8DAAmC,CAAA;IACnC,0DAA+B,CAAA;IAC/B,kEAAuC,CAAA;AAC3C,CAAC,EAJW,uBAAuB,uCAAvB,uBAAuB,QAIlC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A_Fragment } from "
|
|
1
|
+
import { A_Fragment } from "../../A-Fragment/A-Fragment.class";
|
|
2
2
|
import { A_Error } from "@adaas/a-utils";
|
|
3
3
|
export declare class A_CommandContext<T extends Record<string, any> = Record<string, any>> extends A_Fragment {
|
|
4
4
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.A_CommandContext = void 0;
|
|
4
|
-
const A_Fragment_class_1 = require("
|
|
4
|
+
const A_Fragment_class_1 = require("../../A-Fragment/A-Fragment.class");
|
|
5
5
|
class A_CommandContext extends A_Fragment_class_1.A_Fragment {
|
|
6
6
|
/**
|
|
7
7
|
* ExecutionContext for the A-Command
|