@adaas/a-concept 0.0.2
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/.nvmrc +1 -0
- package/LICENSE +22 -0
- package/README.md +19 -0
- package/dist/examples/sdk/concept.d.ts +0 -0
- package/dist/examples/sdk/concept.js +21 -0
- package/dist/examples/sdk/concept.js.map +1 -0
- package/dist/examples/sdk/orders.api.d.ts +0 -0
- package/dist/examples/sdk/orders.api.js +16 -0
- package/dist/examples/sdk/orders.api.js.map +1 -0
- package/dist/examples/sdk/users.api.d.ts +0 -0
- package/dist/examples/sdk/users.api.js +16 -0
- package/dist/examples/sdk/users.api.js.map +1 -0
- package/dist/examples/simple/concept.d.ts +0 -0
- package/dist/examples/simple/concept.js +13 -0
- package/dist/examples/simple/concept.js.map +1 -0
- package/dist/examples/simple-http-server/concept.d.ts +1 -0
- package/dist/examples/simple-http-server/concept.js +36 -0
- package/dist/examples/simple-http-server/concept.js.map +1 -0
- package/dist/examples/simple-http-server/containers/http-server.container.d.ts +12 -0
- package/dist/examples/simple-http-server/containers/http-server.container.js +69 -0
- package/dist/examples/simple-http-server/containers/http-server.container.js.map +1 -0
- package/dist/examples/simple-http-server/containers/http-server.controller.d.ts +7 -0
- package/dist/examples/simple-http-server/containers/http-server.controller.js +37 -0
- package/dist/examples/simple-http-server/containers/http-server.controller.js.map +1 -0
- package/dist/examples/simple-http-server/containers/http-server.router.d.ts +6 -0
- package/dist/examples/simple-http-server/containers/http-server.router.js +39 -0
- package/dist/examples/simple-http-server/containers/http-server.router.js.map +1 -0
- package/dist/examples/simple-http-server/contexts/http-server.context.types.d.ts +4 -0
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js +100 -0
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js.map +1 -0
- package/dist/examples/simple-http-server/contexts/http-server.namespace.d.ts +10 -0
- package/dist/examples/simple-http-server/contexts/http-server.namespace.js +26 -0
- package/dist/examples/simple-http-server/contexts/http-server.namespace.js.map +1 -0
- package/dist/examples/simple-http-server/controllers/orders.controller.d.ts +5 -0
- package/dist/examples/simple-http-server/controllers/orders.controller.js +32 -0
- package/dist/examples/simple-http-server/controllers/orders.controller.js.map +1 -0
- package/dist/examples/simple-http-server/controllers/users.controller.d.ts +0 -0
- package/dist/examples/simple-http-server/controllers/users.controller.js +87 -0
- package/dist/examples/simple-http-server/controllers/users.controller.js.map +1 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.context.d.ts +5 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.context.js +25 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.context.js.map +1 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.module.d.ts +16 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.module.js +8 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.module.js.map +1 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.types.d.ts +2 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.types.js +3 -0
- package/dist/examples/simple-http-server/modules/simple-http-server.types.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +38 -0
- package/dist/index.js.map +1 -0
- package/dist/src/constants/A_ConceptLifecycle.constants.d.ts +2 -0
- package/dist/src/constants/A_ConceptLifecycle.constants.js +12 -0
- package/dist/src/constants/A_ConceptLifecycle.constants.js.map +1 -0
- package/dist/src/containers/A-Config/A-Config.container.d.ts +7 -0
- package/dist/src/containers/A-Config/A-Config.container.js +65 -0
- package/dist/src/containers/A-Config/A-Config.container.js.map +1 -0
- package/dist/src/containers/A-Config/A-Config.namespace.d.ts +28 -0
- package/dist/src/containers/A-Config/A-Config.namespace.js +54 -0
- package/dist/src/containers/A-Config/A-Config.namespace.js.map +1 -0
- package/dist/src/containers/A-Config/A-Config.types.d.ts +12 -0
- package/dist/src/containers/A-Config/A-Config.types.js +3 -0
- package/dist/src/containers/A-Config/A-Config.types.js.map +1 -0
- package/dist/src/containers/A-Config/components/ConfigReader.component.d.ts +18 -0
- package/dist/src/containers/A-Config/components/ConfigReader.component.js +37 -0
- package/dist/src/containers/A-Config/components/ConfigReader.component.js.map +1 -0
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.d.ts +10 -0
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.js +37 -0
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.js.map +1 -0
- package/dist/src/containers/A-Config/components/FileConfigReader.component.d.ts +11 -0
- package/dist/src/containers/A-Config/components/FileConfigReader.component.js +47 -0
- package/dist/src/containers/A-Config/components/FileConfigReader.component.js.map +1 -0
- package/dist/src/containers/A-Errors/A-Errors.container.d.ts +5 -0
- package/dist/src/containers/A-Errors/A-Errors.container.js +32 -0
- package/dist/src/containers/A-Errors/A-Errors.container.js.map +1 -0
- package/dist/src/containers/A-Errors/A-Errors.namespace.d.ts +40 -0
- package/dist/src/containers/A-Errors/A-Errors.namespace.js +76 -0
- package/dist/src/containers/A-Errors/A-Errors.namespace.js.map +1 -0
- package/dist/src/containers/A-Errors/A-Errors.types.d.ts +5 -0
- package/dist/src/containers/A-Errors/A-Errors.types.js +3 -0
- package/dist/src/containers/A-Errors/A-Errors.types.js.map +1 -0
- package/dist/src/containers/A-Logger/A-Logger.container.d.ts +6 -0
- package/dist/src/containers/A-Logger/A-Logger.container.js +41 -0
- package/dist/src/containers/A-Logger/A-Logger.container.js.map +1 -0
- package/dist/src/containers/A-Logger/A-Logger.namespace.d.ts +17 -0
- package/dist/src/containers/A-Logger/A-Logger.namespace.js +22 -0
- package/dist/src/containers/A-Logger/A-Logger.namespace.js.map +1 -0
- package/dist/src/containers/A-Logger/A-Logger.types.d.ts +0 -0
- package/dist/src/containers/A-Logger/A-Logger.types.js +2 -0
- package/dist/src/containers/A-Logger/A-Logger.types.js.map +1 -0
- package/dist/src/containers/A-Logger/components/Logger.component.d.ts +29 -0
- package/dist/src/containers/A-Logger/components/Logger.component.js +128 -0
- package/dist/src/containers/A-Logger/components/Logger.component.js.map +1 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.d.ts +34 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js +3 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.d.ts +11 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js +36 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js.map +1 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.d.ts +7 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js +3 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.d.ts +17 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js +42 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js.map +1 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.d.ts +8 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js +3 -0
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-ConceptLifecycle/index.d.ts +7 -0
- package/dist/src/decorators/A-ConceptLifecycle/index.js +11 -0
- package/dist/src/decorators/A-ConceptLifecycle/index.js.map +1 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.d.ts +0 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.js +11 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.js.map +1 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +0 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.js +2 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +22 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js +32 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +4 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.js +3 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.js.map +1 -0
- package/dist/src/decorators/A_ConceptMethods.decorator.d.ts +0 -0
- package/dist/src/decorators/A_ConceptMethods.decorator.js +2 -0
- package/dist/src/decorators/A_ConceptMethods.decorator.js.map +1 -0
- package/dist/src/decorators/A_Lazy.decorator.d.ts +5 -0
- package/dist/src/decorators/A_Lazy.decorator.js +20 -0
- package/dist/src/decorators/A_Lazy.decorator.js.map +1 -0
- package/dist/src/global/A-Component/A-Component.class.d.ts +16 -0
- package/dist/src/global/A-Component/A-Component.class.js +18 -0
- package/dist/src/global/A-Component/A-Component.class.js.map +1 -0
- package/dist/src/global/A-Concept/A_Concept.class.d.ts +46 -0
- package/dist/src/global/A-Concept/A_Concept.class.js +106 -0
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -0
- package/dist/src/global/A-Concept/A_Concept.types.d.ts +26 -0
- package/dist/src/global/A-Concept/A_Concept.types.js +3 -0
- package/dist/src/global/A-Concept/A_Concept.types.js.map +1 -0
- package/dist/src/global/A-Container/A-Container.class.d.ts +14 -0
- package/dist/src/global/A-Container/A-Container.class.js +21 -0
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -0
- package/dist/src/global/A-Context/A-Context.class.d.ts +88 -0
- package/dist/src/global/A-Context/A-Context.class.js +118 -0
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -0
- package/dist/src/global/A-Context/A-Context.types.d.ts +0 -0
- package/dist/src/global/A-Context/A-Context.types.js +2 -0
- package/dist/src/global/A-Context/A-Context.types.js.map +1 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.class.d.ts +17 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js +67 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +1 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.types.d.ts +55 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js +3 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js.map +1 -0
- package/dist/src/global/A-Namespace/A_Namespace.class.d.ts +47 -0
- package/dist/src/global/A-Namespace/A_Namespace.class.js +112 -0
- package/dist/src/global/A-Namespace/A_Namespace.class.js.map +1 -0
- package/dist/src/global/A-Namespace/A_Namespace.types.d.ts +19 -0
- package/dist/src/global/A-Namespace/A_Namespace.types.js +3 -0
- package/dist/src/global/A-Namespace/A_Namespace.types.js.map +1 -0
- package/dist/src/managers/A_DependencyManager.class.d.ts +24 -0
- package/dist/src/managers/A_DependencyManager.class.js +129 -0
- package/dist/src/managers/A_DependencyManager.class.js.map +1 -0
- package/dist/src/storage/A_Concept.storage.d.ts +19 -0
- package/dist/src/storage/A_Concept.storage.js +29 -0
- package/dist/src/storage/A_Concept.storage.js.map +1 -0
- package/dist/src/types/A_DependencyManager.types.d.ts +15 -0
- package/dist/src/types/A_DependencyManager.types.js +3 -0
- package/dist/src/types/A_DependencyManager.types.js.map +1 -0
- package/dist/src/types/A_Module.types.d.ts +17 -0
- package/dist/src/types/A_Module.types.js +22 -0
- package/dist/src/types/A_Module.types.js.map +1 -0
- package/docs/logo.png +0 -0
- package/examples/sdk/concept.ts +24 -0
- package/examples/sdk/orders.api.ts +21 -0
- package/examples/sdk/users.api.ts +21 -0
- package/examples/simple/concept.ts +16 -0
- package/examples/simple-http-server/concept.ts +30 -0
- package/examples/simple-http-server/containers/http-server.container.ts +69 -0
- package/examples/simple-http-server/containers/http-server.controller.ts +24 -0
- package/examples/simple-http-server/containers/http-server.router.ts +23 -0
- package/examples/simple-http-server/contexts/http-server.context.types.ts +108 -0
- package/examples/simple-http-server/contexts/http-server.namespace.ts +36 -0
- package/examples/simple-http-server/controllers/orders.controller.ts +20 -0
- package/examples/simple-http-server/controllers/users.controller.ts +104 -0
- package/index.ts +14 -0
- package/jest.config.ts +22 -0
- package/package.json +73 -0
- package/src/constants/A_ConceptLifecycle.constants.ts +12 -0
- package/src/containers/A-Config/A-Config.container.ts +60 -0
- package/src/containers/A-Config/A-Config.namespace.ts +98 -0
- package/src/containers/A-Config/A-Config.types.ts +31 -0
- package/src/containers/A-Config/components/ConfigReader.component.ts +30 -0
- package/src/containers/A-Config/components/ENVConfigReader.component.ts +31 -0
- package/src/containers/A-Config/components/FileConfigReader.component.ts +42 -0
- package/src/containers/A-Errors/A-Errors.container.ts +14 -0
- package/src/containers/A-Errors/A-Errors.namespace.ts +104 -0
- package/src/containers/A-Errors/A-Errors.types.ts +6 -0
- package/src/containers/A-Logger/A-Logger.container.ts +22 -0
- package/src/containers/A-Logger/A-Logger.namespace.ts +26 -0
- package/src/containers/A-Logger/A-Logger.types.ts +0 -0
- package/src/containers/A-Logger/components/Logger.component.ts +169 -0
- package/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.ts +46 -0
- package/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.ts +55 -0
- package/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.ts +20 -0
- package/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.ts +62 -0
- package/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.ts +28 -0
- package/src/decorators/A-ConceptLifecycle/index.ts +9 -0
- package/src/decorators/A-Feature/A-Feature.decorator.ts +13 -0
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +0 -0
- package/src/decorators/A-Inject/A-Inject.decorator.ts +75 -0
- package/src/decorators/A-Inject/A-Inject.decorator.types.ts +10 -0
- package/src/decorators/A_ConceptMethods.decorator.ts +0 -0
- package/src/decorators/A_Lazy.decorator.ts +31 -0
- package/src/global/A-Component/A-Component.class.ts +33 -0
- package/src/global/A-Concept/A_Concept.class.ts +143 -0
- package/src/global/A-Concept/A_Concept.types.ts +44 -0
- package/src/global/A-Container/A-Container.class.ts +39 -0
- package/src/global/A-Context/A-Context.class.ts +230 -0
- package/src/global/A-Context/A-Context.types.ts +0 -0
- package/src/global/A-Dependency/A-DependencyReference.class.ts +61 -0
- package/src/global/A-Dependency/A-DependencyReference.types.ts +61 -0
- package/src/global/A-Namespace/A_Namespace.class.ts +128 -0
- package/src/global/A-Namespace/A_Namespace.types.ts +24 -0
- package/src/storage/A_Concept.storage.ts +45 -0
- package/src/types/A_Module.types.ts +23 -0
- package/tests/context.test.ts +124 -0
- package/tests/default.test.ts +159 -0
- package/tests/log.ts +54 -0
- package/tests/polyfill.test.ts +37 -0
- package/tsconfig.json +61 -0
- package/tslint.json +98 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Run = A_Run;
|
|
4
|
+
const A_Concept_storage_1 = require("src/storage/A_Concept.storage");
|
|
5
|
+
const a_utils_1 = require("@adaas/a-utils");
|
|
6
|
+
const A_ConceptLifecycle_constants_1 = require("../../../constants/A_ConceptLifecycle.constants");
|
|
7
|
+
/**
|
|
8
|
+
* A-Run decorator
|
|
9
|
+
*
|
|
10
|
+
* This decorator is used to define a method that will be executed during the lifecycle of the module.
|
|
11
|
+
* Depending on the definition and configurations
|
|
12
|
+
* it will be executed during the run command
|
|
13
|
+
* modifying and adjusting the whole [root.run] pipeline.
|
|
14
|
+
*
|
|
15
|
+
* This decorator can be used in case of the need to define a custom logic that will be executed during the run command.
|
|
16
|
+
*
|
|
17
|
+
*
|
|
18
|
+
* @param params
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
function A_Run(config = {}) {
|
|
22
|
+
return function (target, propertyKey, descriptor) {
|
|
23
|
+
const targetProperty = A_Concept_storage_1.A_CONCEPT_STORAGE__MODULE_DECLARATION_Lifecycle_RootRun;
|
|
24
|
+
const existedMeta = A_Concept_storage_1.A_CONCEPT_ModulesDeclarationStorage.get(target.constructor) || new Map();
|
|
25
|
+
const inheritMeta = A_Concept_storage_1.A_CONCEPT_ModulesDeclarationStorage.get(Object.getPrototypeOf(target.constructor)) || new Map();
|
|
26
|
+
const inheritedInstructions = inheritMeta.get(targetProperty) || [];
|
|
27
|
+
const instructions = existedMeta.get(targetProperty) || [...inheritedInstructions];
|
|
28
|
+
/**
|
|
29
|
+
* That's is needed to remove the previous definition of the method from parent classes
|
|
30
|
+
* and override it with the new one
|
|
31
|
+
*/
|
|
32
|
+
const targetInstructions = instructions
|
|
33
|
+
.filter((instr) => instr.handler !== propertyKey);
|
|
34
|
+
targetInstructions.push({
|
|
35
|
+
handler: propertyKey,
|
|
36
|
+
config: a_utils_1.A_CommonHelper.deepCloneAndMerge(config, A_ConceptLifecycle_constants_1.A_CONSTANTS__DEFAULT_CONCEPT_LIFECYCLE_METHOD_DECLARATION_CONFIG)
|
|
37
|
+
});
|
|
38
|
+
existedMeta.set(targetProperty, targetInstructions);
|
|
39
|
+
A_Concept_storage_1.A_CONCEPT_ModulesDeclarationStorage.set(target.constructor, existedMeta);
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=A-Run.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Run.decorator.js","sourceRoot":"","sources":["../../../../../src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.ts"],"names":[],"mappings":";;AAwBA,sBAqCC;AA5DD,qEAA6I;AAC7I,4CAAgD;AAChD,0GAA2I;AAO3I;;;;;;;;;;;;;GAaG;AACH,SAAgB,KAAK,CACjB,SAAiD,EAAE;IAGnD,OAAO,UACH,MAAmB,EACnB,WAAmB,EACnB,UAA6C;QAE7C,MAAM,cAAc,GAAW,2EAAuD,CAAC;QAIvF,MAAM,WAAW,GAAG,uDAAmC,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;QAC7F,MAAM,WAAW,GAAG,uDAAmC,CAAC,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,IAAI,IAAI,GAAG,EAAE,CAAC;QAEpH,MAAM,qBAAqB,GAAG,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,EAAE,CAAC;QACpE,MAAM,YAAY,GAAqD,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,qBAAqB,CAAC,CAAC;QAErI;;;WAGG;QACH,MAAM,kBAAkB,GAAG,YAAY;aAClC,MAAM,CACH,CAAC,KAAgD,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,KAAK,WAAW,CACtF,CAAC;QAEN,kBAAkB,CAAC,IAAI,CAAC;YACpB,OAAO,EAAE,WAAW;YACpB,MAAM,EAAE,wBAAc,CAAC,iBAAiB,CAAC,MAAM,EAAE,+FAAgE,CAAC;SACrH,CAAC,CAAC;QAEH,WAAW,CAAC,GAAG,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC;QAEpD,uDAAmC,CAAC,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC7E,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { A_TYPES__A_CONCEPT_RootRunParams } from "../../../global/A-Concept/A_Concept.types";
|
|
2
|
+
import { A_TYPES__ConceptLifecycle_MethodDeclarationConfig } from "../A-ConceptLifecycle.decorator.types";
|
|
3
|
+
export type A_TYPES__A_RunDecoratorDescriptor = TypedPropertyDescriptor<(params: A_TYPES__A_CONCEPT_RootRunParams) => any> | TypedPropertyDescriptor<() => any> | TypedPropertyDescriptor<(params: A_TYPES__A_CONCEPT_RootRunParams) => Promise<any>> | TypedPropertyDescriptor<() => Promise<any>>;
|
|
4
|
+
export type A_TYPES__A_RunDecoratorConfig = {} & A_TYPES__ConceptLifecycle_MethodDeclarationConfig;
|
|
5
|
+
export type A_TYPES__A_RunDecoratorStorageInstruction = {
|
|
6
|
+
handler: string;
|
|
7
|
+
config: A_TYPES__A_RunDecoratorConfig;
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Run.decorator.types.js","sourceRoot":"","sources":["../../../../../src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Lifecycle = void 0;
|
|
4
|
+
const A_Load_decorator_1 = require("./A-Load/A-Load.decorator");
|
|
5
|
+
const A_Run_decorator_1 = require("./A-Run/A-Run.decorator");
|
|
6
|
+
exports.A_Lifecycle = {
|
|
7
|
+
Load: A_Load_decorator_1.A_Load,
|
|
8
|
+
Run: A_Run_decorator_1.A_Run,
|
|
9
|
+
Build: A_Run_decorator_1.A_Run
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/decorators/A-ConceptLifecycle/index.ts"],"names":[],"mappings":";;;AAAA,gEAAmD;AACnD,6DAAgD;AAGnC,QAAA,WAAW,GAAG;IACvB,IAAI,EAAE,yBAAM;IACZ,GAAG,EAAE,uBAAK;IACV,KAAK,EAAE,uBAAK;CACf,CAAA"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Feature.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature.decorator.ts"],"names":[],"mappings":";AAIA,6BAA6B;AAC7B,sBAAsB;AACtB,oBAAoB;AACpB,2BAA2B;AAC3B,uBAAuB;AACvB,QAAQ;AACR,MAAM;AACN,qCAAqC;AACrC,IAAI"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Feature.decorator.types.js","sourceRoot":"","sources":["../../../../src/decorators/A-Feature/A-Feature.decorator.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { A_Namespace } from "../../global/A-Namespace/A_Namespace.class";
|
|
2
|
+
import { A_Component } from "../../global/A-Component/A-Component.class";
|
|
3
|
+
/**
|
|
4
|
+
* A-Inject decorator
|
|
5
|
+
*
|
|
6
|
+
* This Decorator allows to inject dependencies into the module like
|
|
7
|
+
* - Namespaces
|
|
8
|
+
* - Other Concepts
|
|
9
|
+
* - or maybe Components
|
|
10
|
+
*
|
|
11
|
+
* @param params
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function A_Inject<T extends {
|
|
15
|
+
new (...args: any[]): A_Component;
|
|
16
|
+
}>(component: T): any;
|
|
17
|
+
export declare function A_Inject<T extends {
|
|
18
|
+
new (...args: any[]): A_Namespace;
|
|
19
|
+
}>(namespace: T): any;
|
|
20
|
+
export declare function A_Inject<E extends {
|
|
21
|
+
new (...args: any[]): A_Namespace;
|
|
22
|
+
}, T extends Array<E>>(namespaces: T): any;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Inject = A_Inject;
|
|
4
|
+
const A_Namespace_class_1 = require("../../global/A-Namespace/A_Namespace.class");
|
|
5
|
+
const A_Component_class_1 = require("../../global/A-Component/A-Component.class");
|
|
6
|
+
function A_Inject(param1) {
|
|
7
|
+
switch (true) {
|
|
8
|
+
case param1 instanceof A_Component_class_1.A_Component:
|
|
9
|
+
return function (target, propertyKey, parameterIndex) {
|
|
10
|
+
// It should be just register the parameter in method that will be resolved in the method
|
|
11
|
+
};
|
|
12
|
+
case param1 instanceof A_Namespace_class_1.A_Namespace:
|
|
13
|
+
return function (target, propertyKey, parameterIndex) {
|
|
14
|
+
// It should be just register the parameter in method that will be resolved in the method
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
// const namespaces: Array<typeof A_Namespace> = [
|
|
18
|
+
// ...(Array.isArray(param1) ? param1 : [param1])
|
|
19
|
+
// ];
|
|
20
|
+
// const resolvedNamespaces: Array<A_Namespace> = []
|
|
21
|
+
// for (const namespace of namespaces) {
|
|
22
|
+
// resolvedNamespaces.push(A_Context.resolve(namespace));
|
|
23
|
+
// }
|
|
24
|
+
// return function (
|
|
25
|
+
// target: T | E,
|
|
26
|
+
// propertyKey: string | symbol,
|
|
27
|
+
// parameterIndex: number
|
|
28
|
+
// ) {
|
|
29
|
+
// // It should be just register the parameter in method that will be resolved in the method
|
|
30
|
+
// }
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=A-Inject.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Inject.decorator.js","sourceRoot":"","sources":["../../../../src/decorators/A-Inject/A-Inject.decorator.ts"],"names":[],"mappings":";;AA+BA,4BA2CC;AA1ED,6FAAoF;AAEpF,6FAAoF;AA6BpF,SAAgB,QAAQ,CAKpB,MAAiB;IAEjB,QAAQ,IAAI,EAAE,CAAC;QACX,KAAK,MAAM,YAAY,+BAAW;YAC9B,OAAO,UACH,MAAS,EACT,WAA4B,EAC5B,cAAsB;gBAEtB,0FAA0F;YAC9F,CAAC,CAAA;QACL,KAAK,MAAM,YAAY,+BAAW;YAC9B,OAAO,UACH,MAAS,EACT,WAA4B,EAC5B,cAAsB;gBAEtB,0FAA0F;YAC9F,CAAC,CAAA;IACT,CAAC;IAED,kDAAkD;IAClD,qDAAqD;IACrD,KAAK;IAEL,oDAAoD;IAEpD,wCAAwC;IACxC,6DAA6D;IAC7D,IAAI;IAEJ,oBAAoB;IACpB,qBAAqB;IACrB,oCAAoC;IACpC,6BAA6B;IAC7B,MAAM;IACN,iGAAiG;IACjG,IAAI;AACR,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Inject.decorator.types.js","sourceRoot":"","sources":["../../../../src/decorators/A-Inject/A-Inject.decorator.types.ts"],"names":[],"mappings":""}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A_ConceptMethods.decorator.js","sourceRoot":"","sources":["../../../src/decorators/A_ConceptMethods.decorator.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Lazy = A_Lazy;
|
|
4
|
+
function RegisterLazyMethod(target, propertyKey, descriptor) {
|
|
5
|
+
const originalMethod = descriptor.value;
|
|
6
|
+
descriptor.value = function (...args) {
|
|
7
|
+
console.log(`Intercepted call to method: ${propertyKey}`);
|
|
8
|
+
console.log(`Arguments: `, args);
|
|
9
|
+
// You can modify args or do something else here
|
|
10
|
+
const result = originalMethod.apply(this, args);
|
|
11
|
+
// You can also modify the return value
|
|
12
|
+
console.log(`Result: `, result);
|
|
13
|
+
return result;
|
|
14
|
+
};
|
|
15
|
+
return descriptor;
|
|
16
|
+
}
|
|
17
|
+
function A_Lazy(params) {
|
|
18
|
+
return RegisterLazyMethod;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=A_Lazy.decorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A_Lazy.decorator.js","sourceRoot":"","sources":["../../../src/decorators/A_Lazy.decorator.ts"],"names":[],"mappings":";;AAwBA,wBAMC;AA9BD,SAAS,kBAAkB,CACvB,MAAW,EACX,WAAmB,EACnB,UAA8B;IAE9B,MAAM,cAAc,GAAG,UAAU,CAAC,KAAK,CAAC;IAExC,UAAU,CAAC,KAAK,GAAG,UAAU,GAAG,IAAW;QACvC,OAAO,CAAC,GAAG,CAAC,+BAA+B,WAAW,EAAE,CAAC,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;QAEjC,gDAAgD;QAChD,MAAM,MAAM,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QAEhD,uCAAuC;QACvC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;QAChC,OAAO,MAAM,CAAC;IAClB,CAAC,CAAC;IAEF,OAAO,UAAU,CAAC;AACtB,CAAC;AAID,SAAgB,MAAM,CAClB,MAEC;IAED,OAAO,kBAAkB,CAAC;AAC9B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { A_Namespace } from "../A-Namespace/A_Namespace.class";
|
|
2
|
+
/**
|
|
3
|
+
* This element only contains the specific code
|
|
4
|
+
*
|
|
5
|
+
*/
|
|
6
|
+
export declare class A_Component<T extends A_Namespace = A_Namespace> {
|
|
7
|
+
/**
|
|
8
|
+
* Primary context that impacts the component behavior
|
|
9
|
+
*/
|
|
10
|
+
protected namespace: A_Namespace;
|
|
11
|
+
constructor(
|
|
12
|
+
/**
|
|
13
|
+
* Primary context that impacts the component behavior
|
|
14
|
+
*/
|
|
15
|
+
namespace: A_Namespace);
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Component = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This element only contains the specific code
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
class A_Component {
|
|
9
|
+
constructor(
|
|
10
|
+
/**
|
|
11
|
+
* Primary context that impacts the component behavior
|
|
12
|
+
*/
|
|
13
|
+
namespace) {
|
|
14
|
+
this.namespace = namespace;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.A_Component = A_Component;
|
|
18
|
+
//# sourceMappingURL=A-Component.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Component.class.js","sourceRoot":"","sources":["../../../../src/global/A-Component/A-Component.class.ts"],"names":[],"mappings":";;;AAIA;;;GAGG;AACH,MAAa,WAAW;IAEpB;IACI;;OAEG;IACO,SAAsB;QAAtB,cAAS,GAAT,SAAS,CAAa;IAGpC,CAAC;CAeJ;AAxBD,kCAwBC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { A_TYPES__A_CONCEPT_RootRunParams, A_TYPES__IConceptConstructor } from "./A_Concept.types";
|
|
2
|
+
import { A_Context } from "../A-Context/A-Context.class";
|
|
3
|
+
/**
|
|
4
|
+
* A_Concept is a placeholder for the concept of the ani program.
|
|
5
|
+
*
|
|
6
|
+
* Concept - could be any Program regardless environment and it's goal.
|
|
7
|
+
* It could be mobile, web or simple html page.
|
|
8
|
+
* All depends on Containers and Components installed and provided in the Concept.
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* [!] Concept operates ONLY with all Components and Containers provided to achieve the goal.
|
|
12
|
+
*
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare class A_Concept {
|
|
16
|
+
/**
|
|
17
|
+
* Context is a root namespace for the concept.
|
|
18
|
+
*/
|
|
19
|
+
Context: typeof A_Context;
|
|
20
|
+
/**
|
|
21
|
+
* Context provider is a singleton that provides the context for ALL concepts.
|
|
22
|
+
*/
|
|
23
|
+
protected props: A_TYPES__IConceptConstructor;
|
|
24
|
+
constructor(props: A_TYPES__IConceptConstructor);
|
|
25
|
+
get namespace(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Returns true if the class has inherited from the given class.
|
|
28
|
+
*
|
|
29
|
+
* @param cl
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
private hasInherited;
|
|
33
|
+
protected init(): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Run the concept.
|
|
36
|
+
*/
|
|
37
|
+
run(params?: A_TYPES__A_CONCEPT_RootRunParams): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Build the concept.
|
|
40
|
+
*/
|
|
41
|
+
build(): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* Call the specific method of the concept or included modules.
|
|
44
|
+
*/
|
|
45
|
+
call(): Promise<void>;
|
|
46
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.A_Concept = void 0;
|
|
13
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
14
|
+
const A_Errors_namespace_1 = require("src/containers/A-Errors/A-Errors.namespace");
|
|
15
|
+
/**
|
|
16
|
+
* A_Concept is a placeholder for the concept of the ani program.
|
|
17
|
+
*
|
|
18
|
+
* Concept - could be any Program regardless environment and it's goal.
|
|
19
|
+
* It could be mobile, web or simple html page.
|
|
20
|
+
* All depends on Containers and Components installed and provided in the Concept.
|
|
21
|
+
*
|
|
22
|
+
*
|
|
23
|
+
* [!] Concept operates ONLY with all Components and Containers provided to achieve the goal.
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
class A_Concept {
|
|
28
|
+
constructor(props) {
|
|
29
|
+
this.props = props;
|
|
30
|
+
this.Context = A_Context_class_1.A_Context;
|
|
31
|
+
}
|
|
32
|
+
get namespace() {
|
|
33
|
+
return this.Context.root;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Returns true if the class has inherited from the given class.
|
|
37
|
+
*
|
|
38
|
+
* @param cl
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
hasInherited(cl) {
|
|
42
|
+
return this.constructor === cl
|
|
43
|
+
? false
|
|
44
|
+
: true;
|
|
45
|
+
}
|
|
46
|
+
init() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
// await this.Context.init();
|
|
49
|
+
// await this.DM.init();
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
// =======================================================================
|
|
53
|
+
// ========================== LIFECYCLE ================================
|
|
54
|
+
// =======================================================================
|
|
55
|
+
/**
|
|
56
|
+
* Run the concept.
|
|
57
|
+
*/
|
|
58
|
+
run() {
|
|
59
|
+
return __awaiter(this, arguments, void 0, function* (params = {}) {
|
|
60
|
+
// to prevent modification of the method parameters use the A_Context directly without decorators
|
|
61
|
+
const [Errors] = this.Context.resolve([A_Errors_namespace_1.A_Errors]);
|
|
62
|
+
if (this.hasInherited(A_Concept))
|
|
63
|
+
Errors.throw('[root.run] method can not be overridden in the inherited classes');
|
|
64
|
+
// const allRunDeclarations = A_CONCEPT_LifecycleDeclarationsStorage
|
|
65
|
+
// .get(A_CONCEPT_STORAGE__DECORATORS_RUN_DECLARATIONS);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build the concept.
|
|
70
|
+
*/
|
|
71
|
+
build() {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
// to prevent modification of the method parameters use the A_Context directly without decorators
|
|
74
|
+
const [Errors] = this.Context.resolve([A_Errors_namespace_1.A_Errors]);
|
|
75
|
+
if (this.hasInherited(A_Concept))
|
|
76
|
+
Errors.throw('[root.build] method can not be overridden in the inherited classes');
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// /**
|
|
80
|
+
// * Deploy the concept.
|
|
81
|
+
// */
|
|
82
|
+
// async deploy() {
|
|
83
|
+
// if (this.hasInherited(A_Concept))
|
|
84
|
+
// this.Context.Errors.throw('[root.deploy] method can not be overridden in the inherited classes');
|
|
85
|
+
// }
|
|
86
|
+
// /**
|
|
87
|
+
// * Publish the concept.
|
|
88
|
+
// */
|
|
89
|
+
// async publish() {
|
|
90
|
+
// if (this.hasInherited(A_Concept))
|
|
91
|
+
// this.Context.Errors.throw('[root.publish] method can not be overridden in the inherited classes');
|
|
92
|
+
// }
|
|
93
|
+
/**
|
|
94
|
+
* Call the specific method of the concept or included modules.
|
|
95
|
+
*/
|
|
96
|
+
call() {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
// to prevent modification of the method parameters use the A_Context directly without decorators
|
|
99
|
+
const [Errors] = this.Context.resolve([A_Errors_namespace_1.A_Errors]);
|
|
100
|
+
// if (this.hasInherited(A_Concept))
|
|
101
|
+
// this.Context.Errors.throw('[root.call] method can not be overridden in the inherited classes');
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
exports.A_Concept = A_Concept;
|
|
106
|
+
//# sourceMappingURL=A_Concept.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,kEAAyD;AACzD,mFAAsE;AAItE;;;;;;;;;;;GAWG;AACH,MAAa,SAAS;IAclB,YACI,KAAmC;QAEnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QAEnB,IAAI,CAAC,OAAO,GAAG,2BAAS,CAAC;IAC7B,CAAC;IAGD,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAA;IAC5B,CAAC;IAGD;;;;;OAKG;IACK,YAAY,CAAC,EAA2B;QAC5C,OAAO,IAAI,CAAC,WAAW,KAAK,EAAE;YAC1B,CAAC,CAAC,KAAK;YACP,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAKe,IAAI;;YAChB,6BAA6B;YAE7B,wBAAwB;QAC5B,CAAC;KAAA;IAID,0EAA0E;IAC1E,0EAA0E;IAC1E,0EAA0E;IAE1E;;OAEG;IACG,GAAG;6DACL,SAA2C,EAAE;YAG7C,mGAAmG;YACnG,MAAM,CACF,MAAM,CACT,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAAQ,CAAC,CAAC,CAAC;YAErC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;gBAC5B,MAAM,CAAC,KAAK,CAAC,kEAAkE,CAAC,CAAC;YAGrF,oEAAoE;YACpE,4DAA4D;QAChE,CAAC;KAAA;IAGD;;OAEG;IACG,KAAK;;YACP,mGAAmG;YACnG,MAAM,CACF,MAAM,CACT,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAAQ,CAAC,CAAC,CAAC;YAGrC,IAAI,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;gBAC5B,MAAM,CAAC,KAAK,CAAC,oEAAoE,CAAC,CAAC;QAE3F,CAAC;KAAA;IAGD,MAAM;IACN,yBAAyB;IACzB,MAAM;IACN,mBAAmB;IACnB,wCAAwC;IACxC,4GAA4G;IAC5G,IAAI;IAGJ,MAAM;IACN,0BAA0B;IAC1B,MAAM;IACN,oBAAoB;IACpB,wCAAwC;IACxC,6GAA6G;IAC7G,IAAI;IAGJ;;OAEG;IACG,IAAI;;YACN,mGAAmG;YACnG,MAAM,CACF,MAAM,CACT,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,6BAAQ,CAAC,CAAC,CAAC;YAErC,oCAAoC;YACpC,sGAAsG;QAC1G,CAAC;KAAA;CAEJ;AA3HD,8BA2HC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { A_Concept } from "./A_Concept.class";
|
|
2
|
+
import { A_Namespace } from "../A-Namespace/A_Namespace.class";
|
|
3
|
+
import { A_Container } from "../A-Container/A-Container.class";
|
|
4
|
+
export interface A_TYPES__IConceptConstructor {
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
/**
|
|
8
|
+
* A set of Namespaces that the concept depends on.
|
|
9
|
+
* These namespaces will create a new Context for the concept.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
context?: Array<A_Namespace>;
|
|
13
|
+
/**
|
|
14
|
+
* A set of Containers that the concept depends on.
|
|
15
|
+
* These containers will create a new Container for the concept.
|
|
16
|
+
*/
|
|
17
|
+
containers?: Array<{
|
|
18
|
+
new (...args: any[]): A_Container;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* A set of external Concepts that can be used in the current Concept.
|
|
22
|
+
* To provide additional functionality or extend the current Concept.
|
|
23
|
+
*/
|
|
24
|
+
import?: Array<A_Concept>;
|
|
25
|
+
}
|
|
26
|
+
export type A_TYPES__A_CONCEPT_RootRunParams = {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A_Concept.types.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { A_Namespace } from "../A-Namespace/A_Namespace.class";
|
|
2
|
+
/**
|
|
3
|
+
* This class should combine Components to achieve the goal withing Context
|
|
4
|
+
* Container could be interpreted as any Structure Entity, or Abstract Entity
|
|
5
|
+
* For example:
|
|
6
|
+
* - Controller (all Controllers with base logic)
|
|
7
|
+
* - Service (all Services with base logic)
|
|
8
|
+
* - Module (all Modules with base logic)
|
|
9
|
+
* - etc.
|
|
10
|
+
*/
|
|
11
|
+
export declare class A_Container<T extends A_Namespace = A_Namespace> {
|
|
12
|
+
protected readonly namespace: T;
|
|
13
|
+
constructor(namespace?: T);
|
|
14
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Container = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* This class should combine Components to achieve the goal withing Context
|
|
6
|
+
* Container could be interpreted as any Structure Entity, or Abstract Entity
|
|
7
|
+
* For example:
|
|
8
|
+
* - Controller (all Controllers with base logic)
|
|
9
|
+
* - Service (all Services with base logic)
|
|
10
|
+
* - Module (all Modules with base logic)
|
|
11
|
+
* - etc.
|
|
12
|
+
*/
|
|
13
|
+
class A_Container {
|
|
14
|
+
constructor(namespace) {
|
|
15
|
+
if (namespace) {
|
|
16
|
+
this.namespace = namespace;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.A_Container = A_Container;
|
|
21
|
+
//# sourceMappingURL=A-Container.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Container.class.js","sourceRoot":"","sources":["../../../../src/global/A-Container/A-Container.class.ts"],"names":[],"mappings":";;;AAIA;;;;;;;;GAQG;AACH,MAAa,WAAW;IAKpB,YACI,SAAa;QAEb,IAAI,SAAS,EAAE,CAAC;YACZ,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC/B,CAAC;IACL,CAAC;CAcJ;AAzBD,kCAyBC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { A_Namespace } from "../A-Namespace/A_Namespace.class";
|
|
2
|
+
import { A_Component } from "../A-Component/A-Component.class";
|
|
3
|
+
/**
|
|
4
|
+
* Namespace Provider is responsible for providing the Namespace to the Containers and other Namespaces.
|
|
5
|
+
* This class stores all Namespaces across the Program.
|
|
6
|
+
*
|
|
7
|
+
* Namespace provider is a singleton class that is used to store all the Namespaces in the program.
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare class A_Context {
|
|
11
|
+
static instance: A_Context;
|
|
12
|
+
/**
|
|
13
|
+
* Stores all the Namespaces by namespace.
|
|
14
|
+
* There might be a Namespaces of the same type but with different namespaces.
|
|
15
|
+
* That might be useful for the cases when you need to have multiple instances of the same Namespace e.g.
|
|
16
|
+
* - multiple http servers
|
|
17
|
+
* - multitenant applications
|
|
18
|
+
* - etc.
|
|
19
|
+
*/
|
|
20
|
+
namespaced: Map<string, A_Namespace>;
|
|
21
|
+
/**
|
|
22
|
+
* Stores the singleton Namespaces.
|
|
23
|
+
* Singleton Namespaces are the Namespaces that are used only once in the program.
|
|
24
|
+
* In most cases, the singleton Namespace is the main Namespace of the program.
|
|
25
|
+
* It could be :
|
|
26
|
+
* - the main Namespace of the Program
|
|
27
|
+
* - the authentication Namespace
|
|
28
|
+
* - the main database Namespace
|
|
29
|
+
* - etc.
|
|
30
|
+
*/
|
|
31
|
+
singleton: WeakMap<{
|
|
32
|
+
new (...args: any[]): A_Namespace;
|
|
33
|
+
}, A_Namespace>;
|
|
34
|
+
/**
|
|
35
|
+
* Stores the components that are used in the program.
|
|
36
|
+
*/
|
|
37
|
+
components: Map<string, any>;
|
|
38
|
+
/**
|
|
39
|
+
* Root Namespace is a Namespace that is used to run the program.
|
|
40
|
+
*/
|
|
41
|
+
private _root;
|
|
42
|
+
private constructor();
|
|
43
|
+
/**
|
|
44
|
+
* Get the instance of the Namespace Provider.
|
|
45
|
+
*
|
|
46
|
+
* @returns
|
|
47
|
+
*/
|
|
48
|
+
static getInstance(): A_Context;
|
|
49
|
+
static get root(): string;
|
|
50
|
+
static get environment(): 'server' | 'browser';
|
|
51
|
+
/**
|
|
52
|
+
* Register a Namespace in the provider.
|
|
53
|
+
* @param Namespace
|
|
54
|
+
*/
|
|
55
|
+
static register(Namespace: A_Namespace): string;
|
|
56
|
+
static register(Namespace: A_Namespace, namespace?: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* Get the Namespace by namespace.
|
|
59
|
+
* @param namespace
|
|
60
|
+
*/
|
|
61
|
+
static get(namespace: string): A_Namespace<any> | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Resolve the Component by Class.
|
|
64
|
+
*
|
|
65
|
+
* @param component
|
|
66
|
+
*/
|
|
67
|
+
static resolve<T extends A_Component>(component: {
|
|
68
|
+
new (...args: any[]): T;
|
|
69
|
+
}): T;
|
|
70
|
+
static resolve<T extends A_Namespace>(namespace: {
|
|
71
|
+
new (...args: any[]): T;
|
|
72
|
+
}): T;
|
|
73
|
+
static resolve<T extends A_Namespace>(namespaces: Array<{
|
|
74
|
+
new (...args: any[]): T;
|
|
75
|
+
}>): Array<T>;
|
|
76
|
+
static resolve<T extends A_Namespace>(namespace: {
|
|
77
|
+
new (...args: any[]): T;
|
|
78
|
+
}, name: string): T;
|
|
79
|
+
private static resolveComponent;
|
|
80
|
+
/**
|
|
81
|
+
*
|
|
82
|
+
* Allowing to resolve the Namespace by Class and Name.
|
|
83
|
+
*
|
|
84
|
+
* @param namespace
|
|
85
|
+
* @param name
|
|
86
|
+
*/
|
|
87
|
+
private static resolveNamespace;
|
|
88
|
+
}
|