@adaas/a-concept 0.0.3 → 0.0.5
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 +71 -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 +27 -19
- package/dist/index.js +58 -26
- 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 +16 -0
- package/dist/src/base/A-Config/A-Config.types.js +7 -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 +37 -54
- package/dist/src/global/A-Context/A-Context.class.js +129 -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.class.d.ts +0 -17
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js +47 -65
- package/dist/src/global/A-Dependency/A-DependencyReference.class.js.map +1 -1
- 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 +57 -0
- package/dist/src/global/A-Entity/A-Entity.class.js +102 -0
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -0
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +13 -0
- package/dist/src/global/A-Entity/A-Entity.types.js +4 -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 +16 -0
- package/dist/src/global/A-Meta/A-Meta.class.js +69 -0
- package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -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 +135 -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 +47 -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 +53 -22
- package/jest.config.ts +1 -3
- 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 +15 -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 +64 -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 +172 -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 +233 -130
- package/src/global/A-Context/A-Context.types.ts +15 -0
- package/src/global/A-Dependency/A-DependencyReference.class.ts +61 -61
- package/src/global/A-Dependency/A-DependencyReference.types.ts +56 -56
- package/src/global/A-Entity/A-Entity.class.ts +141 -0
- package/src/global/A-Entity/A-Entity.types.ts +17 -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 +96 -0
- package/src/global/A-Meta/A-Meta.types.ts +0 -0
- package/src/global/A-Scope/A-Scope.class.ts +211 -0
- package/src/global/A-Scope/A-Scope.types.ts +37 -0
- package/tsconfig.json +1 -3
- 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/storage/A_Concept.storage.ts +0 -45
- /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-Meta/A-Meta.types.d.ts} +0 -0
|
@@ -0,0 +1,125 @@
|
|
|
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_Feature = void 0;
|
|
13
|
+
const A_Feature_Define_decorator_1 = require("../../decorators/A-Feature/A-Feature-Define.decorator");
|
|
14
|
+
const A_Feature_Extend_decorator_1 = require("../../decorators/A-Feature/A-Feature-Extend.decorator");
|
|
15
|
+
const A_Feature_types_1 = require("./A-Feature.types");
|
|
16
|
+
const a_utils_1 = require("@adaas/a-utils");
|
|
17
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
18
|
+
/**
|
|
19
|
+
* A_Feature is representing a feature that can be executed across multiple components
|
|
20
|
+
* This class stores the steps of the feature and executes them in order of appearance
|
|
21
|
+
*
|
|
22
|
+
* Using A_Feature.Define and A_Feature.Extend decorators to define and extend the feature methods
|
|
23
|
+
* across the different, distributed components
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
class A_Feature {
|
|
27
|
+
/**
|
|
28
|
+
* Define a new A-Feature
|
|
29
|
+
*/
|
|
30
|
+
static get Define() {
|
|
31
|
+
return A_Feature_Define_decorator_1.A_Feature_Define;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Extend an existing A-Feature
|
|
35
|
+
*/
|
|
36
|
+
static get Extend() {
|
|
37
|
+
return A_Feature_Extend_decorator_1.A_Feature_Extend;
|
|
38
|
+
}
|
|
39
|
+
constructor(params) {
|
|
40
|
+
// protected scope: A_Scope
|
|
41
|
+
this.steps = [];
|
|
42
|
+
this.state = A_Feature_types_1.A_TYPES__FeatureState.INITIALIZED;
|
|
43
|
+
// this.scope = params.scope;
|
|
44
|
+
this.steps = params.steps;
|
|
45
|
+
A_Context_class_1.A_Context.allocate(this, params);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* This method marks the feature as completed and returns the result
|
|
49
|
+
* Uses to interrupt or end the feature processing
|
|
50
|
+
*
|
|
51
|
+
* @param result
|
|
52
|
+
* @returns
|
|
53
|
+
*/
|
|
54
|
+
completed(...result) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
this.result = result;
|
|
57
|
+
this.state = A_Feature_types_1.A_TYPES__FeatureState.COMPLETED;
|
|
58
|
+
return this.result;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* This method marks the feature as failed and throws an error
|
|
63
|
+
* Uses to interrupt or end the feature processing
|
|
64
|
+
*
|
|
65
|
+
* @param error
|
|
66
|
+
*/
|
|
67
|
+
failed(error) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
this.error = error;
|
|
70
|
+
this.state = A_Feature_types_1.A_TYPES__FeatureState.FAILED;
|
|
71
|
+
yield this.errorHandler(error);
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
process() {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
try {
|
|
77
|
+
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
|
+
}
|
|
89
|
+
}
|
|
90
|
+
yield this.completed();
|
|
91
|
+
}
|
|
92
|
+
catch (error) {
|
|
93
|
+
console.log('Feature processing error:', error);
|
|
94
|
+
yield this.failed(error);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
errorHandler(error) {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
switch (true) {
|
|
101
|
+
case error instanceof a_utils_1.A_Error:
|
|
102
|
+
throw error;
|
|
103
|
+
case error instanceof Error
|
|
104
|
+
&& error.message === 'FEATURE_PROCESSING_INTERRUPTED'
|
|
105
|
+
&& this.state === A_Feature_types_1.A_TYPES__FeatureState.FAILED:
|
|
106
|
+
throw new a_utils_1.A_Error({
|
|
107
|
+
message: 'FEATURE_PROCESSING_INTERRUPTED',
|
|
108
|
+
code: 'FEATURE_PROCESSING_INTERRUPTED',
|
|
109
|
+
data: {
|
|
110
|
+
feature: this
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
case error instanceof Error
|
|
114
|
+
&& error.message === 'FEATURE_PROCESSING_INTERRUPTED'
|
|
115
|
+
&& this.state === A_Feature_types_1.A_TYPES__FeatureState.COMPLETED:
|
|
116
|
+
// Do nothing
|
|
117
|
+
break;
|
|
118
|
+
default:
|
|
119
|
+
throw error;
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
exports.A_Feature = A_Feature;
|
|
125
|
+
//# sourceMappingURL=A-Feature.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Feature.class.js","sourceRoot":"","sources":["../../../../src/global/A-Feature/A-Feature.class.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iHAAoG;AACpG,iHAAoG;AACpG,uDAA6G;AAE7G,4CAA4D;AAC5D,kEAAyD;AAIzD;;;;;;;GAOG;AACH,MAAa,SAAS;IAGlB;;OAEG;IACH,MAAM,KAAK,MAAM;QACb,OAAO,6CAAgB,CAAC;IAC5B,CAAC;IAGD;;OAE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
3
|
+
steps: A_TYPES__FeatureStep[];
|
|
4
|
+
} & A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig;
|
|
5
|
+
export declare enum A_TYPES__FeatureState {
|
|
6
|
+
INITIALIZED = "INITIALIZED",
|
|
7
|
+
PROCESSING = "PROCESSING",
|
|
8
|
+
COMPLETED = "COMPLETED",
|
|
9
|
+
FAILED = "FAILED"
|
|
10
|
+
}
|
|
11
|
+
export type A_TYPES__FeatureStep = {
|
|
12
|
+
component: {
|
|
13
|
+
new (...args: any[]): any;
|
|
14
|
+
};
|
|
15
|
+
handler: string;
|
|
16
|
+
args: any[];
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_TYPES__FeatureState = void 0;
|
|
4
|
+
var A_TYPES__FeatureState;
|
|
5
|
+
(function (A_TYPES__FeatureState) {
|
|
6
|
+
A_TYPES__FeatureState["INITIALIZED"] = "INITIALIZED";
|
|
7
|
+
A_TYPES__FeatureState["PROCESSING"] = "PROCESSING";
|
|
8
|
+
A_TYPES__FeatureState["COMPLETED"] = "COMPLETED";
|
|
9
|
+
A_TYPES__FeatureState["FAILED"] = "FAILED";
|
|
10
|
+
})(A_TYPES__FeatureState || (exports.A_TYPES__FeatureState = A_TYPES__FeatureState = {}));
|
|
11
|
+
//# sourceMappingURL=A-Feature.types.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { A_TYPES__FragmentConstructor } from "./A-Fragment.types";
|
|
2
|
+
/**
|
|
3
|
+
* A-Fragment = Context Fragments is a set of arguments that can be used to define a Context for the pipeline.
|
|
4
|
+
* In other words it is a dynamic context that will be created on pipeline start and destroyed on pipeline end.
|
|
5
|
+
* During the execution of the pipeline, the Context Fragments can be used to pass the data between the pipeline steps.
|
|
6
|
+
*
|
|
7
|
+
* Or to store the data that is required for the pipeline execution
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
export declare class A_Fragment {
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* Indicates that Context Fragment is ready to use
|
|
14
|
+
*/
|
|
15
|
+
ready: Promise<void>;
|
|
16
|
+
constructor(params?: Partial<A_TYPES__FragmentConstructor>);
|
|
17
|
+
private hasInherited;
|
|
18
|
+
/**
|
|
19
|
+
* Initializes the Namespace or can be used to reinitialize the Namespace
|
|
20
|
+
*/
|
|
21
|
+
private init;
|
|
22
|
+
/**
|
|
23
|
+
* Before init hook to be used in inherited classes
|
|
24
|
+
*
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
protected onBeforeInit(): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Main initialization method for the SDK
|
|
30
|
+
*/
|
|
31
|
+
protected onInit(): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* After init hook to be used in inherited classes
|
|
34
|
+
*
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
protected onAfterInit(): Promise<void>;
|
|
38
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
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_Fragment = void 0;
|
|
13
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
14
|
+
/**
|
|
15
|
+
* A-Fragment = Context Fragments is a set of arguments that can be used to define a Context for the pipeline.
|
|
16
|
+
* In other words it is a dynamic context that will be created on pipeline start and destroyed on pipeline end.
|
|
17
|
+
* During the execution of the pipeline, the Context Fragments can be used to pass the data between the pipeline steps.
|
|
18
|
+
*
|
|
19
|
+
* Or to store the data that is required for the pipeline execution
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
class A_Fragment {
|
|
23
|
+
constructor(params = {}) {
|
|
24
|
+
this.name = params.name || this.constructor.name;
|
|
25
|
+
/**
|
|
26
|
+
* Register the Namespace in the global Namespace provider
|
|
27
|
+
*/
|
|
28
|
+
this.name = A_Context_class_1.A_Context
|
|
29
|
+
.register(this, this.name);
|
|
30
|
+
/**
|
|
31
|
+
* Run Async Initialization
|
|
32
|
+
*/
|
|
33
|
+
this.init();
|
|
34
|
+
}
|
|
35
|
+
hasInherited(cl) {
|
|
36
|
+
return this.constructor === cl
|
|
37
|
+
? false
|
|
38
|
+
: true;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Initializes the Namespace or can be used to reinitialize the Namespace
|
|
42
|
+
*/
|
|
43
|
+
init() {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
if (!this.ready)
|
|
46
|
+
this.ready = new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
try {
|
|
48
|
+
yield this.onBeforeInit();
|
|
49
|
+
yield this.onInit();
|
|
50
|
+
yield this.onAfterInit();
|
|
51
|
+
return resolve();
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
return reject(error);
|
|
55
|
+
}
|
|
56
|
+
}));
|
|
57
|
+
else
|
|
58
|
+
yield this.ready;
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// ==============================================================
|
|
62
|
+
// ======================= HOOKS ================================
|
|
63
|
+
// ==============================================================
|
|
64
|
+
/**
|
|
65
|
+
* Before init hook to be used in inherited classes
|
|
66
|
+
*
|
|
67
|
+
* @returns
|
|
68
|
+
*/
|
|
69
|
+
onBeforeInit() {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
return;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Main initialization method for the SDK
|
|
76
|
+
*/
|
|
77
|
+
onInit() {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
// global logger configuration
|
|
80
|
+
if (A_Context_class_1.A_Context.environment === 'server' && !this.hasInherited(A_Fragment)) {
|
|
81
|
+
// eslint-disable-next-line no-use-before-define
|
|
82
|
+
// process.on('uncaughtException', (error) => {
|
|
83
|
+
// // log only in case of A_AUTH_Error
|
|
84
|
+
// if (error instanceof A_Error)
|
|
85
|
+
// this.Logger.error(error);
|
|
86
|
+
// });
|
|
87
|
+
// // eslint-disable-next-line no-use-before-define
|
|
88
|
+
// process.on('unhandledRejection', (error) => {
|
|
89
|
+
// if (error instanceof A_Error)
|
|
90
|
+
// this.Logger.error(error);
|
|
91
|
+
// });
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* After init hook to be used in inherited classes
|
|
97
|
+
*
|
|
98
|
+
* @returns
|
|
99
|
+
*/
|
|
100
|
+
onAfterInit() {
|
|
101
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
return;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.A_Fragment = A_Fragment;
|
|
107
|
+
//# sourceMappingURL=A-Fragment.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,2BAAS;aAChB,QAAQ,CACL,IAAI,EACJ,IAAI,CAAC,IAAI,CACZ,CAAC;QAEN;;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;oBAAC,OAAO,KAAK,EAAE,CAAC;wBACb,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC;oBACzB,CAAC;gBACL,CAAC,CAAA,CAAC,CAAC;;gBAEH,MAAM,IAAI,CAAC,KAAK,CAAC;QACzB,CAAC;KAAA;IAQD,iEAAiE;IACjE,iEAAiE;IACjE,iEAAiE;IAEjE;;;;OAIG;IACa,YAAY;;YACxB,OAAO;QACX,CAAC;KAAA;IAED;;OAEG;IACa,MAAM;;YAClB,8BAA8B;YAC9B,IAAI,2BAAS,CAAC,WAAW,KAAK,QAAQ,IAAI,CAAC,IAAI,CAAC,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Fragment.types.js","sourceRoot":"","sources":["../../../../src/global/A-Fragment/A-Fragment.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
|
|
3
|
+
*
|
|
4
|
+
* [!] Meta can be different depending on the type of input data
|
|
5
|
+
*/
|
|
6
|
+
export declare class A_Meta<_StorageItems extends Record<string, any>> {
|
|
7
|
+
protected meta: Map<keyof _StorageItems, _StorageItems[keyof _StorageItems]>;
|
|
8
|
+
from(meta: A_Meta<_StorageItems>): A_Meta<_StorageItems>;
|
|
9
|
+
set<K extends keyof _StorageItems>(key: K, value: _StorageItems[K]): void;
|
|
10
|
+
get<K extends keyof _StorageItems>(key: K): _StorageItems[K] | undefined;
|
|
11
|
+
delete(key: keyof _StorageItems): boolean;
|
|
12
|
+
findByRegex(regex: RegExp): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
|
|
13
|
+
has(key: keyof _StorageItems): boolean;
|
|
14
|
+
entries(): IterableIterator<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]>;
|
|
15
|
+
clear(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Meta = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
|
|
6
|
+
*
|
|
7
|
+
* [!] Meta can be different depending on the type of input data
|
|
8
|
+
*/
|
|
9
|
+
class A_Meta {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.meta = new Map();
|
|
12
|
+
}
|
|
13
|
+
from(meta) {
|
|
14
|
+
this.meta = new Map(meta.meta);
|
|
15
|
+
return this;
|
|
16
|
+
}
|
|
17
|
+
// ===================================================================================================
|
|
18
|
+
// ================================ META OPERATIONS ==================================================
|
|
19
|
+
// ===================================================================================================
|
|
20
|
+
// Method to set values in the map
|
|
21
|
+
set(key, value) {
|
|
22
|
+
const inheritedValue = this.meta.get(key)
|
|
23
|
+
|| Array.isArray(value)
|
|
24
|
+
? []
|
|
25
|
+
: value instanceof Map
|
|
26
|
+
? new Map()
|
|
27
|
+
: {};
|
|
28
|
+
const targetValue = this.meta.get(key)
|
|
29
|
+
|| Array.isArray(value)
|
|
30
|
+
? [
|
|
31
|
+
...inheritedValue
|
|
32
|
+
] : value instanceof Map
|
|
33
|
+
? new Map(inheritedValue)
|
|
34
|
+
: Object.assign({}, inheritedValue);
|
|
35
|
+
this.meta.set(key, value);
|
|
36
|
+
}
|
|
37
|
+
// Method to get values from the map
|
|
38
|
+
get(key) {
|
|
39
|
+
return this.meta.get(key);
|
|
40
|
+
}
|
|
41
|
+
// Delete a key-value pair by key
|
|
42
|
+
delete(key) {
|
|
43
|
+
return this.meta.delete(key);
|
|
44
|
+
}
|
|
45
|
+
// Search for keys by regex
|
|
46
|
+
findByRegex(regex) {
|
|
47
|
+
const results = [];
|
|
48
|
+
for (const [key, value] of this.meta.entries()) {
|
|
49
|
+
if (regex.test(String(key))) {
|
|
50
|
+
results.push([key, value]);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return results;
|
|
54
|
+
}
|
|
55
|
+
// Check if a key exists
|
|
56
|
+
has(key) {
|
|
57
|
+
return this.meta.has(key);
|
|
58
|
+
}
|
|
59
|
+
// Get all entries in the map
|
|
60
|
+
entries() {
|
|
61
|
+
return this.meta.entries();
|
|
62
|
+
}
|
|
63
|
+
// Clear all entries
|
|
64
|
+
clear() {
|
|
65
|
+
this.meta.clear();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.A_Meta = A_Meta;
|
|
69
|
+
//# sourceMappingURL=A-Meta.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Meta.class.js","sourceRoot":"","sources":["../../../../src/global/A-Meta/A-Meta.class.ts"],"names":[],"mappings":";;;AAMA;;;;GAIG;AACH,MAAa,MAAM;IAAnB;QAKc,SAAI,GAAiE,IAAI,GAAG,EAAE,CAAC;IA6E7F,CAAC;IA1EG,IAAI,CACA,IAA2B;QAE3B,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/B,OAAO,IAAI,CAAC;IAChB,CAAC;IAGD,sGAAsG;IACtG,sGAAsG;IACtG,sGAAsG;IAEtG,kCAAkC;IAClC,GAAG,CAAgC,GAAM,EAAE,KAAuB;QAE9D,MAAM,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;eAClC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACvB,CAAC,CAAC,EAAE;YACJ,CAAC,CAAE,KAAa,YAAY,GAAG;gBAC3B,CAAC,CAAC,IAAI,GAAG,EAAE;gBACX,CAAC,CAAC,EAAE,CAAC;QACb,MAAM,WAAW,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;eAC/B,KAAK,CAAC,OAAO,CAA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 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Meta.types.js","sourceRoot":"","sources":["../../../../src/global/A-Meta/A-Meta.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "./A-Scope.types";
|
|
2
|
+
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
* A_Scope refers to the visibility and accessibility of :
|
|
7
|
+
* - variables,
|
|
8
|
+
* - Components,
|
|
9
|
+
* - Context Fragments
|
|
10
|
+
* - and objects in different parts of your code.
|
|
11
|
+
* Scope determines where a particular piece of data (like a variable or function)
|
|
12
|
+
* can be accessed, modified, or referenced, and it plays a crucial role in avoiding naming collisions and ensuring data integrity.
|
|
13
|
+
*
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare class A_Scope {
|
|
17
|
+
name: string;
|
|
18
|
+
private _components;
|
|
19
|
+
private _fragments;
|
|
20
|
+
private parent?;
|
|
21
|
+
protected params: A_TYPES__ScopeConstructor;
|
|
22
|
+
constructor(params: Partial<A_TYPES__ScopeConstructor>, config?: Partial<A_TYPES__ScopeConfig>);
|
|
23
|
+
private initComponents;
|
|
24
|
+
private initFragments;
|
|
25
|
+
get components(): (new (...args: any[]) => any)[];
|
|
26
|
+
/**
|
|
27
|
+
* This method is used to check if the component is available in the scope
|
|
28
|
+
*
|
|
29
|
+
* @param component
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
has(component: {
|
|
33
|
+
new (...args: any[]): any;
|
|
34
|
+
}): boolean;
|
|
35
|
+
has(fragment: A_Fragment): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* This method is used to get the component by class
|
|
38
|
+
*
|
|
39
|
+
* @param component
|
|
40
|
+
* @returns
|
|
41
|
+
*/
|
|
42
|
+
resolve<T extends {
|
|
43
|
+
new (...args: any[]): any;
|
|
44
|
+
}>(component: T): InstanceType<T>;
|
|
45
|
+
resolve<T extends {
|
|
46
|
+
new (...args: any[]): any;
|
|
47
|
+
}>(component: Array<T>): Array<InstanceType<T>>;
|
|
48
|
+
private resolveOnce;
|
|
49
|
+
private resolveFragment;
|
|
50
|
+
register(fragment: A_Fragment): void;
|
|
51
|
+
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Scope = void 0;
|
|
4
|
+
const a_utils_1 = require("@adaas/a-utils");
|
|
5
|
+
const A_Fragment_class_1 = require("../A-Fragment/A-Fragment.class");
|
|
6
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
7
|
+
const A_Component_types_1 = require("../A-Component/A-Component.types");
|
|
8
|
+
/**
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* A_Scope refers to the visibility and accessibility of :
|
|
12
|
+
* - variables,
|
|
13
|
+
* - Components,
|
|
14
|
+
* - Context Fragments
|
|
15
|
+
* - and objects in different parts of your code.
|
|
16
|
+
* Scope determines where a particular piece of data (like a variable or function)
|
|
17
|
+
* can be accessed, modified, or referenced, and it plays a crucial role in avoiding naming collisions and ensuring data integrity.
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
class A_Scope {
|
|
22
|
+
constructor(params, config = {}) {
|
|
23
|
+
this.name = '';
|
|
24
|
+
this._components = new WeakMap();
|
|
25
|
+
this._fragments = new WeakMap();
|
|
26
|
+
this.name = params.name || this.constructor.name;
|
|
27
|
+
// TODO: move to defaults
|
|
28
|
+
const defaultParams = {
|
|
29
|
+
name: '',
|
|
30
|
+
components: [],
|
|
31
|
+
fragments: [],
|
|
32
|
+
import: [],
|
|
33
|
+
export: [],
|
|
34
|
+
};
|
|
35
|
+
this.params = a_utils_1.A_CommonHelper.deepCloneAndMerge(params, defaultParams);
|
|
36
|
+
this.initComponents(params.components || []);
|
|
37
|
+
this.initFragments(params.fragments || []);
|
|
38
|
+
if (config.parent) {
|
|
39
|
+
this.parent = config.parent;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
initComponents(_components) {
|
|
43
|
+
// _components.forEach(component => {
|
|
44
|
+
// this._components.set(component, new component());
|
|
45
|
+
// })
|
|
46
|
+
}
|
|
47
|
+
initFragments(_fragments) {
|
|
48
|
+
_fragments.forEach(this.register.bind(this));
|
|
49
|
+
}
|
|
50
|
+
get components() {
|
|
51
|
+
return this.params.components || [];
|
|
52
|
+
}
|
|
53
|
+
has(entity) {
|
|
54
|
+
switch (true) {
|
|
55
|
+
case entity instanceof A_Fragment_class_1.A_Fragment
|
|
56
|
+
&& this._fragments.has(entity.constructor):
|
|
57
|
+
{
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
case entity instanceof A_Fragment_class_1.A_Fragment
|
|
61
|
+
&& !this._fragments.has(entity.constructor)
|
|
62
|
+
&& !!this.parent:
|
|
63
|
+
{
|
|
64
|
+
return this.parent.has(entity);
|
|
65
|
+
}
|
|
66
|
+
case !(entity instanceof A_Fragment_class_1.A_Fragment)
|
|
67
|
+
&& this._components.has(entity):
|
|
68
|
+
{
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
case !(entity instanceof A_Fragment_class_1.A_Fragment)
|
|
72
|
+
&& !this._components.has(entity)
|
|
73
|
+
&& !!this.parent:
|
|
74
|
+
{
|
|
75
|
+
return this.parent.has(entity);
|
|
76
|
+
}
|
|
77
|
+
default: {
|
|
78
|
+
return false;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// base definition
|
|
83
|
+
resolve(param1, param2) {
|
|
84
|
+
switch (true) {
|
|
85
|
+
case Array.isArray(param1): {
|
|
86
|
+
return param1.map(c => this.resolveOnce(c));
|
|
87
|
+
}
|
|
88
|
+
case typeof param1 === 'function': {
|
|
89
|
+
return this.resolveOnce(param1);
|
|
90
|
+
}
|
|
91
|
+
default: {
|
|
92
|
+
throw new Error('Invalid arguments provided');
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
resolveOnce(component) {
|
|
97
|
+
switch (true) {
|
|
98
|
+
case a_utils_1.A_CommonHelper.isInheritedFrom(component, A_Fragment_class_1.A_Fragment): {
|
|
99
|
+
return this.resolveFragment(component);
|
|
100
|
+
}
|
|
101
|
+
case this.components.includes(component) && this._components.has(component): {
|
|
102
|
+
return this._components.get(component);
|
|
103
|
+
}
|
|
104
|
+
case this.components.includes(component) && !this._components.has(component): {
|
|
105
|
+
const componentMeta = A_Context_class_1.A_Context.meta(component);
|
|
106
|
+
const argsMeta = componentMeta.get(A_Component_types_1.A_TYPES__ComponentMetaKey.INJECTIONS);
|
|
107
|
+
let resolvedArgs = [];
|
|
108
|
+
if (argsMeta)
|
|
109
|
+
resolvedArgs = (argsMeta.get('constructor') || [])
|
|
110
|
+
.map(arg => this.resolve(arg));
|
|
111
|
+
this._components.set(component, new component());
|
|
112
|
+
return this._components.get(component);
|
|
113
|
+
}
|
|
114
|
+
case !this.components.includes(component) && !!this.parent: {
|
|
115
|
+
return this.parent.resolve(component);
|
|
116
|
+
}
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`Component ${component.name} not found in the scope`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
resolveFragment(fragment) {
|
|
122
|
+
if (this._fragments.has(fragment)) {
|
|
123
|
+
return this._fragments.get(fragment);
|
|
124
|
+
}
|
|
125
|
+
if (this.parent) {
|
|
126
|
+
return this.parent.resolveFragment(fragment);
|
|
127
|
+
}
|
|
128
|
+
throw new Error(`Fragment ${fragment.name} not found in the scope ${this.name}`);
|
|
129
|
+
}
|
|
130
|
+
register(fragment) {
|
|
131
|
+
this._fragments.set(fragment.constructor, fragment);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
exports.A_Scope = A_Scope;
|
|
135
|
+
//# sourceMappingURL=A-Scope.class.js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|
8
|
+
/**
|
|
9
|
+
* A list of Context Fragments available in the Scope
|
|
10
|
+
*/
|
|
11
|
+
fragments: Array<A_Fragment>;
|
|
12
|
+
/**
|
|
13
|
+
* A set of Components available in the Scope
|
|
14
|
+
*/
|
|
15
|
+
components: Array<{
|
|
16
|
+
new (...args: any[]): any;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* A list of Features/Lifecycle Hooks available in the Scope
|
|
20
|
+
*/
|
|
21
|
+
import: Array<string>;
|
|
22
|
+
/**
|
|
23
|
+
* A list of Features/Lifecycle Hooks available to be exported from the Scope
|
|
24
|
+
*/
|
|
25
|
+
export: Array<string>;
|
|
26
|
+
};
|
|
27
|
+
export type A_TYPES__ScopeConfig = {
|
|
28
|
+
/**
|
|
29
|
+
* Allows to define a parent to take dependencies from in case of the current scope does not have the required component
|
|
30
|
+
*/
|
|
31
|
+
parent: A_Scope;
|
|
32
|
+
};
|