@adaas/a-concept 0.0.4 → 0.0.6

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 (133) hide show
  1. package/dist/examples/simple/components/A.component.d.ts +4 -2
  2. package/dist/examples/simple/components/A.component.js +7 -4
  3. package/dist/examples/simple/components/A.component.js.map +1 -1
  4. package/dist/examples/simple/components/B.component.d.ts +6 -2
  5. package/dist/examples/simple/components/B.component.js +18 -7
  6. package/dist/examples/simple/components/B.component.js.map +1 -1
  7. package/dist/examples/simple/concept.js +59 -32
  8. package/dist/examples/simple/concept.js.map +1 -1
  9. package/dist/examples/simple/containers/Main.container.d.ts +2 -3
  10. package/dist/examples/simple/containers/Main.container.js +28 -8
  11. package/dist/examples/simple/containers/Main.container.js.map +1 -1
  12. package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +2 -1
  13. package/dist/examples/simple-http-server/components/http-error-handler.component.js +3 -1
  14. package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +1 -1
  15. package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +2 -1
  16. package/dist/examples/simple-http-server/components/http-request-handler.component.js +2 -1
  17. package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +1 -1
  18. package/dist/examples/simple-http-server/containers/http-server.container.d.ts +1 -2
  19. package/dist/index.d.ts +7 -1
  20. package/dist/index.js +13 -2
  21. package/dist/index.js.map +1 -1
  22. package/dist/src/base/A-Config/A-Config.container.d.ts +1 -3
  23. package/dist/src/base/A-Config/A-Config.container.js +6 -22
  24. package/dist/src/base/A-Config/A-Config.container.js.map +1 -1
  25. package/dist/src/base/A-Config/A-Config.context.d.ts +1 -0
  26. package/dist/src/base/A-Config/A-Config.context.js +20 -2
  27. package/dist/src/base/A-Config/A-Config.context.js.map +1 -1
  28. package/dist/src/base/A-Config/A-Config.types.d.ts +4 -2
  29. package/dist/src/base/A-Config/A-Config.types.js +4 -0
  30. package/dist/src/base/A-Config/A-Config.types.js.map +1 -1
  31. package/dist/src/base/A-Config/components/ConfigReader.component.d.ts +2 -1
  32. package/dist/src/base/A-Config/components/ConfigReader.component.js +3 -1
  33. package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -1
  34. package/dist/src/base/A-Errors/A-Errors.component.d.ts +2 -1
  35. package/dist/src/base/A-Errors/A-Errors.component.js +3 -1
  36. package/dist/src/base/A-Errors/A-Errors.component.js.map +1 -1
  37. package/dist/src/base/A-Logger/A-Logger.component.d.ts +4 -2
  38. package/dist/src/base/A-Logger/A-Logger.component.js +11 -3
  39. package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -1
  40. package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
  41. package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js +9 -9
  42. package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +1 -1
  43. package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +0 -2
  44. package/dist/src/decorators/A-Inject/A-Inject.decorator.js +4 -2
  45. package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
  46. package/dist/src/global/A-Component/A-Component.class.d.ts +28 -1
  47. package/dist/src/global/A-Component/A-Component.class.js +22 -0
  48. package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
  49. package/dist/src/global/A-Component/A-Component.meta.d.ts +8 -1
  50. package/dist/src/global/A-Component/A-Component.meta.js +26 -0
  51. package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
  52. package/dist/src/global/A-Component/A-Component.types.d.ts +43 -6
  53. package/dist/src/global/A-Component/A-Component.types.js +5 -0
  54. package/dist/src/global/A-Component/A-Component.types.js.map +1 -1
  55. package/dist/src/global/A-Concept/A_Concept.class.d.ts +7 -7
  56. package/dist/src/global/A-Concept/A_Concept.class.js +1 -2
  57. package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
  58. package/dist/src/global/A-Container/A-Container.class.d.ts +5 -4
  59. package/dist/src/global/A-Container/A-Container.class.js +13 -24
  60. package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
  61. package/dist/src/global/A-Container/A-Container.meta.d.ts +0 -3
  62. package/dist/src/global/A-Container/A-Container.meta.js +0 -46
  63. package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
  64. package/dist/src/global/A-Context/A-Context.class.d.ts +35 -5
  65. package/dist/src/global/A-Context/A-Context.class.js +138 -54
  66. package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
  67. package/dist/src/global/A-Context/A-Context.types.d.ts +0 -12
  68. package/dist/src/global/A-Context/A-Context.types.js +0 -1
  69. package/dist/src/global/A-Dependency/A-DependencyReference.class.d.ts +0 -17
  70. package/dist/src/global/A-Dependency/A-DependencyReference.class.js +47 -65
  71. package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +1 -1
  72. package/dist/src/global/A-Entity/A-Entity.class.d.ts +73 -2
  73. package/dist/src/global/A-Entity/A-Entity.class.js +107 -1
  74. package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
  75. package/dist/src/global/A-Entity/A-Entity.meta.d.ts +4 -0
  76. package/dist/src/global/A-Entity/A-Entity.meta.js +8 -0
  77. package/dist/src/global/A-Entity/A-Entity.meta.js.map +1 -0
  78. package/dist/src/global/A-Entity/A-Entity.types.d.ts +56 -0
  79. package/dist/src/global/A-Entity/A-Entity.types.js +15 -0
  80. package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
  81. package/dist/src/global/A-Feature/A-Feature.class.d.ts +11 -1
  82. package/dist/src/global/A-Feature/A-Feature.class.js +48 -12
  83. package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
  84. package/dist/src/global/A-Feature/A-Feature.types.d.ts +5 -4
  85. package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
  86. package/dist/src/global/A-Fragment/A-Fragment.class.js +1 -2
  87. package/dist/src/global/A-Fragment/A-Fragment.class.js.map +1 -1
  88. package/dist/src/global/A-Meta/A-Meta.class.d.ts +80 -1
  89. package/dist/src/global/A-Meta/A-Meta.class.js +121 -5
  90. package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -1
  91. package/dist/src/global/A-Scope/A-Scope.class.d.ts +15 -6
  92. package/dist/src/global/A-Scope/A-Scope.class.js +61 -17
  93. package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
  94. package/examples/simple/components/A.component.ts +6 -3
  95. package/examples/simple/components/B.component.ts +19 -6
  96. package/examples/simple/concept.ts +65 -33
  97. package/examples/simple/containers/Main.container.ts +36 -9
  98. package/examples/simple-http-server/components/http-error-handler.component.ts +5 -2
  99. package/examples/simple-http-server/components/http-request-handler.component.ts +3 -1
  100. package/index.ts +9 -1
  101. package/jest.config.ts +0 -4
  102. package/package.json +1 -1
  103. package/src/base/A-Config/A-Config.container.ts +5 -8
  104. package/src/base/A-Config/A-Config.context.ts +10 -2
  105. package/src/base/A-Config/A-Config.types.ts +8 -3
  106. package/src/base/A-Config/components/ConfigReader.component.ts +5 -2
  107. package/src/base/A-Errors/A-Errors.component.ts +3 -2
  108. package/src/base/A-Logger/A-Logger.component.ts +21 -3
  109. package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +0 -1
  110. package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +15 -10
  111. package/src/decorators/A-Inject/A-Inject.decorator.ts +13 -12
  112. package/src/global/A-Component/A-Component.class.ts +56 -1
  113. package/src/global/A-Component/A-Component.meta.ts +40 -1
  114. package/src/global/A-Component/A-Component.types.ts +51 -19
  115. package/src/global/A-Concept/A_Concept.class.ts +2 -2
  116. package/src/global/A-Container/A-Container.class.ts +22 -39
  117. package/src/global/A-Container/A-Container.meta.ts +0 -64
  118. package/src/global/A-Context/A-Context.class.ts +240 -80
  119. package/src/global/A-Context/A-Context.types.ts +0 -15
  120. package/src/global/A-Dependency/A-DependencyReference.class.ts +61 -61
  121. package/src/global/A-Entity/A-Entity.class.ts +184 -2
  122. package/src/global/A-Entity/A-Entity.meta.ts +9 -0
  123. package/src/global/A-Entity/A-Entity.types.ts +75 -0
  124. package/src/global/A-Feature/A-Feature.class.ts +62 -20
  125. package/src/global/A-Feature/A-Feature.types.ts +8 -2
  126. package/src/global/A-Fragment/A-Fragment.class.ts +1 -5
  127. package/src/global/A-Meta/A-Meta.class.ts +140 -12
  128. package/src/global/A-Scope/A-Scope.class.ts +101 -31
  129. package/tsconfig.json +0 -4
  130. package/src/storage/A_Component.storage.ts +0 -28
  131. package/src/storage/A_Concept.storage.ts +0 -49
  132. package/src/storage/A_Container.storage.ts +0 -21
  133. package/src/storage/A_Inject.storage.ts +0 -30
@@ -1,67 +1,49 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- class RealDependency {
12
- constructor(name) {
13
- this.name = name;
14
- }
15
- getName() {
16
- return this.name;
17
- }
18
- performAction() {
19
- console.log(`${this.name} is performing an action.`);
20
- }
21
- }
22
- class DependencyReference {
23
- constructor(realClass, args) {
24
- this.realClass = realClass;
25
- this.args = args;
26
- this.proxyInstance = null;
27
- this.realInstance = null;
28
- }
29
- // Simulate async loading (e.g., dynamic imports, API calls, etc.)
30
- loadInstance() {
31
- return __awaiter(this, void 0, void 0, function* () {
32
- if (!this.realInstance) {
33
- console.log('Loading real dependency...');
34
- // Simulate async loading with a delay
35
- yield new Promise((resolve) => setTimeout(resolve, 1000));
36
- this.realInstance = new this.realClass(...this.args);
37
- }
38
- return this.realInstance;
39
- });
40
- }
41
- resolve() {
42
- return __awaiter(this, void 0, void 0, function* () {
43
- if (!this.proxyInstance) {
44
- const realInstance = yield this.loadInstance();
45
- this.proxyInstance = new Proxy({}, {
46
- get: (target, prop) => {
47
- const value = realInstance[prop];
48
- // If the property is a method, return a bound function
49
- if (typeof value === 'function') {
50
- return value.bind(realInstance);
51
- }
52
- return value;
53
- }
54
- });
55
- }
56
- return this.proxyInstance;
57
- });
58
- }
59
- }
60
- // Example usage:
61
- (() => __awaiter(void 0, void 0, void 0, function* () {
62
- const lazyDependency = new DependencyReference(RealDependency, ['ComponentA']);
63
- const proxy = yield lazyDependency.resolve(); // Loads the instance asynchronously
64
- proxy.performAction(); // Will call the method on the real instance
65
- console.log(proxy.getName()); // Calls method on the real instance
66
- }))();
2
+ // class RealDependency {
3
+ // constructor(private name: string) { }
4
+ // getName() {
5
+ // return this.name;
6
+ // }
7
+ // performAction() {
8
+ // console.log(`${this.name} is performing an action.`);
9
+ // }
10
+ // }
11
+ // class DependencyReference<T> {
12
+ // private proxyInstance: T | null = null;
13
+ // private realInstance: T | null = null;
14
+ // constructor(private realClass: { new(...args: any[]): T }, private args: any[]) { }
15
+ // // Simulate async loading (e.g., dynamic imports, API calls, etc.)
16
+ // private async loadInstance(): Promise<T> {
17
+ // if (!this.realInstance) {
18
+ // console.log('Loading real dependency...');
19
+ // // Simulate async loading with a delay
20
+ // await new Promise((resolve) => setTimeout(resolve, 1000));
21
+ // this.realInstance = new this.realClass(...this.args);
22
+ // }
23
+ // return this.realInstance;
24
+ // }
25
+ // public async resolve(): Promise<T> {
26
+ // if (!this.proxyInstance) {
27
+ // const realInstance = await this.loadInstance();
28
+ // this.proxyInstance = new Proxy({}, {
29
+ // get: (target, prop) => {
30
+ // const value = (realInstance as any)[prop];
31
+ // // If the property is a method, return a bound function
32
+ // if (typeof value === 'function') {
33
+ // return value.bind(realInstance);
34
+ // }
35
+ // return value;
36
+ // }
37
+ // }) as T;
38
+ // }
39
+ // return this.proxyInstance;
40
+ // }
41
+ // }
42
+ // // Example usage:
43
+ // (async () => {
44
+ // const lazyDependency = new DependencyReference(RealDependency, ['ComponentA']);
45
+ // const proxy = await lazyDependency.resolve(); // Loads the instance asynchronously
46
+ // proxy.performAction(); // Will call the method on the real instance
47
+ // console.log(proxy.getName()); // Calls method on the real instance
48
+ // })();
67
49
  //# sourceMappingURL=A-DependencyReference.class.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"A-DependencyReference.class.js","sourceRoot":"","sources":["../../../../src/global/A-Dependency/A-DependencyReference.class.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,MAAM,cAAc;IAChB,YAAoB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAAI,CAAC;IAErC,OAAO;QACH,OAAO,IAAI,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,aAAa;QACT,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,IAAI,2BAA2B,CAAC,CAAC;IACzD,CAAC;CACJ;AAED,MAAM,mBAAmB;IAIrB,YAAoB,SAAqC,EAAU,IAAW;QAA1D,cAAS,GAAT,SAAS,CAA4B;QAAU,SAAI,GAAJ,IAAI,CAAO;QAHtE,kBAAa,GAAa,IAAI,CAAC;QAC/B,iBAAY,GAAa,IAAI,CAAC;IAE4C,CAAC;IAEnF,kEAAkE;IACpD,YAAY;;YACtB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC;gBACrB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;gBAC1C,sCAAsC;gBACtC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;gBAC1D,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;YACzD,CAAC;YACD,OAAO,IAAI,CAAC,YAAY,CAAC;QAC7B,CAAC;KAAA;IAEY,OAAO;;YAChB,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;gBACtB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;gBAE/C,IAAI,CAAC,aAAa,GAAG,IAAI,KAAK,CAAC,EAAE,EAAE;oBAC/B,GAAG,EAAE,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE;wBAClB,MAAM,KAAK,GAAI,YAAoB,CAAC,IAAI,CAAC,CAAC;wBAE1C,uDAAuD;wBACvD,IAAI,OAAO,KAAK,KAAK,UAAU,EAAE,CAAC;4BAC9B,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;wBACpC,CAAC;wBACD,OAAO,KAAK,CAAC;oBACjB,CAAC;iBACJ,CAAM,CAAC;YACZ,CAAC;YAED,OAAO,IAAI,CAAC,aAAa,CAAC;QAC9B,CAAC;KAAA;CACJ;AAGD,iBAAiB;AACjB,CAAC,GAAS,EAAE;IACR,MAAM,cAAc,GAAG,IAAI,mBAAmB,CAAC,cAAc,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAE/E,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,CAAC,CAAE,oCAAoC;IAEnF,KAAK,CAAC,aAAa,EAAE,CAAC,CAAE,4CAA4C;IAEpE,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAE,oCAAoC;AACvE,CAAC,CAAA,CAAC,EAAE,CAAC"}
1
+ {"version":3,"file":"A-DependencyReference.class.js","sourceRoot":"","sources":["../../../../src/global/A-Dependency/A-DependencyReference.class.ts"],"names":[],"mappings":";AAAA,yBAAyB;AACzB,4CAA4C;AAE5C,kBAAkB;AAClB,4BAA4B;AAC5B,QAAQ;AAER,wBAAwB;AACxB,gEAAgE;AAChE,QAAQ;AACR,IAAI;AAEJ,iCAAiC;AACjC,8CAA8C;AAC9C,6CAA6C;AAE7C,0FAA0F;AAE1F,yEAAyE;AACzE,iDAAiD;AACjD,oCAAoC;AACpC,yDAAyD;AACzD,qDAAqD;AACrD,yEAAyE;AACzE,oEAAoE;AACpE,YAAY;AACZ,oCAAoC;AACpC,QAAQ;AAER,2CAA2C;AAC3C,qCAAqC;AACrC,8DAA8D;AAE9D,mDAAmD;AACnD,2CAA2C;AAC3C,iEAAiE;AAEjE,8EAA8E;AAC9E,yDAAyD;AACzD,2DAA2D;AAC3D,wBAAwB;AACxB,oCAAoC;AACpC,oBAAoB;AACpB,uBAAuB;AACvB,YAAY;AAEZ,qCAAqC;AACrC,QAAQ;AACR,IAAI;AAGJ,oBAAoB;AACpB,iBAAiB;AACjB,sFAAsF;AAEtF,0FAA0F;AAE1F,2EAA2E;AAE3E,0EAA0E;AAC1E,QAAQ"}
@@ -1,3 +1,5 @@
1
+ import { A_TYPES__Required, ASEID } from "@adaas/a-utils";
2
+ import { A_TYPES__Entity_JSON, A_TYPES__EntityBaseMethods, A_TYPES__EntityCallParams, A_TYPES__IEntity } from "./A-Entity.types";
1
3
  /**
2
4
  * A_Entity is another abstraction that describes all major participants in the system business logic.
3
5
  * Each Entity should have a clear definition and a clear set of responsibilities.
@@ -5,6 +7,75 @@
5
7
  *
6
8
  * Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.
7
9
  */
8
- export declare class A_Entity {
9
- constructor();
10
+ export declare class A_Entity<_ConstructorType = any, _SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON, _FeatureNames extends Array<string> = A_TYPES__EntityBaseMethods> implements A_TYPES__IEntity {
11
+ aseid: ASEID;
12
+ constructor(aseid: string);
13
+ constructor(aseid: ASEID);
14
+ constructor(serialized: _SerializedType);
15
+ constructor(newEntity: _ConstructorType);
16
+ /**
17
+ * Extracts the ID from the ASEID
18
+ * ID is the unique identifier of the entity
19
+ */
20
+ get id(): string | number;
21
+ /**
22
+ * Extracts the namespace from the ASEID
23
+ * namespace is an application specific identifier from where the entity is coming from
24
+ */
25
+ get namespace(): string;
26
+ /**
27
+ * Extracts the scope from the ASEID
28
+ * scope is the scope of the entity from Application Namespace
29
+ */
30
+ get scope(): string;
31
+ /**
32
+ * Extracts the entity from the ASEID
33
+ * entity is the name of the entity from Application Namespace
34
+ */
35
+ get entity(): string;
36
+ /**
37
+ * Extracts the version from the ASEID
38
+ * version is the version of the entity
39
+ */
40
+ get version(): string | undefined;
41
+ /**
42
+ * Extracts the shard from the ASEID
43
+ * shard is the shard of the entity
44
+ */
45
+ get shard(): string | undefined;
46
+ /**
47
+ * Call a feature of the component
48
+ *
49
+ * @param lifecycleMethod
50
+ * @param args
51
+ */
52
+ call(
53
+ /**
54
+ * A-Feature method name to be called
55
+ */
56
+ feature: _FeatureNames[number]): Promise<any>;
57
+ call(
58
+ /**
59
+ * A-Feature name to be called
60
+ */
61
+ params: A_TYPES__Required<Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>, ['name']>): Promise<any>;
62
+ call(
63
+ /**
64
+ * A-Feature method name to be called
65
+ */
66
+ feature: string,
67
+ /**
68
+ * Parameters to provide additional data to the feature
69
+ */
70
+ params: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>): Promise<any>;
71
+ protected fromNewEntity(newEntity: _ConstructorType): void;
72
+ protected fromSerialized(serialized: _SerializedType): void;
73
+ /**
74
+ * Converts the entity to a JSON object
75
+ *
76
+ *
77
+ * @returns
78
+ */
79
+ toJSON(): _SerializedType;
80
+ toString(): string;
10
81
  }
@@ -1,6 +1,18 @@
1
1
  "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
2
11
  Object.defineProperty(exports, "__esModule", { value: true });
3
12
  exports.A_Entity = void 0;
13
+ const a_utils_1 = require("@adaas/a-utils");
14
+ const errors_constants_1 = require("@adaas/a-utils/dist/src/constants/errors.constants");
15
+ const A_Context_class_1 = require("../A-Context/A-Context.class");
4
16
  /**
5
17
  * A_Entity is another abstraction that describes all major participants in the system business logic.
6
18
  * Each Entity should have a clear definition and a clear set of responsibilities.
@@ -9,7 +21,101 @@ exports.A_Entity = void 0;
9
21
  * Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.
10
22
  */
11
23
  class A_Entity {
12
- constructor() {
24
+ constructor(props) {
25
+ switch (true) {
26
+ case (typeof props === 'string' && a_utils_1.ASEID.isASEID(props)):
27
+ this.aseid = new a_utils_1.ASEID(props);
28
+ break;
29
+ case (props instanceof a_utils_1.ASEID):
30
+ this.aseid = props;
31
+ break;
32
+ case (typeof props === 'object' && props.aseid):
33
+ this.fromSerialized(props);
34
+ break;
35
+ case (typeof props === 'object'):
36
+ this.fromNewEntity(props);
37
+ break;
38
+ default:
39
+ throw new a_utils_1.A_Error(errors_constants_1.A_CONSTANTS__DEFAULT_ERRORS.INCORRECT_A_ENTITY_CONSTRUCTOR);
40
+ }
41
+ }
42
+ // ====================================================================
43
+ // ================== DUPLICATED ASEID Getters ========================
44
+ // ====================================================================
45
+ /**
46
+ * Extracts the ID from the ASEID
47
+ * ID is the unique identifier of the entity
48
+ */
49
+ get id() {
50
+ return this.aseid.id;
51
+ }
52
+ /**
53
+ * Extracts the namespace from the ASEID
54
+ * namespace is an application specific identifier from where the entity is coming from
55
+ */
56
+ get namespace() {
57
+ return this.aseid.namespace;
58
+ }
59
+ /**
60
+ * Extracts the scope from the ASEID
61
+ * scope is the scope of the entity from Application Namespace
62
+ */
63
+ get scope() {
64
+ return this.aseid.scope;
65
+ }
66
+ /**
67
+ * Extracts the entity from the ASEID
68
+ * entity is the name of the entity from Application Namespace
69
+ */
70
+ get entity() {
71
+ return this.aseid.entity;
72
+ }
73
+ /**
74
+ * Extracts the version from the ASEID
75
+ * version is the version of the entity
76
+ */
77
+ get version() {
78
+ return this.aseid.version;
79
+ }
80
+ /**
81
+ * Extracts the shard from the ASEID
82
+ * shard is the shard of the entity
83
+ */
84
+ get shard() {
85
+ return this.aseid.shard;
86
+ }
87
+ call(param1, param2) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ const feature = typeof param1 === 'string'
90
+ ? param1
91
+ : param1.name;
92
+ const params = typeof param1 === 'string'
93
+ ? param2 || {}
94
+ : param1;
95
+ const newFeature = A_Context_class_1.A_Context.feature(this, feature, params);
96
+ return yield newFeature.process();
97
+ });
98
+ }
99
+ fromNewEntity(newEntity) {
100
+ return;
101
+ }
102
+ fromSerialized(serialized) {
103
+ this.aseid = new a_utils_1.ASEID((serialized).aseid);
104
+ return;
105
+ }
106
+ /**
107
+ * Converts the entity to a JSON object
108
+ *
109
+ *
110
+ * @returns
111
+ */
112
+ toJSON() {
113
+ return {
114
+ aseid: this.aseid.toString()
115
+ };
116
+ }
117
+ toString() {
118
+ return this.aseid.toString();
13
119
  }
14
120
  }
15
121
  exports.A_Entity = A_Entity;
@@ -1 +1 @@
1
- {"version":3,"file":"A-Entity.class.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.class.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,MAAa,QAAQ;IAEjB;IAEA,CAAC;CAEJ;AAND,4BAMC"}
1
+ {"version":3,"file":"A-Entity.class.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,4CAGwB;AAOxB,yFAAiG;AACjG,kEAAyD;AAIzD;;;;;;GAMG;AACH,MAAa,QAAQ;IAsBjB,YAAY,KAA0D;QAElE,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,eAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACpD,IAAI,CAAC,KAAK,GAAG,IAAI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C;YAClB,MAAM,MAAM,GAA8D,OAAO,MAAM,KAAK,QAAQ;gBAChG,CAAC,CAAC,MAAM,IAAI,EAAE;gBACd,CAAC,CAAC,MAAM,CAAC;YAEb,MAAM,UAAU,GAAG,2BAAS,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;YAE5D,OAAO,MAAM,UAAU,CAAC,OAAO,EAAE,CAAC;QACtC,CAAC;KAAA;IAKS,aAAa,CAAC,SAA2B;QAC/C,OAAO;IACX,CAAC;IAES,cAAc,CAAC,UAA2B;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO;IACX,CAAC;IAID;;;;;OAKG;IACH,MAAM;QACF,OAAO;YACH,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;SACZ,CAAC;IACzB,CAAC;IAID,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;CACJ;AA/KD,4BA+KC"}
@@ -0,0 +1,4 @@
1
+ import { A_Meta } from "../A-Meta/A-Meta.class";
2
+ import { A_TYPES__EntityMeta } from "./A-Entity.types";
3
+ export declare class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.A_EntityMeta = void 0;
4
+ const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
5
+ class A_EntityMeta extends A_Meta_class_1.A_Meta {
6
+ }
7
+ exports.A_EntityMeta = A_EntityMeta;
8
+ //# sourceMappingURL=A-Entity.meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"A-Entity.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.meta.ts"],"names":[],"mappings":";;;AAAA,yDAAgD;AAIhD,MAAa,YAAa,SAAQ,qBAA2B;CAI5D;AAJD,oCAIC"}
@@ -0,0 +1,56 @@
1
+ import { ASEID } from "@adaas/a-utils";
2
+ import { A_Meta } from "../A-Meta/A-Meta.class";
3
+ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
4
+ export type A_TYPES__EntityCallParams<T extends string> = {
5
+ name: T;
6
+ fragments: Array<A_Fragment>;
7
+ components: Array<{
8
+ new (...args: any[]): any;
9
+ }>;
10
+ };
11
+ export type A_TYPES__EntityBaseMethods = [
12
+ A_TYPES__EntityBaseMethod.SAVE,
13
+ A_TYPES__EntityBaseMethod.UPDATE,
14
+ A_TYPES__EntityBaseMethod.DESTROY,
15
+ A_TYPES__EntityBaseMethod.LOAD
16
+ ];
17
+ export declare enum A_TYPES__EntityBaseMethod {
18
+ SAVE = "save",
19
+ UPDATE = "update",
20
+ DESTROY = "destroy",
21
+ LOAD = "load"
22
+ }
23
+ export interface A_TYPES__IEntity {
24
+ /**
25
+ * The ASEID of the entity
26
+ */
27
+ aseid: ASEID;
28
+ }
29
+ export type A_TYPES__Entity_JSON = {
30
+ /**
31
+ * The ASEID of the entity
32
+ */
33
+ aseid: string;
34
+ };
35
+ export type A_TYPES__EntityMeta = {
36
+ [A_TYPES__EntityMetaKey.EXTENSIONS]: A_Meta<{
37
+ /**
38
+ * Where Key the regexp for what to apply the extension
39
+ * A set of container names or a wildcard, or a regexp
40
+ *
41
+ *
42
+ * Where value is the extension instructions
43
+ */
44
+ [Key: string]: A_TYPES__EntityMeta_ExtensionItem[];
45
+ }>;
46
+ case: any;
47
+ [A_TYPES__EntityMetaKey.FEATURES]: any[];
48
+ };
49
+ export declare enum A_TYPES__EntityMetaKey {
50
+ EXTENSIONS = "a-component-extensions",
51
+ FEATURES = "a-component-features"
52
+ }
53
+ export type A_TYPES__EntityMeta_ExtensionItem = {
54
+ name: string;
55
+ handler: string;
56
+ };
@@ -1,2 +1,17 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.A_TYPES__EntityMetaKey = exports.A_TYPES__EntityBaseMethod = void 0;
4
+ var A_TYPES__EntityBaseMethod;
5
+ (function (A_TYPES__EntityBaseMethod) {
6
+ A_TYPES__EntityBaseMethod["SAVE"] = "save";
7
+ A_TYPES__EntityBaseMethod["UPDATE"] = "update";
8
+ A_TYPES__EntityBaseMethod["DESTROY"] = "destroy";
9
+ A_TYPES__EntityBaseMethod["LOAD"] = "load";
10
+ })(A_TYPES__EntityBaseMethod || (exports.A_TYPES__EntityBaseMethod = A_TYPES__EntityBaseMethod = {}));
11
+ ;
12
+ var A_TYPES__EntityMetaKey;
13
+ (function (A_TYPES__EntityMetaKey) {
14
+ A_TYPES__EntityMetaKey["EXTENSIONS"] = "a-component-extensions";
15
+ A_TYPES__EntityMetaKey["FEATURES"] = "a-component-features";
16
+ })(A_TYPES__EntityMetaKey || (exports.A_TYPES__EntityMetaKey = A_TYPES__EntityMetaKey = {}));
2
17
  //# sourceMappingURL=A-Entity.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"A-Entity.types.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"A-Entity.types.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.types.ts"],"names":[],"mappings":";;;AAmBA,IAAY,yBAKX;AALD,WAAY,yBAAyB;IACjC,0CAAa,CAAA;IACb,8CAAiB,CAAA;IACjB,gDAAmB,CAAA;IACnB,0CAAa,CAAA;AACjB,CAAC,EALW,yBAAyB,yCAAzB,yBAAyB,QAKpC;AAOA,CAAC;AAgCF,IAAY,sBAGX;AAHD,WAAY,sBAAsB;IAC9B,+DAAqC,CAAA;IACrC,2DAAiC,CAAA;AACrC,CAAC,EAHW,sBAAsB,sCAAtB,sBAAsB,QAGjC"}
@@ -1,6 +1,6 @@
1
1
  import { A_Feature_Define } from "../../decorators/A-Feature/A-Feature-Define.decorator";
2
2
  import { A_Feature_Extend } from "../../decorators/A-Feature/A-Feature-Extend.decorator";
3
- import { A_TYPES__FeatureConstructor, A_TYPES__FeatureState, A_TYPES__FeatureStep } from "./A-Feature.types";
3
+ import { A_TYPES__FeatureConstructor, A_TYPES__FeatureIteratorReturn, A_TYPES__FeatureState, A_TYPES__FeatureStep } from "./A-Feature.types";
4
4
  import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
5
5
  /**
6
6
  * A_Feature is representing a feature that can be executed across multiple components
@@ -20,10 +20,20 @@ export declare class A_Feature {
20
20
  */
21
21
  static get Extend(): typeof A_Feature_Extend;
22
22
  protected steps: A_TYPES__FeatureStep[];
23
+ protected _current?: A_TYPES__FeatureStep;
24
+ protected _index: number;
23
25
  state: A_TYPES__FeatureState;
24
26
  result?: any;
25
27
  error?: A_Error;
26
28
  constructor(params: A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps']>);
29
+ /**
30
+ * Custom iterator to iterate over the steps of the feature
31
+ *
32
+ * @returns
33
+ */
34
+ [Symbol.iterator](): Iterator<A_TYPES__FeatureIteratorReturn, any>;
35
+ get current(): A_TYPES__FeatureStep | undefined;
36
+ isDone(): boolean;
27
37
  /**
28
38
  * This method marks the feature as completed and returns the result
29
39
  * Uses to interrupt or end the feature processing
@@ -39,11 +39,56 @@ class A_Feature {
39
39
  constructor(params) {
40
40
  // protected scope: A_Scope
41
41
  this.steps = [];
42
+ this._index = 0;
42
43
  this.state = A_Feature_types_1.A_TYPES__FeatureState.INITIALIZED;
43
44
  // this.scope = params.scope;
44
45
  this.steps = params.steps;
45
46
  A_Context_class_1.A_Context.allocate(this, params);
46
47
  }
48
+ /**
49
+ * Custom iterator to iterate over the steps of the feature
50
+ *
51
+ * @returns
52
+ */
53
+ [Symbol.iterator]() {
54
+ return {
55
+ // Custom next method
56
+ next: () => {
57
+ if (this._index < this.steps.length) {
58
+ if (this.state === A_Feature_types_1.A_TYPES__FeatureState.FAILED
59
+ ||
60
+ this.state === A_Feature_types_1.A_TYPES__FeatureState.COMPLETED) {
61
+ throw new Error('FEATURE_PROCESSING_INTERRUPTED');
62
+ }
63
+ this._current = this.steps[this._index];
64
+ const { component, handler, args } = this._current;
65
+ const instance = A_Context_class_1.A_Context.scope(this).resolve(component);
66
+ return {
67
+ value: () => __awaiter(this, void 0, void 0, function* () {
68
+ if (instance[handler]) {
69
+ const callArgs = A_Context_class_1.A_Context.scope(this).resolve(args);
70
+ yield instance[handler](...callArgs);
71
+ }
72
+ this._index++;
73
+ }),
74
+ done: false
75
+ };
76
+ }
77
+ else {
78
+ this._current = undefined; // Reset current on end
79
+ return { value: undefined, done: true };
80
+ }
81
+ }
82
+ };
83
+ }
84
+ // Access the current element
85
+ get current() {
86
+ return this._current;
87
+ }
88
+ // Custom end strategy or stop condition (could be expanded if needed)
89
+ isDone() {
90
+ return this.current === null;
91
+ }
47
92
  /**
48
93
  * This method marks the feature as completed and returns the result
49
94
  * Uses to interrupt or end the feature processing
@@ -75,22 +120,13 @@ class A_Feature {
75
120
  return __awaiter(this, void 0, void 0, function* () {
76
121
  try {
77
122
  this.state = A_Feature_types_1.A_TYPES__FeatureState.PROCESSING;
78
- for (const { component, handler, args } of this.steps) {
79
- if (this.state === A_Feature_types_1.A_TYPES__FeatureState.FAILED
80
- ||
81
- this.state === A_Feature_types_1.A_TYPES__FeatureState.COMPLETED) {
82
- throw new Error('FEATURE_PROCESSING_INTERRUPTED');
83
- }
84
- const instance = A_Context_class_1.A_Context.scope(this).resolve(component);
85
- if (instance[handler]) {
86
- const callArgs = A_Context_class_1.A_Context.scope(this).resolve(args);
87
- yield instance[handler](...callArgs);
88
- }
123
+ for (const step of this) {
124
+ yield step();
89
125
  }
90
126
  yield this.completed();
91
127
  }
92
128
  catch (error) {
93
- console.log('Feature processing error:', error);
129
+ console.log('[!] Feature processing error:', error);
94
130
  yield this.failed(error);
95
131
  }
96
132
  });
@@ -1 +1 @@
1
- {"version":3,"file":"A-Feature.class.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.class.ts"],"names":[],"mappings":";;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,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;KAAA;IAIK,OAAO;;YACT,IAAI,CAAC;gBACD,IAAI,CAAC,KAAK,GAAG,uCAAqB,CAAC,UAAU,CAAC;gBAE9C,KAAK,MAAM,IAAI,IAAI,IAAI,EAAE,CAAC;oBACtB,MAAM,IAAI,EAAE,CAAC;gBACjB,CAAC;gBAED,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;YAE3B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO,CAAC,GAAG,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;gBAEpD,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC7B,CAAC;QACL,CAAC;KAAA;IAGe,YAAY,CAAC,KAAgC;;YACzD,QAAQ,IAAI,EAAE,CAAC;gBACX,KAAK,KAAK,YAAY,iBAAO;oBACzB,MAAM,KAAK,CAAC;gBAGhB,KAAK,KAAK,YAAY,KAAK;uBACpB,KAAK,CAAC,OAAO,KAAK,gCAAgC;uBAClD,IAAI,CAAC,KAAK,KAAK,uCAAqB,CAAC,MAAM;oBAC9C,MAAM,IAAI,iBAAO,CAAC;wBACd,OAAO,EAAE,gCAAgC;wBACzC,IAAI,EAAE,gCAAgC;wBACtC,IAAI,EAAE;4BACF,OAAO,EAAE,IAAI;yBAChB;qBACJ,CAAC,CAAC;gBAGP,KAAK,KAAK,YAAY,KAAK;uBACpB,KAAK,CAAC,OAAO,KAAK,gCAAgC;uBAClD,IAAI,CAAC,KAAK,KAAK,uCAAqB,CAAC,SAAS;oBAEjD,aAAa;oBACb,MAAM;gBAEV;oBACI,MAAM,KAAK,CAAC;YACpB,CAAC;QACL,CAAC;KAAA;CAGJ;AArLD,8BAqLC"}
@@ -1,4 +1,7 @@
1
+ import { A_Component } from "../A-Component/A-Component.class";
2
+ import { A_TYPES__ComponentMeta_InjectionParam } from "../A-Component/A-Component.types";
1
3
  import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types";
4
+ export type A_TYPES__FeatureIteratorReturn<T extends any = any> = () => Promise<T>;
2
5
  export type A_TYPES__FeatureConstructor = {
3
6
  steps: A_TYPES__FeatureStep[];
4
7
  } & A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig;
@@ -9,9 +12,7 @@ export declare enum A_TYPES__FeatureState {
9
12
  FAILED = "FAILED"
10
13
  }
11
14
  export type A_TYPES__FeatureStep = {
12
- component: {
13
- new (...args: any[]): any;
14
- };
15
+ component: typeof A_Component;
15
16
  handler: string;
16
- args: any[];
17
+ args: A_TYPES__ComponentMeta_InjectionParam[];
17
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"A-Feature.types.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.types.ts"],"names":[],"mappings":";;;AAMA,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC7B,oDAA2B,CAAA;IAC3B,kDAAyB,CAAA;IAEzB,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;AACrB,CAAC,EANW,qBAAqB,qCAArB,qBAAqB,QAMhC"}
1
+ {"version":3,"file":"A-Feature.types.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.types.ts"],"names":[],"mappings":";;;AAYA,IAAY,qBAMX;AAND,WAAY,qBAAqB;IAC7B,oDAA2B,CAAA;IAC3B,kDAAyB,CAAA;IAEzB,gDAAuB,CAAA;IACvB,0CAAiB,CAAA;AACrB,CAAC,EANW,qBAAqB,qCAArB,qBAAqB,QAMhC"}
@@ -25,8 +25,7 @@ class A_Fragment {
25
25
  /**
26
26
  * Register the Namespace in the global Namespace provider
27
27
  */
28
- this.name = A_Context_class_1.A_Context
29
- .register(this, this.name);
28
+ this.name = params.name || this.constructor.name;
30
29
  /**
31
30
  * Run Async Initialization
32
31
  */
@@ -1 +1 @@
1
- {"version":3,"file":"A-Fragment.class.js","sourceRoot":"","sources":["../../../../src/global/A-Fragment/A-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AC,YAAY,CAAC,UAAU,CAAC,EAAE,CAAC;gBACvE,gDAAgD;gBAChD,+CAA+C;gBAC/C,0CAA0C;gBAC1C,oCAAoC;gBACpC,oCAAoC;gBACpC,MAAM;gBACN,mDAAmD;gBACnD,gDAAgD;gBAChD,oCAAoC;gBACpC,oCAAoC;gBACpC,MAAM;YACV,CAAC;QACL,CAAC;KAAA;IAED;;;;OAIG;IACa,WAAW;;YACvB,OAAO;QACX,CAAC;KAAA;CAEJ;AA7GD,gCA6GC"}
1
+ {"version":3,"file":"A-Fragment.class.js","sourceRoot":"","sources":["../../../../src/global/A-Fragment/A-Fragment.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kEAAyD;AAIzD;;;;;;;GAOG;AACH,MAAa,UAAU;IAWnB,YAAY,SAAgD,EAAE;QAE1D,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAEjD;;WAEG;QACH,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAEjD;;WAEG;QACH,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IAKO,YAAY,CAAC,EAA2B;QAC5C,OAAO,IAAI,CAAC,WAAW,KAAK,EAAE;YAC1B,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED;;OAEG;IACW,IAAI;;YACd,IAAI,CAAC,IAAI,CAAC,KAAK;gBACX,IAAI,CAAC,KAAK,GAAG,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAE,EAAE;oBAC/C,IAAI,CAAC;wBACD,MAAM,IAAI,CAAC,YAAY,EAAE,CAAC;wBAE1B,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;wBAEpB,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;wBAEzB,OAAO,OAAO,EAAE,CAAC;oBACrB,CAAC;o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