@celljs/core 3.0.0
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/LICENSE +21 -0
- package/README.md +1 -0
- package/cell-remote.yml +3 -0
- package/cell.yml +15 -0
- package/lib/browser/application/frontend-application-state.d.ts +5 -0
- package/lib/browser/application/frontend-application-state.d.ts.map +1 -0
- package/lib/browser/application/frontend-application-state.js +17 -0
- package/lib/browser/application/frontend-application-state.js.map +1 -0
- package/lib/browser/application/frontend-application.d.ts +31 -0
- package/lib/browser/application/frontend-application.d.ts.map +1 -0
- package/lib/browser/application/frontend-application.js +145 -0
- package/lib/browser/application/frontend-application.js.map +1 -0
- package/lib/browser/application/index.d.ts +3 -0
- package/lib/browser/application/index.d.ts.map +1 -0
- package/lib/browser/application/index.js +19 -0
- package/lib/browser/application/index.js.map +1 -0
- package/lib/browser/browser.d.ts +23 -0
- package/lib/browser/browser.d.ts.map +1 -0
- package/lib/browser/browser.js +53 -0
- package/lib/browser/browser.js.map +1 -0
- package/lib/browser/index.d.ts +4 -0
- package/lib/browser/index.d.ts.map +1 -0
- package/lib/browser/index.js +20 -0
- package/lib/browser/index.js.map +1 -0
- package/lib/browser/shell/application-shell.d.ts +5 -0
- package/lib/browser/shell/application-shell.d.ts.map +1 -0
- package/lib/browser/shell/application-shell.js +21 -0
- package/lib/browser/shell/application-shell.js.map +1 -0
- package/lib/browser/shell/index.d.ts +3 -0
- package/lib/browser/shell/index.d.ts.map +1 -0
- package/lib/browser/shell/index.js +19 -0
- package/lib/browser/shell/index.js.map +1 -0
- package/lib/browser/shell/shell-protocol.d.ts +5 -0
- package/lib/browser/shell/shell-protocol.d.ts.map +1 -0
- package/lib/browser/shell/shell-protocol.js +5 -0
- package/lib/browser/shell/shell-protocol.js.map +1 -0
- package/lib/browser/static-module.d.ts +4 -0
- package/lib/browser/static-module.d.ts.map +1 -0
- package/lib/browser/static-module.js +6 -0
- package/lib/browser/static-module.js.map +1 -0
- package/lib/common/annotation/aspect.d.ts +8 -0
- package/lib/common/annotation/aspect.d.ts.map +1 -0
- package/lib/common/annotation/aspect.js +14 -0
- package/lib/common/annotation/aspect.js.map +1 -0
- package/lib/common/annotation/autowired-provider.d.ts +8 -0
- package/lib/common/annotation/autowired-provider.d.ts.map +1 -0
- package/lib/common/annotation/autowired-provider.js +31 -0
- package/lib/common/annotation/autowired-provider.js.map +1 -0
- package/lib/common/annotation/autowired.d.ts +23 -0
- package/lib/common/annotation/autowired.d.ts.map +1 -0
- package/lib/common/annotation/autowired.js +55 -0
- package/lib/common/annotation/autowired.js.map +1 -0
- package/lib/common/annotation/component.d.ts +58 -0
- package/lib/common/annotation/component.d.ts.map +1 -0
- package/lib/common/annotation/component.js +71 -0
- package/lib/common/annotation/component.js.map +1 -0
- package/lib/common/annotation/constant.d.ts +9 -0
- package/lib/common/annotation/constant.d.ts.map +1 -0
- package/lib/common/annotation/constant.js +17 -0
- package/lib/common/annotation/constant.js.map +1 -0
- package/lib/common/annotation/decorate.d.ts +2 -0
- package/lib/common/annotation/decorate.d.ts.map +1 -0
- package/lib/common/annotation/decorate.js +6 -0
- package/lib/common/annotation/decorate.js.map +1 -0
- package/lib/common/annotation/detached/autowired-provider.d.ts +3 -0
- package/lib/common/annotation/detached/autowired-provider.d.ts.map +1 -0
- package/lib/common/annotation/detached/autowired-provider.js +16 -0
- package/lib/common/annotation/detached/autowired-provider.js.map +1 -0
- package/lib/common/annotation/detached/autowired.d.ts +3 -0
- package/lib/common/annotation/detached/autowired.d.ts.map +1 -0
- package/lib/common/annotation/detached/autowired.js +13 -0
- package/lib/common/annotation/detached/autowired.js.map +1 -0
- package/lib/common/annotation/detached/index.d.ts +4 -0
- package/lib/common/annotation/detached/index.d.ts.map +1 -0
- package/lib/common/annotation/detached/index.js +20 -0
- package/lib/common/annotation/detached/index.js.map +1 -0
- package/lib/common/annotation/detached/value.d.ts +3 -0
- package/lib/common/annotation/detached/value.d.ts.map +1 -0
- package/lib/common/annotation/detached/value.js +13 -0
- package/lib/common/annotation/detached/value.js.map +1 -0
- package/lib/common/annotation/index.d.ts +18 -0
- package/lib/common/annotation/index.d.ts.map +1 -0
- package/lib/common/annotation/index.js +34 -0
- package/lib/common/annotation/index.js.map +1 -0
- package/lib/common/annotation/inject.d.ts +2 -0
- package/lib/common/annotation/inject.d.ts.map +1 -0
- package/lib/common/annotation/inject.js +6 -0
- package/lib/common/annotation/inject.js.map +1 -0
- package/lib/common/annotation/injectable.d.ts +2 -0
- package/lib/common/annotation/injectable.d.ts.map +1 -0
- package/lib/common/annotation/injectable.js +6 -0
- package/lib/common/annotation/injectable.js.map +1 -0
- package/lib/common/annotation/named.d.ts +2 -0
- package/lib/common/annotation/named.d.ts.map +1 -0
- package/lib/common/annotation/named.js +6 -0
- package/lib/common/annotation/named.js.map +1 -0
- package/lib/common/annotation/optional.d.ts +2 -0
- package/lib/common/annotation/optional.d.ts.map +1 -0
- package/lib/common/annotation/optional.js +6 -0
- package/lib/common/annotation/optional.js.map +1 -0
- package/lib/common/annotation/post-construct.d.ts +2 -0
- package/lib/common/annotation/post-construct.d.ts.map +1 -0
- package/lib/common/annotation/post-construct.js +6 -0
- package/lib/common/annotation/post-construct.js.map +1 -0
- package/lib/common/annotation/pre-destroy.d.ts +2 -0
- package/lib/common/annotation/pre-destroy.d.ts.map +1 -0
- package/lib/common/annotation/pre-destroy.js +6 -0
- package/lib/common/annotation/pre-destroy.js.map +1 -0
- package/lib/common/annotation/service.d.ts +5 -0
- package/lib/common/annotation/service.d.ts.map +1 -0
- package/lib/common/annotation/service.js +18 -0
- package/lib/common/annotation/service.js.map +1 -0
- package/lib/common/annotation/tagged.d.ts +2 -0
- package/lib/common/annotation/tagged.d.ts.map +1 -0
- package/lib/common/annotation/tagged.js +6 -0
- package/lib/common/annotation/tagged.js.map +1 -0
- package/lib/common/annotation/target-name.d.ts +2 -0
- package/lib/common/annotation/target-name.d.ts.map +1 -0
- package/lib/common/annotation/target-name.js +6 -0
- package/lib/common/annotation/target-name.js.map +1 -0
- package/lib/common/annotation/unmanaged.d.ts +2 -0
- package/lib/common/annotation/unmanaged.d.ts.map +1 -0
- package/lib/common/annotation/unmanaged.js +6 -0
- package/lib/common/annotation/unmanaged.js.map +1 -0
- package/lib/common/annotation/value.d.ts +16 -0
- package/lib/common/annotation/value.d.ts.map +1 -0
- package/lib/common/annotation/value.js +58 -0
- package/lib/common/annotation/value.js.map +1 -0
- package/lib/common/aop/aop-protocol.d.ts +41 -0
- package/lib/common/aop/aop-protocol.d.ts.map +1 -0
- package/lib/common/aop/aop-protocol.js +11 -0
- package/lib/common/aop/aop-protocol.js.map +1 -0
- package/lib/common/aop/aop-proxy-factory.d.ts +7 -0
- package/lib/common/aop/aop-proxy-factory.d.ts.map +1 -0
- package/lib/common/aop/aop-proxy-factory.js +70 -0
- package/lib/common/aop/aop-proxy-factory.js.map +1 -0
- package/lib/common/aop/class-filter.d.ts +7 -0
- package/lib/common/aop/class-filter.d.ts.map +1 -0
- package/lib/common/aop/class-filter.js +31 -0
- package/lib/common/aop/class-filter.js.map +1 -0
- package/lib/common/aop/index.d.ts +4 -0
- package/lib/common/aop/index.d.ts.map +1 -0
- package/lib/common/aop/index.js +20 -0
- package/lib/common/aop/index.js.map +1 -0
- package/lib/common/application/application-entry.d.ts +2 -0
- package/lib/common/application/application-entry.d.ts.map +1 -0
- package/lib/common/application/application-entry.js +16 -0
- package/lib/common/application/application-entry.js.map +1 -0
- package/lib/common/application/application-error.d.ts +21 -0
- package/lib/common/application/application-error.d.ts.map +1 -0
- package/lib/common/application/application-error.js +47 -0
- package/lib/common/application/application-error.js.map +1 -0
- package/lib/common/application/application-factory.d.ts +8 -0
- package/lib/common/application/application-factory.d.ts.map +1 -0
- package/lib/common/application/application-factory.js +23 -0
- package/lib/common/application/application-factory.js.map +1 -0
- package/lib/common/application/application-protocol.d.ts +54 -0
- package/lib/common/application/application-protocol.d.ts.map +1 -0
- package/lib/common/application/application-protocol.js +108 -0
- package/lib/common/application/application-protocol.js.map +1 -0
- package/lib/common/application/application-state.d.ts +4 -0
- package/lib/common/application/application-state.d.ts.map +1 -0
- package/lib/common/application/application-state.js +18 -0
- package/lib/common/application/application-state.js.map +1 -0
- package/lib/common/application/application.d.ts +7 -0
- package/lib/common/application/application.d.ts.map +1 -0
- package/lib/common/application/application.js +34 -0
- package/lib/common/application/application.js.map +1 -0
- package/lib/common/application/index.d.ts +3 -0
- package/lib/common/application/index.d.ts.map +1 -0
- package/lib/common/application/index.js +19 -0
- package/lib/common/application/index.js.map +1 -0
- package/lib/common/config/config-protocol.d.ts +5 -0
- package/lib/common/config/config-protocol.d.ts.map +1 -0
- package/lib/common/config/config-protocol.js +5 -0
- package/lib/common/config/config-protocol.js.map +1 -0
- package/lib/common/config/config-provider.d.ts +7 -0
- package/lib/common/config/config-provider.d.ts.map +1 -0
- package/lib/common/config/config-provider.js +29 -0
- package/lib/common/config/config-provider.js.map +1 -0
- package/lib/common/config/config-util.d.ts +5 -0
- package/lib/common/config/config-util.d.ts.map +1 -0
- package/lib/common/config/config-util.js +19 -0
- package/lib/common/config/config-util.js.map +1 -0
- package/lib/common/config/dynamic-config.d.ts +4 -0
- package/lib/common/config/dynamic-config.d.ts.map +1 -0
- package/lib/common/config/dynamic-config.js +6 -0
- package/lib/common/config/dynamic-config.js.map +1 -0
- package/lib/common/config/index.d.ts +4 -0
- package/lib/common/config/index.d.ts.map +1 -0
- package/lib/common/config/index.js +20 -0
- package/lib/common/config/index.js.map +1 -0
- package/lib/common/constants.d.ts +6 -0
- package/lib/common/constants.d.ts.map +1 -0
- package/lib/common/constants.js +9 -0
- package/lib/common/constants.js.map +1 -0
- package/lib/common/container/auto-bind.d.ts +4 -0
- package/lib/common/container/auto-bind.d.ts.map +1 -0
- package/lib/common/container/auto-bind.js +103 -0
- package/lib/common/container/auto-bind.js.map +1 -0
- package/lib/common/container/container-factory.d.ts +5 -0
- package/lib/common/container/container-factory.d.ts.map +1 -0
- package/lib/common/container/container-factory.js +13 -0
- package/lib/common/container/container-factory.js.map +1 -0
- package/lib/common/container/container-provider.d.ts +7 -0
- package/lib/common/container/container-provider.d.ts.map +1 -0
- package/lib/common/container/container-provider.js +26 -0
- package/lib/common/container/container-provider.js.map +1 -0
- package/lib/common/container/container-util.d.ts +10 -0
- package/lib/common/container/container-util.d.ts.map +1 -0
- package/lib/common/container/container-util.js +32 -0
- package/lib/common/container/container-util.js.map +1 -0
- package/lib/common/container/dynamic-container.d.ts +3 -0
- package/lib/common/container/dynamic-container.d.ts.map +1 -0
- package/lib/common/container/dynamic-container.js +7 -0
- package/lib/common/container/dynamic-container.js.map +1 -0
- package/lib/common/container/index.d.ts +9 -0
- package/lib/common/container/index.d.ts.map +1 -0
- package/lib/common/container/index.js +22 -0
- package/lib/common/container/index.js.map +1 -0
- package/lib/common/container/scope.d.ts +6 -0
- package/lib/common/container/scope.d.ts.map +1 -0
- package/lib/common/container/scope.js +10 -0
- package/lib/common/container/scope.js.map +1 -0
- package/lib/common/el/core-context-initializer.d.ts +7 -0
- package/lib/common/el/core-context-initializer.d.ts.map +1 -0
- package/lib/common/el/core-context-initializer.js +39 -0
- package/lib/common/el/core-context-initializer.js.map +1 -0
- package/lib/common/el/expression-compiler.d.ts +18 -0
- package/lib/common/el/expression-compiler.d.ts.map +1 -0
- package/lib/common/el/expression-compiler.js +171 -0
- package/lib/common/el/expression-compiler.js.map +1 -0
- package/lib/common/el/expression-context-provider.d.ts +10 -0
- package/lib/common/el/expression-context-provider.d.ts.map +1 -0
- package/lib/common/el/expression-context-provider.js +46 -0
- package/lib/common/el/expression-context-provider.js.map +1 -0
- package/lib/common/el/expression-handler.d.ts +12 -0
- package/lib/common/el/expression-handler.d.ts.map +1 -0
- package/lib/common/el/expression-handler.js +97 -0
- package/lib/common/el/expression-handler.js.map +1 -0
- package/lib/common/el/expression-protocol.d.ts +25 -0
- package/lib/common/el/expression-protocol.d.ts.map +1 -0
- package/lib/common/el/expression-protocol.js +9 -0
- package/lib/common/el/expression-protocol.js.map +1 -0
- package/lib/common/el/index.d.ts +7 -0
- package/lib/common/el/index.d.ts.map +1 -0
- package/lib/common/el/index.js +23 -0
- package/lib/common/el/index.js.map +1 -0
- package/lib/common/el/jexl-engine-provider.d.ts +6 -0
- package/lib/common/el/jexl-engine-provider.d.ts.map +1 -0
- package/lib/common/el/jexl-engine-provider.js +25 -0
- package/lib/common/el/jexl-engine-provider.js.map +1 -0
- package/lib/common/error/cutom-error.d.ts +4 -0
- package/lib/common/error/cutom-error.d.ts.map +1 -0
- package/lib/common/error/cutom-error.js +8 -0
- package/lib/common/error/cutom-error.js.map +1 -0
- package/lib/common/error/error-protocol.d.ts +4 -0
- package/lib/common/error/error-protocol.d.ts.map +1 -0
- package/lib/common/error/error-protocol.js +3 -0
- package/lib/common/error/error-protocol.js.map +1 -0
- package/lib/common/error/illegal-argument-error.d.ts +4 -0
- package/lib/common/error/illegal-argument-error.d.ts.map +1 -0
- package/lib/common/error/illegal-argument-error.js +8 -0
- package/lib/common/error/illegal-argument-error.js.map +1 -0
- package/lib/common/error/index.d.ts +4 -0
- package/lib/common/error/index.d.ts.map +1 -0
- package/lib/common/error/index.js +20 -0
- package/lib/common/error/index.js.map +1 -0
- package/lib/common/index.d.ts +13 -0
- package/lib/common/index.d.ts.map +1 -0
- package/lib/common/index.js +29 -0
- package/lib/common/index.js.map +1 -0
- package/lib/common/logger/abstract-logger.d.ts +14 -0
- package/lib/common/logger/abstract-logger.d.ts.map +1 -0
- package/lib/common/logger/abstract-logger.js +39 -0
- package/lib/common/logger/abstract-logger.js.map +1 -0
- package/lib/common/logger/index.d.ts +4 -0
- package/lib/common/logger/index.d.ts.map +1 -0
- package/lib/common/logger/index.js +20 -0
- package/lib/common/logger/index.js.map +1 -0
- package/lib/common/logger/logger-protocol.d.ts +16 -0
- package/lib/common/logger/logger-protocol.d.ts.map +1 -0
- package/lib/common/logger/logger-protocol.js +8 -0
- package/lib/common/logger/logger-protocol.js.map +1 -0
- package/lib/common/logger/logger.d.ts +8 -0
- package/lib/common/logger/logger.d.ts.map +1 -0
- package/lib/common/logger/logger.js +38 -0
- package/lib/common/logger/logger.js.map +1 -0
- package/lib/common/provider/component-filter-registry.d.ts +12 -0
- package/lib/common/provider/component-filter-registry.d.ts.map +1 -0
- package/lib/common/provider/component-filter-registry.js +69 -0
- package/lib/common/provider/component-filter-registry.js.map +1 -0
- package/lib/common/provider/index.d.ts +6 -0
- package/lib/common/provider/index.d.ts.map +1 -0
- package/lib/common/provider/index.js +22 -0
- package/lib/common/provider/index.js.map +1 -0
- package/lib/common/provider/provider-creator.d.ts +7 -0
- package/lib/common/provider/provider-creator.d.ts.map +1 -0
- package/lib/common/provider/provider-creator.js +22 -0
- package/lib/common/provider/provider-creator.js.map +1 -0
- package/lib/common/provider/provider-protocol.d.ts +49 -0
- package/lib/common/provider/provider-protocol.d.ts.map +1 -0
- package/lib/common/provider/provider-protocol.js +8 -0
- package/lib/common/provider/provider-protocol.js.map +1 -0
- package/lib/common/provider/provider-util.d.ts +6 -0
- package/lib/common/provider/provider-util.d.ts.map +1 -0
- package/lib/common/provider/provider-util.js +13 -0
- package/lib/common/provider/provider-util.js.map +1 -0
- package/lib/common/provider/provider.d.ts +14 -0
- package/lib/common/provider/provider.d.ts.map +1 -0
- package/lib/common/provider/provider.js +58 -0
- package/lib/common/provider/provider.js.map +1 -0
- package/lib/common/static-module.d.ts +4 -0
- package/lib/common/static-module.d.ts.map +1 -0
- package/lib/common/static-module.js +11 -0
- package/lib/common/static-module.js.map +1 -0
- package/lib/common/test/index.d.ts +2 -0
- package/lib/common/test/index.d.ts.map +1 -0
- package/lib/common/test/index.js +18 -0
- package/lib/common/test/index.js.map +1 -0
- package/lib/common/test/mock-logger.d.ts +9 -0
- package/lib/common/test/mock-logger.d.ts.map +1 -0
- package/lib/common/test/mock-logger.js +32 -0
- package/lib/common/test/mock-logger.js.map +1 -0
- package/lib/common/test/test-module.d.ts +3 -0
- package/lib/common/test/test-module.d.ts.map +1 -0
- package/lib/common/test/test-module.js +15 -0
- package/lib/common/test/test-module.js.map +1 -0
- package/lib/common/utils/annotation-util.d.ts +5 -0
- package/lib/common/utils/annotation-util.d.ts.map +1 -0
- package/lib/common/utils/annotation-util.js +27 -0
- package/lib/common/utils/annotation-util.js.map +1 -0
- package/lib/common/utils/async.d.ts +368 -0
- package/lib/common/utils/async.d.ts.map +1 -0
- package/lib/common/utils/async.js +964 -0
- package/lib/common/utils/async.js.map +1 -0
- package/lib/common/utils/cancellation.d.ts +22 -0
- package/lib/common/utils/cancellation.d.ts.map +1 -0
- package/lib/common/utils/cancellation.js +95 -0
- package/lib/common/utils/cancellation.js.map +1 -0
- package/lib/common/utils/class-util.d.ts +3 -0
- package/lib/common/utils/class-util.d.ts.map +1 -0
- package/lib/common/utils/class-util.js +24 -0
- package/lib/common/utils/class-util.js.map +1 -0
- package/lib/common/utils/disposable.d.ts +30 -0
- package/lib/common/utils/disposable.d.ts.map +1 -0
- package/lib/common/utils/disposable.js +82 -0
- package/lib/common/utils/disposable.js.map +1 -0
- package/lib/common/utils/emitter.d.ts +64 -0
- package/lib/common/utils/emitter.d.ts.map +1 -0
- package/lib/common/utils/emitter.js +226 -0
- package/lib/common/utils/emitter.js.map +1 -0
- package/lib/common/utils/event.d.ts +41 -0
- package/lib/common/utils/event.d.ts.map +1 -0
- package/lib/common/utils/event.js +90 -0
- package/lib/common/utils/event.js.map +1 -0
- package/lib/common/utils/global-util.d.ts +2 -0
- package/lib/common/utils/global-util.d.ts.map +1 -0
- package/lib/common/utils/global-util.js +19 -0
- package/lib/common/utils/global-util.js.map +1 -0
- package/lib/common/utils/index.d.ts +17 -0
- package/lib/common/utils/index.d.ts.map +1 -0
- package/lib/common/utils/index.js +33 -0
- package/lib/common/utils/index.js.map +1 -0
- package/lib/common/utils/metadata-util.d.ts +2 -0
- package/lib/common/utils/metadata-util.d.ts.map +1 -0
- package/lib/common/utils/metadata-util.js +29 -0
- package/lib/common/utils/metadata-util.js.map +1 -0
- package/lib/common/utils/os.d.ts +20 -0
- package/lib/common/utils/os.d.ts.map +1 -0
- package/lib/common/utils/os.js +50 -0
- package/lib/common/utils/os.js.map +1 -0
- package/lib/common/utils/prioritizeable.d.ts +18 -0
- package/lib/common/utils/prioritizeable.d.ts.map +1 -0
- package/lib/common/utils/prioritizeable.js +41 -0
- package/lib/common/utils/prioritizeable.js.map +1 -0
- package/lib/common/utils/promise-util.d.ts +6 -0
- package/lib/common/utils/promise-util.d.ts.map +1 -0
- package/lib/common/utils/promise-util.js +13 -0
- package/lib/common/utils/promise-util.js.map +1 -0
- package/lib/common/utils/proxy-util.d.ts +5 -0
- package/lib/common/utils/proxy-util.d.ts.map +1 -0
- package/lib/common/utils/proxy-util.js +41 -0
- package/lib/common/utils/proxy-util.js.map +1 -0
- package/lib/common/utils/types.d.ts +13 -0
- package/lib/common/utils/types.d.ts.map +1 -0
- package/lib/common/utils/types.js +3 -0
- package/lib/common/utils/types.js.map +1 -0
- package/lib/common/utils/url-util.d.ts +4 -0
- package/lib/common/utils/url-util.d.ts.map +1 -0
- package/lib/common/utils/url-util.js +58 -0
- package/lib/common/utils/url-util.js.map +1 -0
- package/lib/common/utils/uuid.d.ts +3 -0
- package/lib/common/utils/uuid.d.ts.map +1 -0
- package/lib/common/utils/uuid.js +65 -0
- package/lib/common/utils/uuid.js.map +1 -0
- package/lib/node/application/backend-application-state.d.ts +5 -0
- package/lib/node/application/backend-application-state.d.ts.map +1 -0
- package/lib/node/application/backend-application-state.js +17 -0
- package/lib/node/application/backend-application-state.js.map +1 -0
- package/lib/node/application/backend-application.d.ts +12 -0
- package/lib/node/application/backend-application.d.ts.map +1 -0
- package/lib/node/application/backend-application.js +55 -0
- package/lib/node/application/backend-application.js.map +1 -0
- package/lib/node/application/index.d.ts +3 -0
- package/lib/node/application/index.d.ts.map +1 -0
- package/lib/node/application/index.js +19 -0
- package/lib/node/application/index.js.map +1 -0
- package/lib/node/constants.d.ts +16 -0
- package/lib/node/constants.d.ts.map +1 -0
- package/lib/node/constants.js +19 -0
- package/lib/node/constants.js.map +1 -0
- package/lib/node/context/context.d.ts +16 -0
- package/lib/node/context/context.d.ts.map +1 -0
- package/lib/node/context/context.js +60 -0
- package/lib/node/context/context.js.map +1 -0
- package/lib/node/context/index.d.ts +2 -0
- package/lib/node/context/index.d.ts.map +1 -0
- package/lib/node/context/index.js +18 -0
- package/lib/node/context/index.js.map +1 -0
- package/lib/node/index.d.ts +4 -0
- package/lib/node/index.d.ts.map +1 -0
- package/lib/node/index.js +20 -0
- package/lib/node/index.js.map +1 -0
- package/lib/node/static-module.d.ts +4 -0
- package/lib/node/static-module.d.ts.map +1 -0
- package/lib/node/static-module.js +6 -0
- package/lib/node/static-module.js.map +1 -0
- package/lib/node/utils/crc.d.ts +2 -0
- package/lib/node/utils/crc.d.ts.map +1 -0
- package/lib/node/utils/crc.js +11 -0
- package/lib/node/utils/crc.js.map +1 -0
- package/lib/node/utils/index.d.ts +2 -0
- package/lib/node/utils/index.d.ts.map +1 -0
- package/lib/node/utils/index.js +18 -0
- package/lib/node/utils/index.js.map +1 -0
- package/lib/package.spec.d.ts +1 -0
- package/lib/package.spec.d.ts.map +1 -0
- package/lib/package.spec.js +4 -0
- package/lib/package.spec.js.map +1 -0
- package/package.json +55 -0
- package/src/browser/application/frontend-application-state.ts +11 -0
- package/src/browser/application/frontend-application.ts +142 -0
- package/src/browser/application/index.ts +2 -0
- package/src/browser/browser.ts +59 -0
- package/src/browser/index.ts +3 -0
- package/src/browser/shell/application-shell.ts +10 -0
- package/src/browser/shell/index.ts +2 -0
- package/src/browser/shell/shell-protocol.ts +5 -0
- package/src/browser/static-module.ts +4 -0
- package/src/common/annotation/aspect.ts +18 -0
- package/src/common/annotation/autowired-provider.ts +31 -0
- package/src/common/annotation/autowired.ts +76 -0
- package/src/common/annotation/component.ts +120 -0
- package/src/common/annotation/constant.ts +20 -0
- package/src/common/annotation/decorate.ts +1 -0
- package/src/common/annotation/detached/autowired-provider.ts +13 -0
- package/src/common/annotation/detached/autowired.ts +9 -0
- package/src/common/annotation/detached/index.ts +3 -0
- package/src/common/annotation/detached/value.ts +9 -0
- package/src/common/annotation/index.ts +17 -0
- package/src/common/annotation/inject.ts +1 -0
- package/src/common/annotation/injectable.ts +1 -0
- package/src/common/annotation/named.ts +1 -0
- package/src/common/annotation/optional.ts +1 -0
- package/src/common/annotation/post-construct.ts +1 -0
- package/src/common/annotation/pre-destroy.ts +1 -0
- package/src/common/annotation/service.ts +15 -0
- package/src/common/annotation/tagged.ts +1 -0
- package/src/common/annotation/target-name.ts +1 -0
- package/src/common/annotation/unmanaged.ts +1 -0
- package/src/common/annotation/value.ts +64 -0
- package/src/common/aop/aop-protocol.ts +57 -0
- package/src/common/aop/aop-proxy-factory.ts +61 -0
- package/src/common/aop/class-filter.ts +22 -0
- package/src/common/aop/index.ts +3 -0
- package/src/common/application/application-entry.ts +14 -0
- package/src/common/application/application-error.ts +57 -0
- package/src/common/application/application-factory.ts +20 -0
- package/src/common/application/application-protocol.ts +143 -0
- package/src/common/application/application-state.ts +7 -0
- package/src/common/application/application.ts +20 -0
- package/src/common/application/index.ts +2 -0
- package/src/common/config/config-protocol.ts +5 -0
- package/src/common/config/config-provider.ts +15 -0
- package/src/common/config/config-util.ts +14 -0
- package/src/common/config/dynamic-config.ts +2 -0
- package/src/common/config/index.ts +3 -0
- package/src/common/constants.ts +6 -0
- package/src/common/container/auto-bind.ts +101 -0
- package/src/common/container/container-factory.ts +9 -0
- package/src/common/container/container-provider.ts +23 -0
- package/src/common/container/container-util.ts +28 -0
- package/src/common/container/dynamic-container.ts +4 -0
- package/src/common/container/index.ts +9 -0
- package/src/common/container/scope.ts +3 -0
- package/src/common/el/core-context-initializer.ts +25 -0
- package/src/common/el/expression-compiler.ts +157 -0
- package/src/common/el/expression-context-provider.ts +34 -0
- package/src/common/el/expression-handler.ts +84 -0
- package/src/common/el/expression-protocol.ts +36 -0
- package/src/common/el/index.ts +6 -0
- package/src/common/el/jexl-engine-provider.ts +18 -0
- package/src/common/error/cutom-error.ts +5 -0
- package/src/common/error/error-protocol.ts +4 -0
- package/src/common/error/illegal-argument-error.ts +5 -0
- package/src/common/error/index.ts +3 -0
- package/src/common/index.ts +12 -0
- package/src/common/logger/abstract-logger.ts +32 -0
- package/src/common/logger/index.ts +3 -0
- package/src/common/logger/logger-protocol.ts +23 -0
- package/src/common/logger/logger.ts +31 -0
- package/src/common/provider/component-filter-registry.ts +56 -0
- package/src/common/provider/index.ts +6 -0
- package/src/common/provider/provider-creator.ts +12 -0
- package/src/common/provider/provider-protocol.ts +59 -0
- package/src/common/provider/provider-util.ts +10 -0
- package/src/common/provider/provider.ts +63 -0
- package/src/common/static-module.ts +9 -0
- package/src/common/test/index.ts +1 -0
- package/src/common/test/mock-logger.ts +21 -0
- package/src/common/test/test-module.ts +12 -0
- package/src/common/utils/annotation-util.ts +21 -0
- package/src/common/utils/async.ts +1222 -0
- package/src/common/utils/cancellation.ts +112 -0
- package/src/common/utils/class-util.ts +20 -0
- package/src/common/utils/disposable.ts +94 -0
- package/src/common/utils/emitter.ts +268 -0
- package/src/common/utils/event.ts +124 -0
- package/src/common/utils/global-util.ts +16 -0
- package/src/common/utils/index.ts +16 -0
- package/src/common/utils/metadata-util.ts +24 -0
- package/src/common/utils/os.ts +49 -0
- package/src/common/utils/prioritizeable.ts +44 -0
- package/src/common/utils/promise-util.ts +9 -0
- package/src/common/utils/proxy-util.ts +36 -0
- package/src/common/utils/types.ts +13 -0
- package/src/common/utils/url-util.ts +64 -0
- package/src/common/utils/uuid.ts +75 -0
- package/src/node/application/backend-application-state.ts +9 -0
- package/src/node/application/backend-application.ts +43 -0
- package/src/node/application/index.ts +2 -0
- package/src/node/constants.ts +16 -0
- package/src/node/context/context.ts +58 -0
- package/src/node/context/index.ts +1 -0
- package/src/node/index.ts +3 -0
- package/src/node/static-module.ts +4 -0
- package/src/node/utils/crc.ts +7 -0
- package/src/node/utils/index.ts +1 -0
- package/src/package.spec.ts +4 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
function is(userAgent: string, platform: string): boolean {
|
|
2
|
+
if (typeof navigator !== 'undefined') {
|
|
3
|
+
if (navigator.userAgent && navigator.userAgent.indexOf(userAgent) >= 0) {
|
|
4
|
+
return true;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
if (typeof process !== 'undefined') {
|
|
8
|
+
return (process.platform === platform);
|
|
9
|
+
}
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const isWindows = is('Windows', 'win32');
|
|
14
|
+
export const isOSX = is('Mac', 'darwin');
|
|
15
|
+
|
|
16
|
+
export type CMD = [string, string[]];
|
|
17
|
+
export function cmd(command: string, ...args: string[]): CMD {
|
|
18
|
+
return [
|
|
19
|
+
isWindows ? 'cmd' : command,
|
|
20
|
+
isWindows ? ['/c', command, ...args] : args
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export namespace OS {
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Enumeration of the supported operating systems.
|
|
28
|
+
*/
|
|
29
|
+
export enum Type {
|
|
30
|
+
Windows = 'Windows',
|
|
31
|
+
Linux = 'Linux',
|
|
32
|
+
OSX = 'OSX'
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns with the type of the operating system. If it is neither [Windows](isWindows) nor [OS X](isOSX), then
|
|
37
|
+
* it always return with the `Linux` OS type.
|
|
38
|
+
*/
|
|
39
|
+
export function type(): OS.Type {
|
|
40
|
+
if (isWindows) {
|
|
41
|
+
return Type.Windows;
|
|
42
|
+
}
|
|
43
|
+
if (isOSX) {
|
|
44
|
+
return Type.OSX;
|
|
45
|
+
}
|
|
46
|
+
return Type.Linux;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type MaybeArray<T> = T | T[];
|
|
2
|
+
export type MaybePromise<T> = T | Promise<T> | PromiseLike<T>;
|
|
3
|
+
|
|
4
|
+
export interface Prioritizeable<T> {
|
|
5
|
+
readonly priority: number;
|
|
6
|
+
readonly value: T;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export namespace Prioritizeable {
|
|
10
|
+
export type GetPriority<T> = (value: T) => MaybePromise<number>;
|
|
11
|
+
export type GetPrioritySync<T> = (value: T) => number;
|
|
12
|
+
export async function toPrioritizeable<T>(rawValue: MaybePromise<T>, getPriority: GetPriority<T>): Promise<Prioritizeable<T>>;
|
|
13
|
+
export async function toPrioritizeable<T>(rawValue: MaybePromise<T>[], getPriority: GetPriority<T>): Promise<Prioritizeable<T>[]>;
|
|
14
|
+
export async function toPrioritizeable<T>(rawValue: MaybeArray<MaybePromise<T>>, getPriority: GetPriority<T>): Promise<MaybeArray<Prioritizeable<T>>> {
|
|
15
|
+
if (rawValue instanceof Array) {
|
|
16
|
+
return Promise.all(
|
|
17
|
+
rawValue.map(v => toPrioritizeable(v, getPriority))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
const value = await rawValue;
|
|
21
|
+
const priority = await getPriority(value);
|
|
22
|
+
return { priority, value };
|
|
23
|
+
}
|
|
24
|
+
export function toPrioritizeableSync<T>(rawValue: T[], getPriority: GetPrioritySync<T> = value => (<any>value).priority): Prioritizeable<T>[] {
|
|
25
|
+
return rawValue.map(v => ({
|
|
26
|
+
value: v,
|
|
27
|
+
priority: getPriority(v)
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
export function prioritizeAllSync<T>(values: T[], getPriority?: GetPrioritySync<T>): Prioritizeable<T>[] {
|
|
31
|
+
const prioritizeable = toPrioritizeableSync(values, getPriority);
|
|
32
|
+
return prioritizeable.filter(isValid).sort(compare);
|
|
33
|
+
}
|
|
34
|
+
export async function prioritizeAll<T>(values: MaybePromise<T>[], getPriority: GetPriority<T>): Promise<Prioritizeable<T>[]> {
|
|
35
|
+
const prioritizeable = await toPrioritizeable(values, getPriority);
|
|
36
|
+
return prioritizeable.filter(isValid).sort(compare);
|
|
37
|
+
}
|
|
38
|
+
export function isValid<T>(p: Prioritizeable<T>): boolean {
|
|
39
|
+
return p.priority > 0;
|
|
40
|
+
}
|
|
41
|
+
export function compare<T>(p: Prioritizeable<T>, p2: Prioritizeable<T>): number {
|
|
42
|
+
return p2.priority - p.priority;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
let resolveMode = false;
|
|
2
|
+
|
|
3
|
+
export function isResolveMode(): boolean {
|
|
4
|
+
return resolveMode;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getTargetClass(obj: any): any {
|
|
8
|
+
try {
|
|
9
|
+
resolveMode = true;
|
|
10
|
+
const target = obj.target;
|
|
11
|
+
return target ? target.constructor : obj.constructor;
|
|
12
|
+
|
|
13
|
+
} finally {
|
|
14
|
+
resolveMode = false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function getTarget(obj: any): any {
|
|
19
|
+
try {
|
|
20
|
+
resolveMode = true;
|
|
21
|
+
const target = obj.target;
|
|
22
|
+
return target || obj;
|
|
23
|
+
|
|
24
|
+
} finally {
|
|
25
|
+
resolveMode = false;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function isProxy(obj: any): boolean {
|
|
30
|
+
try {
|
|
31
|
+
resolveMode = true;
|
|
32
|
+
return !!obj.target;
|
|
33
|
+
} finally {
|
|
34
|
+
resolveMode = false;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface Newable<T> {
|
|
2
|
+
new (...args: any[]): T;
|
|
3
|
+
}
|
|
4
|
+
export interface Abstract<T> {
|
|
5
|
+
prototype: T;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Type<T> extends Function {
|
|
9
|
+
new (...args: any[]): T;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export type Mutable<T> = { -readonly [P in keyof T]: T[P] };
|
|
13
|
+
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
export namespace UrlUtil {
|
|
2
|
+
export function join(...paths: string[]) {
|
|
3
|
+
const resultArray = [];
|
|
4
|
+
if (paths.length === 0) {
|
|
5
|
+
return '';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (typeof paths[0] !== 'string') {
|
|
9
|
+
throw new TypeError('Url must be a string. Received ' + paths[0]);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// If the first part is a plain protocol, we combine it with the next part.
|
|
13
|
+
if (paths[0].match(/^[^/:]+:\/*$/) && paths.length > 1) {
|
|
14
|
+
paths[0] = paths.shift() + paths[0];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// There must be two or three slashes in the file protocol, two slashes in anything else.
|
|
18
|
+
if (paths[0].match(/^file:\/\/\//)) {
|
|
19
|
+
paths[0] = paths[0].replace(/^([^/:]+):\/*/, '$1:///');
|
|
20
|
+
} else {
|
|
21
|
+
paths[0] = paths[0].replace(/^([^/:]+):\/*/, '$1://');
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
for (let i = 0; i < paths.length; i++) {
|
|
25
|
+
let component = paths[i];
|
|
26
|
+
|
|
27
|
+
if (typeof component !== 'string') {
|
|
28
|
+
throw new TypeError(
|
|
29
|
+
'Url must be a string. Received ' + component
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (component === '') {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (i > 0) {
|
|
38
|
+
// Removing the starting slashes for each component but the first.
|
|
39
|
+
component = component.replace(/^[\/]+/, '');
|
|
40
|
+
}
|
|
41
|
+
if (i < paths.length - 1) {
|
|
42
|
+
// Removing the ending slashes for each component but the last.
|
|
43
|
+
component = component.replace(/[\/]+$/, '');
|
|
44
|
+
} else {
|
|
45
|
+
// For the last component we will combine multiple slashes to a single one.
|
|
46
|
+
component = component.replace(/[\/]+$/, '/');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
resultArray.push(component);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let str = resultArray.join('/');
|
|
53
|
+
// Each input component is now separated by a single slash except the possible first plain protocol part.
|
|
54
|
+
|
|
55
|
+
// remove trailing slash before parameters or hash
|
|
56
|
+
str = str.replace(/\/(\?|&|#[^!])/g, '$1');
|
|
57
|
+
|
|
58
|
+
// replace ? in parameters with &
|
|
59
|
+
const parts = str.split('?');
|
|
60
|
+
str = parts.shift() + (parts.length > 0 ? '?' : '') + parts.join('&');
|
|
61
|
+
|
|
62
|
+
return str;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
const _UUIDPattern = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
2
|
+
|
|
3
|
+
export function isUUID(value: string): boolean {
|
|
4
|
+
return _UUIDPattern.test(value);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
declare const crypto: undefined | {
|
|
8
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#browser_compatibility
|
|
9
|
+
getRandomValues?(data: Uint8Array): Uint8Array;
|
|
10
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/randomUUID#browser_compatibility
|
|
11
|
+
randomUUID?(): string;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const generateUUUID = (function (): () => string {
|
|
15
|
+
|
|
16
|
+
// use `randomUUID` if possible
|
|
17
|
+
if (typeof crypto === 'object' && typeof crypto.randomUUID === 'function') {
|
|
18
|
+
return crypto.randomUUID.bind(crypto);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// use `randomValues` if possible
|
|
22
|
+
let getRandomValues: (bucket: Uint8Array) => Uint8Array;
|
|
23
|
+
if (typeof crypto === 'object' && typeof crypto.getRandomValues === 'function') {
|
|
24
|
+
getRandomValues = crypto.getRandomValues.bind(crypto);
|
|
25
|
+
|
|
26
|
+
} else {
|
|
27
|
+
getRandomValues = function (bucket: Uint8Array): Uint8Array {
|
|
28
|
+
for (let i = 0; i < bucket.length; i++) {
|
|
29
|
+
bucket[i] = Math.floor(Math.random() * 256);
|
|
30
|
+
}
|
|
31
|
+
return bucket;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// prep-work
|
|
36
|
+
const _data = new Uint8Array(16);
|
|
37
|
+
const _hex: string[] = [];
|
|
38
|
+
for (let i = 0; i < 256; i++) {
|
|
39
|
+
_hex.push(i.toString(16).padStart(2, '0'));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return function generateUuid(): string {
|
|
43
|
+
// get data
|
|
44
|
+
getRandomValues(_data);
|
|
45
|
+
|
|
46
|
+
// set version bits
|
|
47
|
+
_data[6] = (_data[6] & 0x0f) | 0x40;
|
|
48
|
+
_data[8] = (_data[8] & 0x3f) | 0x80;
|
|
49
|
+
|
|
50
|
+
// print as string
|
|
51
|
+
let i = 0;
|
|
52
|
+
let result = '';
|
|
53
|
+
result += _hex[_data[i++]];
|
|
54
|
+
result += _hex[_data[i++]];
|
|
55
|
+
result += _hex[_data[i++]];
|
|
56
|
+
result += _hex[_data[i++]];
|
|
57
|
+
result += '-';
|
|
58
|
+
result += _hex[_data[i++]];
|
|
59
|
+
result += _hex[_data[i++]];
|
|
60
|
+
result += '-';
|
|
61
|
+
result += _hex[_data[i++]];
|
|
62
|
+
result += _hex[_data[i++]];
|
|
63
|
+
result += '-';
|
|
64
|
+
result += _hex[_data[i++]];
|
|
65
|
+
result += _hex[_data[i++]];
|
|
66
|
+
result += '-';
|
|
67
|
+
result += _hex[_data[i++]];
|
|
68
|
+
result += _hex[_data[i++]];
|
|
69
|
+
result += _hex[_data[i++]];
|
|
70
|
+
result += _hex[_data[i++]];
|
|
71
|
+
result += _hex[_data[i++]];
|
|
72
|
+
result += _hex[_data[i++]];
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
})();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ApplicationState, AbstractApplicationStateService, ApplicationStateService, Component } from '../../common';
|
|
2
|
+
|
|
3
|
+
export type BackendApplicationState = ApplicationState;
|
|
4
|
+
|
|
5
|
+
@Component(ApplicationStateService)
|
|
6
|
+
export class BackendApplicationStateService extends AbstractApplicationStateService<BackendApplicationState> {
|
|
7
|
+
|
|
8
|
+
}
|
|
9
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ApplicationStateService, AbstractApplication, Application, Component, Autowired } from '../../common';
|
|
2
|
+
import { BackendApplicationStateService } from './backend-application-state';
|
|
3
|
+
|
|
4
|
+
@Component(Application)
|
|
5
|
+
export class BackendApplication extends AbstractApplication {
|
|
6
|
+
|
|
7
|
+
@Autowired(ApplicationStateService)
|
|
8
|
+
protected readonly stateService: BackendApplicationStateService;
|
|
9
|
+
|
|
10
|
+
async start(): Promise<void> {
|
|
11
|
+
this.setupExitSignals();
|
|
12
|
+
await this.doStart();
|
|
13
|
+
this.stateService.state = 'started';
|
|
14
|
+
this.stateService.state = 'ready';
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
protected removeListeners(event: NodeJS.Signals) {
|
|
18
|
+
for (const l of process.listeners(event)) {
|
|
19
|
+
if ((l as any)._tag === BackendApplication.name) {
|
|
20
|
+
process.removeListener(event, l);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
protected setupExitSignals(): void {
|
|
26
|
+
this.removeListeners('SIGINT');
|
|
27
|
+
this.removeListeners('SIGTERM');
|
|
28
|
+
const l = this.doExit.bind(this);
|
|
29
|
+
l._tag = BackendApplication.name;
|
|
30
|
+
process.once('SIGINT', l);
|
|
31
|
+
process.once('SIGTERM', l);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
protected doExit(): void {
|
|
35
|
+
this.doStop();
|
|
36
|
+
process.exit(0);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async stop(): Promise<void> {
|
|
40
|
+
this.doStop();
|
|
41
|
+
this.stateService.state = 'stoped';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const METADATA_KEY = {
|
|
2
|
+
controller: 'cell:controller',
|
|
3
|
+
controllerMethod: 'cell:controller-method',
|
|
4
|
+
controllerParam: 'cell:controller-param',
|
|
5
|
+
controllerRequestHeader: 'cell:controller-request-header',
|
|
6
|
+
controllerResponseHeader: 'cell:controller-response-header',
|
|
7
|
+
controllerRequestCookie: 'cell:controller-request-cookie',
|
|
8
|
+
controllerResponseCookie: 'cell:controller-response-cookie',
|
|
9
|
+
controllerRequestSession: 'cell:controller-request-session',
|
|
10
|
+
controllerResponseSession: 'cell:controller-response-session',
|
|
11
|
+
controllerQuery: 'cell:controller-query',
|
|
12
|
+
controllerBody: 'cell:controller-body',
|
|
13
|
+
controllerView: 'cell:controller-view',
|
|
14
|
+
controllerCatch: 'cell:controller-catch'
|
|
15
|
+
|
|
16
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const createNamespace = require('cls-hooked').createNamespace;
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
4
|
+
export enum AttributeScope { App, Request, Session }
|
|
5
|
+
|
|
6
|
+
export const CURRENT_CONTEXT_REQUEST_KEY = 'CurrentContextRequest';
|
|
7
|
+
|
|
8
|
+
const appAttrs = new Map<string, any>();
|
|
9
|
+
|
|
10
|
+
const store = createNamespace('3f45efdf-383c-4152-877b-1e98a410e0da');
|
|
11
|
+
|
|
12
|
+
export class Context {
|
|
13
|
+
|
|
14
|
+
[key: string | symbol | number]: any;
|
|
15
|
+
|
|
16
|
+
static run(fn: (...args: any[]) => void) {
|
|
17
|
+
store.runPromise(async () => fn());
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
static bind(fn: (...args: any[]) => void, context?: any) {
|
|
21
|
+
return store.bind(fn, context);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
static setCurrent(context: Context) {
|
|
25
|
+
store.set(CURRENT_CONTEXT_REQUEST_KEY, context);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static getCurrent<T extends Context>(): T {
|
|
29
|
+
return store.get(CURRENT_CONTEXT_REQUEST_KEY);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static setAttr(key: string, value: any, scope: AttributeScope = AttributeScope.Request) {
|
|
33
|
+
if (scope === AttributeScope.Request) {
|
|
34
|
+
Context.getCurrent<Context>()[key] = value;
|
|
35
|
+
} else if (scope === AttributeScope.Session) {
|
|
36
|
+
Context.getCurrent()[key] = value;
|
|
37
|
+
} else {
|
|
38
|
+
appAttrs.set(key, value);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static getAttr<T>(key: string, scope?: AttributeScope): T {
|
|
43
|
+
if (scope) {
|
|
44
|
+
if (scope === AttributeScope.Request) {
|
|
45
|
+
return Context.getCurrent()?.[key];
|
|
46
|
+
} else if (scope === AttributeScope.Session) {
|
|
47
|
+
return Context.getCurrent()?.[key];
|
|
48
|
+
} else {
|
|
49
|
+
return appAttrs.get(key);
|
|
50
|
+
}
|
|
51
|
+
} else {
|
|
52
|
+
let value = store.get(key);
|
|
53
|
+
value = value ? value : Context.getCurrent()?.[key];
|
|
54
|
+
return value ? value : appAttrs.get(key);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './context';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './crc';
|