@adaas/a-utils 0.2.8 → 0.3.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/.conf/tsconfig.base.json +91 -0
- package/.conf/tsconfig.browser.json +26 -0
- package/.conf/tsconfig.node.json +30 -0
- package/dist/browser/A-Logger.component-Be-LMV3I.d.mts +467 -0
- package/dist/browser/A-StateMachineTransition.context-BINjcsgq.d.mts +221 -0
- package/dist/browser/a-channel.d.mts +456 -0
- package/dist/browser/a-channel.mjs +367 -0
- package/dist/browser/a-channel.mjs.map +1 -0
- package/dist/browser/a-command.d.mts +555 -0
- package/dist/browser/a-command.mjs +567 -0
- package/dist/browser/a-command.mjs.map +1 -0
- package/dist/browser/a-config.d.mts +60 -0
- package/dist/browser/a-config.mjs +6 -0
- package/dist/browser/a-config.mjs.map +1 -0
- package/dist/browser/a-execution.d.mts +17 -0
- package/dist/browser/a-execution.mjs +4 -0
- package/dist/browser/a-execution.mjs.map +1 -0
- package/dist/browser/a-logger.d.mts +107 -0
- package/dist/browser/a-logger.mjs +7 -0
- package/dist/browser/a-logger.mjs.map +1 -0
- package/dist/browser/a-manifest.d.mts +111 -0
- package/dist/browser/a-manifest.mjs +176 -0
- package/dist/browser/a-manifest.mjs.map +1 -0
- package/dist/browser/a-memory.d.mts +163 -0
- package/dist/browser/a-memory.mjs +375 -0
- package/dist/browser/a-memory.mjs.map +1 -0
- package/dist/browser/a-operation.d.mts +52 -0
- package/dist/browser/a-operation.mjs +5 -0
- package/dist/browser/a-operation.mjs.map +1 -0
- package/dist/browser/a-polyfill.d.mts +275 -0
- package/dist/browser/a-polyfill.mjs +4 -0
- package/dist/browser/a-polyfill.mjs.map +1 -0
- package/dist/browser/a-route.d.mts +25 -0
- package/dist/browser/a-route.mjs +98 -0
- package/dist/browser/a-route.mjs.map +1 -0
- package/dist/browser/a-schedule.d.mts +111 -0
- package/dist/browser/a-schedule.mjs +97 -0
- package/dist/browser/a-schedule.mjs.map +1 -0
- package/dist/browser/a-service.d.mts +40 -0
- package/dist/browser/a-service.mjs +197 -0
- package/dist/browser/a-service.mjs.map +1 -0
- package/dist/browser/a-signal.d.mts +402 -0
- package/dist/browser/a-signal.mjs +588 -0
- package/dist/browser/a-signal.mjs.map +1 -0
- package/dist/browser/a-state-machine.d.mts +11 -0
- package/dist/browser/a-state-machine.mjs +6 -0
- package/dist/browser/a-state-machine.mjs.map +1 -0
- package/dist/browser/chunk-72ANHWNG.mjs +48 -0
- package/dist/browser/chunk-72ANHWNG.mjs.map +1 -0
- package/dist/browser/chunk-ECSGFDRQ.mjs +264 -0
- package/dist/browser/chunk-ECSGFDRQ.mjs.map +1 -0
- package/dist/browser/chunk-EQQGB2QZ.mjs +15 -0
- package/dist/browser/chunk-EQQGB2QZ.mjs.map +1 -0
- package/dist/browser/chunk-J6CLHXFQ.mjs +679 -0
- package/dist/browser/chunk-J6CLHXFQ.mjs.map +1 -0
- package/dist/browser/chunk-NLPSQYIQ.mjs +149 -0
- package/dist/browser/chunk-NLPSQYIQ.mjs.map +1 -0
- package/dist/browser/chunk-TK5UEYMZ.mjs +776 -0
- package/dist/browser/chunk-TK5UEYMZ.mjs.map +1 -0
- package/dist/browser/chunk-TQ5UON22.mjs +56 -0
- package/dist/browser/chunk-TQ5UON22.mjs.map +1 -0
- package/dist/node/A-Command.entity-24rvXQLC.d.mts +409 -0
- package/dist/node/A-Command.entity-ISgSk8wB.d.ts +409 -0
- package/dist/node/A-Manifest.context-D2uynD9t.d.mts +66 -0
- package/dist/node/A-Manifest.context-rZnvR17w.d.ts +66 -0
- package/dist/node/A-Signal.types-P5VKMKMs.d.mts +114 -0
- package/dist/node/A-Signal.types-P5VKMKMs.d.ts +114 -0
- package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
- package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
- package/dist/node/constants/errors.constants.d.mts +2 -0
- package/dist/node/constants/errors.constants.d.ts +2 -0
- package/dist/node/constants/errors.constants.js +4 -0
- package/dist/node/constants/errors.constants.js.map +1 -0
- package/dist/node/constants/errors.constants.mjs +3 -0
- package/dist/node/constants/errors.constants.mjs.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.component.d.mts +365 -0
- package/dist/node/lib/A-Channel/A-Channel.component.d.ts +365 -0
- package/dist/node/lib/A-Channel/A-Channel.component.js +303 -0
- package/dist/node/lib/A-Channel/A-Channel.component.js.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.component.mjs +294 -0
- package/dist/node/lib/A-Channel/A-Channel.component.mjs.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.constants.d.mts +68 -0
- package/dist/node/lib/A-Channel/A-Channel.constants.d.ts +68 -0
- package/dist/node/lib/A-Channel/A-Channel.constants.js +28 -0
- package/dist/node/lib/A-Channel/A-Channel.constants.js.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.constants.mjs +27 -0
- package/dist/node/lib/A-Channel/A-Channel.constants.mjs.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.error.d.mts +23 -0
- package/dist/node/lib/A-Channel/A-Channel.error.d.ts +23 -0
- package/dist/node/lib/A-Channel/A-Channel.error.js +36 -0
- package/dist/node/lib/A-Channel/A-Channel.error.js.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.error.mjs +35 -0
- package/dist/node/lib/A-Channel/A-Channel.error.mjs.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.types.d.mts +2 -0
- package/dist/node/lib/A-Channel/A-Channel.types.d.ts +2 -0
- package/dist/node/lib/A-Channel/A-Channel.types.js +4 -0
- package/dist/node/lib/A-Channel/A-Channel.types.js.map +1 -0
- package/dist/node/lib/A-Channel/A-Channel.types.mjs +3 -0
- package/dist/node/lib/A-Channel/A-Channel.types.mjs.map +1 -0
- package/dist/node/lib/A-Channel/A-ChannelRequest.context.d.mts +17 -0
- package/dist/node/lib/A-Channel/A-ChannelRequest.context.d.ts +17 -0
- package/dist/node/lib/A-Channel/A-ChannelRequest.context.js +41 -0
- package/dist/node/lib/A-Channel/A-ChannelRequest.context.js.map +1 -0
- package/dist/node/lib/A-Channel/A-ChannelRequest.context.mjs +34 -0
- package/dist/node/lib/A-Channel/A-ChannelRequest.context.mjs.map +1 -0
- package/dist/node/lib/A-Channel/index.d.mts +8 -0
- package/dist/node/lib/A-Channel/index.d.ts +8 -0
- package/dist/node/lib/A-Channel/index.js +36 -0
- package/dist/node/lib/A-Channel/index.js.map +1 -0
- package/dist/node/lib/A-Channel/index.mjs +8 -0
- package/dist/node/lib/A-Channel/index.mjs.map +1 -0
- package/dist/node/lib/A-Command/A-Command.constants.d.mts +139 -0
- package/dist/node/lib/A-Command/A-Command.constants.d.ts +139 -0
- package/dist/node/lib/A-Command/A-Command.constants.js +45 -0
- package/dist/node/lib/A-Command/A-Command.constants.js.map +1 -0
- package/dist/node/lib/A-Command/A-Command.constants.mjs +42 -0
- package/dist/node/lib/A-Command/A-Command.constants.mjs.map +1 -0
- package/dist/node/lib/A-Command/A-Command.entity.d.mts +16 -0
- package/dist/node/lib/A-Command/A-Command.entity.d.ts +16 -0
- package/dist/node/lib/A-Command/A-Command.entity.js +530 -0
- package/dist/node/lib/A-Command/A-Command.entity.js.map +1 -0
- package/dist/node/lib/A-Command/A-Command.entity.mjs +520 -0
- package/dist/node/lib/A-Command/A-Command.entity.mjs.map +1 -0
- package/dist/node/lib/A-Command/A-Command.error.d.mts +13 -0
- package/dist/node/lib/A-Command/A-Command.error.d.ts +13 -0
- package/dist/node/lib/A-Command/A-Command.error.js +17 -0
- package/dist/node/lib/A-Command/A-Command.error.js.map +1 -0
- package/dist/node/lib/A-Command/A-Command.error.mjs +16 -0
- package/dist/node/lib/A-Command/A-Command.error.mjs.map +1 -0
- package/dist/node/lib/A-Command/A-Command.types.d.mts +16 -0
- package/dist/node/lib/A-Command/A-Command.types.d.ts +16 -0
- package/dist/node/lib/A-Command/A-Command.types.js +4 -0
- package/dist/node/lib/A-Command/A-Command.types.js.map +1 -0
- package/dist/node/lib/A-Command/A-Command.types.mjs +3 -0
- package/dist/node/lib/A-Command/A-Command.types.mjs.map +1 -0
- package/dist/node/lib/A-Command/index.d.mts +17 -0
- package/dist/node/lib/A-Command/index.d.ts +17 -0
- package/dist/node/lib/A-Command/index.js +31 -0
- package/dist/node/lib/A-Command/index.js.map +1 -0
- package/dist/node/lib/A-Command/index.mjs +7 -0
- package/dist/node/lib/A-Command/index.mjs.map +1 -0
- package/dist/node/lib/A-Config/A-Config.constants.d.mts +5 -0
- package/dist/node/lib/A-Config/A-Config.constants.d.ts +5 -0
- package/dist/node/lib/A-Config/A-Config.constants.js +9 -0
- package/dist/node/lib/A-Config/A-Config.constants.js.map +1 -0
- package/dist/node/lib/A-Config/A-Config.constants.mjs +8 -0
- package/dist/node/lib/A-Config/A-Config.constants.mjs.map +1 -0
- package/dist/node/lib/A-Config/A-Config.container.d.mts +33 -0
- package/dist/node/lib/A-Config/A-Config.container.d.ts +33 -0
- package/dist/node/lib/A-Config/A-Config.container.js +78 -0
- package/dist/node/lib/A-Config/A-Config.container.js.map +1 -0
- package/dist/node/lib/A-Config/A-Config.container.mjs +68 -0
- package/dist/node/lib/A-Config/A-Config.container.mjs.map +1 -0
- package/dist/node/lib/A-Config/A-Config.context.d.mts +42 -0
- package/dist/node/lib/A-Config/A-Config.context.d.ts +42 -0
- package/dist/node/lib/A-Config/A-Config.context.js +65 -0
- package/dist/node/lib/A-Config/A-Config.context.js.map +1 -0
- package/dist/node/lib/A-Config/A-Config.context.mjs +58 -0
- package/dist/node/lib/A-Config/A-Config.context.mjs.map +1 -0
- package/dist/node/lib/A-Config/A-Config.error.d.mts +7 -0
- package/dist/node/lib/A-Config/A-Config.error.d.ts +7 -0
- package/dist/node/lib/A-Config/A-Config.error.js +11 -0
- package/dist/node/lib/A-Config/A-Config.error.js.map +1 -0
- package/dist/node/lib/A-Config/A-Config.error.mjs +10 -0
- package/dist/node/lib/A-Config/A-Config.error.mjs.map +1 -0
- package/dist/node/lib/A-Config/A-Config.types.d.mts +22 -0
- package/dist/node/lib/A-Config/A-Config.types.d.ts +22 -0
- package/dist/node/lib/A-Config/A-Config.types.js +9 -0
- package/dist/node/lib/A-Config/A-Config.types.js.map +1 -0
- package/dist/node/lib/A-Config/A-Config.types.mjs +9 -0
- package/dist/node/lib/A-Config/A-Config.types.mjs.map +1 -0
- package/dist/node/lib/A-Config/components/ConfigReader.component.d.mts +50 -0
- package/dist/node/lib/A-Config/components/ConfigReader.component.d.ts +50 -0
- package/dist/node/lib/A-Config/components/ConfigReader.component.js +81 -0
- package/dist/node/lib/A-Config/components/ConfigReader.component.js.map +1 -0
- package/dist/node/lib/A-Config/components/ConfigReader.component.mjs +71 -0
- package/dist/node/lib/A-Config/components/ConfigReader.component.mjs.map +1 -0
- package/dist/node/lib/A-Config/components/ENVConfigReader.component.d.mts +40 -0
- package/dist/node/lib/A-Config/components/ENVConfigReader.component.d.ts +40 -0
- package/dist/node/lib/A-Config/components/ENVConfigReader.component.js +69 -0
- package/dist/node/lib/A-Config/components/ENVConfigReader.component.js.map +1 -0
- package/dist/node/lib/A-Config/components/ENVConfigReader.component.mjs +59 -0
- package/dist/node/lib/A-Config/components/ENVConfigReader.component.mjs.map +1 -0
- package/dist/node/lib/A-Config/components/FileConfigReader.component.d.mts +40 -0
- package/dist/node/lib/A-Config/components/FileConfigReader.component.d.ts +40 -0
- package/dist/node/lib/A-Config/components/FileConfigReader.component.js +50 -0
- package/dist/node/lib/A-Config/components/FileConfigReader.component.js.map +1 -0
- package/dist/node/lib/A-Config/components/FileConfigReader.component.mjs +43 -0
- package/dist/node/lib/A-Config/components/FileConfigReader.component.mjs.map +1 -0
- package/dist/node/lib/A-Config/index.d.mts +31 -0
- package/dist/node/lib/A-Config/index.d.ts +31 -0
- package/dist/node/lib/A-Config/index.js +51 -0
- package/dist/node/lib/A-Config/index.js.map +1 -0
- package/dist/node/lib/A-Config/index.mjs +11 -0
- package/dist/node/lib/A-Config/index.mjs.map +1 -0
- package/dist/node/lib/A-Execution/A-Execution.context.d.mts +17 -0
- package/dist/node/lib/A-Execution/A-Execution.context.d.ts +17 -0
- package/dist/node/lib/A-Execution/A-Execution.context.js +63 -0
- package/dist/node/lib/A-Execution/A-Execution.context.js.map +1 -0
- package/dist/node/lib/A-Execution/A-Execution.context.mjs +56 -0
- package/dist/node/lib/A-Execution/A-Execution.context.mjs.map +1 -0
- package/dist/node/lib/A-Execution/A-Execution.types.d.mts +2 -0
- package/dist/node/lib/A-Execution/A-Execution.types.d.ts +2 -0
- package/dist/node/lib/A-Execution/A-Execution.types.js +4 -0
- package/dist/node/lib/A-Execution/A-Execution.types.js.map +1 -0
- package/dist/node/lib/A-Execution/A-Execution.types.mjs +3 -0
- package/dist/node/lib/A-Execution/A-Execution.types.mjs.map +1 -0
- package/dist/node/lib/A-Execution/index.d.mts +2 -0
- package/dist/node/lib/A-Execution/index.d.ts +2 -0
- package/dist/node/lib/A-Execution/index.js +12 -0
- package/dist/node/lib/A-Execution/index.js.map +1 -0
- package/dist/node/lib/A-Execution/index.mjs +4 -0
- package/dist/node/lib/A-Execution/index.mjs.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.component.d.mts +377 -0
- package/dist/node/lib/A-Logger/A-Logger.component.d.ts +377 -0
- package/dist/node/lib/A-Logger/A-Logger.component.js +623 -0
- package/dist/node/lib/A-Logger/A-Logger.component.js.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.component.mjs +615 -0
- package/dist/node/lib/A-Logger/A-Logger.component.mjs.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.constants.d.mts +103 -0
- package/dist/node/lib/A-Logger/A-Logger.constants.d.ts +103 -0
- package/dist/node/lib/A-Logger/A-Logger.constants.js +141 -0
- package/dist/node/lib/A-Logger/A-Logger.constants.js.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.constants.mjs +133 -0
- package/dist/node/lib/A-Logger/A-Logger.constants.mjs.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.env.d.mts +30 -0
- package/dist/node/lib/A-Logger/A-Logger.env.d.ts +30 -0
- package/dist/node/lib/A-Logger/A-Logger.env.js +39 -0
- package/dist/node/lib/A-Logger/A-Logger.env.js.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.env.mjs +38 -0
- package/dist/node/lib/A-Logger/A-Logger.env.mjs.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.types.d.mts +8 -0
- package/dist/node/lib/A-Logger/A-Logger.types.d.ts +8 -0
- package/dist/node/lib/A-Logger/A-Logger.types.js +4 -0
- package/dist/node/lib/A-Logger/A-Logger.types.js.map +1 -0
- package/dist/node/lib/A-Logger/A-Logger.types.mjs +3 -0
- package/dist/node/lib/A-Logger/A-Logger.types.mjs.map +1 -0
- package/dist/node/lib/A-Logger/index.d.mts +9 -0
- package/dist/node/lib/A-Logger/index.d.ts +9 -0
- package/dist/node/lib/A-Logger/index.js +35 -0
- package/dist/node/lib/A-Logger/index.js.map +1 -0
- package/dist/node/lib/A-Logger/index.mjs +6 -0
- package/dist/node/lib/A-Logger/index.mjs.map +1 -0
- package/dist/node/lib/A-Manifest/A-Manifest.context.d.mts +3 -0
- package/dist/node/lib/A-Manifest/A-Manifest.context.d.ts +3 -0
- package/dist/node/lib/A-Manifest/A-Manifest.context.js +164 -0
- package/dist/node/lib/A-Manifest/A-Manifest.context.js.map +1 -0
- package/dist/node/lib/A-Manifest/A-Manifest.context.mjs +157 -0
- package/dist/node/lib/A-Manifest/A-Manifest.context.mjs.map +1 -0
- package/dist/node/lib/A-Manifest/A-Manifest.error.d.mts +7 -0
- package/dist/node/lib/A-Manifest/A-Manifest.error.d.ts +7 -0
- package/dist/node/lib/A-Manifest/A-Manifest.error.js +11 -0
- package/dist/node/lib/A-Manifest/A-Manifest.error.js.map +1 -0
- package/dist/node/lib/A-Manifest/A-Manifest.error.mjs +10 -0
- package/dist/node/lib/A-Manifest/A-Manifest.error.mjs.map +1 -0
- package/dist/node/lib/A-Manifest/A-Manifest.types.d.mts +45 -0
- package/dist/node/lib/A-Manifest/A-Manifest.types.d.ts +45 -0
- package/dist/node/lib/A-Manifest/A-Manifest.types.js +4 -0
- package/dist/node/lib/A-Manifest/A-Manifest.types.js.map +1 -0
- package/dist/node/lib/A-Manifest/A-Manifest.types.mjs +3 -0
- package/dist/node/lib/A-Manifest/A-Manifest.types.mjs.map +1 -0
- package/dist/node/lib/A-Manifest/classes/A-ManifestChecker.class.d.mts +3 -0
- package/dist/node/lib/A-Manifest/classes/A-ManifestChecker.class.d.ts +3 -0
- package/dist/node/lib/A-Manifest/classes/A-ManifestChecker.class.js +22 -0
- package/dist/node/lib/A-Manifest/classes/A-ManifestChecker.class.js.map +1 -0
- package/dist/node/lib/A-Manifest/classes/A-ManifestChecker.class.mjs +22 -0
- package/dist/node/lib/A-Manifest/classes/A-ManifestChecker.class.mjs.map +1 -0
- package/dist/node/lib/A-Manifest/index.d.mts +4 -0
- package/dist/node/lib/A-Manifest/index.d.ts +4 -0
- package/dist/node/lib/A-Manifest/index.js +29 -0
- package/dist/node/lib/A-Manifest/index.js.map +1 -0
- package/dist/node/lib/A-Manifest/index.mjs +7 -0
- package/dist/node/lib/A-Manifest/index.mjs.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.component.d.mts +86 -0
- package/dist/node/lib/A-Memory/A-Memory.component.d.ts +86 -0
- package/dist/node/lib/A-Memory/A-Memory.component.js +335 -0
- package/dist/node/lib/A-Memory/A-Memory.component.js.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.component.mjs +325 -0
- package/dist/node/lib/A-Memory/A-Memory.component.mjs.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.constants.d.mts +44 -0
- package/dist/node/lib/A-Memory/A-Memory.constants.d.ts +44 -0
- package/dist/node/lib/A-Memory/A-Memory.constants.js +19 -0
- package/dist/node/lib/A-Memory/A-Memory.constants.js.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.constants.mjs +19 -0
- package/dist/node/lib/A-Memory/A-Memory.constants.mjs.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.context.d.mts +12 -0
- package/dist/node/lib/A-Memory/A-Memory.context.d.ts +12 -0
- package/dist/node/lib/A-Memory/A-Memory.context.js +43 -0
- package/dist/node/lib/A-Memory/A-Memory.context.js.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.context.mjs +36 -0
- package/dist/node/lib/A-Memory/A-Memory.context.mjs.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.error.d.mts +14 -0
- package/dist/node/lib/A-Memory/A-Memory.error.d.ts +14 -0
- package/dist/node/lib/A-Memory/A-Memory.error.js +18 -0
- package/dist/node/lib/A-Memory/A-Memory.error.js.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.error.mjs +17 -0
- package/dist/node/lib/A-Memory/A-Memory.error.mjs.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.types.d.mts +24 -0
- package/dist/node/lib/A-Memory/A-Memory.types.d.ts +24 -0
- package/dist/node/lib/A-Memory/A-Memory.types.js +4 -0
- package/dist/node/lib/A-Memory/A-Memory.types.js.map +1 -0
- package/dist/node/lib/A-Memory/A-Memory.types.mjs +3 -0
- package/dist/node/lib/A-Memory/A-Memory.types.mjs.map +1 -0
- package/dist/node/lib/A-Memory/index.d.mts +9 -0
- package/dist/node/lib/A-Memory/index.d.ts +9 -0
- package/dist/node/lib/A-Memory/index.js +36 -0
- package/dist/node/lib/A-Memory/index.js.map +1 -0
- package/dist/node/lib/A-Memory/index.mjs +8 -0
- package/dist/node/lib/A-Memory/index.mjs.map +1 -0
- package/dist/node/lib/A-Operation/A-Operation.context.d.mts +16 -0
- package/dist/node/lib/A-Operation/A-Operation.context.d.ts +16 -0
- package/dist/node/lib/A-Operation/A-Operation.context.js +55 -0
- package/dist/node/lib/A-Operation/A-Operation.context.js.map +1 -0
- package/dist/node/lib/A-Operation/A-Operation.context.mjs +48 -0
- package/dist/node/lib/A-Operation/A-Operation.context.mjs.map +1 -0
- package/dist/node/lib/A-Operation/A-Operation.types.d.mts +40 -0
- package/dist/node/lib/A-Operation/A-Operation.types.d.ts +40 -0
- package/dist/node/lib/A-Operation/A-Operation.types.js +4 -0
- package/dist/node/lib/A-Operation/A-Operation.types.js.map +1 -0
- package/dist/node/lib/A-Operation/A-Operation.types.mjs +3 -0
- package/dist/node/lib/A-Operation/A-Operation.types.mjs.map +1 -0
- package/dist/node/lib/A-Operation/index.d.mts +4 -0
- package/dist/node/lib/A-Operation/index.d.ts +4 -0
- package/dist/node/lib/A-Operation/index.js +19 -0
- package/dist/node/lib/A-Operation/index.js.map +1 -0
- package/dist/node/lib/A-Operation/index.mjs +5 -0
- package/dist/node/lib/A-Operation/index.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-browser.d.mts +108 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-browser.d.ts +108 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-browser.js +163 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-browser.js.map +1 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-browser.mjs +153 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-browser.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-node.d.mts +108 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-node.d.ts +108 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-node.js +160 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-node.js.map +1 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-node.mjs +150 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.component.env-node.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.types.d.mts +59 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.types.d.ts +59 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.types.js +4 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.types.js.map +1 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.types.mjs +3 -0
- package/dist/node/lib/A-Polyfill/A-Polyfill.types.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Buffer-Polyfill.base.d.mts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Buffer-Polyfill.base.d.ts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Buffer-Polyfill.base.js +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Buffer-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Buffer-Polyfill.base.mjs +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Buffer-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Crypto-Polyfill.base.d.mts +23 -0
- package/dist/node/lib/A-Polyfill/base/A-Crypto-Polyfill.base.d.ts +23 -0
- package/dist/node/lib/A-Polyfill/base/A-Crypto-Polyfill.base.js +31 -0
- package/dist/node/lib/A-Polyfill/base/A-Crypto-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Crypto-Polyfill.base.mjs +31 -0
- package/dist/node/lib/A-Polyfill/base/A-Crypto-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-FS-Polyfill.base.d.mts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-FS-Polyfill.base.d.ts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-FS-Polyfill.base.js +30 -0
- package/dist/node/lib/A-Polyfill/base/A-FS-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-FS-Polyfill.base.mjs +30 -0
- package/dist/node/lib/A-Polyfill/base/A-FS-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Http-Polyfill.base.d.mts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Http-Polyfill.base.d.ts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Http-Polyfill.base.js +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Http-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Http-Polyfill.base.mjs +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Http-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Https-Polyfill.base.d.mts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Https-Polyfill.base.d.ts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Https-Polyfill.base.js +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Https-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Https-Polyfill.base.mjs +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Https-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Path-Polyfill.base.d.mts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Path-Polyfill.base.d.ts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Path-Polyfill.base.js +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Path-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Path-Polyfill.base.mjs +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Path-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Process-Polyfill.base.d.mts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Process-Polyfill.base.d.ts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Process-Polyfill.base.js +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Process-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Process-Polyfill.base.mjs +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Process-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Url-Polyfill.base.d.mts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Url-Polyfill.base.d.ts +22 -0
- package/dist/node/lib/A-Polyfill/base/A-Url-Polyfill.base.js +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Url-Polyfill.base.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/A-Url-Polyfill.base.mjs +30 -0
- package/dist/node/lib/A-Polyfill/base/A-Url-Polyfill.base.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/base/index.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/base/index.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/base/index.js +47 -0
- package/dist/node/lib/A-Polyfill/base/index.js.map +1 -0
- package/dist/node/lib/A-Polyfill/base/index.mjs +11 -0
- package/dist/node/lib/A-Polyfill/base/index.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Buffer-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Buffer-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Buffer-Polyfill.js +46 -0
- package/dist/node/lib/A-Polyfill/browser/A-Buffer-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Buffer-Polyfill.mjs +45 -0
- package/dist/node/lib/A-Polyfill/browser/A-Buffer-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Crypto-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Crypto-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Crypto-Polyfill.js +36 -0
- package/dist/node/lib/A-Polyfill/browser/A-Crypto-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Crypto-Polyfill.mjs +35 -0
- package/dist/node/lib/A-Polyfill/browser/A-Crypto-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-FS-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-FS-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-FS-Polyfill.js +29 -0
- package/dist/node/lib/A-Polyfill/browser/A-FS-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-FS-Polyfill.mjs +28 -0
- package/dist/node/lib/A-Polyfill/browser/A-FS-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Http-Polyfill.d.mts +18 -0
- package/dist/node/lib/A-Polyfill/browser/A-Http-Polyfill.d.ts +18 -0
- package/dist/node/lib/A-Polyfill/browser/A-Http-Polyfill.js +58 -0
- package/dist/node/lib/A-Polyfill/browser/A-Http-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Http-Polyfill.mjs +57 -0
- package/dist/node/lib/A-Polyfill/browser/A-Http-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Https-Polyfill.d.mts +18 -0
- package/dist/node/lib/A-Polyfill/browser/A-Https-Polyfill.d.ts +18 -0
- package/dist/node/lib/A-Polyfill/browser/A-Https-Polyfill.js +58 -0
- package/dist/node/lib/A-Polyfill/browser/A-Https-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Https-Polyfill.mjs +57 -0
- package/dist/node/lib/A-Polyfill/browser/A-Https-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Path-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Path-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Path-Polyfill.js +64 -0
- package/dist/node/lib/A-Polyfill/browser/A-Path-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Path-Polyfill.mjs +63 -0
- package/dist/node/lib/A-Polyfill/browser/A-Path-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Process-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Process-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Process-Polyfill.js +33 -0
- package/dist/node/lib/A-Polyfill/browser/A-Process-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Process-Polyfill.mjs +32 -0
- package/dist/node/lib/A-Polyfill/browser/A-Process-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Url-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Url-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/browser/A-Url-Polyfill.js +50 -0
- package/dist/node/lib/A-Polyfill/browser/A-Url-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/A-Url-Polyfill.mjs +49 -0
- package/dist/node/lib/A-Polyfill/browser/A-Url-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/index.d.mts +23 -0
- package/dist/node/lib/A-Polyfill/browser/index.d.ts +23 -0
- package/dist/node/lib/A-Polyfill/browser/index.js +56 -0
- package/dist/node/lib/A-Polyfill/browser/index.js.map +1 -0
- package/dist/node/lib/A-Polyfill/browser/index.mjs +9 -0
- package/dist/node/lib/A-Polyfill/browser/index.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/index.browser.d.mts +26 -0
- package/dist/node/lib/A-Polyfill/index.browser.d.ts +26 -0
- package/dist/node/lib/A-Polyfill/index.browser.js +33 -0
- package/dist/node/lib/A-Polyfill/index.browser.js.map +1 -0
- package/dist/node/lib/A-Polyfill/index.browser.mjs +7 -0
- package/dist/node/lib/A-Polyfill/index.browser.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/index.node.d.mts +26 -0
- package/dist/node/lib/A-Polyfill/index.node.d.ts +26 -0
- package/dist/node/lib/A-Polyfill/index.node.js +33 -0
- package/dist/node/lib/A-Polyfill/index.node.js.map +1 -0
- package/dist/node/lib/A-Polyfill/index.node.mjs +7 -0
- package/dist/node/lib/A-Polyfill/index.node.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Buffer-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Buffer-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Buffer-Polyfill.js +27 -0
- package/dist/node/lib/A-Polyfill/node/A-Buffer-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Buffer-Polyfill.mjs +22 -0
- package/dist/node/lib/A-Polyfill/node/A-Buffer-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Crypto-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Crypto-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Crypto-Polyfill.js +39 -0
- package/dist/node/lib/A-Polyfill/node/A-Crypto-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Crypto-Polyfill.mjs +34 -0
- package/dist/node/lib/A-Polyfill/node/A-Crypto-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-FS-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-FS-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-FS-Polyfill.js +21 -0
- package/dist/node/lib/A-Polyfill/node/A-FS-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-FS-Polyfill.mjs +16 -0
- package/dist/node/lib/A-Polyfill/node/A-FS-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Http-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Http-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Http-Polyfill.js +25 -0
- package/dist/node/lib/A-Polyfill/node/A-Http-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Http-Polyfill.mjs +20 -0
- package/dist/node/lib/A-Polyfill/node/A-Http-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Https-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Https-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Https-Polyfill.js +25 -0
- package/dist/node/lib/A-Polyfill/node/A-Https-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Https-Polyfill.mjs +20 -0
- package/dist/node/lib/A-Polyfill/node/A-Https-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Path-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Path-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Path-Polyfill.js +34 -0
- package/dist/node/lib/A-Polyfill/node/A-Path-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Path-Polyfill.mjs +29 -0
- package/dist/node/lib/A-Polyfill/node/A-Path-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Process-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Process-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Process-Polyfill.js +25 -0
- package/dist/node/lib/A-Polyfill/node/A-Process-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Process-Polyfill.mjs +24 -0
- package/dist/node/lib/A-Polyfill/node/A-Process-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Url-Polyfill.d.mts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Url-Polyfill.d.ts +17 -0
- package/dist/node/lib/A-Polyfill/node/A-Url-Polyfill.js +27 -0
- package/dist/node/lib/A-Polyfill/node/A-Url-Polyfill.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/A-Url-Polyfill.mjs +22 -0
- package/dist/node/lib/A-Polyfill/node/A-Url-Polyfill.mjs.map +1 -0
- package/dist/node/lib/A-Polyfill/node/index.d.mts +23 -0
- package/dist/node/lib/A-Polyfill/node/index.d.ts +23 -0
- package/dist/node/lib/A-Polyfill/node/index.js +56 -0
- package/dist/node/lib/A-Polyfill/node/index.js.map +1 -0
- package/dist/node/lib/A-Polyfill/node/index.mjs +9 -0
- package/dist/node/lib/A-Polyfill/node/index.mjs.map +1 -0
- package/dist/node/lib/A-Route/A-Route.entity.d.mts +25 -0
- package/dist/node/lib/A-Route/A-Route.entity.d.ts +25 -0
- package/dist/node/lib/A-Route/A-Route.entity.js +105 -0
- package/dist/node/lib/A-Route/A-Route.entity.js.map +1 -0
- package/dist/node/lib/A-Route/A-Route.entity.mjs +98 -0
- package/dist/node/lib/A-Route/A-Route.entity.mjs.map +1 -0
- package/dist/node/lib/A-Route/A-Route.types.d.mts +2 -0
- package/dist/node/lib/A-Route/A-Route.types.d.ts +2 -0
- package/dist/node/lib/A-Route/A-Route.types.js +4 -0
- package/dist/node/lib/A-Route/A-Route.types.js.map +1 -0
- package/dist/node/lib/A-Route/A-Route.types.mjs +3 -0
- package/dist/node/lib/A-Route/A-Route.types.mjs.map +1 -0
- package/dist/node/lib/A-Route/index.d.mts +2 -0
- package/dist/node/lib/A-Route/index.d.ts +2 -0
- package/dist/node/lib/A-Route/index.js +12 -0
- package/dist/node/lib/A-Route/index.js.map +1 -0
- package/dist/node/lib/A-Route/index.mjs +4 -0
- package/dist/node/lib/A-Route/index.mjs.map +1 -0
- package/dist/node/lib/A-Schedule/A-Deferred.class.d.mts +14 -0
- package/dist/node/lib/A-Schedule/A-Deferred.class.d.ts +14 -0
- package/dist/node/lib/A-Schedule/A-Deferred.class.js +24 -0
- package/dist/node/lib/A-Schedule/A-Deferred.class.js.map +1 -0
- package/dist/node/lib/A-Schedule/A-Deferred.class.mjs +24 -0
- package/dist/node/lib/A-Schedule/A-Deferred.class.mjs.map +1 -0
- package/dist/node/lib/A-Schedule/A-Schedule.component.d.mts +60 -0
- package/dist/node/lib/A-Schedule/A-Schedule.component.d.ts +60 -0
- package/dist/node/lib/A-Schedule/A-Schedule.component.js +46 -0
- package/dist/node/lib/A-Schedule/A-Schedule.component.js.map +1 -0
- package/dist/node/lib/A-Schedule/A-Schedule.component.mjs +39 -0
- package/dist/node/lib/A-Schedule/A-Schedule.component.mjs.map +1 -0
- package/dist/node/lib/A-Schedule/A-Schedule.types.d.mts +12 -0
- package/dist/node/lib/A-Schedule/A-Schedule.types.d.ts +12 -0
- package/dist/node/lib/A-Schedule/A-Schedule.types.js +4 -0
- package/dist/node/lib/A-Schedule/A-Schedule.types.js.map +1 -0
- package/dist/node/lib/A-Schedule/A-Schedule.types.mjs +3 -0
- package/dist/node/lib/A-Schedule/A-Schedule.types.mjs.map +1 -0
- package/dist/node/lib/A-Schedule/A-ScheduleObject.class.d.mts +32 -0
- package/dist/node/lib/A-Schedule/A-ScheduleObject.class.d.ts +32 -0
- package/dist/node/lib/A-Schedule/A-ScheduleObject.class.js +49 -0
- package/dist/node/lib/A-Schedule/A-ScheduleObject.class.js.map +1 -0
- package/dist/node/lib/A-Schedule/A-ScheduleObject.class.mjs +48 -0
- package/dist/node/lib/A-Schedule/A-ScheduleObject.class.mjs.map +1 -0
- package/dist/node/lib/A-Schedule/index.d.mts +5 -0
- package/dist/node/lib/A-Schedule/index.d.ts +5 -0
- package/dist/node/lib/A-Schedule/index.js +29 -0
- package/dist/node/lib/A-Schedule/index.js.map +1 -0
- package/dist/node/lib/A-Schedule/index.mjs +7 -0
- package/dist/node/lib/A-Schedule/index.mjs.map +1 -0
- package/dist/node/lib/A-Service/A-Service.constants.d.mts +14 -0
- package/dist/node/lib/A-Service/A-Service.constants.d.ts +14 -0
- package/dist/node/lib/A-Service/A-Service.constants.js +19 -0
- package/dist/node/lib/A-Service/A-Service.constants.js.map +1 -0
- package/dist/node/lib/A-Service/A-Service.constants.mjs +19 -0
- package/dist/node/lib/A-Service/A-Service.constants.mjs.map +1 -0
- package/dist/node/lib/A-Service/A-Service.container.d.mts +50 -0
- package/dist/node/lib/A-Service/A-Service.container.d.ts +50 -0
- package/dist/node/lib/A-Service/A-Service.container.js +188 -0
- package/dist/node/lib/A-Service/A-Service.container.js.map +1 -0
- package/dist/node/lib/A-Service/A-Service.container.mjs +178 -0
- package/dist/node/lib/A-Service/A-Service.container.mjs.map +1 -0
- package/dist/node/lib/A-Service/A-Service.error.d.mts +9 -0
- package/dist/node/lib/A-Service/A-Service.error.d.ts +9 -0
- package/dist/node/lib/A-Service/A-Service.error.js +13 -0
- package/dist/node/lib/A-Service/A-Service.error.js.map +1 -0
- package/dist/node/lib/A-Service/A-Service.error.mjs +12 -0
- package/dist/node/lib/A-Service/A-Service.error.mjs.map +1 -0
- package/dist/node/lib/A-Service/A-Service.types.d.mts +27 -0
- package/dist/node/lib/A-Service/A-Service.types.d.ts +27 -0
- package/dist/node/lib/A-Service/A-Service.types.js +16 -0
- package/dist/node/lib/A-Service/A-Service.types.js.map +1 -0
- package/dist/node/lib/A-Service/A-Service.types.mjs +16 -0
- package/dist/node/lib/A-Service/A-Service.types.mjs.map +1 -0
- package/dist/node/lib/A-Service/index.d.mts +28 -0
- package/dist/node/lib/A-Service/index.d.ts +28 -0
- package/dist/node/lib/A-Service/index.js +19 -0
- package/dist/node/lib/A-Service/index.js.map +1 -0
- package/dist/node/lib/A-Service/index.mjs +5 -0
- package/dist/node/lib/A-Service/index.mjs.map +1 -0
- package/dist/node/lib/A-Signal/A-Signal.constants.d.mts +2 -0
- package/dist/node/lib/A-Signal/A-Signal.constants.d.ts +2 -0
- package/dist/node/lib/A-Signal/A-Signal.constants.js +4 -0
- package/dist/node/lib/A-Signal/A-Signal.constants.js.map +1 -0
- package/dist/node/lib/A-Signal/A-Signal.constants.mjs +3 -0
- package/dist/node/lib/A-Signal/A-Signal.constants.mjs.map +1 -0
- package/dist/node/lib/A-Signal/A-Signal.error.d.mts +2 -0
- package/dist/node/lib/A-Signal/A-Signal.error.d.ts +2 -0
- package/dist/node/lib/A-Signal/A-Signal.error.js +4 -0
- package/dist/node/lib/A-Signal/A-Signal.error.js.map +1 -0
- package/dist/node/lib/A-Signal/A-Signal.error.mjs +3 -0
- package/dist/node/lib/A-Signal/A-Signal.error.mjs.map +1 -0
- package/dist/node/lib/A-Signal/A-Signal.types.d.mts +2 -0
- package/dist/node/lib/A-Signal/A-Signal.types.d.ts +2 -0
- package/dist/node/lib/A-Signal/A-Signal.types.js +4 -0
- package/dist/node/lib/A-Signal/A-Signal.types.js.map +1 -0
- package/dist/node/lib/A-Signal/A-Signal.types.mjs +3 -0
- package/dist/node/lib/A-Signal/A-Signal.types.mjs.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.component.d.mts +44 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.component.d.ts +44 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.component.js +132 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.component.js.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.component.mjs +122 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.component.mjs.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.constants.d.mts +7 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.constants.d.ts +7 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.constants.js +12 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.constants.js.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.constants.mjs +12 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.constants.mjs.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.error.d.mts +7 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.error.d.ts +7 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.error.js +11 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.error.js.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.error.mjs +10 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.error.mjs.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.types.d.mts +2 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.types.d.ts +2 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.types.js +4 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.types.js.map +1 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.types.mjs +3 -0
- package/dist/node/lib/A-Signal/components/A-SignalBus.types.mjs.map +1 -0
- package/dist/node/lib/A-Signal/context/A-SignalConfig.context.d.mts +36 -0
- package/dist/node/lib/A-Signal/context/A-SignalConfig.context.d.ts +36 -0
- package/dist/node/lib/A-Signal/context/A-SignalConfig.context.js +68 -0
- package/dist/node/lib/A-Signal/context/A-SignalConfig.context.js.map +1 -0
- package/dist/node/lib/A-Signal/context/A-SignalConfig.context.mjs +61 -0
- package/dist/node/lib/A-Signal/context/A-SignalConfig.context.mjs.map +1 -0
- package/dist/node/lib/A-Signal/context/A-SignalState.context.d.mts +111 -0
- package/dist/node/lib/A-Signal/context/A-SignalState.context.d.ts +111 -0
- package/dist/node/lib/A-Signal/context/A-SignalState.context.js +114 -0
- package/dist/node/lib/A-Signal/context/A-SignalState.context.js.map +1 -0
- package/dist/node/lib/A-Signal/context/A-SignalState.context.mjs +107 -0
- package/dist/node/lib/A-Signal/context/A-SignalState.context.mjs.map +1 -0
- package/dist/node/lib/A-Signal/entities/A-Signal.entity.d.mts +2 -0
- package/dist/node/lib/A-Signal/entities/A-Signal.entity.d.ts +2 -0
- package/dist/node/lib/A-Signal/entities/A-Signal.entity.js +120 -0
- package/dist/node/lib/A-Signal/entities/A-Signal.entity.js.map +1 -0
- package/dist/node/lib/A-Signal/entities/A-Signal.entity.mjs +113 -0
- package/dist/node/lib/A-Signal/entities/A-Signal.entity.mjs.map +1 -0
- package/dist/node/lib/A-Signal/entities/A-SignalVector.entity.d.mts +113 -0
- package/dist/node/lib/A-Signal/entities/A-SignalVector.entity.d.ts +113 -0
- package/dist/node/lib/A-Signal/entities/A-SignalVector.entity.js +217 -0
- package/dist/node/lib/A-Signal/entities/A-SignalVector.entity.js.map +1 -0
- package/dist/node/lib/A-Signal/entities/A-SignalVector.entity.mjs +210 -0
- package/dist/node/lib/A-Signal/entities/A-SignalVector.entity.mjs.map +1 -0
- package/dist/node/lib/A-Signal/index.d.mts +15 -0
- package/dist/node/lib/A-Signal/index.d.ts +15 -0
- package/dist/node/lib/A-Signal/index.js +51 -0
- package/dist/node/lib/A-Signal/index.js.map +1 -0
- package/dist/node/lib/A-Signal/index.mjs +11 -0
- package/dist/node/lib/A-Signal/index.mjs.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.component.d.mts +180 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.component.d.ts +180 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.component.js +119 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.component.js.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.component.mjs +110 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.component.mjs.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.constants.d.mts +20 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.constants.d.ts +20 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.constants.js +13 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.constants.js.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.constants.mjs +13 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.constants.mjs.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.error.d.mts +8 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.error.d.ts +8 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.error.js +12 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.error.js.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.error.mjs +11 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.error.mjs.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.types.d.mts +14 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.types.d.ts +14 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.types.js +4 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.types.js.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.types.mjs +3 -0
- package/dist/node/lib/A-StateMachine/A-StateMachine.types.mjs.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachineTransition.context.d.mts +19 -0
- package/dist/node/lib/A-StateMachine/A-StateMachineTransition.context.d.ts +19 -0
- package/dist/node/lib/A-StateMachine/A-StateMachineTransition.context.js +43 -0
- package/dist/node/lib/A-StateMachine/A-StateMachineTransition.context.js.map +1 -0
- package/dist/node/lib/A-StateMachine/A-StateMachineTransition.context.mjs +36 -0
- package/dist/node/lib/A-StateMachine/A-StateMachineTransition.context.mjs.map +1 -0
- package/dist/node/lib/A-StateMachine/index.d.mts +9 -0
- package/dist/node/lib/A-StateMachine/index.d.ts +9 -0
- package/dist/node/lib/A-StateMachine/index.js +36 -0
- package/dist/node/lib/A-StateMachine/index.js.map +1 -0
- package/dist/node/lib/A-StateMachine/index.mjs +8 -0
- package/dist/node/lib/A-StateMachine/index.mjs.map +1 -0
- package/examples/A-Logger-examples.ts +1 -2
- package/jest.config.ts +20 -7
- package/package.json +232 -15
- package/src/lib/A-Channel/A-Channel.component.ts +1 -1
- package/src/lib/A-Channel/A-Channel.error.ts +1 -1
- package/src/lib/A-Channel/A-Channel.types.ts +0 -3
- package/src/lib/A-Channel/A-ChannelRequest.context.ts +1 -1
- package/src/lib/A-Channel/index.ts +6 -0
- package/src/lib/A-Command/A-Command.entity.ts +3 -5
- package/src/lib/A-Command/index.ts +5 -0
- package/src/lib/A-Config/A-Config.container.ts +3 -4
- package/src/lib/A-Config/A-Config.context.ts +1 -1
- package/src/lib/A-Config/components/ConfigReader.component.ts +10 -21
- package/src/lib/A-Config/components/ENVConfigReader.component.ts +13 -12
- package/src/lib/A-Config/index.ts +9 -0
- package/src/lib/A-Execution/index.ts +3 -0
- package/src/lib/A-Logger/A-Logger.component.ts +3 -1
- package/src/lib/A-Logger/index.ts +5 -0
- package/src/lib/A-Manifest/index.ts +5 -0
- package/src/lib/A-Memory/A-Memory.component.ts +1 -1
- package/src/lib/A-Memory/A-Memory.types.ts +1 -1
- package/src/lib/A-Memory/index.ts +6 -0
- package/src/lib/A-Operation/A-Operation.context.ts +1 -1
- package/src/lib/A-Operation/index.ts +3 -0
- package/src/lib/A-Polyfill/{A-Polyfill.component.ts → A-Polyfill.component.env-browser.ts} +26 -27
- package/src/lib/A-Polyfill/A-Polyfill.component.env-node.ts +184 -0
- package/src/lib/A-Polyfill/base/A-Buffer-Polyfill.base.ts +34 -0
- package/src/lib/A-Polyfill/base/A-Crypto-Polyfill.base.ts +36 -0
- package/src/lib/A-Polyfill/base/A-FS-Polyfill.base.ts +34 -0
- package/src/lib/A-Polyfill/base/A-Http-Polyfill.base.ts +34 -0
- package/src/lib/A-Polyfill/base/A-Https-Polyfill.base.ts +34 -0
- package/src/lib/A-Polyfill/base/A-Path-Polyfill.base.ts +34 -0
- package/src/lib/A-Polyfill/base/A-Process-Polyfill.base.ts +34 -0
- package/src/lib/A-Polyfill/base/A-Url-Polyfill.base.ts +34 -0
- package/src/lib/A-Polyfill/base/index.ts +9 -0
- package/src/lib/A-Polyfill/browser/A-Buffer-Polyfill.ts +42 -0
- package/src/lib/A-Polyfill/browser/A-Crypto-Polyfill.ts +32 -0
- package/src/lib/A-Polyfill/browser/A-FS-Polyfill.ts +25 -0
- package/src/lib/A-Polyfill/{classes/A-Http-Polyfill.class.ts → browser/A-Http-Polyfill.ts} +6 -46
- package/src/lib/A-Polyfill/{classes/A-Https-Polyfill.class.ts → browser/A-Https-Polyfill.ts} +6 -46
- package/src/lib/A-Polyfill/{classes/A-Path-Polyfill.class.ts → browser/A-Path-Polyfill.ts} +6 -42
- package/src/lib/A-Polyfill/browser/A-Process-Polyfill.ts +29 -0
- package/src/lib/A-Polyfill/browser/A-Url-Polyfill.ts +46 -0
- package/src/lib/A-Polyfill/browser/index.ts +8 -0
- package/src/lib/A-Polyfill/index.browser.ts +5 -0
- package/src/lib/A-Polyfill/index.node.ts +5 -0
- package/src/lib/A-Polyfill/node/A-Buffer-Polyfill.ts +19 -0
- package/src/lib/A-Polyfill/node/A-Crypto-Polyfill.ts +31 -0
- package/src/lib/A-Polyfill/node/A-FS-Polyfill.ts +14 -0
- package/src/lib/A-Polyfill/node/A-Http-Polyfill.ts +17 -0
- package/src/lib/A-Polyfill/node/A-Https-Polyfill.ts +18 -0
- package/src/lib/A-Polyfill/node/A-Path-Polyfill.ts +27 -0
- package/src/lib/A-Polyfill/node/A-Process-Polyfill.ts +21 -0
- package/src/lib/A-Polyfill/node/A-Url-Polyfill.ts +19 -0
- package/src/lib/A-Polyfill/node/index.ts +8 -0
- package/src/lib/A-Route/index.ts +3 -0
- package/src/lib/A-Schedule/index.ts +5 -0
- package/src/lib/A-Service/A-Service.container.ts +2 -4
- package/src/lib/A-Service/index.ts +4 -0
- package/src/lib/A-Signal/components/A-SignalBus.component.ts +2 -2
- package/src/lib/A-Signal/index.ts +11 -0
- package/src/lib/A-StateMachine/A-StateMachine.types.ts +1 -1
- package/src/lib/A-StateMachine/A-StateMachineTransition.context.ts +1 -1
- package/src/lib/A-StateMachine/index.ts +6 -0
- package/tests/A-Channel.test.ts +3 -5
- package/tests/A-Command.test.ts +4 -9
- package/tests/A-Config.test.ts +8 -7
- package/tests/A-Logger.test.ts +1 -3
- package/tests/A-Manifest.test.ts +1 -1
- package/tests/A-Memory.test.ts +1 -3
- package/tests/A-Polyfill.test.ts +2 -2
- package/tests/A-Route.test.ts +1 -3
- package/tests/A-Schedule.test.ts +1 -1
- package/tests/A-Signal.test.ts +1 -5
- package/tests/A-StateMachine.test.ts +2 -5
- package/tests/main.test.ts +30 -0
- package/tsconfig.json +39 -57
- package/tsup.config.ts +94 -28
- package/dist/index.cjs +0 -35
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.mts +0 -2976
- package/dist/index.d.ts +0 -2976
- package/dist/index.mjs +0 -35
- package/dist/index.mjs.map +0 -1
- package/src/index.ts +0 -124
- package/src/lib/A-Polyfill/classes/A-Buffer-Polyfill.class.ts +0 -85
- package/src/lib/A-Polyfill/classes/A-Crypto-Polyfill.class.ts +0 -87
- package/src/lib/A-Polyfill/classes/A-FS-Polyfill.class.ts +0 -61
- package/src/lib/A-Polyfill/classes/A-Process-Polyfill.class.ts +0 -73
- package/src/lib/A-Polyfill/classes/A-Url-Polyfill.class.ts +0 -88
package/dist/index.d.ts
DELETED
|
@@ -1,2976 +0,0 @@
|
|
|
1
|
-
import { A_Error, A_TYPES__Error_Serialized, A_Fragment, A_Meta, A_TYPES__Fragment_Serialized, A_Component, A_TYPES__Entity_Serialized, A_TYPES__ConceptENVVariables, A_TYPES__Fragment_Constructor, A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, A_Scope, A_Entity, A_Container, A_Feature, A_TYPES__Component_Constructor, A_TYPES__Entity_Constructor, A_TYPES__Container_Constructor } from '@adaas/a-concept';
|
|
2
|
-
|
|
3
|
-
type A_Operation_Storage<_Result_type extends any = any, _ParamsType extends Record<string, any> = Record<string, any>> = {
|
|
4
|
-
/**
|
|
5
|
-
* The name of the operation
|
|
6
|
-
*/
|
|
7
|
-
name: string;
|
|
8
|
-
/**
|
|
9
|
-
* The parameters for the operation
|
|
10
|
-
*/
|
|
11
|
-
params: _ParamsType;
|
|
12
|
-
/**
|
|
13
|
-
* The result of the operation
|
|
14
|
-
*/
|
|
15
|
-
result: _Result_type;
|
|
16
|
-
/**
|
|
17
|
-
* Any error that occurred during the operation
|
|
18
|
-
*/
|
|
19
|
-
error?: A_Error;
|
|
20
|
-
};
|
|
21
|
-
type A_Operation_Serialized<_Result_type extends any = any, _ParamsType extends Record<string, any> = Record<string, any>> = {
|
|
22
|
-
/**
|
|
23
|
-
* The name of the operation
|
|
24
|
-
*/
|
|
25
|
-
name: string;
|
|
26
|
-
/**
|
|
27
|
-
* The parameters for the operation
|
|
28
|
-
*/
|
|
29
|
-
params: _ParamsType;
|
|
30
|
-
/**
|
|
31
|
-
* The result of the operation
|
|
32
|
-
*/
|
|
33
|
-
result: _Result_type;
|
|
34
|
-
/**
|
|
35
|
-
* Any error that occurred during the operation
|
|
36
|
-
*/
|
|
37
|
-
error?: A_TYPES__Error_Serialized;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
declare class A_ExecutionContext<_MetaType extends Record<string, any> = Record<string, any>, _SerializedType extends Record<string, any> = Record<string, any>> extends A_Fragment {
|
|
41
|
-
protected _meta: A_Meta<_MetaType, _SerializedType>;
|
|
42
|
-
constructor(name: string, defaults?: Partial<_MetaType>);
|
|
43
|
-
[Symbol.iterator](): Iterator<[keyof _MetaType, _MetaType[keyof _MetaType]]>;
|
|
44
|
-
get meta(): A_Meta<_MetaType>;
|
|
45
|
-
get<K extends keyof _MetaType>(key: K): _MetaType[K] | undefined;
|
|
46
|
-
set<K extends keyof _MetaType>(key: K, value: _MetaType[K]): this;
|
|
47
|
-
has(key: keyof _MetaType): boolean;
|
|
48
|
-
drop(key: keyof _MetaType): void;
|
|
49
|
-
clear(): this;
|
|
50
|
-
toRaw(): _SerializedType;
|
|
51
|
-
toJSON(): A_TYPES__Fragment_Serialized;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
declare class A_OperationContext<_AllowedOperations extends string = string, _ParamsType extends Record<string, any> = Record<string, any>, _ResultType = any, _StorageType extends A_Operation_Storage<_ResultType, _ParamsType> = A_Operation_Storage<_ResultType, _ParamsType>> extends A_ExecutionContext<_StorageType, A_Operation_Serialized<_ResultType, _ParamsType>> {
|
|
55
|
-
constructor(operation: _AllowedOperations, params?: _ParamsType);
|
|
56
|
-
get name(): _AllowedOperations;
|
|
57
|
-
get result(): _ResultType | undefined;
|
|
58
|
-
get error(): A_Error | undefined;
|
|
59
|
-
get params(): _ParamsType;
|
|
60
|
-
fail(error: A_Error): void;
|
|
61
|
-
succeed(result: _ResultType): void;
|
|
62
|
-
toJSON(): A_Operation_Serialized<_ResultType, _ParamsType>;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
declare enum A_ChannelFeatures {
|
|
66
|
-
/**
|
|
67
|
-
* Allows to extend timeout logic and behavior
|
|
68
|
-
*/
|
|
69
|
-
onTimeout = "_A_Channel_onTimeout",
|
|
70
|
-
/**
|
|
71
|
-
* Allows to extend retry logic and behavior
|
|
72
|
-
*/
|
|
73
|
-
onRetry = "_A_Channel_onRetry",
|
|
74
|
-
/**
|
|
75
|
-
* Allows to extend circuit breaker logic and behavior
|
|
76
|
-
*/
|
|
77
|
-
onCircuitBreakerOpen = "_A_Channel_onCircuitBreakerOpen",
|
|
78
|
-
/**
|
|
79
|
-
* Allows to extend cache logic and behavior
|
|
80
|
-
*/
|
|
81
|
-
onCache = "_A_Channel_onCache",
|
|
82
|
-
/**
|
|
83
|
-
* Allows to extend connection logic and behavior
|
|
84
|
-
*/
|
|
85
|
-
onConnect = "_A_Channel_onConnect",
|
|
86
|
-
/**
|
|
87
|
-
* Allows to extend disconnection logic and behavior
|
|
88
|
-
*/
|
|
89
|
-
onDisconnect = "_A_Channel_onDisconnect",
|
|
90
|
-
/**
|
|
91
|
-
* Allows to extend request preparation logic and behavior
|
|
92
|
-
*/
|
|
93
|
-
onBeforeRequest = "_A_Channel_onBeforeRequest",
|
|
94
|
-
/**
|
|
95
|
-
* Allows to extend request sending logic and behavior
|
|
96
|
-
*/
|
|
97
|
-
onRequest = "_A_Channel_onRequest",
|
|
98
|
-
/**
|
|
99
|
-
* Allows to extend request post-processing logic and behavior
|
|
100
|
-
*/
|
|
101
|
-
onAfterRequest = "_A_Channel_onAfterRequest",
|
|
102
|
-
/**
|
|
103
|
-
* Allows to extend error handling logic and behavior
|
|
104
|
-
*
|
|
105
|
-
* [!] The same approach uses for ALL errors within the channel
|
|
106
|
-
*/
|
|
107
|
-
onError = "_A_Channel_onError",
|
|
108
|
-
/**
|
|
109
|
-
* Allows to extend send logic and behavior
|
|
110
|
-
*/
|
|
111
|
-
onSend = "_A_Channel_onSend",
|
|
112
|
-
/**
|
|
113
|
-
* Allows to extend consume logic and behavior
|
|
114
|
-
*/
|
|
115
|
-
onConsume = "_A_Channel_onConsume"
|
|
116
|
-
}
|
|
117
|
-
declare enum A_ChannelRequestStatuses {
|
|
118
|
-
/**
|
|
119
|
-
* Request is pending
|
|
120
|
-
*/
|
|
121
|
-
PENDING = "PENDING",
|
|
122
|
-
/***
|
|
123
|
-
* Request was successful
|
|
124
|
-
*/
|
|
125
|
-
SUCCESS = "SUCCESS",
|
|
126
|
-
/**
|
|
127
|
-
* Request failed
|
|
128
|
-
*/
|
|
129
|
-
FAILED = "FAILED"
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
declare class A_ChannelRequest<_ParamsType extends Record<string, any> = Record<string, any>, _ResultType extends Record<string, any> = Record<string, any>> extends A_OperationContext<'request', _ParamsType, {
|
|
133
|
-
data?: _ResultType;
|
|
134
|
-
status?: A_ChannelRequestStatuses;
|
|
135
|
-
}> {
|
|
136
|
-
constructor(params?: _ParamsType);
|
|
137
|
-
get status(): A_ChannelRequestStatuses | undefined;
|
|
138
|
-
get data(): _ResultType | undefined;
|
|
139
|
-
succeed(result: _ResultType): void;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* A-Channel - A powerful, extensible communication channel component
|
|
144
|
-
*
|
|
145
|
-
* A-Channel provides a structured approach to implementing various communication patterns
|
|
146
|
-
* such as HTTP clients, WebSocket connections, message queues, and other messaging systems.
|
|
147
|
-
* It offers a complete lifecycle management system with extensible hooks for custom behavior.
|
|
148
|
-
*
|
|
149
|
-
* ## Key Features:
|
|
150
|
-
* - 🔄 **Lifecycle Management** - Complete connection and processing lifecycle with hooks
|
|
151
|
-
* - 📡 **Multiple Communication Patterns** - Request/Response and Fire-and-Forget messaging
|
|
152
|
-
* - 🛡️ **Error Handling** - Comprehensive error capture and management
|
|
153
|
-
* - 🎯 **Type Safety** - Full TypeScript support with generic types
|
|
154
|
-
* - 🔧 **Extensible** - Component-based architecture for custom behavior
|
|
155
|
-
* - ⚡ **Concurrent Processing** - Handle multiple requests simultaneously
|
|
156
|
-
*
|
|
157
|
-
* ## Basic Usage:
|
|
158
|
-
* ```typescript
|
|
159
|
-
* const channel = new A_Channel();
|
|
160
|
-
* A_Context.root.register(channel);
|
|
161
|
-
*
|
|
162
|
-
* // Request/Response pattern
|
|
163
|
-
* const response = await channel.request({ action: 'getData', id: 123 });
|
|
164
|
-
*
|
|
165
|
-
* // Fire-and-forget pattern
|
|
166
|
-
* await channel.send({ type: 'notification', message: 'Hello World' });
|
|
167
|
-
* ```
|
|
168
|
-
*
|
|
169
|
-
* ## Custom Implementation:
|
|
170
|
-
* ```typescript
|
|
171
|
-
* class HttpChannel extends A_Channel {}
|
|
172
|
-
*
|
|
173
|
-
* class HttpProcessor extends A_Component {
|
|
174
|
-
* @A_Feature.Extend({ scope: [HttpChannel] })
|
|
175
|
-
* async [A_ChannelFeatures.onRequest](
|
|
176
|
-
* @A_Inject(A_ChannelRequest) context: A_ChannelRequest
|
|
177
|
-
* ) {
|
|
178
|
-
* const response = await fetch(context.params.url);
|
|
179
|
-
* (context as any)._result = await response.json();
|
|
180
|
-
* }
|
|
181
|
-
* }
|
|
182
|
-
* ```
|
|
183
|
-
*
|
|
184
|
-
* @see {@link ./README.md} For complete documentation and examples
|
|
185
|
-
*/
|
|
186
|
-
declare class A_Channel extends A_Component {
|
|
187
|
-
/**
|
|
188
|
-
* Indicates whether the channel is currently processing requests.
|
|
189
|
-
* This flag is managed automatically during request/send operations.
|
|
190
|
-
*
|
|
191
|
-
* @readonly
|
|
192
|
-
*/
|
|
193
|
-
protected _processing: boolean;
|
|
194
|
-
/**
|
|
195
|
-
* Promise that resolves when the channel initialization is complete.
|
|
196
|
-
* Ensures that onConnect lifecycle hook has been executed before
|
|
197
|
-
* any communication operations.
|
|
198
|
-
*
|
|
199
|
-
* @private
|
|
200
|
-
*/
|
|
201
|
-
protected _initialized?: Promise<void>;
|
|
202
|
-
/**
|
|
203
|
-
* Internal cache storage for channel-specific data.
|
|
204
|
-
* Can be used by custom implementations for caching responses,
|
|
205
|
-
* connection pools, or other channel-specific state.
|
|
206
|
-
*
|
|
207
|
-
* @protected
|
|
208
|
-
*/
|
|
209
|
-
protected _cache: Map<string, any>;
|
|
210
|
-
/**
|
|
211
|
-
* Creates a new A_Channel instance.
|
|
212
|
-
*
|
|
213
|
-
* The channel must be registered with A_Context before use:
|
|
214
|
-
* ```typescript
|
|
215
|
-
* const channel = new A_Channel();
|
|
216
|
-
* A_Context.root.register(channel);
|
|
217
|
-
* ```
|
|
218
|
-
*/
|
|
219
|
-
constructor();
|
|
220
|
-
/**
|
|
221
|
-
* Indicates whether the channel is currently processing requests.
|
|
222
|
-
*
|
|
223
|
-
* @returns {boolean} True if channel is processing, false otherwise
|
|
224
|
-
*/
|
|
225
|
-
get processing(): boolean;
|
|
226
|
-
/**
|
|
227
|
-
* Promise that resolves when the channel is fully initialized.
|
|
228
|
-
*
|
|
229
|
-
* Automatically calls the onConnect lifecycle hook if not already called.
|
|
230
|
-
* This ensures the channel is ready for communication operations.
|
|
231
|
-
*
|
|
232
|
-
* @returns {Promise<void>} Promise that resolves when initialization is complete
|
|
233
|
-
*/
|
|
234
|
-
get initialize(): Promise<void>;
|
|
235
|
-
/**
|
|
236
|
-
* Connection lifecycle hook - called during channel initialization.
|
|
237
|
-
*
|
|
238
|
-
* Override this method in custom components to implement connection logic:
|
|
239
|
-
* - Initialize network connections
|
|
240
|
-
* - Load configuration
|
|
241
|
-
* - Validate environment
|
|
242
|
-
* - Set up connection pools
|
|
243
|
-
*
|
|
244
|
-
* @example
|
|
245
|
-
* ```typescript
|
|
246
|
-
* class DatabaseChannel extends A_Channel {}
|
|
247
|
-
*
|
|
248
|
-
* class DatabaseConnector extends A_Component {
|
|
249
|
-
* @A_Feature.Extend({ scope: [DatabaseChannel] })
|
|
250
|
-
* async [A_ChannelFeatures.onConnect]() {
|
|
251
|
-
* await this.initializeDatabase();
|
|
252
|
-
* console.log('Database channel connected');
|
|
253
|
-
* }
|
|
254
|
-
* }
|
|
255
|
-
* ```
|
|
256
|
-
*/
|
|
257
|
-
onConnect(...args: any[]): Promise<void>;
|
|
258
|
-
/**
|
|
259
|
-
* Disconnection lifecycle hook - called during channel cleanup.
|
|
260
|
-
*
|
|
261
|
-
* Override this method in custom components to implement cleanup logic:
|
|
262
|
-
* - Close network connections
|
|
263
|
-
* - Save state
|
|
264
|
-
* - Release resources
|
|
265
|
-
* - Clear caches
|
|
266
|
-
*
|
|
267
|
-
* @example
|
|
268
|
-
* ```typescript
|
|
269
|
-
* @A_Feature.Extend({ scope: [DatabaseChannel] })
|
|
270
|
-
* async [A_ChannelFeatures.onDisconnect]() {
|
|
271
|
-
* await this.closeConnections();
|
|
272
|
-
* console.log('Database channel disconnected');
|
|
273
|
-
* }
|
|
274
|
-
* ```
|
|
275
|
-
*/
|
|
276
|
-
onDisconnect(...args: any[]): Promise<void>;
|
|
277
|
-
/**
|
|
278
|
-
* Pre-request processing hook - called before main request processing.
|
|
279
|
-
*
|
|
280
|
-
* Use this hook for:
|
|
281
|
-
* - Request validation
|
|
282
|
-
* - Authentication
|
|
283
|
-
* - Rate limiting
|
|
284
|
-
* - Logging
|
|
285
|
-
* - Request transformation
|
|
286
|
-
*
|
|
287
|
-
* @example
|
|
288
|
-
* ```typescript
|
|
289
|
-
* @A_Feature.Extend({ scope: [HttpChannel] })
|
|
290
|
-
* async [A_ChannelFeatures.onBeforeRequest](
|
|
291
|
-
* @A_Inject(A_ChannelRequest) context: A_ChannelRequest
|
|
292
|
-
* ) {
|
|
293
|
-
* // Validate required parameters
|
|
294
|
-
* if (!context.params.url) {
|
|
295
|
-
* throw new Error('URL is required');
|
|
296
|
-
* }
|
|
297
|
-
* }
|
|
298
|
-
* ```
|
|
299
|
-
*/
|
|
300
|
-
onBeforeRequest(...args: any[]): Promise<void>;
|
|
301
|
-
/**
|
|
302
|
-
* Main request processing hook - core business logic goes here.
|
|
303
|
-
*
|
|
304
|
-
* This is where the main communication logic should be implemented:
|
|
305
|
-
* - Make HTTP requests
|
|
306
|
-
* - Send messages to queues
|
|
307
|
-
* - Execute database queries
|
|
308
|
-
* - Process business logic
|
|
309
|
-
*
|
|
310
|
-
* Set the result in the context: `(context as any)._result = yourResult;`
|
|
311
|
-
*
|
|
312
|
-
* @example
|
|
313
|
-
* ```typescript
|
|
314
|
-
* @A_Feature.Extend({ scope: [HttpChannel] })
|
|
315
|
-
* async [A_ChannelFeatures.onRequest](
|
|
316
|
-
* @A_Inject(A_ChannelRequest) context: A_ChannelRequest
|
|
317
|
-
* ) {
|
|
318
|
-
* const response = await fetch(context.params.url);
|
|
319
|
-
* (context as any)._result = await response.json();
|
|
320
|
-
* }
|
|
321
|
-
* ```
|
|
322
|
-
*/
|
|
323
|
-
onRequest(...args: any[]): Promise<void>;
|
|
324
|
-
/**
|
|
325
|
-
* Post-request processing hook - called after successful request processing.
|
|
326
|
-
*
|
|
327
|
-
* Use this hook for:
|
|
328
|
-
* - Response transformation
|
|
329
|
-
* - Logging
|
|
330
|
-
* - Analytics
|
|
331
|
-
* - Caching results
|
|
332
|
-
* - Cleanup
|
|
333
|
-
*
|
|
334
|
-
* @example
|
|
335
|
-
* ```typescript
|
|
336
|
-
* @A_Feature.Extend({ scope: [HttpChannel] })
|
|
337
|
-
* async [A_ChannelFeatures.onAfterRequest](
|
|
338
|
-
* @A_Inject(A_ChannelRequest) context: A_ChannelRequest
|
|
339
|
-
* ) {
|
|
340
|
-
* console.log(`Request completed in ${Date.now() - context.startTime}ms`);
|
|
341
|
-
* await this.cacheResponse(context.params, context.data);
|
|
342
|
-
* }
|
|
343
|
-
* ```
|
|
344
|
-
*/
|
|
345
|
-
onAfterRequest(...args: any[]): Promise<void>;
|
|
346
|
-
/**
|
|
347
|
-
* Error handling hook - called when any operation fails.
|
|
348
|
-
*
|
|
349
|
-
* Use this hook for:
|
|
350
|
-
* - Error logging
|
|
351
|
-
* - Error transformation
|
|
352
|
-
* - Alerting
|
|
353
|
-
* - Retry logic
|
|
354
|
-
* - Fallback mechanisms
|
|
355
|
-
*
|
|
356
|
-
* @example
|
|
357
|
-
* ```typescript
|
|
358
|
-
* @A_Feature.Extend({ scope: [HttpChannel] })
|
|
359
|
-
* async [A_ChannelFeatures.onError](
|
|
360
|
-
* @A_Inject(A_ChannelRequest) context: A_ChannelRequest
|
|
361
|
-
* ) {
|
|
362
|
-
* console.error('Request failed:', context.params, context.failed);
|
|
363
|
-
* await this.logError(context);
|
|
364
|
-
* await this.sendAlert(context);
|
|
365
|
-
* }
|
|
366
|
-
* ```
|
|
367
|
-
*/
|
|
368
|
-
onError(...args: any[]): Promise<void>;
|
|
369
|
-
/**
|
|
370
|
-
* Send operation hook - called for fire-and-forget messaging.
|
|
371
|
-
*
|
|
372
|
-
* Use this hook for:
|
|
373
|
-
* - Message broadcasting
|
|
374
|
-
* - Event publishing
|
|
375
|
-
* - Notification sending
|
|
376
|
-
* - Queue operations
|
|
377
|
-
*
|
|
378
|
-
* @example
|
|
379
|
-
* ```typescript
|
|
380
|
-
* @A_Feature.Extend({ scope: [EventChannel] })
|
|
381
|
-
* async [A_ChannelFeatures.onSend](
|
|
382
|
-
* @A_Inject(A_ChannelRequest) context: A_ChannelRequest
|
|
383
|
-
* ) {
|
|
384
|
-
* const { eventType, payload } = context.params;
|
|
385
|
-
* await this.publishEvent(eventType, payload);
|
|
386
|
-
* }
|
|
387
|
-
* ```
|
|
388
|
-
*/
|
|
389
|
-
onSend(...args: any[]): Promise<void>;
|
|
390
|
-
/**
|
|
391
|
-
* Initializes the channel by calling the onConnect lifecycle hook.
|
|
392
|
-
*
|
|
393
|
-
* This method is called automatically when accessing the `initialize` property.
|
|
394
|
-
* You can also call it manually if needed.
|
|
395
|
-
*
|
|
396
|
-
* @returns {Promise<void>} Promise that resolves when connection is established
|
|
397
|
-
*/
|
|
398
|
-
connect(): Promise<void>;
|
|
399
|
-
/**
|
|
400
|
-
* Disconnects the channel by calling the onDisconnect lifecycle hook.
|
|
401
|
-
*
|
|
402
|
-
* Use this method to properly cleanup resources when the channel is no longer needed.
|
|
403
|
-
*
|
|
404
|
-
* @returns {Promise<void>} Promise that resolves when cleanup is complete
|
|
405
|
-
*/
|
|
406
|
-
disconnect(): Promise<void>;
|
|
407
|
-
/**
|
|
408
|
-
* Sends a request and waits for a response (Request/Response pattern).
|
|
409
|
-
*
|
|
410
|
-
* This method follows the complete request lifecycle:
|
|
411
|
-
* 1. Ensures channel is initialized
|
|
412
|
-
* 2. Creates request scope and context
|
|
413
|
-
* 3. Calls onBeforeRequest hook
|
|
414
|
-
* 4. Calls onRequest hook (main processing)
|
|
415
|
-
* 5. Calls onAfterRequest hook
|
|
416
|
-
* 6. Returns the response context
|
|
417
|
-
*
|
|
418
|
-
* If any step fails, the onError hook is called and the error is captured
|
|
419
|
-
* in the returned context.
|
|
420
|
-
*
|
|
421
|
-
* @template _ParamsType The type of request parameters
|
|
422
|
-
* @template _ResultType The type of response data
|
|
423
|
-
* @param params The request parameters
|
|
424
|
-
* @returns {Promise<A_ChannelRequest<_ParamsType, _ResultType>>} Request context with response
|
|
425
|
-
*
|
|
426
|
-
* @example
|
|
427
|
-
* ```typescript
|
|
428
|
-
* // Basic usage
|
|
429
|
-
* const response = await channel.request({ action: 'getData', id: 123 });
|
|
430
|
-
*
|
|
431
|
-
* // Typed usage
|
|
432
|
-
* interface UserRequest { userId: string; }
|
|
433
|
-
* interface UserResponse { name: string; email: string; }
|
|
434
|
-
*
|
|
435
|
-
* const userResponse = await channel.request<UserRequest, UserResponse>({
|
|
436
|
-
* userId: 'user-123'
|
|
437
|
-
* });
|
|
438
|
-
*
|
|
439
|
-
* if (!userResponse.failed) {
|
|
440
|
-
* console.log('User:', userResponse.data.name);
|
|
441
|
-
* }
|
|
442
|
-
* ```
|
|
443
|
-
*/
|
|
444
|
-
request<_ParamsType extends Record<string, any> = Record<string, any>, _ResultType extends Record<string, any> = Record<string, any>>(params: _ParamsType): Promise<A_ChannelRequest<_ParamsType, _ResultType>>;
|
|
445
|
-
/**
|
|
446
|
-
* Sends a fire-and-forget message (Send pattern).
|
|
447
|
-
*
|
|
448
|
-
* This method is used for one-way communication where no response is expected:
|
|
449
|
-
* - Event broadcasting
|
|
450
|
-
* - Notification sending
|
|
451
|
-
* - Message queuing
|
|
452
|
-
* - Logging operations
|
|
453
|
-
*
|
|
454
|
-
* The method follows this lifecycle:
|
|
455
|
-
* 1. Ensures channel is initialized
|
|
456
|
-
* 2. Creates send scope and context
|
|
457
|
-
* 3. Calls onSend hook
|
|
458
|
-
* 4. Completes without returning data
|
|
459
|
-
*
|
|
460
|
-
* If the operation fails, the onError hook is called but no error is thrown
|
|
461
|
-
* to the caller (fire-and-forget semantics).
|
|
462
|
-
*
|
|
463
|
-
* @template _ParamsType The type of message parameters
|
|
464
|
-
* @param message The message to send
|
|
465
|
-
* @returns {Promise<void>} Promise that resolves when send is complete
|
|
466
|
-
*
|
|
467
|
-
* @example
|
|
468
|
-
* ```typescript
|
|
469
|
-
* // Send notification
|
|
470
|
-
* await channel.send({
|
|
471
|
-
* type: 'user.login',
|
|
472
|
-
* userId: 'user-123',
|
|
473
|
-
* timestamp: new Date().toISOString()
|
|
474
|
-
* });
|
|
475
|
-
*
|
|
476
|
-
* // Send to message queue
|
|
477
|
-
* await channel.send({
|
|
478
|
-
* queue: 'email-queue',
|
|
479
|
-
* payload: {
|
|
480
|
-
* to: 'user@example.com',
|
|
481
|
-
* subject: 'Welcome!',
|
|
482
|
-
* body: 'Welcome to our service!'
|
|
483
|
-
* }
|
|
484
|
-
* });
|
|
485
|
-
* ```
|
|
486
|
-
*/
|
|
487
|
-
send<_ParamsType extends Record<string, any> = Record<string, any>>(message: _ParamsType): Promise<void>;
|
|
488
|
-
/**
|
|
489
|
-
* @deprecated This method is deprecated and will be removed in future versions.
|
|
490
|
-
* Use request() or send() methods instead depending on your communication pattern.
|
|
491
|
-
*
|
|
492
|
-
* For request/response pattern: Use request()
|
|
493
|
-
* For fire-and-forget pattern: Use send()
|
|
494
|
-
* For consumer patterns: Implement custom consumer logic using request() in a loop
|
|
495
|
-
*/
|
|
496
|
-
consume<T extends Record<string, any> = Record<string, any>>(): Promise<A_OperationContext<any, T>>;
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
declare class A_ChannelError extends A_Error {
|
|
500
|
-
static readonly MethodNotImplemented = "A-Channel Method Not Implemented";
|
|
501
|
-
protected _context?: A_OperationContext;
|
|
502
|
-
/**
|
|
503
|
-
* Channel Error allows to keep track of errors within a channel if something goes wrong
|
|
504
|
-
*
|
|
505
|
-
*
|
|
506
|
-
* @param originalError
|
|
507
|
-
* @param context
|
|
508
|
-
*/
|
|
509
|
-
constructor(originalError: string | A_Error | Error | any, context?: A_OperationContext | string);
|
|
510
|
-
/***
|
|
511
|
-
* Returns Context of the error
|
|
512
|
-
*/
|
|
513
|
-
get context(): A_OperationContext | undefined;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/**
|
|
517
|
-
* A-Command Status Enumeration
|
|
518
|
-
*
|
|
519
|
-
* Defines all possible states a command can be in during its lifecycle.
|
|
520
|
-
* Commands progress through these states in a specific order:
|
|
521
|
-
* CREATED → INITIALIZED → COMPILED → EXECUTING → COMPLETED/FAILED
|
|
522
|
-
*/
|
|
523
|
-
declare enum A_Command_Status {
|
|
524
|
-
/**
|
|
525
|
-
* Initial state when command is instantiated but not yet ready for execution
|
|
526
|
-
*/
|
|
527
|
-
CREATED = "CREATED",
|
|
528
|
-
/**
|
|
529
|
-
* Command has been initialized with execution scope and dependencies
|
|
530
|
-
*/
|
|
531
|
-
INITIALIZED = "INITIALIZED",
|
|
532
|
-
/**
|
|
533
|
-
* Command has been compiled and is ready for execution
|
|
534
|
-
*/
|
|
535
|
-
COMPILED = "COMPILED",
|
|
536
|
-
/**
|
|
537
|
-
* Command is currently being executed
|
|
538
|
-
*/
|
|
539
|
-
EXECUTING = "EXECUTING",
|
|
540
|
-
/**
|
|
541
|
-
* Command has completed successfully
|
|
542
|
-
*/
|
|
543
|
-
COMPLETED = "COMPLETED",
|
|
544
|
-
/**
|
|
545
|
-
* Command execution has failed with errors
|
|
546
|
-
*/
|
|
547
|
-
FAILED = "FAILED"
|
|
548
|
-
}
|
|
549
|
-
/**
|
|
550
|
-
* A-Command State Transitions
|
|
551
|
-
*
|
|
552
|
-
* Defines valid state transitions for command lifecycle management.
|
|
553
|
-
* These transitions are used by the StateMachine to enforce proper command flow.
|
|
554
|
-
*/
|
|
555
|
-
declare enum A_CommandTransitions {
|
|
556
|
-
/** Transition from CREATED to INITIALIZED state */
|
|
557
|
-
CREATED_TO_INITIALIZED = "created_initialized",
|
|
558
|
-
/** Transition from INITIALIZED to EXECUTING state */
|
|
559
|
-
INITIALIZED_TO_EXECUTING = "initialized_executing",
|
|
560
|
-
/** Transition from EXECUTING to COMPLETED state (success path) */
|
|
561
|
-
EXECUTING_TO_COMPLETED = "executing_completed",
|
|
562
|
-
/** Transition from EXECUTING to FAILED state (error path) */
|
|
563
|
-
EXECUTING_TO_FAILED = "executing_failed"
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* A-Command Lifecycle Features
|
|
567
|
-
*
|
|
568
|
-
* Defines feature extension points that components can implement to customize
|
|
569
|
-
* command behavior at different stages of the lifecycle.
|
|
570
|
-
*
|
|
571
|
-
* Components can use @A_Feature.Extend() decorator with these feature names
|
|
572
|
-
* to inject custom logic into command execution.
|
|
573
|
-
*/
|
|
574
|
-
declare enum A_CommandFeatures {
|
|
575
|
-
/**
|
|
576
|
-
* Triggered during command initialization phase
|
|
577
|
-
* Use to set up execution environment, validate parameters, or prepare resources
|
|
578
|
-
*/
|
|
579
|
-
onInit = "_A_Command_onInit",
|
|
580
|
-
/**
|
|
581
|
-
* Triggered before command execution starts
|
|
582
|
-
* Use for pre-execution validation, logging, or setup tasks
|
|
583
|
-
*/
|
|
584
|
-
onBeforeExecute = "_A_Command_onBeforeExecute",
|
|
585
|
-
/**
|
|
586
|
-
* Main command execution logic
|
|
587
|
-
* Core business logic should be implemented here
|
|
588
|
-
*/
|
|
589
|
-
onExecute = "_A_Command_onExecute",
|
|
590
|
-
/**
|
|
591
|
-
* Triggered after command execution completes (success or failure)
|
|
592
|
-
* Use for cleanup, logging, or post-processing tasks
|
|
593
|
-
*/
|
|
594
|
-
onAfterExecute = "_A_Command_onAfterExecute",
|
|
595
|
-
/**
|
|
596
|
-
* Triggered when command completes successfully
|
|
597
|
-
* Use for success-specific operations like notifications or result processing
|
|
598
|
-
*/
|
|
599
|
-
onComplete = "_A_Command_onComplete",
|
|
600
|
-
/**
|
|
601
|
-
* Triggered when command execution fails
|
|
602
|
-
* Use for error handling, cleanup, or failure notifications
|
|
603
|
-
*/
|
|
604
|
-
onFail = "_A_Command_onFail",
|
|
605
|
-
/**
|
|
606
|
-
* Triggered when an error occurs during execution
|
|
607
|
-
* Use for error logging, transformation, or recovery attempts
|
|
608
|
-
*/
|
|
609
|
-
onError = "_A_Command_onError"
|
|
610
|
-
}
|
|
611
|
-
declare enum A_CommandEvent {
|
|
612
|
-
/**
|
|
613
|
-
* Triggered during command initialization phase
|
|
614
|
-
* Use to set up execution environment, validate parameters, or prepare resources
|
|
615
|
-
*/
|
|
616
|
-
onInit = "onInit",
|
|
617
|
-
/**
|
|
618
|
-
* Triggered before command execution starts
|
|
619
|
-
* Use for pre-execution validation, logging, or setup tasks
|
|
620
|
-
*/
|
|
621
|
-
onBeforeExecute = "onBeforeExecute",
|
|
622
|
-
/**
|
|
623
|
-
* Main command execution logic
|
|
624
|
-
* Core business logic should be implemented here
|
|
625
|
-
*/
|
|
626
|
-
onExecute = "onExecute",
|
|
627
|
-
/**
|
|
628
|
-
* Triggered after command execution completes (success or failure)
|
|
629
|
-
* Use for cleanup, logging, or post-processing tasks
|
|
630
|
-
*/
|
|
631
|
-
onAfterExecute = "onAfterExecute",
|
|
632
|
-
/**
|
|
633
|
-
* Triggered when command completes successfully
|
|
634
|
-
* Use for success-specific operations like notifications or result processing
|
|
635
|
-
*/
|
|
636
|
-
onComplete = "onComplete",
|
|
637
|
-
/**
|
|
638
|
-
* Triggered when command execution fails
|
|
639
|
-
* Use for error handling, cleanup, or failure notifications
|
|
640
|
-
*/
|
|
641
|
-
onFail = "onFail",
|
|
642
|
-
/**
|
|
643
|
-
* Triggered when an error occurs during execution
|
|
644
|
-
* Use for error logging, transformation, or recovery attempts
|
|
645
|
-
*/
|
|
646
|
-
onError = "onError"
|
|
647
|
-
}
|
|
648
|
-
/**
|
|
649
|
-
* Type alias for command lifecycle event names
|
|
650
|
-
* Represents all available events that can be listened to on a command instance
|
|
651
|
-
*/
|
|
652
|
-
type A_CommandEvents = keyof typeof A_CommandEvent;
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* Command Constructor Type
|
|
656
|
-
*
|
|
657
|
-
* Generic constructor type for creating command instances.
|
|
658
|
-
* Used for dependency injection and factory patterns.
|
|
659
|
-
*
|
|
660
|
-
* @template T - The command class type extending A_Command
|
|
661
|
-
*/
|
|
662
|
-
type A_TYPES__Command_Constructor<T = A_Command> = new (...args: any[]) => T;
|
|
663
|
-
/**
|
|
664
|
-
* Command Initialization Parameters
|
|
665
|
-
*
|
|
666
|
-
* Base type for command parameters. Commands should extend this with
|
|
667
|
-
* specific parameter types for their use case.
|
|
668
|
-
*
|
|
669
|
-
* @example
|
|
670
|
-
* ```typescript
|
|
671
|
-
* interface UserCommandParams extends A_TYPES__Command_Init {
|
|
672
|
-
* userId: string;
|
|
673
|
-
* action: 'create' | 'update' | 'delete';
|
|
674
|
-
* }
|
|
675
|
-
* ```
|
|
676
|
-
*/
|
|
677
|
-
type A_TYPES__Command_Init = Record<string, any>;
|
|
678
|
-
/**
|
|
679
|
-
* Command Serialized Format
|
|
680
|
-
*
|
|
681
|
-
* Complete serialized representation of a command including all state,
|
|
682
|
-
* timing information, results, and errors. Used for persistence,
|
|
683
|
-
* transmission between services, and state restoration.
|
|
684
|
-
*
|
|
685
|
-
* @template ParamsType - Type of command parameters
|
|
686
|
-
* @template ResultType - Type of command execution result
|
|
687
|
-
*
|
|
688
|
-
* @example
|
|
689
|
-
* ```typescript
|
|
690
|
-
* const serialized: A_TYPES__Command_Serialized<
|
|
691
|
-
* { userId: string },
|
|
692
|
-
* { success: boolean }
|
|
693
|
-
* > = command.toJSON();
|
|
694
|
-
* ```
|
|
695
|
-
*/
|
|
696
|
-
type A_TYPES__Command_Serialized<ParamsType extends Record<string, any> = Record<string, any>, ResultType extends Record<string, any> = Record<string, any>> = {
|
|
697
|
-
/**
|
|
698
|
-
* Unique identifier for the command type (derived from class name)
|
|
699
|
-
*/
|
|
700
|
-
code: string;
|
|
701
|
-
/**
|
|
702
|
-
* Current execution status of the command
|
|
703
|
-
*/
|
|
704
|
-
status: A_Command_Status;
|
|
705
|
-
/**
|
|
706
|
-
* Parameters used to initialize the command
|
|
707
|
-
*/
|
|
708
|
-
params: ParamsType;
|
|
709
|
-
/**
|
|
710
|
-
* ISO timestamp when the command was created
|
|
711
|
-
*/
|
|
712
|
-
createdAt: string;
|
|
713
|
-
/**
|
|
714
|
-
* ISO timestamp when command execution started (if started)
|
|
715
|
-
*/
|
|
716
|
-
startedAt?: string;
|
|
717
|
-
/**
|
|
718
|
-
* ISO timestamp when command execution ended (if completed/failed)
|
|
719
|
-
*/
|
|
720
|
-
endedAt?: string;
|
|
721
|
-
/**
|
|
722
|
-
* Total execution duration in milliseconds (if completed/failed)
|
|
723
|
-
*/
|
|
724
|
-
duration?: number;
|
|
725
|
-
/**
|
|
726
|
-
* Time between creation and execution start in milliseconds
|
|
727
|
-
*/
|
|
728
|
-
idleTime?: number;
|
|
729
|
-
/**
|
|
730
|
-
* Result data produced by successful command execution
|
|
731
|
-
*/
|
|
732
|
-
result?: ResultType;
|
|
733
|
-
/**
|
|
734
|
-
* Array of serialized errors that occurred during execution
|
|
735
|
-
*/
|
|
736
|
-
error?: A_TYPES__Error_Serialized;
|
|
737
|
-
} & A_TYPES__Entity_Serialized;
|
|
738
|
-
/**
|
|
739
|
-
* Command Event Listener Function
|
|
740
|
-
*
|
|
741
|
-
* Type definition for event listener functions that can be registered
|
|
742
|
-
* to respond to command lifecycle events.
|
|
743
|
-
*
|
|
744
|
-
* @template InvokeType - Type of command initialization parameters
|
|
745
|
-
* @template ResultType - Type of command execution result
|
|
746
|
-
* @template LifecycleEvents - Union type of custom lifecycle event names
|
|
747
|
-
*
|
|
748
|
-
* @param command - The command instance that triggered the event
|
|
749
|
-
*
|
|
750
|
-
* @example
|
|
751
|
-
* ```typescript
|
|
752
|
-
* const listener: A_TYPES__Command_Listener<UserParams, UserResult> = (command) => {
|
|
753
|
-
* console.log(`Command ${command?.code} triggered event`);
|
|
754
|
-
* };
|
|
755
|
-
*
|
|
756
|
-
* command.on('onExecute', listener);
|
|
757
|
-
* ```
|
|
758
|
-
*/
|
|
759
|
-
type A_TYPES__Command_Listener<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string = keyof typeof A_CommandEvent> = (command?: A_Command<InvokeType, ResultType, LifecycleEvents>) => void;
|
|
760
|
-
type A_Command_ExecutionContext<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>> = {
|
|
761
|
-
result: ResultType;
|
|
762
|
-
params: InvokeType;
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
declare enum A_StateMachineFeatures {
|
|
766
|
-
/**
|
|
767
|
-
* Allows to extend error handling logic and behavior
|
|
768
|
-
*/
|
|
769
|
-
onError = "_A_StateMachine_onError",
|
|
770
|
-
/**
|
|
771
|
-
* Allows to extend initialization logic and behavior
|
|
772
|
-
*/
|
|
773
|
-
onInitialize = "_A_StateMachine_onInitialize",
|
|
774
|
-
/**
|
|
775
|
-
* Allows to extend transition validation logic and behavior
|
|
776
|
-
*/
|
|
777
|
-
onBeforeTransition = "_A_StateMachine_onBeforeTransition",
|
|
778
|
-
/**
|
|
779
|
-
* Allows to extend post-transition logic and behavior
|
|
780
|
-
*/
|
|
781
|
-
onAfterTransition = "_A_StateMachine_onAfterTransition"
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
/**
|
|
785
|
-
* A_StateMachine is a powerful state machine implementation that allows you to define and manage
|
|
786
|
-
* complex state transitions with validation, hooks, and error handling.
|
|
787
|
-
*
|
|
788
|
-
* @template T - A record type defining the state transitions and their associated data types.
|
|
789
|
-
* Each key represents a state name, and the value represents the data type for that state.
|
|
790
|
-
*
|
|
791
|
-
* @example
|
|
792
|
-
* ```typescript
|
|
793
|
-
* interface OrderStates {
|
|
794
|
-
* pending: { orderId: string };
|
|
795
|
-
* processing: { orderId: string; processedBy: string };
|
|
796
|
-
* completed: { orderId: string; completedAt: Date };
|
|
797
|
-
* cancelled: { orderId: string; reason: string };
|
|
798
|
-
* }
|
|
799
|
-
*
|
|
800
|
-
* class OrderStateMachine extends A_StateMachine<OrderStates> {
|
|
801
|
-
* // Define custom transition logic
|
|
802
|
-
* async pending_processing(scope: A_Scope) {
|
|
803
|
-
* const operation = scope.resolve(A_StateMachineTransition)!;
|
|
804
|
-
* const { orderId } = operation.props;
|
|
805
|
-
* // Custom validation and business logic
|
|
806
|
-
* }
|
|
807
|
-
* }
|
|
808
|
-
* ```
|
|
809
|
-
*/
|
|
810
|
-
declare class A_StateMachine<T extends Record<string, any> = Record<string, any>> extends A_Component {
|
|
811
|
-
/**
|
|
812
|
-
* Internal promise that tracks the initialization state of the state machine.
|
|
813
|
-
* Used to ensure the state machine is properly initialized before allowing transitions.
|
|
814
|
-
*/
|
|
815
|
-
protected _initialized?: Promise<void>;
|
|
816
|
-
/**
|
|
817
|
-
* Gets a promise that resolves when the state machine is fully initialized and ready for transitions.
|
|
818
|
-
* This ensures that all initialization hooks have been executed before allowing state transitions.
|
|
819
|
-
*
|
|
820
|
-
* @returns Promise<void> that resolves when initialization is complete
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* ```typescript
|
|
824
|
-
* const stateMachine = new MyStateMachine();
|
|
825
|
-
* await stateMachine.ready; // Wait for initialization
|
|
826
|
-
* await stateMachine.transition('idle', 'running');
|
|
827
|
-
* ```
|
|
828
|
-
*/
|
|
829
|
-
get ready(): Promise<void>;
|
|
830
|
-
/**
|
|
831
|
-
* Initialization hook that runs when the state machine is first created.
|
|
832
|
-
* This method can be extended to add custom initialization logic.
|
|
833
|
-
*
|
|
834
|
-
* @param args - Variable arguments passed during initialization
|
|
835
|
-
* @returns Promise<void>
|
|
836
|
-
*
|
|
837
|
-
* @example
|
|
838
|
-
* ```typescript
|
|
839
|
-
* class MyStateMachine extends A_StateMachine {
|
|
840
|
-
* @A_Feature.Extend()
|
|
841
|
-
* async [A_StateMachineFeatures.onInitialize]() {
|
|
842
|
-
* // Custom initialization logic
|
|
843
|
-
* console.log('State machine initialized');
|
|
844
|
-
* }
|
|
845
|
-
* }
|
|
846
|
-
* ```
|
|
847
|
-
*/
|
|
848
|
-
[A_StateMachineFeatures.onInitialize](...args: any[]): Promise<void>;
|
|
849
|
-
/**
|
|
850
|
-
* Hook that runs before any state transition occurs.
|
|
851
|
-
* Use this to add validation, logging, or preparation logic that should run for all transitions.
|
|
852
|
-
*
|
|
853
|
-
* @param args - Variable arguments, typically includes the transition scope
|
|
854
|
-
* @returns Promise<void>
|
|
855
|
-
*
|
|
856
|
-
* @example
|
|
857
|
-
* ```typescript
|
|
858
|
-
* class MyStateMachine extends A_StateMachine {
|
|
859
|
-
* @A_Feature.Extend()
|
|
860
|
-
* async [A_StateMachineFeatures.onBeforeTransition](scope: A_Scope) {
|
|
861
|
-
* const operation = scope.resolve(A_StateMachineTransition)!;
|
|
862
|
-
* console.log(`Transitioning from ${operation.props.from} to ${operation.props.to}`);
|
|
863
|
-
* }
|
|
864
|
-
* }
|
|
865
|
-
* ```
|
|
866
|
-
*/
|
|
867
|
-
[A_StateMachineFeatures.onBeforeTransition](...args: any[]): Promise<void>;
|
|
868
|
-
/**
|
|
869
|
-
* Hook that runs after a successful state transition.
|
|
870
|
-
* Use this to add cleanup, logging, or post-transition logic that should run for all transitions.
|
|
871
|
-
*
|
|
872
|
-
* @param args - Variable arguments, typically includes the transition scope
|
|
873
|
-
* @returns Promise<void>
|
|
874
|
-
*
|
|
875
|
-
* @example
|
|
876
|
-
* ```typescript
|
|
877
|
-
* class MyStateMachine extends A_StateMachine {
|
|
878
|
-
* @A_Feature.Extend()
|
|
879
|
-
* async [A_StateMachineFeatures.onAfterTransition](scope: A_Scope) {
|
|
880
|
-
* const operation = scope.resolve(A_StateMachineTransition)!;
|
|
881
|
-
* console.log(`Successfully transitioned to ${operation.props.to}`);
|
|
882
|
-
* }
|
|
883
|
-
* }
|
|
884
|
-
* ```
|
|
885
|
-
*/
|
|
886
|
-
[A_StateMachineFeatures.onAfterTransition](...args: any[]): Promise<void>;
|
|
887
|
-
/**
|
|
888
|
-
* Error handling hook that runs when a transition fails.
|
|
889
|
-
* Use this to add custom error handling, logging, or recovery logic.
|
|
890
|
-
*
|
|
891
|
-
* @param args - Variable arguments, typically includes the error scope
|
|
892
|
-
* @returns Promise<void>
|
|
893
|
-
*
|
|
894
|
-
* @example
|
|
895
|
-
* ```typescript
|
|
896
|
-
* class MyStateMachine extends A_StateMachine {
|
|
897
|
-
* @A_Feature.Extend()
|
|
898
|
-
* async [A_StateMachineFeatures.onError](scope: A_Scope) {
|
|
899
|
-
* const error = scope.resolve(A_StateMachineError);
|
|
900
|
-
* console.error('Transition failed:', error?.message);
|
|
901
|
-
* }
|
|
902
|
-
* }
|
|
903
|
-
* ```
|
|
904
|
-
*/
|
|
905
|
-
[A_StateMachineFeatures.onError](...args: any[]): Promise<void>;
|
|
906
|
-
/**
|
|
907
|
-
* Executes a state transition from one state to another.
|
|
908
|
-
* This is the core method of the state machine that handles the complete transition lifecycle.
|
|
909
|
-
*
|
|
910
|
-
* @param from - The state to transition from (must be a key of T)
|
|
911
|
-
* @param to - The state to transition to (must be a key of T)
|
|
912
|
-
* @param props - Optional properties to pass to the transition context (should match T[keyof T])
|
|
913
|
-
* @returns Promise<void> that resolves when the transition is complete
|
|
914
|
-
*
|
|
915
|
-
* @throws {A_StateMachineError} When the transition fails for any reason
|
|
916
|
-
*
|
|
917
|
-
* @example
|
|
918
|
-
* ```typescript
|
|
919
|
-
* interface OrderStates {
|
|
920
|
-
* pending: { orderId: string };
|
|
921
|
-
* processing: { orderId: string; processedBy: string };
|
|
922
|
-
* }
|
|
923
|
-
*
|
|
924
|
-
* const orderMachine = new A_StateMachine<OrderStates>();
|
|
925
|
-
*
|
|
926
|
-
* // Transition with props
|
|
927
|
-
* await orderMachine.transition('pending', 'processing', {
|
|
928
|
-
* orderId: '12345',
|
|
929
|
-
* processedBy: 'user-456'
|
|
930
|
-
* });
|
|
931
|
-
* ```
|
|
932
|
-
*
|
|
933
|
-
* The transition process follows this lifecycle:
|
|
934
|
-
* 1. Wait for state machine initialization (ready)
|
|
935
|
-
* 2. Create transition name in camelCase format (e.g., "pending_processing")
|
|
936
|
-
* 3. Create operation context with transition data
|
|
937
|
-
* 4. Create isolated scope for the transition
|
|
938
|
-
* 5. Call onBeforeTransition hook
|
|
939
|
-
* 6. Execute the specific transition method (if defined)
|
|
940
|
-
* 7. Call onAfterTransition hook
|
|
941
|
-
* 8. Clean up scope and return result
|
|
942
|
-
*
|
|
943
|
-
* If any step fails, the onError hook is called and a wrapped error is thrown.
|
|
944
|
-
*/
|
|
945
|
-
transition(
|
|
946
|
-
/**
|
|
947
|
-
* The state to transition from
|
|
948
|
-
*/
|
|
949
|
-
from: keyof T,
|
|
950
|
-
/**
|
|
951
|
-
* The state to transition to
|
|
952
|
-
*/
|
|
953
|
-
to: keyof T,
|
|
954
|
-
/**
|
|
955
|
-
* Optional properties to pass to the transition context
|
|
956
|
-
*/
|
|
957
|
-
props?: T[keyof T]): Promise<void>;
|
|
958
|
-
}
|
|
959
|
-
|
|
960
|
-
declare enum A_TYPES__ConfigFeature {
|
|
961
|
-
}
|
|
962
|
-
type A_TYPES__ConfigContainerConstructor<T extends Array<string | A_TYPES__ConceptENVVariables[number]>> = {
|
|
963
|
-
/**
|
|
964
|
-
* If set to true, the SDK will throw an error if the variable is not defined OR not presented in the defaults
|
|
965
|
-
*/
|
|
966
|
-
strict: boolean;
|
|
967
|
-
/**
|
|
968
|
-
* Allows to define the names of variable to be loaded
|
|
969
|
-
*/
|
|
970
|
-
variables: T;
|
|
971
|
-
/**
|
|
972
|
-
* Allows to set the default values for the variables
|
|
973
|
-
*/
|
|
974
|
-
defaults: {
|
|
975
|
-
[key in T[number]]?: any;
|
|
976
|
-
};
|
|
977
|
-
} & A_TYPES__Fragment_Constructor;
|
|
978
|
-
|
|
979
|
-
declare const A_CONSTANTS__CONFIG_ENV_VARIABLES: {};
|
|
980
|
-
type A_TYPES__ConfigENVVariables = (typeof A_CONSTANTS__CONFIG_ENV_VARIABLES)[keyof typeof A_CONSTANTS__CONFIG_ENV_VARIABLES][];
|
|
981
|
-
declare const A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY: readonly [];
|
|
982
|
-
|
|
983
|
-
declare class A_Config<T extends Array<string | A_TYPES__ConceptENVVariables[number]> = any[]> extends A_ExecutionContext<{
|
|
984
|
-
[key in T[number]]: any;
|
|
985
|
-
} & {
|
|
986
|
-
[key in typeof A_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY[number]]: any;
|
|
987
|
-
} & {
|
|
988
|
-
[key in typeof A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY[number]]: any;
|
|
989
|
-
}> {
|
|
990
|
-
protected _strict: boolean;
|
|
991
|
-
protected _configProperties: T;
|
|
992
|
-
protected DEFAULT_ALLOWED_TO_READ_PROPERTIES: ("A_CONCEPT_NAME" | "A_CONCEPT_ROOT_SCOPE" | "A_CONCEPT_ENVIRONMENT" | "A_CONCEPT_ROOT_FOLDER" | "A_ERROR_DEFAULT_DESCRIPTION")[];
|
|
993
|
-
constructor(config: Partial<A_TYPES__ConfigContainerConstructor<T>>);
|
|
994
|
-
get strict(): boolean;
|
|
995
|
-
/**
|
|
996
|
-
* This method is used to get the configuration property by name
|
|
997
|
-
*
|
|
998
|
-
* @param property
|
|
999
|
-
* @returns
|
|
1000
|
-
*/
|
|
1001
|
-
get<K extends T[number]>(property: K | typeof this.DEFAULT_ALLOWED_TO_READ_PROPERTIES[number]): {
|
|
1002
|
-
[key in T[number]]: any;
|
|
1003
|
-
}[K] | undefined;
|
|
1004
|
-
/**
|
|
1005
|
-
*
|
|
1006
|
-
* This method is used to set the configuration property by name
|
|
1007
|
-
* OR set multiple properties at once by passing an array of objects
|
|
1008
|
-
*
|
|
1009
|
-
* @param variables
|
|
1010
|
-
*/
|
|
1011
|
-
set(variables: Array<{
|
|
1012
|
-
property: T[number] | A_TYPES__ConceptENVVariables[number];
|
|
1013
|
-
value: any;
|
|
1014
|
-
}>): any;
|
|
1015
|
-
set(variables: Partial<Record<T[number] | A_TYPES__ConceptENVVariables[number], any>>): any;
|
|
1016
|
-
set(property: T[number] | A_TYPES__ConceptENVVariables[number], value: any): any;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
declare const A_LoggerEnvVariables: {
|
|
1020
|
-
/**
|
|
1021
|
-
* Sets the log level for the logger
|
|
1022
|
-
*
|
|
1023
|
-
* @example 'debug', 'info', 'warn', 'error'
|
|
1024
|
-
*/
|
|
1025
|
-
readonly A_LOGGER_LEVEL: "A_LOGGER_LEVEL";
|
|
1026
|
-
/**
|
|
1027
|
-
* Sets the default scope length for log messages
|
|
1028
|
-
*
|
|
1029
|
-
* @example 'A_LOGGER_DEFAULT_SCOPE_LENGTH'
|
|
1030
|
-
*/
|
|
1031
|
-
readonly A_LOGGER_DEFAULT_SCOPE_LENGTH: "A_LOGGER_DEFAULT_SCOPE_LENGTH";
|
|
1032
|
-
/**
|
|
1033
|
-
* Sets the default color for scope display in log messages
|
|
1034
|
-
*
|
|
1035
|
-
* @example 'green', 'blue', 'red', 'yellow', 'gray', 'magenta', 'cyan', 'white', 'pink'
|
|
1036
|
-
*/
|
|
1037
|
-
readonly A_LOGGER_DEFAULT_SCOPE_COLOR: "A_LOGGER_DEFAULT_SCOPE_COLOR";
|
|
1038
|
-
/**
|
|
1039
|
-
* Sets the default color for log message content
|
|
1040
|
-
*
|
|
1041
|
-
* @example 'green', 'blue', 'red', 'yellow', 'gray', 'magenta', 'cyan', 'white', 'pink'
|
|
1042
|
-
*/
|
|
1043
|
-
readonly A_LOGGER_DEFAULT_LOG_COLOR: "A_LOGGER_DEFAULT_LOG_COLOR";
|
|
1044
|
-
};
|
|
1045
|
-
declare const A_LoggerEnvVariablesArray: readonly ["A_LOGGER_LEVEL", "A_LOGGER_DEFAULT_SCOPE_LENGTH", "A_LOGGER_DEFAULT_SCOPE_COLOR", "A_LOGGER_DEFAULT_LOG_COLOR"];
|
|
1046
|
-
type A_LoggerEnvVariablesType = (typeof A_LoggerEnvVariables)[keyof typeof A_LoggerEnvVariables][];
|
|
1047
|
-
|
|
1048
|
-
type A_LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'all';
|
|
1049
|
-
/**
|
|
1050
|
-
* Available color names for the logger
|
|
1051
|
-
* Can be used as first parameter in logging methods to specify message color
|
|
1052
|
-
*/
|
|
1053
|
-
type A_LoggerColorName = 'red' | 'yellow' | 'green' | 'blue' | 'cyan' | 'magenta' | 'gray' | 'brightBlue' | 'brightCyan' | 'brightMagenta' | 'darkGray' | 'lightGray' | 'indigo' | 'violet' | 'purple' | 'lavender' | 'skyBlue' | 'steelBlue' | 'slateBlue' | 'deepBlue' | 'lightBlue' | 'periwinkle' | 'cornflower' | 'powder' | 'charcoal' | 'silver' | 'smoke' | 'slate';
|
|
1054
|
-
|
|
1055
|
-
/**
|
|
1056
|
-
* A_Logger - Advanced Logging Component with Scope-based Output Formatting
|
|
1057
|
-
*
|
|
1058
|
-
* This component provides comprehensive logging capabilities with:
|
|
1059
|
-
* - Color-coded console output for different log levels
|
|
1060
|
-
* - Scope-based message formatting with consistent alignment
|
|
1061
|
-
* - Support for multiple data types (objects, errors, strings)
|
|
1062
|
-
* - Configurable log levels for filtering output
|
|
1063
|
-
* - Special handling for A_Error and native Error objects
|
|
1064
|
-
* - Timestamp inclusion for better debugging
|
|
1065
|
-
*
|
|
1066
|
-
* Key Features:
|
|
1067
|
-
* - **Scope Integration**: Uses A_Scope for consistent message prefixing
|
|
1068
|
-
* - **Color Support**: Terminal color codes for visual distinction
|
|
1069
|
-
* - **Object Formatting**: Pretty-prints JSON objects with proper indentation
|
|
1070
|
-
* - **Error Handling**: Special formatting for A_Error and Error objects
|
|
1071
|
-
* - **Log Level Filtering**: Configurable filtering based on severity
|
|
1072
|
-
* - **Multi-line Support**: Proper alignment for multi-line messages
|
|
1073
|
-
*
|
|
1074
|
-
* @example
|
|
1075
|
-
* ```typescript
|
|
1076
|
-
* // Basic usage with dependency injection (uses deterministic colors based on scope name)
|
|
1077
|
-
* class MyService {
|
|
1078
|
-
* constructor(@A_Inject(A_Logger) private logger: A_Logger) {}
|
|
1079
|
-
*
|
|
1080
|
-
* doSomething() {
|
|
1081
|
-
* this.logger.info('Processing started'); // Uses scope-name-based colors, always shows
|
|
1082
|
-
* this.logger.debug('Debug information'); // Only shows when debug level enabled
|
|
1083
|
-
*
|
|
1084
|
-
* // Color overload methods with enum support
|
|
1085
|
-
* this.logger.info('green', 'Success message'); // Green message, scope stays default
|
|
1086
|
-
* this.logger.debug('gray', 'Verbose debug info'); // Gray message for less important info
|
|
1087
|
-
* this.logger.info('brightBlue', 'Important notification');
|
|
1088
|
-
*
|
|
1089
|
-
* // Terminal width aware formatting - automatically wraps long lines
|
|
1090
|
-
* this.logger.info('This is a very long message that will be automatically wrapped to fit within the terminal width while maintaining proper indentation and formatting');
|
|
1091
|
-
*
|
|
1092
|
-
* this.logger.warning('Something might be wrong');
|
|
1093
|
-
* this.logger.error(new Error('Something failed'));
|
|
1094
|
-
* }
|
|
1095
|
-
* }
|
|
1096
|
-
*
|
|
1097
|
-
* // Same scope names will always get the same colors automatically
|
|
1098
|
-
* const logger1 = new A_Logger(new A_Scope({name: 'UserService'})); // Gets consistent colors
|
|
1099
|
-
* const logger2 = new A_Logger(new A_Scope({name: 'UserService'})); // Gets same colors as logger1
|
|
1100
|
-
*
|
|
1101
|
-
* // Available color names (A_LoggerColorName enum):
|
|
1102
|
-
* // 'red', 'yellow', 'green', 'blue', 'cyan', 'magenta', 'gray',
|
|
1103
|
-
* // 'brightBlue', 'brightCyan', 'brightMagenta', 'darkGray', 'lightGray',
|
|
1104
|
-
* // 'indigo', 'violet', 'purple', 'lavender', 'skyBlue', 'steelBlue',
|
|
1105
|
-
* // 'slateBlue', 'deepBlue', 'lightBlue', 'periwinkle', 'cornflower',
|
|
1106
|
-
* // 'powder', 'charcoal', 'silver', 'smoke', 'slate'
|
|
1107
|
-
*
|
|
1108
|
-
* // Configuration via environment variables or A_Config (overrides automatic selection)
|
|
1109
|
-
* process.env.A_LOGGER_DEFAULT_SCOPE_COLOR = 'magenta';
|
|
1110
|
-
* process.env.A_LOGGER_DEFAULT_LOG_COLOR = 'green';
|
|
1111
|
-
*
|
|
1112
|
-
* // Or through A_Config instance
|
|
1113
|
-
* const config = new A_Config({
|
|
1114
|
-
* A_LOGGER_DEFAULT_SCOPE_COLOR: 'red',
|
|
1115
|
-
* A_LOGGER_DEFAULT_LOG_COLOR: 'white'
|
|
1116
|
-
* });
|
|
1117
|
-
* const logger = new A_Logger(scope, config);
|
|
1118
|
-
* ```
|
|
1119
|
-
*/
|
|
1120
|
-
declare class A_Logger extends A_Component {
|
|
1121
|
-
protected scope: A_Scope;
|
|
1122
|
-
protected config?: A_Config<A_LoggerEnvVariablesType> | undefined;
|
|
1123
|
-
/**
|
|
1124
|
-
* Terminal color codes for different log levels and custom styling
|
|
1125
|
-
* These codes work with ANSI escape sequences for colored terminal output
|
|
1126
|
-
*/
|
|
1127
|
-
readonly COLORS: any;
|
|
1128
|
-
/**
|
|
1129
|
-
* Standard scope length for consistent formatting
|
|
1130
|
-
* This ensures all log messages align properly regardless of scope name length
|
|
1131
|
-
*/
|
|
1132
|
-
private readonly STANDARD_SCOPE_LENGTH;
|
|
1133
|
-
/**
|
|
1134
|
-
* Default color for the scope portion of log messages
|
|
1135
|
-
* This color is used for the scope brackets and content, and remains consistent
|
|
1136
|
-
* for this logger instance regardless of message color overrides
|
|
1137
|
-
*/
|
|
1138
|
-
private readonly DEFAULT_SCOPE_COLOR;
|
|
1139
|
-
/**
|
|
1140
|
-
* Default color for log message content when no explicit color is provided
|
|
1141
|
-
* This color is used for the message body when logging without specifying a color
|
|
1142
|
-
*/
|
|
1143
|
-
private readonly DEFAULT_LOG_COLOR;
|
|
1144
|
-
/**
|
|
1145
|
-
* Current terminal width for responsive formatting
|
|
1146
|
-
* Automatically detected or falls back to default values
|
|
1147
|
-
*/
|
|
1148
|
-
private readonly TERMINAL_WIDTH;
|
|
1149
|
-
/**
|
|
1150
|
-
* Maximum content width based on terminal size
|
|
1151
|
-
* Used for word wrapping and line length calculations
|
|
1152
|
-
*/
|
|
1153
|
-
private readonly MAX_CONTENT_WIDTH;
|
|
1154
|
-
/**
|
|
1155
|
-
* Initialize A_Logger with dependency injection
|
|
1156
|
-
* Colors are configured through A_Config or generated randomly if not provided
|
|
1157
|
-
*
|
|
1158
|
-
* @param scope - The current scope context for message prefixing
|
|
1159
|
-
* @param config - Optional configuration for log level filtering and color settings
|
|
1160
|
-
*/
|
|
1161
|
-
constructor(scope: A_Scope, config?: A_Config<A_LoggerEnvVariablesType> | undefined);
|
|
1162
|
-
/**
|
|
1163
|
-
* Generate a simple hash from a string
|
|
1164
|
-
* Used to create deterministic color selection based on scope name
|
|
1165
|
-
*
|
|
1166
|
-
* @param str - The string to hash
|
|
1167
|
-
* @returns A numeric hash value
|
|
1168
|
-
*/
|
|
1169
|
-
private simpleHash;
|
|
1170
|
-
/**
|
|
1171
|
-
* Generate a deterministic color based on scope name
|
|
1172
|
-
* Same scope names will always get the same color, but uses safe color palette
|
|
1173
|
-
*
|
|
1174
|
-
* @param scopeName - The scope name to generate color for
|
|
1175
|
-
* @returns A color key from the safe colors palette
|
|
1176
|
-
*/
|
|
1177
|
-
private generateColorFromScopeName;
|
|
1178
|
-
/**
|
|
1179
|
-
* Generate a pair of complementary colors based on scope name
|
|
1180
|
-
* Ensures visual harmony between scope and message colors while being deterministic
|
|
1181
|
-
*
|
|
1182
|
-
* @param scopeName - The scope name to base colors on
|
|
1183
|
-
* @returns Object with scopeColor and logColor that work well together
|
|
1184
|
-
*/
|
|
1185
|
-
private generateComplementaryColorsFromScope;
|
|
1186
|
-
/**
|
|
1187
|
-
* Detect current terminal width based on environment
|
|
1188
|
-
*
|
|
1189
|
-
* Returns appropriate width for different environments:
|
|
1190
|
-
* - Node.js: Uses process.stdout.columns if available
|
|
1191
|
-
* - Browser: Returns browser default width
|
|
1192
|
-
* - Fallback: Returns default terminal width
|
|
1193
|
-
*
|
|
1194
|
-
* @returns Terminal width in characters
|
|
1195
|
-
*/
|
|
1196
|
-
private detectTerminalWidth;
|
|
1197
|
-
/**
|
|
1198
|
-
* Wrap text to fit within terminal width while preserving formatting
|
|
1199
|
-
*
|
|
1200
|
-
* @param text - Text to wrap
|
|
1201
|
-
* @param scopePadding - The scope padding string for alignment
|
|
1202
|
-
* @param isFirstLine - Whether this is the first line (affects available width calculation)
|
|
1203
|
-
* @returns Array of wrapped lines with proper indentation
|
|
1204
|
-
*/
|
|
1205
|
-
private wrapText;
|
|
1206
|
-
/**
|
|
1207
|
-
* Split a long word that doesn't fit on a single line
|
|
1208
|
-
*
|
|
1209
|
-
* @param word - Word to split
|
|
1210
|
-
* @param maxLength - Maximum length per chunk
|
|
1211
|
-
* @returns Array of word chunks
|
|
1212
|
-
*/
|
|
1213
|
-
private splitLongWord;
|
|
1214
|
-
/**
|
|
1215
|
-
* Get the formatted scope length for consistent message alignment
|
|
1216
|
-
* Uses a standard length to ensure all messages align properly regardless of scope name
|
|
1217
|
-
*
|
|
1218
|
-
* @returns The scope length to use for padding calculations
|
|
1219
|
-
*/
|
|
1220
|
-
get scopeLength(): number;
|
|
1221
|
-
/**
|
|
1222
|
-
* Get the formatted scope name with proper padding, centered within the container
|
|
1223
|
-
* Ensures consistent width for all scope names in log output with centered alignment
|
|
1224
|
-
*
|
|
1225
|
-
* @returns Centered and padded scope name for consistent formatting
|
|
1226
|
-
*/
|
|
1227
|
-
get formattedScope(): string;
|
|
1228
|
-
/**
|
|
1229
|
-
* Compile log arguments into formatted console output with colors and proper alignment
|
|
1230
|
-
*
|
|
1231
|
-
* This method handles the core formatting logic for all log messages:
|
|
1232
|
-
* - Applies separate colors for scope and message content
|
|
1233
|
-
* - Formats scope names with consistent padding
|
|
1234
|
-
* - Handles different data types appropriately
|
|
1235
|
-
* - Maintains proper indentation for multi-line content
|
|
1236
|
-
*
|
|
1237
|
-
* @param messageColor - The color key to apply to the message content
|
|
1238
|
-
* @param args - Variable arguments to format and display
|
|
1239
|
-
* @returns Array of formatted strings and/or objects ready for console output
|
|
1240
|
-
*/
|
|
1241
|
-
compile(messageColor: keyof typeof this.COLORS, ...args: any[]): Array<any>;
|
|
1242
|
-
/**
|
|
1243
|
-
* Format an object for display with proper JSON indentation and terminal width awareness
|
|
1244
|
-
*
|
|
1245
|
-
* @param obj - The object to format
|
|
1246
|
-
* @param shouldAddNewline - Whether to add a newline prefix
|
|
1247
|
-
* @param scopePadding - The padding string for consistent alignment
|
|
1248
|
-
* @returns Formatted object string or the object itself for browser environments
|
|
1249
|
-
*/
|
|
1250
|
-
private formatObject;
|
|
1251
|
-
/**
|
|
1252
|
-
* Wrap a long JSON string value while preserving readability
|
|
1253
|
-
*
|
|
1254
|
-
* @param value - The string value to wrap
|
|
1255
|
-
* @param maxWidth - Maximum width for the value
|
|
1256
|
-
* @returns Wrapped string value
|
|
1257
|
-
*/
|
|
1258
|
-
private wrapJsonStringValue;
|
|
1259
|
-
/**
|
|
1260
|
-
* Format a string for display with proper indentation and terminal width wrapping
|
|
1261
|
-
*
|
|
1262
|
-
* @param str - The string to format
|
|
1263
|
-
* @param shouldAddNewline - Whether to add a newline prefix
|
|
1264
|
-
* @param scopePadding - The padding string for consistent alignment
|
|
1265
|
-
* @returns Formatted string
|
|
1266
|
-
*/
|
|
1267
|
-
private formatString;
|
|
1268
|
-
/**
|
|
1269
|
-
* Determine if a log message should be output based on configured log level
|
|
1270
|
-
*
|
|
1271
|
-
* Log level hierarchy:
|
|
1272
|
-
* - debug: Shows all messages (debug, info, warning, error)
|
|
1273
|
-
* - info: Shows info, warning, and error messages
|
|
1274
|
-
* - warn: Shows warning and error messages only
|
|
1275
|
-
* - error: Shows error messages only
|
|
1276
|
-
* - all: Shows all messages (alias for debug)
|
|
1277
|
-
*
|
|
1278
|
-
* @param logMethod - The type of log method being called
|
|
1279
|
-
* @returns True if the message should be logged, false otherwise
|
|
1280
|
-
*/
|
|
1281
|
-
protected shouldLog(logMethod: 'debug' | 'info' | 'warning' | 'error'): boolean;
|
|
1282
|
-
/**
|
|
1283
|
-
* Debug logging method with optional color specification
|
|
1284
|
-
* Only logs when debug level is enabled
|
|
1285
|
-
*
|
|
1286
|
-
* Supports two usage patterns:
|
|
1287
|
-
* 1. debug(message, ...args) - Uses instance's default log color
|
|
1288
|
-
* 2. debug(color, message, ...args) - Uses specified color for message content only
|
|
1289
|
-
*
|
|
1290
|
-
* Note: The scope color always remains the instance's default scope color,
|
|
1291
|
-
* only the message content color changes when explicitly specified.
|
|
1292
|
-
*
|
|
1293
|
-
* @param color - Optional color name from A_LoggerColorName enum or the first message argument
|
|
1294
|
-
* @param args - Additional arguments to log
|
|
1295
|
-
*
|
|
1296
|
-
* @example
|
|
1297
|
-
* ```typescript
|
|
1298
|
-
* logger.debug('Debug information'); // Uses instance default colors
|
|
1299
|
-
* logger.debug('gray', 'Debug message'); // Gray message, scope stays instance color
|
|
1300
|
-
* logger.debug('Processing user:', { id: 1, name: 'John' });
|
|
1301
|
-
* ```
|
|
1302
|
-
*/
|
|
1303
|
-
debug(color: A_LoggerColorName, ...args: any[]): void;
|
|
1304
|
-
debug(...args: any[]): void;
|
|
1305
|
-
/**
|
|
1306
|
-
* Info logging method with optional color specification
|
|
1307
|
-
* Logs without any restrictions (always shows regardless of log level)
|
|
1308
|
-
*
|
|
1309
|
-
* Supports two usage patterns:
|
|
1310
|
-
* 1. info(message, ...args) - Uses instance's default log color
|
|
1311
|
-
* 2. info(color, message, ...args) - Uses specified color for message content only
|
|
1312
|
-
*
|
|
1313
|
-
* Note: The scope color always remains the instance's default scope color,
|
|
1314
|
-
* only the message content color changes when explicitly specified.
|
|
1315
|
-
*
|
|
1316
|
-
* @param color - Optional color name from A_LoggerColorName enum or the first message argument
|
|
1317
|
-
* @param args - Additional arguments to log
|
|
1318
|
-
*
|
|
1319
|
-
* @example
|
|
1320
|
-
* ```typescript
|
|
1321
|
-
* logger.info('Hello World'); // Uses instance default colors
|
|
1322
|
-
* logger.info('green', 'Success message'); // Green message, scope stays instance color
|
|
1323
|
-
* logger.info('Processing user:', { id: 1, name: 'John' });
|
|
1324
|
-
* ```
|
|
1325
|
-
*/
|
|
1326
|
-
info(color: A_LoggerColorName, ...args: any[]): void;
|
|
1327
|
-
info(...args: any[]): void;
|
|
1328
|
-
/**
|
|
1329
|
-
* Legacy log method (kept for backward compatibility)
|
|
1330
|
-
* @deprecated Use info() method instead
|
|
1331
|
-
*
|
|
1332
|
-
* @param color - Optional color name from A_LoggerColorName enum or the first message argument
|
|
1333
|
-
* @param args - Additional arguments to log
|
|
1334
|
-
*/
|
|
1335
|
-
log(color: A_LoggerColorName, ...args: any[]): void;
|
|
1336
|
-
log(...args: any[]): void;
|
|
1337
|
-
/**
|
|
1338
|
-
* Log warning messages with yellow color coding
|
|
1339
|
-
*
|
|
1340
|
-
* Use for non-critical issues that should be brought to attention
|
|
1341
|
-
* but don't prevent normal operation
|
|
1342
|
-
*
|
|
1343
|
-
* @param args - Arguments to log as warnings
|
|
1344
|
-
*
|
|
1345
|
-
* @example
|
|
1346
|
-
* ```typescript
|
|
1347
|
-
* logger.warning('Deprecated method used');
|
|
1348
|
-
* logger.warning('Rate limit approaching:', { current: 95, limit: 100 });
|
|
1349
|
-
* ```
|
|
1350
|
-
*/
|
|
1351
|
-
warning(...args: any[]): void;
|
|
1352
|
-
/**
|
|
1353
|
-
* Log error messages with red color coding
|
|
1354
|
-
*
|
|
1355
|
-
* Use for critical issues, exceptions, and failures that need immediate attention
|
|
1356
|
-
*
|
|
1357
|
-
* @param args - Arguments to log as errors
|
|
1358
|
-
* @returns void (for compatibility with console.log)
|
|
1359
|
-
*
|
|
1360
|
-
* @example
|
|
1361
|
-
* ```typescript
|
|
1362
|
-
* logger.error('Database connection failed');
|
|
1363
|
-
* logger.error(new Error('Validation failed'));
|
|
1364
|
-
* logger.error('Critical error:', error, { context: 'user-registration' });
|
|
1365
|
-
* ```
|
|
1366
|
-
*/
|
|
1367
|
-
error(...args: any[]): void;
|
|
1368
|
-
/**
|
|
1369
|
-
* Legacy method for A_Error logging (kept for backward compatibility)
|
|
1370
|
-
*
|
|
1371
|
-
* @deprecated Use error() method instead which handles A_Error automatically
|
|
1372
|
-
* @param error - The A_Error instance to log
|
|
1373
|
-
*/
|
|
1374
|
-
protected log_A_Error(error: A_Error): void;
|
|
1375
|
-
/**
|
|
1376
|
-
* Format A_Error instances for inline display within compiled messages
|
|
1377
|
-
*
|
|
1378
|
-
* Provides detailed formatting for A_Error objects with:
|
|
1379
|
-
* - Error code, message, and description
|
|
1380
|
-
* - Original error information FIRST (better UX for debugging)
|
|
1381
|
-
* - Stack traces with terminal width awareness
|
|
1382
|
-
* - Documentation links (if available)
|
|
1383
|
-
* - Consistent formatting with rest of logger
|
|
1384
|
-
*
|
|
1385
|
-
* @param error - The A_Error instance to format
|
|
1386
|
-
* @returns Formatted string ready for display
|
|
1387
|
-
*/
|
|
1388
|
-
protected compile_A_Error(error: A_Error): string;
|
|
1389
|
-
/**
|
|
1390
|
-
* Format stack trace with proper terminal width wrapping and indentation
|
|
1391
|
-
*
|
|
1392
|
-
* @param stack - The stack trace string
|
|
1393
|
-
* @param baseIndent - Base indentation for continuation lines
|
|
1394
|
-
* @returns Array of formatted stack trace lines
|
|
1395
|
-
*/
|
|
1396
|
-
private formatStackTrace;
|
|
1397
|
-
/**
|
|
1398
|
-
* Format standard Error instances for inline display within compiled messages
|
|
1399
|
-
*
|
|
1400
|
-
* Provides clean, readable formatting for standard JavaScript errors with:
|
|
1401
|
-
* - Terminal width aware message wrapping
|
|
1402
|
-
* - Properly formatted stack traces
|
|
1403
|
-
* - Consistent indentation with rest of logger
|
|
1404
|
-
*
|
|
1405
|
-
* @param error - The Error instance to format
|
|
1406
|
-
* @returns Formatted string ready for display
|
|
1407
|
-
*/
|
|
1408
|
-
protected compile_Error(error: Error): string;
|
|
1409
|
-
/**
|
|
1410
|
-
* Generate timestamp string for log messages
|
|
1411
|
-
*
|
|
1412
|
-
* Format: MM:SS:mmm (minutes:seconds:milliseconds)
|
|
1413
|
-
* This provides sufficient precision for debugging while remaining readable
|
|
1414
|
-
*
|
|
1415
|
-
* @returns Formatted timestamp string
|
|
1416
|
-
*
|
|
1417
|
-
* @example
|
|
1418
|
-
* Returns: "15:42:137" for 3:42:15 PM and 137 milliseconds
|
|
1419
|
-
*/
|
|
1420
|
-
protected getTime(): string;
|
|
1421
|
-
}
|
|
1422
|
-
|
|
1423
|
-
type A_StateMachineTransitionParams<T = any> = {
|
|
1424
|
-
from: string;
|
|
1425
|
-
to: string;
|
|
1426
|
-
props?: T;
|
|
1427
|
-
};
|
|
1428
|
-
type A_StateMachineTransitionStorage<_ResultType extends any = any, _ParamsType extends any = any> = {
|
|
1429
|
-
from: string;
|
|
1430
|
-
to: string;
|
|
1431
|
-
} & A_Operation_Storage<_ResultType, A_StateMachineTransitionParams<_ParamsType>>;
|
|
1432
|
-
|
|
1433
|
-
declare class A_StateMachineTransition<_ParamsType = any, _ResultType = any> extends A_OperationContext<'a-state-machine-transition', A_StateMachineTransitionParams<_ParamsType>, _ResultType, A_StateMachineTransitionStorage<_ResultType, _ParamsType>> {
|
|
1434
|
-
constructor(params: A_StateMachineTransitionParams<_ParamsType>);
|
|
1435
|
-
/**
|
|
1436
|
-
* The state to transition from
|
|
1437
|
-
*/
|
|
1438
|
-
get from(): string;
|
|
1439
|
-
/**
|
|
1440
|
-
* The state to transition to
|
|
1441
|
-
*/
|
|
1442
|
-
get to(): string;
|
|
1443
|
-
}
|
|
1444
|
-
|
|
1445
|
-
/**
|
|
1446
|
-
* A_Command - Advanced Command Pattern Implementation
|
|
1447
|
-
*
|
|
1448
|
-
* A comprehensive command pattern implementation that encapsulates business logic
|
|
1449
|
-
* as executable commands with full lifecycle management, event handling, and
|
|
1450
|
-
* state persistence capabilities.
|
|
1451
|
-
*
|
|
1452
|
-
* ## Key Features
|
|
1453
|
-
* - **Structured Lifecycle**: Automatic progression through init → compile → execute → complete/fail
|
|
1454
|
-
* - **Event-Driven**: Subscribe to lifecycle events and emit custom events
|
|
1455
|
-
* - **State Persistence**: Full serialization/deserialization for cross-service communication
|
|
1456
|
-
* - **Type Safety**: Generic types for parameters, results, and custom events
|
|
1457
|
-
* - **Dependency Injection**: Integrated with A-Concept's DI system
|
|
1458
|
-
* - **Error Management**: Comprehensive error capture and handling
|
|
1459
|
-
* - **Execution Tracking**: Built-in timing and performance metrics
|
|
1460
|
-
*
|
|
1461
|
-
* ## Lifecycle Phases
|
|
1462
|
-
* 1. **CREATED** - Command instantiated but not initialized
|
|
1463
|
-
* 2. **INITIALIZED** - Execution scope and dependencies set up
|
|
1464
|
-
* 3. **COMPILED** - Ready for execution with all resources prepared
|
|
1465
|
-
* 4. **EXECUTING** - Currently running business logic
|
|
1466
|
-
* 5. **COMPLETED** - Successfully finished execution
|
|
1467
|
-
* 6. **FAILED** - Execution failed with errors captured
|
|
1468
|
-
*
|
|
1469
|
-
* @template InvokeType - Type definition for command parameters
|
|
1470
|
-
* @template ResultType - Type definition for command execution result
|
|
1471
|
-
* @template LifecycleEvents - Union type of custom lifecycle event names
|
|
1472
|
-
*
|
|
1473
|
-
* @example
|
|
1474
|
-
* ```typescript
|
|
1475
|
-
* // Define parameter and result types
|
|
1476
|
-
* interface UserCreateParams {
|
|
1477
|
-
* name: string;
|
|
1478
|
-
* email: string;
|
|
1479
|
-
* role: 'admin' | 'user';
|
|
1480
|
-
* }
|
|
1481
|
-
*
|
|
1482
|
-
* interface UserCreateResult {
|
|
1483
|
-
* userId: string;
|
|
1484
|
-
* success: boolean;
|
|
1485
|
-
* }
|
|
1486
|
-
*
|
|
1487
|
-
* // Create custom command
|
|
1488
|
-
* class CreateUserCommand extends A_Command<UserCreateParams, UserCreateResult> {}
|
|
1489
|
-
*
|
|
1490
|
-
* // Execute command
|
|
1491
|
-
* const command = new CreateUserCommand({
|
|
1492
|
-
* name: 'John Doe',
|
|
1493
|
-
* email: 'john@example.com',
|
|
1494
|
-
* role: 'user'
|
|
1495
|
-
* });
|
|
1496
|
-
*
|
|
1497
|
-
* scope.register(command);
|
|
1498
|
-
* await command.execute();
|
|
1499
|
-
*
|
|
1500
|
-
* console.log('Result:', command.result);
|
|
1501
|
-
* console.log('Status:', command.status);
|
|
1502
|
-
* ```
|
|
1503
|
-
*/
|
|
1504
|
-
declare class A_Command<InvokeType extends A_TYPES__Command_Init = A_TYPES__Command_Init, ResultType extends Record<string, any> = Record<string, any>, LifecycleEvents extends string | keyof typeof A_CommandEvent = keyof typeof A_CommandEvent> extends A_Entity<InvokeType, A_TYPES__Command_Serialized<InvokeType, ResultType>> {
|
|
1505
|
-
/**
|
|
1506
|
-
* Static command identifier derived from the class name
|
|
1507
|
-
* Used for command registration and serialization
|
|
1508
|
-
*/
|
|
1509
|
-
static get code(): string;
|
|
1510
|
-
/** The origin of the command, used to know has it been created from serialization or invoked */
|
|
1511
|
-
protected _origin: 'invoked' | 'serialized';
|
|
1512
|
-
/** Command execution scope for dependency injection and feature resolution */
|
|
1513
|
-
protected _executionScope: A_Scope;
|
|
1514
|
-
/** Result data produced by successful command execution */
|
|
1515
|
-
protected _result?: ResultType;
|
|
1516
|
-
/** Set of errors that occurred during command execution */
|
|
1517
|
-
protected _error: A_Error;
|
|
1518
|
-
/** Command initialization parameters */
|
|
1519
|
-
protected _params: InvokeType;
|
|
1520
|
-
/** Current lifecycle status of the command */
|
|
1521
|
-
protected _status: A_Command_Status;
|
|
1522
|
-
/** Map of event listeners organized by event name */
|
|
1523
|
-
protected _listeners: Map<LifecycleEvents | keyof typeof A_CommandEvent, Set<A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>>>;
|
|
1524
|
-
/** Timestamp when command execution started */
|
|
1525
|
-
protected _startTime?: Date;
|
|
1526
|
-
/** Timestamp when command execution ended */
|
|
1527
|
-
protected _endTime?: Date;
|
|
1528
|
-
/** Timestamp when command was created */
|
|
1529
|
-
protected _createdAt: Date;
|
|
1530
|
-
/**
|
|
1531
|
-
* Total execution duration in milliseconds
|
|
1532
|
-
*
|
|
1533
|
-
* - If completed/failed: Returns total time from start to end
|
|
1534
|
-
* - If currently executing: Returns elapsed time since start
|
|
1535
|
-
* - If not started: Returns undefined
|
|
1536
|
-
*/
|
|
1537
|
-
get duration(): number | undefined;
|
|
1538
|
-
/**
|
|
1539
|
-
* Idle time before execution started in milliseconds
|
|
1540
|
-
*
|
|
1541
|
-
* Time between command creation and execution start.
|
|
1542
|
-
* Useful for monitoring command queue performance.
|
|
1543
|
-
*/
|
|
1544
|
-
get idleTime(): number | undefined;
|
|
1545
|
-
/**
|
|
1546
|
-
* Command execution scope for dependency injection
|
|
1547
|
-
*
|
|
1548
|
-
* Provides access to components, services, and shared resources
|
|
1549
|
-
* during command execution. Inherits from the scope where the
|
|
1550
|
-
* command was registered.
|
|
1551
|
-
*/
|
|
1552
|
-
get scope(): A_Scope;
|
|
1553
|
-
/**
|
|
1554
|
-
* Execution context associated with the command
|
|
1555
|
-
*/
|
|
1556
|
-
get context(): A_ExecutionContext<A_Command_ExecutionContext<InvokeType, ResultType>>;
|
|
1557
|
-
/**
|
|
1558
|
-
* Unique command type identifier
|
|
1559
|
-
*
|
|
1560
|
-
* Derived from the class name and used for:
|
|
1561
|
-
* - Command registration and resolution
|
|
1562
|
-
* - Serialization and deserialization
|
|
1563
|
-
* - Logging and debugging
|
|
1564
|
-
*
|
|
1565
|
-
* @example 'create-user-command', 'process-order-command'
|
|
1566
|
-
*/
|
|
1567
|
-
get code(): string;
|
|
1568
|
-
/**
|
|
1569
|
-
* Current lifecycle status of the command
|
|
1570
|
-
*
|
|
1571
|
-
* Indicates the current phase in the command execution lifecycle.
|
|
1572
|
-
* Used to track progress and determine available operations.
|
|
1573
|
-
*/
|
|
1574
|
-
get status(): A_Command_Status;
|
|
1575
|
-
/**
|
|
1576
|
-
* Timestamp when the command was created
|
|
1577
|
-
*
|
|
1578
|
-
* Marks the initial instantiation time, useful for tracking
|
|
1579
|
-
* command age and queue performance metrics.
|
|
1580
|
-
*/
|
|
1581
|
-
get createdAt(): Date;
|
|
1582
|
-
/**
|
|
1583
|
-
* Timestamp when command execution started
|
|
1584
|
-
*
|
|
1585
|
-
* Undefined until execution begins. Used for calculating
|
|
1586
|
-
* execution duration and idle time.
|
|
1587
|
-
*/
|
|
1588
|
-
get startedAt(): Date | undefined;
|
|
1589
|
-
/**
|
|
1590
|
-
* Timestamp when command execution ended
|
|
1591
|
-
*
|
|
1592
|
-
* Set when command reaches COMPLETED or FAILED status.
|
|
1593
|
-
* Used for calculating total execution duration.
|
|
1594
|
-
*/
|
|
1595
|
-
get endedAt(): Date | undefined;
|
|
1596
|
-
/**
|
|
1597
|
-
* Result data produced by command execution
|
|
1598
|
-
*
|
|
1599
|
-
* Contains the output data from successful command execution.
|
|
1600
|
-
* Undefined until command completes successfully.
|
|
1601
|
-
*/
|
|
1602
|
-
get result(): ResultType | undefined;
|
|
1603
|
-
/**
|
|
1604
|
-
* Array of errors that occurred during execution
|
|
1605
|
-
*
|
|
1606
|
-
* Automatically wraps native errors in A_Error instances
|
|
1607
|
-
* for consistent error handling. Empty array if no errors occurred.
|
|
1608
|
-
*/
|
|
1609
|
-
get error(): A_Error | undefined;
|
|
1610
|
-
/**
|
|
1611
|
-
* Command initialization parameters
|
|
1612
|
-
*
|
|
1613
|
-
* Contains the input data used to create and configure the command.
|
|
1614
|
-
* These parameters are immutable during command execution.
|
|
1615
|
-
return new A_Error(err);
|
|
1616
|
-
}
|
|
1617
|
-
});
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
|
-
/**
|
|
1621
|
-
* Command initialization parameters
|
|
1622
|
-
*
|
|
1623
|
-
* Contains the input data used to create and configure the command.
|
|
1624
|
-
* These parameters are immutable during command execution.
|
|
1625
|
-
*/
|
|
1626
|
-
get params(): InvokeType;
|
|
1627
|
-
/**
|
|
1628
|
-
* Indicates if the command has been processed (completed or failed)
|
|
1629
|
-
*
|
|
1630
|
-
* Returns true if the command has completed or failed, false otherwise.
|
|
1631
|
-
*/
|
|
1632
|
-
get isProcessed(): boolean;
|
|
1633
|
-
/**
|
|
1634
|
-
*
|
|
1635
|
-
* A-Command represents an executable command with a specific code and parameters.
|
|
1636
|
-
* It can be executed within a given scope and stores execution results and errors.
|
|
1637
|
-
*
|
|
1638
|
-
*
|
|
1639
|
-
* A-Command should be context independent and execution logic should be based on attached components
|
|
1640
|
-
*
|
|
1641
|
-
* @param code
|
|
1642
|
-
* @param params
|
|
1643
|
-
*/
|
|
1644
|
-
constructor(
|
|
1645
|
-
/**
|
|
1646
|
-
* Command invocation parameters
|
|
1647
|
-
*/
|
|
1648
|
-
params: InvokeType | A_TYPES__Command_Serialized<InvokeType, ResultType> | string);
|
|
1649
|
-
protected [A_StateMachineFeatures.onBeforeTransition](transition: A_StateMachineTransition, logger?: A_Logger, ...args: any[]): Promise<void>;
|
|
1650
|
-
protected [A_CommandTransitions.CREATED_TO_INITIALIZED](transition: A_StateMachineTransition, ...args: any[]): Promise<void>;
|
|
1651
|
-
protected [A_CommandTransitions.INITIALIZED_TO_EXECUTING](transition: A_StateMachineTransition, ...args: any[]): Promise<void>;
|
|
1652
|
-
protected [A_CommandTransitions.EXECUTING_TO_COMPLETED](transition: A_StateMachineTransition, ...args: any[]): Promise<void>;
|
|
1653
|
-
protected [A_CommandTransitions.EXECUTING_TO_FAILED](transition: A_StateMachineTransition, error: A_Error, ...args: any[]): Promise<void>;
|
|
1654
|
-
protected [A_CommandFeatures.onInit](stateMachine: A_StateMachine, ...args: any[]): Promise<void>;
|
|
1655
|
-
protected [A_CommandFeatures.onBeforeExecute](stateMachine: A_StateMachine, ...args: any[]): Promise<void>;
|
|
1656
|
-
protected [A_CommandFeatures.onExecute](...args: any[]): Promise<void>;
|
|
1657
|
-
protected [A_CommandFeatures.onAfterExecute](...args: any[]): Promise<void>;
|
|
1658
|
-
protected [A_CommandFeatures.onComplete](stateMachine: A_StateMachine, ...args: any[]): Promise<void>;
|
|
1659
|
-
protected [A_CommandFeatures.onFail](stateMachine: A_StateMachine, operation: A_ExecutionContext<A_Command_ExecutionContext<InvokeType, ResultType>>, ...args: any[]): Promise<void>;
|
|
1660
|
-
/**
|
|
1661
|
-
* Initializes the command before execution.
|
|
1662
|
-
*/
|
|
1663
|
-
init(): Promise<void>;
|
|
1664
|
-
/**
|
|
1665
|
-
* Executes the command logic.
|
|
1666
|
-
*/
|
|
1667
|
-
execute(): Promise<any>;
|
|
1668
|
-
/**
|
|
1669
|
-
* Marks the command as completed
|
|
1670
|
-
*
|
|
1671
|
-
*
|
|
1672
|
-
* Calling This method will set the command status to COMPLETED, record the end time,
|
|
1673
|
-
* store the result, emit the onComplete event, and destroy the execution scope.
|
|
1674
|
-
*
|
|
1675
|
-
* [!] After Calling this method, the command is considered fully processed And further processing will be INTERRUPTED.
|
|
1676
|
-
* [!] If the command is already processed (COMPLETED or FAILED), this method does nothing.
|
|
1677
|
-
* [!] This method can be called with optional result data to store with the command.
|
|
1678
|
-
*
|
|
1679
|
-
* @param result - Optional result data to store with the command
|
|
1680
|
-
*/
|
|
1681
|
-
complete(result?: ResultType): Promise<void>;
|
|
1682
|
-
/**
|
|
1683
|
-
* Marks the command as failed
|
|
1684
|
-
*/
|
|
1685
|
-
fail(error?: A_Error): Promise<void>;
|
|
1686
|
-
/**
|
|
1687
|
-
* Registers an event listener for a specific event
|
|
1688
|
-
*
|
|
1689
|
-
* @param event
|
|
1690
|
-
* @param listener
|
|
1691
|
-
*/
|
|
1692
|
-
on(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1693
|
-
/**
|
|
1694
|
-
* Removes an event listener for a specific event
|
|
1695
|
-
*
|
|
1696
|
-
* @param event
|
|
1697
|
-
* @param listener
|
|
1698
|
-
*/
|
|
1699
|
-
off(event: LifecycleEvents | A_CommandEvent, listener: A_TYPES__Command_Listener<InvokeType, ResultType, LifecycleEvents>): void;
|
|
1700
|
-
/**
|
|
1701
|
-
* Emits an event to all registered listeners
|
|
1702
|
-
*
|
|
1703
|
-
* @param event
|
|
1704
|
-
*/
|
|
1705
|
-
emit(event: LifecycleEvents | keyof typeof A_CommandEvent): void;
|
|
1706
|
-
/**
|
|
1707
|
-
* Allows to create a Command instance from new data
|
|
1708
|
-
*
|
|
1709
|
-
* @param newEntity
|
|
1710
|
-
*/
|
|
1711
|
-
fromNew(newEntity: InvokeType): void;
|
|
1712
|
-
/**
|
|
1713
|
-
* Allows to convert serialized data to Command instance
|
|
1714
|
-
*
|
|
1715
|
-
* [!] By default it omits params as they are not stored in the serialized data
|
|
1716
|
-
*
|
|
1717
|
-
* @param serialized
|
|
1718
|
-
*/
|
|
1719
|
-
fromJSON(serialized: A_TYPES__Command_Serialized<InvokeType, ResultType>): void;
|
|
1720
|
-
/**
|
|
1721
|
-
* Converts the Command instance to a plain object
|
|
1722
|
-
*
|
|
1723
|
-
* @returns
|
|
1724
|
-
*/
|
|
1725
|
-
toJSON(): A_TYPES__Command_Serialized<InvokeType, ResultType>;
|
|
1726
|
-
/**
|
|
1727
|
-
* Ensures that the command's execution scope inherits from the context scope
|
|
1728
|
-
*
|
|
1729
|
-
* Throws an error if the command is not bound to any context scope
|
|
1730
|
-
*/
|
|
1731
|
-
protected checkScopeInheritance(): void;
|
|
1732
|
-
}
|
|
1733
|
-
|
|
1734
|
-
declare class A_CommandError extends A_Error {
|
|
1735
|
-
static readonly CommandScopeBindingError = "A-Command Scope Binding Error";
|
|
1736
|
-
static readonly ExecutionError = "A-Command Execution Error";
|
|
1737
|
-
static readonly ResultProcessingError = "A-Command Result Processing Error";
|
|
1738
|
-
/**
|
|
1739
|
-
* Error indicating that the command was interrupted during execution
|
|
1740
|
-
*/
|
|
1741
|
-
static readonly CommandInterruptedError = "A-Command Interrupted Error";
|
|
1742
|
-
}
|
|
1743
|
-
|
|
1744
|
-
interface Ifspolyfill {
|
|
1745
|
-
readFileSync: (path: string, encoding: string) => string;
|
|
1746
|
-
existsSync: (path: string) => boolean;
|
|
1747
|
-
createReadStream: (path: string, options?: BufferEncoding) => any;
|
|
1748
|
-
}
|
|
1749
|
-
interface IcryptoInterface {
|
|
1750
|
-
createTextHash(text: string, algorithm: string): Promise<string>;
|
|
1751
|
-
createFileHash(filePath: string, algorithm: string): Promise<string>;
|
|
1752
|
-
}
|
|
1753
|
-
interface IhttpInterface {
|
|
1754
|
-
request: (options: any, callback?: (res: any) => void) => any;
|
|
1755
|
-
get: (url: string | any, callback?: (res: any) => void) => any;
|
|
1756
|
-
createServer: (requestListener?: (req: any, res: any) => void) => any;
|
|
1757
|
-
}
|
|
1758
|
-
interface IhttpsInterface {
|
|
1759
|
-
request: (options: any, callback?: (res: any) => void) => any;
|
|
1760
|
-
get: (url: string | any, callback?: (res: any) => void) => any;
|
|
1761
|
-
createServer: (options: any, requestListener?: (req: any, res: any) => void) => any;
|
|
1762
|
-
}
|
|
1763
|
-
interface IpathInterface {
|
|
1764
|
-
join: (...paths: string[]) => string;
|
|
1765
|
-
resolve: (...paths: string[]) => string;
|
|
1766
|
-
dirname: (path: string) => string;
|
|
1767
|
-
basename: (path: string, ext?: string) => string;
|
|
1768
|
-
extname: (path: string) => string;
|
|
1769
|
-
relative: (from: string, to: string) => string;
|
|
1770
|
-
normalize: (path: string) => string;
|
|
1771
|
-
isAbsolute: (path: string) => boolean;
|
|
1772
|
-
parse: (path: string) => any;
|
|
1773
|
-
format: (pathObject: any) => string;
|
|
1774
|
-
sep: string;
|
|
1775
|
-
delimiter: string;
|
|
1776
|
-
}
|
|
1777
|
-
interface IurlInterface {
|
|
1778
|
-
parse: (urlString: string) => any;
|
|
1779
|
-
format: (urlObject: any) => string;
|
|
1780
|
-
resolve: (from: string, to: string) => string;
|
|
1781
|
-
URL: typeof URL;
|
|
1782
|
-
URLSearchParams: typeof URLSearchParams;
|
|
1783
|
-
}
|
|
1784
|
-
interface IbufferInterface {
|
|
1785
|
-
from: (data: any, encoding?: string) => any;
|
|
1786
|
-
alloc: (size: number, fill?: any) => any;
|
|
1787
|
-
allocUnsafe: (size: number) => any;
|
|
1788
|
-
isBuffer: (obj: any) => boolean;
|
|
1789
|
-
concat: (list: any[], totalLength?: number) => any;
|
|
1790
|
-
}
|
|
1791
|
-
interface IprocessInterface {
|
|
1792
|
-
env: Record<string, string | undefined>;
|
|
1793
|
-
argv: string[];
|
|
1794
|
-
platform: string;
|
|
1795
|
-
version: string;
|
|
1796
|
-
versions: Record<string, string>;
|
|
1797
|
-
cwd: () => string;
|
|
1798
|
-
exit: (code?: number) => never;
|
|
1799
|
-
nextTick: (callback: Function, ...args: any[]) => void;
|
|
1800
|
-
}
|
|
1801
|
-
|
|
1802
|
-
declare class A_FSPolyfillClass {
|
|
1803
|
-
protected logger: A_Logger;
|
|
1804
|
-
private _fs;
|
|
1805
|
-
private _initialized;
|
|
1806
|
-
constructor(logger: A_Logger);
|
|
1807
|
-
get isInitialized(): boolean;
|
|
1808
|
-
get(): Promise<Ifspolyfill>;
|
|
1809
|
-
private init;
|
|
1810
|
-
private initServer;
|
|
1811
|
-
private initBrowser;
|
|
1812
|
-
}
|
|
1813
|
-
|
|
1814
|
-
declare class A_CryptoPolyfillClass {
|
|
1815
|
-
protected logger: A_Logger;
|
|
1816
|
-
private _crypto;
|
|
1817
|
-
private _initialized;
|
|
1818
|
-
private _fsPolyfill?;
|
|
1819
|
-
constructor(logger: A_Logger);
|
|
1820
|
-
get isInitialized(): boolean;
|
|
1821
|
-
get(fsPolyfill?: Ifspolyfill): Promise<IcryptoInterface>;
|
|
1822
|
-
private init;
|
|
1823
|
-
private initServer;
|
|
1824
|
-
private initBrowser;
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
declare class A_HttpPolyfillClass {
|
|
1828
|
-
protected logger: A_Logger;
|
|
1829
|
-
private _http;
|
|
1830
|
-
private _initialized;
|
|
1831
|
-
constructor(logger: A_Logger);
|
|
1832
|
-
get isInitialized(): boolean;
|
|
1833
|
-
get(): Promise<IhttpInterface>;
|
|
1834
|
-
private init;
|
|
1835
|
-
private initServer;
|
|
1836
|
-
private initBrowser;
|
|
1837
|
-
private createMockRequest;
|
|
1838
|
-
}
|
|
1839
|
-
|
|
1840
|
-
declare class A_HttpsPolyfillClass {
|
|
1841
|
-
protected logger: A_Logger;
|
|
1842
|
-
private _https;
|
|
1843
|
-
private _initialized;
|
|
1844
|
-
constructor(logger: A_Logger);
|
|
1845
|
-
get isInitialized(): boolean;
|
|
1846
|
-
get(): Promise<IhttpsInterface>;
|
|
1847
|
-
private init;
|
|
1848
|
-
private initServer;
|
|
1849
|
-
private initBrowser;
|
|
1850
|
-
private createMockRequest;
|
|
1851
|
-
}
|
|
1852
|
-
|
|
1853
|
-
declare class A_PathPolyfillClass {
|
|
1854
|
-
protected logger: A_Logger;
|
|
1855
|
-
private _path;
|
|
1856
|
-
private _initialized;
|
|
1857
|
-
constructor(logger: A_Logger);
|
|
1858
|
-
get isInitialized(): boolean;
|
|
1859
|
-
get(): Promise<IpathInterface>;
|
|
1860
|
-
private init;
|
|
1861
|
-
private initServer;
|
|
1862
|
-
private initBrowser;
|
|
1863
|
-
}
|
|
1864
|
-
|
|
1865
|
-
declare class A_UrlPolyfillClass {
|
|
1866
|
-
protected logger: A_Logger;
|
|
1867
|
-
private _url;
|
|
1868
|
-
private _initialized;
|
|
1869
|
-
get isInitialized(): boolean;
|
|
1870
|
-
constructor(logger: A_Logger);
|
|
1871
|
-
get(): Promise<IurlInterface>;
|
|
1872
|
-
private init;
|
|
1873
|
-
private initServer;
|
|
1874
|
-
private initBrowser;
|
|
1875
|
-
}
|
|
1876
|
-
|
|
1877
|
-
declare class A_BufferPolyfillClass {
|
|
1878
|
-
protected logger: A_Logger;
|
|
1879
|
-
private _buffer;
|
|
1880
|
-
private _initialized;
|
|
1881
|
-
constructor(logger: A_Logger);
|
|
1882
|
-
get isInitialized(): boolean;
|
|
1883
|
-
get(): Promise<IbufferInterface>;
|
|
1884
|
-
private init;
|
|
1885
|
-
private initServer;
|
|
1886
|
-
private initBrowser;
|
|
1887
|
-
}
|
|
1888
|
-
|
|
1889
|
-
declare class A_ProcessPolyfillClass {
|
|
1890
|
-
protected logger: A_Logger;
|
|
1891
|
-
private _process;
|
|
1892
|
-
private _initialized;
|
|
1893
|
-
get isInitialized(): boolean;
|
|
1894
|
-
constructor(logger: A_Logger);
|
|
1895
|
-
get(): Promise<IprocessInterface>;
|
|
1896
|
-
private init;
|
|
1897
|
-
private initServer;
|
|
1898
|
-
private initBrowser;
|
|
1899
|
-
}
|
|
1900
|
-
|
|
1901
|
-
declare class A_Polyfill extends A_Component {
|
|
1902
|
-
protected logger: A_Logger;
|
|
1903
|
-
protected _fsPolyfill: A_FSPolyfillClass;
|
|
1904
|
-
protected _cryptoPolyfill: A_CryptoPolyfillClass;
|
|
1905
|
-
protected _httpPolyfill: A_HttpPolyfillClass;
|
|
1906
|
-
protected _httpsPolyfill: A_HttpsPolyfillClass;
|
|
1907
|
-
protected _pathPolyfill: A_PathPolyfillClass;
|
|
1908
|
-
protected _urlPolyfill: A_UrlPolyfillClass;
|
|
1909
|
-
protected _bufferPolyfill: A_BufferPolyfillClass;
|
|
1910
|
-
protected _processPolyfill: A_ProcessPolyfillClass;
|
|
1911
|
-
protected _initializing: Promise<void> | null;
|
|
1912
|
-
/**
|
|
1913
|
-
* Indicates whether the channel is connected
|
|
1914
|
-
*/
|
|
1915
|
-
protected _initialized?: Promise<void>;
|
|
1916
|
-
constructor(logger: A_Logger);
|
|
1917
|
-
/**
|
|
1918
|
-
* Indicates whether the channel is connected
|
|
1919
|
-
*/
|
|
1920
|
-
get ready(): Promise<void>;
|
|
1921
|
-
load(): Promise<void>;
|
|
1922
|
-
attachToWindow(): Promise<void>;
|
|
1923
|
-
protected _loadInternal(): Promise<void>;
|
|
1924
|
-
/**
|
|
1925
|
-
* Allows to use the 'fs' polyfill methods regardless of the environment
|
|
1926
|
-
* This method loads the 'fs' polyfill and returns its instance
|
|
1927
|
-
*
|
|
1928
|
-
* @returns
|
|
1929
|
-
*/
|
|
1930
|
-
fs(): Promise<Ifspolyfill>;
|
|
1931
|
-
/**
|
|
1932
|
-
* Allows to use the 'crypto' polyfill methods regardless of the environment
|
|
1933
|
-
* This method loads the 'crypto' polyfill and returns its instance
|
|
1934
|
-
*
|
|
1935
|
-
* @returns
|
|
1936
|
-
*/
|
|
1937
|
-
crypto(): Promise<IcryptoInterface>;
|
|
1938
|
-
/**
|
|
1939
|
-
* Allows to use the 'http' polyfill methods regardless of the environment
|
|
1940
|
-
* This method loads the 'http' polyfill and returns its instance
|
|
1941
|
-
*
|
|
1942
|
-
* @returns
|
|
1943
|
-
*/
|
|
1944
|
-
http(): Promise<IhttpInterface>;
|
|
1945
|
-
/**
|
|
1946
|
-
* Allows to use the 'https' polyfill methods regardless of the environment
|
|
1947
|
-
* This method loads the 'https' polyfill and returns its instance
|
|
1948
|
-
*
|
|
1949
|
-
* @returns
|
|
1950
|
-
*/
|
|
1951
|
-
https(): Promise<IhttpsInterface>;
|
|
1952
|
-
/**
|
|
1953
|
-
* Allows to use the 'path' polyfill methods regardless of the environment
|
|
1954
|
-
* This method loads the 'path' polyfill and returns its instance
|
|
1955
|
-
*
|
|
1956
|
-
* @returns
|
|
1957
|
-
*/
|
|
1958
|
-
path(): Promise<IpathInterface>;
|
|
1959
|
-
/**
|
|
1960
|
-
* Allows to use the 'url' polyfill methods regardless of the environment
|
|
1961
|
-
* This method loads the 'url' polyfill and returns its instance
|
|
1962
|
-
*
|
|
1963
|
-
* @returns
|
|
1964
|
-
*/
|
|
1965
|
-
url(): Promise<IurlInterface>;
|
|
1966
|
-
/**
|
|
1967
|
-
* Allows to use the 'buffer' polyfill methods regardless of the environment
|
|
1968
|
-
* This method loads the 'buffer' polyfill and returns its instance
|
|
1969
|
-
*
|
|
1970
|
-
* @returns
|
|
1971
|
-
*/
|
|
1972
|
-
buffer(): Promise<IbufferInterface>;
|
|
1973
|
-
/**
|
|
1974
|
-
* Allows to use the 'process' polyfill methods regardless of the environment
|
|
1975
|
-
* This method loads the 'process' polyfill and returns its instance
|
|
1976
|
-
*
|
|
1977
|
-
* @returns
|
|
1978
|
-
*/
|
|
1979
|
-
process(): Promise<IprocessInterface>;
|
|
1980
|
-
}
|
|
1981
|
-
|
|
1982
|
-
declare class A_ConfigLoader extends A_Container {
|
|
1983
|
-
private reader;
|
|
1984
|
-
prepare(polyfill: A_Polyfill): Promise<void>;
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
declare class A_ConfigError extends A_Error {
|
|
1988
|
-
static readonly InitializationError = "A-Config Initialization Error";
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
/**
|
|
1992
|
-
* Config Reader
|
|
1993
|
-
*/
|
|
1994
|
-
declare class ConfigReader extends A_Component {
|
|
1995
|
-
protected polyfill: A_Polyfill;
|
|
1996
|
-
protected DEFAULT_ALLOWED_TO_READ_PROPERTIES: ("A_CONCEPT_NAME" | "A_CONCEPT_ROOT_SCOPE" | "A_CONCEPT_ENVIRONMENT" | "A_CONCEPT_ROOT_FOLDER" | "A_ERROR_DEFAULT_DESCRIPTION")[];
|
|
1997
|
-
constructor(polyfill: A_Polyfill);
|
|
1998
|
-
attachContext(container: A_Container, context: A_Scope, config?: A_Config<any>): Promise<void>;
|
|
1999
|
-
initialize(config: A_Config): Promise<void>;
|
|
2000
|
-
/**
|
|
2001
|
-
* Get the configuration property by Name
|
|
2002
|
-
* @param property
|
|
2003
|
-
*/
|
|
2004
|
-
resolve<_ReturnType = any>(property: string): _ReturnType;
|
|
2005
|
-
/**
|
|
2006
|
-
* This method reads the configuration and sets the values to the context
|
|
2007
|
-
*
|
|
2008
|
-
* @returns
|
|
2009
|
-
*/
|
|
2010
|
-
read<T extends string>(variables?: Array<T>): Promise<Record<T, any>>;
|
|
2011
|
-
/**
|
|
2012
|
-
* Finds the root directory of the project by locating the folder containing package.json
|
|
2013
|
-
*
|
|
2014
|
-
* @param {string} startPath - The initial directory to start searching from (default is __dirname)
|
|
2015
|
-
* @returns {string|null} - The path to the root directory or null if package.json is not found
|
|
2016
|
-
*/
|
|
2017
|
-
protected getProjectRoot(startPath?: string): Promise<string>;
|
|
2018
|
-
}
|
|
2019
|
-
|
|
2020
|
-
declare class ENVConfigReader extends ConfigReader {
|
|
2021
|
-
readEnvFile(config: A_Config<A_TYPES__ConceptENVVariables>, polyfill: A_Polyfill, feature: A_Feature): Promise<void>;
|
|
2022
|
-
/**
|
|
2023
|
-
* Get the configuration property Name
|
|
2024
|
-
* @param property
|
|
2025
|
-
*/
|
|
2026
|
-
getConfigurationProperty_ENV_Alias(property: string): string;
|
|
2027
|
-
resolve<_ReturnType = any>(property: string): _ReturnType;
|
|
2028
|
-
read<T extends string>(variables?: Array<T>): Promise<Record<T, any>>;
|
|
2029
|
-
}
|
|
2030
|
-
|
|
2031
|
-
declare class FileConfigReader extends ConfigReader {
|
|
2032
|
-
private FileData;
|
|
2033
|
-
/**
|
|
2034
|
-
* Get the configuration property Name
|
|
2035
|
-
* @param property
|
|
2036
|
-
*/
|
|
2037
|
-
getConfigurationProperty_File_Alias(property: string): string;
|
|
2038
|
-
resolve<_ReturnType = any>(property: string): _ReturnType;
|
|
2039
|
-
read<T extends string>(variables?: Array<T>): Promise<Record<T, any>>;
|
|
2040
|
-
}
|
|
2041
|
-
|
|
2042
|
-
/**
|
|
2043
|
-
* A-Logger Constants
|
|
2044
|
-
*
|
|
2045
|
-
* Configuration constants and default values for the A_Logger component
|
|
2046
|
-
*/
|
|
2047
|
-
/**
|
|
2048
|
-
* Default scope length for consistent message alignment
|
|
2049
|
-
*/
|
|
2050
|
-
declare const A_LOGGER_DEFAULT_SCOPE_LENGTH = 20;
|
|
2051
|
-
/**
|
|
2052
|
-
* Default log level when none is specified
|
|
2053
|
-
*/
|
|
2054
|
-
declare const A_LOGGER_DEFAULT_LEVEL = "all";
|
|
2055
|
-
/**
|
|
2056
|
-
* Terminal color codes mapping
|
|
2057
|
-
*/
|
|
2058
|
-
declare const A_LOGGER_COLORS: {
|
|
2059
|
-
readonly red: "31";
|
|
2060
|
-
readonly yellow: "33";
|
|
2061
|
-
readonly green: "32";
|
|
2062
|
-
readonly blue: "34";
|
|
2063
|
-
readonly cyan: "36";
|
|
2064
|
-
readonly magenta: "35";
|
|
2065
|
-
readonly gray: "90";
|
|
2066
|
-
readonly brightBlue: "94";
|
|
2067
|
-
readonly brightCyan: "96";
|
|
2068
|
-
readonly brightMagenta: "95";
|
|
2069
|
-
readonly darkGray: "30";
|
|
2070
|
-
readonly lightGray: "37";
|
|
2071
|
-
readonly indigo: "38;5;54";
|
|
2072
|
-
readonly violet: "38;5;93";
|
|
2073
|
-
readonly purple: "38;5;129";
|
|
2074
|
-
readonly lavender: "38;5;183";
|
|
2075
|
-
readonly skyBlue: "38;5;117";
|
|
2076
|
-
readonly steelBlue: "38;5;67";
|
|
2077
|
-
readonly slateBlue: "38;5;62";
|
|
2078
|
-
readonly deepBlue: "38;5;18";
|
|
2079
|
-
readonly lightBlue: "38;5;153";
|
|
2080
|
-
readonly periwinkle: "38;5;111";
|
|
2081
|
-
readonly cornflower: "38;5;69";
|
|
2082
|
-
readonly powder: "38;5;152";
|
|
2083
|
-
readonly charcoal: "38;5;236";
|
|
2084
|
-
readonly silver: "38;5;250";
|
|
2085
|
-
readonly smoke: "38;5;244";
|
|
2086
|
-
readonly slate: "38;5;240";
|
|
2087
|
-
};
|
|
2088
|
-
/**
|
|
2089
|
-
* Safe colors for random selection - grey-blue-violet palette
|
|
2090
|
-
* Excludes system colors (red, yellow, green) to avoid confusion with warnings/errors
|
|
2091
|
-
*/
|
|
2092
|
-
declare const A_LOGGER_SAFE_RANDOM_COLORS: readonly ["blue", "cyan", "magenta", "gray", "brightBlue", "brightCyan", "brightMagenta", "darkGray", "lightGray", "indigo", "violet", "purple", "lavender", "skyBlue", "steelBlue", "slateBlue", "deepBlue", "lightBlue", "periwinkle", "cornflower", "powder", "charcoal", "silver", "smoke", "slate"];
|
|
2093
|
-
/**
|
|
2094
|
-
* ANSI escape codes
|
|
2095
|
-
*/
|
|
2096
|
-
declare const A_LOGGER_ANSI: {
|
|
2097
|
-
readonly RESET: "\u001B[0m";
|
|
2098
|
-
readonly PREFIX: "\u001B[";
|
|
2099
|
-
readonly SUFFIX: "m";
|
|
2100
|
-
};
|
|
2101
|
-
/**
|
|
2102
|
-
* Timestamp format configuration
|
|
2103
|
-
*/
|
|
2104
|
-
declare const A_LOGGER_TIME_FORMAT: {
|
|
2105
|
-
readonly MINUTES_PAD: 2;
|
|
2106
|
-
readonly SECONDS_PAD: 2;
|
|
2107
|
-
readonly MILLISECONDS_PAD: 3;
|
|
2108
|
-
readonly SEPARATOR: ":";
|
|
2109
|
-
};
|
|
2110
|
-
/**
|
|
2111
|
-
* Log message structure constants
|
|
2112
|
-
*/
|
|
2113
|
-
declare const A_LOGGER_FORMAT: {
|
|
2114
|
-
readonly SCOPE_OPEN: "[";
|
|
2115
|
-
readonly SCOPE_CLOSE: "]";
|
|
2116
|
-
readonly TIME_OPEN: "|";
|
|
2117
|
-
readonly TIME_CLOSE: "|";
|
|
2118
|
-
readonly SEPARATOR: "-------------------------------";
|
|
2119
|
-
readonly INDENT_BASE: 3;
|
|
2120
|
-
readonly PIPE: "| ";
|
|
2121
|
-
};
|
|
2122
|
-
/**
|
|
2123
|
-
* Environment variable keys
|
|
2124
|
-
*/
|
|
2125
|
-
/**
|
|
2126
|
-
* Terminal width configuration
|
|
2127
|
-
*/
|
|
2128
|
-
declare const A_LOGGER_TERMINAL: {
|
|
2129
|
-
readonly DEFAULT_WIDTH: 80;
|
|
2130
|
-
readonly MIN_WIDTH: 40;
|
|
2131
|
-
readonly MAX_LINE_LENGTH_RATIO: 0.8;
|
|
2132
|
-
readonly BROWSER_DEFAULT_WIDTH: 120;
|
|
2133
|
-
};
|
|
2134
|
-
/**
|
|
2135
|
-
* Environment variable keys
|
|
2136
|
-
*/
|
|
2137
|
-
declare const A_LOGGER_ENV_KEYS: {
|
|
2138
|
-
readonly LOG_LEVEL: "A_LOGGER_LEVEL";
|
|
2139
|
-
readonly DEFAULT_SCOPE_LENGTH: "A_LOGGER_DEFAULT_SCOPE_LENGTH";
|
|
2140
|
-
readonly DEFAULT_SCOPE_COLOR: "A_LOGGER_DEFAULT_SCOPE_COLOR";
|
|
2141
|
-
readonly DEFAULT_LOG_COLOR: "A_LOGGER_DEFAULT_LOG_COLOR";
|
|
2142
|
-
};
|
|
2143
|
-
|
|
2144
|
-
type A_UTILS_TYPES__Manifest_Init = Array<A_UTILS_TYPES__Manifest_ComponentLevelConfig>;
|
|
2145
|
-
type A_UTILS_TYPES__Manifest_ComponentLevelConfig<T extends A_Component = A_Component> = {
|
|
2146
|
-
/**
|
|
2147
|
-
* Component constructor
|
|
2148
|
-
*/
|
|
2149
|
-
component: A_TYPES__Component_Constructor<T>;
|
|
2150
|
-
/**
|
|
2151
|
-
* Method level configurations for the component
|
|
2152
|
-
*/
|
|
2153
|
-
methods?: Array<A_UTILS_TYPES__Manifest_MethodLevelConfig<T>>;
|
|
2154
|
-
} & Partial<A_UTILS_TYPES__Manifest_Rules>;
|
|
2155
|
-
type A_UTILS_TYPES__Manifest_MethodLevelConfig<T extends A_Component = A_Component> = {
|
|
2156
|
-
/**
|
|
2157
|
-
* Method name from the component provided
|
|
2158
|
-
*/
|
|
2159
|
-
method: string | RegExp;
|
|
2160
|
-
} & Partial<A_UTILS_TYPES__Manifest_Rules>;
|
|
2161
|
-
type A_UTILS_TYPES__Manifest_Rules = {
|
|
2162
|
-
/**
|
|
2163
|
-
* A list of entities to which a component is applied
|
|
2164
|
-
*
|
|
2165
|
-
* By default is for all
|
|
2166
|
-
*/
|
|
2167
|
-
apply: Array<A_UTILS_TYPES__Manifest_AllowedComponents> | RegExp;
|
|
2168
|
-
/**
|
|
2169
|
-
* A list of entities to which a component is excluded
|
|
2170
|
-
*/
|
|
2171
|
-
exclude: Array<A_UTILS_TYPES__Manifest_AllowedComponents> | RegExp;
|
|
2172
|
-
};
|
|
2173
|
-
type A_UTILS_TYPES__Manifest_AllowedComponents = A_TYPES__Component_Constructor | A_TYPES__Entity_Constructor | A_TYPES__Fragment_Constructor | A_TYPES__Container_Constructor;
|
|
2174
|
-
interface A_UTILS_TYPES__ManifestRule {
|
|
2175
|
-
componentRegex: RegExp;
|
|
2176
|
-
methodRegex: RegExp;
|
|
2177
|
-
applyRegex?: RegExp;
|
|
2178
|
-
excludeRegex?: RegExp;
|
|
2179
|
-
}
|
|
2180
|
-
interface A_UTILS_TYPES__ManifestQuery {
|
|
2181
|
-
component: A_TYPES__Component_Constructor;
|
|
2182
|
-
method: string;
|
|
2183
|
-
target: A_UTILS_TYPES__Manifest_AllowedComponents;
|
|
2184
|
-
}
|
|
2185
|
-
|
|
2186
|
-
/**
|
|
2187
|
-
* Fluent API for checking manifest permissions
|
|
2188
|
-
*/
|
|
2189
|
-
declare class A_ManifestChecker {
|
|
2190
|
-
private manifest;
|
|
2191
|
-
private component;
|
|
2192
|
-
private method;
|
|
2193
|
-
private checkExclusion;
|
|
2194
|
-
constructor(manifest: A_Manifest, component: A_TYPES__Component_Constructor, method: string, checkExclusion?: boolean);
|
|
2195
|
-
for(target: A_UTILS_TYPES__Manifest_AllowedComponents): boolean;
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
declare class A_Manifest extends A_Fragment {
|
|
2199
|
-
private rules;
|
|
2200
|
-
/**
|
|
2201
|
-
* A-Manifest is a configuration set that allows to include or exclude component application for the particular methods.
|
|
2202
|
-
*
|
|
2203
|
-
* For example, if A-Scope provides polymorphic A-Component that applies for All A-Entities in it but you have another component that should be used for only One particular Entity, you can use A-Manifest to specify this behavior.
|
|
2204
|
-
*
|
|
2205
|
-
*
|
|
2206
|
-
* By default if Component is provided in the scope - it applies for all entities in it. However, if you want to exclude some entities or include only some entities for the particular component - you can use A-Manifest to define this behavior.
|
|
2207
|
-
*
|
|
2208
|
-
* @param config - Array of component configurations
|
|
2209
|
-
*/
|
|
2210
|
-
constructor(config?: A_UTILS_TYPES__Manifest_Init);
|
|
2211
|
-
/**
|
|
2212
|
-
* Should convert received configuration into internal Regexp applicable for internal storage
|
|
2213
|
-
*/
|
|
2214
|
-
protected prepare(config: A_UTILS_TYPES__Manifest_Init): void;
|
|
2215
|
-
/**
|
|
2216
|
-
* Process a single configuration item and convert it to internal rules
|
|
2217
|
-
*/
|
|
2218
|
-
private processConfigItem;
|
|
2219
|
-
/**
|
|
2220
|
-
* Convert a constructor to a regex pattern
|
|
2221
|
-
*/
|
|
2222
|
-
private constructorToRegex;
|
|
2223
|
-
/**
|
|
2224
|
-
* Convert a method name or regex to a regex pattern
|
|
2225
|
-
*/
|
|
2226
|
-
private methodToRegex;
|
|
2227
|
-
/**
|
|
2228
|
-
* Convert allowed components array or regex to a single regex
|
|
2229
|
-
*/
|
|
2230
|
-
private allowedComponentsToRegex;
|
|
2231
|
-
/**
|
|
2232
|
-
* Escape special regex characters in a string
|
|
2233
|
-
*/
|
|
2234
|
-
private escapeRegex;
|
|
2235
|
-
protected configItemToRegexp(item: A_TYPES__Component_Constructor): RegExp;
|
|
2236
|
-
protected ID(component: A_TYPES__Component_Constructor, method: string): string;
|
|
2237
|
-
/**
|
|
2238
|
-
* Check if a component and method combination is allowed for a target
|
|
2239
|
-
*/
|
|
2240
|
-
isAllowed<T extends A_Component>(ctor: T | A_TYPES__Component_Constructor<T>, method: string): A_ManifestChecker;
|
|
2241
|
-
/**
|
|
2242
|
-
* Internal method to check if access is allowed
|
|
2243
|
-
*/
|
|
2244
|
-
internal_checkAccess(query: A_UTILS_TYPES__ManifestQuery): boolean;
|
|
2245
|
-
isExcluded<T extends A_Component>(ctor: T | A_TYPES__Component_Constructor<T>, method: string): A_ManifestChecker;
|
|
2246
|
-
}
|
|
2247
|
-
|
|
2248
|
-
declare class A_ManifestError extends A_Error {
|
|
2249
|
-
static readonly ManifestInitializationError = "A-Manifest Initialization Error";
|
|
2250
|
-
}
|
|
2251
|
-
|
|
2252
|
-
declare enum A_MemoryFeatures {
|
|
2253
|
-
/**
|
|
2254
|
-
* Allows to extend initialization logic and behavior
|
|
2255
|
-
*/
|
|
2256
|
-
onInit = "_A_Memory_onInit",
|
|
2257
|
-
/**
|
|
2258
|
-
* Allows to extend destruction logic and behavior
|
|
2259
|
-
*/
|
|
2260
|
-
onDestroy = "_A_Memory_onDestroy",
|
|
2261
|
-
/**
|
|
2262
|
-
* Allows to extend expiration logic and behavior
|
|
2263
|
-
*/
|
|
2264
|
-
onExpire = "_A_Memory_onExpire",
|
|
2265
|
-
/**
|
|
2266
|
-
* Allows to extend error handling logic and behavior
|
|
2267
|
-
*/
|
|
2268
|
-
onError = "_A_Memory_onError",
|
|
2269
|
-
/**
|
|
2270
|
-
* Allows to extend serialization logic and behavior
|
|
2271
|
-
*/
|
|
2272
|
-
onSerialize = "_A_Memory_onSerialize",
|
|
2273
|
-
/**
|
|
2274
|
-
* Allows to extend set operation logic and behavior
|
|
2275
|
-
*/
|
|
2276
|
-
onSet = "_A_Memory_onSet",
|
|
2277
|
-
/**
|
|
2278
|
-
* Allows to extend get operation logic and behavior
|
|
2279
|
-
*/
|
|
2280
|
-
onGet = "_A_Memory_onGet",
|
|
2281
|
-
/**
|
|
2282
|
-
* Allows to extend drop operation logic and behavior
|
|
2283
|
-
*/
|
|
2284
|
-
onDrop = "_A_Memory_onDrop",
|
|
2285
|
-
/**
|
|
2286
|
-
* Allows to extend clear operation logic and behavior
|
|
2287
|
-
*/
|
|
2288
|
-
onClear = "_A_Memory_onClear",
|
|
2289
|
-
/**
|
|
2290
|
-
* Allows to extend has operation logic and behavior
|
|
2291
|
-
*/
|
|
2292
|
-
onHas = "_A_Memory_onHas"
|
|
2293
|
-
}
|
|
2294
|
-
|
|
2295
|
-
declare class A_MemoryContext<_MemoryType extends Record<string, any> = Record<string, any>, _SerializedType extends A_TYPES__Fragment_Serialized = A_TYPES__Fragment_Serialized> extends A_Fragment {
|
|
2296
|
-
protected _storage: Map<keyof _MemoryType, _MemoryType[keyof _MemoryType]>;
|
|
2297
|
-
set<K extends keyof _MemoryType>(param: K, value: _MemoryType[K]): void;
|
|
2298
|
-
get<K extends keyof _MemoryType>(param: K): _MemoryType[K] | undefined;
|
|
2299
|
-
delete<K extends keyof _MemoryType>(param: K): void;
|
|
2300
|
-
has<K extends keyof _MemoryType>(param: K): boolean;
|
|
2301
|
-
clear(): void;
|
|
2302
|
-
}
|
|
2303
|
-
|
|
2304
|
-
type A_MemoryContextMeta<T extends Record<string, any> = Record<string, any>> = Omit<T, 'error'> & {
|
|
2305
|
-
error?: A_Error;
|
|
2306
|
-
};
|
|
2307
|
-
type A_Memory_Storage = Record<string, any> & {
|
|
2308
|
-
error?: A_Error;
|
|
2309
|
-
};
|
|
2310
|
-
type A_MemoryOperations = 'get' | 'set' | 'drop' | 'clear' | 'has' | 'serialize';
|
|
2311
|
-
type A_MemoryOperationContext<T extends any = any> = A_OperationContext<A_MemoryOperations, {
|
|
2312
|
-
key: string;
|
|
2313
|
-
value?: any;
|
|
2314
|
-
}, T>;
|
|
2315
|
-
type A_MemoryOperationContextMeta<T extends any = any, I extends any = any> = {
|
|
2316
|
-
result: T;
|
|
2317
|
-
operation: A_MemoryOperations;
|
|
2318
|
-
key: string;
|
|
2319
|
-
value?: I;
|
|
2320
|
-
};
|
|
2321
|
-
|
|
2322
|
-
declare class A_Memory<_StorageType extends Record<string, any> = Record<string, any>, _SerializedType extends Record<string, any> = Record<string, any>> extends A_Component {
|
|
2323
|
-
protected _ready?: Promise<void>;
|
|
2324
|
-
get ready(): Promise<void>;
|
|
2325
|
-
[A_MemoryFeatures.onError](...args: any[]): Promise<void>;
|
|
2326
|
-
[A_MemoryFeatures.onExpire](...args: any[]): Promise<void>;
|
|
2327
|
-
[A_MemoryFeatures.onInit](context: A_MemoryContext<_StorageType>, ...args: any[]): Promise<void>;
|
|
2328
|
-
[A_MemoryFeatures.onDestroy](context: A_MemoryContext<_StorageType>, ...args: any[]): Promise<void>;
|
|
2329
|
-
/**
|
|
2330
|
-
* Handles the 'get' operation for retrieving a value from memory
|
|
2331
|
-
*/
|
|
2332
|
-
[A_MemoryFeatures.onGet](operation: A_MemoryOperationContext, context: A_MemoryContext<_StorageType>, ...args: any[]): Promise<void>;
|
|
2333
|
-
[A_MemoryFeatures.onHas](operation: A_MemoryOperationContext<boolean>, context: A_MemoryContext<_StorageType>, ...args: any[]): Promise<void>;
|
|
2334
|
-
[A_MemoryFeatures.onSet](operation: A_MemoryOperationContext, context: A_MemoryContext<_StorageType>, scope: A_Scope, ...args: any[]): Promise<void>;
|
|
2335
|
-
[A_MemoryFeatures.onDrop](operation: A_MemoryOperationContext, context: A_MemoryContext<_StorageType>, ...args: any[]): Promise<void>;
|
|
2336
|
-
[A_MemoryFeatures.onClear](operation: A_MemoryOperationContext, context: A_MemoryContext<_StorageType>, ...args: any[]): Promise<void>;
|
|
2337
|
-
/**
|
|
2338
|
-
* Initializes the memory context
|
|
2339
|
-
*/
|
|
2340
|
-
init(): Promise<void>;
|
|
2341
|
-
/**
|
|
2342
|
-
* Destroys the memory context
|
|
2343
|
-
*
|
|
2344
|
-
* This method is responsible for cleaning up any resources
|
|
2345
|
-
* used by the memory context and resetting its state.
|
|
2346
|
-
*/
|
|
2347
|
-
destroy(): Promise<void>;
|
|
2348
|
-
/**
|
|
2349
|
-
* Retrieves a value from the context memory
|
|
2350
|
-
*
|
|
2351
|
-
* @param key - memory key to retrieve
|
|
2352
|
-
* @returns - value associated with the key or undefined if not found
|
|
2353
|
-
*/
|
|
2354
|
-
get<K extends keyof _StorageType>(
|
|
2355
|
-
/**
|
|
2356
|
-
* Key to retrieve the value for
|
|
2357
|
-
*/
|
|
2358
|
-
key: K): Promise<_StorageType[K] | undefined>;
|
|
2359
|
-
/**
|
|
2360
|
-
* Checks if a value exists in the context memory
|
|
2361
|
-
*
|
|
2362
|
-
* @param key - memory key to check
|
|
2363
|
-
* @returns - true if key exists, false otherwise
|
|
2364
|
-
*/
|
|
2365
|
-
has(key: keyof _StorageType): Promise<boolean>;
|
|
2366
|
-
/**
|
|
2367
|
-
* Saves a value in the context memory
|
|
2368
|
-
*
|
|
2369
|
-
* @param key
|
|
2370
|
-
* @param value
|
|
2371
|
-
*/
|
|
2372
|
-
set<K extends keyof _StorageType>(
|
|
2373
|
-
/**
|
|
2374
|
-
* Key to save the value under
|
|
2375
|
-
*/
|
|
2376
|
-
key: K,
|
|
2377
|
-
/**
|
|
2378
|
-
* Value to save
|
|
2379
|
-
*/
|
|
2380
|
-
value: _StorageType[K]): Promise<void>;
|
|
2381
|
-
/**
|
|
2382
|
-
* Removes a value from the context memory by key
|
|
2383
|
-
*
|
|
2384
|
-
* @param key
|
|
2385
|
-
*/
|
|
2386
|
-
drop(key: keyof _StorageType): Promise<void>;
|
|
2387
|
-
/**
|
|
2388
|
-
* Clears all stored values in the context memory
|
|
2389
|
-
*/
|
|
2390
|
-
clear(): Promise<void>;
|
|
2391
|
-
/**
|
|
2392
|
-
* Serializes the memory context to a JSON object
|
|
2393
|
-
*
|
|
2394
|
-
* @returns - serialized memory object
|
|
2395
|
-
*/
|
|
2396
|
-
toJSON(): Promise<_SerializedType>;
|
|
2397
|
-
}
|
|
2398
|
-
|
|
2399
|
-
declare class A_MemoryError extends A_Error {
|
|
2400
|
-
static readonly MemoryInitializationError = "Memory initialization error";
|
|
2401
|
-
static readonly MemoryDestructionError = "Memory destruction error";
|
|
2402
|
-
static readonly MemoryGetError = "Memory GET operation failed";
|
|
2403
|
-
static readonly MemorySetError = "Memory SET operation failed";
|
|
2404
|
-
static readonly MemoryDropError = "Memory DROP operation failed";
|
|
2405
|
-
static readonly MemoryClearError = "Memory CLEAR operation failed";
|
|
2406
|
-
static readonly MemoryHasError = "Memory HAS operation failed";
|
|
2407
|
-
static readonly MemorySerializeError = "Memory toJSON operation failed";
|
|
2408
|
-
}
|
|
2409
|
-
|
|
2410
|
-
declare enum A_ServiceFeatures {
|
|
2411
|
-
onBeforeLoad = "_A_Service_onBeforeLoad",
|
|
2412
|
-
onLoad = "_A_Service_onLoad",
|
|
2413
|
-
onAfterLoad = "_A_Service_onAfterLoad",
|
|
2414
|
-
onBeforeStart = "_A_Service_onBeforeStart",
|
|
2415
|
-
onStart = "_A_Service_onStart",
|
|
2416
|
-
onAfterStart = "_A_Service_onAfterStart",
|
|
2417
|
-
onBeforeStop = "_A_Service_onBeforeStop",
|
|
2418
|
-
onStop = "_A_Service_onStop",
|
|
2419
|
-
onAfterStop = "_A_Service_onAfterStop",
|
|
2420
|
-
onError = "_A_Service_onError"
|
|
2421
|
-
}
|
|
2422
|
-
|
|
2423
|
-
/**
|
|
2424
|
-
* A-Service is a container that can run different types of services, such as HTTP servers, workers, etc.
|
|
2425
|
-
* Depending on the provided config and configuration, it will load the necessary components and start the service.
|
|
2426
|
-
*
|
|
2427
|
-
*/
|
|
2428
|
-
declare class A_Service extends A_Container {
|
|
2429
|
-
load(): Promise<void>;
|
|
2430
|
-
start(): Promise<void>;
|
|
2431
|
-
stop(): Promise<void>;
|
|
2432
|
-
protected [A_ServiceFeatures.onBeforeLoad](polyfill: A_Polyfill, ...args: any[]): Promise<void>;
|
|
2433
|
-
protected [A_ServiceFeatures.onLoad](...args: any[]): Promise<void>;
|
|
2434
|
-
protected [A_ServiceFeatures.onAfterLoad](...args: any[]): Promise<void>;
|
|
2435
|
-
protected [A_ServiceFeatures.onBeforeStart](...args: any[]): Promise<void>;
|
|
2436
|
-
protected [A_ServiceFeatures.onStart](...args: any[]): Promise<void>;
|
|
2437
|
-
protected [A_ServiceFeatures.onAfterStart](...args: any[]): Promise<void>;
|
|
2438
|
-
protected [A_ServiceFeatures.onBeforeStop](...args: any[]): Promise<void>;
|
|
2439
|
-
protected [A_ServiceFeatures.onStop](...args: any[]): Promise<void>;
|
|
2440
|
-
protected [A_ServiceFeatures.onAfterStop](...args: any[]): Promise<void>;
|
|
2441
|
-
protected [A_ServiceFeatures.onError](error: A_Error, logger?: A_Logger, ...args: any[]): Promise<void>;
|
|
2442
|
-
}
|
|
2443
|
-
|
|
2444
|
-
declare class A_Route<_TParams extends Record<string, any> = Record<string, any>, _TQuery extends Record<string, any> = Record<string, any>> extends A_Fragment {
|
|
2445
|
-
url: string;
|
|
2446
|
-
constructor(url: string | RegExp);
|
|
2447
|
-
/**
|
|
2448
|
-
* Returns path only without query and hash
|
|
2449
|
-
*/
|
|
2450
|
-
get path(): string;
|
|
2451
|
-
/**
|
|
2452
|
-
* Returns array of parameter names in the route path
|
|
2453
|
-
*/
|
|
2454
|
-
get params(): string[];
|
|
2455
|
-
/**
|
|
2456
|
-
* Returns protocol based on URL scheme
|
|
2457
|
-
*/
|
|
2458
|
-
get protocol(): string;
|
|
2459
|
-
extractParams(url: string): _TParams;
|
|
2460
|
-
extractQuery(url: string): _TQuery;
|
|
2461
|
-
toString(): string;
|
|
2462
|
-
toRegExp(): RegExp;
|
|
2463
|
-
toAFeatureExtension(extensionScope?: Array<string>): RegExp;
|
|
2464
|
-
}
|
|
2465
|
-
|
|
2466
|
-
type A_SignalConfig_Init<TSignals extends Array<A_Signal> = Array<A_Signal>> = {
|
|
2467
|
-
/**
|
|
2468
|
-
* An array defining the structure of the signal vector.
|
|
2469
|
-
*
|
|
2470
|
-
* Each entry corresponds to a signal component constructor.
|
|
2471
|
-
*/
|
|
2472
|
-
structure?: A_Signal_TSignalsConstructors<TSignals>;
|
|
2473
|
-
/**
|
|
2474
|
-
* A string representation of the structure for easier DI resolution.
|
|
2475
|
-
* Each signal's constructor name is used to form this string.
|
|
2476
|
-
* e.g. "['A_RouterWatcher', 'A_ScopeWatcher', 'A_LoggerWatcher']"
|
|
2477
|
-
* OR "A_RouterWatcher,A_ScopeWatcher,A_LoggerWatcher"
|
|
2478
|
-
*/
|
|
2479
|
-
stringStructure?: string;
|
|
2480
|
-
propagateSignals?: boolean;
|
|
2481
|
-
};
|
|
2482
|
-
type A_Signal_TSignalsConstructors<T extends Array<A_Signal> = Array<A_Signal>> = T extends Array<infer U> ? U extends A_Signal ? A_TYPES__Entity_Constructor<U>[] : never : never;
|
|
2483
|
-
type A_SignalTValue<T extends A_Signal> = T extends A_Signal<infer U> ? U : never;
|
|
2484
|
-
type A_SignalTValueArray<T extends Array<A_Signal>> = {
|
|
2485
|
-
[K in keyof T]: T[K] extends A_Signal<infer U> ? U : never;
|
|
2486
|
-
};
|
|
2487
|
-
type A_SignalVector_Init<_TSignals extends Array<A_Signal> = Array<A_Signal>> = {
|
|
2488
|
-
structure: A_Signal_TSignalsConstructors<_TSignals>;
|
|
2489
|
-
values: _TSignals;
|
|
2490
|
-
};
|
|
2491
|
-
type A_SignalVector_Serialized = A_TYPES__Entity_Serialized & {
|
|
2492
|
-
structure: string[];
|
|
2493
|
-
values: Array<Record<string, any>>;
|
|
2494
|
-
} & A_TYPES__Entity_Serialized;
|
|
2495
|
-
type A_Signal_Init<T extends Record<string, any> = Record<string, any>> = {
|
|
2496
|
-
/**
|
|
2497
|
-
* Possible signal id
|
|
2498
|
-
*
|
|
2499
|
-
* [!] used for identification only, all properties will be participating in the hash calculation for deduplication
|
|
2500
|
-
*/
|
|
2501
|
-
id?: Array<any>;
|
|
2502
|
-
/**
|
|
2503
|
-
* The signal name
|
|
2504
|
-
*/
|
|
2505
|
-
name?: string;
|
|
2506
|
-
/**
|
|
2507
|
-
* The signal data
|
|
2508
|
-
*/
|
|
2509
|
-
data: T;
|
|
2510
|
-
};
|
|
2511
|
-
type A_Signal_Serialized<T extends Record<string, any> = Record<string, any>> = {
|
|
2512
|
-
/**
|
|
2513
|
-
* The signal data
|
|
2514
|
-
*/
|
|
2515
|
-
data: T;
|
|
2516
|
-
} & A_TYPES__Entity_Serialized;
|
|
2517
|
-
|
|
2518
|
-
/**
|
|
2519
|
-
* A Signal Entity is an individual signal instance that carries data.
|
|
2520
|
-
* Signals is a event types that uses for vectors of signals to be used for further processing.
|
|
2521
|
-
*
|
|
2522
|
-
* Comparing to standard events, signals should be used in case when the event impacts some "state"
|
|
2523
|
-
* and the state should be used instead of the event itself.
|
|
2524
|
-
*
|
|
2525
|
-
* For example, a signal can represent the current status of a user (online/offline/away),
|
|
2526
|
-
* while an event would represent a single action (user logged in/logged out).
|
|
2527
|
-
*
|
|
2528
|
-
* Signals are typically used in scenarios where the current state is more important than individual events,
|
|
2529
|
-
* such as monitoring systems, real-time dashboards, or stateful applications.
|
|
2530
|
-
*/
|
|
2531
|
-
declare class A_Signal<_TSignalDataType extends Record<string, any> = Record<string, any>> extends A_Entity<A_Signal_Init<_TSignalDataType>, A_Signal_Serialized<_TSignalDataType>> {
|
|
2532
|
-
/**
|
|
2533
|
-
* Allows to define default data for the signal.
|
|
2534
|
-
*
|
|
2535
|
-
* If no data is provided during initialization, the default data will be used.
|
|
2536
|
-
*
|
|
2537
|
-
* @returns
|
|
2538
|
-
*/
|
|
2539
|
-
static default(): Promise<A_Signal | undefined>;
|
|
2540
|
-
/**
|
|
2541
|
-
* The actual data carried by the signal.
|
|
2542
|
-
*/
|
|
2543
|
-
data: _TSignalDataType;
|
|
2544
|
-
/**
|
|
2545
|
-
* Generates signal hash uses for comparison
|
|
2546
|
-
*
|
|
2547
|
-
* @param str
|
|
2548
|
-
*/
|
|
2549
|
-
protected createHash(str?: string): string;
|
|
2550
|
-
protected createHash(str?: undefined): string;
|
|
2551
|
-
protected createHash(str?: Record<string, any>): string;
|
|
2552
|
-
protected createHash(str?: Array<any>): string;
|
|
2553
|
-
protected createHash(str?: number): string;
|
|
2554
|
-
protected createHash(str?: boolean): string;
|
|
2555
|
-
protected createHash(str?: null): string;
|
|
2556
|
-
protected createHash(map?: Map<any, any>): string;
|
|
2557
|
-
protected createHash(set?: Set<any>): string;
|
|
2558
|
-
/**
|
|
2559
|
-
* This method compares the current signal with another signal instance by deduplication ID
|
|
2560
|
-
* this id can be configured during initialization with the "id" property.
|
|
2561
|
-
*
|
|
2562
|
-
* example:
|
|
2563
|
-
* * const signalA = new A_Signal({ id: ['user-status', 'user123'], data: { status: 'online' } });
|
|
2564
|
-
* * const signalB = new A_Signal({ id: ['user-status', 'user123'], data: { status: 'offline' } });
|
|
2565
|
-
*
|
|
2566
|
-
* signalA.compare(signalB) // true because both signals have the same deduplication ID
|
|
2567
|
-
*
|
|
2568
|
-
* @param other
|
|
2569
|
-
* @returns
|
|
2570
|
-
*/
|
|
2571
|
-
compare(other: A_Signal<_TSignalDataType>): boolean;
|
|
2572
|
-
fromJSON(serializedEntity: A_Signal_Serialized<_TSignalDataType>): void;
|
|
2573
|
-
fromNew(newEntity: A_Signal_Init<_TSignalDataType>): void;
|
|
2574
|
-
toJSON(): A_Signal_Serialized<_TSignalDataType>;
|
|
2575
|
-
}
|
|
2576
|
-
|
|
2577
|
-
/**
|
|
2578
|
-
* A Signal Vector Entity is a collection of signals structured in a specific way.
|
|
2579
|
-
* It allows grouping multiple signals together for batch processing or transmission.
|
|
2580
|
-
*
|
|
2581
|
-
* Signal Vectors are useful in scenarios where multiple related signals need to be handled together,
|
|
2582
|
-
* as a state of the system or a snapshot of various parameters at a given time.
|
|
2583
|
-
*
|
|
2584
|
-
* @template TSignalsConstructors - Array of signal constructor types (e.g., [typeof MySignal, typeof CustomSignal])
|
|
2585
|
-
* @template TSignals - Array of signal instances derived from constructors
|
|
2586
|
-
*/
|
|
2587
|
-
declare class A_SignalVector<TSignals extends A_Signal[] = A_Signal[]> extends A_Entity<A_SignalVector_Init<TSignals>> {
|
|
2588
|
-
/**
|
|
2589
|
-
* The structure of the signal vector, defining the types of signals it contains.
|
|
2590
|
-
*
|
|
2591
|
-
* For example:
|
|
2592
|
-
* [UserSignInSignal, UserStatusSignal, UserActivitySignal]
|
|
2593
|
-
*
|
|
2594
|
-
* [!] if not provided, it will be derived from the signals values.
|
|
2595
|
-
*/
|
|
2596
|
-
protected _structure?: A_Signal_TSignalsConstructors<TSignals>;
|
|
2597
|
-
/**
|
|
2598
|
-
* It's actual vector Values of Signals like :
|
|
2599
|
-
* [UserActionSignal, UserMousePositionSignal, ExternalDependencySignal]
|
|
2600
|
-
*/
|
|
2601
|
-
protected _signals: TSignals;
|
|
2602
|
-
constructor(values: TSignals, structure?: {
|
|
2603
|
-
[K in keyof TSignals]: TSignals[K] extends A_Signal ? A_TYPES__Entity_Constructor<TSignals[K]> : never;
|
|
2604
|
-
});
|
|
2605
|
-
constructor(serialized: A_SignalVector_Serialized);
|
|
2606
|
-
fromNew(newEntity: A_SignalVector_Init<TSignals>): void;
|
|
2607
|
-
/**
|
|
2608
|
-
* The structure of the signal vector, defining the types of signals it contains.
|
|
2609
|
-
*
|
|
2610
|
-
* For example:
|
|
2611
|
-
* [UserSignInSignal, UserStatusSignal, UserActivitySignal]
|
|
2612
|
-
*
|
|
2613
|
-
*/
|
|
2614
|
-
get structure(): A_Signal_TSignalsConstructors<TSignals>;
|
|
2615
|
-
get length(): number;
|
|
2616
|
-
/**
|
|
2617
|
-
* Enables iteration over the signals in the vector.
|
|
2618
|
-
*
|
|
2619
|
-
* @returns
|
|
2620
|
-
*/
|
|
2621
|
-
[Symbol.iterator](): Iterator<TSignals[number]>;
|
|
2622
|
-
/**
|
|
2623
|
-
* Allows to match the current Signal Vector with another Signal Vector by comparing each signal in the structure.
|
|
2624
|
-
* This method returns true if all signals in the vector match the corresponding signals in the other vector.
|
|
2625
|
-
*
|
|
2626
|
-
* @param other
|
|
2627
|
-
* @returns
|
|
2628
|
-
*/
|
|
2629
|
-
match(other: A_SignalVector<TSignals>): boolean;
|
|
2630
|
-
/**
|
|
2631
|
-
* This method should ensure that the current Signal Vector contains all signals from the provided Signal Vector.
|
|
2632
|
-
*
|
|
2633
|
-
* @param signal
|
|
2634
|
-
*/
|
|
2635
|
-
contains(signal: A_SignalVector): boolean;
|
|
2636
|
-
/**
|
|
2637
|
-
* Checks if the vector contains a signal of the specified type.
|
|
2638
|
-
*
|
|
2639
|
-
* @param signal
|
|
2640
|
-
*/
|
|
2641
|
-
has(signal: A_Signal): boolean;
|
|
2642
|
-
has(signalConstructor: A_TYPES__Entity_Constructor<A_Signal>): boolean;
|
|
2643
|
-
/**
|
|
2644
|
-
* Retrieves the signal of the specified type from the vector.
|
|
2645
|
-
*
|
|
2646
|
-
* @param signal
|
|
2647
|
-
*/
|
|
2648
|
-
get<T extends A_Signal>(signal: T): T | undefined;
|
|
2649
|
-
get<T extends A_Signal>(signalConstructor: A_TYPES__Entity_Constructor<T>): T | undefined;
|
|
2650
|
-
/**
|
|
2651
|
-
* Converts to Array of values of signals in the vector
|
|
2652
|
-
* Maintains the order specified in the structure/generic type
|
|
2653
|
-
*
|
|
2654
|
-
* @param structure - Optional structure to override the default ordering
|
|
2655
|
-
* @returns Array of signal instances in the specified order
|
|
2656
|
-
*/
|
|
2657
|
-
toVector<T extends Array<A_Signal> = TSignals>(structure?: A_Signal_TSignalsConstructors<T>): Promise<T>;
|
|
2658
|
-
/**
|
|
2659
|
-
* Converts to Array of data of signals in the vector
|
|
2660
|
-
* Maintains the order specified in the structure/generic type
|
|
2661
|
-
*
|
|
2662
|
-
* @param structure - Optional structure to override the default ordering
|
|
2663
|
-
* @returns Array of serialized signal data in the specified order
|
|
2664
|
-
*/
|
|
2665
|
-
toDataVector<T extends A_Signal[] = TSignals>(structure?: A_Signal_TSignalsConstructors<T>): Promise<A_SignalTValueArray<T>>;
|
|
2666
|
-
/**
|
|
2667
|
-
* Converts to Object with signal constructor names as keys and their corresponding data values
|
|
2668
|
-
* Uses the structure ordering to ensure consistent key ordering
|
|
2669
|
-
*
|
|
2670
|
-
* @returns Object with signal constructor names as keys and signal data as values
|
|
2671
|
-
*/
|
|
2672
|
-
toObject<T extends Array<A_Signal> = TSignals>(structure?: {
|
|
2673
|
-
[K in keyof T]: T[K] extends A_Signal ? A_TYPES__Entity_Constructor<T[K]> : never;
|
|
2674
|
-
}): Promise<{
|
|
2675
|
-
[key: string]: T[number] extends A_Signal<infer D> ? D | undefined : never;
|
|
2676
|
-
}>;
|
|
2677
|
-
/**
|
|
2678
|
-
* Serializes the Signal Vector to a JSON-compatible format.
|
|
2679
|
-
*
|
|
2680
|
-
*
|
|
2681
|
-
* @returns
|
|
2682
|
-
*/
|
|
2683
|
-
toJSON(): A_SignalVector_Serialized;
|
|
2684
|
-
}
|
|
2685
|
-
|
|
2686
|
-
/**
|
|
2687
|
-
* A_SignalState manages the latest state of all signals within a given scope.
|
|
2688
|
-
*
|
|
2689
|
-
* This class maintains a mapping between signal constructors and their most recently emitted values,
|
|
2690
|
-
* providing a centralized state store for signal management within an application context.
|
|
2691
|
-
*
|
|
2692
|
-
* @template TSignalData - Union type of all possible signal data types that can be stored (must extend Record<string, any>)
|
|
2693
|
-
*
|
|
2694
|
-
* The generic ensures type safety by maintaining correspondence between:
|
|
2695
|
-
* - Signal constructor types and their data types
|
|
2696
|
-
* - Signal instances and their emitted value types
|
|
2697
|
-
* - Vector structure and the data it contains
|
|
2698
|
-
*/
|
|
2699
|
-
declare class A_SignalState<TSignalData extends Record<string, any> = Record<string, any>> extends A_Fragment {
|
|
2700
|
-
/**
|
|
2701
|
-
* Internal map storing the relationship between signal constructors and their latest values
|
|
2702
|
-
* Key: Signal constructor function
|
|
2703
|
-
* Value: Latest emitted data from that signal type
|
|
2704
|
-
*/
|
|
2705
|
-
protected _state: Map<A_TYPES__Component_Constructor<A_Signal>, A_Signal>;
|
|
2706
|
-
/**
|
|
2707
|
-
* Previous state map to track changes between signal emissions
|
|
2708
|
-
* Key: Signal constructor function
|
|
2709
|
-
* Value: Previous emitted data from that signal type
|
|
2710
|
-
*/
|
|
2711
|
-
protected _prevState: Map<A_TYPES__Component_Constructor<A_Signal>, A_Signal>;
|
|
2712
|
-
/**
|
|
2713
|
-
* Optional structure defining the ordered list of signal constructors
|
|
2714
|
-
* Used for vector operations and initialization
|
|
2715
|
-
*/
|
|
2716
|
-
protected _structure: Array<A_TYPES__Component_Constructor<A_Signal>>;
|
|
2717
|
-
/**
|
|
2718
|
-
* Gets the ordered structure of signal constructors
|
|
2719
|
-
* @returns Array of signal constructors in their defined order
|
|
2720
|
-
*/
|
|
2721
|
-
get structure(): Array<A_TYPES__Component_Constructor<A_Signal>>;
|
|
2722
|
-
/**
|
|
2723
|
-
* Creates a new A_SignalState instance
|
|
2724
|
-
*
|
|
2725
|
-
* @param structure - Optional array defining the ordered structure of signal constructors
|
|
2726
|
-
* This structure is used for vector operations and determines the order
|
|
2727
|
-
* in which signals are processed and serialized
|
|
2728
|
-
*/
|
|
2729
|
-
constructor(structure: A_TYPES__Component_Constructor<A_Signal>[]);
|
|
2730
|
-
/**
|
|
2731
|
-
* Sets the latest value for a specific signal type
|
|
2732
|
-
*
|
|
2733
|
-
* @param signal - The signal constructor to associate the value with
|
|
2734
|
-
* @param value - The data value emitted by the signal
|
|
2735
|
-
*/
|
|
2736
|
-
set(signal: A_Signal, value: A_Signal): void;
|
|
2737
|
-
set(signal: A_Signal): void;
|
|
2738
|
-
set(signal: A_TYPES__Component_Constructor<A_Signal>, value: A_Signal): void;
|
|
2739
|
-
/**
|
|
2740
|
-
* Retrieves the latest value for a specific signal type
|
|
2741
|
-
*
|
|
2742
|
-
* @param signal - The signal constructor to get the value for
|
|
2743
|
-
* @returns The latest data value or undefined if no value has been set
|
|
2744
|
-
*/
|
|
2745
|
-
get(signal: A_Signal): A_Signal | undefined;
|
|
2746
|
-
get(signal: A_TYPES__Component_Constructor<A_Signal>): A_Signal | undefined;
|
|
2747
|
-
/**
|
|
2748
|
-
* Retrieves the previous value for a specific signal type
|
|
2749
|
-
*
|
|
2750
|
-
* @param signal
|
|
2751
|
-
*/
|
|
2752
|
-
getPrev(signal: A_Signal): A_Signal | undefined;
|
|
2753
|
-
getPrev(signal: A_TYPES__Component_Constructor<A_Signal>): A_Signal | undefined;
|
|
2754
|
-
/**
|
|
2755
|
-
* Checks if a signal type has been registered in the state
|
|
2756
|
-
*
|
|
2757
|
-
* @param signal - The signal constructor to check for
|
|
2758
|
-
* @returns True if the signal type exists in the state map
|
|
2759
|
-
*/
|
|
2760
|
-
has(signal: A_Signal): boolean;
|
|
2761
|
-
has(signal: A_TYPES__Component_Constructor<A_Signal>): boolean;
|
|
2762
|
-
/**
|
|
2763
|
-
* Removes a signal type and its associated value from the state
|
|
2764
|
-
*
|
|
2765
|
-
* @param signal - The signal constructor to remove
|
|
2766
|
-
* @returns True if the signal was successfully deleted, false if it didn't exist
|
|
2767
|
-
*/
|
|
2768
|
-
delete(signal: A_Signal): boolean;
|
|
2769
|
-
delete(signal: A_TYPES__Component_Constructor<A_Signal>): boolean;
|
|
2770
|
-
/**
|
|
2771
|
-
* Converts the current state to a vector (ordered array) format
|
|
2772
|
-
*
|
|
2773
|
-
* The order is determined by the structure array provided during construction.
|
|
2774
|
-
* Each position in the vector corresponds to a specific signal type's latest value.
|
|
2775
|
-
*
|
|
2776
|
-
* @returns Array of signal values in the order defined by the structure
|
|
2777
|
-
* @throws Error if structure is not defined or if any signal value is undefined
|
|
2778
|
-
*/
|
|
2779
|
-
toVector(): A_SignalVector;
|
|
2780
|
-
/**
|
|
2781
|
-
* Converts the current state to an object with signal constructor names as keys
|
|
2782
|
-
*
|
|
2783
|
-
* This provides a more readable representation of the state where each signal
|
|
2784
|
-
* type is identified by its constructor name.
|
|
2785
|
-
*
|
|
2786
|
-
* @returns Object mapping signal constructor names to their latest values
|
|
2787
|
-
* @throws Error if any signal value is undefined
|
|
2788
|
-
*/
|
|
2789
|
-
toObject(): Record<string, A_Signal>;
|
|
2790
|
-
}
|
|
2791
|
-
|
|
2792
|
-
/**
|
|
2793
|
-
* This component should dictate a structure of the vector for all signals within a given scope.
|
|
2794
|
-
* so if there're multiple signals it should say what type at what position should be expected.
|
|
2795
|
-
*
|
|
2796
|
-
* e.g. [A_RouterWatcher, A_ScopeWatcher, A_LoggerWatcher]
|
|
2797
|
-
* This structure then should be used for any further processing of signals within the scope.
|
|
2798
|
-
*/
|
|
2799
|
-
declare class A_SignalConfig extends A_Fragment {
|
|
2800
|
-
protected _structure?: Array<A_TYPES__Entity_Constructor<A_Signal>>;
|
|
2801
|
-
protected _config: A_SignalConfig_Init;
|
|
2802
|
-
protected _ready?: Promise<void>;
|
|
2803
|
-
get structure(): Array<A_TYPES__Entity_Constructor<A_Signal>>;
|
|
2804
|
-
/**
|
|
2805
|
-
* Uses for synchronization to ensure the config is initialized.
|
|
2806
|
-
*
|
|
2807
|
-
* @returns True if the configuration has been initialized.
|
|
2808
|
-
*/
|
|
2809
|
-
get ready(): Promise<void> | undefined;
|
|
2810
|
-
constructor(params: A_SignalConfig_Init);
|
|
2811
|
-
/**
|
|
2812
|
-
* Initializes the signal configuration if not already initialized.
|
|
2813
|
-
*
|
|
2814
|
-
* @returns
|
|
2815
|
-
*/
|
|
2816
|
-
initialize(): Promise<void>;
|
|
2817
|
-
/**
|
|
2818
|
-
* Initializes the signal configuration by processing the provided structure or string representation.
|
|
2819
|
-
* This method sets up the internal structure of signal constructors based on the configuration.
|
|
2820
|
-
*/
|
|
2821
|
-
protected _initialize(): Promise<void>;
|
|
2822
|
-
}
|
|
2823
|
-
|
|
2824
|
-
declare enum A_SignalBusFeatures {
|
|
2825
|
-
onBeforeNext = "_A_SignalBusFeatures_onBeforeNext",
|
|
2826
|
-
onNext = "_A_SignalBusFeatures_onNext",
|
|
2827
|
-
onError = "_A_SignalBusFeatures_onError"
|
|
2828
|
-
}
|
|
2829
|
-
|
|
2830
|
-
/**
|
|
2831
|
-
* This component should listen for all available signal watchers components in this and all parent scopes.
|
|
2832
|
-
* When a signal is emitted, it should forward the signal to all registered watchers.
|
|
2833
|
-
*
|
|
2834
|
-
* A_SignalBus should always return the same vector structure of the signals, and that's why it should store the state of the latest behavior.
|
|
2835
|
-
* For example if there are 3 watchers registered, the bus should always return a vector of 3 elements, based on the A_SignalConfig structure.
|
|
2836
|
-
*
|
|
2837
|
-
*
|
|
2838
|
-
* The component itself is stateless and all methods uses only parameters (context) is provided with.
|
|
2839
|
-
*/
|
|
2840
|
-
declare class A_SignalBus extends A_Component {
|
|
2841
|
-
next(...signals: A_Signal[]): Promise<void>;
|
|
2842
|
-
protected [A_SignalBusFeatures.onError](error: A_Error, logger?: A_Logger, ...args: any[]): Promise<void>;
|
|
2843
|
-
[A_SignalBusFeatures.onBeforeNext](scope: A_Scope, globalConfig?: A_Config<['A_SIGNAL_VECTOR_STRUCTURE']>, state?: A_SignalState, logger?: A_Logger, config?: A_SignalConfig): Promise<void>;
|
|
2844
|
-
/**
|
|
2845
|
-
* This methods extends A-Signal Emit feature to handle signal emission within the bus.
|
|
2846
|
-
*
|
|
2847
|
-
* It updates the signal state and emits the updated signal vector.
|
|
2848
|
-
*
|
|
2849
|
-
* @param signal
|
|
2850
|
-
* @param globalConfig
|
|
2851
|
-
* @param logger
|
|
2852
|
-
* @param state
|
|
2853
|
-
* @param config
|
|
2854
|
-
* @returns
|
|
2855
|
-
*/
|
|
2856
|
-
[A_SignalBusFeatures.onNext](signals: A_Signal[], scope: A_Scope, state: A_SignalState, globalConfig?: A_Config<['A_SIGNAL_VECTOR_STRUCTURE']>, logger?: A_Logger, config?: A_SignalConfig): Promise<void>;
|
|
2857
|
-
}
|
|
2858
|
-
|
|
2859
|
-
declare class A_SignalBusError extends A_Error {
|
|
2860
|
-
static readonly SignalProcessingError = "Signal processing error";
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2863
|
-
type A_UTILS_TYPES__ScheduleObjectConfig = {
|
|
2864
|
-
/**
|
|
2865
|
-
* If the timeout is cleared, should the promise resolve or reject?
|
|
2866
|
-
* BY Default it rejects
|
|
2867
|
-
*
|
|
2868
|
-
* !!!NOTE: If the property is set to true, the promise will resolve with undefined
|
|
2869
|
-
*/
|
|
2870
|
-
resolveOnClear: boolean;
|
|
2871
|
-
};
|
|
2872
|
-
type A_UTILS_TYPES__ScheduleObjectCallback<T> = () => Promise<T>;
|
|
2873
|
-
|
|
2874
|
-
declare class A_ScheduleObject<T extends any = any> {
|
|
2875
|
-
private timeout;
|
|
2876
|
-
private deferred;
|
|
2877
|
-
private config;
|
|
2878
|
-
/**
|
|
2879
|
-
* Creates a scheduled object that will execute the action after specified milliseconds
|
|
2880
|
-
*
|
|
2881
|
-
*
|
|
2882
|
-
* @param ms - milliseconds to wait before executing the action
|
|
2883
|
-
* @param action - the action to execute
|
|
2884
|
-
* @param config - configuration options for the schedule object
|
|
2885
|
-
*/
|
|
2886
|
-
constructor(
|
|
2887
|
-
/**
|
|
2888
|
-
* Milliseconds to wait before executing the action
|
|
2889
|
-
*/
|
|
2890
|
-
ms: number,
|
|
2891
|
-
/**
|
|
2892
|
-
* The action to execute after the specified milliseconds
|
|
2893
|
-
*/
|
|
2894
|
-
action: A_UTILS_TYPES__ScheduleObjectCallback<T>,
|
|
2895
|
-
/**
|
|
2896
|
-
* Configuration options for the schedule object
|
|
2897
|
-
*/
|
|
2898
|
-
config?: A_UTILS_TYPES__ScheduleObjectConfig);
|
|
2899
|
-
get promise(): Promise<T>;
|
|
2900
|
-
clear(): void;
|
|
2901
|
-
}
|
|
2902
|
-
|
|
2903
|
-
declare class A_Schedule extends A_Component {
|
|
2904
|
-
/**
|
|
2905
|
-
* Allows to schedule a callback for particular time in the future
|
|
2906
|
-
*
|
|
2907
|
-
* @param timestamp - Unix timestamp in milliseconds
|
|
2908
|
-
* @param callback - The callback to execute
|
|
2909
|
-
* @returns A promise that resolves to the schedule object
|
|
2910
|
-
*/
|
|
2911
|
-
schedule<T extends any = any>(
|
|
2912
|
-
/**
|
|
2913
|
-
* Unix timestamp in milliseconds
|
|
2914
|
-
*/
|
|
2915
|
-
timestamp: number,
|
|
2916
|
-
/**
|
|
2917
|
-
* The callback to execute
|
|
2918
|
-
*/
|
|
2919
|
-
callback: A_UTILS_TYPES__ScheduleObjectCallback<T>,
|
|
2920
|
-
/**
|
|
2921
|
-
* Configuration options for the schedule object
|
|
2922
|
-
*/
|
|
2923
|
-
config?: A_UTILS_TYPES__ScheduleObjectConfig): Promise<A_ScheduleObject<T>>;
|
|
2924
|
-
schedule<T extends any = any>(
|
|
2925
|
-
/**
|
|
2926
|
-
* ISO date string representing the date and time to schedule the callback for
|
|
2927
|
-
*/
|
|
2928
|
-
date: string,
|
|
2929
|
-
/**
|
|
2930
|
-
* The callback to execute
|
|
2931
|
-
*/
|
|
2932
|
-
callback: A_UTILS_TYPES__ScheduleObjectCallback<T>,
|
|
2933
|
-
/**
|
|
2934
|
-
* Configuration options for the schedule object
|
|
2935
|
-
*/
|
|
2936
|
-
config?: A_UTILS_TYPES__ScheduleObjectConfig): Promise<A_ScheduleObject<T>>;
|
|
2937
|
-
/**
|
|
2938
|
-
* Allows to execute callback after particular delay in milliseconds
|
|
2939
|
-
* So the callback will be executed after the specified delay
|
|
2940
|
-
*
|
|
2941
|
-
* @param ms
|
|
2942
|
-
*/
|
|
2943
|
-
delay<T extends any = any>(
|
|
2944
|
-
/**
|
|
2945
|
-
* Delay in milliseconds
|
|
2946
|
-
*/
|
|
2947
|
-
ms: number,
|
|
2948
|
-
/**
|
|
2949
|
-
* The callback to execute after the delay
|
|
2950
|
-
*/
|
|
2951
|
-
callback: A_UTILS_TYPES__ScheduleObjectCallback<T>,
|
|
2952
|
-
/**
|
|
2953
|
-
* Configuration options for the schedule object
|
|
2954
|
-
*/
|
|
2955
|
-
config?: A_UTILS_TYPES__ScheduleObjectConfig): Promise<A_ScheduleObject<T>>;
|
|
2956
|
-
}
|
|
2957
|
-
|
|
2958
|
-
declare class A_Deferred<T> {
|
|
2959
|
-
promise: Promise<T>;
|
|
2960
|
-
private resolveFn;
|
|
2961
|
-
private rejectFn;
|
|
2962
|
-
/**
|
|
2963
|
-
* Creates a deferred promise
|
|
2964
|
-
* @returns A promise that can be resolved or rejected later
|
|
2965
|
-
*/
|
|
2966
|
-
constructor();
|
|
2967
|
-
resolve(value: T | PromiseLike<T>): void;
|
|
2968
|
-
reject(reason?: any): void;
|
|
2969
|
-
}
|
|
2970
|
-
|
|
2971
|
-
declare class A_StateMachineError extends A_Error {
|
|
2972
|
-
static readonly InitializationError = "A-StateMachine Initialization Error";
|
|
2973
|
-
static readonly TransitionError = "A-StateMachine Transition Error";
|
|
2974
|
-
}
|
|
2975
|
-
|
|
2976
|
-
export { A_CONSTANTS__CONFIG_ENV_VARIABLES, A_CONSTANTS__CONFIG_ENV_VARIABLES_ARRAY, A_Channel, A_ChannelError, A_ChannelFeatures, A_ChannelRequest, A_ChannelRequestStatuses, A_Command, A_CommandError, A_CommandEvent, type A_CommandEvents, A_CommandFeatures, A_CommandTransitions, type A_Command_ExecutionContext, A_Command_Status, A_Config, A_ConfigError, A_ConfigLoader, A_Deferred, A_ExecutionContext, A_LOGGER_ANSI, A_LOGGER_COLORS, A_LOGGER_DEFAULT_LEVEL, A_LOGGER_DEFAULT_SCOPE_LENGTH, A_LOGGER_ENV_KEYS, A_LOGGER_FORMAT, A_LOGGER_SAFE_RANDOM_COLORS, A_LOGGER_TERMINAL, A_LOGGER_TIME_FORMAT, A_Logger, type A_LoggerColorName, A_LoggerEnvVariables, A_LoggerEnvVariablesArray, type A_LoggerEnvVariablesType, type A_LoggerLevel, A_Manifest, A_ManifestChecker, A_ManifestError, A_Memory, A_MemoryContext, type A_MemoryContextMeta, A_MemoryError, A_MemoryFeatures, type A_MemoryOperationContext, type A_MemoryOperationContextMeta, type A_MemoryOperations, type A_Memory_Storage, A_OperationContext, type A_Operation_Serialized, type A_Operation_Storage, A_Polyfill, A_Route, A_Schedule, A_ScheduleObject, A_Service, A_ServiceFeatures, A_Signal, A_SignalBus, A_SignalBusError, A_SignalBusFeatures, A_SignalConfig, type A_SignalConfig_Init, A_SignalState, type A_SignalTValue, type A_SignalTValueArray, A_SignalVector, type A_SignalVector_Init, type A_SignalVector_Serialized, type A_Signal_Init, type A_Signal_Serialized, type A_Signal_TSignalsConstructors, A_StateMachine, A_StateMachineError, A_StateMachineFeatures, A_StateMachineTransition, type A_StateMachineTransitionParams, type A_StateMachineTransitionStorage, type A_TYPES__Command_Constructor, type A_TYPES__Command_Init, type A_TYPES__Command_Listener, type A_TYPES__Command_Serialized, type A_TYPES__ConfigContainerConstructor, type A_TYPES__ConfigENVVariables, A_TYPES__ConfigFeature, type A_UTILS_TYPES__ManifestQuery, type A_UTILS_TYPES__ManifestRule, type A_UTILS_TYPES__Manifest_AllowedComponents, type A_UTILS_TYPES__Manifest_ComponentLevelConfig, type A_UTILS_TYPES__Manifest_Init, type A_UTILS_TYPES__Manifest_MethodLevelConfig, type A_UTILS_TYPES__Manifest_Rules, type A_UTILS_TYPES__ScheduleObjectCallback, type A_UTILS_TYPES__ScheduleObjectConfig, ConfigReader, ENVConfigReader, FileConfigReader, type IbufferInterface, type IcryptoInterface, type Ifspolyfill, type IhttpInterface, type IhttpsInterface, type IpathInterface, type IprocessInterface, type IurlInterface };
|