@adaas/a-concept 0.0.33 → 0.0.34
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/README.md +156 -8
- package/dist/index.d.ts +3 -1
- package/dist/index.js +6 -3
- package/dist/index.js.map +1 -1
- package/dist/src/base/A-Config/A-Config.container.d.ts +5 -2
- package/dist/src/base/A-Config/A-Config.container.js +7 -2
- package/dist/src/base/A-Config/A-Config.container.js.map +1 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.js +1 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.js.map +1 -1
- package/dist/src/base/A-Config/components/FileConfigReader.component.js.map +1 -1
- package/dist/src/base/A-Errors/A-Errors.context.js.map +1 -1
- package/dist/src/base/A-Logger/A-Logger.component.js.map +1 -1
- package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.d.ts → A-Abstraction-Extend.decorator.d.ts} +1 -1
- package/dist/src/decorators/A-Abstraction/{A-Abstraction.decorator.js → A-Abstraction-Extend.decorator.js} +6 -6
- package/dist/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.js.map +1 -0
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.d.ts +1 -1
- package/dist/src/decorators/A-Connect/A-Connect.decorator.js.map +1 -1
- package/dist/src/decorators/A-Entity/A-Entity.decorator.types.d.ts +1 -1
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +3 -3
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js +20 -4
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +1 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +3 -2
- package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +1 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js +23 -2
- 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 +3 -3
- package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +40 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js +113 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +1 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +13 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js +11 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +1 -0
- package/dist/src/global/A-Channel/A-Channel.class.js +0 -1
- package/dist/src/global/A-Channel/A-Channel.class.js.map +1 -1
- package/dist/src/global/A-Channel/A-Channel.types.d.ts +2 -1
- package/dist/src/global/A-Component/A-Component.class.d.ts +5 -30
- package/dist/src/global/A-Component/A-Component.class.js +6 -10
- package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.meta.d.ts +9 -2
- package/dist/src/global/A-Component/A-Component.meta.js +10 -1
- package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.class.d.ts +16 -17
- package/dist/src/global/A-Concept/A_Concept.class.js +31 -65
- package/dist/src/global/A-Concept/A_Concept.class.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.meta.d.ts +10 -0
- package/dist/src/global/A-Concept/A_Concept.meta.js +20 -0
- package/dist/src/global/A-Concept/A_Concept.meta.js.map +1 -1
- package/dist/src/global/A-Concept/A_Concept.types.d.ts +2 -2
- package/dist/src/global/A-Container/A-Container.class.d.ts +7 -50
- package/dist/src/global/A-Container/A-Container.class.js +9 -19
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.meta.d.ts +15 -0
- package/dist/src/global/A-Container/A-Container.meta.js +20 -0
- package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +20 -20
- package/dist/src/global/A-Context/A-Context.class.js +57 -15
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +10 -18
- package/dist/src/global/A-Entity/A-Entity.class.js +21 -31
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.meta.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +3 -2
- package/dist/src/global/A-Entity/A-Entity.types.js +1 -0
- package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +2 -1
- package/dist/src/global/A-Feature/A-Feature.class.js +14 -4
- package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +9 -0
- package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +1 -0
- package/dist/src/global/A-Meta/A-Meta.class.js +3 -6
- package/dist/src/global/A-Meta/A-Meta.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +4 -2
- package/dist/src/global/A-Scope/A-Scope.class.js +23 -16
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +0 -8
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +3 -3
- package/dist/src/global/A-Stage/A-Stage.class.js +11 -10
- package/dist/src/global/A-Stage/A-Stage.class.js.map +1 -1
- package/dist/src/global/A-Stage/A-Stage.types.d.ts +1 -1
- package/dist/src/global/A-Stage/A-Stage.types.js.map +1 -1
- package/dist/src/helpers/StepsManager.class.d.ts +1 -0
- package/dist/src/helpers/StepsManager.class.js +10 -7
- package/dist/src/helpers/StepsManager.class.js.map +1 -1
- package/docs/a-concept-logo.png +0 -0
- package/docs/a-logo-docs.png +0 -0
- package/examples/fe-be/channels/Test.channel.ts +6 -3
- package/examples/simple/components/A.component.ts +7 -0
- package/examples/simple/components/B.component.ts +9 -0
- package/examples/simple/concept.ts +38 -60
- package/examples/simple/containers/Main.container.ts +24 -11
- package/examples/simple/entities/EntityA.entity.ts +3 -5
- package/examples/simple-http-server/components/http-request-handler.component.ts +6 -4
- package/examples/simple-http-server/concept.ts +24 -21
- package/examples/simple-http-server/containers/http-server.container.ts +4 -3
- package/index.ts +4 -1
- package/package.json +6 -2
- package/src/base/A-Config/A-Config.container.ts +12 -4
- package/src/base/A-Config/components/ConfigReader.component.ts +4 -5
- package/src/base/A-Config/components/FileConfigReader.component.ts +0 -2
- package/src/base/A-Errors/A-Error.entity.ts +1 -1
- package/src/base/A-Errors/A-Errors.context.ts +2 -1
- package/src/base/A-Logger/A-Logger.component.ts +0 -1
- package/src/decorators/A-Abstraction/{A-Abstraction.decorator.ts → A-Abstraction-Extend.decorator.ts} +5 -6
- package/src/decorators/A-Abstraction/A-Abstraction.decorator.types.ts +1 -1
- package/src/decorators/A-Connect/A-Connect.decorator.ts +1 -1
- package/src/decorators/A-Entity/A-Entity.decorator.types.ts +1 -1
- package/src/decorators/A-Feature/A-Feature-Define.decorator.ts +37 -10
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +12 -12
- package/src/decorators/A-Inject/A-Inject.decorator.ts +31 -4
- package/src/decorators/A-Inject/A-Inject.decorator.types.ts +4 -3
- package/src/global/A-Abstraction/A-Abstraction.class.ts +130 -0
- package/src/global/A-Abstraction/A-Abstraction.types.ts +22 -0
- package/src/global/A-Channel/A-Channel.class.ts +0 -2
- package/src/global/A-Channel/A-Channel.types.ts +2 -1
- package/src/global/A-Component/A-Component.class.ts +12 -52
- package/src/global/A-Component/A-Component.meta.ts +19 -2
- package/src/global/A-Concept/A_Concept.class.ts +45 -126
- package/src/global/A-Concept/A_Concept.meta.ts +68 -0
- package/src/global/A-Concept/A_Concept.types.ts +2 -2
- package/src/global/A-Container/A-Container.class.ts +11 -90
- package/src/global/A-Container/A-Container.meta.ts +33 -0
- package/src/global/A-Context/A-Context.class.ts +134 -56
- package/src/global/A-Entity/A-Entity.class.ts +22 -69
- package/src/global/A-Entity/A-Entity.meta.ts +3 -2
- package/src/global/A-Entity/A-Entity.types.ts +2 -1
- package/src/global/A-Feature/A-Feature.class.ts +18 -7
- package/src/global/A-Feature/A-Feature.types.ts +10 -2
- package/src/global/A-Meta/A-Meta.class.ts +5 -8
- package/src/global/A-Scope/A-Scope.class.ts +38 -21
- package/src/global/A-Scope/A-Scope.types.ts +2 -2
- package/src/global/A-Stage/A-Stage.class.ts +20 -20
- package/src/global/A-Stage/A-Stage.types.ts +2 -3
- package/src/helpers/StepsManager.class.ts +11 -7
- package/trace-require.js +46 -0
- package/tsconfig.build.json +57 -0
- package/dist/examples/fe-be/channels/Test.channel.d.ts +0 -6
- package/dist/examples/fe-be/channels/Test.channel.js +0 -14
- package/dist/examples/fe-be/channels/Test.channel.js.map +0 -1
- package/dist/examples/fe-be/components/BE-Controller.component.d.ts +0 -4
- package/dist/examples/fe-be/components/BE-Controller.component.js +0 -24
- package/dist/examples/fe-be/components/BE-Controller.component.js.map +0 -1
- package/dist/examples/fe-be/components/FE.component.d.ts +0 -4
- package/dist/examples/fe-be/components/FE.component.js +0 -31
- package/dist/examples/fe-be/components/FE.component.js.map +0 -1
- package/dist/examples/fe-be/components/UserActions.component.d.ts +0 -5
- package/dist/examples/fe-be/components/UserActions.component.js +0 -25
- package/dist/examples/fe-be/components/UserActions.component.js.map +0 -1
- package/dist/examples/fe-be/concept.d.ts +0 -0
- package/dist/examples/fe-be/concept.js +0 -2
- package/dist/examples/fe-be/concept.js.map +0 -1
- package/dist/examples/fe-be/containers/ServerApp.container.d.ts +0 -3
- package/dist/examples/fe-be/containers/ServerApp.container.js +0 -8
- package/dist/examples/fe-be/containers/ServerApp.container.js.map +0 -1
- package/dist/examples/fe-be/containers/WebApp.container.d.ts +0 -3
- package/dist/examples/fe-be/containers/WebApp.container.js +0 -8
- package/dist/examples/fe-be/containers/WebApp.container.js.map +0 -1
- package/dist/examples/multi-container/channels/Direct.channel.d.ts +0 -9
- package/dist/examples/multi-container/channels/Direct.channel.js +0 -32
- package/dist/examples/multi-container/channels/Direct.channel.js.map +0 -1
- package/dist/examples/multi-container/concept.d.ts +0 -0
- package/dist/examples/multi-container/concept.js +0 -2
- package/dist/examples/multi-container/concept.js.map +0 -1
- package/dist/examples/multi-container/containers/Command.container.d.ts +0 -11
- package/dist/examples/multi-container/containers/Command.container.js +0 -51
- package/dist/examples/multi-container/containers/Command.container.js.map +0 -1
- package/dist/examples/multi-container/containers/Schedule.container.d.ts +0 -15
- package/dist/examples/multi-container/containers/Schedule.container.js +0 -67
- package/dist/examples/multi-container/containers/Schedule.container.js.map +0 -1
- package/dist/examples/sdk/concept.d.ts +0 -0
- package/dist/examples/sdk/concept.js +0 -21
- package/dist/examples/sdk/concept.js.map +0 -1
- package/dist/examples/sdk/orders.api.d.ts +0 -0
- package/dist/examples/sdk/orders.api.js +0 -16
- package/dist/examples/sdk/orders.api.js.map +0 -1
- package/dist/examples/sdk/users.api.d.ts +0 -0
- package/dist/examples/sdk/users.api.js +0 -16
- package/dist/examples/sdk/users.api.js.map +0 -1
- package/dist/examples/simple/components/A.component.d.ts +0 -9
- package/dist/examples/simple/components/A.component.js +0 -60
- package/dist/examples/simple/components/A.component.js.map +0 -1
- package/dist/examples/simple/components/B.component.d.ts +0 -13
- package/dist/examples/simple/components/B.component.js +0 -88
- package/dist/examples/simple/components/B.component.js.map +0 -1
- package/dist/examples/simple/concept.d.ts +0 -1
- package/dist/examples/simple/concept.js +0 -82
- package/dist/examples/simple/concept.js.map +0 -1
- package/dist/examples/simple/containers/Main.container.d.ts +0 -11
- package/dist/examples/simple/containers/Main.container.js +0 -86
- package/dist/examples/simple/containers/Main.container.js.map +0 -1
- package/dist/examples/simple/context/Fragment_A.context.d.ts +0 -6
- package/dist/examples/simple/context/Fragment_A.context.js +0 -16
- package/dist/examples/simple/context/Fragment_A.context.js.map +0 -1
- package/dist/examples/simple/context/Fragment_B.context.d.ts +0 -6
- package/dist/examples/simple/context/Fragment_B.context.js +0 -16
- package/dist/examples/simple/context/Fragment_B.context.js.map +0 -1
- package/dist/examples/simple/entities/EntityA.entity.d.ts +0 -8
- package/dist/examples/simple/entities/EntityA.entity.js +0 -22
- package/dist/examples/simple/entities/EntityA.entity.js.map +0 -1
- package/dist/examples/simple-http-server/components/http-error-handler.component.d.ts +0 -10
- package/dist/examples/simple-http-server/components/http-error-handler.component.js +0 -65
- package/dist/examples/simple-http-server/components/http-error-handler.component.js.map +0 -1
- package/dist/examples/simple-http-server/components/http-request-handler.component.d.ts +0 -3
- package/dist/examples/simple-http-server/components/http-request-handler.component.js +0 -8
- package/dist/examples/simple-http-server/components/http-request-handler.component.js.map +0 -1
- package/dist/examples/simple-http-server/concept.d.ts +0 -1
- package/dist/examples/simple-http-server/concept.js +0 -35
- package/dist/examples/simple-http-server/concept.js.map +0 -1
- package/dist/examples/simple-http-server/containers/http-server.container.d.ts +0 -11
- package/dist/examples/simple-http-server/containers/http-server.container.js +0 -73
- package/dist/examples/simple-http-server/containers/http-server.container.js.map +0 -1
- package/dist/examples/simple-http-server/containers/http-server.controller.d.ts +0 -7
- package/dist/examples/simple-http-server/containers/http-server.controller.js +0 -37
- package/dist/examples/simple-http-server/containers/http-server.controller.js.map +0 -1
- package/dist/examples/simple-http-server/containers/http-server.router.d.ts +0 -6
- package/dist/examples/simple-http-server/containers/http-server.router.js +0 -39
- package/dist/examples/simple-http-server/containers/http-server.router.js.map +0 -1
- package/dist/examples/simple-http-server/contexts/http-request.context.d.ts +0 -12
- package/dist/examples/simple-http-server/contexts/http-request.context.js +0 -49
- package/dist/examples/simple-http-server/contexts/http-request.context.js.map +0 -1
- package/dist/examples/simple-http-server/contexts/http-server.context.types.d.ts +0 -0
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js +0 -2
- package/dist/examples/simple-http-server/contexts/http-server.context.types.js.map +0 -1
- package/dist/examples/simple-http-server/contexts/http-server.namespace.d.ts +0 -10
- package/dist/examples/simple-http-server/contexts/http-server.namespace.js +0 -26
- package/dist/examples/simple-http-server/contexts/http-server.namespace.js.map +0 -1
- package/dist/examples/simple-http-server/controllers/orders.controller.d.ts +0 -5
- package/dist/examples/simple-http-server/controllers/orders.controller.js +0 -32
- package/dist/examples/simple-http-server/controllers/orders.controller.js.map +0 -1
- package/dist/examples/simple-http-server/controllers/users.controller.d.ts +0 -0
- package/dist/examples/simple-http-server/controllers/users.controller.js +0 -87
- package/dist/examples/simple-http-server/controllers/users.controller.js.map +0 -1
- package/dist/examples/simple-http-server/modules/simple-http-server.context.d.ts +0 -5
- package/dist/examples/simple-http-server/modules/simple-http-server.context.js +0 -25
- package/dist/examples/simple-http-server/modules/simple-http-server.context.js.map +0 -1
- package/dist/examples/simple-http-server/modules/simple-http-server.module.d.ts +0 -16
- package/dist/examples/simple-http-server/modules/simple-http-server.module.js +0 -8
- package/dist/examples/simple-http-server/modules/simple-http-server.module.js.map +0 -1
- package/dist/examples/simple-http-server/modules/simple-http-server.types.d.ts +0 -2
- package/dist/examples/simple-http-server/modules/simple-http-server.types.js +0 -3
- package/dist/examples/simple-http-server/modules/simple-http-server.types.js.map +0 -1
- package/dist/examples/simple-http-server/test.d.ts +0 -68
- package/dist/examples/simple-http-server/test.js +0 -162
- package/dist/examples/simple-http-server/test.js.map +0 -1
- package/dist/src/containers/A-Config/A-Config.container.d.ts +0 -7
- package/dist/src/containers/A-Config/A-Config.container.js +0 -65
- package/dist/src/containers/A-Config/A-Config.container.js.map +0 -1
- package/dist/src/containers/A-Config/A-Config.namespace.d.ts +0 -28
- package/dist/src/containers/A-Config/A-Config.namespace.js +0 -54
- package/dist/src/containers/A-Config/A-Config.namespace.js.map +0 -1
- package/dist/src/containers/A-Config/A-Config.types.d.ts +0 -12
- package/dist/src/containers/A-Config/A-Config.types.js +0 -3
- package/dist/src/containers/A-Config/A-Config.types.js.map +0 -1
- package/dist/src/containers/A-Config/components/ConfigReader.component.d.ts +0 -18
- package/dist/src/containers/A-Config/components/ConfigReader.component.js +0 -37
- package/dist/src/containers/A-Config/components/ConfigReader.component.js.map +0 -1
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.d.ts +0 -10
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.js +0 -37
- package/dist/src/containers/A-Config/components/ENVConfigReader.component.js.map +0 -1
- package/dist/src/containers/A-Config/components/FileConfigReader.component.d.ts +0 -11
- package/dist/src/containers/A-Config/components/FileConfigReader.component.js +0 -47
- package/dist/src/containers/A-Config/components/FileConfigReader.component.js.map +0 -1
- package/dist/src/containers/A-Errors/A-Errors.container.d.ts +0 -5
- package/dist/src/containers/A-Errors/A-Errors.container.js +0 -32
- package/dist/src/containers/A-Errors/A-Errors.container.js.map +0 -1
- package/dist/src/containers/A-Errors/A-Errors.namespace.d.ts +0 -40
- package/dist/src/containers/A-Errors/A-Errors.namespace.js +0 -76
- package/dist/src/containers/A-Errors/A-Errors.namespace.js.map +0 -1
- package/dist/src/containers/A-Errors/A-Errors.types.d.ts +0 -5
- package/dist/src/containers/A-Errors/A-Errors.types.js +0 -3
- package/dist/src/containers/A-Errors/A-Errors.types.js.map +0 -1
- package/dist/src/containers/A-Logger/A-Logger.container.d.ts +0 -6
- package/dist/src/containers/A-Logger/A-Logger.container.js +0 -41
- package/dist/src/containers/A-Logger/A-Logger.container.js.map +0 -1
- package/dist/src/containers/A-Logger/A-Logger.namespace.d.ts +0 -17
- package/dist/src/containers/A-Logger/A-Logger.namespace.js +0 -22
- package/dist/src/containers/A-Logger/A-Logger.namespace.js.map +0 -1
- package/dist/src/containers/A-Logger/A-Logger.types.d.ts +0 -0
- package/dist/src/containers/A-Logger/A-Logger.types.js +0 -2
- package/dist/src/containers/A-Logger/A-Logger.types.js.map +0 -1
- package/dist/src/containers/A-Logger/components/Logger.component.d.ts +0 -29
- package/dist/src/containers/A-Logger/components/Logger.component.js +0 -128
- package/dist/src/containers/A-Logger/components/Logger.component.js.map +0 -1
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.d.ts +0 -34
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js +0 -3
- package/dist/src/decorators/A-ConceptLifecycle/A-ConceptLifecycle.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.d.ts +0 -11
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js +0 -36
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.d.ts +0 -7
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js +0 -3
- package/dist/src/decorators/A-ConceptLifecycle/A-Load/A-Load.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.d.ts +0 -17
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js +0 -42
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.d.ts +0 -8
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js +0 -3
- package/dist/src/decorators/A-ConceptLifecycle/A-Run/A-Run.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-ConceptLifecycle/index.d.ts +0 -7
- package/dist/src/decorators/A-ConceptLifecycle/index.js +0 -11
- package/dist/src/decorators/A-ConceptLifecycle/index.js.map +0 -1
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.d.ts +0 -16
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.js +0 -36
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.js.map +0 -1
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.d.ts +0 -8
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js +0 -3
- package/dist/src/decorators/A-Define/Feature/Feature.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.d.ts +0 -14
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js +0 -24
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.js.map +0 -1
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.d.ts +0 -8
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js +0 -3
- package/dist/src/decorators/A-Define/Lifecycle/Lifecycle.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Define/index.d.ts +0 -7
- package/dist/src/decorators/A-Define/index.js +0 -10
- package/dist/src/decorators/A-Define/index.js.map +0 -1
- package/dist/src/decorators/A-Extend/A-Extend.decorator.d.ts +0 -18
- package/dist/src/decorators/A-Extend/A-Extend.decorator.js +0 -37
- package/dist/src/decorators/A-Extend/A-Extend.decorator.js.map +0 -1
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.d.ts +0 -21
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js +0 -3
- package/dist/src/decorators/A-Extend/A-Extend.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.d.ts +0 -0
- package/dist/src/decorators/A-Feature/A-Feature.decorator.js +0 -11
- package/dist/src/decorators/A-Feature/A-Feature.decorator.js.map +0 -1
- package/dist/src/decorators/A-Stage/A-Stage.decorator.d.ts +0 -13
- package/dist/src/decorators/A-Stage/A-Stage.decorator.js +0 -52
- package/dist/src/decorators/A-Stage/A-Stage.decorator.js.map +0 -1
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.d.ts +0 -2
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js +0 -3
- package/dist/src/decorators/A-Stage/A-Stage.decorator.types.js.map +0 -1
- package/dist/src/decorators/A_ConceptMethods.decorator.d.ts +0 -0
- package/dist/src/decorators/A_ConceptMethods.decorator.js +0 -2
- package/dist/src/decorators/A_ConceptMethods.decorator.js.map +0 -1
- package/dist/src/decorators/A_Lazy.decorator.d.ts +0 -5
- package/dist/src/decorators/A_Lazy.decorator.js +0 -20
- package/dist/src/decorators/A_Lazy.decorator.js.map +0 -1
- package/dist/src/global/A-Context/A-ContextFragment.class.d.ts +0 -12
- package/dist/src/global/A-Context/A-ContextFragment.class.js +0 -19
- package/dist/src/global/A-Context/A-ContextFragment.class.js.map +0 -1
- package/dist/src/global/A-Namespace/A_Namespace.class.d.ts +0 -47
- package/dist/src/global/A-Namespace/A_Namespace.class.js +0 -112
- package/dist/src/global/A-Namespace/A_Namespace.class.js.map +0 -1
- package/dist/src/global/A-Namespace/A_Namespace.types.d.ts +0 -19
- package/dist/src/global/A-Namespace/A_Namespace.types.js +0 -3
- package/dist/src/global/A-Namespace/A_Namespace.types.js.map +0 -1
- package/dist/src/managers/A_DependencyManager.class.d.ts +0 -24
- package/dist/src/managers/A_DependencyManager.class.js +0 -129
- package/dist/src/managers/A_DependencyManager.class.js.map +0 -1
- package/dist/src/storage/A_Component.storage.d.ts +0 -10
- package/dist/src/storage/A_Component.storage.js +0 -17
- package/dist/src/storage/A_Component.storage.js.map +0 -1
- package/dist/src/storage/A_Concept.storage.d.ts +0 -19
- package/dist/src/storage/A_Concept.storage.js +0 -29
- package/dist/src/storage/A_Concept.storage.js.map +0 -1
- package/dist/src/storage/A_Container.storage.d.ts +0 -8
- package/dist/src/storage/A_Container.storage.js +0 -17
- package/dist/src/storage/A_Container.storage.js.map +0 -1
- package/dist/src/storage/A_Inject.storage.d.ts +0 -9
- package/dist/src/storage/A_Inject.storage.js +0 -13
- package/dist/src/storage/A_Inject.storage.js.map +0 -1
- package/dist/src/types/A_DependencyManager.types.d.ts +0 -15
- package/dist/src/types/A_DependencyManager.types.js +0 -3
- package/dist/src/types/A_DependencyManager.types.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaas/a-concept",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.34",
|
|
4
4
|
"description": "A-Concept is a framework to build new Applications within or outside the ADAAS ecosystem. This framework is designed to be modular structure regardless environment and program goal.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -22,12 +22,16 @@
|
|
|
22
22
|
"scripts": {
|
|
23
23
|
"test": "jest",
|
|
24
24
|
"start": "nodemon ./tests/log.ts",
|
|
25
|
+
"example:simple": "nodemon ./examples/simple/concept.ts",
|
|
26
|
+
"example:simple:trace": "node -r tsconfig-paths/register -r ts-node/register -r ./trace-require.js ./examples/simple/concept.ts",
|
|
27
|
+
"example:http": "nodemon ./examples/simple-http-server/concept.ts",
|
|
28
|
+
"example:http:trace": "node -r tsconfig-paths/register -r ts-node/register -r ./trace-require.js ./examples/simple-http-server/concept.ts",
|
|
25
29
|
"publish": "npm run build && git add . && git commit -m \"new version created :: $(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[\",]//g')\" && npm version patch && npm publish --access public",
|
|
26
30
|
"preversion": "echo test",
|
|
27
31
|
"version": "echo git add .",
|
|
28
32
|
"postversion": "git push --no-verify && git push --tags --no-verify && echo \"\n======Version Pushed Successfully=====\n\" ",
|
|
29
33
|
"echo-version": "echo $npm_package_version",
|
|
30
|
-
"build": "tsc --declaration --project tsconfig.json && tscpaths -p tsconfig.json -s ./ -o ./dist
|
|
34
|
+
"build": "rm -rf ./dist && tsc --declaration --project tsconfig.build.json && tscpaths -p tsconfig.build.json -s ./ -o ./dist",
|
|
31
35
|
"test:simple": "nodemon ./examples/simple/concept.ts"
|
|
32
36
|
},
|
|
33
37
|
"repository": {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
|
|
2
2
|
import { ConfigReader } from "./components/ConfigReader.component";
|
|
3
|
-
import { A_Logger } from "../A-Logger/A-Logger.component";
|
|
4
3
|
import { A_Inject } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator";
|
|
5
4
|
import { A_Polyfills } from "@adaas/a-utils";
|
|
6
5
|
import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
|
|
@@ -9,14 +8,20 @@ import { ENVConfigReader } from "./components/ENVConfigReader.component";
|
|
|
9
8
|
import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
|
|
10
9
|
import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
|
|
11
10
|
import { A_Config } from "./A-Config.context";
|
|
11
|
+
import { A_TYPES__ContainerConstructor } from "@adaas/a-concept/global/A-Container/A-Container.types";
|
|
12
12
|
|
|
13
13
|
|
|
14
|
+
export class A_ConfigLoader extends A_Container {
|
|
14
15
|
|
|
16
|
+
private reader!: ConfigReader
|
|
15
17
|
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
19
|
+
constructor(params:Partial<A_TYPES__ContainerConstructor<['load', 'read']>>) {
|
|
20
|
+
super({
|
|
21
|
+
...params,
|
|
22
|
+
name:params.name || 'a-config-loader'
|
|
23
|
+
});
|
|
24
|
+
}
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
@A_Concept.Load()
|
|
@@ -50,6 +55,7 @@ export class A_ConfigLoader extends A_Container<['load', 'read']> {
|
|
|
50
55
|
@A_Concept.Load()
|
|
51
56
|
async readVariables(
|
|
52
57
|
@A_Inject(A_Config) config: A_Config,
|
|
58
|
+
@A_Inject(A_Scope) scope: A_Scope,
|
|
53
59
|
) {
|
|
54
60
|
await this.reader.inject(config);
|
|
55
61
|
}
|
|
@@ -58,4 +64,6 @@ export class A_ConfigLoader extends A_Container<['load', 'read']> {
|
|
|
58
64
|
|
|
59
65
|
|
|
60
66
|
|
|
67
|
+
|
|
68
|
+
|
|
61
69
|
const foo = new A_ConfigLoader({});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
+
import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
|
|
1
2
|
import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
|
|
2
3
|
import { A_Inject } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator";
|
|
3
4
|
import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
|
|
4
|
-
import { A_Polyfills } from "@adaas/a-utils";
|
|
5
|
-
import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
|
|
6
5
|
import { A_Config } from "../A-Config.context";
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
import { A_Concept } from "@adaas/a-concept/global/A-Concept/A_Concept.class";
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Config Reader
|
|
@@ -21,8 +19,9 @@ export class ConfigReader extends A_Component {
|
|
|
21
19
|
|
|
22
20
|
@A_Concept.Load()
|
|
23
21
|
async inject(
|
|
24
|
-
@A_Inject(A_Config) config: A_Config
|
|
22
|
+
@A_Inject(A_Config) config: A_Config,
|
|
25
23
|
) {
|
|
24
|
+
|
|
26
25
|
const data = this.read(config.CONFIG_PROPERTIES);
|
|
27
26
|
|
|
28
27
|
config.set(data);
|
|
@@ -8,6 +8,8 @@ export class A_Errors extends A_Fragment {
|
|
|
8
8
|
|
|
9
9
|
protected registeredErrors: Map<string, A_TYPES__Error | A_TYPES__ServerError> = new Map();
|
|
10
10
|
|
|
11
|
+
|
|
12
|
+
|
|
11
13
|
constructor(
|
|
12
14
|
params: Partial<A_TYPES__A_ErrorsConstructor>
|
|
13
15
|
) {
|
|
@@ -76,7 +78,6 @@ export class A_Errors extends A_Fragment {
|
|
|
76
78
|
*
|
|
77
79
|
* This method throws an error by its code.
|
|
78
80
|
*
|
|
79
|
-
* @param code
|
|
80
81
|
*/
|
|
81
82
|
// throw(code: A_CONSTANTS__ERROR_CODES | string): never {
|
|
82
83
|
// const template = this.get(code);
|
|
@@ -12,7 +12,6 @@ import { A_ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component
|
|
|
12
12
|
import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
|
|
13
13
|
import { A_TYPES__A_ExtendDecoratorConfig } from "../A-Feature/A-Feature.decorator.types";
|
|
14
14
|
|
|
15
|
-
|
|
16
15
|
/**
|
|
17
16
|
* A_Stage Decorator uses to extend basic A-Concept Stage methods inside Containers.
|
|
18
17
|
*
|
|
@@ -21,12 +20,12 @@ import { A_TYPES__A_ExtendDecoratorConfig } from "../A-Feature/A-Feature.decorat
|
|
|
21
20
|
* @param params
|
|
22
21
|
* @returns
|
|
23
22
|
*/
|
|
24
|
-
export function
|
|
23
|
+
export function A_Abstraction_Extend(
|
|
25
24
|
method: A_TYPES__ConceptStage,
|
|
26
25
|
config: Partial<A_TYPES__A_ExtendDecoratorConfig> = {}
|
|
27
26
|
) {
|
|
28
27
|
return function (
|
|
29
|
-
target: A_Container
|
|
28
|
+
target: A_Container | A_Component,
|
|
30
29
|
propertyKey: string,
|
|
31
30
|
descriptor: A_TYPES__A_AbstractionDecoratorDescriptor
|
|
32
31
|
) {
|
|
@@ -35,7 +34,7 @@ export function A_Abstraction(
|
|
|
35
34
|
|
|
36
35
|
let metaKey;
|
|
37
36
|
|
|
38
|
-
const
|
|
37
|
+
const abstractionKey = `${method}`;
|
|
39
38
|
|
|
40
39
|
switch (true) {
|
|
41
40
|
case target instanceof A_Container:
|
|
@@ -54,7 +53,7 @@ export function A_Abstraction(
|
|
|
54
53
|
}> = meta.get(metaKey) || new A_Meta();
|
|
55
54
|
|
|
56
55
|
// Set the metadata of the method to define a custom Stage with name
|
|
57
|
-
const existedMetaValue = existedMeta.get(
|
|
56
|
+
const existedMetaValue = existedMeta.get(abstractionKey) || [];
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
// Add the new method to the metadata
|
|
@@ -67,7 +66,7 @@ export function A_Abstraction(
|
|
|
67
66
|
});
|
|
68
67
|
|
|
69
68
|
// Set the metadata of the method to define a custom Feature with name
|
|
70
|
-
existedMeta.set(
|
|
69
|
+
existedMeta.set(abstractionKey, existedMetaValue);
|
|
71
70
|
|
|
72
71
|
|
|
73
72
|
// Update the metadata of the container with the new Stage definition
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
|
|
2
1
|
import {
|
|
3
2
|
A_TYPES__A_DefineDecorator_Meta,
|
|
4
3
|
A_TYPES__A_FeatureDecoratorConfig,
|
|
5
4
|
A_TYPES__A_FeatureDecoratorDescriptor,
|
|
6
5
|
} from "./A-Feature.decorator.types";
|
|
7
|
-
import {
|
|
8
|
-
import { A_TYPES__ContainerMeta_FeatureItem, A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.types";
|
|
6
|
+
import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
|
|
9
7
|
import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
|
|
8
|
+
import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
|
|
9
|
+
import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
|
|
10
|
+
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.types";
|
|
10
11
|
import { A_EntityMeta } from "@adaas/a-concept/global/A-Entity/A-Entity.meta";
|
|
11
12
|
import { A_ContainerMeta } from "@adaas/a-concept/global/A-Container/A-Container.meta";
|
|
12
13
|
import { A_ComponentMeta } from "@adaas/a-concept/global/A-Component/A-Component.meta";
|
|
13
14
|
import { A_TYPES__EntityMetaKey } from "@adaas/a-concept/global/A-Entity/A-Entity.types";
|
|
14
15
|
import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A-Component.types";
|
|
15
|
-
import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
|
|
16
16
|
import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
/**
|
|
20
19
|
* A-Feature decorator
|
|
21
20
|
*
|
|
@@ -33,12 +32,12 @@ export function A_Feature_Define(
|
|
|
33
32
|
config: Partial<A_TYPES__A_FeatureDecoratorConfig> = {}
|
|
34
33
|
) {
|
|
35
34
|
return function (
|
|
36
|
-
target: A_Container
|
|
35
|
+
target: A_Container | A_Entity | A_Component,
|
|
37
36
|
propertyKey: string,
|
|
38
37
|
descriptor: A_TYPES__A_FeatureDecoratorDescriptor
|
|
39
38
|
) {
|
|
40
39
|
|
|
41
|
-
const meta: A_EntityMeta | A_ContainerMeta | A_ComponentMeta = A_Context.meta(target.constructor);
|
|
40
|
+
const meta: A_EntityMeta | A_ContainerMeta | A_ComponentMeta = A_Context.meta(target.constructor as any);
|
|
42
41
|
|
|
43
42
|
let metaKey;
|
|
44
43
|
|
|
@@ -69,10 +68,15 @@ export function A_Feature_Define(
|
|
|
69
68
|
}> = meta.get(metaKey) || new A_Meta();
|
|
70
69
|
|
|
71
70
|
|
|
71
|
+
|
|
72
|
+
const handlerName = config.name || propertyKey;
|
|
73
|
+
const invoke = config.invoke !== false;
|
|
74
|
+
|
|
75
|
+
|
|
72
76
|
// Set the metadata of the method to define a custom Feature with name
|
|
73
77
|
existedMeta.set(propertyKey, {
|
|
74
|
-
name: `${target.constructor.name}.${
|
|
75
|
-
handler:
|
|
78
|
+
name: `${target.constructor.name}.${handlerName}`,
|
|
79
|
+
handler: handlerName,
|
|
76
80
|
template: config.template && config.template.length ? config.template.map(
|
|
77
81
|
item => ({
|
|
78
82
|
...item,
|
|
@@ -86,10 +90,33 @@ export function A_Feature_Define(
|
|
|
86
90
|
|
|
87
91
|
// Update the metadata of the container with the new Feature definition
|
|
88
92
|
A_Context
|
|
89
|
-
.meta(target.constructor)
|
|
93
|
+
.meta(target.constructor as any)
|
|
90
94
|
.set(
|
|
91
95
|
metaKey,
|
|
92
96
|
existedMeta
|
|
93
97
|
);
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
const originalMethod = descriptor.value!;
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
// Wrap the original method to add the call to `call`
|
|
105
|
+
// this helps to automatically call the container/entity/component method when it's called
|
|
106
|
+
descriptor.value = function (...args: any[]) {
|
|
107
|
+
|
|
108
|
+
// Call the original method
|
|
109
|
+
if (!invoke)
|
|
110
|
+
return originalMethod.apply(this, args);
|
|
111
|
+
else
|
|
112
|
+
originalMethod.apply(this, args);
|
|
113
|
+
|
|
114
|
+
// Call your `call` with the function name
|
|
115
|
+
if (typeof (this as any).call === "function" && invoke)
|
|
116
|
+
return (this as any).call(propertyKey);
|
|
117
|
+
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
return descriptor;
|
|
94
121
|
};
|
|
95
122
|
}
|
|
@@ -13,22 +13,22 @@ export type A_TYPES__A_Feature_Extend = {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
export type A_TYPES__A_FeatureDecoratorDescriptor =
|
|
16
|
+
TypedPropertyDescriptor<
|
|
17
|
+
((...args: any[]) => any)
|
|
18
|
+
|
|
|
19
|
+
((...args: any[]) => Promise<any>)
|
|
20
|
+
|
|
|
21
|
+
(() => any)
|
|
22
|
+
|
|
|
23
|
+
(() => Promise<any>)
|
|
24
|
+
>
|
|
25
|
+
|
|
16
26
|
|
|
17
|
-
TypedPropertyDescriptor<() => any>
|
|
18
|
-
|
|
|
19
|
-
TypedPropertyDescriptor<(
|
|
20
|
-
...args: any[]
|
|
21
|
-
) => any>
|
|
22
|
-
|
|
|
23
|
-
TypedPropertyDescriptor<(
|
|
24
|
-
...args: any[]
|
|
25
|
-
) => Promise<any>>
|
|
26
|
-
|
|
|
27
|
-
TypedPropertyDescriptor<() => Promise<any>>
|
|
28
27
|
|
|
29
28
|
|
|
30
29
|
export type A_TYPES__A_FeatureDecoratorConfig = {
|
|
31
30
|
name: string,
|
|
31
|
+
invoke: boolean,
|
|
32
32
|
channel: Array<typeof A_Channel>
|
|
33
33
|
template: Array<A_TYPES__A_FeatureTemplateItem>
|
|
34
34
|
}
|
|
@@ -74,7 +74,7 @@ export type A_TYPES__A_ExtendDecoratorConfig = {
|
|
|
74
74
|
* [!!] By default uses OR to join all provided items. If you need more complex Logic, please use Regexp instead
|
|
75
75
|
*/
|
|
76
76
|
scope: Array<
|
|
77
|
-
{ new(...args: any[]): A_Container
|
|
77
|
+
{ new(...args: any[]): A_Container }
|
|
78
78
|
| { new(...args: any[]): A_Entity }
|
|
79
79
|
| { new(...args: any[]): A_Component }
|
|
80
80
|
>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
|
|
2
1
|
import {
|
|
3
2
|
A_TYPES__A_InjectDecorator_EntityInjectionInstructions,
|
|
4
3
|
A_TYPES__A_InjectDecoratorReturn
|
|
5
4
|
} from "./A-Inject.decorator.types";
|
|
5
|
+
import { A_Component } from "@adaas/a-concept/global/A-Component/A-Component.class";
|
|
6
6
|
import { A_Fragment } from "@adaas/a-concept/global/A-Fragment/A-Fragment.class";
|
|
7
7
|
import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
|
|
8
8
|
import { A_Context } from "@adaas/a-concept/global/A-Context/A-Context.class";
|
|
@@ -10,7 +10,9 @@ import { A_TYPES__ComponentMetaKey } from "@adaas/a-concept/global/A-Component/A
|
|
|
10
10
|
import { A_Meta } from "@adaas/a-concept/global/A-Meta/A-Meta.class";
|
|
11
11
|
import { A_Feature } from "@adaas/a-concept/global/A-Feature/A-Feature.class";
|
|
12
12
|
import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class";
|
|
13
|
-
|
|
13
|
+
import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
|
|
14
|
+
import { A_TYPES__ContainerMetaKey } from "@adaas/a-concept/global/A-Container/A-Container.types";
|
|
15
|
+
import { A_CommonHelper } from "@adaas/a-utils";
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
|
|
@@ -65,9 +67,34 @@ export function A_Inject(
|
|
|
65
67
|
|
|
66
68
|
const method = methodName ? String(methodName) : 'constructor';
|
|
67
69
|
|
|
70
|
+
let metaKey;
|
|
71
|
+
|
|
72
|
+
switch (true) {
|
|
73
|
+
|
|
74
|
+
case target instanceof A_Component:
|
|
75
|
+
metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;
|
|
76
|
+
break;
|
|
77
|
+
|
|
78
|
+
case A_CommonHelper.isInheritedFrom(target, A_Component):
|
|
79
|
+
metaKey = A_TYPES__ComponentMetaKey.INJECTIONS;
|
|
80
|
+
break;
|
|
81
|
+
|
|
82
|
+
case A_CommonHelper.isInheritedFrom(target, A_Container):
|
|
83
|
+
metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;
|
|
84
|
+
break;
|
|
85
|
+
|
|
86
|
+
case target instanceof A_Container:
|
|
87
|
+
metaKey = A_TYPES__ContainerMetaKey.INJECTIONS;
|
|
88
|
+
break;
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
default:
|
|
92
|
+
throw new Error(`A-Inject cannot be defined on the ${target} level`);
|
|
93
|
+
}
|
|
94
|
+
|
|
68
95
|
const existedMeta = A_Context
|
|
69
96
|
.meta(target)
|
|
70
|
-
.get(
|
|
97
|
+
.get(metaKey)
|
|
71
98
|
|| new A_Meta();
|
|
72
99
|
|
|
73
100
|
|
|
@@ -83,7 +110,7 @@ export function A_Inject(
|
|
|
83
110
|
A_Context
|
|
84
111
|
.meta(target)
|
|
85
112
|
.set(
|
|
86
|
-
|
|
113
|
+
metaKey,
|
|
87
114
|
existedMeta
|
|
88
115
|
);
|
|
89
116
|
}
|
|
@@ -6,6 +6,7 @@ import { A_Fragment } from "@adaas/a-concept/global/A-Fragment/A-Fragment.class"
|
|
|
6
6
|
import { A_Scope } from "@adaas/a-concept/global/A-Scope/A-Scope.class";
|
|
7
7
|
import { ASEID } from "@adaas/a-utils";
|
|
8
8
|
|
|
9
|
+
|
|
9
10
|
export type A_TYPES__A_InjectDecoratorDescriptor = TypedPropertyDescriptor<(
|
|
10
11
|
...args: any[]
|
|
11
12
|
) => Promise<void>>
|
|
@@ -56,10 +57,10 @@ export type A_TYPES__A_InjectDecorator_Meta = Array<{
|
|
|
56
57
|
export type A_TYPES__A_InjectDecorator_Injectable =
|
|
57
58
|
{ new(...args: any[]): A_Fragment }
|
|
58
59
|
| { new(...args: any[]): A_Component }
|
|
59
|
-
| { new(...args: any[]): A_Container
|
|
60
|
+
| { new(...args: any[]): A_Container }
|
|
60
61
|
| { new(...args: any[]): A_Scope }
|
|
61
62
|
| { new(...args: any[]): A_Feature }
|
|
62
|
-
| { new(...args: any[]): A_Entity
|
|
63
|
+
| { new(...args: any[]): A_Entity };
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
export type A_TYPES__A_InjectDecorator_EntityInjectionInstructions = {
|
|
@@ -71,7 +72,7 @@ export type A_TYPES__A_InjectDecorator_EntityInjectionInstructions = {
|
|
|
71
72
|
export type A_TYPES__A_InjectDecorator_EntityInjectionQuery = {
|
|
72
73
|
aseid: string | ASEID,
|
|
73
74
|
id: string,
|
|
74
|
-
type: { new(...args: any[]): A_Entity
|
|
75
|
+
type: { new(...args: any[]): A_Entity },
|
|
75
76
|
entity: string
|
|
76
77
|
}
|
|
77
78
|
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { A_Abstraction_Extend } from "@adaas/a-concept/decorators/A-Abstraction/A-Abstraction-Extend.decorator";
|
|
2
|
+
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
3
|
+
import { A_TYPES__A_AbstractionConstructor, A_TYPES__AbstractionState } from "./A-Abstraction.types";
|
|
4
|
+
import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export class A_Abstraction {
|
|
8
|
+
|
|
9
|
+
public name: string;
|
|
10
|
+
protected features: A_Feature[] = [];
|
|
11
|
+
protected _current?: A_Feature;
|
|
12
|
+
protected _index: number = 0;
|
|
13
|
+
|
|
14
|
+
state: A_TYPES__AbstractionState = A_TYPES__AbstractionState.INITIALIZED;
|
|
15
|
+
error?: A_Error
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Define a new A-Abstraction
|
|
21
|
+
*/
|
|
22
|
+
static get Extend(): typeof A_Abstraction_Extend {
|
|
23
|
+
return A_Abstraction_Extend;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
constructor(params: A_TYPES__Required<Partial<A_TYPES__A_AbstractionConstructor>, ['name', 'features']>) {
|
|
29
|
+
this.name = params.name;
|
|
30
|
+
this.features = params.features.map(def => new A_Feature(def));
|
|
31
|
+
|
|
32
|
+
this._current = this.features[0];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
get feature(): A_Feature | undefined {
|
|
37
|
+
return this._current;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
[Symbol.iterator](): Iterator<A_Feature, any> {
|
|
41
|
+
return {
|
|
42
|
+
// Custom next method
|
|
43
|
+
next: (): IteratorResult<A_Feature, any> => {
|
|
44
|
+
if (!this.isDone()) {
|
|
45
|
+
|
|
46
|
+
this._current = this.features[this._index];
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
value: this._current,
|
|
50
|
+
done: false
|
|
51
|
+
};
|
|
52
|
+
} else {
|
|
53
|
+
|
|
54
|
+
this._current = undefined; // Reset current on end
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
value: undefined,
|
|
58
|
+
done: true
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* This method moves the feature to the next stage
|
|
67
|
+
*
|
|
68
|
+
* @param stage
|
|
69
|
+
*/
|
|
70
|
+
next(stage) {
|
|
71
|
+
const stageIndex = this.features.indexOf(stage);
|
|
72
|
+
|
|
73
|
+
this._index = stageIndex + 1;
|
|
74
|
+
|
|
75
|
+
if (this._index >= this.features.length) {
|
|
76
|
+
this.completed();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async completed(): Promise<void> {
|
|
81
|
+
this.state = A_TYPES__AbstractionState.COMPLETED;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* This method marks the feature as failed and throws an error
|
|
87
|
+
* Uses to interrupt or end the feature processing
|
|
88
|
+
*
|
|
89
|
+
* @param error
|
|
90
|
+
*/
|
|
91
|
+
async failed(
|
|
92
|
+
error: Error | A_Error | unknown
|
|
93
|
+
): Promise<void> {
|
|
94
|
+
this.error = error as A_Error;
|
|
95
|
+
this.state = A_TYPES__AbstractionState.FAILED;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* This method checks if the A-Feature is done
|
|
101
|
+
*
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
isDone(): boolean {
|
|
105
|
+
return !this.feature
|
|
106
|
+
|| this._index >= this.features.length
|
|
107
|
+
|| this.state === A_TYPES__AbstractionState.COMPLETED
|
|
108
|
+
|| this.state === A_TYPES__AbstractionState.FAILED;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
async process() {
|
|
113
|
+
if (this.isDone())
|
|
114
|
+
return;
|
|
115
|
+
try {
|
|
116
|
+
this.state = A_TYPES__AbstractionState.PROCESSING;
|
|
117
|
+
|
|
118
|
+
for (const feature of this.features) {
|
|
119
|
+
|
|
120
|
+
await feature.process();
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
await this.completed();
|
|
124
|
+
|
|
125
|
+
} catch (error) {
|
|
126
|
+
await this.failed(error);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
}
|
|
130
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { A_TYPES__Required } from "@adaas/a-utils";
|
|
2
|
+
import { A_Container } from "../A-Container/A-Container.class";
|
|
3
|
+
import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
4
|
+
import { A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types";
|
|
5
|
+
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
export type A_TYPES__A_AbstractionConstructor = {
|
|
10
|
+
name: string,
|
|
11
|
+
features: Array<A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps']>>
|
|
12
|
+
} & A_TYPES__ScopeConstructor
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
export enum A_TYPES__AbstractionState {
|
|
17
|
+
INITIALIZED = "INITIALIZED",
|
|
18
|
+
PROCESSING = "PROCESSING",
|
|
19
|
+
|
|
20
|
+
COMPLETED = "COMPLETED",
|
|
21
|
+
FAILED = "FAILED",
|
|
22
|
+
}
|
|
@@ -38,8 +38,6 @@ export class A_Channel<
|
|
|
38
38
|
async call<_Resp extends any>(prop: A_TYPES__A_ChannelAggregateMethods<T>, params?: Partial<A_TYPES__A_ChannelCallParams>): Promise<_Resp> {
|
|
39
39
|
// do HTTP Call or just inject class or whatever you want
|
|
40
40
|
|
|
41
|
-
console.log('Calling method', prop);
|
|
42
|
-
|
|
43
41
|
return {} as _Resp;
|
|
44
42
|
}
|
|
45
43
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { A_Container } from "@adaas/a-concept/global/A-Container/A-Container.class";
|
|
1
2
|
import { A_Component } from "../A-Component/A-Component.class"
|
|
2
3
|
import { A_TYPES__ContainerCallParams } from "../A-Container/A-Container.types"
|
|
3
4
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class"
|
|
@@ -80,7 +81,7 @@ export type A_TYPES__A_ExecutableMethods<T> = {
|
|
|
80
81
|
/**
|
|
81
82
|
* Returns a string set of possible methods that could be called on a set of provided set of A-Components
|
|
82
83
|
*/
|
|
83
|
-
export type A_TYPES__A_ChannelAggregateMethods<TClasses extends A_Component[]> = {
|
|
84
|
+
export type A_TYPES__A_ChannelAggregateMethods<TClasses extends (A_Component | A_Container)[]> = {
|
|
84
85
|
[K in keyof TClasses]: TClasses[K] extends infer Instance
|
|
85
86
|
? A_TYPES__A_ExecutableMethods<Instance>
|
|
86
87
|
: never;
|