@adaas/a-concept 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/examples/simple/components/A.component.d.ts +7 -0
- package/dist/examples/simple/components/A.component.js +57 -0
- package/dist/examples/simple/components/A.component.js.map +1 -0
- package/dist/examples/simple/components/B.component.d.ts +9 -0
- package/dist/examples/simple/components/B.component.js +77 -0
- package/dist/examples/simple/components/B.component.js.map +1 -0
- package/dist/examples/simple/concept.d.ts +1 -0
- package/dist/examples/simple/concept.js +53 -11
- package/dist/examples/simple/concept.js.map +1 -1
- package/dist/examples/simple/containers/Main.container.d.ts +11 -0
- package/dist/examples/simple/containers/Main.container.js +64 -0
- package/dist/examples/simple/containers/Main.container.js.map +1 -0
- package/dist/examples/simple/context/Fragment_A.context.d.ts +6 -0
- package/dist/examples/simple/context/Fragment_A.context.js +16 -0
- package/dist/examples/simple/context/Fragment_A.context.js.map +1 -0
- package/dist/examples/simple/context/Fragment_B.context.d.ts +6 -0
- package/dist/examples/simple/context/Fragment_B.context.js +16 -0
- package/dist/examples/simple/context/Fragment_B.context.js.map +1 -0
- package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +9 -0
- package/dist/examples/simple-http-server/components/http-error-handler.component.js +63 -0
- package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +1 -0
- package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +2 -0
- package/dist/examples/simple-http-server/components/http-request-handler.component.js +7 -0
- package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +1 -0
- package/dist/examples/simple-http-server/concept.js +21 -22
- package/dist/examples/simple-http-server/concept.js.map +1 -1
- package/dist/examples/simple-http-server/containers/http-server.container.d.ts +8 -8
- package/dist/examples/simple-http-server/containers/http-server.container.js +34 -30
- package/dist/examples/simple-http-server/containers/http-server.container.js.map +1 -1
- package/dist/examples/simple-http-server/containers/http-server.controller.js +1 -1
- package/dist/examples/simple-http-server/containers/http-server.router.js +2 -2
- package/dist/examples/simple-http-server/containers/http-server.router.js.map +1 -1
- package/dist/examples/simple-http-server/contexts/http-request.context.d.ts +13 -0
- package/dist/examples/simple-http-server/contexts/http-request.context.js +51 -0
- package/dist/examples/simple-http-server/contexts/http-request.context.js.map +1 -0
- package/dist/examples/simple-http-server/contexts/http-server.context.types.d.ts +0 -4
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js +0 -98
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js.map +1 -1
- package/dist/examples/simple-http-server/contexts/http-server.namespace.d.ts +1 -1
- package/dist/examples/simple-http-server/contexts/http-server.namespace.js +1 -1
- package/dist/examples/simple-http-server/controllers/users.controller.js +2 -2
- package/dist/examples/simple-http-server/test.d.ts +68 -0
- package/dist/examples/simple-http-server/test.js +162 -0
- package/dist/examples/simple-http-server/test.js.map +1 -0
- package/dist/index.d.ts +25 -7
- package/dist/index.js +55 -13
- package/dist/index.js.map +1 -1
- package/dist/src/base/A-Config/A-Config.container.d.ts +8 -0
- package/dist/src/base/A-Config/A-Config.container.js +64 -0
- package/dist/src/base/A-Config/A-Config.container.js.map +1 -0
- package/dist/src/base/A-Config/A-Config.context.d.ts +30 -0
- package/dist/src/base/A-Config/A-Config.context.js +58 -0
- package/dist/src/base/A-Config/A-Config.context.js.map +1 -0
- package/dist/src/base/A-Config/A-Config.types.d.ts +14 -0
- package/dist/src/base/A-Config/A-Config.types.js +3 -0
- package/dist/src/base/A-Config/A-Config.types.js.map +1 -0
- package/dist/src/base/A-Config/components/ConfigReader.component.d.ts +19 -0
- package/dist/src/base/A-Config/components/ConfigReader.component.js +53 -0
- package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -0
- package/dist/src/base/A-Config/components/ENVConfigReader.component.d.ts +10 -0
- package/dist/src/base/A-Config/components/ENVConfigReader.component.js +37 -0
- package/dist/src/base/A-Config/components/ENVConfigReader.component.js.map +1 -0
- package/dist/src/base/A-Config/components/FileConfigReader.component.d.ts +11 -0
- package/dist/src/base/A-Config/components/FileConfigReader.component.js +47 -0
- package/dist/src/base/A-Config/components/FileConfigReader.component.js.map +1 -0
- package/dist/src/base/A-Errors/A-Errors.component.d.ts +18 -0
- package/dist/src/base/A-Errors/A-Errors.component.js +85 -0
- package/dist/src/base/A-Errors/A-Errors.component.js.map +1 -0
- package/dist/src/base/A-Errors/A-Errors.context.d.ts +27 -0
- package/dist/src/base/A-Errors/A-Errors.context.js +50 -0
- package/dist/src/base/A-Errors/A-Errors.context.js.map +1 -0
- package/dist/src/base/A-Errors/A-Errors.types.d.ts +5 -0
- package/dist/src/base/A-Errors/A-Errors.types.js +3 -0
- package/dist/src/base/A-Errors/A-Errors.types.js.map +1 -0
- package/dist/src/base/A-Logger/A-Logger.component.d.ts +28 -0
- package/dist/src/base/A-Logger/A-Logger.component.js +142 -0
- package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -0
- package/dist/src/base/A-Logger/A-Logger.types.js +2 -0
- package/dist/src/base/A-Logger/A-Logger.types.js.map +1 -0
- package/dist/src/constants/A_ConceptLifecycle.constants.d.ts +0 -2
- package/dist/src/constants/A_ConceptLifecycle.constants.js +9 -10
- package/dist/src/constants/A_ConceptLifecycle.constants.js.map +1 -1
- package/dist/src/containers/A-Config/A-Config.container.js +1 -1
- package/dist/src/containers/A-Config/A-Config.namespace.d.ts +1 -1
- package/dist/src/containers/A-Config/A-Config.namespace.js +1 -1
- package/dist/src/containers/A-Config/A-Config.types.d.ts +1 -1
- package/dist/src/containers/A-Errors/A-Errors.container.js +1 -1
- package/dist/src/containers/A-Errors/A-Errors.namespace.d.ts +1 -1
- package/dist/src/containers/A-Errors/A-Errors.namespace.js +1 -1
- package/dist/src/containers/A-Errors/A-Errors.types.d.ts +1 -1
- package/dist/src/containers/A-Logger/A-Logger.container.js +1 -1
- package/dist/src/containers/A-Logger/A-Logger.namespace.d.ts +1 -1
- package/dist/src/containers/A-Logger/A-Logger.namespace.js +1 -1
- package/dist/src/containers/A-Logger/components/Logger.component.d.ts +1 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js.map +1 -1
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.d.ts +16 -0
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.js +36 -0
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.js.map +1 -0
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.d.ts +8 -0
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js +3 -0
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.d.ts +14 -0
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js +24 -0
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js.map +1 -0
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.d.ts +8 -0
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js +3 -0
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-Define/index.d.ts +7 -0
- package/dist/src/decorators/A-Define/index.js +10 -0
- package/dist/src/decorators/A-Define/index.js.map +1 -0
- package/dist/src/decorators/A-Extend/A-Extend.decorator.d.ts +18 -0
- package/dist/src/decorators/A-Extend/A-Extend.decorator.js +37 -0
- package/dist/src/decorators/A-Extend/A-Extend.decorator.js.map +1 -0
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.d.ts +21 -0
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js +3 -0
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js.map +1 -0
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +16 -0
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +37 -0
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -0
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.d.ts +16 -0
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js +42 -0
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +1 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +20 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.js +1 -0
- package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +12 -10
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js +16 -26
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +1 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +4 -3
- package/dist/src/decorators/A-Stage/A-Stage.decorator.d.ts +12 -0
- package/dist/src/decorators/A-Stage/A-Stage.decorator.js +35 -0
- package/dist/src/decorators/A-Stage/A-Stage.decorator.js.map +1 -0
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.d.ts +2 -0
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js +3 -0
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js.map +1 -0
- package/dist/src/global/A-Channel/A-Channel.class.d.ts +18 -0
- package/dist/src/global/A-Channel/A-Channel.class.js +54 -0
- package/dist/src/global/A-Channel/A-Channel.class.js.map +1 -0
- package/dist/src/global/A-Channel/A-Channel.types.d.ts +35 -0
- package/dist/src/global/A-Channel/A-Channel.types.js +3 -0
- package/dist/src/global/A-Channel/A-Channel.types.js.map +1 -0
- package/dist/src/global/A-Component/A-Component.class.d.ts +1 -11
- package/dist/src/global/A-Component/A-Component.class.js +0 -7
- package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.meta.d.ts +4 -0
- package/dist/src/global/A-Component/A-Component.meta.js +8 -0
- package/dist/src/global/A-Component/A-Component.meta.js.map +1 -0
- package/dist/src/global/A-Component/A-Component.types.d.ts +18 -0
- package/dist/src/global/A-Component/A-Component.types.js +10 -0
- package/dist/src/global/A-Component/A-Component.types.js.map +1 -0
- package/dist/src/global/A-Concept/A_Concept.class.d.ts +41 -17
- package/dist/src/global/A-Concept/A_Concept.class.js +120 -43
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.meta.d.ts +3 -0
- package/dist/src/global/A-Concept/A_Concept.meta.js +9 -0
- package/dist/src/global/A-Concept/A_Concept.meta.js.map +1 -0
- package/dist/src/global/A-Concept/A_Concept.types.d.ts +31 -16
- package/dist/src/global/A-Concept/A_Concept.types.js +25 -0
- package/dist/src/global/A-Concept/A_Concept.types.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.class.d.ts +72 -10
- package/dist/src/global/A-Container/A-Container.class.js +119 -9
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.meta.d.ts +7 -0
- package/dist/src/global/A-Container/A-Container.meta.js +54 -0
- package/dist/src/global/A-Container/A-Container.meta.js.map +1 -0
- package/dist/src/global/A-Container/A-Container.types.d.ts +31 -0
- package/dist/src/global/A-Container/A-Container.types.js +9 -0
- package/dist/src/global/A-Container/A-Container.types.js.map +1 -0
- package/dist/src/global/A-Context/A-Context.class.d.ts +36 -54
- package/dist/src/global/A-Context/A-Context.class.js +127 -61
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.types.d.ts +12 -0
- package/dist/src/global/A-Context/A-Context.types.js +1 -0
- package/dist/src/global/A-Context/A-ContextFragment.class.d.ts +12 -0
- package/dist/src/global/A-Context/A-ContextFragment.class.js +19 -0
- package/dist/src/global/A-Context/A-ContextFragment.class.js.map +1 -0
- package/dist/src/global/A-Dependency/A-DependencyReference.types.d.ts +0 -55
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js +56 -1
- package/dist/src/global/A-Dependency/A-DependencyReference.types.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +10 -0
- package/dist/src/global/A-Entity/A-Entity.class.js +16 -0
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -0
- package/dist/src/global/A-Entity/A-Entity.types.js +2 -0
- package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -0
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +44 -0
- package/dist/src/global/A-Feature/A-Feature.class.js +125 -0
- package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -0
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +17 -0
- package/dist/src/global/A-Feature/A-Feature.types.js +11 -0
- package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -0
- package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +38 -0
- package/dist/src/global/A-Fragment/A-Fragment.class.js +107 -0
- package/dist/src/global/A-Fragment/A-Fragment.class.js.map +1 -0
- package/dist/src/global/A-Fragment/A-Fragment.types.d.ts +3 -0
- package/dist/src/global/A-Fragment/A-Fragment.types.js +3 -0
- package/dist/src/global/A-Fragment/A-Fragment.types.js.map +1 -0
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +11 -0
- package/dist/src/global/A-Meta/A-Meta.class.js +43 -0
- package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -0
- package/dist/src/global/A-Meta/A-Meta.types.d.ts +0 -0
- package/dist/src/global/A-Meta/A-Meta.types.js +2 -0
- package/dist/src/global/A-Meta/A-Meta.types.js.map +1 -0
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +51 -0
- package/dist/src/global/A-Scope/A-Scope.class.js +133 -0
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -0
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +32 -0
- package/dist/src/global/A-Scope/A-Scope.types.js +3 -0
- package/dist/src/global/A-Scope/A-Scope.types.js.map +1 -0
- package/dist/src/storage/A_Component.storage.d.ts +10 -0
- package/dist/src/storage/A_Component.storage.js +17 -0
- package/dist/src/storage/A_Component.storage.js.map +1 -0
- package/dist/src/storage/A_Concept.storage.js +2 -2
- package/dist/src/storage/A_Concept.storage.js.map +1 -1
- package/dist/src/storage/A_Container.storage.d.ts +8 -0
- package/dist/src/storage/A_Container.storage.js +17 -0
- package/dist/src/storage/A_Container.storage.js.map +1 -0
- package/dist/src/storage/A_Inject.storage.d.ts +9 -0
- package/dist/src/storage/A_Inject.storage.js +13 -0
- package/dist/src/storage/A_Inject.storage.js.map +1 -0
- package/examples/simple/components/A.component.ts +35 -0
- package/examples/simple/components/B.component.ts +46 -0
- package/examples/simple/concept.ts +49 -12
- package/examples/simple/containers/Main.container.ts +41 -0
- package/examples/simple/context/Fragment_A.context.ts +25 -0
- package/examples/simple/context/Fragment_B.context.ts +19 -0
- package/examples/simple-http-server/components/http-error-handler.component.ts +44 -0
- package/examples/simple-http-server/components/http-request-handler.component.ts +9 -0
- package/examples/simple-http-server/concept.ts +22 -21
- package/examples/simple-http-server/containers/http-server.container.ts +23 -38
- package/examples/simple-http-server/contexts/http-request.context.ts +59 -0
- package/examples/simple-http-server/contexts/http-server.context.types.ts +0 -108
- package/examples/simple-http-server/test.ts +290 -0
- package/index.ts +55 -8
- package/jest.config.ts +2 -0
- package/package.json +4 -7
- package/src/{containers → base}/A-Config/A-Config.container.ts +21 -20
- package/src/{containers/A-Config/A-Config.namespace.ts → base/A-Config/A-Config.context.ts} +12 -5
- package/src/{containers → base}/A-Config/A-Config.types.ts +10 -4
- package/src/{containers → base}/A-Config/components/ConfigReader.component.ts +7 -3
- package/src/{containers → base}/A-Config/components/ENVConfigReader.component.ts +1 -1
- package/src/{containers → base}/A-Config/components/FileConfigReader.component.ts +1 -1
- package/src/base/A-Errors/A-Errors.component.ts +102 -0
- package/src/{containers/A-Errors/A-Errors.namespace.ts → base/A-Errors/A-Errors.context.ts} +24 -39
- package/src/{containers → base}/A-Errors/A-Errors.types.ts +2 -2
- package/src/base/A-Logger/A-Logger.component.ts +169 -0
- package/src/base/A-Logger/A-Logger.types.ts +0 -0
- package/src/constants/A_ConceptLifecycle.constants.ts +9 -9
- package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +57 -0
- package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +57 -0
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +56 -0
- package/src/decorators/A-Inject/A-Inject.decorator.ts +65 -53
- package/src/decorators/A-Inject/A-Inject.decorator.types.ts +31 -4
- package/src/decorators/A-Stage/A-Stage.decorator.ts +57 -0
- package/src/decorators/A-Stage/A-Stage.decorator.types.ts +23 -0
- package/src/global/A-Channel/A-Channel.class.ts +48 -0
- package/src/global/A-Channel/A-Channel.types.ts +60 -0
- package/src/global/A-Component/A-Component.class.ts +1 -29
- package/src/global/A-Component/A-Component.meta.ts +9 -0
- package/src/global/A-Component/A-Component.types.ts +40 -0
- package/src/global/A-Concept/A_Concept.class.ts +160 -66
- package/src/global/A-Concept/A_Concept.meta.ts +9 -0
- package/src/global/A-Concept/A_Concept.types.ts +45 -10
- package/src/global/A-Container/A-Container.class.ts +177 -22
- package/src/global/A-Container/A-Container.meta.ts +80 -0
- package/src/global/A-Container/A-Container.types.ts +40 -0
- package/src/global/A-Context/A-Context.class.ts +231 -130
- package/src/global/A-Context/A-Context.types.ts +15 -0
- package/src/global/A-Dependency/A-DependencyReference.types.ts +56 -56
- package/src/global/A-Entity/A-Entity.class.ts +16 -0
- package/src/global/A-Entity/A-Entity.types.ts +0 -0
- package/src/global/A-Feature/A-Feature.class.ts +156 -0
- package/src/global/A-Feature/A-Feature.types.ts +20 -0
- package/src/global/{A-Namespace/A_Namespace.class.ts → A-Fragment/A-Fragment.class.ts} +24 -30
- package/src/global/A-Fragment/A-Fragment.types.ts +6 -0
- package/src/global/A-Meta/A-Meta.class.ts +60 -0
- package/src/global/A-Meta/A-Meta.types.ts +0 -0
- package/src/global/A-Scope/A-Scope.class.ts +208 -0
- package/src/global/A-Scope/A-Scope.types.ts +37 -0
- package/src/storage/A_Component.storage.ts +28 -0
- package/src/storage/A_Concept.storage.ts +5 -1
- package/src/storage/A_Container.storage.ts +21 -0
- package/src/storage/A_Inject.storage.ts +30 -0
- package/tsconfig.json +3 -1
- package/examples/sdk/concept.ts +0 -24
- package/examples/sdk/orders.api.ts +0 -21
- package/examples/sdk/users.api.ts +0 -21
- package/examples/simple-http-server/containers/http-server.controller.ts +0 -24
- package/examples/simple-http-server/containers/http-server.router.ts +0 -23
- package/examples/simple-http-server/contexts/http-server.namespace.ts +0 -36
- package/src/containers/A-Errors/A-Errors.container.ts +0 -14
- package/src/containers/A-Logger/A-Logger.container.ts +0 -22
- package/src/containers/A-Logger/A-Logger.namespace.ts +0 -26
- package/src/containers/A-Logger/components/Logger.component.ts +0 -169
- package/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.ts +0 -46
- package/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.ts +0 -55
- package/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.ts +0 -20
- package/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.ts +0 -62
- package/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.ts +0 -28
- package/src/decorators/A-ConceptLifecycle/index.ts +0 -9
- package/src/decorators/A-Feature/A-Feature.decorator.ts +0 -13
- package/src/decorators/A_Lazy.decorator.ts +0 -31
- package/src/global/A-Namespace/A_Namespace.types.ts +0 -24
- /package/{src/containers/A-Logger/A-Logger.types.ts → dist/src/base/A-Logger/A-Logger.types.d.ts} +0 -0
- /package/{src/decorators/A_ConceptMethods.decorator.ts → dist/src/global/A-Entity/A-Entity.types.d.ts} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { A_TYPES__ConceptStageParams, A_TYPES__IConceptConstructor } from "./A_Concept.types";
|
|
2
|
+
import { A_Container } from "../A-Container/A-Container.class";
|
|
3
|
+
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
3
4
|
/**
|
|
4
5
|
* A_Concept is a placeholder for the concept of the ani program.
|
|
5
6
|
*
|
|
@@ -12,35 +13,58 @@ import { A_Context } from "../A-Context/A-Context.class";
|
|
|
12
13
|
*
|
|
13
14
|
*
|
|
14
15
|
*/
|
|
15
|
-
export declare class A_Concept {
|
|
16
|
+
export declare class A_Concept<_Features extends A_Container<any>[] = any> {
|
|
17
|
+
protected props: A_TYPES__IConceptConstructor<_Features>;
|
|
16
18
|
/**
|
|
17
|
-
*
|
|
19
|
+
* Load the concept. This step runs before any other steps to ensure that all components are loaded.
|
|
18
20
|
*/
|
|
19
|
-
|
|
21
|
+
static get Load(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
|
|
20
22
|
/**
|
|
21
|
-
*
|
|
23
|
+
* Publish the concept to ADAAS platform. (Or any other place defined in the concept)
|
|
24
|
+
*
|
|
25
|
+
* [!] To extend the logic just create a custom containers and override the default behavior.
|
|
22
26
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
static get Publish(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
|
|
28
|
+
/**
|
|
29
|
+
* Deploy the concept to the environment.
|
|
30
|
+
*/
|
|
31
|
+
static get Deploy(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
|
|
26
32
|
/**
|
|
27
|
-
*
|
|
33
|
+
* Compiles the Concept in case there are some containers that require that.
|
|
34
|
+
*
|
|
35
|
+
* Can be used for static websites or any other concept that requires a build step.
|
|
28
36
|
*
|
|
29
|
-
* @param cl
|
|
30
|
-
* @returns
|
|
31
37
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
38
|
+
static get Build(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Main execution of the concept.
|
|
41
|
+
*/
|
|
42
|
+
static get Run(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Start the concept. Uses for servers or any other background services.
|
|
45
|
+
*/
|
|
46
|
+
static get Start(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Stop the concept. Uses for servers or any other background services.
|
|
49
|
+
*/
|
|
50
|
+
static get Stop(): (config?: Partial<import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorConfig>) => (target: A_Container<any>, propertyKey: string, descriptor: import("../../decorators/A-Stage/A-Stage.decorator.types").A_TYPES__A_StageDecoratorDescriptor) => void;
|
|
51
|
+
protected containers: A_Container<any>[];
|
|
52
|
+
constructor(props: A_TYPES__IConceptConstructor<_Features>);
|
|
53
|
+
get namespace(): string;
|
|
34
54
|
/**
|
|
35
55
|
* Run the concept.
|
|
36
56
|
*/
|
|
37
|
-
run(params?:
|
|
57
|
+
run(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
|
|
38
58
|
/**
|
|
39
59
|
* Build the concept.
|
|
40
60
|
*/
|
|
41
|
-
build(): Promise<void>;
|
|
61
|
+
build(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
|
|
62
|
+
deploy(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
|
|
63
|
+
publish(params?: Partial<A_TYPES__ConceptStageParams>): Promise<void>;
|
|
42
64
|
/**
|
|
43
65
|
* Call the specific method of the concept or included modules.
|
|
44
66
|
*/
|
|
45
|
-
call(): Promise<void>;
|
|
67
|
+
call<K extends Record<_Features[number]['name'], _Features[number]['exports'][number]>>(container: K[keyof K], params?: A_Fragment[]): Promise<void>;
|
|
68
|
+
private runStage;
|
|
69
|
+
private execute;
|
|
46
70
|
}
|
|
@@ -10,8 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.A_Concept = void 0;
|
|
13
|
+
const A_Concept_types_1 = require("./A_Concept.types");
|
|
13
14
|
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
14
|
-
const
|
|
15
|
+
const A_Logger_component_1 = require("../../base/A-Logger/A-Logger.component");
|
|
16
|
+
const A_Container_types_1 = require("../A-Container/A-Container.types");
|
|
17
|
+
const A_Stage_decorator_1 = require("../../decorators/A-Stage/A-Stage.decorator");
|
|
18
|
+
// export type RunParams<T> = T extends A_Container<any, infer Params> ? Params : never;
|
|
15
19
|
/**
|
|
16
20
|
* A_Concept is a placeholder for the concept of the ani program.
|
|
17
21
|
*
|
|
@@ -25,29 +29,74 @@ const A_Errors_namespace_1 = require("src/containers/A-Errors/A-Errors.namespace
|
|
|
25
29
|
*
|
|
26
30
|
*/
|
|
27
31
|
class A_Concept {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
32
|
+
// ==============================================================================
|
|
33
|
+
// ==================== STATIC LIFECYCLE DECORATORS ===========================
|
|
34
|
+
// ==============================================================================
|
|
35
|
+
/**
|
|
36
|
+
* Load the concept. This step runs before any other steps to ensure that all components are loaded.
|
|
37
|
+
*/
|
|
38
|
+
static get Load() {
|
|
39
|
+
return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Load);
|
|
31
40
|
}
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Publish the concept to ADAAS platform. (Or any other place defined in the concept)
|
|
43
|
+
*
|
|
44
|
+
* [!] To extend the logic just create a custom containers and override the default behavior.
|
|
45
|
+
*/
|
|
46
|
+
static get Publish() {
|
|
47
|
+
return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Publish);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Deploy the concept to the environment.
|
|
51
|
+
*/
|
|
52
|
+
static get Deploy() {
|
|
53
|
+
return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Deploy);
|
|
34
54
|
}
|
|
35
55
|
/**
|
|
36
|
-
*
|
|
56
|
+
* Compiles the Concept in case there are some containers that require that.
|
|
57
|
+
*
|
|
58
|
+
* Can be used for static websites or any other concept that requires a build step.
|
|
37
59
|
*
|
|
38
|
-
* @param cl
|
|
39
|
-
* @returns
|
|
40
60
|
*/
|
|
41
|
-
|
|
42
|
-
return
|
|
43
|
-
? false
|
|
44
|
-
: true;
|
|
61
|
+
static get Build() {
|
|
62
|
+
return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Build);
|
|
45
63
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Main execution of the concept.
|
|
66
|
+
*/
|
|
67
|
+
static get Run() {
|
|
68
|
+
return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Run);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Start the concept. Uses for servers or any other background services.
|
|
72
|
+
*/
|
|
73
|
+
static get Start() {
|
|
74
|
+
return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Start);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Stop the concept. Uses for servers or any other background services.
|
|
78
|
+
*/
|
|
79
|
+
static get Stop() {
|
|
80
|
+
return (0, A_Stage_decorator_1.A_Stage)(A_Concept_types_1.A_TYPES__ConceptStage.Stop);
|
|
81
|
+
}
|
|
82
|
+
constructor(props) {
|
|
83
|
+
this.props = props;
|
|
84
|
+
// ==============================================================================
|
|
85
|
+
// ========================== MAIN Class ======================================
|
|
86
|
+
// ==============================================================================
|
|
87
|
+
this.containers = [];
|
|
88
|
+
A_Context_class_1.A_Context.allocate(this, {
|
|
89
|
+
name: props.name,
|
|
90
|
+
fragments: props.fragments || [],
|
|
91
|
+
// containers: props.containers
|
|
92
|
+
components: [
|
|
93
|
+
A_Logger_component_1.A_Logger,
|
|
94
|
+
]
|
|
50
95
|
});
|
|
96
|
+
this.containers = props.containers || [];
|
|
97
|
+
}
|
|
98
|
+
get namespace() {
|
|
99
|
+
return A_Context_class_1.A_Context.scope(this).name;
|
|
51
100
|
}
|
|
52
101
|
// =======================================================================
|
|
53
102
|
// ========================== LIFECYCLE ================================
|
|
@@ -55,50 +104,78 @@ class A_Concept {
|
|
|
55
104
|
/**
|
|
56
105
|
* Run the concept.
|
|
57
106
|
*/
|
|
58
|
-
run() {
|
|
59
|
-
return __awaiter(this,
|
|
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);
|
|
107
|
+
run(params) {
|
|
108
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
66
109
|
});
|
|
67
110
|
}
|
|
68
111
|
/**
|
|
69
112
|
* Build the concept.
|
|
70
113
|
*/
|
|
71
|
-
build() {
|
|
114
|
+
build(params) {
|
|
72
115
|
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
116
|
});
|
|
78
117
|
}
|
|
79
118
|
// /**
|
|
80
119
|
// * Deploy the concept.
|
|
81
120
|
// */
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
121
|
+
deploy(params) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
});
|
|
124
|
+
}
|
|
86
125
|
// /**
|
|
87
126
|
// * Publish the concept.
|
|
88
127
|
// */
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
128
|
+
publish(params) {
|
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
130
|
+
});
|
|
131
|
+
}
|
|
93
132
|
/**
|
|
94
133
|
* Call the specific method of the concept or included modules.
|
|
95
134
|
*/
|
|
96
|
-
call() {
|
|
135
|
+
call(container, params) {
|
|
136
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
+
// for (const feature of this.features) {
|
|
138
|
+
// if (methodName in feature) {
|
|
139
|
+
// (feature as any)[methodName](...args);
|
|
140
|
+
// }
|
|
141
|
+
// }
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
runStage(method, params) {
|
|
145
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
146
|
+
const stages = [];
|
|
147
|
+
this.containers.map(container => {
|
|
148
|
+
const meta = A_Context_class_1.A_Context.meta(container);
|
|
149
|
+
const containerStages = meta.get(A_Container_types_1.A_TYPES__ContainerMetaKey.STAGES);
|
|
150
|
+
if (containerStages) {
|
|
151
|
+
for (const [name, stage] of containerStages) {
|
|
152
|
+
if (stage.name === method) {
|
|
153
|
+
stages.push({
|
|
154
|
+
name,
|
|
155
|
+
container,
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
const scope = A_Context_class_1.A_Context.allocate(this, {
|
|
162
|
+
components: params.components,
|
|
163
|
+
fragments: params.fragments,
|
|
164
|
+
parent: A_Context_class_1.A_Context.scope(this)
|
|
165
|
+
});
|
|
166
|
+
for (const stage of stages) {
|
|
167
|
+
yield stage.container[stage.name](params);
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
execute(params) {
|
|
97
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
-
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
173
|
+
const fragments = params.fragments || [];
|
|
174
|
+
const component = params.components || [];
|
|
175
|
+
this.containers.map(container => {
|
|
176
|
+
const meta = A_Context_class_1.A_Context.meta(container);
|
|
177
|
+
meta.get(A_Container_types_1.A_TYPES__ContainerMetaKey.FEATURES);
|
|
178
|
+
});
|
|
102
179
|
});
|
|
103
180
|
}
|
|
104
181
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"A_Concept.class.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.class.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_ConceptMeta = void 0;
|
|
4
|
+
const A_Meta_class_1 = require("../A-Meta/A-Meta.class");
|
|
5
|
+
// import { A_TYPES__ComponentMeta } from "./A-Component.types";
|
|
6
|
+
class A_ConceptMeta extends A_Meta_class_1.A_Meta {
|
|
7
|
+
}
|
|
8
|
+
exports.A_ConceptMeta = A_ConceptMeta;
|
|
9
|
+
//# sourceMappingURL=A_Concept.meta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A_Concept.meta.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.meta.ts"],"names":[],"mappings":";;;AAAA,yDAAgD;AAChD,gEAAgE;AAGhE,MAAa,aAAc,SAAQ,qBAAW;CAI7C;AAJD,sCAIC"}
|
|
@@ -1,26 +1,41 @@
|
|
|
1
|
-
import { A_Concept } from "./A_Concept.class";
|
|
2
|
-
import { A_Namespace } from "../A-Namespace/A_Namespace.class";
|
|
3
1
|
import { A_Container } from "../A-Container/A-Container.class";
|
|
4
|
-
|
|
2
|
+
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
3
|
+
export declare enum A_TYPES__ConceptStage {
|
|
4
|
+
Run = "run",
|
|
5
|
+
Build = "build",
|
|
6
|
+
Publish = "publish",
|
|
7
|
+
Deploy = "deploy",
|
|
8
|
+
Load = "load",
|
|
9
|
+
Start = "start",
|
|
10
|
+
Stop = "stop"
|
|
11
|
+
}
|
|
12
|
+
export declare enum A_TYPES__ConceptMetaKey {
|
|
13
|
+
LIFECYCLE = "a-component-extensions"
|
|
14
|
+
}
|
|
15
|
+
export interface A_TYPES__IConceptConstructor<T extends Array<A_Container<any>>> {
|
|
5
16
|
name: string;
|
|
6
|
-
description?: string;
|
|
7
17
|
/**
|
|
8
|
-
* A set of
|
|
9
|
-
* These
|
|
18
|
+
* A set of Context Fragments to register globally for the concept.
|
|
19
|
+
* These fragments will be available in the global context.
|
|
10
20
|
*
|
|
11
21
|
*/
|
|
12
|
-
|
|
22
|
+
fragments?: Array<A_Fragment>;
|
|
13
23
|
/**
|
|
14
24
|
* A set of Containers that the concept depends on.
|
|
15
25
|
* These containers will create a new Container for the concept.
|
|
16
26
|
*/
|
|
17
|
-
containers?:
|
|
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>;
|
|
27
|
+
containers?: T;
|
|
25
28
|
}
|
|
26
|
-
export type
|
|
29
|
+
export type A_TYPES__ConceptStageParams = {
|
|
30
|
+
fragments: Array<A_Fragment>;
|
|
31
|
+
components: Array<{
|
|
32
|
+
new (...args: any[]): any;
|
|
33
|
+
}>;
|
|
34
|
+
};
|
|
35
|
+
export type A_TYPES__ConceptCallParams<T extends string> = {
|
|
36
|
+
name: T;
|
|
37
|
+
fragments: Array<A_Fragment>;
|
|
38
|
+
components: Array<{
|
|
39
|
+
new (...args: any[]): any;
|
|
40
|
+
}>;
|
|
41
|
+
};
|
|
@@ -1,3 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_TYPES__ConceptMetaKey = exports.A_TYPES__ConceptStage = void 0;
|
|
4
|
+
var A_TYPES__ConceptStage;
|
|
5
|
+
(function (A_TYPES__ConceptStage) {
|
|
6
|
+
A_TYPES__ConceptStage["Run"] = "run";
|
|
7
|
+
A_TYPES__ConceptStage["Build"] = "build";
|
|
8
|
+
A_TYPES__ConceptStage["Publish"] = "publish";
|
|
9
|
+
A_TYPES__ConceptStage["Deploy"] = "deploy";
|
|
10
|
+
A_TYPES__ConceptStage["Load"] = "load";
|
|
11
|
+
A_TYPES__ConceptStage["Start"] = "start";
|
|
12
|
+
A_TYPES__ConceptStage["Stop"] = "stop";
|
|
13
|
+
})(A_TYPES__ConceptStage || (exports.A_TYPES__ConceptStage = A_TYPES__ConceptStage = {}));
|
|
14
|
+
// export type A_TYPES__ConceptMeta = {
|
|
15
|
+
// [A_TYPES__ConceptMetaKey.EXTENSIONS]: Map<string, A_TYPES__ConceptMeta_ExtensionItem>,
|
|
16
|
+
// [A_TYPES__ConceptMetaKey.FEATURES]: any[],
|
|
17
|
+
// // [A_TYPES__ConceptMetaKey.INJECTIONS]: Map<
|
|
18
|
+
// // // Where key is method name
|
|
19
|
+
// // Symbol | string,
|
|
20
|
+
// // // And value is Injection instructions
|
|
21
|
+
// // A_TYPES__ConceptMeta_InjectionParams
|
|
22
|
+
// // >
|
|
23
|
+
// }
|
|
24
|
+
var A_TYPES__ConceptMetaKey;
|
|
25
|
+
(function (A_TYPES__ConceptMetaKey) {
|
|
26
|
+
A_TYPES__ConceptMetaKey["LIFECYCLE"] = "a-component-extensions";
|
|
27
|
+
})(A_TYPES__ConceptMetaKey || (exports.A_TYPES__ConceptMetaKey = A_TYPES__ConceptMetaKey = {}));
|
|
3
28
|
//# sourceMappingURL=A_Concept.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A_Concept.types.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"A_Concept.types.js","sourceRoot":"","sources":["../../../../src/global/A-Concept/A_Concept.types.ts"],"names":[],"mappings":";;;AAIA,IAAY,qBAQX;AARD,WAAY,qBAAqB;IAC7B,oCAAW,CAAA;IACX,wCAAe,CAAA;IACf,4CAAmB,CAAA;IACnB,0CAAiB,CAAA;IACjB,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,sCAAa,CAAA;AACjB,CAAC,EARW,qBAAqB,qCAArB,qBAAqB,QAQhC;AAGD,uCAAuC;AACvC,6FAA6F;AAC7F,iDAAiD;AACjD,oDAAoD;AACpD,yCAAyC;AACzC,8BAA8B;AAC9B,oDAAoD;AACpD,kDAAkD;AAClD,WAAW;AAEX,IAAI;AAEJ,IAAY,uBAEX;AAFD,WAAY,uBAAuB;IAC/B,+DAAoC,CAAA;AACxC,CAAC,EAFW,uBAAuB,uCAAvB,uBAAuB,QAElC"}
|
|
@@ -1,14 +1,76 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A_TYPES__ContainerCallParams, A_TYPES__ContainerConstructor } from "./A-Container.types";
|
|
2
|
+
import { A_TYPES__Required } from "@adaas/a-utils";
|
|
3
|
+
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
2
4
|
/**
|
|
3
|
-
* This class should combine Components to achieve the goal withing
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* -
|
|
8
|
-
* -
|
|
5
|
+
* This class should combine Components to achieve the goal withing Concept
|
|
6
|
+
*
|
|
7
|
+
* Container is a direct container that should be "run" to make Concept work.
|
|
8
|
+
* So because of that Container can be:
|
|
9
|
+
* - HTTP Server
|
|
10
|
+
* - BASH Script
|
|
11
|
+
* - Database Connection
|
|
12
|
+
* - Microservice
|
|
9
13
|
* - etc.
|
|
10
14
|
*/
|
|
11
|
-
export declare class A_Container<
|
|
12
|
-
protected readonly
|
|
13
|
-
|
|
15
|
+
export declare class A_Container<_FeatureNames extends Array<string>> {
|
|
16
|
+
protected readonly config: Partial<A_TYPES__ContainerConstructor<_FeatureNames>>;
|
|
17
|
+
/**
|
|
18
|
+
* Promise that will be resolved when the container is ready to be used.
|
|
19
|
+
*/
|
|
20
|
+
ready: Promise<void>;
|
|
21
|
+
get exports(): _FeatureNames;
|
|
22
|
+
get name(): string;
|
|
23
|
+
constructor(
|
|
24
|
+
/**
|
|
25
|
+
* Configuration of the container that will be used to run it.
|
|
26
|
+
*/
|
|
27
|
+
config: Partial<A_TYPES__ContainerConstructor<_FeatureNames>>);
|
|
28
|
+
protected hasInherited(cl: {
|
|
29
|
+
new (...args: any[]): any;
|
|
30
|
+
}): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Initializes the Namespace or can be used to reinitialize the Namespace
|
|
33
|
+
*/
|
|
34
|
+
private init;
|
|
35
|
+
/**
|
|
36
|
+
* This method allows to call the lifecycle method of the container as well as any other Feature defined for it
|
|
37
|
+
*
|
|
38
|
+
* @param lifecycleMethod
|
|
39
|
+
* @param args
|
|
40
|
+
*/
|
|
41
|
+
call(
|
|
42
|
+
/**
|
|
43
|
+
* A-Feature method name to be called
|
|
44
|
+
*/
|
|
45
|
+
feature: _FeatureNames[number]): A_Feature;
|
|
46
|
+
call(
|
|
47
|
+
/**
|
|
48
|
+
* A-Feature name to be called
|
|
49
|
+
*/
|
|
50
|
+
params: A_TYPES__Required<Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>, ['name']>): A_Feature;
|
|
51
|
+
call(
|
|
52
|
+
/**
|
|
53
|
+
* A-Feature method name to be called
|
|
54
|
+
*/
|
|
55
|
+
feature: _FeatureNames[number],
|
|
56
|
+
/**
|
|
57
|
+
* Parameters to provide additional data to the feature
|
|
58
|
+
*/
|
|
59
|
+
params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>): A_Feature;
|
|
60
|
+
/**
|
|
61
|
+
* Before init hook to be used in inherited classes
|
|
62
|
+
*
|
|
63
|
+
* @returns
|
|
64
|
+
*/
|
|
65
|
+
protected onBeforeInit(): Promise<void>;
|
|
66
|
+
/**
|
|
67
|
+
* Main initialization method for the Container
|
|
68
|
+
*/
|
|
69
|
+
protected onInit(): Promise<void>;
|
|
70
|
+
/**
|
|
71
|
+
* After init hook to be used in inherited classes
|
|
72
|
+
*
|
|
73
|
+
* @returns
|
|
74
|
+
*/
|
|
75
|
+
protected onAfterInit(): Promise<void>;
|
|
14
76
|
}
|
|
@@ -1,20 +1,130 @@
|
|
|
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_Container = void 0;
|
|
13
|
+
const A_Feature_class_1 = require("../A-Feature/A-Feature.class");
|
|
14
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
4
15
|
/**
|
|
5
|
-
* This class should combine Components to achieve the goal withing
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* -
|
|
10
|
-
* -
|
|
16
|
+
* This class should combine Components to achieve the goal withing Concept
|
|
17
|
+
*
|
|
18
|
+
* Container is a direct container that should be "run" to make Concept work.
|
|
19
|
+
* So because of that Container can be:
|
|
20
|
+
* - HTTP Server
|
|
21
|
+
* - BASH Script
|
|
22
|
+
* - Database Connection
|
|
23
|
+
* - Microservice
|
|
11
24
|
* - etc.
|
|
12
25
|
*/
|
|
13
26
|
class A_Container {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
27
|
+
get exports() {
|
|
28
|
+
return this.config.exports || [];
|
|
29
|
+
}
|
|
30
|
+
get name() {
|
|
31
|
+
return this.config.name || this.constructor.name;
|
|
32
|
+
}
|
|
33
|
+
constructor(
|
|
34
|
+
/**
|
|
35
|
+
* Configuration of the container that will be used to run it.
|
|
36
|
+
*/
|
|
37
|
+
config) {
|
|
38
|
+
this.config = config;
|
|
39
|
+
const components = config.components || [];
|
|
40
|
+
const fragments = config.fragments || [];
|
|
41
|
+
A_Context_class_1.A_Context.allocate(this, {
|
|
42
|
+
components,
|
|
43
|
+
fragments
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* Run Async Initialization
|
|
47
|
+
*/
|
|
48
|
+
this.init();
|
|
49
|
+
}
|
|
50
|
+
hasInherited(cl) {
|
|
51
|
+
return this.constructor === cl
|
|
52
|
+
? false
|
|
53
|
+
: true;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Initializes the Namespace or can be used to reinitialize the Namespace
|
|
57
|
+
*/
|
|
58
|
+
init() {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
if (!this.ready)
|
|
61
|
+
this.ready = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
try {
|
|
63
|
+
yield this.onBeforeInit();
|
|
64
|
+
yield this.onInit();
|
|
65
|
+
yield this.onAfterInit();
|
|
66
|
+
return resolve();
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return reject(error);
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
else
|
|
73
|
+
yield this.ready;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
call(param1, param2) {
|
|
77
|
+
let feature;
|
|
78
|
+
let params;
|
|
79
|
+
if (typeof param1 === 'string') {
|
|
80
|
+
feature = param1;
|
|
81
|
+
params = param2 || {};
|
|
17
82
|
}
|
|
83
|
+
else {
|
|
84
|
+
feature = param1.name;
|
|
85
|
+
params = param1;
|
|
86
|
+
}
|
|
87
|
+
const meta = A_Context_class_1.A_Context.meta(this);
|
|
88
|
+
const steps = meta.feature(this, feature);
|
|
89
|
+
const newFeature = new A_Feature_class_1.A_Feature({
|
|
90
|
+
name: `${this.constructor.name}.${feature}`,
|
|
91
|
+
fragments: (param2 === null || param2 === void 0 ? void 0 : param2.fragments) || [],
|
|
92
|
+
components: (param2 === null || param2 === void 0 ? void 0 : param2.components) || [],
|
|
93
|
+
steps,
|
|
94
|
+
parent: A_Context_class_1.A_Context.scope(this)
|
|
95
|
+
});
|
|
96
|
+
return newFeature;
|
|
97
|
+
}
|
|
98
|
+
// ==============================================================
|
|
99
|
+
// ======================= HOOKS ================================
|
|
100
|
+
// ==============================================================
|
|
101
|
+
/**
|
|
102
|
+
* Before init hook to be used in inherited classes
|
|
103
|
+
*
|
|
104
|
+
* @returns
|
|
105
|
+
*/
|
|
106
|
+
onBeforeInit() {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
return;
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Main initialization method for the Container
|
|
113
|
+
*/
|
|
114
|
+
onInit() {
|
|
115
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
116
|
+
return;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* After init hook to be used in inherited classes
|
|
121
|
+
*
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
onAfterInit() {
|
|
125
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
126
|
+
return;
|
|
127
|
+
});
|
|
18
128
|
}
|
|
19
129
|
}
|
|
20
130
|
exports.A_Container = A_Container;
|