@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,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context Fragments is a set of arguments that can be used to define a Context for the pipeline.
|
|
3
|
+
* In other words it is a dynamic context that will be created on pipeline start and destroyed on pipeline end.
|
|
4
|
+
* During the execution of the pipeline, the Context Fragments can be used to pass the data between the pipeline steps.
|
|
5
|
+
*
|
|
6
|
+
* Or to store the data that is required for the pipeline execution
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
export declare class A_ContextFragment {
|
|
10
|
+
protected args: any[];
|
|
11
|
+
constructor(...args: any[]);
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_ContextFragment = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Context Fragments is a set of arguments that can be used to define a Context for the pipeline.
|
|
6
|
+
* In other words it is a dynamic context that will be created on pipeline start and destroyed on pipeline end.
|
|
7
|
+
* During the execution of the pipeline, the Context Fragments can be used to pass the data between the pipeline steps.
|
|
8
|
+
*
|
|
9
|
+
* Or to store the data that is required for the pipeline execution
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
class A_ContextFragment {
|
|
13
|
+
constructor(...args) {
|
|
14
|
+
this.args = [];
|
|
15
|
+
this.args = args;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.A_ContextFragment = A_ContextFragment;
|
|
19
|
+
//# sourceMappingURL=A-ContextFragment.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-ContextFragment.class.js","sourceRoot":"","sources":["../../../../src/global/A-Context/A-ContextFragment.class.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,MAAa,iBAAiB;IAI1B,YAAY,GAAG,IAAW;QAFhB,SAAI,GAAU,EAAE,CAAC;QAGvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CAEJ;AARD,8CAQC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
declare class RealDependency {
|
|
2
|
-
private name;
|
|
3
|
-
constructor(name: string);
|
|
4
|
-
getName(): string;
|
|
5
|
-
performAction(): void;
|
|
6
|
-
}
|
|
7
|
-
declare class DependencyReference<T> {
|
|
8
|
-
private realClass;
|
|
9
|
-
private args;
|
|
10
|
-
private proxyInstance;
|
|
11
|
-
private realInstance;
|
|
12
|
-
constructor(realClass: {
|
|
13
|
-
new (...args: any[]): T;
|
|
14
|
-
}, args: any[]);
|
|
15
|
-
private loadInstance;
|
|
16
|
-
resolve(): Promise<T>;
|
|
17
|
-
}
|
|
@@ -1,67 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
class
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (typeof value === 'function') {
|
|
50
|
-
return value.bind(realInstance);
|
|
51
|
-
}
|
|
52
|
-
return value;
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
return this.proxyInstance;
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
// Example usage:
|
|
61
|
-
(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
62
|
-
const lazyDependency = new DependencyReference(RealDependency, ['ComponentA']);
|
|
63
|
-
const proxy = yield lazyDependency.resolve(); // Loads the instance asynchronously
|
|
64
|
-
proxy.performAction(); // Will call the method on the real instance
|
|
65
|
-
console.log(proxy.getName()); // Calls method on the real instance
|
|
66
|
-
}))();
|
|
2
|
+
// class RealDependency {
|
|
3
|
+
// constructor(private name: string) { }
|
|
4
|
+
// getName() {
|
|
5
|
+
// return this.name;
|
|
6
|
+
// }
|
|
7
|
+
// performAction() {
|
|
8
|
+
// console.log(`${this.name} is performing an action.`);
|
|
9
|
+
// }
|
|
10
|
+
// }
|
|
11
|
+
// class DependencyReference<T> {
|
|
12
|
+
// private proxyInstance: T | null = null;
|
|
13
|
+
// private realInstance: T | null = null;
|
|
14
|
+
// constructor(private realClass: { new(...args: any[]): T }, private args: any[]) { }
|
|
15
|
+
// // Simulate async loading (e.g., dynamic imports, API calls, etc.)
|
|
16
|
+
// private async loadInstance(): Promise<T> {
|
|
17
|
+
// if (!this.realInstance) {
|
|
18
|
+
// console.log('Loading real dependency...');
|
|
19
|
+
// // Simulate async loading with a delay
|
|
20
|
+
// await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
21
|
+
// this.realInstance = new this.realClass(...this.args);
|
|
22
|
+
// }
|
|
23
|
+
// return this.realInstance;
|
|
24
|
+
// }
|
|
25
|
+
// public async resolve(): Promise<T> {
|
|
26
|
+
// if (!this.proxyInstance) {
|
|
27
|
+
// const realInstance = await this.loadInstance();
|
|
28
|
+
// this.proxyInstance = new Proxy({}, {
|
|
29
|
+
// get: (target, prop) => {
|
|
30
|
+
// const value = (realInstance as any)[prop];
|
|
31
|
+
// // If the property is a method, return a bound function
|
|
32
|
+
// if (typeof value === 'function') {
|
|
33
|
+
// return value.bind(realInstance);
|
|
34
|
+
// }
|
|
35
|
+
// return value;
|
|
36
|
+
// }
|
|
37
|
+
// }) as T;
|
|
38
|
+
// }
|
|
39
|
+
// return this.proxyInstance;
|
|
40
|
+
// }
|
|
41
|
+
// }
|
|
42
|
+
// // Example usage:
|
|
43
|
+
// (async () => {
|
|
44
|
+
// const lazyDependency = new DependencyReference(RealDependency, ['ComponentA']);
|
|
45
|
+
// const proxy = await lazyDependency.resolve(); // Loads the instance asynchronously
|
|
46
|
+
// proxy.performAction(); // Will call the method on the real instance
|
|
47
|
+
// console.log(proxy.getName()); // Calls method on the real instance
|
|
48
|
+
// })();
|
|
67
49
|
//# sourceMappingURL=A-DependencyReference.class.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-DependencyReference.class.js","sourceRoot":"","sources":["../../../../src/global/A-Dependency/A-DependencyReference.class.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"A-DependencyReference.class.js","sourceRoot":"","sources":["../../../../src/global/A-Dependency/A-DependencyReference.class.ts"],"names":[],"mappings":";AAAA,yBAAyB;AACzB,4CAA4C;AAE5C,kBAAkB;AAClB,4BAA4B;AAC5B,QAAQ;AAER,wBAAwB;AACxB,gEAAgE;AAChE,QAAQ;AACR,IAAI;AAEJ,iCAAiC;AACjC,8CAA8C;AAC9C,6CAA6C;AAE7C,0FAA0F;AAE1F,yEAAyE;AACzE,iDAAiD;AACjD,oCAAoC;AACpC,yDAAyD;AACzD,qDAAqD;AACrD,yEAAyE;AACzE,oEAAoE;AACpE,YAAY;AACZ,oCAAoC;AACpC,QAAQ;AAER,2CAA2C;AAC3C,qCAAqC;AACrC,8DAA8D;AAE9D,mDAAmD;AACnD,2CAA2C;AAC3C,iEAAiE;AAEjE,8EAA8E;AAC9E,yDAAyD;AACzD,2DAA2D;AAC3D,wBAAwB;AACxB,oCAAoC;AACpC,oBAAoB;AACpB,uBAAuB;AACvB,YAAY;AAEZ,qCAAqC;AACrC,QAAQ;AACR,IAAI;AAGJ,oBAAoB;AACpB,iBAAiB;AACjB,sFAAsF;AAEtF,0FAA0F;AAE1F,2EAA2E;AAE3E,0EAA0E;AAC1E,QAAQ"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { A_Namespace } from "../A-Namespace/A_Namespace.class";
|
|
2
|
-
export type A_TYPES__A_DependencyReferenceConstructor = {
|
|
3
|
-
/**
|
|
4
|
-
* The name of the dependency
|
|
5
|
-
*/
|
|
6
|
-
name: string;
|
|
7
|
-
/**
|
|
8
|
-
* The version of the module
|
|
9
|
-
* By default it is 1.0.0
|
|
10
|
-
*/
|
|
11
|
-
version: string;
|
|
12
|
-
/**
|
|
13
|
-
* The dependencies of the module
|
|
14
|
-
* Could be:
|
|
15
|
-
* - other Modules
|
|
16
|
-
* - other Contexts
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
dependencies: Array<typeof A_Namespace>;
|
|
20
|
-
/**
|
|
21
|
-
* The source of the dependency
|
|
22
|
-
* Could be:
|
|
23
|
-
* - a string representing the path to the module
|
|
24
|
-
* - a module class (in case when config should be provided via the module constructor)
|
|
25
|
-
* - a module class constructor
|
|
26
|
-
* - a context class (in case when config should be provided via the context constructor)
|
|
27
|
-
* - a context class constructor
|
|
28
|
-
*
|
|
29
|
-
*/
|
|
30
|
-
source: A_Namespace;
|
|
31
|
-
};
|
|
32
|
-
export type A_TYPES__A_DependencyReferenceConstructorConfig = {
|
|
33
|
-
/**
|
|
34
|
-
* Sync - blocks A-Express Application initialization until module is ready
|
|
35
|
-
* Async - allows to initialize module after A-Express Application initialization
|
|
36
|
-
*/
|
|
37
|
-
behavior: 'async' | 'sync';
|
|
38
|
-
/**
|
|
39
|
-
* Allows to define a scheme of retries
|
|
40
|
-
*/
|
|
41
|
-
retries: {
|
|
42
|
-
/**
|
|
43
|
-
* The number of retries
|
|
44
|
-
* Default is 3
|
|
45
|
-
*/
|
|
46
|
-
n: number;
|
|
47
|
-
/**
|
|
48
|
-
* The timeout between retries
|
|
49
|
-
* Multiplied by the number of retries
|
|
50
|
-
* So after each retry the timeout is increased e.g. 1000ms * 1, 1000ms * 2, 1000ms * 3
|
|
51
|
-
* Default is 1000
|
|
52
|
-
*/
|
|
53
|
-
timeout: number;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
@@ -1,3 +1,58 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
// import { A_Namespace } from "@adaas/a-concept/global/A-Namespace/A_Namespace.class"
|
|
3
|
+
// export type A_TYPES__A_DependencyReferenceConstructor = {
|
|
4
|
+
// /**
|
|
5
|
+
// * The name of the dependency
|
|
6
|
+
// */
|
|
7
|
+
// name: string
|
|
8
|
+
// /**
|
|
9
|
+
// * The version of the module
|
|
10
|
+
// * By default it is 1.0.0
|
|
11
|
+
// */
|
|
12
|
+
// version: string
|
|
13
|
+
// /**
|
|
14
|
+
// * The dependencies of the module
|
|
15
|
+
// * Could be:
|
|
16
|
+
// * - other Modules
|
|
17
|
+
// * - other Contexts
|
|
18
|
+
// *
|
|
19
|
+
// */
|
|
20
|
+
// dependencies: Array<typeof A_Namespace>
|
|
21
|
+
// /**
|
|
22
|
+
// * The source of the dependency
|
|
23
|
+
// * Could be:
|
|
24
|
+
// * - a string representing the path to the module
|
|
25
|
+
// * - a module class (in case when config should be provided via the module constructor)
|
|
26
|
+
// * - a module class constructor
|
|
27
|
+
// * - a context class (in case when config should be provided via the context constructor)
|
|
28
|
+
// * - a context class constructor
|
|
29
|
+
// *
|
|
30
|
+
// */
|
|
31
|
+
// // source: A_Module | A_Context | typeof A_Module | typeof A_Context | string
|
|
32
|
+
// source: A_Namespace
|
|
33
|
+
// }
|
|
34
|
+
// export type A_TYPES__A_DependencyReferenceConstructorConfig = {
|
|
35
|
+
// /**
|
|
36
|
+
// * Sync - blocks A-Express Application initialization until module is ready
|
|
37
|
+
// * Async - allows to initialize module after A-Express Application initialization
|
|
38
|
+
// */
|
|
39
|
+
// behavior: 'async' | 'sync',
|
|
40
|
+
// /**
|
|
41
|
+
// * Allows to define a scheme of retries
|
|
42
|
+
// */
|
|
43
|
+
// retries: {
|
|
44
|
+
// /**
|
|
45
|
+
// * The number of retries
|
|
46
|
+
// * Default is 3
|
|
47
|
+
// */
|
|
48
|
+
// n: number,
|
|
49
|
+
// /**
|
|
50
|
+
// * The timeout between retries
|
|
51
|
+
// * Multiplied by the number of retries
|
|
52
|
+
// * So after each retry the timeout is increased e.g. 1000ms * 1, 1000ms * 2, 1000ms * 3
|
|
53
|
+
// * Default is 1000
|
|
54
|
+
// */
|
|
55
|
+
// timeout: number
|
|
56
|
+
// }
|
|
57
|
+
// }
|
|
3
58
|
//# sourceMappingURL=A-DependencyReference.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-DependencyReference.types.js","sourceRoot":"","sources":["../../../../src/global/A-Dependency/A-DependencyReference.types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"A-DependencyReference.types.js","sourceRoot":"","sources":["../../../../src/global/A-Dependency/A-DependencyReference.types.ts"],"names":[],"mappings":";AAAA,sFAAsF;AAGtF,4DAA4D;AAC5D,UAAU;AACV,qCAAqC;AACrC,UAAU;AACV,mBAAmB;AACnB,UAAU;AACV,oCAAoC;AACpC,gCAAgC;AAChC,UAAU;AACV,sBAAsB;AACtB,UAAU;AACV,yCAAyC;AACzC,mBAAmB;AACnB,yBAAyB;AACzB,0BAA0B;AAC1B,UAAU;AACV,UAAU;AACV,8CAA8C;AAC9C,UAAU;AACV,uCAAuC;AACvC,mBAAmB;AACnB,wDAAwD;AACxD,+FAA+F;AAC/F,sCAAsC;AACtC,gGAAgG;AAChG,uCAAuC;AACvC,UAAU;AACV,UAAU;AACV,oFAAoF;AACpF,0BAA0B;AAC1B,IAAI;AAGJ,kEAAkE;AAClE,UAAU;AACV,oFAAoF;AACpF,wFAAwF;AACxF,UAAU;AACV,kCAAkC;AAElC,UAAU;AACV,8CAA8C;AAC9C,UAAU;AACV,iBAAiB;AACjB,cAAc;AACd,mCAAmC;AACnC,0BAA0B;AAC1B,cAAc;AACd,qBAAqB;AACrB,cAAc;AACd,yCAAyC;AACzC,kDAAkD;AAClD,kGAAkG;AAClG,6BAA6B;AAC7B,cAAc;AACd,0BAA0B;AAC1B,QAAQ;AACR,IAAI"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ASEID } from "@adaas/a-utils";
|
|
2
|
+
import { A_TYPES__Entity_JSON, A_TYPES__IEntity } from "./A-Entity.types";
|
|
3
|
+
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
|
+
/**
|
|
5
|
+
* A_Entity is another abstraction that describes all major participants in the system business logic.
|
|
6
|
+
* Each Entity should have a clear definition and a clear set of responsibilities.
|
|
7
|
+
* However, entity may hide some of its responsibilities behind the interface to prevent overload.
|
|
8
|
+
*
|
|
9
|
+
* Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.
|
|
10
|
+
*/
|
|
11
|
+
export declare class A_Entity<_ConstructorType = any, _SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON> extends A_Fragment implements A_TYPES__IEntity {
|
|
12
|
+
aseid: ASEID;
|
|
13
|
+
constructor(aseid: string);
|
|
14
|
+
constructor(aseid: ASEID);
|
|
15
|
+
constructor(serialized: _SerializedType);
|
|
16
|
+
constructor(newEntity: _ConstructorType);
|
|
17
|
+
/**
|
|
18
|
+
* Extracts the ID from the ASEID
|
|
19
|
+
* ID is the unique identifier of the entity
|
|
20
|
+
*/
|
|
21
|
+
get id(): string | number;
|
|
22
|
+
/**
|
|
23
|
+
* Extracts the namespace from the ASEID
|
|
24
|
+
* namespace is an application specific identifier from where the entity is coming from
|
|
25
|
+
*/
|
|
26
|
+
get namespace(): string;
|
|
27
|
+
/**
|
|
28
|
+
* Extracts the scope from the ASEID
|
|
29
|
+
* scope is the scope of the entity from Application Namespace
|
|
30
|
+
*/
|
|
31
|
+
get scope(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Extracts the entity from the ASEID
|
|
34
|
+
* entity is the name of the entity from Application Namespace
|
|
35
|
+
*/
|
|
36
|
+
get entity(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Extracts the version from the ASEID
|
|
39
|
+
* version is the version of the entity
|
|
40
|
+
*/
|
|
41
|
+
get version(): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Extracts the shard from the ASEID
|
|
44
|
+
* shard is the shard of the entity
|
|
45
|
+
*/
|
|
46
|
+
get shard(): string | undefined;
|
|
47
|
+
protected fromNewEntity(newEntity: _ConstructorType): void;
|
|
48
|
+
protected fromSerialized(serialized: _SerializedType): void;
|
|
49
|
+
/**
|
|
50
|
+
* Converts the entity to a JSON object
|
|
51
|
+
*
|
|
52
|
+
*
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
toJSON(): _SerializedType;
|
|
56
|
+
toString(): string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_Entity = void 0;
|
|
4
|
+
const a_utils_1 = require("@adaas/a-utils");
|
|
5
|
+
const errors_constants_1 = require("@adaas/a-utils/dist/src/constants/errors.constants");
|
|
6
|
+
const A_Fragment_class_1 = require("../A-Fragment/A-Fragment.class");
|
|
7
|
+
/**
|
|
8
|
+
* A_Entity is another abstraction that describes all major participants in the system business logic.
|
|
9
|
+
* Each Entity should have a clear definition and a clear set of responsibilities.
|
|
10
|
+
* However, entity may hide some of its responsibilities behind the interface to prevent overload.
|
|
11
|
+
*
|
|
12
|
+
* Each entity should be connected to the ContextFragment (Scope) and should be able to communicate with other entities.
|
|
13
|
+
*/
|
|
14
|
+
class A_Entity extends A_Fragment_class_1.A_Fragment {
|
|
15
|
+
constructor(props) {
|
|
16
|
+
super();
|
|
17
|
+
switch (true) {
|
|
18
|
+
case (typeof props === 'string' && a_utils_1.ASEID.isASEID(props)):
|
|
19
|
+
this.aseid = new a_utils_1.ASEID(props);
|
|
20
|
+
break;
|
|
21
|
+
case (props instanceof a_utils_1.ASEID):
|
|
22
|
+
this.aseid = props;
|
|
23
|
+
break;
|
|
24
|
+
case (typeof props === 'object' && props.aseid):
|
|
25
|
+
this.fromSerialized(props);
|
|
26
|
+
break;
|
|
27
|
+
case (typeof props === 'object'):
|
|
28
|
+
this.fromNewEntity(props);
|
|
29
|
+
break;
|
|
30
|
+
default:
|
|
31
|
+
throw new a_utils_1.A_Error(errors_constants_1.A_CONSTANTS__DEFAULT_ERRORS.INCORRECT_A_ENTITY_CONSTRUCTOR);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// ====================================================================
|
|
35
|
+
// ================== DUPLICATED ASEID Getters ========================
|
|
36
|
+
// ====================================================================
|
|
37
|
+
/**
|
|
38
|
+
* Extracts the ID from the ASEID
|
|
39
|
+
* ID is the unique identifier of the entity
|
|
40
|
+
*/
|
|
41
|
+
get id() {
|
|
42
|
+
return this.aseid.id;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Extracts the namespace from the ASEID
|
|
46
|
+
* namespace is an application specific identifier from where the entity is coming from
|
|
47
|
+
*/
|
|
48
|
+
get namespace() {
|
|
49
|
+
return this.aseid.namespace;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Extracts the scope from the ASEID
|
|
53
|
+
* scope is the scope of the entity from Application Namespace
|
|
54
|
+
*/
|
|
55
|
+
get scope() {
|
|
56
|
+
return this.aseid.scope;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Extracts the entity from the ASEID
|
|
60
|
+
* entity is the name of the entity from Application Namespace
|
|
61
|
+
*/
|
|
62
|
+
get entity() {
|
|
63
|
+
return this.aseid.entity;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Extracts the version from the ASEID
|
|
67
|
+
* version is the version of the entity
|
|
68
|
+
*/
|
|
69
|
+
get version() {
|
|
70
|
+
return this.aseid.version;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Extracts the shard from the ASEID
|
|
74
|
+
* shard is the shard of the entity
|
|
75
|
+
*/
|
|
76
|
+
get shard() {
|
|
77
|
+
return this.aseid.shard;
|
|
78
|
+
}
|
|
79
|
+
fromNewEntity(newEntity) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
fromSerialized(serialized) {
|
|
83
|
+
this.aseid = new a_utils_1.ASEID((serialized).aseid);
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Converts the entity to a JSON object
|
|
88
|
+
*
|
|
89
|
+
*
|
|
90
|
+
* @returns
|
|
91
|
+
*/
|
|
92
|
+
toJSON() {
|
|
93
|
+
return {
|
|
94
|
+
aseid: this.aseid.toString()
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
toString() {
|
|
98
|
+
return this.aseid.toString();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.A_Entity = A_Entity;
|
|
102
|
+
//# sourceMappingURL=A-Entity.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Entity.class.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.class.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAEhD,yFAAiG;AAEjG,qEAA4D;AAE5D;;;;;;GAMG;AACH,MAAa,QAIT,SAAQ,6BAAU;IAkBlB,YAAY,KAA0D;QAClE,KAAK,EAAE,CAAC;QAER,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAI,eAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACpD,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC,KAAK,CAAC,CAAC;gBAC9B,MAAM;YACV,KAAK,CAAC,KAAK,YAAY,eAAK,CAAC;gBACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;gBACnB,MAAM;YACV,KAAK,CAAC,OAAO,KAAK,KAAK,QAAQ,IAAK,KAAa,CAAC,KAAK,CAAC;gBACpD,IAAI,CAAC,cAAc,CAAC,KAAwB,CAAC,CAAC;gBAC9C,MAAM;YAEV,KAAK,CAAC,OAAO,KAAK,KAAK,QAAQ,CAAC;gBAC5B,IAAI,CAAC,aAAa,CAAC,KAAyB,CAAC,CAAC;gBAC9C,MAAK;YAET;gBACI,MAAM,IAAI,iBAAO,CAAC,8CAA2B,CAAC,8BAA8B,CAAC,CAAC;QACtF,CAAC;IAEL,CAAC;IAED,uEAAuE;IACvE,uEAAuE;IACvE,uEAAuE;IAEvE;;;OAGG;IACH,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;IACzB,CAAC;IAED;;;OAGG;IACH,IAAI,SAAS;QACT,OAAO,IAAI,CAAC,KAAK,CAAC,SAAS,CAAA;IAC/B,CAAC;IAED;;;OAGG;IACH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACH,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC;IAC7B,CAAC;IAED;;;OAGG;IAEH,IAAI,OAAO;QACP,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC;IAC9B,CAAC;IAED;;;OAGG;IACH,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC;IAC5B,CAAC;IAGS,aAAa,CAAC,SAA2B;QAC/C,OAAO;IACX,CAAC;IAES,cAAc,CAAC,UAA2B;QAChD,IAAI,CAAC,KAAK,GAAG,IAAI,eAAK,CAAC,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,CAAC;QAC3C,OAAO;IACX,CAAC;IAGD;;;;;OAKG;IACH,MAAM;QACF,OAAO;YACH,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE;SACZ,CAAC;IACzB,CAAC;IAID,QAAQ;QACJ,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IACjC,CAAC;CACJ;AA/HD,4BA+HC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"A-Entity.types.js","sourceRoot":"","sources":["../../../../src/global/A-Entity/A-Entity.types.ts"],"names":[],"mappings":";;AAOC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { A_Feature_Define } from "../../decorators/A-Feature/A-Feature-Define.decorator";
|
|
2
|
+
import { A_Feature_Extend } from "../../decorators/A-Feature/A-Feature-Extend.decorator";
|
|
3
|
+
import { A_TYPES__FeatureConstructor, A_TYPES__FeatureState, A_TYPES__FeatureStep } from "./A-Feature.types";
|
|
4
|
+
import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
|
|
5
|
+
/**
|
|
6
|
+
* A_Feature is representing a feature that can be executed across multiple components
|
|
7
|
+
* This class stores the steps of the feature and executes them in order of appearance
|
|
8
|
+
*
|
|
9
|
+
* Using A_Feature.Define and A_Feature.Extend decorators to define and extend the feature methods
|
|
10
|
+
* across the different, distributed components
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
export declare class A_Feature {
|
|
14
|
+
/**
|
|
15
|
+
* Define a new A-Feature
|
|
16
|
+
*/
|
|
17
|
+
static get Define(): typeof A_Feature_Define;
|
|
18
|
+
/**
|
|
19
|
+
* Extend an existing A-Feature
|
|
20
|
+
*/
|
|
21
|
+
static get Extend(): typeof A_Feature_Extend;
|
|
22
|
+
protected steps: A_TYPES__FeatureStep[];
|
|
23
|
+
state: A_TYPES__FeatureState;
|
|
24
|
+
result?: any;
|
|
25
|
+
error?: A_Error;
|
|
26
|
+
constructor(params: A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps']>);
|
|
27
|
+
/**
|
|
28
|
+
* This method marks the feature as completed and returns the result
|
|
29
|
+
* Uses to interrupt or end the feature processing
|
|
30
|
+
*
|
|
31
|
+
* @param result
|
|
32
|
+
* @returns
|
|
33
|
+
*/
|
|
34
|
+
completed<T extends any>(...result: T[]): Promise<T>;
|
|
35
|
+
/**
|
|
36
|
+
* This method marks the feature as failed and throws an error
|
|
37
|
+
* Uses to interrupt or end the feature processing
|
|
38
|
+
*
|
|
39
|
+
* @param error
|
|
40
|
+
*/
|
|
41
|
+
failed(error: Error | A_Error | unknown): Promise<void>;
|
|
42
|
+
process(): Promise<void>;
|
|
43
|
+
protected errorHandler(error: Error | A_Error | unknown): Promise<void>;
|
|
44
|
+
}
|