@adaas/a-concept 0.0.32 → 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.component.js +3 -3
- package/dist/src/base/A-Errors/A-Errors.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 +43 -20
- package/dist/src/global/A-Concept/A_Concept.class.js +77 -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 +9 -6
- 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 +21 -21
- package/dist/src/global/A-Context/A-Context.class.js +60 -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 +25 -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 +4 -6
- 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 +25 -12
- 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.component.ts +3 -3
- 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 +109 -111
- package/src/global/A-Concept/A_Concept.meta.ts +68 -0
- package/src/global/A-Concept/A_Concept.types.ts +11 -4
- 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 +139 -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 +40 -21
- package/src/global/A-Scope/A-Scope.types.ts +8 -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,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();
|
|
@@ -77,10 +74,14 @@ export class A_Context {
|
|
|
77
74
|
/**
|
|
78
75
|
* Root Namespace is a Namespace that is used to run the program.
|
|
79
76
|
*/
|
|
80
|
-
private _root!:
|
|
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
|
|
|
@@ -103,7 +104,7 @@ export class A_Context {
|
|
|
103
104
|
return A_Context.instance;
|
|
104
105
|
}
|
|
105
106
|
|
|
106
|
-
static get root():
|
|
107
|
+
static get root(): A_Scope {
|
|
107
108
|
return this.getInstance()._root;
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -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
|
|
|
@@ -138,17 +138,14 @@ export class A_Context {
|
|
|
138
138
|
switch (true) {
|
|
139
139
|
case param1 instanceof A_Container:
|
|
140
140
|
instance.containers.set(param1, newScope);
|
|
141
|
+
|
|
141
142
|
break;
|
|
142
143
|
|
|
143
144
|
case param1 instanceof A_Feature:
|
|
144
145
|
instance.features.set(param1, newScope);
|
|
145
|
-
break;
|
|
146
146
|
|
|
147
|
-
case param1 instanceof A_Concept:
|
|
148
|
-
instance.concepts.set(param1, newScope);
|
|
149
147
|
break;
|
|
150
148
|
|
|
151
|
-
|
|
152
149
|
default:
|
|
153
150
|
throw new Error(`[!] A-Concept Context: Unknown type of the parameter.`);
|
|
154
151
|
}
|
|
@@ -164,7 +161,7 @@ export class A_Context {
|
|
|
164
161
|
container: typeof A_Container,
|
|
165
162
|
): A_ContainerMeta
|
|
166
163
|
static meta(
|
|
167
|
-
container: A_Container
|
|
164
|
+
container: A_Container,
|
|
168
165
|
): A_ContainerMeta
|
|
169
166
|
static meta(
|
|
170
167
|
entity: A_Entity,
|
|
@@ -179,17 +176,14 @@ export class A_Context {
|
|
|
179
176
|
component: A_Component,
|
|
180
177
|
): A_ComponentMeta
|
|
181
178
|
static meta<T extends Record<string, any>>(
|
|
182
|
-
|
|
183
|
-
): A_Meta<T>
|
|
184
|
-
static meta<T extends Record<string, any>>(
|
|
185
|
-
param1: A_Container<any>
|
|
186
|
-
| typeof A_Container
|
|
179
|
+
param1: typeof A_Component | typeof A_Container | A_Container
|
|
187
180
|
| A_Component
|
|
188
|
-
| typeof A_Component
|
|
189
181
|
| A_Entity
|
|
190
182
|
| typeof A_Entity
|
|
191
183
|
| { new(...args: any[]): any }
|
|
192
184
|
): A_ContainerMeta | A_ComponentMeta | A_Meta<T> {
|
|
185
|
+
|
|
186
|
+
|
|
193
187
|
const instance = this.getInstance();
|
|
194
188
|
|
|
195
189
|
let metaStorage: WeakMap<typeof A_Container.constructor, A_Meta<any>>;
|
|
@@ -209,7 +203,7 @@ export class A_Context {
|
|
|
209
203
|
|
|
210
204
|
case A_CommonHelper.isInheritedFrom(param1, A_Container): {
|
|
211
205
|
metaStorage = instance.containersMeta;
|
|
212
|
-
property = param1 as typeof A_Container
|
|
206
|
+
property = param1 as typeof A_Container;
|
|
213
207
|
metaType = A_ContainerMeta;
|
|
214
208
|
|
|
215
209
|
break;
|
|
@@ -256,11 +250,13 @@ export class A_Context {
|
|
|
256
250
|
}
|
|
257
251
|
}
|
|
258
252
|
|
|
253
|
+
|
|
259
254
|
if (!metaStorage.has(property)) {
|
|
260
255
|
const inheritMeta = metaStorage.get(Object.getPrototypeOf(property)) || new metaType();
|
|
261
256
|
metaStorage.set(property, new metaType().from(inheritMeta as any));
|
|
262
257
|
}
|
|
263
258
|
|
|
259
|
+
|
|
264
260
|
return metaStorage.get(property)!;
|
|
265
261
|
}
|
|
266
262
|
|
|
@@ -273,10 +269,7 @@ export class A_Context {
|
|
|
273
269
|
component: A_Component
|
|
274
270
|
): A_Scope
|
|
275
271
|
static scope(
|
|
276
|
-
|
|
277
|
-
): A_Scope
|
|
278
|
-
static scope(
|
|
279
|
-
container: A_Container<any>
|
|
272
|
+
container: A_Container
|
|
280
273
|
): A_Scope
|
|
281
274
|
static scope(
|
|
282
275
|
feature: A_Fragment
|
|
@@ -285,7 +278,7 @@ export class A_Context {
|
|
|
285
278
|
feature: A_Feature
|
|
286
279
|
): A_Scope
|
|
287
280
|
static scope(
|
|
288
|
-
param1: A_Feature | A_Container
|
|
281
|
+
param1: A_Feature | A_Container | A_Component | A_Entity | A_Fragment
|
|
289
282
|
): A_Scope | undefined {
|
|
290
283
|
|
|
291
284
|
const instance = this.getInstance();
|
|
@@ -297,9 +290,6 @@ export class A_Context {
|
|
|
297
290
|
case param1 instanceof A_Feature:
|
|
298
291
|
return instance.features.get(param1);
|
|
299
292
|
|
|
300
|
-
case param1 instanceof A_Concept:
|
|
301
|
-
return instance.concepts.get(param1);
|
|
302
|
-
|
|
303
293
|
case param1 instanceof A_Entity:
|
|
304
294
|
return instance.registry.get(param1);
|
|
305
295
|
|
|
@@ -347,16 +337,16 @@ export class A_Context {
|
|
|
347
337
|
* @param scope
|
|
348
338
|
* @returns
|
|
349
339
|
*/
|
|
350
|
-
static featureDefinition
|
|
340
|
+
static featureDefinition(
|
|
351
341
|
scope: A_Scope,
|
|
352
|
-
entity: A_Entity
|
|
353
|
-
feature: A_TYPES__EntityBaseMethod | string |
|
|
342
|
+
entity: A_Entity,
|
|
343
|
+
feature: A_TYPES__EntityBaseMethod | string | RegExp,
|
|
354
344
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
355
345
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
356
|
-
static featureDefinition
|
|
346
|
+
static featureDefinition(
|
|
357
347
|
scope: A_Scope,
|
|
358
|
-
container: A_Container
|
|
359
|
-
feature:
|
|
348
|
+
container: A_Container,
|
|
349
|
+
feature: string,
|
|
360
350
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
361
351
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
362
352
|
static featureDefinition(
|
|
@@ -365,10 +355,10 @@ export class A_Context {
|
|
|
365
355
|
feature: string,
|
|
366
356
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
367
357
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']>
|
|
368
|
-
static featureDefinition
|
|
358
|
+
static featureDefinition(
|
|
369
359
|
scope: A_Scope,
|
|
370
|
-
param1: A_Component
|
|
371
|
-
param2: string
|
|
360
|
+
param1: A_Component | A_Container | A_Entity,
|
|
361
|
+
param2: string,
|
|
372
362
|
param3?: Partial<A_TYPES__ScopeConstructor>
|
|
373
363
|
): A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps', 'fragments', 'name', 'components']> {
|
|
374
364
|
const instance = this.getInstance();
|
|
@@ -416,14 +406,18 @@ export class A_Context {
|
|
|
416
406
|
case component instanceof A_Container:
|
|
417
407
|
metaKey = A_TYPES__ContainerMetaKey.FEATURES
|
|
418
408
|
break;
|
|
419
|
-
case component instanceof A_Component:
|
|
409
|
+
case component instanceof A_Component: {
|
|
420
410
|
metaKey = A_TYPES__ComponentMetaKey.FEATURES
|
|
411
|
+
}
|
|
421
412
|
break;
|
|
422
413
|
default:
|
|
423
414
|
throw new Error(`A-Feature cannot be defined on the ${component} level`);
|
|
424
415
|
}
|
|
425
416
|
|
|
426
|
-
|
|
417
|
+
|
|
418
|
+
const featureDefinition = this.meta(component)
|
|
419
|
+
.get(metaKey)
|
|
420
|
+
.get(param2);
|
|
427
421
|
|
|
428
422
|
if (!featureDefinition)
|
|
429
423
|
throw new Error(`[!] A-Concept Context: Feature not found.`);
|
|
@@ -464,12 +458,101 @@ export class A_Context {
|
|
|
464
458
|
name: feature,
|
|
465
459
|
fragments: config.fragments || [],
|
|
466
460
|
components: config.components || [],
|
|
461
|
+
entities: config.entities || [],
|
|
467
462
|
steps,
|
|
468
463
|
parent: scope
|
|
469
464
|
};
|
|
470
465
|
}
|
|
471
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();
|
|
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
|
+
|
|
472
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
|
+
}
|
|
473
556
|
|
|
474
557
|
/**
|
|
475
558
|
* This method returns a step-by-step instructions of feature implementation depending on the feature name and the class.
|
|
@@ -479,13 +562,13 @@ export class A_Context {
|
|
|
479
562
|
*/
|
|
480
563
|
static feature<T extends Array<string>>(
|
|
481
564
|
scope: A_Scope,
|
|
482
|
-
entity: A_Entity<any, any
|
|
565
|
+
entity: A_Entity<any, any>,
|
|
483
566
|
feature: A_TYPES__EntityBaseMethod | string | T[number] | RegExp,
|
|
484
567
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
485
568
|
): A_Feature
|
|
486
569
|
static feature<T extends Array<string>>(
|
|
487
570
|
scope: A_Scope,
|
|
488
|
-
container: A_Container
|
|
571
|
+
container: A_Container,
|
|
489
572
|
feature: T[number],
|
|
490
573
|
params?: Partial<A_TYPES__ScopeConstructor>
|
|
491
574
|
): A_Feature
|
|
@@ -497,7 +580,7 @@ export class A_Context {
|
|
|
497
580
|
): A_Feature
|
|
498
581
|
static feature<T extends Array<string>>(
|
|
499
582
|
scope: A_Scope,
|
|
500
|
-
param1: A_Component
|
|
583
|
+
param1: A_Component | A_Container | A_Entity<any, any>,
|
|
501
584
|
param2: string | T[number],
|
|
502
585
|
param3?: Partial<A_TYPES__ScopeConstructor>
|
|
503
586
|
): A_Feature {
|
|
@@ -517,7 +600,7 @@ export class A_Context {
|
|
|
517
600
|
*/
|
|
518
601
|
static register(
|
|
519
602
|
scope: A_Scope,
|
|
520
|
-
container: A_Container
|
|
603
|
+
container: A_Container
|
|
521
604
|
)
|
|
522
605
|
static register(
|
|
523
606
|
scope: A_Scope,
|
|
@@ -533,12 +616,12 @@ export class A_Context {
|
|
|
533
616
|
)
|
|
534
617
|
static register(
|
|
535
618
|
scope: A_Scope,
|
|
536
|
-
param1: A_Fragment | A_Container
|
|
619
|
+
param1: A_Fragment | A_Container | A_Entity | A_Component
|
|
537
620
|
) {
|
|
538
621
|
const instance = this.getInstance();
|
|
539
622
|
|
|
540
|
-
if (!instance._root)
|
|
541
|
-
|
|
623
|
+
// if (!instance._root)
|
|
624
|
+
// instance._root = scope.name;
|
|
542
625
|
|
|
543
626
|
switch (true) {
|
|
544
627
|
case param1 instanceof A_Component:
|
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
A_CommonHelper,
|
|
3
|
-
A_Error,
|
|
3
|
+
A_Error,
|
|
4
4
|
ASEID
|
|
5
5
|
} from "@adaas/a-utils";
|
|
6
6
|
import {
|
|
7
7
|
A_TYPES__Entity_JSON,
|
|
8
|
-
A_TYPES__EntityBaseMethod,
|
|
9
|
-
A_TYPES__EntityBaseMethods,
|
|
10
|
-
A_TYPES__EntityCallParams,
|
|
11
8
|
A_TYPES__IEntity
|
|
12
9
|
} from "./A-Entity.types";
|
|
13
10
|
import { A_CONSTANTS__DEFAULT_ERRORS } from "@adaas/a-utils/dist/src/constants/errors.constants";
|
|
14
11
|
import { A_Context } from "../A-Context/A-Context.class";
|
|
15
|
-
import {
|
|
12
|
+
import { A_TYPES__FeatureCallParams } from "../A-Feature/A-Feature.types";
|
|
16
13
|
|
|
17
14
|
|
|
18
15
|
|
|
@@ -25,8 +22,7 @@ import { A_Fragment } from "../A-Fragment/A-Fragment.class";
|
|
|
25
22
|
*/
|
|
26
23
|
export class A_Entity<
|
|
27
24
|
_ConstructorType = any,
|
|
28
|
-
_SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON
|
|
29
|
-
_FeatureNames extends Array<string | A_TYPES__EntityBaseMethod> = A_TYPES__EntityBaseMethods
|
|
25
|
+
_SerializedType extends A_TYPES__Entity_JSON = A_TYPES__Entity_JSON
|
|
30
26
|
>
|
|
31
27
|
implements A_TYPES__IEntity {
|
|
32
28
|
|
|
@@ -57,7 +53,7 @@ export class A_Entity<
|
|
|
57
53
|
)
|
|
58
54
|
constructor(props: string | ASEID | _SerializedType | _ConstructorType) {
|
|
59
55
|
|
|
60
|
-
|
|
56
|
+
|
|
61
57
|
switch (true) {
|
|
62
58
|
case (typeof props === 'string' && ASEID.isASEID(props)):
|
|
63
59
|
this.aseid = new ASEID(props);
|
|
@@ -139,43 +135,12 @@ export class A_Entity<
|
|
|
139
135
|
* @param lifecycleMethod
|
|
140
136
|
* @param args
|
|
141
137
|
*/
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
async call(
|
|
149
|
-
/**
|
|
150
|
-
* A-Feature name to be called
|
|
151
|
-
*/
|
|
152
|
-
params: A_TYPES__Required<Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>, ['name']>,
|
|
153
|
-
): Promise<any>
|
|
154
|
-
async call(
|
|
155
|
-
/**
|
|
156
|
-
* A-Feature method name to be called
|
|
157
|
-
*/
|
|
158
|
-
feature: _FeatureNames[number],
|
|
159
|
-
/**
|
|
160
|
-
* Parameters to provide additional data to the feature
|
|
161
|
-
*/
|
|
162
|
-
params: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>,
|
|
163
|
-
): Promise<any>
|
|
164
|
-
|
|
165
|
-
async call(
|
|
166
|
-
param1: _FeatureNames[number] | A_TYPES__Required<Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>, ['name']>,
|
|
167
|
-
param2?: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>>
|
|
168
|
-
): Promise<any> {
|
|
169
|
-
|
|
170
|
-
const feature: string = typeof param1 === 'string'
|
|
171
|
-
? param1
|
|
172
|
-
: param1.name;
|
|
173
|
-
const params: Partial<A_TYPES__EntityCallParams<_FeatureNames[number]>> = typeof param1 === 'string'
|
|
174
|
-
? param2 || {}
|
|
175
|
-
: param1;
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
console.log('WTF???? ', A_Context.scope(this))
|
|
138
|
+
async call(
|
|
139
|
+
feature: string,
|
|
140
|
+
params: Partial<A_TYPES__FeatureCallParams> = {}
|
|
141
|
+
) {
|
|
142
|
+
params.entities = params.entities || [this];
|
|
143
|
+
|
|
179
144
|
|
|
180
145
|
const newFeature = A_Context.feature(A_Context.scope(this), this, feature, params);
|
|
181
146
|
|
|
@@ -188,33 +153,21 @@ export class A_Entity<
|
|
|
188
153
|
// ====================================================================
|
|
189
154
|
|
|
190
155
|
|
|
191
|
-
async load() {
|
|
192
|
-
await this.call(A_TYPES__EntityBaseMethod.DESTROY, {
|
|
193
|
-
entities: [
|
|
194
|
-
this
|
|
195
|
-
]
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
async destroy() {
|
|
202
|
-
await this.call(A_TYPES__EntityBaseMethod.DESTROY, {
|
|
203
|
-
entities: [
|
|
204
|
-
this
|
|
205
|
-
],
|
|
206
|
-
});
|
|
207
|
-
}
|
|
208
156
|
|
|
157
|
+
/**
|
|
158
|
+
* The default method that can be called and extended to load entity data.
|
|
159
|
+
*/
|
|
160
|
+
async load() { }
|
|
209
161
|
|
|
162
|
+
/**
|
|
163
|
+
* The default method that can be called and extended to destroy entity data.
|
|
164
|
+
*/
|
|
165
|
+
async destroy() { }
|
|
210
166
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
]
|
|
216
|
-
});
|
|
217
|
-
}
|
|
167
|
+
/**
|
|
168
|
+
* The default method that can be called and extended to save entity data.
|
|
169
|
+
*/
|
|
170
|
+
async save() { }
|
|
218
171
|
|
|
219
172
|
|
|
220
173
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types";
|
|
1
2
|
import { A_Meta } from "../A-Meta/A-Meta.class";
|
|
2
|
-
import { A_TYPES__EntityMeta } from "./A-Entity.types";
|
|
3
|
+
import { A_TYPES__EntityMeta, A_TYPES__EntityMetaKey } from "./A-Entity.types";
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
export class A_EntityMeta extends A_Meta<A_TYPES__EntityMeta> {
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
|
|
8
9
|
|
|
9
10
|
}
|
|
@@ -9,7 +9,7 @@ import { A_TYPES__ContainerMeta_FeatureItem } from "../A-Container/A-Container.t
|
|
|
9
9
|
export type A_TYPES__EntityCallParams<T extends string> = {
|
|
10
10
|
name: T,
|
|
11
11
|
fragments: Array<A_Fragment>,
|
|
12
|
-
entities: Array<A_Entity<any, any
|
|
12
|
+
entities: Array<A_Entity<any, any>>,
|
|
13
13
|
components: Array<{ new(...args: any[]): any }>
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -73,6 +73,7 @@ export type A_TYPES__EntityMeta = {
|
|
|
73
73
|
export enum A_TYPES__EntityMetaKey {
|
|
74
74
|
EXTENSIONS = 'a-component-extensions',
|
|
75
75
|
FEATURES = 'a-component-features',
|
|
76
|
+
ABSTRACTIONS = 'a-component-abstractions',
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
+
import { A_Context } from "../A-Context/A-Context.class";
|
|
1
2
|
import { A_Feature_Define } from "@adaas/a-concept/decorators/A-Feature/A-Feature-Define.decorator";
|
|
2
3
|
import { A_Feature_Extend } from "@adaas/a-concept/decorators/A-Feature/A-Feature-Extend.decorator";
|
|
3
4
|
import { A_TYPES__FeatureConstructor, A_TYPES__FeatureState, } from "./A-Feature.types";
|
|
4
5
|
import { A_Error, A_TYPES__Required } from "@adaas/a-utils";
|
|
5
|
-
import { A_Context } from "../A-Context/A-Context.class";
|
|
6
6
|
import { A_TYPES__A_Feature_Extend } from "@adaas/a-concept/decorators/A-Feature/A-Feature.decorator.types";
|
|
7
7
|
import { A_Stage } from "../A-Stage/A-Stage.class";
|
|
8
|
-
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types";
|
|
9
8
|
import { StepsManager } from "@adaas/a-concept/helpers/StepsManager.class";
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
10
|
/**
|
|
14
11
|
* A_Feature is representing a feature that can be executed across multiple components
|
|
15
12
|
* This class stores the steps of the feature and executes them in order of appearance
|
|
@@ -48,10 +45,12 @@ export class A_Feature {
|
|
|
48
45
|
result?: any
|
|
49
46
|
error?: A_Error
|
|
50
47
|
|
|
48
|
+
readonly name: string;
|
|
51
49
|
|
|
52
50
|
constructor(
|
|
53
51
|
params: A_TYPES__Required<Partial<A_TYPES__FeatureConstructor>, ['steps']>
|
|
54
52
|
) {
|
|
53
|
+
this.name = params.name || this.constructor.name;
|
|
55
54
|
|
|
56
55
|
this.SM = new StepsManager(params.steps);
|
|
57
56
|
|
|
@@ -175,11 +174,23 @@ export class A_Feature {
|
|
|
175
174
|
*
|
|
176
175
|
*/
|
|
177
176
|
async process() {
|
|
178
|
-
this.
|
|
177
|
+
if (this.isDone()) {
|
|
178
|
+
return this.result;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
try {
|
|
182
|
+
this.state = A_TYPES__FeatureState.PROCESSING;
|
|
183
|
+
|
|
184
|
+
for (const stage of this.stages) {
|
|
185
|
+
await stage.process();
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
await this.completed();
|
|
179
189
|
|
|
180
|
-
|
|
181
|
-
await
|
|
190
|
+
} catch (error) {
|
|
191
|
+
await this.failed(error);
|
|
182
192
|
}
|
|
193
|
+
|
|
183
194
|
}
|
|
184
195
|
|
|
185
196
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
|
-
import { A_TYPES__A_InjectDecorator_Injectable, A_TYPES__A_InjectDecorator_Meta } from "@adaas/a-concept/decorators/A-Inject/A-Inject.decorator.types"
|
|
2
|
-
import { A_Component } from "../A-Component/A-Component.class"
|
|
3
1
|
import { A_TYPES__ScopeConfig, A_TYPES__ScopeConstructor } from "../A-Scope/A-Scope.types"
|
|
4
2
|
import { A_TYPES__A_StageStep } from "../A-Stage/A-Stage.types"
|
|
3
|
+
import { A_Fragment } from "../A-Fragment/A-Fragment.class"
|
|
4
|
+
import { A_Entity } from "@adaas/a-concept/global/A-Entity/A-Entity.class"
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
export type A_TYPES__FeatureIteratorReturn<T extends any = any> = () => Promise<T>
|
|
8
8
|
|
|
9
9
|
|
|
10
|
+
export type A_TYPES__FeatureCallParams = {
|
|
11
|
+
fragments: Array<A_Fragment>,
|
|
12
|
+
entities: Array<A_Entity<any, any>>,
|
|
13
|
+
components: Array<{ new(...args: any[]): any }>
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
10
18
|
export type A_TYPES__FeatureConstructor = {
|
|
11
19
|
steps: A_TYPES__A_StageStep[]
|
|
12
20
|
} & A_TYPES__ScopeConstructor & A_TYPES__ScopeConfig
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
|
|
9
1
|
/**
|
|
10
2
|
* A Meta is an entity that stores all the metadata for the specific entity like container, component, feature, etc.
|
|
11
3
|
*
|
|
@@ -185,4 +177,9 @@ export class A_Meta<
|
|
|
185
177
|
clear(): void {
|
|
186
178
|
this.meta.clear();
|
|
187
179
|
}
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
toArray(): Array<[keyof _StorageItems, _StorageItems[keyof _StorageItems]]> {
|
|
183
|
+
return Array.from(this.meta.entries());
|
|
184
|
+
}
|
|
188
185
|
}
|