@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,28 @@
|
|
|
1
|
+
import { interfaces } from 'inversify';
|
|
2
|
+
import { ContainerProvider } from './container-provider';
|
|
3
|
+
|
|
4
|
+
export namespace ContainerUtil {
|
|
5
|
+
export function get<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>): T {
|
|
6
|
+
return ContainerProvider.provide().get(serviceIdentifier);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function getAll<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>): T[] {
|
|
10
|
+
return ContainerProvider.provide().getAll(serviceIdentifier);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function getAllNamed<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol): T[] {
|
|
14
|
+
return ContainerProvider.provide().getAllNamed(serviceIdentifier, named);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function getNamed<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, named: string | number | symbol): T {
|
|
18
|
+
return ContainerProvider.provide().getNamed(serviceIdentifier, named);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function getAllTagged<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: any): T[] {
|
|
22
|
+
return ContainerProvider.provide().getAllTagged(serviceIdentifier, key, value);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function getTagged<T>(serviceIdentifier: interfaces.ServiceIdentifier<T>, key: string | number | symbol, value: any): T {
|
|
26
|
+
return ContainerProvider.provide().getTagged(serviceIdentifier, key, value);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './container-provider';
|
|
2
|
+
export * from './auto-bind';
|
|
3
|
+
export * from './container-util';
|
|
4
|
+
export * from './scope';
|
|
5
|
+
export * from './container-factory';
|
|
6
|
+
import { interfaces } from 'inversify';
|
|
7
|
+
export type Container = interfaces.Container;
|
|
8
|
+
export type ContainerModule = interfaces.ContainerModule;
|
|
9
|
+
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Component, Autowired } from '../annotation';
|
|
2
|
+
import { ContainerUtil } from '../container';
|
|
3
|
+
import { ContextInitializer, ExpressionContext, JexlEngineProvider, ExpressionHandler } from './expression-protocol';
|
|
4
|
+
|
|
5
|
+
@Component(ContextInitializer)
|
|
6
|
+
export class CoreContextInitializer implements ContextInitializer {
|
|
7
|
+
|
|
8
|
+
@Autowired(JexlEngineProvider)
|
|
9
|
+
protected readonly jexlEngineProvider: JexlEngineProvider<any>;
|
|
10
|
+
|
|
11
|
+
initialize(ctx: ExpressionContext): void {
|
|
12
|
+
if (typeof process !== 'undefined') {
|
|
13
|
+
ctx.env = { ...process.env, _ignoreEl: true };
|
|
14
|
+
}
|
|
15
|
+
const jexlEngine = this.jexlEngineProvider.provide();
|
|
16
|
+
jexlEngine.addTransform('replace',
|
|
17
|
+
(val: string, searchValue: string | RegExp, replaceValue: string) => val && val.replace(new RegExp(searchValue, 'g'), replaceValue));
|
|
18
|
+
jexlEngine.addTransform('regexp', (pattern: string, flags?: string) => new RegExp(pattern, flags));
|
|
19
|
+
const expressionHandler = ContainerUtil.get<ExpressionHandler>(ExpressionHandler);
|
|
20
|
+
jexlEngine.addTransform('eval', (text: string) => expressionHandler.handle(text));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
priority = 500;
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { ExpressionCompiler, JexlEngineProvider } from './expression-protocol';
|
|
2
|
+
import { Component, Autowired } from '../annotation';
|
|
3
|
+
|
|
4
|
+
interface MiddleExpression {
|
|
5
|
+
expression: any;
|
|
6
|
+
nextText?: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
@Component(ExpressionCompiler)
|
|
10
|
+
export class ExpressionCompilerImpl implements ExpressionCompiler {
|
|
11
|
+
|
|
12
|
+
private ESCAPE_CHAR = '\\';
|
|
13
|
+
private SPECIAL_CHAR = '$';
|
|
14
|
+
private BRACKET_BEGIN = '{';
|
|
15
|
+
private BRACKET_END = '}';
|
|
16
|
+
|
|
17
|
+
@Autowired(JexlEngineProvider)
|
|
18
|
+
protected readonly jexlEngineProvider: JexlEngineProvider<any>;
|
|
19
|
+
|
|
20
|
+
compileSections(text: string): any[] {
|
|
21
|
+
if (!text || text.indexOf(this.SPECIAL_CHAR) < 0) {
|
|
22
|
+
return [];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const sections: any[] = [];
|
|
26
|
+
let middleText: string | undefined = text;
|
|
27
|
+
while (middleText) {
|
|
28
|
+
const me: MiddleExpression | undefined = this.middleCompile(middleText);
|
|
29
|
+
if (!me) {
|
|
30
|
+
sections.push(middleText);
|
|
31
|
+
middleText = undefined;
|
|
32
|
+
} else {
|
|
33
|
+
sections.push(me.expression);
|
|
34
|
+
middleText = me.nextText;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return sections;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
protected middleCompile(text: string): MiddleExpression | undefined {
|
|
42
|
+
let me: MiddleExpression | undefined;
|
|
43
|
+
if (text.startsWith('${{')) {
|
|
44
|
+
me = this.nextMiddleExpression(text.substring(3), 2);
|
|
45
|
+
} else if (text.startsWith('${')) {
|
|
46
|
+
me = this.nextMiddleExpression(text.substring(2));
|
|
47
|
+
} else {
|
|
48
|
+
me = this.nextString(text);
|
|
49
|
+
}
|
|
50
|
+
return me;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
protected nextMiddleExpression(text: string, bracketBeginCharNum = 1): MiddleExpression | undefined {
|
|
54
|
+
let stringed = false;
|
|
55
|
+
let escaped = false;
|
|
56
|
+
let bracketBeginCharFound = 0;
|
|
57
|
+
|
|
58
|
+
const section: string[] = [];
|
|
59
|
+
for (let i = 0; i < text.length; i++) {
|
|
60
|
+
const c = text[i];
|
|
61
|
+
if (!escaped) {
|
|
62
|
+
if ('\'' === c || '\"' === c) {
|
|
63
|
+
stringed = !stringed;
|
|
64
|
+
section.push(c);
|
|
65
|
+
continue;
|
|
66
|
+
} else
|
|
67
|
+
if (c === this.ESCAPE_CHAR) {
|
|
68
|
+
escaped = true;
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (stringed) {
|
|
74
|
+
section.push(c);
|
|
75
|
+
escaped = false;
|
|
76
|
+
} else if (escaped) {
|
|
77
|
+
if (this.SPECIAL_CHAR === c || this.BRACKET_BEGIN === c || this.BRACKET_END === c) {
|
|
78
|
+
section.push(c);
|
|
79
|
+
} else {
|
|
80
|
+
section.push(this.ESCAPE_CHAR);
|
|
81
|
+
section.push(c);
|
|
82
|
+
}
|
|
83
|
+
escaped = false;
|
|
84
|
+
} else if (this.BRACKET_BEGIN === c) {
|
|
85
|
+
bracketBeginCharFound++;
|
|
86
|
+
section.push(c);
|
|
87
|
+
} else if (this.BRACKET_END === c) {
|
|
88
|
+
if (bracketBeginCharFound === 0 && bracketBeginCharNum === 1) {
|
|
89
|
+
const jexlEngine = this.jexlEngineProvider.provide();
|
|
90
|
+
const expression = jexlEngine.createExpression(section.join(''));
|
|
91
|
+
let nextText;
|
|
92
|
+
if (i !== text.length - 1) {
|
|
93
|
+
nextText = text.substring(i + 1);
|
|
94
|
+
}
|
|
95
|
+
return { expression, nextText };
|
|
96
|
+
} else if (bracketBeginCharFound > 0) {
|
|
97
|
+
bracketBeginCharFound--;
|
|
98
|
+
section.push(c);
|
|
99
|
+
} else {
|
|
100
|
+
bracketBeginCharNum--;
|
|
101
|
+
}
|
|
102
|
+
} else {
|
|
103
|
+
section.push(c);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
protected nextString(text: string): MiddleExpression {
|
|
109
|
+
let escaped = false;
|
|
110
|
+
let specialCharFound = false;
|
|
111
|
+
|
|
112
|
+
const section: string[] = [];
|
|
113
|
+
for (let i = 0; i < text.length; i++) {
|
|
114
|
+
const c = text[i];
|
|
115
|
+
if (!escaped) {
|
|
116
|
+
if ('\'' === c || '\"' === c) {
|
|
117
|
+
section.push(c);
|
|
118
|
+
continue;
|
|
119
|
+
} else
|
|
120
|
+
if (c === this.ESCAPE_CHAR) {
|
|
121
|
+
escaped = true;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
if (escaped) {
|
|
127
|
+
if (this.SPECIAL_CHAR === c || this.BRACKET_BEGIN === c || this.BRACKET_END === c) {
|
|
128
|
+
section.push(c);
|
|
129
|
+
} else {
|
|
130
|
+
section.push(this.ESCAPE_CHAR);
|
|
131
|
+
section.push(c);
|
|
132
|
+
}
|
|
133
|
+
escaped = false;
|
|
134
|
+
} else
|
|
135
|
+
if (specialCharFound) {
|
|
136
|
+
if (this.BRACKET_BEGIN === c) {
|
|
137
|
+
const expression = section.join('');
|
|
138
|
+
const nextText = text.substring(i - 1);
|
|
139
|
+
return { expression, nextText };
|
|
140
|
+
} else {
|
|
141
|
+
specialCharFound = false;
|
|
142
|
+
section.push(this.SPECIAL_CHAR);
|
|
143
|
+
section.push(c);
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
if (this.SPECIAL_CHAR === c) {
|
|
147
|
+
specialCharFound = true;
|
|
148
|
+
} else {
|
|
149
|
+
section.push(c);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
return { expression: section.join('') };
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Component, Autowired, Optional } from '../annotation';
|
|
2
|
+
import { ExpressionContextProvider, ContextInitializer, ExpressionContext } from './expression-protocol';
|
|
3
|
+
import { Prioritizeable } from '../utils';
|
|
4
|
+
import { ConfigUtil } from '../config';
|
|
5
|
+
|
|
6
|
+
@Component(ExpressionContextProvider)
|
|
7
|
+
export class ExpressionContextProviderImpl implements ExpressionContextProvider {
|
|
8
|
+
|
|
9
|
+
protected prioritized: ContextInitializer[];
|
|
10
|
+
protected ctx: ExpressionContext;
|
|
11
|
+
protected initialized = false;
|
|
12
|
+
|
|
13
|
+
constructor(
|
|
14
|
+
@Autowired(ContextInitializer) @Optional()
|
|
15
|
+
protected readonly contextInitializers: ContextInitializer[]
|
|
16
|
+
|
|
17
|
+
) {
|
|
18
|
+
this.ctx = ConfigUtil.getRaw();
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
provide(): ExpressionContext {
|
|
22
|
+
if (!this.prioritized) {
|
|
23
|
+
this.prioritized = Prioritizeable.prioritizeAllSync(this.contextInitializers).map(c => c.value);
|
|
24
|
+
}
|
|
25
|
+
if (!this.initialized) {
|
|
26
|
+
this.initialized = true;
|
|
27
|
+
for (const initializer of this.prioritized) {
|
|
28
|
+
initializer.initialize(this.ctx);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return this.ctx;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Component, Autowired } from '../annotation';
|
|
2
|
+
import { JexlEngineProvider, ExpressionHandler, ExpressionContextProvider, ExpressionCompiler, ExpressionContext } from './expression-protocol';
|
|
3
|
+
import * as traverse from 'traverse';
|
|
4
|
+
|
|
5
|
+
@Component(ExpressionHandler)
|
|
6
|
+
export class ExpressionHandlerImpl implements ExpressionHandler {
|
|
7
|
+
|
|
8
|
+
@Autowired(JexlEngineProvider)
|
|
9
|
+
protected readonly jexlEngineProvider: JexlEngineProvider<any>;
|
|
10
|
+
|
|
11
|
+
@Autowired(ExpressionContextProvider)
|
|
12
|
+
protected readonly expressionContextProvider: ExpressionContextProvider;
|
|
13
|
+
|
|
14
|
+
@Autowired(ExpressionCompiler)
|
|
15
|
+
protected readonly expressionCompiler: ExpressionCompiler;
|
|
16
|
+
|
|
17
|
+
protected _ctx: ExpressionContext;
|
|
18
|
+
|
|
19
|
+
protected getContext(ctx?: ExpressionContext) {
|
|
20
|
+
const c = ctx || this.expressionContextProvider.provide();
|
|
21
|
+
|
|
22
|
+
if (!ctx && c !== this._ctx) {
|
|
23
|
+
this._ctx = c;
|
|
24
|
+
this.handle(c, c);
|
|
25
|
+
}
|
|
26
|
+
return c;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
handle(textOrObj: string | Object, ctx?: ExpressionContext): any {
|
|
30
|
+
if (typeof textOrObj === 'string') {
|
|
31
|
+
return this.doHandle(textOrObj, ctx);
|
|
32
|
+
} else {
|
|
33
|
+
const self = this;
|
|
34
|
+
traverse(textOrObj).forEach(function (value: any) {
|
|
35
|
+
if (typeof value === 'string') {
|
|
36
|
+
this.update(self.handle(value, ctx));
|
|
37
|
+
} else if (value && (value as any)._ignoreEl === true) {
|
|
38
|
+
this.update(value, true);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return textOrObj;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
protected doHandle(text: string, ctx?: ExpressionContext): any {
|
|
46
|
+
const sections = this.expressionCompiler.compileSections(text);
|
|
47
|
+
if (sections.length > 0) {
|
|
48
|
+
if (this.hasExpression(sections)) {
|
|
49
|
+
const c = this.getContext(ctx);
|
|
50
|
+
if (sections.length === 1) {
|
|
51
|
+
let value = sections[0].evalSync(c);
|
|
52
|
+
if (typeof value === 'string') {
|
|
53
|
+
value = this.handle(value, c);
|
|
54
|
+
}
|
|
55
|
+
return value;
|
|
56
|
+
}
|
|
57
|
+
const result: string[] = [];
|
|
58
|
+
for (const section of sections) {
|
|
59
|
+
if (typeof section === 'string') {
|
|
60
|
+
result.push(section);
|
|
61
|
+
} else {
|
|
62
|
+
let value = section.evalSync(c);
|
|
63
|
+
if (typeof value === 'string') {
|
|
64
|
+
value = this.handle(value, c);
|
|
65
|
+
}
|
|
66
|
+
result.push(value);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return result.join('');
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return text;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
protected hasExpression(sections: any[]) {
|
|
76
|
+
for (const section of sections) {
|
|
77
|
+
if (typeof section !== 'string') {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export const ExpressionCompiler = Symbol('ExpressionCompiler');
|
|
2
|
+
export const ExpressionHandler = Symbol('ExpressionHandler');
|
|
3
|
+
export const ContextInitializer = Symbol('ContextInitializer');
|
|
4
|
+
export const ExpressionContextProvider = Symbol('ExpressionContextProvider');
|
|
5
|
+
export const JexlEngineProvider = Symbol('JexlEngineProvider');
|
|
6
|
+
|
|
7
|
+
export interface ExpressionCompiler {
|
|
8
|
+
compileSections(text: string): any[]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface ExpressionHandler {
|
|
12
|
+
|
|
13
|
+
handle(text: string | Object, ctx?: ExpressionContext): any;
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface ExpressionContext {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface ContextInitializer {
|
|
22
|
+
|
|
23
|
+
initialize(ctx: ExpressionContext): void;
|
|
24
|
+
readonly priority: number;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export interface ExpressionContextProvider {
|
|
28
|
+
|
|
29
|
+
provide(): ExpressionContext;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface JexlEngineProvider<T> {
|
|
33
|
+
|
|
34
|
+
provide(): T
|
|
35
|
+
}
|
|
36
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component } from '../annotation';
|
|
2
|
+
import { JexlEngineProvider } from './expression-protocol';
|
|
3
|
+
import { Jexl } from 'jexl';
|
|
4
|
+
|
|
5
|
+
@Component(JexlEngineProvider)
|
|
6
|
+
export class JexlEngineProviderImpl implements JexlEngineProvider<any> {
|
|
7
|
+
|
|
8
|
+
protected jexlEngine: any;
|
|
9
|
+
|
|
10
|
+
provide(): any {
|
|
11
|
+
|
|
12
|
+
if (!this.jexlEngine) {
|
|
13
|
+
this.jexlEngine = new Jexl();
|
|
14
|
+
}
|
|
15
|
+
return this.jexlEngine;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import 'reflect-metadata';
|
|
2
|
+
export * from './utils';
|
|
3
|
+
export * from './annotation';
|
|
4
|
+
export * from './application';
|
|
5
|
+
export * from './logger';
|
|
6
|
+
export * from './container';
|
|
7
|
+
export * from './aop';
|
|
8
|
+
export * from './constants';
|
|
9
|
+
export * from './config';
|
|
10
|
+
export * from './error';
|
|
11
|
+
export * from './el';
|
|
12
|
+
export * from './provider';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Autowired, Optional, Value } from '../annotation';
|
|
2
|
+
import { Logger, LOGGER_LEVEL, LogLevel, TraceIdProvider } from './logger-protocol';
|
|
3
|
+
|
|
4
|
+
export abstract class AbstractLogger implements Logger {
|
|
5
|
+
protected instance: Logger;
|
|
6
|
+
protected context?: string;
|
|
7
|
+
|
|
8
|
+
@Value(`${LOGGER_LEVEL} ?: 'info'`)
|
|
9
|
+
protected level: LogLevel;
|
|
10
|
+
|
|
11
|
+
@Autowired(TraceIdProvider) @Optional()
|
|
12
|
+
protected readonly traceIdProvider?: TraceIdProvider;
|
|
13
|
+
|
|
14
|
+
setContext(context?: string): void {
|
|
15
|
+
this.context = context;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
protected call(logFn: (...args: any[]) => void, message: any, context?: string): void {
|
|
19
|
+
context = context ?? this.context;
|
|
20
|
+
const time = new Date().toISOString();
|
|
21
|
+
const traceId = this.traceIdProvider?.provide();
|
|
22
|
+
const traceStr = traceId ? ` [trace: ${traceId}]` : '';
|
|
23
|
+
const contextStr = this.context ? ` [${this.context}]` : '';
|
|
24
|
+
logFn(`${time} [${this.level}]${traceStr}${contextStr} ${message}`);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
abstract info(message: any, context?: string | undefined): void;
|
|
28
|
+
abstract error(message: any, context?: string | undefined): void;
|
|
29
|
+
abstract warn(message: any, context?: string | undefined): void;
|
|
30
|
+
abstract debug(message: any, context?: string | undefined): void;
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export const LOGGER_CONFIG = 'cell.logger';
|
|
2
|
+
export const LOGGER_LEVEL = `${LOGGER_CONFIG}.level`;
|
|
3
|
+
|
|
4
|
+
export const Logger = Symbol('Logger');
|
|
5
|
+
export const TraceIdProvider = Symbol('TraceIdProvider');
|
|
6
|
+
|
|
7
|
+
export type LogLevel = 'verbose' | 'debug' | 'info' | 'warn' | 'error';
|
|
8
|
+
|
|
9
|
+
export interface Logger {
|
|
10
|
+
/*
|
|
11
|
+
* Set the context information of the log object level. When printing the log, the context will be carried.
|
|
12
|
+
* If the context of the log method level is additionally specified when printing the log, the occlusion overrides the context of the log object level
|
|
13
|
+
*/
|
|
14
|
+
setContext(context?: string): void;
|
|
15
|
+
info(message: any, context?: string): void;
|
|
16
|
+
error(message: any, context?: string): void;
|
|
17
|
+
warn(message: any, context?: string): void;
|
|
18
|
+
debug(message: any, context?: string): void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TraceIdProvider {
|
|
22
|
+
provide(): string | undefined;
|
|
23
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Component } from '../annotation';
|
|
2
|
+
import { Scope } from '../container';
|
|
3
|
+
import { AbstractLogger } from './abstract-logger';
|
|
4
|
+
import { Logger } from './logger-protocol';
|
|
5
|
+
|
|
6
|
+
@Component({ id: Logger, scope: Scope.Transient })
|
|
7
|
+
export class LoggerImpl extends AbstractLogger {
|
|
8
|
+
|
|
9
|
+
error(message: any, context?: string): void {
|
|
10
|
+
this.call(console.error.bind(console), message, context);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
info(message: any, context?: string): void {
|
|
14
|
+
if (['info', 'debug'].includes(this.level)) {
|
|
15
|
+
this.call(console.info.bind(console), message, context);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
warn(message: any, context?: string): void {
|
|
20
|
+
if (['info', 'debug', 'warn'].includes(this.level)) {
|
|
21
|
+
this.call(console.warn.bind(console), message, context);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
debug(message: any, context?: string): void {
|
|
26
|
+
if (this.level === 'debug') {
|
|
27
|
+
this.call(console.debug.bind(console), message, context);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ComponentFilterRegistry, ComponentType, ComponentFilterContribution, ComponentFilter } from './provider-protocol';
|
|
2
|
+
import { Autowired, Component, Optional } from '../annotation';
|
|
3
|
+
|
|
4
|
+
@Component(ComponentFilterRegistry)
|
|
5
|
+
export class ComponentFilterRegistryImpl implements ComponentFilterRegistry {
|
|
6
|
+
|
|
7
|
+
protected initialized = false;
|
|
8
|
+
protected genericFilters: ComponentFilter<Object>[] = [];
|
|
9
|
+
protected typeToFilters = new Map<ComponentType, ComponentFilter<Object>[]>();
|
|
10
|
+
|
|
11
|
+
constructor(
|
|
12
|
+
@Autowired(ComponentFilterContribution) @Optional() contributions: ComponentFilterContribution[] = []
|
|
13
|
+
) {
|
|
14
|
+
for (const contribution of contributions) {
|
|
15
|
+
contribution.registerContributionFilters(this);
|
|
16
|
+
}
|
|
17
|
+
this.initialized = true;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
addFilters(types: '*' | ComponentType[], filters: ComponentFilter<Object>[]): void {
|
|
21
|
+
if (this.initialized) {
|
|
22
|
+
throw new Error('cannot add filters after initialization is done.');
|
|
23
|
+
} else if (types === '*') {
|
|
24
|
+
this.genericFilters.push(...filters);
|
|
25
|
+
} else {
|
|
26
|
+
for (const type of types) {
|
|
27
|
+
this.getOrCreate(type).push(...filters);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
applyFilters<T extends Object>(toFilter: T[], type: ComponentType): T[] {
|
|
33
|
+
const filters = this.getFilters(type);
|
|
34
|
+
if (filters.length === 0) {
|
|
35
|
+
return toFilter;
|
|
36
|
+
}
|
|
37
|
+
return toFilter.filter(
|
|
38
|
+
object => filters.every(filter => filter(object))
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
protected getOrCreate(type: ComponentType): ComponentFilter<Object>[] {
|
|
43
|
+
let value = this.typeToFilters.get(type);
|
|
44
|
+
if (value === undefined) {
|
|
45
|
+
this.typeToFilters.set(type, value = []);
|
|
46
|
+
}
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
protected getFilters(type: ComponentType): ComponentFilter<Object>[] {
|
|
51
|
+
return [
|
|
52
|
+
...this.typeToFilters.get(type) || [],
|
|
53
|
+
...this.genericFilters
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Component, ComponentId } from '../annotation/component';
|
|
2
|
+
import { Provider, ProviderCreator } from './provider-protocol';
|
|
3
|
+
import { Container } from '../container';
|
|
4
|
+
import { ContainerBasedProvider } from './provider';
|
|
5
|
+
|
|
6
|
+
@Component(ProviderCreator)
|
|
7
|
+
export class ProviderCreatorImpl<T extends Object> implements ProviderCreator<T> {
|
|
8
|
+
create(id: ComponentId, container: Container): Provider<T> {
|
|
9
|
+
return new ContainerBasedProvider(id, container) as Provider<T>;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|