@adaas/a-concept 0.0.64 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +24 -32
- package/dist/index.js +35 -52
- package/dist/index.js.map +1 -1
- package/dist/src/constants/env.constants.d.ts +15 -8
- package/dist/src/constants/env.constants.js +17 -10
- package/dist/src/constants/env.constants.js.map +1 -1
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.d.ts +23 -0
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js +69 -0
- package/dist/src/global/A-Abstraction/A-Abstraction-Extend.decorator.js.map +1 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.class.d.ts +47 -20
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js +55 -48
- package/dist/src/global/A-Abstraction/A-Abstraction.class.js.map +1 -1
- package/dist/src/global/A-Abstraction/A-Abstraction.error.d.ts +7 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.error.js +12 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.error.js.map +1 -0
- package/dist/src/global/A-Abstraction/A-Abstraction.types.d.ts +27 -12
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js +0 -8
- package/dist/src/global/A-Abstraction/A-Abstraction.types.js.map +1 -1
- package/dist/src/global/A-Caller/A_Caller.class.d.ts +33 -0
- package/dist/src/global/A-Caller/A_Caller.class.js +44 -0
- package/dist/src/global/A-Caller/A_Caller.class.js.map +1 -0
- package/dist/src/global/A-Caller/A_Caller.error.d.ts +7 -0
- package/dist/src/global/A-Caller/A_Caller.error.js +12 -0
- package/dist/src/global/A-Caller/A_Caller.error.js.map +1 -0
- package/dist/src/global/A-Caller/A_Caller.types.d.ts +18 -0
- package/dist/src/{base/A-Errors/A-Errors.types.js → global/A-Caller/A_Caller.types.js} +1 -1
- package/dist/src/global/A-Caller/A_Caller.types.js.map +1 -0
- package/dist/src/global/A-Component/A-Component.class.d.ts +20 -3
- package/dist/src/global/A-Component/A-Component.class.js +35 -19
- package/dist/src/global/A-Component/A-Component.class.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.constants.d.ts +6 -0
- package/dist/src/global/A-Component/A-Component.constants.js +11 -0
- package/dist/src/global/A-Component/A-Component.constants.js.map +1 -0
- package/dist/src/global/A-Component/A-Component.meta.d.ts +4 -4
- package/dist/src/global/A-Component/A-Component.meta.js +6 -8
- package/dist/src/global/A-Component/A-Component.meta.js.map +1 -1
- package/dist/src/global/A-Component/A-Component.types.d.ts +40 -22
- package/dist/src/global/A-Component/A-Component.types.js +1 -8
- package/dist/src/global/A-Component/A-Component.types.js.map +1 -1
- package/dist/src/global/A-Concept/A-Concept.class.d.ts +153 -0
- package/dist/src/global/A-Concept/A-Concept.class.js +260 -0
- package/dist/src/global/A-Concept/A-Concept.class.js.map +1 -0
- package/dist/src/global/A-Concept/A-Concept.constants.d.ts +33 -0
- package/dist/src/global/A-Concept/A-Concept.constants.js +39 -0
- package/dist/src/global/A-Concept/A-Concept.constants.js.map +1 -0
- package/dist/src/global/A-Concept/{A_Concept.meta.js → A-Concept.meta.js} +1 -2
- package/dist/src/global/A-Concept/A-Concept.meta.js.map +1 -0
- package/dist/src/global/A-Concept/A-Concept.types.d.ts +83 -0
- package/dist/src/global/{A-Channel/A-Channel.types.js → A-Concept/A-Concept.types.js} +1 -1
- package/dist/src/global/A-Concept/A-Concept.types.js.map +1 -0
- package/dist/src/global/A-Container/A-Container.class.d.ts +31 -35
- package/dist/src/global/A-Container/A-Container.class.js +34 -55
- package/dist/src/global/A-Container/A-Container.class.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.constants.d.ts +5 -0
- package/dist/src/global/A-Container/A-Container.constants.js +10 -0
- package/dist/src/global/A-Container/A-Container.constants.js.map +1 -0
- package/dist/src/global/A-Container/A-Container.meta.d.ts +6 -6
- package/dist/src/global/A-Container/A-Container.meta.js +5 -6
- package/dist/src/global/A-Container/A-Container.meta.js.map +1 -1
- package/dist/src/global/A-Container/A-Container.types.d.ts +31 -25
- package/dist/src/global/A-Container/A-Container.types.js +1 -7
- package/dist/src/global/A-Container/A-Container.types.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.class.d.ts +302 -76
- package/dist/src/global/A-Context/A-Context.class.js +436 -244
- package/dist/src/global/A-Context/A-Context.class.js.map +1 -1
- package/dist/src/global/A-Context/A-Context.error.d.ts +20 -0
- package/dist/src/global/A-Context/A-Context.error.js +25 -0
- package/dist/src/global/A-Context/A-Context.error.js.map +1 -0
- package/dist/src/global/A-Context/A-Context.types.d.ts +5 -0
- package/dist/src/global/A-Context/A-Context.types.js +1 -0
- package/dist/src/global/A-Entity/A-Entity.class.d.ts +18 -18
- package/dist/src/global/A-Entity/A-Entity.class.js +36 -43
- package/dist/src/global/A-Entity/A-Entity.class.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.constants.d.ts +11 -0
- package/dist/src/global/A-Entity/A-Entity.constants.js +17 -0
- package/dist/src/global/A-Entity/A-Entity.constants.js.map +1 -0
- package/dist/src/global/A-Entity/A-Entity.error.d.ts +7 -0
- package/dist/src/global/A-Entity/A-Entity.error.js +12 -0
- package/dist/src/global/A-Entity/A-Entity.error.js.map +1 -0
- package/dist/src/global/A-Entity/A-Entity.meta.d.ts +2 -2
- package/dist/src/global/A-Entity/A-Entity.meta.js +2 -2
- package/dist/src/global/A-Entity/A-Entity.meta.js.map +1 -1
- package/dist/src/global/A-Entity/A-Entity.types.d.ts +24 -29
- package/dist/src/global/A-Entity/A-Entity.types.js +1 -13
- package/dist/src/global/A-Entity/A-Entity.types.js.map +1 -1
- package/dist/src/global/A-Error/A_Error.class.d.ts +219 -0
- package/dist/src/global/A-Error/A_Error.class.js +267 -0
- package/dist/src/global/A-Error/A_Error.class.js.map +1 -0
- package/dist/src/global/A-Error/A_Error.constants.d.ts +5 -0
- package/dist/src/global/A-Error/A_Error.constants.js +9 -0
- package/dist/src/global/A-Error/A_Error.constants.js.map +1 -0
- package/dist/src/global/A-Error/A_Error.types.d.ts +89 -0
- package/dist/src/{decorators/A-Inject/A-Inject.decorator.types.js → global/A-Error/A_Error.types.js} +1 -1
- package/dist/src/global/A-Error/A_Error.types.js.map +1 -0
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.d.ts +15 -0
- package/dist/src/{decorators → global}/A-Feature/A-Feature-Define.decorator.js +21 -27
- package/dist/src/global/A-Feature/A-Feature-Define.decorator.js.map +1 -0
- package/dist/src/{decorators → global}/A-Feature/A-Feature-Extend.decorator.d.ts +26 -3
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js +97 -0
- package/dist/src/global/A-Feature/A-Feature-Extend.decorator.js.map +1 -0
- package/dist/src/global/A-Feature/A-Feature.class.d.ts +120 -30
- package/dist/src/global/A-Feature/A-Feature.class.js +205 -73
- package/dist/src/global/A-Feature/A-Feature.class.js.map +1 -1
- package/dist/src/global/A-Feature/A-Feature.error.d.ts +25 -0
- package/dist/src/global/A-Feature/A-Feature.error.js +33 -0
- package/dist/src/global/A-Feature/A-Feature.error.js.map +1 -0
- package/dist/src/global/A-Feature/A-Feature.types.d.ts +241 -18
- package/dist/src/global/A-Feature/A-Feature.types.js +16 -22
- package/dist/src/global/A-Feature/A-Feature.types.js.map +1 -1
- package/dist/src/global/A-Fragment/A-Fragment.class.d.ts +19 -27
- package/dist/src/global/A-Fragment/A-Fragment.class.js +21 -91
- package/dist/src/global/A-Fragment/A-Fragment.class.js.map +1 -1
- package/dist/src/global/A-Fragment/A-Fragment.types.d.ts +19 -1
- package/dist/src/global/A-Fragment/A-Fragment.types.js +3 -0
- package/dist/src/global/A-Fragment/A-Fragment.types.js.map +1 -1
- package/dist/src/global/A-Inject/A-Inject.decorator.d.ts +80 -0
- package/dist/src/global/A-Inject/A-Inject.decorator.js +49 -0
- package/dist/src/global/A-Inject/A-Inject.decorator.js.map +1 -0
- package/dist/src/global/A-Inject/A-Inject.error.d.ts +5 -0
- package/dist/src/global/A-Inject/A-Inject.error.js +10 -0
- package/dist/src/global/A-Inject/A-Inject.error.js.map +1 -0
- package/dist/src/global/A-Inject/A-Inject.types.d.ts +42 -0
- package/dist/src/{decorators/A-Entity/A-Entity.decorator.types.js → global/A-Inject/A-Inject.types.js} +1 -1
- package/dist/src/global/A-Inject/A-Inject.types.js.map +1 -0
- package/dist/src/global/A-Meta/A-Meta.class.d.ts +1 -1
- package/dist/src/global/A-Meta/A-Meta.types.d.ts +14 -0
- package/dist/src/global/A-Meta/A-Meta.types.js +1 -0
- package/dist/src/global/A-Scope/A-Scope.class.d.ts +124 -142
- package/dist/src/global/A-Scope/A-Scope.class.js +163 -209
- package/dist/src/global/A-Scope/A-Scope.class.js.map +1 -1
- package/dist/src/global/A-Scope/A-Scope.error.d.ts +6 -0
- package/dist/src/global/A-Scope/A-Scope.error.js +11 -0
- package/dist/src/global/A-Scope/A-Scope.error.js.map +1 -0
- package/dist/src/global/A-Scope/A-Scope.types.d.ts +48 -13
- package/dist/src/global/A-Stage/A-Stage.class.d.ts +31 -23
- package/dist/src/global/A-Stage/A-Stage.class.js +100 -68
- package/dist/src/global/A-Stage/A-Stage.class.js.map +1 -1
- package/dist/src/global/A-Stage/A-Stage.error.d.ts +2 -1
- package/dist/src/global/A-Stage/A-Stage.error.js +5 -2
- package/dist/src/global/A-Stage/A-Stage.error.js.map +1 -1
- package/dist/src/global/A-Stage/A-Stage.types.d.ts +4 -16
- package/dist/src/global/A-Stage/A-Stage.types.js +0 -16
- package/dist/src/global/A-Stage/A-Stage.types.js.map +1 -1
- package/dist/src/global/ASEID/ASEID.class.d.ts +130 -0
- package/dist/src/global/ASEID/ASEID.class.js +167 -0
- package/dist/src/global/ASEID/ASEID.class.js.map +1 -0
- package/dist/src/global/ASEID/ASEID.constants.js +2 -0
- package/dist/src/global/ASEID/ASEID.constants.js.map +1 -0
- package/dist/src/global/ASEID/ASEID.error.d.ts +5 -0
- package/dist/src/global/ASEID/ASEID.error.js +10 -0
- package/dist/src/global/ASEID/ASEID.error.js.map +1 -0
- package/dist/src/global/ASEID/ASEID.types.d.ts +65 -0
- package/dist/src/global/ASEID/ASEID.types.js +5 -0
- package/dist/src/global/ASEID/ASEID.types.js.map +1 -0
- package/dist/src/helpers/A_Common.helper.d.ts +28 -0
- package/dist/src/helpers/A_Common.helper.js +170 -0
- package/dist/src/helpers/A_Common.helper.js.map +1 -0
- package/dist/src/helpers/A_Formatter.helper.d.ts +35 -0
- package/dist/src/helpers/A_Formatter.helper.js +62 -0
- package/dist/src/helpers/A_Formatter.helper.js.map +1 -0
- package/dist/src/helpers/A_Identity.helper.d.ts +29 -0
- package/dist/src/helpers/A_Identity.helper.js +43 -0
- package/dist/src/helpers/A_Identity.helper.js.map +1 -0
- package/dist/src/helpers/{StepsManager.class.d.ts → A_StepsManager.class.d.ts} +4 -2
- package/dist/src/helpers/{StepsManager.class.js → A_StepsManager.class.js} +10 -5
- package/dist/src/helpers/A_StepsManager.class.js.map +1 -0
- package/dist/src/helpers/A_TypeGuards.helper.d.ts +205 -0
- package/dist/src/helpers/A_TypeGuards.helper.js +288 -0
- package/dist/src/helpers/A_TypeGuards.helper.js.map +1 -0
- package/dist/src/types/A_Common.types.d.ts +36 -0
- package/dist/src/types/A_Common.types.js +3 -0
- package/dist/src/types/A_Common.types.js.map +1 -0
- package/index.ts +27 -51
- package/jest.config.ts +1 -0
- package/package.json +1 -2
- package/src/constants/env.constants.ts +18 -11
- package/src/global/A-Abstraction/A-Abstraction-Extend.decorator.ts +103 -0
- package/src/global/A-Abstraction/A-Abstraction.class.ts +71 -65
- package/src/global/A-Abstraction/A-Abstraction.error.ts +9 -0
- package/src/global/A-Abstraction/A-Abstraction.types.ts +52 -13
- package/src/global/A-Caller/A_Caller.class.ts +61 -0
- package/src/global/A-Caller/A_Caller.error.ts +10 -0
- package/src/global/A-Caller/A_Caller.types.ts +25 -0
- package/src/global/A-Component/A-Component.class.ts +26 -15
- package/src/global/A-Component/A-Component.constants.ts +9 -0
- package/src/global/A-Component/A-Component.meta.ts +6 -16
- package/src/global/A-Component/A-Component.types.ts +53 -28
- package/src/global/A-Concept/A-Concept.class.ts +316 -0
- package/src/global/A-Concept/A-Concept.constants.ts +36 -0
- package/src/global/A-Concept/A-Concept.meta.ts +17 -0
- package/src/global/A-Concept/A-Concept.types.ts +100 -0
- package/src/global/A-Container/A-Container.class.ts +42 -83
- package/src/global/A-Container/A-Container.constants.ts +5 -0
- package/src/global/A-Container/A-Container.meta.ts +7 -11
- package/src/global/A-Container/A-Container.types.ts +38 -34
- package/src/global/A-Context/A-Context.class.ts +648 -412
- package/src/global/A-Context/A-Context.error.ts +44 -0
- package/src/global/A-Context/A-Context.types.ts +14 -0
- package/src/global/A-Entity/A-Entity.class.ts +39 -52
- package/src/global/A-Entity/A-Entity.constants.ts +12 -0
- package/src/global/A-Entity/A-Entity.error.ts +12 -0
- package/src/global/A-Entity/A-Entity.meta.ts +4 -4
- package/src/global/A-Entity/A-Entity.types.ts +31 -36
- package/src/global/A-Error/A_Error.class.ts +408 -0
- package/src/global/A-Error/A_Error.constants.ts +11 -0
- package/src/global/A-Error/A_Error.types.ts +96 -0
- package/src/{decorators → global}/A-Feature/A-Feature-Define.decorator.ts +31 -37
- package/src/global/A-Feature/A-Feature-Extend.decorator.ts +187 -0
- package/src/global/A-Feature/A-Feature.class.ts +279 -122
- package/src/global/A-Feature/A-Feature.error.ts +33 -0
- package/src/global/A-Feature/A-Feature.types.ts +278 -40
- package/src/global/A-Fragment/A-Fragment.class.ts +29 -100
- package/src/global/A-Fragment/A-Fragment.types.ts +25 -3
- package/src/global/A-Inject/A-Inject.decorator.ts +167 -0
- package/src/global/A-Inject/A-Inject.error.ts +8 -0
- package/src/global/A-Inject/A-Inject.types.ts +75 -0
- package/src/global/A-Meta/A-Meta.class.ts +1 -1
- package/src/global/A-Meta/A-Meta.types.ts +21 -0
- package/src/global/A-Scope/A-Scope.class.ts +288 -299
- package/src/global/A-Scope/A-Scope.error.ts +13 -0
- package/src/global/A-Scope/A-Scope.types.ts +61 -27
- package/src/global/A-Stage/A-Stage.class.ts +142 -80
- package/src/global/A-Stage/A-Stage.error.ts +4 -2
- package/src/global/A-Stage/A-Stage.types.ts +4 -25
- package/src/global/ASEID/ASEID.class.ts +275 -0
- package/src/global/ASEID/ASEID.error.ts +12 -0
- package/src/global/ASEID/ASEID.types.ts +79 -0
- package/src/helpers/A_Common.helper.ts +204 -0
- package/src/helpers/A_Formatter.helper.ts +58 -0
- package/src/helpers/A_Identity.helper.ts +53 -0
- package/src/helpers/{StepsManager.class.ts → A_StepsManager.class.ts} +19 -3
- package/src/helpers/A_TypeGuards.helper.ts +318 -0
- package/src/types/A_Common.types.ts +79 -0
- package/tests/A-Common.test.ts +117 -0
- package/tests/A-Component.test.ts +11 -6
- package/tests/A-Concept.test.ts +19 -22
- package/tests/A-Entity.test.ts +24 -24
- package/tests/A-Error.test.ts +129 -0
- package/tests/A-Feature.test.ts +34 -25
- package/tests/A-Scope.test.ts +50 -22
- package/tests/ASEID.test.ts +74 -0
- package/tsconfig.build.json +2 -1
- package/tsconfig.json +3 -2
- package/dist/src/base/A-Config/A-Config.container.d.ts +0 -9
- package/dist/src/base/A-Config/A-Config.container.js +0 -69
- package/dist/src/base/A-Config/A-Config.container.js.map +0 -1
- package/dist/src/base/A-Config/A-Config.context.d.ts +0 -30
- package/dist/src/base/A-Config/A-Config.context.js +0 -60
- package/dist/src/base/A-Config/A-Config.context.js.map +0 -1
- package/dist/src/base/A-Config/A-Config.types.d.ts +0 -20
- package/dist/src/base/A-Config/A-Config.types.js +0 -7
- package/dist/src/base/A-Config/A-Config.types.js.map +0 -1
- package/dist/src/base/A-Config/components/ConfigReader.component.d.ts +0 -29
- package/dist/src/base/A-Config/components/ConfigReader.component.js +0 -84
- package/dist/src/base/A-Config/components/ConfigReader.component.js.map +0 -1
- package/dist/src/base/A-Config/components/ENVConfigReader.component.d.ts +0 -10
- package/dist/src/base/A-Config/components/ENVConfigReader.component.js +0 -37
- package/dist/src/base/A-Config/components/ENVConfigReader.component.js.map +0 -1
- package/dist/src/base/A-Config/components/FileConfigReader.component.d.ts +0 -11
- package/dist/src/base/A-Config/components/FileConfigReader.component.js +0 -48
- package/dist/src/base/A-Config/components/FileConfigReader.component.js.map +0 -1
- package/dist/src/base/A-Errors/A-Error.entity.d.ts +0 -3
- package/dist/src/base/A-Errors/A-Error.entity.js +0 -8
- package/dist/src/base/A-Errors/A-Error.entity.js.map +0 -1
- package/dist/src/base/A-Errors/A-Errors.component.d.ts +0 -19
- package/dist/src/base/A-Errors/A-Errors.component.js +0 -87
- package/dist/src/base/A-Errors/A-Errors.component.js.map +0 -1
- package/dist/src/base/A-Errors/A-Errors.context.d.ts +0 -27
- package/dist/src/base/A-Errors/A-Errors.context.js +0 -50
- package/dist/src/base/A-Errors/A-Errors.context.js.map +0 -1
- package/dist/src/base/A-Errors/A-Errors.types.d.ts +0 -5
- package/dist/src/base/A-Errors/A-Errors.types.js.map +0 -1
- package/dist/src/base/A-Logger/A-Logger.component.d.ts +0 -31
- package/dist/src/base/A-Logger/A-Logger.component.js +0 -155
- package/dist/src/base/A-Logger/A-Logger.component.js.map +0 -1
- package/dist/src/base/A-Logger/A-Logger.types.js +0 -2
- package/dist/src/base/A-Logger/A-Logger.types.js.map +0 -1
- package/dist/src/base/A-Polyfill/A-Polyfill.component.d.ts +0 -5
- package/dist/src/base/A-Polyfill/A-Polyfill.component.js +0 -34
- package/dist/src/base/A-Polyfill/A-Polyfill.component.js.map +0 -1
- package/dist/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.d.ts +0 -14
- package/dist/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.js +0 -53
- package/dist/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.js.map +0 -1
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.d.ts +0 -2
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.js +0 -3
- package/dist/src/decorators/A-Abstraction/A-Abstraction.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Connect/A-Connect.decorator.d.ts +0 -19
- package/dist/src/decorators/A-Connect/A-Connect.decorator.js +0 -31
- package/dist/src/decorators/A-Connect/A-Connect.decorator.js.map +0 -1
- package/dist/src/decorators/A-Connect/A-Connect.decorator.types.d.ts +0 -1
- package/dist/src/decorators/A-Connect/A-Connect.decorator.types.js +0 -3
- package/dist/src/decorators/A-Connect/A-Connect.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Entity/A-Entity-List.decorator.d.ts +0 -1
- package/dist/src/decorators/A-Entity/A-Entity-List.decorator.js +0 -8
- package/dist/src/decorators/A-Entity/A-Entity-List.decorator.js.map +0 -1
- package/dist/src/decorators/A-Entity/A-Entity.decorator.types.d.ts +0 -14
- package/dist/src/decorators/A-Entity/A-Entity.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.d.ts +0 -19
- package/dist/src/decorators/A-Feature/A-Feature-Define.decorator.js.map +0 -1
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js +0 -81
- package/dist/src/decorators/A-Feature/A-Feature-Extend.decorator.js.map +0 -1
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.d.ts +0 -96
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.js +0 -3
- package/dist/src/decorators/A-Feature/A-Feature.decorator.types.js.map +0 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.d.ts +0 -30
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js +0 -47
- package/dist/src/decorators/A-Inject/A-Inject.decorator.js.map +0 -1
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.d.ts +0 -48
- package/dist/src/decorators/A-Inject/A-Inject.decorator.types.js.map +0 -1
- package/dist/src/global/A-Channel/A-Channel.class.d.ts +0 -16
- package/dist/src/global/A-Channel/A-Channel.class.js +0 -59
- package/dist/src/global/A-Channel/A-Channel.class.js.map +0 -1
- package/dist/src/global/A-Channel/A-Channel.types.d.ts +0 -68
- package/dist/src/global/A-Channel/A-Channel.types.js.map +0 -1
- package/dist/src/global/A-Command/A-Command.class.d.ts +0 -187
- package/dist/src/global/A-Command/A-Command.class.js +0 -349
- package/dist/src/global/A-Command/A-Command.class.js.map +0 -1
- package/dist/src/global/A-Command/A-Command.constants.d.ts +0 -17
- package/dist/src/global/A-Command/A-Command.constants.js +0 -22
- package/dist/src/global/A-Command/A-Command.constants.js.map +0 -1
- package/dist/src/global/A-Command/A-Command.meta.d.ts +0 -11
- package/dist/src/global/A-Command/A-Command.meta.js +0 -18
- package/dist/src/global/A-Command/A-Command.meta.js.map +0 -1
- package/dist/src/global/A-Command/A-Command.types.d.ts +0 -43
- package/dist/src/global/A-Command/A-Command.types.js +0 -10
- package/dist/src/global/A-Command/A-Command.types.js.map +0 -1
- package/dist/src/global/A-Command/context/A_Command.context.d.ts +0 -64
- package/dist/src/global/A-Command/context/A_Command.context.js +0 -85
- package/dist/src/global/A-Command/context/A_Command.context.js.map +0 -1
- package/dist/src/global/A-Concept/A_Concept.class.d.ts +0 -104
- package/dist/src/global/A-Concept/A_Concept.class.js +0 -217
- package/dist/src/global/A-Concept/A_Concept.class.js.map +0 -1
- package/dist/src/global/A-Concept/A_Concept.meta.js.map +0 -1
- package/dist/src/global/A-Concept/A_Concept.types.d.ts +0 -103
- package/dist/src/global/A-Concept/A_Concept.types.js +0 -28
- package/dist/src/global/A-Concept/A_Concept.types.js.map +0 -1
- package/dist/src/global/A-Feature/A-FeatureCaller.class.d.ts +0 -22
- package/dist/src/global/A-Feature/A-FeatureCaller.class.js +0 -26
- package/dist/src/global/A-Feature/A-FeatureCaller.class.js.map +0 -1
- package/dist/src/global/A-Scope/A-Scope.constants.d.ts +0 -2
- package/dist/src/global/A-Scope/A-Scope.constants.js +0 -11
- package/dist/src/global/A-Scope/A-Scope.constants.js.map +0 -1
- package/dist/src/helpers/StepsManager.class.js.map +0 -1
- package/dist/src/types/A_Module.types.d.ts +0 -17
- package/dist/src/types/A_Module.types.js +0 -22
- package/dist/src/types/A_Module.types.js.map +0 -1
- package/examples/entity/concept.ts +0 -68
- package/examples/entity/entities/Task.entity.ts +0 -110
- package/examples/entity/entities/User.entity.ts +0 -62
- package/examples/fe-be/channels/Test.channel.ts +0 -27
- package/examples/fe-be/components/BE-Controller.component.ts +0 -20
- package/examples/fe-be/components/FE.component.ts +0 -13
- package/examples/fe-be/containers/ServerApp.container.ts +0 -8
- package/examples/fe-be/containers/WebApp.container.ts +0 -13
- package/examples/multi-container/channels/Direct.channel.ts +0 -39
- package/examples/multi-container/concept.ts +0 -0
- package/examples/multi-container/containers/Command.container.ts +0 -41
- package/examples/multi-container/containers/Schedule.container.ts +0 -52
- package/examples/simple/components/A.component.ts +0 -71
- package/examples/simple/components/B.component.ts +0 -68
- package/examples/simple/concept.ts +0 -87
- package/examples/simple/containers/Main.container.ts +0 -88
- package/examples/simple/containers/Secondary.container.ts +0 -26
- package/examples/simple/context/Fragment_A.context.ts +0 -25
- package/examples/simple/context/Fragment_B.context.ts +0 -19
- package/examples/simple/entities/EntityA.entity.ts +0 -32
- package/examples/simple-http-server/components/http-error-handler.component.ts +0 -47
- package/examples/simple-http-server/components/http-request-handler.component.ts +0 -13
- package/examples/simple-http-server/concept.ts +0 -35
- package/examples/simple-http-server/containers/http-server.container.ts +0 -57
- package/examples/simple-http-server/contexts/http-request.context.ts +0 -59
- package/examples/simple-http-server/contexts/http-server.context.types.ts +0 -0
- package/examples/simple-http-server/controllers/orders.controller.ts +0 -20
- package/examples/simple-http-server/controllers/users.controller.ts +0 -104
- package/examples/simple-http-server/test.ts +0 -290
- package/src/base/A-Config/A-Config.container.ts +0 -68
- package/src/base/A-Config/A-Config.context.ts +0 -114
- package/src/base/A-Config/A-Config.types.ts +0 -28
- package/src/base/A-Config/components/ConfigReader.component.ts +0 -68
- package/src/base/A-Config/components/ENVConfigReader.component.ts +0 -31
- package/src/base/A-Config/components/FileConfigReader.component.ts +0 -41
- package/src/base/A-Errors/A-Error.entity.ts +0 -10
- package/src/base/A-Errors/A-Errors.component.ts +0 -103
- package/src/base/A-Errors/A-Errors.context.ts +0 -90
- package/src/base/A-Errors/A-Errors.types.ts +0 -6
- package/src/base/A-Logger/A-Logger.component.ts +0 -192
- package/src/base/A-Logger/A-Logger.types.ts +0 -0
- package/src/base/A-Polyfill/A-Polyfill.component.ts +0 -18
- package/src/decorators/A-Abstraction/A-Abstraction-Extend.decorator.ts +0 -81
- package/src/decorators/A-Abstraction/A-Abstraction.decorator.types.ts +0 -21
- package/src/decorators/A-Connect/A-Connect.decorator.ts +0 -71
- package/src/decorators/A-Connect/A-Connect.decorator.types.ts +0 -6
- package/src/decorators/A-Entity/A-Entity-List.decorator.ts +0 -12
- package/src/decorators/A-Entity/A-Entity.decorator.types.ts +0 -18
- package/src/decorators/A-Feature/A-Feature-Extend.decorator.ts +0 -151
- package/src/decorators/A-Feature/A-Feature.decorator.types.ts +0 -142
- package/src/decorators/A-Inject/A-Inject.decorator.ts +0 -119
- package/src/decorators/A-Inject/A-Inject.decorator.types.ts +0 -85
- package/src/global/A-Channel/A-Channel.class.ts +0 -111
- package/src/global/A-Channel/A-Channel.types.ts +0 -114
- package/src/global/A-Command/A-Command.class.ts +0 -419
- package/src/global/A-Command/A-Command.constants.ts +0 -27
- package/src/global/A-Command/A-Command.meta.ts +0 -22
- package/src/global/A-Command/A-Command.types.ts +0 -73
- package/src/global/A-Command/context/A_Command.context.ts +0 -114
- package/src/global/A-Concept/A_Concept.class.ts +0 -298
- package/src/global/A-Concept/A_Concept.meta.ts +0 -32
- package/src/global/A-Concept/A_Concept.types.ts +0 -143
- package/src/global/A-Feature/A-FeatureCaller.class.ts +0 -38
- package/src/global/A-Scope/A-Scope.constants.ts +0 -9
- package/src/types/A_Module.types.ts +0 -23
- package/tests/A-Command.test.ts +0 -133
- package/tests/A-Config.test.ts +0 -172
- /package/dist/src/global/A-Concept/{A_Concept.meta.d.ts → A-Concept.meta.d.ts} +0 -0
- /package/dist/src/{base/A-Logger/A-Logger.types.d.ts → global/ASEID/ASEID.constants.d.ts} +0 -0
- /package/{examples/fe-be/concept.ts → src/global/ASEID/ASEID.constants.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A_Component } from "../A-Component/A-Component.class";
|
|
2
1
|
import { A_Container } from "../A-Container/A-Container.class";
|
|
3
|
-
import {
|
|
2
|
+
import { A_TYPES__Component_Constructor } from "../A-Component/A-Component.types";
|
|
3
|
+
import { A_TYPES__FeatureExtendDecoratorBehaviorConfig } from "../A-Feature/A-Feature.types";
|
|
4
4
|
export declare enum A_TYPES__A_Stage_Status {
|
|
5
5
|
/**
|
|
6
6
|
* The stage is currently being processed
|
|
@@ -31,18 +31,6 @@ export declare enum A_TYPES__A_Stage_Status {
|
|
|
31
31
|
* The stage has been initialized
|
|
32
32
|
*/
|
|
33
33
|
INITIALIZED = "INITIALIZED",
|
|
34
|
-
/**
|
|
35
|
-
* The stage has been reset
|
|
36
|
-
*/
|
|
37
|
-
/**
|
|
38
|
-
* The stage has been resumed
|
|
39
|
-
*/
|
|
40
|
-
/**
|
|
41
|
-
* The stage has been suspended
|
|
42
|
-
*/
|
|
43
|
-
/**
|
|
44
|
-
* The stage has been terminated
|
|
45
|
-
*/
|
|
46
34
|
/**
|
|
47
35
|
* The stage has been aborted
|
|
48
36
|
*/
|
|
@@ -52,7 +40,7 @@ export type A_TYPES__A_StageStep = {
|
|
|
52
40
|
/**
|
|
53
41
|
* The component to be called
|
|
54
42
|
*/
|
|
55
|
-
component:
|
|
43
|
+
component: A_TYPES__Component_Constructor | A_Container | string;
|
|
56
44
|
/**
|
|
57
45
|
* The method to be called on the component
|
|
58
46
|
*/
|
|
@@ -64,7 +52,7 @@ export type A_TYPES__A_StageStep = {
|
|
|
64
52
|
*
|
|
65
53
|
*/
|
|
66
54
|
name: string;
|
|
67
|
-
} &
|
|
55
|
+
} & A_TYPES__FeatureExtendDecoratorBehaviorConfig;
|
|
68
56
|
export type A_TYPES__A_Stage_JSON = {
|
|
69
57
|
/**
|
|
70
58
|
* The name of the stage
|
|
@@ -35,22 +35,6 @@ var A_TYPES__A_Stage_Status;
|
|
|
35
35
|
* The stage has been initialized
|
|
36
36
|
*/
|
|
37
37
|
A_TYPES__A_Stage_Status["INITIALIZED"] = "INITIALIZED";
|
|
38
|
-
/**
|
|
39
|
-
* The stage has been reset
|
|
40
|
-
*/
|
|
41
|
-
// RESET = 'RESET',
|
|
42
|
-
/**
|
|
43
|
-
* The stage has been resumed
|
|
44
|
-
*/
|
|
45
|
-
// RESUMED = 'RESUMED',
|
|
46
|
-
/**
|
|
47
|
-
* The stage has been suspended
|
|
48
|
-
*/
|
|
49
|
-
// SUSPENDED = 'SUSPENDED',
|
|
50
|
-
/**
|
|
51
|
-
* The stage has been terminated
|
|
52
|
-
*/
|
|
53
|
-
// TERMINATED = 'TERMINATED',
|
|
54
38
|
/**
|
|
55
39
|
* The stage has been aborted
|
|
56
40
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"A-Stage.types.js","sourceRoot":"","sources":["../../../../src/global/A-Stage/A-Stage.types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"A-Stage.types.js","sourceRoot":"","sources":["../../../../src/global/A-Stage/A-Stage.types.ts"],"names":[],"mappings":";;;AAMA,IAAY,uBAqCX;AArCD,WAAY,uBAAuB;IAC/B;;OAEG;IACH,oDAAyB,CAAA;IACzB;;OAEG;IACH,kDAAuB,CAAA;IACvB;;OAEG;IACH,4CAAiB,CAAA;IACjB;;OAEG;IACH,8CAAmB,CAAA;IACnB;;OAEG;IACH,qBAAqB;IACrB;;OAEG;IACH,uBAAuB;IACvB;;OAEG;IACH,uBAAuB;IACvB;;OAEG;IACH,sDAA2B,CAAA;IAC3B;;OAEG;IACH,8CAAmB,CAAA;AACvB,CAAC,EArCW,uBAAuB,uCAAvB,uBAAuB,QAqClC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { A_TYPES__ASEID_Constructor, A_TYPES__ASEID_JSON } from "./ASEID.types";
|
|
2
|
+
import { A_TYPES__Required } from "../../types/A_Common.types";
|
|
3
|
+
export declare class ASEID {
|
|
4
|
+
/**
|
|
5
|
+
* ASEID Regular Expression
|
|
6
|
+
*/
|
|
7
|
+
static readonly regexp: RegExp;
|
|
8
|
+
/**
|
|
9
|
+
* Tests if the identity string is an ASEID
|
|
10
|
+
*
|
|
11
|
+
* @param identity
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
static isASEID(identity: string): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Concept for the ASEID
|
|
17
|
+
* Generally it is the application name or code, should correspond to the concept where the entity is used
|
|
18
|
+
* Could be ID or ASEID
|
|
19
|
+
*/
|
|
20
|
+
private _concept;
|
|
21
|
+
/**
|
|
22
|
+
* Entity Scope the primary location of the resource
|
|
23
|
+
* Organization, or organization Unit
|
|
24
|
+
* Could be ID or ASEID
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
private _scope;
|
|
28
|
+
/**
|
|
29
|
+
* Entity Type the type of the resource
|
|
30
|
+
*/
|
|
31
|
+
private _entity;
|
|
32
|
+
/**
|
|
33
|
+
* Entity ID the unique identifier of the resource
|
|
34
|
+
*/
|
|
35
|
+
private _id;
|
|
36
|
+
/**
|
|
37
|
+
* Version of the entity (optional)
|
|
38
|
+
*/
|
|
39
|
+
private _version?;
|
|
40
|
+
/**
|
|
41
|
+
* Shard of the entity (optional)
|
|
42
|
+
*/
|
|
43
|
+
private _shard?;
|
|
44
|
+
/**
|
|
45
|
+
* ASEID is a structured identifier for entities in the A-Concept system.
|
|
46
|
+
* using the format:
|
|
47
|
+
* A - A-Concept
|
|
48
|
+
* S - System
|
|
49
|
+
* E - Entity
|
|
50
|
+
* I - Identifier
|
|
51
|
+
* D - iDentifier
|
|
52
|
+
*
|
|
53
|
+
* Structure: CONCEPT_NAME + @ + SCOPE + : ENTITY_NAME + : + ID + @ + VERSION
|
|
54
|
+
*
|
|
55
|
+
* Example:
|
|
56
|
+
* - root@core:usr:0000000001
|
|
57
|
+
*
|
|
58
|
+
* [!] Concept is optional, if not provided will be used the current concept name
|
|
59
|
+
* [!] Scope is optional, if not provided will be used the root scope of the current concept
|
|
60
|
+
* [!] Version is optional, if not provided will be considered as latest version
|
|
61
|
+
*
|
|
62
|
+
* @param aseid - ASEID string representation or ASEID components as object
|
|
63
|
+
*/
|
|
64
|
+
constructor(
|
|
65
|
+
/**
|
|
66
|
+
* ASEID string representation
|
|
67
|
+
*/
|
|
68
|
+
aseid: string);
|
|
69
|
+
constructor(
|
|
70
|
+
/**
|
|
71
|
+
* ASEID components as object
|
|
72
|
+
*/
|
|
73
|
+
props: A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>);
|
|
74
|
+
/**
|
|
75
|
+
* Getters for ASEID components
|
|
76
|
+
*/
|
|
77
|
+
get concept(): string;
|
|
78
|
+
/**
|
|
79
|
+
* Get the scope of the ASEID
|
|
80
|
+
*/
|
|
81
|
+
get scope(): string;
|
|
82
|
+
/**
|
|
83
|
+
* Get the entity of the ASEID
|
|
84
|
+
*/
|
|
85
|
+
get entity(): string;
|
|
86
|
+
/**
|
|
87
|
+
* Get the id of the ASEID
|
|
88
|
+
*/
|
|
89
|
+
get id(): string;
|
|
90
|
+
/**
|
|
91
|
+
* Get the version of the ASEID (if any)
|
|
92
|
+
*/
|
|
93
|
+
get version(): string | undefined;
|
|
94
|
+
/**
|
|
95
|
+
* Get the shard of the ASEID (if any)
|
|
96
|
+
*/
|
|
97
|
+
get shard(): string | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* get Internal Initializer based on the type of the parameter provided
|
|
100
|
+
*
|
|
101
|
+
* @param param1
|
|
102
|
+
* @returns
|
|
103
|
+
*/
|
|
104
|
+
private getInitializer;
|
|
105
|
+
/**
|
|
106
|
+
* Initialize ASEID from string
|
|
107
|
+
*
|
|
108
|
+
* @param param1
|
|
109
|
+
*/
|
|
110
|
+
private fromString;
|
|
111
|
+
/**
|
|
112
|
+
* Initialize ASEID from object
|
|
113
|
+
*
|
|
114
|
+
* @param param1
|
|
115
|
+
*/
|
|
116
|
+
private fromObject;
|
|
117
|
+
/**
|
|
118
|
+
* String representation of the ASEID
|
|
119
|
+
*
|
|
120
|
+
* @returns
|
|
121
|
+
*/
|
|
122
|
+
toString(): string;
|
|
123
|
+
/**
|
|
124
|
+
* JSON representation of the ASEID
|
|
125
|
+
*
|
|
126
|
+
* @returns
|
|
127
|
+
*/
|
|
128
|
+
toJSON(): A_TYPES__ASEID_JSON;
|
|
129
|
+
protected verifyInput(param1: string | A_TYPES__Required<Partial<A_TYPES__ASEID_Constructor>, ['id', 'entity']>): void;
|
|
130
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ASEID = void 0;
|
|
4
|
+
const A_Identity_helper_1 = require("../../helpers/A_Identity.helper");
|
|
5
|
+
const A_TypeGuards_helper_1 = require("../../helpers/A_TypeGuards.helper");
|
|
6
|
+
const A_Context_class_1 = require("../A-Context/A-Context.class");
|
|
7
|
+
const ASEID_error_1 = require("./ASEID.error");
|
|
8
|
+
class ASEID {
|
|
9
|
+
/**
|
|
10
|
+
* Tests if the identity string is an ASEID
|
|
11
|
+
*
|
|
12
|
+
* @param identity
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
static isASEID(identity) {
|
|
16
|
+
return this.regexp.test(identity);
|
|
17
|
+
}
|
|
18
|
+
constructor(param1) {
|
|
19
|
+
this.verifyInput(param1);
|
|
20
|
+
const initializer = this.getInitializer(param1);
|
|
21
|
+
// the returned initializer is already bound to `this` (we used .bind(this)),
|
|
22
|
+
// so calling it will run the appropriate logic on this instance:
|
|
23
|
+
initializer.call(this, param1);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Getters for ASEID components
|
|
27
|
+
*/
|
|
28
|
+
get concept() {
|
|
29
|
+
return this._concept || A_Context_class_1.A_Context.concept;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get the scope of the ASEID
|
|
33
|
+
*/
|
|
34
|
+
get scope() {
|
|
35
|
+
return this._scope || A_Context_class_1.A_Context.root.name;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the entity of the ASEID
|
|
39
|
+
*/
|
|
40
|
+
get entity() {
|
|
41
|
+
return this._entity;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get the id of the ASEID
|
|
45
|
+
*/
|
|
46
|
+
get id() {
|
|
47
|
+
return this._id;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get the version of the ASEID (if any)
|
|
51
|
+
*/
|
|
52
|
+
get version() {
|
|
53
|
+
return this._version;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Get the shard of the ASEID (if any)
|
|
57
|
+
*/
|
|
58
|
+
get shard() {
|
|
59
|
+
return this._shard;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* get Internal Initializer based on the type of the parameter provided
|
|
63
|
+
*
|
|
64
|
+
* @param param1
|
|
65
|
+
* @returns
|
|
66
|
+
*/
|
|
67
|
+
getInitializer(param1) {
|
|
68
|
+
switch (true) {
|
|
69
|
+
case A_TypeGuards_helper_1.A_TypeGuards.isString(param1):
|
|
70
|
+
return this.fromString;
|
|
71
|
+
case A_TypeGuards_helper_1.A_TypeGuards.isObject(param1):
|
|
72
|
+
return this.fromObject;
|
|
73
|
+
default:
|
|
74
|
+
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDInitializationError, 'Invalid parameters provided to ASEID constructor');
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Initialize ASEID from string
|
|
79
|
+
*
|
|
80
|
+
* @param param1
|
|
81
|
+
*/
|
|
82
|
+
fromString(param1) {
|
|
83
|
+
const [concept, body, version] = param1.split('@');
|
|
84
|
+
const [scope, entity, idCandidate] = body.split(':');
|
|
85
|
+
const shard = idCandidate.includes('.') ? idCandidate.split('.')[0] : undefined;
|
|
86
|
+
const id = idCandidate.includes('.') ? idCandidate.split('.')[1] : idCandidate;
|
|
87
|
+
this._concept = concept || A_Context_class_1.A_Context.root.name;
|
|
88
|
+
this._scope = scope || A_Context_class_1.A_Context.root.name;
|
|
89
|
+
this._entity = entity;
|
|
90
|
+
this._id = id;
|
|
91
|
+
this._version = version;
|
|
92
|
+
this._shard = shard;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Initialize ASEID from object
|
|
96
|
+
*
|
|
97
|
+
* @param param1
|
|
98
|
+
*/
|
|
99
|
+
fromObject(param1) {
|
|
100
|
+
this._concept = param1.concept
|
|
101
|
+
? ASEID.isASEID(param1.concept)
|
|
102
|
+
? new ASEID(param1.concept).id
|
|
103
|
+
: param1.concept
|
|
104
|
+
: A_Context_class_1.A_Context.concept;
|
|
105
|
+
this._scope = param1.scope
|
|
106
|
+
? A_TypeGuards_helper_1.A_TypeGuards.isNumber(param1.scope)
|
|
107
|
+
? A_Identity_helper_1.A_IdentityHelper.formatWithLeadingZeros(param1.scope) :
|
|
108
|
+
ASEID.isASEID(param1.scope)
|
|
109
|
+
? new ASEID(param1.scope).id
|
|
110
|
+
: param1.scope
|
|
111
|
+
: A_Context_class_1.A_Context.root.name;
|
|
112
|
+
this._entity = param1.entity;
|
|
113
|
+
this._id = A_TypeGuards_helper_1.A_TypeGuards.isNumber(param1.id)
|
|
114
|
+
? A_Identity_helper_1.A_IdentityHelper.formatWithLeadingZeros(param1.id)
|
|
115
|
+
: param1.id;
|
|
116
|
+
this._version = param1.version;
|
|
117
|
+
this._shard = param1.shard;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* String representation of the ASEID
|
|
121
|
+
*
|
|
122
|
+
* @returns
|
|
123
|
+
*/
|
|
124
|
+
toString() {
|
|
125
|
+
return `${this.concept}@${this.scope}:${this.entity}:${this.shard ? (this.shard + '.' + this.id) : this.id}${this.version ? ('@' + this.version) : ''}`;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* JSON representation of the ASEID
|
|
129
|
+
*
|
|
130
|
+
* @returns
|
|
131
|
+
*/
|
|
132
|
+
toJSON() {
|
|
133
|
+
return {
|
|
134
|
+
concept: this._concept,
|
|
135
|
+
scope: this._scope,
|
|
136
|
+
entity: this._entity,
|
|
137
|
+
id: this._id,
|
|
138
|
+
version: this._version,
|
|
139
|
+
shard: this._shard
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// --------------------------------------------------------------------------
|
|
143
|
+
// ----------------------- PROTECTED HELPERS --------------------------------
|
|
144
|
+
// --------------------------------------------------------------------------
|
|
145
|
+
verifyInput(param1) {
|
|
146
|
+
switch (true) {
|
|
147
|
+
// 1) check for string and validate it as ASEID
|
|
148
|
+
case A_TypeGuards_helper_1.A_TypeGuards.isString(param1) && !ASEID.isASEID(param1):
|
|
149
|
+
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDValidationError, 'Invalid ASEID format provided');
|
|
150
|
+
// 2) check for object and validate required fields
|
|
151
|
+
case A_TypeGuards_helper_1.A_TypeGuards.isObject(param1) && !param1.id:
|
|
152
|
+
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDValidationError, 'ASEID id is required');
|
|
153
|
+
// 3) check for object and validate required fields
|
|
154
|
+
case A_TypeGuards_helper_1.A_TypeGuards.isObject(param1) && !param1.entity:
|
|
155
|
+
throw new ASEID_error_1.ASEID_Error(ASEID_error_1.ASEID_Error.ASEIDValidationError, 'ASEID entity is required');
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
exports.ASEID = ASEID;
|
|
160
|
+
//==========================================================================
|
|
161
|
+
//============================= STATIC METHODS ===========================
|
|
162
|
+
//==========================================================================
|
|
163
|
+
/**
|
|
164
|
+
* ASEID Regular Expression
|
|
165
|
+
*/
|
|
166
|
+
ASEID.regexp = new RegExp(`^[a-z|A-Z|0-9|-]+@[a-z|A-Z|0-9|-]+:[a-z|A-Z|0-9|-]+:[a-z|A-Z|0-9|-|\\.]+(@v[0-9|\\.]+|@lts)?$`);
|
|
167
|
+
//# sourceMappingURL=ASEID.class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ASEID.class.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.class.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ASEID.constants.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.constants.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ASEID_Error = void 0;
|
|
4
|
+
const A_Error_class_1 = require("../A-Error/A_Error.class");
|
|
5
|
+
class ASEID_Error extends A_Error_class_1.A_Error {
|
|
6
|
+
}
|
|
7
|
+
exports.ASEID_Error = ASEID_Error;
|
|
8
|
+
ASEID_Error.ASEIDInitializationError = 'ASEID Initialization Error';
|
|
9
|
+
ASEID_Error.ASEIDValidationError = 'ASEID Validation Error';
|
|
10
|
+
//# sourceMappingURL=ASEID.error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ASEID.error.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.error.ts"],"names":[],"mappings":";;;AAAA,4DAAmD;AAInD,MAAa,WAAY,SAAQ,uBAAO;;AAAxC,kCAOC;AAJmB,oCAAwB,GAAG,4BAA4B,CAAC;AAExD,gCAAoB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface A_TYPES__ASEID_Constructor {
|
|
2
|
+
/**
|
|
3
|
+
* Concept for the ASEID
|
|
4
|
+
* Generally it is the application name or code, should correspond to the concept where the entity is used
|
|
5
|
+
* Could be ID or ASEID
|
|
6
|
+
*/
|
|
7
|
+
concept?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Entity Scope the primary location of the resource
|
|
10
|
+
* Organization, or organization Unit or Internal/External
|
|
11
|
+
* Could be ID or ASEID
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
scope: number | string;
|
|
15
|
+
/**
|
|
16
|
+
* Entity Type the type of the resource
|
|
17
|
+
*/
|
|
18
|
+
entity: string;
|
|
19
|
+
/**
|
|
20
|
+
* Entity ID the unique identifier of the resource
|
|
21
|
+
*/
|
|
22
|
+
id: number | string;
|
|
23
|
+
/**
|
|
24
|
+
* Version of the entity (optional)
|
|
25
|
+
*/
|
|
26
|
+
version?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Shard of the entity (optional)
|
|
29
|
+
*/
|
|
30
|
+
shard?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface A_TYPES__ASEID_ConstructorConfig {
|
|
33
|
+
/**
|
|
34
|
+
* If true, the entity ASEID will be distributed across multiple shards.
|
|
35
|
+
* In this case SHARD should be provided via Environment Variables (A_SHARD) or Configurations
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
sharding?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export type A_TYPES__ASEID_JSON = {
|
|
41
|
+
/**
|
|
42
|
+
* Concept for the ASEID
|
|
43
|
+
*/
|
|
44
|
+
concept: string;
|
|
45
|
+
/**
|
|
46
|
+
* Entity Scope the primary location of the resource
|
|
47
|
+
*/
|
|
48
|
+
scope: string;
|
|
49
|
+
/**
|
|
50
|
+
* Entity Type the type of the resource
|
|
51
|
+
*/
|
|
52
|
+
entity: string;
|
|
53
|
+
/**
|
|
54
|
+
* Entity ID the unique identifier of the resource
|
|
55
|
+
*/
|
|
56
|
+
id: string;
|
|
57
|
+
/**
|
|
58
|
+
* Version of the entity (optional)
|
|
59
|
+
*/
|
|
60
|
+
version?: string;
|
|
61
|
+
/**
|
|
62
|
+
* Shard of the entity (optional)
|
|
63
|
+
*/
|
|
64
|
+
shard?: string;
|
|
65
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ASEID.types.js","sourceRoot":"","sources":["../../../../src/global/ASEID/ASEID.types.ts"],"names":[],"mappings":";;AA8BC,CAAC;AAYD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { A_TYPES__DeepPartial } from "../types/A_Common.types";
|
|
2
|
+
export declare class A_CommonHelper {
|
|
3
|
+
/**
|
|
4
|
+
* A simple promise that resolves immediately.
|
|
5
|
+
* Can be used in async functions to create a resolved promise.
|
|
6
|
+
*/
|
|
7
|
+
static resolve(): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Check if a class is inherited from another class
|
|
10
|
+
*
|
|
11
|
+
* @param childClass
|
|
12
|
+
* @param parentClass
|
|
13
|
+
* @returns
|
|
14
|
+
*/
|
|
15
|
+
static isInheritedFrom(childClass: any, parentClass: any): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Omit properties from an object or array with nested objects
|
|
18
|
+
*
|
|
19
|
+
* @param input
|
|
20
|
+
* @param paths
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
static omitProperties<T, S extends string>(input: T, paths: string[]): Omit<T, S>;
|
|
24
|
+
static isObject(item: unknown): item is Record<string, any>;
|
|
25
|
+
static deepMerge<T = any>(target: any, source: any, visited?: Map<any, any>): T;
|
|
26
|
+
static deepClone<T>(target: T): T;
|
|
27
|
+
static deepCloneAndMerge<T>(target: A_TYPES__DeepPartial<T>, source: T): T;
|
|
28
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.A_CommonHelper = void 0;
|
|
4
|
+
class A_CommonHelper {
|
|
5
|
+
/**
|
|
6
|
+
* A simple promise that resolves immediately.
|
|
7
|
+
* Can be used in async functions to create a resolved promise.
|
|
8
|
+
*/
|
|
9
|
+
static resolve() {
|
|
10
|
+
return new Promise((resolve) => resolve());
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Check if a class is inherited from another class
|
|
14
|
+
*
|
|
15
|
+
* @param childClass
|
|
16
|
+
* @param parentClass
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
static isInheritedFrom(childClass, parentClass) {
|
|
20
|
+
let current = childClass;
|
|
21
|
+
// Traverse the prototype chain
|
|
22
|
+
while (current) {
|
|
23
|
+
if (current === parentClass) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
current = Object.getPrototypeOf(current);
|
|
27
|
+
}
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Omit properties from an object or array with nested objects
|
|
32
|
+
*
|
|
33
|
+
* @param input
|
|
34
|
+
* @param paths
|
|
35
|
+
* @returns
|
|
36
|
+
*/
|
|
37
|
+
static omitProperties(input, paths) {
|
|
38
|
+
// Deep clone the input object or array
|
|
39
|
+
const result = JSON.parse(JSON.stringify(input));
|
|
40
|
+
// Helper function to recursively remove properties
|
|
41
|
+
function removeProperties(target, currPath) {
|
|
42
|
+
const currKey = currPath[0];
|
|
43
|
+
if (currPath.length === 1) {
|
|
44
|
+
// If current path has only one key, delete the property
|
|
45
|
+
delete target[currKey];
|
|
46
|
+
}
|
|
47
|
+
else if (target[currKey] !== undefined && typeof target[currKey] === 'object') {
|
|
48
|
+
// If current key exists and is an object, recursively call removeProperties
|
|
49
|
+
removeProperties(target[currKey], currPath.slice(1));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// Iterate through each path and remove corresponding properties from the result
|
|
53
|
+
paths.forEach(path => {
|
|
54
|
+
const pathKeys = path.split('.');
|
|
55
|
+
removeProperties(result, pathKeys);
|
|
56
|
+
});
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
59
|
+
static isObject(item) {
|
|
60
|
+
return item !== null && typeof item === 'object' && !Array.isArray(item);
|
|
61
|
+
}
|
|
62
|
+
static deepMerge(target, source, visited = new Map()) {
|
|
63
|
+
if (this.isObject(target) && this.isObject(source)) {
|
|
64
|
+
for (const key in source) {
|
|
65
|
+
if (this.isObject(source[key])) {
|
|
66
|
+
if (!target[key]) {
|
|
67
|
+
target[key] = {};
|
|
68
|
+
}
|
|
69
|
+
// Check if the source object has already been visited
|
|
70
|
+
if (!visited.has(source[key])) {
|
|
71
|
+
visited.set(source[key], {});
|
|
72
|
+
this.deepMerge(target[key], source[key], visited);
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
target[key] = visited.get(source[key]);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
target[key] = source[key];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return target;
|
|
84
|
+
}
|
|
85
|
+
static deepClone(target) {
|
|
86
|
+
// Check if the value is null or undefined
|
|
87
|
+
if (target === null || target === undefined) {
|
|
88
|
+
return target;
|
|
89
|
+
}
|
|
90
|
+
// Handle primitive types (string, number, boolean, etc.)
|
|
91
|
+
if (typeof target !== 'object') {
|
|
92
|
+
return target;
|
|
93
|
+
}
|
|
94
|
+
// Handle Date
|
|
95
|
+
if (target instanceof Date) {
|
|
96
|
+
return new Date(target.getTime());
|
|
97
|
+
}
|
|
98
|
+
// Handle Array
|
|
99
|
+
if (Array.isArray(target)) {
|
|
100
|
+
return target.map(item => this.deepClone(item));
|
|
101
|
+
}
|
|
102
|
+
// Handle Function
|
|
103
|
+
if (typeof target === 'function') {
|
|
104
|
+
return target;
|
|
105
|
+
}
|
|
106
|
+
// Handle Object
|
|
107
|
+
if (target instanceof Object) {
|
|
108
|
+
const clone = {};
|
|
109
|
+
for (const key in target) {
|
|
110
|
+
if (target.hasOwnProperty(key)) {
|
|
111
|
+
clone[key] = this.deepClone(target[key]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
return clone;
|
|
115
|
+
}
|
|
116
|
+
// For any other cases
|
|
117
|
+
throw new Error('Unable to clone the object. Unsupported type.');
|
|
118
|
+
}
|
|
119
|
+
static deepCloneAndMerge(target, source) {
|
|
120
|
+
if ((source === null || source === undefined) &&
|
|
121
|
+
(target === null || target === undefined))
|
|
122
|
+
return target;
|
|
123
|
+
// Check if the value is null or undefined
|
|
124
|
+
if ((target === null || target === undefined) &&
|
|
125
|
+
source) {
|
|
126
|
+
return this.deepClone(source);
|
|
127
|
+
}
|
|
128
|
+
// Handle primitive types (string, number, boolean, etc.)
|
|
129
|
+
if (typeof target !== 'object') {
|
|
130
|
+
return target;
|
|
131
|
+
}
|
|
132
|
+
// Handle Date
|
|
133
|
+
if (target instanceof Date) {
|
|
134
|
+
return new Date(target.getTime());
|
|
135
|
+
}
|
|
136
|
+
// Handle Array
|
|
137
|
+
if (Array.isArray(target)) {
|
|
138
|
+
return target.map(item => this.deepCloneAndMerge(item, source));
|
|
139
|
+
}
|
|
140
|
+
// Handle Function
|
|
141
|
+
if (typeof target === 'function') {
|
|
142
|
+
return target;
|
|
143
|
+
}
|
|
144
|
+
// Handle Object
|
|
145
|
+
if (target instanceof Object) {
|
|
146
|
+
const clone = {};
|
|
147
|
+
for (const key in target) {
|
|
148
|
+
if (source[key] !== null
|
|
149
|
+
&&
|
|
150
|
+
source[key] !== undefined)
|
|
151
|
+
clone[key] = this.deepCloneAndMerge(target[key], source[key]);
|
|
152
|
+
else
|
|
153
|
+
clone[key] = this.deepClone(target[key]);
|
|
154
|
+
}
|
|
155
|
+
for (const key in source) {
|
|
156
|
+
if (target[key] !== undefined
|
|
157
|
+
&&
|
|
158
|
+
target[key] !== null)
|
|
159
|
+
clone[key] = this.deepCloneAndMerge(target[key], source[key]);
|
|
160
|
+
else
|
|
161
|
+
clone[key] = this.deepClone(source[key]);
|
|
162
|
+
}
|
|
163
|
+
return clone;
|
|
164
|
+
}
|
|
165
|
+
// For any other cases
|
|
166
|
+
throw new Error('Unable to clone the object. Unsupported type.');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
exports.A_CommonHelper = A_CommonHelper;
|
|
170
|
+
//# sourceMappingURL=A_Common.helper.js.map
|