@adaas/a-concept 0.0.60 → 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.
Files changed (62) hide show
  1. package/dist/index.d.ts +4 -4
  2. package/dist/index.js +5 -5
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +2 -1
  5. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +9 -2
  6. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
  7. package/dist/src/{base/A-Command/A_Command.entity.d.ts → global/A-Command/A-Command.class.d.ts} +72 -10
  8. package/dist/src/{base/A-Command/A_Command.entity.js → global/A-Command/A-Command.class.js} +119 -46
  9. package/dist/src/global/A-Command/A-Command.class.js.map +1 -0
  10. package/dist/src/{base/A-Command/A_Command.constants.js → global/A-Command/A-Command.constants.js} +1 -1
  11. package/dist/src/global/A-Command/A-Command.constants.js.map +1 -0
  12. package/dist/src/global/A-Command/A-Command.meta.d.ts +11 -0
  13. package/dist/src/global/A-Command/A-Command.meta.js +18 -0
  14. package/dist/src/global/A-Command/A-Command.meta.js.map +1 -0
  15. package/dist/src/global/A-Command/A-Command.types.d.ts +43 -0
  16. package/dist/src/global/A-Command/A-Command.types.js +10 -0
  17. package/dist/src/global/A-Command/A-Command.types.js.map +1 -0
  18. package/dist/src/{base → global}/A-Command/context/A_Command.context.d.ts +1 -1
  19. package/dist/src/{base → global}/A-Command/context/A_Command.context.js +1 -1
  20. package/dist/src/global/A-Command/context/A_Command.context.js.map +1 -0
  21. package/dist/src/global/A-Concept/A_Concept.class.js +2 -0
  22. package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
  23. package/dist/src/global/A-Concept/A_Concept.types.d.ts +10 -0
  24. package/dist/src/global/A-Concept/A_Concept.types.js.map +1 -1
  25. package/dist/src/global/A-Context/A-Context.class.d.ts +3 -1
  26. package/dist/src/global/A-Context/A-Context.class.js +16 -6
  27. package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
  28. package/dist/src/global/A-Entity/A-Entity.class.js +1 -4
  29. package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
  30. package/dist/src/global/A-Feature/A-FeatureCaller.class.d.ts +4 -3
  31. package/dist/src/global/A-Feature/A-FeatureCaller.class.js.map +1 -1
  32. package/dist/src/global/A-Scope/A-Scope.class.d.ts +15 -1
  33. package/dist/src/global/A-Scope/A-Scope.class.js +62 -5
  34. package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
  35. package/dist/src/global/A-Scope/A-Scope.types.d.ts +7 -0
  36. package/dist/src/global/A-Stage/A-Stage.class.d.ts +1 -1
  37. package/index.ts +4 -4
  38. package/package.json +2 -2
  39. package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +13 -6
  40. package/src/{base/A-Command/A_Command.entity.ts → global/A-Command/A-Command.class.ts} +149 -35
  41. package/src/global/A-Command/A-Command.meta.ts +22 -0
  42. package/src/global/A-Command/A-Command.types.ts +71 -0
  43. package/src/global/A-Concept/A_Concept.class.ts +3 -0
  44. package/src/global/A-Concept/A_Concept.types.ts +10 -0
  45. package/src/global/A-Context/A-Context.class.ts +23 -5
  46. package/src/global/A-Entity/A-Entity.class.ts +1 -4
  47. package/src/global/A-Feature/A-FeatureCaller.class.ts +4 -3
  48. package/src/global/A-Scope/A-Scope.class.ts +81 -9
  49. package/src/global/A-Scope/A-Scope.types.ts +7 -0
  50. package/tests/A-Command.test.ts +15 -11
  51. package/tests/A-Concept.test.ts +110 -0
  52. package/tests/A-Scope.test.ts +45 -4
  53. package/dist/src/base/A-Command/A_Command.constants.js.map +0 -1
  54. package/dist/src/base/A-Command/A_Command.entity.js.map +0 -1
  55. package/dist/src/base/A-Command/A_Command.types.d.ts +0 -15
  56. package/dist/src/base/A-Command/A_Command.types.js +0 -3
  57. package/dist/src/base/A-Command/A_Command.types.js.map +0 -1
  58. package/dist/src/base/A-Command/context/A_Command.context.js.map +0 -1
  59. package/src/base/A-Command/A_Command.types.ts +0 -34
  60. /package/dist/src/{base/A-Command/A_Command.constants.d.ts → global/A-Command/A-Command.constants.d.ts} +0 -0
  61. /package/src/{base/A-Command/A_Command.constants.ts → global/A-Command/A-Command.constants.ts} +0 -0
  62. /package/src/{base → global}/A-Command/context/A_Command.context.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -41,10 +41,10 @@ export { ENVConfigReader } from './src/base/A-Config/components/ENVConfigReader.
41
41
  export { FileConfigReader } from './src/base/A-Config/components/FileConfigReader.component';
42
42
  export * from './src/base/A-Config/A-Config.types';
43
43
  export * from './src/base/A-Logger/A-Logger.component';
44
- export { A_Command } from './src/base/A-Command/A_Command.entity';
45
- export * from './src/base/A-Command/A_Command.types';
46
- export * from './src/base/A-Command/A_Command.constants';
47
- export { A_CommandContext } from './src/base/A-Command/context/A_Command.context';
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';
48
48
  export { A_ErrorsManager } from './src/base/A-Errors/A-Errors.component';
49
49
  export { A_Errors } from './src/base/A-Errors/A-Errors.context';
50
50
  export * from './src/base/A-Errors/A-Errors.types';
package/dist/index.js CHANGED
@@ -98,11 +98,11 @@ Object.defineProperty(exports, "FileConfigReader", { enumerable: true, get: func
98
98
  __exportStar(require("./src/base/A-Config/A-Config.types"), exports);
99
99
  __exportStar(require("./src/base/A-Logger/A-Logger.component"), exports);
100
100
  // export * from './src/base/A-Logger/A-Logger.types';
101
- var A_Command_entity_1 = require("./src/base/A-Command/A_Command.entity");
102
- Object.defineProperty(exports, "A_Command", { enumerable: true, get: function () { return A_Command_entity_1.A_Command; } });
103
- __exportStar(require("./src/base/A-Command/A_Command.types"), exports);
104
- __exportStar(require("./src/base/A-Command/A_Command.constants"), exports);
105
- var A_Command_context_1 = require("./src/base/A-Command/context/A_Command.context");
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
106
  Object.defineProperty(exports, "A_CommandContext", { enumerable: true, get: function () { return A_Command_context_1.A_CommandContext; } });
107
107
  var A_Errors_component_1 = require("./src/base/A-Errors/A-Errors.component");
108
108
  Object.defineProperty(exports, "A_ErrorsManager", { enumerable: true, get: function () { return A_Errors_component_1.A_ErrorsManager; } });
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,iFAA+D;AAE/D,0EAAmE;AAA1D,4GAAA,SAAS,OAAA;AAClB,wEAAsE;AAA7D,+GAAA,aAAa,OAAA;AACtB,yEAAuD;AAEvD,gFAAyE;AAAhE,gHAAA,WAAW,OAAA;AACpB,8EAA4E;AAAnE,mHAAA,eAAe,OAAA;AACxB,6EAA2D;AAE3D,gFAAyE;AAAhE,gHAAA,WAAW,OAAA;AACpB,8EAA4E;AAAnE,mHAAA,eAAe,OAAA;AACxB,6EAA2D;AAE3D,uEAAgE;AAAvD,0GAAA,QAAQ,OAAA;AACjB,uEAAqD;AAGrD,kEAAkE;AAClE,0EAAmE;AAA1D,4GAAA,SAAS,OAAA;AAClB,yEAAuD;AAEvD,0EAAmE;AAA1D,4GAAA,SAAS,OAAA;AAClB,sFAA+E;AAAtE,wHAAA,eAAe,OAAA;AACxB,yEAAuD;AAEvD,oE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gE;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
- default:
40
- throw new Error(`A-Feature cannot be defined on the ${target} level`);
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":";;AA8BA,4CA6FC;AAtHD,oFAA2E;AAC3E,uFAA8E;AAC9E,6FAAoF;AACpF,6FAAoF;AACpF,6FAAkG;AAIlG,oFAAyF;AACzF,6FAAkG;AAClG,8EAAqE;AAErE;;;;;;;;;;;;GAYG;AACH,SAAgB,gBAAgB,CAC5B,SAAqD,EAAE;IAEvD,OAAO,UACH,MAA4C,EAC5C,WAAmB,EACnB,UAAiD;QAGjD,MAAM,IAAI,GAAqD,2BAAS,CAAC,IAAI,CAAC,MAAM,CAAC,WAAkB,CAAC,CAAC;QAEzG,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;gBAC9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AIzC,qDAAqD;QACrD,0FAA0F;QAC1F,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;YAEvC,2BAA2B;YAC3B,IAAI,CAAC,MAAM;gBACP,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;gBAExC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAErC,0CAA0C;YAC1C,IAAI,OAAQ,IAAY,CAAC,IAAI,KAAK,UAAU,IAAI,MAAM;gBAClD,OAAQ,IAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE/C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC"}
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,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G,CACA,OAAO,EACP,WAAW,CACd,CAAC;QAGN,MAAM,cAAc,GAAG,UAAU,CAAC,KAAM,CAAC;QAGzC,qDAAqD;QACrD,0FAA0F;QAC1F,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;YAEvC,2BAA2B;YAC3B,IAAI,CAAC,MAAM;gBACP,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;;gBAExC,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;YAErC,0CAA0C;YAC1C,IAAI,OAAQ,IAAY,CAAC,IAAI,KAAK,UAAU,IAAI,MAAM;gBAClD,OAAQ,IAAY,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAE/C,CAAC,CAAC;QAEF,OAAO,UAAU,CAAC;IACtB,CAAC,CAAC;AACN,CAAC"}
@@ -1,10 +1,42 @@
1
- import { A_Entity } from "../../global/A-Entity/A-Entity.class";
2
- import { A_TYPES__Command_Constructor, A_TYPES__Command_Listener, A_TYPES__Command_Serialized } from "./A_Command.types";
3
- import { A_Error } from "@adaas/a-utils";
4
- import { A_Scope } from "../../global/A-Scope/A-Scope.class";
5
- import { A_CONSTANTS__A_Command_Event, A_CONSTANTS__A_Command_Status, A_CONSTANTS_A_Command_Features } from "./A_Command.constants";
6
- export declare class A_Command<InvokeType extends A_TYPES__Command_Constructor = A_TYPES__Command_Constructor, ResultType extends Record<string, any> = Record<string, any>> extends A_Entity<InvokeType, A_TYPES__Command_Serialized<ResultType>> {
7
- protected _scope: A_Scope;
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
- [A_CONSTANTS_A_Command_Features.EXECUTE](): Promise<any>;
127
+ execute(): Promise<any>;
75
128
  /**
76
129
  * Marks the command as completed
77
130
  */
78
- [A_CONSTANTS_A_Command_Features.COMPLETE](): Promise<void>;
131
+ complete(): Promise<void>;
79
132
  /**
80
133
  * Marks the command as failed
81
134
  */
82
- [A_CONSTANTS_A_Command_Features.FAIL](): Promise<void>;
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("./A_Command.constants");
26
- class A_Command extends A_Entity_class_1.A_Entity {
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._scope;
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.name;
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
- [_a = A_Command_constants_1.A_CONSTANTS_A_Command_Features.EXECUTE]() {
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', this._scope);
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
- [_b = A_Command_constants_1.A_CONSTANTS_A_Command_Features.COMPLETE]() {
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', this._scope);
186
+ this.call('complete');
136
187
  });
137
188
  }
138
189
  /**
139
190
  * Marks the command as failed
140
191
  */
141
- [_c = A_Command_constants_1.A_CONSTANTS_A_Command_Features.FAIL]() {
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', this._scope);
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 _d;
172
- (_d = this._listeners.get(event)) === null || _d === void 0 ? void 0 : _d.delete(listener);
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 _d;
181
- (_d = this._listeners.get(event)) === null || _d === void 0 ? void 0 : _d.forEach(listener => {
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
- super.fromNew(newEntity);
197
- this._params = newEntity;
198
- this._status = A_Command_constants_1.A_CONSTANTS__A_Command_Status.INITIALIZED;
199
- this._scope = new A_Scope_class_1.A_Scope({
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
- super.fromJSON(serialized);
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
- this._scope = new A_Scope_class_1.A_Scope({
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 Object.assign(Object.assign({}, super.toJSON()), { code: this.Code, status: this._status, startedAt: this._startTime ? this._startTime.toISOString() : undefined, endedAt: this._endTime ? this._endTime.toISOString() : undefined, duration: this.Duration, result: this.Result, errors: this.Errors ? Array.from(this.Errors).map(err => err.toJSON()) : undefined });
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
- __decorate([
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,+DAAoG;AACpG,kEAAyD;AACzD,4EAA8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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"}
@@ -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=A_Command.constants.js.map
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 "../../../global/A-Fragment/A-Fragment.class";
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("../../../global/A-Fragment/A-Fragment.class");
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"A_Command.context.js","sourceRoot":"","sources":["../../../../../src/global/A-Command/context/A_Command.context.ts"],"names":[],"mappings":";;;AAAA,0FAAiF;AAIjF,MAAa,gBAEX,SAAQ,6BAAU;IAchB;;;OAGG;IACH,YAAY,gBAAmB,EAAO;QAClC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,IAAI,GAAG,EAAE,CAAC;IAC7B,CAAC;IAGD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5D,CAAC;IAGD;;;;;OAKG;IACH,mBAAmB,CACf,YAA4B;QAE5B,OAAO,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;IAC5D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,KAAc;QAChB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED;;;;;OAKG;IACH,IAAI;IACA;;OAEG;IACH,GAAM;IACN;;OAEG;IACH,KAAW;QAEX,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IACjC,CAAC;IAGD;;;;OAIG;IACH,IAAI,CAAC,GAAY;QACb,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC7B,CAAC;IAED;;OAEG;IACH,KAAK;QACD,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IAGD;;;;;;OAMG;IACH,MAAM;QACF,MAAM,GAAG,GAAwB,EAAE,CAAC;QAEpC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;YAChC,GAAG,CAAC,GAAa,CAAC;gBACd,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,QAAQ,IAAI,KAAK,IAAI,OAAO,KAAK,CAAC,MAAM,KAAK,UAAU;oBAClG,CAAC,CAAC,KAAK,CAAC,MAAM,EAAE;oBAChB,CAAC,CAAC,KAAK,CAAC;QACpB,CAAC,CAAC,CAAA;QAEF,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AA7GD,4CA6GC"}
@@ -85,6 +85,8 @@ class A_Concept {
85
85
  props.fragments.forEach(fragment => this.Scope.register(fragment));
86
86
  if (props.entities && props.entities.length)
87
87
  props.entities.forEach(entity => this.Scope.register(entity));
88
+ if (props.commands && props.commands.length)
89
+ props.commands.forEach(command => this.Scope.register(command));
88
90
  this.containers = props.containers || [];
89
91
  }
90
92
  get namespace() {