@adaas/a-concept 0.0.33 → 0.0.35
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-Fragment/A-Fragment.class.d.ts +1 -3
- 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/multi-container/containers/Schedule.container.ts +1 -6
- 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-Fragment/A-Fragment.class.ts +1 -1
- 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
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A_TYPES__ContainerConstructor } from "./A-Container.types";
|
|
2
2
|
import { A_TYPES__Required } from "@adaas/a-utils";
|
|
3
3
|
import { A_Context } from "../A-Context/A-Context.class";
|
|
4
4
|
import { A_Scope } from "../A-Scope/A-Scope.class";
|
|
5
|
-
import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
5
|
+
import { A_TYPES__FeatureCallParams, A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -17,22 +17,16 @@ import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
|
17
17
|
* - Microservice
|
|
18
18
|
* - etc.
|
|
19
19
|
*/
|
|
20
|
-
export class A_Container
|
|
21
|
-
_FeatureNames extends Array<string> = any
|
|
22
|
-
> {
|
|
20
|
+
export class A_Container {
|
|
23
21
|
// scope!: A_Scope
|
|
24
22
|
|
|
25
|
-
protected readonly config!: Partial<A_TYPES__ContainerConstructor<
|
|
23
|
+
protected readonly config!: Partial<A_TYPES__ContainerConstructor<any>>;
|
|
26
24
|
|
|
27
25
|
/**
|
|
28
26
|
* Promise that will be resolved when the container is ready to be used.
|
|
29
27
|
*/
|
|
30
28
|
ready!: Promise<void>;
|
|
31
29
|
|
|
32
|
-
get exports(): _FeatureNames {
|
|
33
|
-
return this.config.exports || [] as any;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
30
|
get name() {
|
|
37
31
|
return this.config.name || this.constructor.name;
|
|
38
32
|
}
|
|
@@ -46,7 +40,7 @@ export class A_Container<
|
|
|
46
40
|
/**
|
|
47
41
|
* Configuration of the container that will be used to run it.
|
|
48
42
|
*/
|
|
49
|
-
config: Partial<A_TYPES__ContainerConstructor<
|
|
43
|
+
config: Partial<A_TYPES__ContainerConstructor<any>>
|
|
50
44
|
) {
|
|
51
45
|
this.config = config;
|
|
52
46
|
|
|
@@ -58,104 +52,31 @@ export class A_Container<
|
|
|
58
52
|
|
|
59
53
|
}
|
|
60
54
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* This method allows to call the lifecycle method of the container as well as any other Feature defined for it
|
|
65
|
-
*
|
|
66
|
-
* @param lifecycleMethod
|
|
67
|
-
* @param args
|
|
68
|
-
*/
|
|
69
|
-
async call(
|
|
70
|
-
/**
|
|
71
|
-
* A-Feature method name to be called
|
|
72
|
-
*/
|
|
73
|
-
feature: _FeatureNames[number],
|
|
74
|
-
): Promise<any>
|
|
75
|
-
async call(
|
|
76
|
-
/**
|
|
77
|
-
* A-Feature name to be called
|
|
78
|
-
*/
|
|
79
|
-
params: A_TYPES__Required<Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>, ['name']>,
|
|
80
|
-
): Promise<any>
|
|
81
|
-
|
|
82
|
-
async call(
|
|
83
|
-
/**
|
|
84
|
-
* A-Feature method name to be called
|
|
85
|
-
*/
|
|
86
|
-
feature: _FeatureNames[number],
|
|
87
|
-
/**
|
|
88
|
-
* Parameters to provide additional data to the feature
|
|
89
|
-
*/
|
|
90
|
-
params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>,
|
|
91
|
-
): Promise<any>
|
|
92
55
|
|
|
93
56
|
async call(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
)
|
|
97
|
-
|
|
98
|
-
const feature: string = typeof param1 === 'string'
|
|
99
|
-
? param1
|
|
100
|
-
: param1.name;
|
|
101
|
-
const params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>> = typeof param1 === 'string'
|
|
102
|
-
? param2 || {}
|
|
103
|
-
: param1;
|
|
104
|
-
|
|
105
|
-
const newFeature = A_Context.feature(A_Context.scope(this), this, feature, params);
|
|
57
|
+
feature: string,
|
|
58
|
+
params: Partial<A_TYPES__FeatureCallParams> = {}
|
|
59
|
+
) {
|
|
60
|
+
const newFeature = A_Context.feature(this.Scope, this, feature, params);
|
|
106
61
|
|
|
107
62
|
return await newFeature.process();
|
|
108
63
|
}
|
|
109
64
|
|
|
110
65
|
|
|
111
|
-
|
|
112
|
-
|
|
113
66
|
/**
|
|
114
67
|
* This method allows to get a feature Definition for the future reuse with custom Feature classes
|
|
115
68
|
*
|
|
116
69
|
* @param feature
|
|
117
70
|
*/
|
|
118
71
|
feature(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
*/
|
|
122
|
-
feature: _FeatureNames[number],
|
|
123
|
-
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
124
|
-
feature(
|
|
125
|
-
/**
|
|
126
|
-
* A-Feature name to be called
|
|
127
|
-
*/
|
|
128
|
-
params: A_TYPES__Required<Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>, ['name']>,
|
|
129
|
-
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
130
|
-
|
|
131
|
-
feature(
|
|
132
|
-
/**
|
|
133
|
-
* A-Feature method name to be called
|
|
134
|
-
*/
|
|
135
|
-
feature: _FeatureNames[number],
|
|
136
|
-
/**
|
|
137
|
-
* Parameters to provide additional data to the feature
|
|
138
|
-
*/
|
|
139
|
-
params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>,
|
|
140
|
-
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
141
|
-
|
|
142
|
-
feature(
|
|
143
|
-
param1: _FeatureNames[number] | A_TYPES__Required<Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>, ['name']>,
|
|
144
|
-
param2?: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>>
|
|
72
|
+
feature: string,
|
|
73
|
+
params: Partial<A_TYPES__FeatureCallParams> = {}
|
|
145
74
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']> {
|
|
146
75
|
|
|
147
|
-
const feature: string = typeof param1 === 'string'
|
|
148
|
-
? param1
|
|
149
|
-
: param1.name;
|
|
150
|
-
const params: Partial<A_TYPES__ContainerCallParams<_FeatureNames[number]>> = typeof param1 === 'string'
|
|
151
|
-
? param2 || {}
|
|
152
|
-
: param1;
|
|
153
|
-
|
|
154
76
|
return A_Context.featureDefinition(this.Scope, this, feature, params);
|
|
155
77
|
}
|
|
156
78
|
|
|
157
79
|
|
|
158
|
-
|
|
159
80
|
// ==============================================================
|
|
160
81
|
// ======================= HOOKS ================================
|
|
161
82
|
// ==============================================================
|
|
@@ -1,15 +1,48 @@
|
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types";
|
|
1
2
|
import { A_TYPES__ConceptAbstractionMeta, A_TYPES__ConceptStage } from "../A-Concept/A_Concept.types";
|
|
2
3
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
3
4
|
import {
|
|
4
5
|
A_TYPES__ContainerMeta,
|
|
5
6
|
A_TYPES__ContainerMetaKey
|
|
6
7
|
} from "./A-Container.types";
|
|
8
|
+
import { A_TYPES__A_DefineDecorator_Meta } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator.types";
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
export class A_ContainerMeta extends A_Meta<A_TYPES__ContainerMeta> {
|
|
11
13
|
|
|
12
14
|
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Allows to get all the injections for a given handler
|
|
18
|
+
*
|
|
19
|
+
* @param handler
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
injections(
|
|
23
|
+
handler: string
|
|
24
|
+
): A_TYPES__A_InjectDecorator_Meta {
|
|
25
|
+
const injections = this.get(A_TYPES__ContainerMetaKey.INJECTIONS);
|
|
26
|
+
|
|
27
|
+
const args = injections?.get(handler) || [];
|
|
28
|
+
|
|
29
|
+
return args;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Returns all features defined in the Container
|
|
34
|
+
*
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
features(): Array<A_TYPES__A_DefineDecorator_Meta> {
|
|
38
|
+
|
|
39
|
+
const features = this.get(A_TYPES__ContainerMetaKey.FEATURES);
|
|
40
|
+
|
|
41
|
+
return features?.toArray()
|
|
42
|
+
// returns all extensions that match the feature
|
|
43
|
+
.map(([, feature]) => feature) || [];
|
|
44
|
+
}
|
|
45
|
+
|
|
13
46
|
/**
|
|
14
47
|
* Returns a set of instructions to run proper methods in Container during A-Concept Stage
|
|
15
48
|
*
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
A_CommonHelper,
|
|
3
|
+
A_Polyfills,
|
|
4
|
+
A_TYPES__Required,
|
|
5
|
+
} from "@adaas/a-utils";
|
|
2
6
|
import { A_Component } from "../A-Component/A-Component.class";
|
|
3
7
|
import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
4
8
|
import { A_Feature } from "../A-Feature/A-Feature.class";
|
|
@@ -8,15 +12,15 @@ import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Sc
|
|
|
8
12
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
9
13
|
import { A_ComponentMeta } from "../A-Component/A-Component.meta";
|
|
10
14
|
import { A_ContainerMeta } from "../A-Container/A-Container.meta";
|
|
11
|
-
import { A_Concept } from "../A-Concept/A_Concept.class";
|
|
12
15
|
import { A_TYPES__EntityBaseMethod, A_TYPES__EntityMetaKey } from "../A-Entity/A-Entity.types";
|
|
13
16
|
import { A_Entity } from "../A-Entity/A-Entity.class";
|
|
14
17
|
import { A_EntityMeta } from "../A-Entity/A-Entity.meta";
|
|
15
18
|
import { A_TYPES__FeatureConstructor } from "../A-Feature/A-Feature.types";
|
|
16
19
|
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
|
|
17
|
-
import { A_TYPES__A_DefineDecorator_Meta, A_TYPES__A_FeatureDecoratorConfig } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator.types";
|
|
18
20
|
import { A_TYPES__ContainerMetaKey } from "../A-Container/A-Container.types";
|
|
19
21
|
import { A_TYPES__ComponentMetaKey } from "../A-Component/A-Component.types";
|
|
22
|
+
import { A_TYPES__ConceptStage } from "../A-Concept/A_Concept.types";
|
|
23
|
+
|
|
20
24
|
|
|
21
25
|
|
|
22
26
|
/**
|
|
@@ -33,25 +37,19 @@ export class A_Context {
|
|
|
33
37
|
/**
|
|
34
38
|
* A set of globally registered containers.
|
|
35
39
|
*/
|
|
36
|
-
protected containers: WeakMap<A_Container
|
|
40
|
+
protected containers: WeakMap<A_Container, A_Scope> = new WeakMap();
|
|
37
41
|
|
|
38
42
|
/**
|
|
39
43
|
* A set of globally registered features.
|
|
40
44
|
*/
|
|
41
45
|
protected features: WeakMap<A_Feature, A_Scope> = new WeakMap();
|
|
42
46
|
|
|
43
|
-
/**
|
|
44
|
-
* A set of globally registered concepts.
|
|
45
|
-
*/
|
|
46
|
-
protected concepts: WeakMap<A_Concept<any>, A_Scope> = new WeakMap();
|
|
47
|
-
|
|
48
47
|
|
|
49
48
|
/**
|
|
50
49
|
* Uses to store the scope of every element in the program.
|
|
51
50
|
*/
|
|
52
51
|
protected registry: WeakMap<
|
|
53
|
-
|
|
54
|
-
A_Container<any> |
|
|
52
|
+
A_Container |
|
|
55
53
|
A_Feature |
|
|
56
54
|
A_Component |
|
|
57
55
|
A_Fragment |
|
|
@@ -65,7 +63,6 @@ export class A_Context {
|
|
|
65
63
|
/**
|
|
66
64
|
* A set of allocated scopes per every element in the program.
|
|
67
65
|
*/
|
|
68
|
-
protected conceptsMeta: Map<typeof A_Concept.constructor, A_Meta<any>> = new Map();
|
|
69
66
|
protected containersMeta: Map<typeof A_Container.constructor, A_ContainerMeta> = new Map();
|
|
70
67
|
protected componentsMeta: Map<typeof A_Component, A_ComponentMeta> = new Map();
|
|
71
68
|
protected entitiesMeta: Map<typeof A_Entity.constructor, A_EntityMeta> = new Map();
|
|
@@ -80,7 +77,11 @@ export class A_Context {
|
|
|
80
77
|
private _root!: A_Scope
|
|
81
78
|
|
|
82
79
|
|
|
83
|
-
private constructor() {
|
|
80
|
+
private constructor() {
|
|
81
|
+
this._root = new A_Scope({
|
|
82
|
+
name: 'root'
|
|
83
|
+
});
|
|
84
|
+
}
|
|
84
85
|
|
|
85
86
|
|
|
86
87
|
|
|
@@ -113,7 +114,6 @@ export class A_Context {
|
|
|
113
114
|
|
|
114
115
|
|
|
115
116
|
|
|
116
|
-
|
|
117
117
|
static allocate(
|
|
118
118
|
component: any,
|
|
119
119
|
importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
|
|
@@ -123,11 +123,11 @@ export class A_Context {
|
|
|
123
123
|
importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
|
|
124
124
|
): A_Scope
|
|
125
125
|
static allocate(
|
|
126
|
-
container: A_Container
|
|
126
|
+
container: A_Container,
|
|
127
127
|
importing: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
|
|
128
128
|
): A_Scope
|
|
129
129
|
static allocate(
|
|
130
|
-
param1: A_Container
|
|
130
|
+
param1: A_Container | A_Feature | A_Component | any,
|
|
131
131
|
param2: Partial<A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig>
|
|
132
132
|
): A_Scope {
|
|
133
133
|
|
|
@@ -135,24 +135,17 @@ export class A_Context {
|
|
|
135
135
|
|
|
136
136
|
const newScope = new A_Scope(param2, param2);
|
|
137
137
|
|
|
138
|
-
if (!instance._root)
|
|
139
|
-
instance._root = newScope;
|
|
140
|
-
|
|
141
138
|
switch (true) {
|
|
142
139
|
case param1 instanceof A_Container:
|
|
143
140
|
instance.containers.set(param1, newScope);
|
|
141
|
+
|
|
144
142
|
break;
|
|
145
143
|
|
|
146
144
|
case param1 instanceof A_Feature:
|
|
147
145
|
instance.features.set(param1, newScope);
|
|
148
|
-
break;
|
|
149
|
-
|
|
150
|
-
case param1 instanceof A_Concept:
|
|
151
|
-
instance.concepts.set(param1, newScope);
|
|
152
146
|
|
|
153
147
|
break;
|
|
154
148
|
|
|
155
|
-
|
|
156
149
|
default:
|
|
157
150
|
throw new Error(`[!] A-Concept Context: Unknown type of the parameter.`);
|
|
158
151
|
}
|
|
@@ -168,7 +161,7 @@ export class A_Context {
|
|
|
168
161
|
container: typeof A_Container,
|
|
169
162
|
): A_ContainerMeta
|
|
170
163
|
static meta(
|
|
171
|
-
container: A_Container
|
|
164
|
+
container: A_Container,
|
|
172
165
|
): A_ContainerMeta
|
|
173
166
|
static meta(
|
|
174
167
|
entity: A_Entity,
|
|
@@ -183,17 +176,14 @@ export class A_Context {
|
|
|
183
176
|
component: A_Component,
|
|
184
177
|
): A_ComponentMeta
|
|
185
178
|
static meta<T extends Record<string, any>>(
|
|
186
|
-
|
|
187
|
-
): A_Meta<T>
|
|
188
|
-
static meta<T extends Record<string, any>>(
|
|
189
|
-
param1: A_Container<any>
|
|
190
|
-
| typeof A_Container
|
|
179
|
+
param1: typeof A_Component | typeof A_Container | A_Container
|
|
191
180
|
| A_Component
|
|
192
|
-
| typeof A_Component
|
|
193
181
|
| A_Entity
|
|
194
182
|
| typeof A_Entity
|
|
195
183
|
| { new(...args: any[]): any }
|
|
196
184
|
): A_ContainerMeta | A_ComponentMeta | A_Meta<T> {
|
|
185
|
+
|
|
186
|
+
|
|
197
187
|
const instance = this.getInstance();
|
|
198
188
|
|
|
199
189
|
let metaStorage: WeakMap<typeof A_Container.constructor, A_Meta<any>>;
|
|
@@ -213,7 +203,7 @@ export class A_Context {
|
|
|
213
203
|
|
|
214
204
|
case A_CommonHelper.isInheritedFrom(param1, A_Container): {
|
|
215
205
|
metaStorage = instance.containersMeta;
|
|
216
|
-
property = param1 as typeof A_Container
|
|
206
|
+
property = param1 as typeof A_Container;
|
|
217
207
|
metaType = A_ContainerMeta;
|
|
218
208
|
|
|
219
209
|
break;
|
|
@@ -260,11 +250,13 @@ export class A_Context {
|
|
|
260
250
|
}
|
|
261
251
|
}
|
|
262
252
|
|
|
253
|
+
|
|
263
254
|
if (!metaStorage.has(property)) {
|
|
264
255
|
const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new metaType();
|
|
265
256
|
metaStorage.set(property, new metaType().from(inheritMeta as any));
|
|
266
257
|
}
|
|
267
258
|
|
|
259
|
+
|
|
268
260
|
return metaStorage.get(property)!;
|
|
269
261
|
}
|
|
270
262
|
|
|
@@ -277,10 +269,7 @@ export class A_Context {
|
|
|
277
269
|
component: A_Component
|
|
278
270
|
): A_Scope
|
|
279
271
|
static scope(
|
|
280
|
-
|
|
281
|
-
): A_Scope
|
|
282
|
-
static scope(
|
|
283
|
-
container: A_Container<any>
|
|
272
|
+
container: A_Container
|
|
284
273
|
): A_Scope
|
|
285
274
|
static scope(
|
|
286
275
|
feature: A_Fragment
|
|
@@ -289,7 +278,7 @@ export class A_Context {
|
|
|
289
278
|
feature: A_Feature
|
|
290
279
|
): A_Scope
|
|
291
280
|
static scope(
|
|
292
|
-
param1: A_Feature | A_Container
|
|
281
|
+
param1: A_Feature | A_Container | A_Component | A_Entity | A_Fragment
|
|
293
282
|
): A_Scope | undefined {
|
|
294
283
|
|
|
295
284
|
const instance = this.getInstance();
|
|
@@ -301,9 +290,6 @@ export class A_Context {
|
|
|
301
290
|
case param1 instanceof A_Feature:
|
|
302
291
|
return instance.features.get(param1);
|
|
303
292
|
|
|
304
|
-
case param1 instanceof A_Concept:
|
|
305
|
-
return instance.concepts.get(param1);
|
|
306
|
-
|
|
307
293
|
case param1 instanceof A_Entity:
|
|
308
294
|
return instance.registry.get(param1);
|
|
309
295
|
|
|
@@ -351,16 +337,16 @@ export class A_Context {
|
|
|
351
337
|
* @param scope
|
|
352
338
|
* @returns
|
|
353
339
|
*/
|
|
354
|
-
static featureDefinition
|
|
340
|
+
static featureDefinition(
|
|
355
341
|
scope: A_Scope,
|
|
356
|
-
entity: A_Entity
|
|
357
|
-
feature: A_TYPES__EntityBaseMethod | string |
|
|
342
|
+
entity: A_Entity,
|
|
343
|
+
feature: A_TYPES__EntityBaseMethod | string | RegExp,
|
|
358
344
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
359
345
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
360
|
-
static featureDefinition
|
|
346
|
+
static featureDefinition(
|
|
361
347
|
scope: A_Scope,
|
|
362
|
-
container: A_Container
|
|
363
|
-
feature:
|
|
348
|
+
container: A_Container,
|
|
349
|
+
feature: string,
|
|
364
350
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
365
351
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
366
352
|
static featureDefinition(
|
|
@@ -369,10 +355,10 @@ export class A_Context {
|
|
|
369
355
|
feature: string,
|
|
370
356
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
371
357
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
372
|
-
static featureDefinition
|
|
358
|
+
static featureDefinition(
|
|
373
359
|
scope: A_Scope,
|
|
374
|
-
param1: A_Component
|
|
375
|
-
param2: string
|
|
360
|
+
param1: A_Component | A_Container | A_Entity,
|
|
361
|
+
param2: string,
|
|
376
362
|
param3?: Partial<A_TYPES__ScopeConstructor>
|
|
377
363
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']> {
|
|
378
364
|
const instance = this.getInstance();
|
|
@@ -420,14 +406,18 @@ export class A_Context {
|
|
|
420
406
|
case component instanceof A_Container:
|
|
421
407
|
metaKey = A_TYPES__ContainerMetaKey.FEATURES
|
|
422
408
|
break;
|
|
423
|
-
case component instanceof A_Component:
|
|
409
|
+
case component instanceof A_Component: {
|
|
424
410
|
metaKey = A_TYPES__ComponentMetaKey.FEATURES
|
|
411
|
+
}
|
|
425
412
|
break;
|
|
426
413
|
default:
|
|
427
414
|
throw new Error(`A-Feature cannot be defined on the ${component} level`);
|
|
428
415
|
}
|
|
429
416
|
|
|
430
|
-
|
|
417
|
+
|
|
418
|
+
const featureDefinition = this.meta(component)
|
|
419
|
+
.get(metaKey)
|
|
420
|
+
.get(param2);
|
|
431
421
|
|
|
432
422
|
if (!featureDefinition)
|
|
433
423
|
throw new Error(`[!] A-Concept Context: Feature not found.`);
|
|
@@ -474,7 +464,95 @@ export class A_Context {
|
|
|
474
464
|
};
|
|
475
465
|
}
|
|
476
466
|
|
|
467
|
+
/**
|
|
468
|
+
* This method returns a constructor params to create a new feature
|
|
469
|
+
*
|
|
470
|
+
* @param scope
|
|
471
|
+
* @returns
|
|
472
|
+
*/
|
|
473
|
+
static abstractionDefinition(
|
|
474
|
+
scope: A_Scope,
|
|
475
|
+
entity: A_Entity,
|
|
476
|
+
feature: A_TYPES__ConceptStage,
|
|
477
|
+
params?: Partial<A_TYPES__ScopeConstructor>
|
|
478
|
+
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
479
|
+
static abstractionDefinition(
|
|
480
|
+
scope: A_Scope,
|
|
481
|
+
container: A_Container,
|
|
482
|
+
feature: A_TYPES__ConceptStage,
|
|
483
|
+
params?: Partial<A_TYPES__ScopeConstructor>
|
|
484
|
+
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
485
|
+
static abstractionDefinition(
|
|
486
|
+
scope: A_Scope,
|
|
487
|
+
component: A_Component,
|
|
488
|
+
feature: A_TYPES__ConceptStage,
|
|
489
|
+
params?: Partial<A_TYPES__ScopeConstructor>
|
|
490
|
+
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
491
|
+
static abstractionDefinition(
|
|
492
|
+
scope: A_Scope,
|
|
493
|
+
param1: A_Component | A_Container | A_Entity,
|
|
494
|
+
param2: A_TYPES__ConceptStage,
|
|
495
|
+
param3?: Partial<A_TYPES__ScopeConstructor>
|
|
496
|
+
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']> {
|
|
497
|
+
const instance = this.getInstance();
|
|
477
498
|
|
|
499
|
+
const component = param1;
|
|
500
|
+
const config = param3 || {};
|
|
501
|
+
|
|
502
|
+
let metaKey;
|
|
503
|
+
|
|
504
|
+
switch (true) {
|
|
505
|
+
case component instanceof A_Entity:
|
|
506
|
+
metaKey = A_TYPES__EntityMetaKey.FEATURES;
|
|
507
|
+
break;
|
|
508
|
+
case component instanceof A_Container:
|
|
509
|
+
metaKey = A_TYPES__ContainerMetaKey.ABSTRACTIONS
|
|
510
|
+
break;
|
|
511
|
+
case component instanceof A_Component: {
|
|
512
|
+
metaKey = A_TYPES__ComponentMetaKey.ABSTRACTIONS
|
|
513
|
+
}
|
|
514
|
+
break;
|
|
515
|
+
default:
|
|
516
|
+
throw new Error(`A-Feature cannot be defined on the ${component} level`);
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
const featureDefinition = this.meta(component)
|
|
520
|
+
.get(metaKey)
|
|
521
|
+
.get(param2) || []
|
|
522
|
+
|
|
523
|
+
|
|
524
|
+
const steps: A_TYPES__A_StageStep[] = [
|
|
525
|
+
...featureDefinition
|
|
526
|
+
];
|
|
527
|
+
|
|
528
|
+
const feature = `${component.constructor.name}.${param2}`;
|
|
529
|
+
|
|
530
|
+
// We need to get all components that has extensions for the feature in component
|
|
531
|
+
instance.componentsMeta
|
|
532
|
+
.forEach((meta, constructor) => {
|
|
533
|
+
// Just try to make sure that component not only Indexed but also presented in scope
|
|
534
|
+
if (scope.has(constructor))
|
|
535
|
+
// Get all extensions for the feature
|
|
536
|
+
meta
|
|
537
|
+
.abstractions(feature)
|
|
538
|
+
.forEach((declaration) => {
|
|
539
|
+
steps.push({
|
|
540
|
+
component: constructor,
|
|
541
|
+
...declaration
|
|
542
|
+
});
|
|
543
|
+
});
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
return {
|
|
548
|
+
name: feature,
|
|
549
|
+
fragments: config.fragments || [],
|
|
550
|
+
components: config.components || [],
|
|
551
|
+
entities: config.entities || [],
|
|
552
|
+
steps,
|
|
553
|
+
parent: scope
|
|
554
|
+
};
|
|
555
|
+
}
|
|
478
556
|
|
|
479
557
|
/**
|
|
480
558
|
* This method returns a step-by-step instructions of feature implementation depending on the feature name and the class.
|
|
@@ -484,13 +562,13 @@ export class A_Context {
|
|
|
484
562
|
*/
|
|
485
563
|
static feature<T extends Array<string>>(
|
|
486
564
|
scope: A_Scope,
|
|
487
|
-
entity: A_Entity<any, any
|
|
565
|
+
entity: A_Entity<any, any>,
|
|
488
566
|
feature: A_TYPES__EntityBaseMethod | string | T[number] | RegExp,
|
|
489
567
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
490
568
|
): A_Feature
|
|
491
569
|
static feature<T extends Array<string>>(
|
|
492
570
|
scope: A_Scope,
|
|
493
|
-
container: A_Container
|
|
571
|
+
container: A_Container,
|
|
494
572
|
feature: T[number],
|
|
495
573
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
496
574
|
): A_Feature
|
|
@@ -502,7 +580,7 @@ export class A_Context {
|
|
|
502
580
|
): A_Feature
|
|
503
581
|
static feature<T extends Array<string>>(
|
|
504
582
|
scope: A_Scope,
|
|
505
|
-
param1: A_Component
|
|
583
|
+
param1: A_Component | A_Container | A_Entity<any, any>,
|
|
506
584
|
param2: string | T[number],
|
|
507
585
|
param3?: Partial<A_TYPES__ScopeConstructor>
|
|
508
586
|
): A_Feature {
|
|
@@ -522,7 +600,7 @@ export class A_Context {
|
|
|
522
600
|
*/
|
|
523
601
|
static register(
|
|
524
602
|
scope: A_Scope,
|
|
525
|
-
container: A_Container
|
|
603
|
+
container: A_Container
|
|
526
604
|
)
|
|
527
605
|
static register(
|
|
528
606
|
scope: A_Scope,
|
|
@@ -538,7 +616,7 @@ export class A_Context {
|
|
|
538
616
|
)
|
|
539
617
|
static register(
|
|
540
618
|
scope: A_Scope,
|
|
541
|
-
param1: A_Fragment | A_Container
|
|
619
|
+
param1: A_Fragment | A_Container | A_Entity | A_Component
|
|
542
620
|
) {
|
|
543
621
|
const instance = this.getInstance();
|
|
544
622
|
|