taon 21.0.54 → 21.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +159 -159
- package/bin/start.js +17 -17
- package/bin/taon +5 -5
- package/bin/taon-debug +5 -5
- package/bin/taon-debug-brk +4 -4
- package/browser/README.md +24 -24
- package/browser/fesm2022/taon-browser.mjs.map +1 -1
- package/browser/package.json +1 -1
- package/browser-prod/README.md +24 -24
- package/browser-prod/fesm2022/taon-browser.mjs.map +1 -1
- package/browser-prod/package.json +1 -1
- package/icon-menu-taon.svg +15 -15
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/package.json +1 -1
- package/lib/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -1
- package/lib/ui/index.js +2 -2
- package/lib/ui/taon-admin-mode-configuration/index.js +2 -2
- package/lib-prod/base-classes/base-abstract-entity.d.ts +7 -0
- package/lib-prod/base-classes/base-abstract-entity.js +32 -9
- package/lib-prod/base-classes/base-abstract-entity.js.map +1 -0
- package/lib-prod/base-classes/base-angular-service.d.ts +27 -0
- package/lib-prod/base-classes/base-angular-service.js +8 -3
- package/lib-prod/base-classes/base-angular-service.js.map +1 -0
- package/lib-prod/base-classes/base-class.d.ts +15 -0
- package/lib-prod/base-classes/base-class.js +15 -10
- package/lib-prod/base-classes/base-class.js.map +1 -0
- package/lib-prod/base-classes/base-context.d.ts +20 -0
- package/lib-prod/base-classes/base-context.js +13 -9
- package/lib-prod/base-classes/base-context.js.map +1 -0
- package/lib-prod/base-classes/base-controller.d.ts +84 -0
- package/lib-prod/base-classes/base-controller.js +45 -26
- package/lib-prod/base-classes/base-controller.js.map +1 -0
- package/lib-prod/base-classes/base-crud-controller.d.ts +28 -0
- package/lib-prod/base-classes/base-crud-controller.js +104 -50
- package/lib-prod/base-classes/base-crud-controller.js.map +1 -0
- package/lib-prod/base-classes/base-custom-repository.d.ts +3 -0
- package/lib-prod/base-classes/base-custom-repository.js +16 -6
- package/lib-prod/base-classes/base-custom-repository.js.map +1 -0
- package/lib-prod/base-classes/base-electron-service.d.ts +0 -0
- package/lib-prod/base-classes/base-electron-service.js +1 -0
- package/lib-prod/base-classes/base-electron-service.js.map +1 -0
- package/lib-prod/base-classes/base-entity.d.ts +16 -0
- package/lib-prod/base-classes/base-entity.js +16 -6
- package/lib-prod/base-classes/base-entity.js.map +1 -0
- package/lib-prod/base-classes/base-file-upload.middleware.d.ts +14 -0
- package/lib-prod/base-classes/base-file-upload.middleware.js +24 -14
- package/lib-prod/base-classes/base-file-upload.middleware.js.map +1 -0
- package/lib-prod/base-classes/base-injector.d.ts +67 -0
- package/lib-prod/base-classes/base-injector.js +27 -13
- package/lib-prod/base-classes/base-injector.js.map +1 -0
- package/lib-prod/base-classes/base-middleware.d.ts +38 -0
- package/lib-prod/base-classes/base-middleware.js +7 -2
- package/lib-prod/base-classes/base-middleware.js.map +1 -0
- package/lib-prod/base-classes/base-migration.d.ts +11 -0
- package/lib-prod/base-classes/base-migration.js +12 -7
- package/lib-prod/base-classes/base-migration.js.map +1 -0
- package/lib-prod/base-classes/base-provider.d.ts +8 -0
- package/lib-prod/base-classes/base-provider.js +7 -2
- package/lib-prod/base-classes/base-provider.js.map +1 -0
- package/lib-prod/base-classes/base-repository.d.ts +272 -0
- package/lib-prod/base-classes/base-repository.js +38 -21
- package/lib-prod/base-classes/base-repository.js.map +1 -0
- package/lib-prod/base-classes/base-subscriber-for-entity.d.ts +81 -0
- package/lib-prod/base-classes/base-subscriber-for-entity.js +16 -6
- package/lib-prod/base-classes/base-subscriber-for-entity.js.map +1 -0
- package/lib-prod/base-classes/base.d.ts +1 -0
- package/lib-prod/base-classes/base.js +3 -1
- package/lib-prod/base-classes/base.js.map +1 -0
- package/lib-prod/build-info._auto-generated_.d.ts +24 -0
- package/lib-prod/build-info._auto-generated_.js +10 -6
- package/lib-prod/build-info._auto-generated_.js.map +1 -0
- package/lib-prod/config/controller-config.d.ts +21 -0
- package/lib-prod/config/controller-config.js +9 -3
- package/lib-prod/config/controller-config.js.map +1 -0
- package/lib-prod/config/controller-options.d.ts +16 -0
- package/lib-prod/config/controller-options.js +7 -2
- package/lib-prod/config/controller-options.js.map +1 -0
- package/lib-prod/config/method-config.d.ts +39 -0
- package/lib-prod/config/method-config.js +6 -1
- package/lib-prod/config/method-config.js.map +1 -0
- package/lib-prod/config/param-config.d.ts +8 -0
- package/lib-prod/config/param-config.js +6 -1
- package/lib-prod/config/param-config.js.map +1 -0
- package/lib-prod/constants.d.ts +9 -0
- package/lib-prod/constants.js +6 -7
- package/lib-prod/constants.js.map +1 -0
- package/lib-prod/context-db-migrations.d.ts +17 -0
- package/lib-prod/context-db-migrations.js +76 -69
- package/lib-prod/context-db-migrations.js.map +1 -0
- package/lib-prod/create-context.d.ts +78 -0
- package/lib-prod/create-context.js +19 -13
- package/lib-prod/create-context.js.map +1 -0
- package/lib-prod/decorators/classes/controller-decorator.d.ts +5 -0
- package/lib-prod/decorators/classes/controller-decorator.js +10 -6
- package/lib-prod/decorators/classes/controller-decorator.js.map +1 -0
- package/lib-prod/decorators/classes/entity-decorator.d.ts +19 -0
- package/lib-prod/decorators/classes/entity-decorator.js +31 -16
- package/lib-prod/decorators/classes/entity-decorator.js.map +1 -0
- package/lib-prod/decorators/classes/middleware-decorator.d.ts +8 -0
- package/lib-prod/decorators/classes/middleware-decorator.js +15 -9
- package/lib-prod/decorators/classes/middleware-decorator.js.map +1 -0
- package/lib-prod/decorators/classes/migration-decorator.d.ts +7 -0
- package/lib-prod/decorators/classes/migration-decorator.js +14 -8
- package/lib-prod/decorators/classes/migration-decorator.js.map +1 -0
- package/lib-prod/decorators/classes/provider-decorator.d.ts +7 -0
- package/lib-prod/decorators/classes/provider-decorator.js +14 -8
- package/lib-prod/decorators/classes/provider-decorator.js.map +1 -0
- package/lib-prod/decorators/classes/repository-decorator.d.ts +7 -0
- package/lib-prod/decorators/classes/repository-decorator.js +14 -8
- package/lib-prod/decorators/classes/repository-decorator.js.map +1 -0
- package/lib-prod/decorators/classes/subscriber-decorator.d.ts +8 -0
- package/lib-prod/decorators/classes/subscriber-decorator.js +15 -8
- package/lib-prod/decorators/classes/subscriber-decorator.js.map +1 -0
- package/lib-prod/decorators/decorator-abstract-opt.d.ts +3 -0
- package/lib-prod/decorators/decorator-abstract-opt.js +6 -1
- package/lib-prod/decorators/decorator-abstract-opt.js.map +1 -0
- package/lib-prod/decorators/http/http-decorators.d.ts +3 -0
- package/lib-prod/decorators/http/http-decorators.js +7 -3
- package/lib-prod/decorators/http/http-decorators.js.map +1 -0
- package/lib-prod/decorators/http/http-methods-decorators.d.ts +70 -0
- package/lib-prod/decorators/http/http-methods-decorators.js +22 -12
- package/lib-prod/decorators/http/http-methods-decorators.js.map +1 -0
- package/lib-prod/decorators/http/http-params-decorators.d.ts +8 -0
- package/lib-prod/decorators/http/http-params-decorators.js +15 -7
- package/lib-prod/decorators/http/http-params-decorators.js.map +1 -0
- package/lib-prod/dependency-injection/di-container.d.ts +5 -0
- package/lib-prod/dependency-injection/di-container.js +7 -2
- package/lib-prod/dependency-injection/di-container.js.map +1 -0
- package/lib-prod/endpoint-context-storage.d.ts +11 -0
- package/lib-prod/endpoint-context-storage.js +11 -4
- package/lib-prod/endpoint-context-storage.js.map +1 -0
- package/lib-prod/endpoint-context.d.ts +197 -0
- package/lib-prod/endpoint-context.js +460 -435
- package/lib-prod/endpoint-context.js.map +1 -0
- package/lib-prod/entity-process.d.ts +39 -0
- package/lib-prod/entity-process.js +77 -61
- package/lib-prod/entity-process.js.map +1 -0
- package/lib-prod/env/env.angular-node-app.d.ts +64 -0
- package/lib-prod/env/env.angular-node-app.js +69 -64
- package/lib-prod/env/env.angular-node-app.js.map +1 -0
- package/lib-prod/env/env.docs-webapp.d.ts +64 -0
- package/lib-prod/env/env.docs-webapp.js +69 -64
- package/lib-prod/env/env.docs-webapp.js.map +1 -0
- package/lib-prod/env/env.electron-app.d.ts +64 -0
- package/lib-prod/env/env.electron-app.js +69 -64
- package/lib-prod/env/env.electron-app.js.map +1 -0
- package/lib-prod/env/env.mobile-app.d.ts +64 -0
- package/lib-prod/env/env.mobile-app.js +69 -64
- package/lib-prod/env/env.mobile-app.js.map +1 -0
- package/lib-prod/env/env.npm-lib-and-cli-tool.d.ts +64 -0
- package/lib-prod/env/env.npm-lib-and-cli-tool.js +69 -64
- package/lib-prod/env/env.npm-lib-and-cli-tool.js.map +1 -0
- package/lib-prod/env/env.vscode-plugin.d.ts +64 -0
- package/lib-prod/env/env.vscode-plugin.js +69 -64
- package/lib-prod/env/env.vscode-plugin.js.map +1 -0
- package/lib-prod/env/index.d.ts +6 -0
- package/lib-prod/env/index.js +23 -6
- package/lib-prod/env/index.js.map +1 -0
- package/lib-prod/express-types.d.ts +1 -0
- package/lib-prod/express-types.js +3 -1
- package/lib-prod/express-types.js.map +1 -0
- package/lib-prod/formly/formly.models.d.ts +1 -0
- package/lib-prod/formly/formly.models.js +3 -1
- package/lib-prod/formly/formly.models.js.map +1 -0
- package/lib-prod/formly/fromly.d.ts +16 -0
- package/lib-prod/formly/fromly.js +33 -29
- package/lib-prod/formly/fromly.js.map +1 -0
- package/lib-prod/formly/type-from-entity.d.ts +20 -0
- package/lib-prod/formly/type-from-entity.js +24 -15
- package/lib-prod/formly/type-from-entity.js.map +1 -0
- package/lib-prod/get-response-value.d.ts +6 -0
- package/lib-prod/get-response-value.js +6 -1
- package/lib-prod/get-response-value.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/index.d.ts +5 -0
- package/lib-prod/global-state/taon-global-state/index.js +22 -5
- package/lib-prod/global-state/taon-global-state/index.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.d.ts +19 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.js +18 -14
- package/lib-prod/global-state/taon-global-state/taon-global-state.abstract.context.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.constants.d.ts +2 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.constants.js +7 -3
- package/lib-prod/global-state/taon-global-state/taon-global-state.constants.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.controller.d.ts +11 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.controller.js +38 -19
- package/lib-prod/global-state/taon-global-state/taon-global-state.controller.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.entity.d.ts +7 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.entity.js +41 -12
- package/lib-prod/global-state/taon-global-state/taon-global-state.entity.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.middleware.d.ts +3 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.middleware.js +16 -6
- package/lib-prod/global-state/taon-global-state/taon-global-state.middleware.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.models.d.ts +28 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.models.js +7 -3
- package/lib-prod/global-state/taon-global-state/taon-global-state.models.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.provider.d.ts +3 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.provider.js +16 -6
- package/lib-prod/global-state/taon-global-state/taon-global-state.provider.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.repository.d.ts +9 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.repository.js +23 -16
- package/lib-prod/global-state/taon-global-state/taon-global-state.repository.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.subscriber.d.ts +7 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.subscriber.js +20 -13
- package/lib-prod/global-state/taon-global-state/taon-global-state.subscriber.js.map +1 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.utils.d.ts +2 -0
- package/lib-prod/global-state/taon-global-state/taon-global-state.utils.js +8 -3
- package/lib-prod/global-state/taon-global-state/taon-global-state.utils.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/index.d.ts +10 -0
- package/lib-prod/global-state/taon-transaction-registry/index.js +27 -10
- package/lib-prod/global-state/taon-transaction-registry/index.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.d.ts +19 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.js +20 -16
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.abstract.context.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.constants.d.ts +2 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.constants.js +5 -1
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.constants.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.d.ts +9 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.js +33 -18
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.controller.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.entity.d.ts +12 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.entity.js +55 -14
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.entity.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.middleware.d.ts +3 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.middleware.js +16 -6
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.middleware.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.models.d.ts +6 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.models.js +6 -2
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.models.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.provider.d.ts +3 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.provider.js +16 -6
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.provider.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.repository.d.ts +9 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.repository.js +20 -13
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.repository.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.d.ts +7 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.js +20 -13
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.subscriber.js.map +1 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.d.ts +2 -0
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.js +5 -1
- package/lib-prod/global-state/taon-transaction-registry/taon-transaction-registry.utils.js.map +1 -0
- package/lib-prod/helpers/class-helpers.d.ts +22 -0
- package/lib-prod/helpers/class-helpers.js +78 -60
- package/lib-prod/helpers/class-helpers.js.map +1 -0
- package/lib-prod/helpers/clone-obj.d.ts +1 -0
- package/lib-prod/helpers/clone-obj.js +12 -7
- package/lib-prod/helpers/clone-obj.js.map +1 -0
- package/lib-prod/helpers/taon-helpers.d.ts +16 -0
- package/lib-prod/helpers/taon-helpers.js +36 -21
- package/lib-prod/helpers/taon-helpers.js.map +1 -0
- package/lib-prod/index._auto-generated_.d.ts +0 -0
- package/lib-prod/index._auto-generated_.js +2 -1
- package/lib-prod/index._auto-generated_.js.map +1 -0
- package/lib-prod/index.d.ts +230 -0
- package/lib-prod/index.js +94 -73
- package/lib-prod/index.js.map +1 -0
- package/lib-prod/inject.d.ts +4 -0
- package/lib-prod/inject.js +9 -4
- package/lib-prod/inject.js.map +1 -0
- package/lib-prod/migrations/index.d.ts +1 -0
- package/lib-prod/migrations/index.js +18 -1
- package/lib-prod/migrations/index.js.map +1 -0
- package/lib-prod/migrations/migrations_index._auto-generated_.d.ts +0 -0
- package/lib-prod/migrations/migrations_index._auto-generated_.js +1 -0
- package/lib-prod/migrations/migrations_index._auto-generated_.js.map +1 -0
- package/lib-prod/models.d.ts +255 -0
- package/lib-prod/models.js +53 -14
- package/lib-prod/models.js.map +1 -0
- package/lib-prod/orm/columns.d.ts +32 -0
- package/lib-prod/orm/columns.js +70 -22
- package/lib-prod/orm/columns.js.map +1 -0
- package/lib-prod/orm/index.d.ts +1 -0
- package/lib-prod/orm/index.js +18 -1
- package/lib-prod/orm/index.js.map +1 -0
- package/lib-prod/package.json +1 -1
- package/lib-prod/realtime/realtime-client.d.ts +41 -0
- package/lib-prod/realtime/realtime-client.js +30 -24
- package/lib-prod/realtime/realtime-client.js.map +1 -0
- package/lib-prod/realtime/realtime-core.d.ts +40 -0
- package/lib-prod/realtime/realtime-core.js +51 -26
- package/lib-prod/realtime/realtime-core.js.map +1 -0
- package/lib-prod/realtime/realtime-server.d.ts +43 -0
- package/lib-prod/realtime/realtime-server.js +34 -28
- package/lib-prod/realtime/realtime-server.js.map +1 -0
- package/lib-prod/realtime/realtime-strategy/index.d.ts +4 -0
- package/lib-prod/realtime/realtime-strategy/index.js +21 -4
- package/lib-prod/realtime/realtime-strategy/index.js.map +1 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.d.ts +80 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.js +41 -24
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-ipc.js.map +1 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.d.ts +14 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.js +34 -20
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-mock.js.map +1 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-socket-io.d.ts +16 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-socket-io.js +12 -6
- package/lib-prod/realtime/realtime-strategy/realtime-strategy-socket-io.js.map +1 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy.d.ts +11 -0
- package/lib-prod/realtime/realtime-strategy/realtime-strategy.js +7 -1
- package/lib-prod/realtime/realtime-strategy/realtime-strategy.js.map +1 -0
- package/lib-prod/realtime/realtime-subs-manager.d.ts +14 -0
- package/lib-prod/realtime/realtime-subs-manager.js +19 -13
- package/lib-prod/realtime/realtime-subs-manager.js.map +1 -0
- package/lib-prod/realtime/realtime.models.d.ts +25 -0
- package/lib-prod/realtime/realtime.models.js +3 -1
- package/lib-prod/realtime/realtime.models.js.map +1 -0
- package/lib-prod/symbols.d.ts +63 -0
- package/lib-prod/symbols.js +20 -19
- package/lib-prod/symbols.js.map +1 -0
- package/lib-prod/ui/index.d.ts +1 -0
- package/lib-prod/ui/index.js +5 -1
- package/lib-prod/ui/index.js.map +1 -0
- package/lib-prod/ui/taon-admin-mode-configuration/index.d.ts +1 -0
- package/lib-prod/ui/taon-admin-mode-configuration/index.js +5 -1
- package/lib-prod/ui/taon-admin-mode-configuration/index.js.map +1 -0
- package/lib-prod/validators.d.ts +5 -0
- package/lib-prod/validators.js +20 -12
- package/lib-prod/validators.js.map +1 -0
- package/lib-prod.split-namespaces.json +91 -31
- package/package.json +1 -1
- package/websql/README.md +24 -24
- package/websql/fesm2022/taon-websql.mjs.map +1 -1
- package/websql/package.json +1 -1
- package/websql-prod/README.md +24 -24
- package/websql-prod/fesm2022/taon-websql.mjs.map +1 -1
- package/websql-prod/package.json +1 -1
|
@@ -1,30 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EndpointContext = void 0;
|
|
4
|
+
const url_1 = require("url"); // @backend
|
|
5
|
+
const axios_1 = require("axios");
|
|
6
|
+
const electron_1 = require("electron"); // @backend
|
|
7
|
+
const lib_prod_1 = require("json10/lib-prod");
|
|
8
|
+
const lib_prod_2 = require("lodash-walk-object/lib-prod");
|
|
9
|
+
const lib_prod_3 = require("ng2-rest/lib-prod");
|
|
10
|
+
const rxjs_1 = require("rxjs");
|
|
11
|
+
const lib_prod_4 = require("taon-typeorm/lib-prod"); // @websql
|
|
12
|
+
const lib_prod_5 = require("taon-typeorm/lib-prod"); // @websql
|
|
13
|
+
const lib_prod_6 = require("taon-typeorm/lib-prod");
|
|
14
|
+
const lib_prod_7 = require("tnp-core/lib-prod");
|
|
15
|
+
const lib_prod_8 = require("tnp-core/lib-prod");
|
|
16
|
+
const lib_prod_9 = require("tnp-core/lib-prod");
|
|
17
|
+
const lib_prod_10 = require("tnp-core/lib-prod"); // @backend
|
|
18
|
+
const lib_prod_11 = require("tnp-core/lib-prod");
|
|
19
|
+
const lib_prod_12 = require("tnp-core/lib-prod");
|
|
20
|
+
const lib_prod_13 = require("tnp-core/lib-prod");
|
|
21
|
+
const constants_1 = require("./constants");
|
|
22
|
+
const context_db_migrations_1 = require("./context-db-migrations");
|
|
23
|
+
const di_container_1 = require("./dependency-injection/di-container");
|
|
24
|
+
const entity_process_1 = require("./entity-process");
|
|
25
|
+
const get_response_value_1 = require("./get-response-value");
|
|
26
|
+
const class_helpers_1 = require("./helpers/class-helpers");
|
|
27
|
+
const taon_helpers_1 = require("./helpers/taon-helpers");
|
|
28
|
+
const models_1 = require("./models");
|
|
29
|
+
const realtime_core_1 = require("./realtime/realtime-core");
|
|
30
|
+
const symbols_1 = require("./symbols");
|
|
28
31
|
/* */
|
|
29
32
|
//#endregion
|
|
30
33
|
let bodyParser;
|
|
@@ -34,23 +37,113 @@ let express;
|
|
|
34
37
|
let methodOverride;
|
|
35
38
|
let expressSession;
|
|
36
39
|
//#region @backend
|
|
37
|
-
bodyParser = requireDefault('body-parser');
|
|
38
|
-
cookieParser = requireDefault('cookie-parser');
|
|
39
|
-
cors = requireDefault('cors');
|
|
40
|
-
express = requireDefault('express');
|
|
41
|
-
methodOverride = requireDefault('method-override');
|
|
42
|
-
expressSession = requireDefault('express-session');
|
|
40
|
+
bodyParser = (0, lib_prod_7.requireDefault)('body-parser');
|
|
41
|
+
cookieParser = (0, lib_prod_7.requireDefault)('cookie-parser');
|
|
42
|
+
cors = (0, lib_prod_7.requireDefault)('cors');
|
|
43
|
+
express = (0, lib_prod_7.requireDefault)('express');
|
|
44
|
+
methodOverride = (0, lib_prod_7.requireDefault)('method-override');
|
|
45
|
+
expressSession = (0, lib_prod_7.requireDefault)('express-session');
|
|
43
46
|
//#endregion
|
|
44
|
-
|
|
47
|
+
class EndpointContext {
|
|
48
|
+
originalConfig;
|
|
49
|
+
configFn;
|
|
50
|
+
cloneOptions;
|
|
51
|
+
//#region fields
|
|
52
|
+
//#region fields / use mariadb mysql in docker
|
|
53
|
+
/**
|
|
54
|
+
* JUST FOR TESTING PURPOSES
|
|
55
|
+
*/
|
|
56
|
+
USE_MARIADB_MYSQL_IN_DOCKER = false;
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region fields / flags
|
|
59
|
+
disabledRealtime = false;
|
|
60
|
+
/**
|
|
61
|
+
* check whether context is inited
|
|
62
|
+
* (with init() function )
|
|
63
|
+
*/
|
|
64
|
+
inited = false;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region fields / db migrations
|
|
67
|
+
dbMigrations = new context_db_migrations_1.ContextDbMigrations(this);
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region fields / local instance obj symbol
|
|
70
|
+
localInstaceObjSymbol = Symbol('localInstaceObjSymbol');
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region fields / all instances of classes from context
|
|
73
|
+
/**
|
|
74
|
+
* all instances of classes from context
|
|
75
|
+
* key is class name
|
|
76
|
+
*/
|
|
77
|
+
allClassesInstances = {};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region fields / class instances by name
|
|
80
|
+
classInstancesByNameObj = {};
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region fields / obj with classes instances arr
|
|
83
|
+
objWithClassesInstancesArr = {};
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region fields / active routes
|
|
86
|
+
activeRoutes = [];
|
|
87
|
+
//#endregion
|
|
88
|
+
//#region fields / typeorm repositories
|
|
89
|
+
//#region @websql
|
|
90
|
+
repos = new Map();
|
|
45
91
|
//#endregion
|
|
46
92
|
//#endregion
|
|
47
93
|
//#region fields / source context
|
|
48
94
|
get sourceContext() {
|
|
49
95
|
return this.cloneOptions?.sourceContext;
|
|
50
96
|
}
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region fields / skip writing server routes
|
|
99
|
+
skipWritingServerRoutes = false;
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region fields / types from contexts
|
|
102
|
+
injectableTypesfromContexts = [
|
|
103
|
+
models_1.Models__NS__ClassType.CONTROLLER,
|
|
104
|
+
models_1.Models__NS__ClassType.PROVIDER,
|
|
105
|
+
models_1.Models__NS__ClassType.MIDDLEWARE,
|
|
106
|
+
models_1.Models__NS__ClassType.REPOSITORY,
|
|
107
|
+
models_1.Models__NS__ClassType.SUBSCRIBER,
|
|
108
|
+
models_1.Models__NS__ClassType.MIGRATION,
|
|
109
|
+
];
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region fields / all types from contexts
|
|
112
|
+
allTypesfromContexts = [
|
|
113
|
+
...this.injectableTypesfromContexts,
|
|
114
|
+
models_1.Models__NS__ClassType.ENTITY,
|
|
115
|
+
];
|
|
116
|
+
//#endregion
|
|
117
|
+
//#region fields / express app
|
|
118
|
+
expressApp = {};
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region fields / server tcp udp
|
|
121
|
+
serverTcpUdp;
|
|
122
|
+
//#endregion
|
|
123
|
+
//#region fields / database config
|
|
124
|
+
databaseConfig;
|
|
125
|
+
//#endregion
|
|
126
|
+
//#region fields / mode
|
|
127
|
+
mode;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region fields / only migration start
|
|
130
|
+
onlyMigrationRun = false;
|
|
131
|
+
onlyMigrationRevertToTimestamp = undefined;
|
|
51
132
|
get isRunOrRevertOnlyMigrationAppStart() {
|
|
52
133
|
return !!(this.onlyMigrationRun || this.onlyMigrationRevertToTimestamp);
|
|
53
134
|
}
|
|
135
|
+
//#endregion
|
|
136
|
+
//#region fields / session
|
|
137
|
+
session;
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region fields / connection
|
|
140
|
+
connection;
|
|
141
|
+
//#endregion
|
|
142
|
+
//#region fields / entities triggers
|
|
143
|
+
entitiesTriggers = {};
|
|
144
|
+
//#endregion
|
|
145
|
+
//#region fields / realtime
|
|
146
|
+
realtime;
|
|
54
147
|
get realtimeClient() {
|
|
55
148
|
return this.realtime.client;
|
|
56
149
|
}
|
|
@@ -58,43 +151,56 @@ export class EndpointContext {
|
|
|
58
151
|
return this.realtime.server;
|
|
59
152
|
}
|
|
60
153
|
//#endregion
|
|
154
|
+
//#region fields / config
|
|
155
|
+
/**
|
|
156
|
+
* available after init()
|
|
157
|
+
*/
|
|
158
|
+
config;
|
|
159
|
+
//#endregion
|
|
61
160
|
//#region fields / logs
|
|
62
161
|
get logHttp() {
|
|
63
|
-
if (___NS__isObject(this.config?.logs)) {
|
|
162
|
+
if ((0, lib_prod_13.___NS__isObject)(this.config?.logs)) {
|
|
64
163
|
return !!this.config.logs.http;
|
|
65
164
|
}
|
|
66
165
|
return this.config?.logs === true;
|
|
67
166
|
}
|
|
68
167
|
get logRealtime() {
|
|
69
|
-
if (___NS__isObject(this.config?.logs)) {
|
|
168
|
+
if ((0, lib_prod_13.___NS__isObject)(this.config?.logs)) {
|
|
70
169
|
return !!this.config.logs.realtime;
|
|
71
170
|
}
|
|
72
171
|
return this.config?.logs === true;
|
|
73
172
|
}
|
|
74
173
|
get logFramework() {
|
|
75
|
-
if (___NS__isObject(this.config?.logs)) {
|
|
174
|
+
if ((0, lib_prod_13.___NS__isObject)(this.config?.logs)) {
|
|
76
175
|
return !!this.config.logs.framework;
|
|
77
176
|
}
|
|
78
177
|
return this.config?.logs === true;
|
|
79
178
|
}
|
|
80
179
|
get logRoutes() {
|
|
81
|
-
if (___NS__isObject(this.config?.logs)) {
|
|
180
|
+
if ((0, lib_prod_13.___NS__isObject)(this.config?.logs)) {
|
|
82
181
|
return !!this.config.logs.routes;
|
|
83
182
|
}
|
|
84
183
|
return this.config?.logs === true;
|
|
85
184
|
}
|
|
86
185
|
get logDb() {
|
|
87
|
-
if (___NS__isObject(this.config?.logs)) {
|
|
186
|
+
if ((0, lib_prod_13.___NS__isObject)(this.config?.logs)) {
|
|
88
187
|
return !!this.config.logs.db;
|
|
89
188
|
}
|
|
90
189
|
return this.config?.logs === true;
|
|
91
190
|
}
|
|
92
191
|
get logMigrations() {
|
|
93
|
-
if (___NS__isObject(this.config?.logs)) {
|
|
192
|
+
if ((0, lib_prod_13.___NS__isObject)(this.config?.logs)) {
|
|
94
193
|
return !!this.config.logs.migrations;
|
|
95
194
|
}
|
|
96
195
|
return this.config?.logs === true;
|
|
97
196
|
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region constructor
|
|
200
|
+
/**
|
|
201
|
+
* Inside docker there is not need for https secure server
|
|
202
|
+
*/
|
|
203
|
+
isRunningInsideDocker = false;
|
|
98
204
|
constructor(originalConfig, configFn,
|
|
99
205
|
/**
|
|
100
206
|
* (@default: false)
|
|
@@ -106,180 +212,8 @@ export class EndpointContext {
|
|
|
106
212
|
this.originalConfig = originalConfig;
|
|
107
213
|
this.configFn = configFn;
|
|
108
214
|
this.cloneOptions = cloneOptions;
|
|
109
|
-
//#region fields
|
|
110
|
-
//#region fields / use mariadb mysql in docker
|
|
111
|
-
/**
|
|
112
|
-
* JUST FOR TESTING PURPOSES
|
|
113
|
-
*/
|
|
114
|
-
this.USE_MARIADB_MYSQL_IN_DOCKER = false;
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region fields / flags
|
|
117
|
-
this.disabledRealtime = false;
|
|
118
|
-
/**
|
|
119
|
-
* check whether context is inited
|
|
120
|
-
* (with init() function )
|
|
121
|
-
*/
|
|
122
|
-
this.inited = false;
|
|
123
|
-
//#endregion
|
|
124
|
-
//#region fields / db migrations
|
|
125
|
-
this.dbMigrations = new ContextDbMigrations(this);
|
|
126
|
-
//#endregion
|
|
127
|
-
//#region fields / local instance obj symbol
|
|
128
|
-
this.localInstaceObjSymbol = Symbol('localInstaceObjSymbol');
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region fields / all instances of classes from context
|
|
131
|
-
/**
|
|
132
|
-
* all instances of classes from context
|
|
133
|
-
* key is class name
|
|
134
|
-
*/
|
|
135
|
-
this.allClassesInstances = {};
|
|
136
|
-
//#endregion
|
|
137
|
-
//#region fields / class instances by name
|
|
138
|
-
this.classInstancesByNameObj = {};
|
|
139
|
-
//#endregion
|
|
140
|
-
//#region fields / obj with classes instances arr
|
|
141
|
-
this.objWithClassesInstancesArr = {};
|
|
142
|
-
//#endregion
|
|
143
|
-
//#region fields / active routes
|
|
144
|
-
this.activeRoutes = [];
|
|
145
|
-
//#endregion
|
|
146
|
-
//#region fields / typeorm repositories
|
|
147
|
-
//#region @websql
|
|
148
|
-
this.repos = new Map();
|
|
149
|
-
//#endregion
|
|
150
|
-
//#region fields / skip writing server routes
|
|
151
|
-
this.skipWritingServerRoutes = false;
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region fields / types from contexts
|
|
154
|
-
this.injectableTypesfromContexts = [
|
|
155
|
-
Models.ClassType.CONTROLLER,
|
|
156
|
-
Models.ClassType.PROVIDER,
|
|
157
|
-
Models.ClassType.MIDDLEWARE,
|
|
158
|
-
Models.ClassType.REPOSITORY,
|
|
159
|
-
Models.ClassType.SUBSCRIBER,
|
|
160
|
-
Models.ClassType.MIGRATION,
|
|
161
|
-
];
|
|
162
|
-
//#endregion
|
|
163
|
-
//#region fields / all types from contexts
|
|
164
|
-
this.allTypesfromContexts = [
|
|
165
|
-
...this.injectableTypesfromContexts,
|
|
166
|
-
Models.ClassType.ENTITY,
|
|
167
|
-
];
|
|
168
|
-
//#endregion
|
|
169
|
-
//#region fields / express app
|
|
170
|
-
this.expressApp = {};
|
|
171
|
-
//#endregion
|
|
172
|
-
//#region fields / only migration start
|
|
173
|
-
this.onlyMigrationRun = false;
|
|
174
|
-
this.onlyMigrationRevertToTimestamp = undefined;
|
|
175
|
-
//#endregion
|
|
176
|
-
//#region fields / entities triggers
|
|
177
|
-
this.entitiesTriggers = {};
|
|
178
|
-
//#endregion
|
|
179
|
-
//#endregion
|
|
180
|
-
//#region constructor
|
|
181
|
-
/**
|
|
182
|
-
* Inside docker there is not need for https secure server
|
|
183
|
-
*/
|
|
184
|
-
this.isRunningInsideDocker = false;
|
|
185
|
-
//#endregion
|
|
186
|
-
//#region methods & getters / clone class
|
|
187
|
-
this.cloneClassWithNewMetadata = ({ TaonBaseClass, className, config, ctx, classType, }) => {
|
|
188
|
-
// Return a new class that extends the base class
|
|
189
|
-
const cloneClass = () => {
|
|
190
|
-
var _a, _b, _c, _d, _e;
|
|
191
|
-
if (TaonBaseClass[Symbols__NS__fullClassNameStaticProperty] ===
|
|
192
|
-
`${ctx.contextName}.${className}`) {
|
|
193
|
-
return TaonBaseClass;
|
|
194
|
-
}
|
|
195
|
-
return class extends TaonBaseClass {
|
|
196
|
-
constructor() {
|
|
197
|
-
// static ['_'] = TaonBaseClass['_'];
|
|
198
|
-
super(...arguments);
|
|
199
|
-
this[_e] = ctx;
|
|
200
|
-
// You can override prototype properties or methods here if needed
|
|
201
|
-
// static properties override allowed
|
|
202
|
-
}
|
|
203
|
-
static { _a = Symbols__NS__orignalClass, _b = Symbols__NS__fullClassNameStaticProperty, _c = Symbols__NS__classNameStaticProperty, _d = Symbols__NS__ctxInClassOrClassObj, _e = Symbols__NS__ctxInClassOrClassObj; }
|
|
204
|
-
// @ts-ignore
|
|
205
|
-
static { this[_a] = TaonBaseClass; }
|
|
206
|
-
// @ts-ignore
|
|
207
|
-
static { this[_b] = `${ctx.contextName}.${className}`; }
|
|
208
|
-
// @ts-ignore
|
|
209
|
-
static { this[_c] = className; }
|
|
210
|
-
static { this[_d] = ctx; }
|
|
211
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
212
|
-
static __getFullPathForClass__(arr = []) {
|
|
213
|
-
const name = this[Symbols__NS__fullClassNameStaticProperty];
|
|
214
|
-
arr.push(name);
|
|
215
|
-
// @ts-ignore
|
|
216
|
-
if (this[Symbols__NS__orignalClass] && // @ts-ignore
|
|
217
|
-
this[Symbols__NS__orignalClass].__getFullPathForClass__) {
|
|
218
|
-
// @ts-ignore
|
|
219
|
-
this[Symbols__NS__orignalClass].__getFullPathForClass__(arr);
|
|
220
|
-
}
|
|
221
|
-
return arr.join('/');
|
|
222
|
-
}
|
|
223
|
-
static get fullPathForClass() {
|
|
224
|
-
return this.__getFullPathForClass__();
|
|
225
|
-
}
|
|
226
|
-
};
|
|
227
|
-
};
|
|
228
|
-
const cloneClassFunction = cloneClass();
|
|
229
|
-
//#region gather all instances for all contexts
|
|
230
|
-
// TODO this is not needed anymore - for typeorm I use normal entities
|
|
231
|
-
// this thinng belowe is nice for debugging purpose
|
|
232
|
-
// if (___NS__isUndefined(cloneClassFunction[Symbols__NS__orignalClassClonesObj])) {
|
|
233
|
-
// cloneClassFunction[Symbols__NS__orignalClassClonesObj] = {};
|
|
234
|
-
// }
|
|
235
|
-
// if (___NS__isUndefined(TaonBaseClass[Symbols__NS__orignalClassClonesObj])) {
|
|
236
|
-
// TaonBaseClass[Symbols__NS__orignalClassClonesObj] = {};
|
|
237
|
-
// }
|
|
238
|
-
// const all = {
|
|
239
|
-
// ...TaonBaseClass[Symbols__NS__orignalClassClonesObj],
|
|
240
|
-
// ...cloneClassFunction[Symbols__NS__orignalClassClonesObj],
|
|
241
|
-
// };
|
|
242
|
-
// all[ctx.contextName] = cloneClassFunction;
|
|
243
|
-
// cloneClassFunction[Symbols__NS__orignalClassClonesObj] = all;
|
|
244
|
-
// TaonBaseClass[Symbols__NS__orignalClassClonesObj] = all;
|
|
245
|
-
//#endregion
|
|
246
|
-
return cloneClassFunction;
|
|
247
|
-
};
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region methods & getters / clone classes obj with new metadata
|
|
250
|
-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
251
|
-
this.cloneClassesObjWithNewMetadata = ({ classesInput, config, ctx, classType, }) => {
|
|
252
|
-
const classes = {};
|
|
253
|
-
// console.log(Object.keys(classesInput))
|
|
254
|
-
for (const key of Object.keys(classesInput || {})) {
|
|
255
|
-
const TaonBaseClass = classesInput[key];
|
|
256
|
-
if (!TaonBaseClass) {
|
|
257
|
-
Helpers__NS__error(`Class ${key} is not defined in context ${ctx.contextName}
|
|
258
|
-
|
|
259
|
-
Please check if you have correct import in context file
|
|
260
|
-
|
|
261
|
-
`);
|
|
262
|
-
}
|
|
263
|
-
var className = Reflect.getMetadata(Symbols__NS__metadata.className, TaonBaseClass);
|
|
264
|
-
// console.log('Metadata className', className, TaonBaseClass);
|
|
265
|
-
// if (!className) {
|
|
266
|
-
// console.warn(`Please provide className for ${TaonBaseClass.name} class`);
|
|
267
|
-
// }
|
|
268
|
-
className = className || key;
|
|
269
|
-
TaonBaseClass[Symbols__NS__classNameStaticProperty] = className;
|
|
270
|
-
const clonedClass = this.cloneClassWithNewMetadata({
|
|
271
|
-
TaonBaseClass,
|
|
272
|
-
className,
|
|
273
|
-
config,
|
|
274
|
-
ctx,
|
|
275
|
-
classType,
|
|
276
|
-
});
|
|
277
|
-
classes[className] = clonedClass;
|
|
278
|
-
}
|
|
279
|
-
return classes;
|
|
280
|
-
};
|
|
281
215
|
this.cloneOptions = this.cloneOptions || {};
|
|
282
|
-
this.isRunningInsideDocker = UtilsOs__NS__isRunningInDocker();
|
|
216
|
+
this.isRunningInsideDocker = (0, lib_prod_11.UtilsOs__NS__isRunningInDocker)();
|
|
283
217
|
}
|
|
284
218
|
//#endregion
|
|
285
219
|
//#region methods & getters / init
|
|
@@ -291,8 +225,8 @@ export class EndpointContext {
|
|
|
291
225
|
// @ts-ignore
|
|
292
226
|
this.onlyMigrationRevertToTimestamp = onlyMigrationRevertToTimestamp;
|
|
293
227
|
this.config = this.configFn({});
|
|
294
|
-
if (___NS__isObject(this.config.database)) {
|
|
295
|
-
this.config.database =
|
|
228
|
+
if ((0, lib_prod_13.___NS__isObject)(this.config.database)) {
|
|
229
|
+
this.config.database = models_1.Models__NS__DatabaseConfig.from(this.config.database).databaseConfigTypeORM;
|
|
296
230
|
}
|
|
297
231
|
this.config.host = this.host === null ? void 0 : this.host;
|
|
298
232
|
if (this.cloneOptions.overrideHost &&
|
|
@@ -306,15 +240,15 @@ export class EndpointContext {
|
|
|
306
240
|
if (this.config.host &&
|
|
307
241
|
!this.config.host.startsWith('http://') &&
|
|
308
242
|
!this.config.host.startsWith('https://')) {
|
|
309
|
-
Helpers__NS__throwError(`[taon-config] Your${this.host ? ' remote' : ''} 'host' must start with http:// or https://`);
|
|
243
|
+
(0, lib_prod_13.Helpers__NS__throwError)(`[taon-config] Your${this.host ? ' remote' : ''} 'host' must start with http:// or https://`);
|
|
310
244
|
}
|
|
311
|
-
if (___NS__isUndefined(this.config.useIpcWhenElectron)) {
|
|
245
|
+
if ((0, lib_prod_13.___NS__isUndefined)(this.config.useIpcWhenElectron)) {
|
|
312
246
|
this.config.useIpcWhenElectron = true;
|
|
313
247
|
}
|
|
314
248
|
// console.log(`config for ${this.contextName}`, this.config);
|
|
315
249
|
//#region resolve if skipping writing server routes
|
|
316
250
|
//@ts-expect-error overriding readonly
|
|
317
|
-
this.skipWritingServerRoutes = ___NS__isBoolean(this.config.skipWritingServerRoutes)
|
|
251
|
+
this.skipWritingServerRoutes = (0, lib_prod_13.___NS__isBoolean)(this.config.skipWritingServerRoutes)
|
|
318
252
|
? this.config.skipWritingServerRoutes
|
|
319
253
|
: false;
|
|
320
254
|
//#endregion
|
|
@@ -331,8 +265,8 @@ export class EndpointContext {
|
|
|
331
265
|
// useIpcWhenElectron: ${this.config.useIpcWhenElectron}
|
|
332
266
|
// UtilsOs__NS__isElectron: ${UtilsOs__NS__isElectron}
|
|
333
267
|
// `)
|
|
334
|
-
if (this.config.useIpcWhenElectron && UtilsOs__NS__isElectron) {
|
|
335
|
-
if (UtilsOs__NS__isWebSQL) {
|
|
268
|
+
if (this.config.useIpcWhenElectron && lib_prod_11.UtilsOs__NS__isElectron) {
|
|
269
|
+
if (lib_prod_11.UtilsOs__NS__isWebSQL) {
|
|
336
270
|
this.mode = 'backend-frontend(websql-electron)';
|
|
337
271
|
}
|
|
338
272
|
else {
|
|
@@ -347,7 +281,7 @@ export class EndpointContext {
|
|
|
347
281
|
if (!this.mode && !this.config.abstract) {
|
|
348
282
|
const errMsg = `You need to provide host property or ` +
|
|
349
283
|
`useIpcWhenElectron or mark it as abstract`;
|
|
350
|
-
Helpers__NS__error(`[taon][Context=${this.contextName}]: ${errMsg}`, false, true);
|
|
284
|
+
(0, lib_prod_13.Helpers__NS__error)(`[taon][Context=${this.contextName}]: ${errMsg}`, false, true);
|
|
351
285
|
//#region @backend
|
|
352
286
|
process.exit(1);
|
|
353
287
|
//#endregion
|
|
@@ -363,7 +297,7 @@ export class EndpointContext {
|
|
|
363
297
|
`);
|
|
364
298
|
this.databaseConfig = this.getAutoGeneratedConfig();
|
|
365
299
|
}
|
|
366
|
-
else if (___NS__isObject(this.config.database)) {
|
|
300
|
+
else if ((0, lib_prod_13.___NS__isObject)(this.config.database)) {
|
|
367
301
|
this.logFramework &&
|
|
368
302
|
console.log(`
|
|
369
303
|
|
|
@@ -371,14 +305,14 @@ export class EndpointContext {
|
|
|
371
305
|
|
|
372
306
|
`);
|
|
373
307
|
this.databaseConfig = this.getAutoGeneratedConfig();
|
|
374
|
-
walk.Object(this.config.database, (value, lodashPath) => {
|
|
375
|
-
if (___NS__isNil(value) || ___NS__isFunction(value) || ___NS__isObject(value)) {
|
|
308
|
+
lib_prod_2.walk.Object(this.config.database, (value, lodashPath) => {
|
|
309
|
+
if ((0, lib_prod_13.___NS__isNil)(value) || (0, lib_prod_13.___NS__isFunction)(value) || (0, lib_prod_13.___NS__isObject)(value)) {
|
|
376
310
|
// skipping
|
|
377
311
|
}
|
|
378
312
|
else {
|
|
379
313
|
this.logFramework &&
|
|
380
314
|
console.info(`Overriding database config: ${lodashPath}=${value}`);
|
|
381
|
-
___NS__set(this.databaseConfig, lodashPath, value);
|
|
315
|
+
(0, lib_prod_13.___NS__set)(this.databaseConfig, lodashPath, value);
|
|
382
316
|
}
|
|
383
317
|
}, {
|
|
384
318
|
walkGetters: false,
|
|
@@ -387,13 +321,13 @@ export class EndpointContext {
|
|
|
387
321
|
//#endregion
|
|
388
322
|
//#region resolve session
|
|
389
323
|
if (this.config.session) {
|
|
390
|
-
this.session = ___NS__cloneDeep(this.config.session);
|
|
324
|
+
this.session = (0, lib_prod_13.___NS__cloneDeep)(this.config.session);
|
|
391
325
|
const oneHour = 1000 * 60 * 60 * 1; // 24;
|
|
392
326
|
if (!this.session.cookieMaxAge) {
|
|
393
327
|
this.session.cookieMaxAge = oneHour;
|
|
394
328
|
}
|
|
395
329
|
// serever and browser cookie authentication
|
|
396
|
-
|
|
330
|
+
axios_1.default.defaults.withCredentials = true;
|
|
397
331
|
}
|
|
398
332
|
//#endregion
|
|
399
333
|
//#region prepare & gather all classes recursively
|
|
@@ -405,31 +339,31 @@ export class EndpointContext {
|
|
|
405
339
|
this.config.subscribers = this.config.subscribers || {};
|
|
406
340
|
this.config.migrations = this.config.migrations || {};
|
|
407
341
|
this.config.entities = {
|
|
408
|
-
...(await this.getRecrusiveClassesfromContextsObj(
|
|
342
|
+
...(await this.getRecrusiveClassesfromContextsObj(models_1.Models__NS__ClassType.ENTITY)),
|
|
409
343
|
...this.config.entities,
|
|
410
344
|
};
|
|
411
345
|
this.config.controllers = {
|
|
412
|
-
...(await this.getRecrusiveClassesfromContextsObj(
|
|
346
|
+
...(await this.getRecrusiveClassesfromContextsObj(models_1.Models__NS__ClassType.CONTROLLER)),
|
|
413
347
|
...this.config.controllers,
|
|
414
348
|
};
|
|
415
349
|
this.config.providers = {
|
|
416
|
-
...(await this.getRecrusiveClassesfromContextsObj(
|
|
350
|
+
...(await this.getRecrusiveClassesfromContextsObj(models_1.Models__NS__ClassType.PROVIDER)),
|
|
417
351
|
...this.config.providers,
|
|
418
352
|
};
|
|
419
353
|
this.config.middlewares = {
|
|
420
|
-
...(await this.getRecrusiveClassesfromContextsObj(
|
|
354
|
+
...(await this.getRecrusiveClassesfromContextsObj(models_1.Models__NS__ClassType.MIDDLEWARE)),
|
|
421
355
|
...this.config.middlewares,
|
|
422
356
|
};
|
|
423
357
|
this.config.subscribers = {
|
|
424
|
-
...(await this.getRecrusiveClassesfromContextsObj(
|
|
358
|
+
...(await this.getRecrusiveClassesfromContextsObj(models_1.Models__NS__ClassType.SUBSCRIBER)),
|
|
425
359
|
...this.config.subscribers,
|
|
426
360
|
};
|
|
427
361
|
this.config.repositories = {
|
|
428
|
-
...(await this.getRecrusiveClassesfromContextsObj(
|
|
362
|
+
...(await this.getRecrusiveClassesfromContextsObj(models_1.Models__NS__ClassType.REPOSITORY)),
|
|
429
363
|
...this.config.repositories,
|
|
430
364
|
};
|
|
431
365
|
this.config.migrations = {
|
|
432
|
-
...(await this.getRecrusiveClassesfromContextsObj(
|
|
366
|
+
...(await this.getRecrusiveClassesfromContextsObj(models_1.Models__NS__ClassType.MIGRATION)),
|
|
433
367
|
...this.config.migrations,
|
|
434
368
|
};
|
|
435
369
|
// console.log(this.config);
|
|
@@ -440,37 +374,37 @@ export class EndpointContext {
|
|
|
440
374
|
classesInput: this.config.controllers,
|
|
441
375
|
config: this.config,
|
|
442
376
|
ctx: this,
|
|
443
|
-
classType:
|
|
377
|
+
classType: models_1.Models__NS__ClassType.CONTROLLER,
|
|
444
378
|
});
|
|
445
379
|
this.config.repositories = this.cloneClassesObjWithNewMetadata({
|
|
446
380
|
classesInput: this.config.repositories,
|
|
447
381
|
config: this.config,
|
|
448
382
|
ctx: this,
|
|
449
|
-
classType:
|
|
383
|
+
classType: models_1.Models__NS__ClassType.REPOSITORY,
|
|
450
384
|
});
|
|
451
385
|
this.config.providers = this.cloneClassesObjWithNewMetadata({
|
|
452
386
|
classesInput: this.config.providers,
|
|
453
387
|
config: this.config,
|
|
454
388
|
ctx: this,
|
|
455
|
-
classType:
|
|
389
|
+
classType: models_1.Models__NS__ClassType.PROVIDER,
|
|
456
390
|
});
|
|
457
391
|
this.config.middlewares = this.cloneClassesObjWithNewMetadata({
|
|
458
392
|
classesInput: this.config.middlewares,
|
|
459
393
|
config: this.config,
|
|
460
394
|
ctx: this,
|
|
461
|
-
classType:
|
|
395
|
+
classType: models_1.Models__NS__ClassType.MIDDLEWARE,
|
|
462
396
|
});
|
|
463
397
|
this.config.subscribers = this.cloneClassesObjWithNewMetadata({
|
|
464
398
|
classesInput: this.config.subscribers,
|
|
465
399
|
config: this.config,
|
|
466
400
|
ctx: this,
|
|
467
|
-
classType:
|
|
401
|
+
classType: models_1.Models__NS__ClassType.SUBSCRIBER,
|
|
468
402
|
});
|
|
469
403
|
this.config.migrations = this.cloneClassesObjWithNewMetadata({
|
|
470
404
|
classesInput: this.config.migrations,
|
|
471
405
|
config: this.config,
|
|
472
406
|
ctx: this,
|
|
473
|
-
classType:
|
|
407
|
+
classType: models_1.Models__NS__ClassType.MIGRATION,
|
|
474
408
|
});
|
|
475
409
|
//#endregion
|
|
476
410
|
//#region prepare instances
|
|
@@ -479,7 +413,7 @@ export class EndpointContext {
|
|
|
479
413
|
this.objWithClassesInstancesArr[classTypeName] = [];
|
|
480
414
|
}
|
|
481
415
|
for (const classTypeName of this.injectableTypesfromContexts) {
|
|
482
|
-
await this.createInstances(this.config[Models__NS__ClassTypeKey[classTypeName]], classTypeName);
|
|
416
|
+
await this.createInstances(this.config[models_1.Models__NS__ClassTypeKey[classTypeName]], classTypeName);
|
|
483
417
|
}
|
|
484
418
|
//#endregion
|
|
485
419
|
if (!this.isRunOrRevertOnlyMigrationAppStart) {
|
|
@@ -494,17 +428,17 @@ export class EndpointContext {
|
|
|
494
428
|
await this.initCustomBackendMiddlewares();
|
|
495
429
|
const shouldStartHttpsSecureServer = this.isHttpServer && !this.isRunningInsideDocker;
|
|
496
430
|
this.logFramework &&
|
|
497
|
-
Helpers__NS__info(`
|
|
431
|
+
(0, lib_prod_13.Helpers__NS__info)(`
|
|
498
432
|
|
|
499
433
|
Starting server ${shouldStartHttpsSecureServer ? 'with' : 'without'} HTTPS secure server
|
|
500
434
|
|
|
501
435
|
`);
|
|
502
436
|
this.serverTcpUdp = shouldStartHttpsSecureServer
|
|
503
|
-
? new https.Server({
|
|
437
|
+
? new lib_prod_10.https.Server({
|
|
504
438
|
key: this.config.https?.key,
|
|
505
439
|
cert: this.config.https?.cert,
|
|
506
440
|
}, this.expressApp)
|
|
507
|
-
: new http.Server(this.expressApp);
|
|
441
|
+
: new lib_prod_10.http.Server(this.expressApp);
|
|
508
442
|
this.publicAssets.forEach(asset => {
|
|
509
443
|
this.expressApp.use(asset.serverPath, express.static(asset.locationOnDisk));
|
|
510
444
|
});
|
|
@@ -533,8 +467,8 @@ export class EndpointContext {
|
|
|
533
467
|
// }
|
|
534
468
|
//#endregion
|
|
535
469
|
this.logRealtime &&
|
|
536
|
-
Helpers__NS__info(`[ctx=${this.contextName}] Init Realtime for ${this.mode}`);
|
|
537
|
-
this.realtime = new RealtimeCore(this);
|
|
470
|
+
(0, lib_prod_13.Helpers__NS__info)(`[ctx=${this.contextName}] Init Realtime for ${this.mode}`);
|
|
471
|
+
this.realtime = new realtime_core_1.RealtimeCore(this);
|
|
538
472
|
}
|
|
539
473
|
//#endregion
|
|
540
474
|
}
|
|
@@ -542,16 +476,16 @@ export class EndpointContext {
|
|
|
542
476
|
// console.log({ ref })
|
|
543
477
|
if (this.config.abstract) {
|
|
544
478
|
this.logFramework &&
|
|
545
|
-
Helpers__NS__info(`[taon] Create abstract context: ${this.config.contextName}`);
|
|
479
|
+
(0, lib_prod_13.Helpers__NS__info)(`[taon] Create abstract context: ${this.config.contextName}`);
|
|
546
480
|
}
|
|
547
481
|
else {
|
|
548
482
|
if (this.isRemoteHost) {
|
|
549
483
|
this.logFramework &&
|
|
550
|
-
Helpers__NS__info(`[taon] Create context for remote host: ${this.config.host}`);
|
|
484
|
+
(0, lib_prod_13.Helpers__NS__info)(`[taon] Create context for remote host: ${this.config.host}`);
|
|
551
485
|
}
|
|
552
486
|
else {
|
|
553
487
|
this.logFramework &&
|
|
554
|
-
Helpers__NS__info(`[taon] Create context for host: ${this.config.host}`);
|
|
488
|
+
(0, lib_prod_13.Helpers__NS__info)(`[taon] Create context for host: ${this.config.host}`);
|
|
555
489
|
}
|
|
556
490
|
}
|
|
557
491
|
//#endregion
|
|
@@ -571,13 +505,13 @@ export class EndpointContext {
|
|
|
571
505
|
|
|
572
506
|
`);
|
|
573
507
|
//#region @websqlFunc
|
|
574
|
-
let databaseConfig =
|
|
575
|
-
const tcpUdpDatabaseSqliteRelativeFileLocation = `${Models__NS__DatabasesFolder}/db-${this.contextName}.sqlite`;
|
|
508
|
+
let databaseConfig = models_1.Models__NS__DatabaseConfig.from({});
|
|
509
|
+
const tcpUdpDatabaseSqliteRelativeFileLocation = `${models_1.Models__NS__DatabasesFolder}/db-${this.contextName}.sqlite`;
|
|
576
510
|
if (this.isRunningInsideDocker) {
|
|
577
511
|
if (this.USE_MARIADB_MYSQL_IN_DOCKER) {
|
|
578
512
|
// Helpers__NS__info('Running in docker, using in mysql database');
|
|
579
513
|
// // TODO auto resolve database config in docker
|
|
580
|
-
// databaseConfig =
|
|
514
|
+
// databaseConfig = Models__NS__DatabaseConfig.from({
|
|
581
515
|
// database: `db-${this.contextName}.sqlite`,
|
|
582
516
|
// type: 'mysql',
|
|
583
517
|
// recreateMode: 'PRESERVE_DATA+MIGRATIONS',
|
|
@@ -597,12 +531,12 @@ export class EndpointContext {
|
|
|
597
531
|
|
|
598
532
|
`);
|
|
599
533
|
//#region @backend
|
|
600
|
-
const locationOfTheDatabase = crossPlatformPath([
|
|
534
|
+
const locationOfTheDatabase = (0, lib_prod_12.crossPlatformPath)([
|
|
601
535
|
process.cwd(),
|
|
602
536
|
`db-${this.contextName}.sqlite`,
|
|
603
537
|
]);
|
|
604
538
|
//#endregion
|
|
605
|
-
databaseConfig = databaseConfig =
|
|
539
|
+
databaseConfig = databaseConfig = models_1.Models__NS__DatabaseConfig.from({
|
|
606
540
|
location: tcpUdpDatabaseSqliteRelativeFileLocation,
|
|
607
541
|
type: 'sqljs',
|
|
608
542
|
useLocalForage: false,
|
|
@@ -610,14 +544,14 @@ export class EndpointContext {
|
|
|
610
544
|
logging: true,
|
|
611
545
|
});
|
|
612
546
|
//#region @backend
|
|
613
|
-
if (!fse.existsSync(locationOfTheDatabase)) {
|
|
547
|
+
if (!lib_prod_10.fse.existsSync(locationOfTheDatabase)) {
|
|
614
548
|
databaseConfig.recreateMode = 'DROP_DB+MIGRATIONS';
|
|
615
549
|
}
|
|
616
550
|
// TODO @LAST add same thing for mariadb/mysql
|
|
617
551
|
this.logFramework &&
|
|
618
552
|
console.log(`
|
|
619
553
|
location of database: ${locationOfTheDatabase}
|
|
620
|
-
db file exists: ${fse.existsSync(locationOfTheDatabase)}
|
|
554
|
+
db file exists: ${lib_prod_10.fse.existsSync(locationOfTheDatabase)}
|
|
621
555
|
synchronize: ${databaseConfig.synchronize}
|
|
622
556
|
dropSchema: ${databaseConfig.dropSchema}
|
|
623
557
|
`);
|
|
@@ -627,24 +561,24 @@ export class EndpointContext {
|
|
|
627
561
|
else {
|
|
628
562
|
//#region auto resolve db config
|
|
629
563
|
this.logFramework &&
|
|
630
|
-
Helpers__NS__info(`[taon][database] Automatically resolving database config for mode ${this.mode}`);
|
|
564
|
+
(0, lib_prod_13.Helpers__NS__info)(`[taon][database] Automatically resolving database config for mode ${this.mode}`);
|
|
631
565
|
switch (this.mode) {
|
|
632
566
|
//#region resolve database config for backend-frontend(ipc-electron)
|
|
633
567
|
case 'backend-frontend(ipc-electron)':
|
|
634
568
|
let dbLocationInOs;
|
|
635
569
|
//#region @backend
|
|
636
|
-
if (UtilsOs__NS__isElectron) {
|
|
637
|
-
dbLocationInOs = crossPlatformPath([
|
|
638
|
-
UtilsOs__NS__getRealHomeDir(),
|
|
639
|
-
`.taon/databases-for-electron-apps/${this.appId || ___NS__snakeCase(process.cwd()).replace(/\_/, '.')}/${this.contextName}.sqlite`,
|
|
570
|
+
if (lib_prod_11.UtilsOs__NS__isElectron) {
|
|
571
|
+
dbLocationInOs = (0, lib_prod_12.crossPlatformPath)([
|
|
572
|
+
(0, lib_prod_11.UtilsOs__NS__getRealHomeDir)(),
|
|
573
|
+
`.taon/databases-for-electron-apps/${this.appId || (0, lib_prod_13.___NS__snakeCase)(process.cwd()).replace(/\_/, '.')}/${this.contextName}.sqlite`,
|
|
640
574
|
]);
|
|
641
|
-
if (!Helpers__NS__exists(path.dirname(dbLocationInOs))) {
|
|
642
|
-
Helpers__NS__mkdirp(path.dirname(dbLocationInOs));
|
|
575
|
+
if (!(0, lib_prod_13.Helpers__NS__exists)(lib_prod_7.path.dirname(dbLocationInOs))) {
|
|
576
|
+
(0, lib_prod_13.Helpers__NS__mkdirp)(lib_prod_7.path.dirname(dbLocationInOs));
|
|
643
577
|
}
|
|
644
578
|
}
|
|
645
579
|
//#endregion
|
|
646
|
-
databaseConfig =
|
|
647
|
-
location: UtilsOs__NS__isElectron
|
|
580
|
+
databaseConfig = models_1.Models__NS__DatabaseConfig.from({
|
|
581
|
+
location: lib_prod_11.UtilsOs__NS__isElectron
|
|
648
582
|
? dbLocationInOs
|
|
649
583
|
: `db-${this.contextName}.sqlite`,
|
|
650
584
|
type: 'sqljs',
|
|
@@ -660,7 +594,7 @@ export class EndpointContext {
|
|
|
660
594
|
/* */
|
|
661
595
|
/* */
|
|
662
596
|
/* */
|
|
663
|
-
databaseConfig = databaseConfig =
|
|
597
|
+
databaseConfig = databaseConfig = models_1.Models__NS__DatabaseConfig.from({
|
|
664
598
|
location: `db-${this.contextName}.sqlite`,
|
|
665
599
|
type: 'sqljs',
|
|
666
600
|
useLocalForage: true, // !!window['localforage'], // TODO this need to be checked in runtime
|
|
@@ -673,7 +607,7 @@ export class EndpointContext {
|
|
|
673
607
|
//#endregion
|
|
674
608
|
//#region resolve database config for mode backend-frontend(tcp+udp)
|
|
675
609
|
case 'backend-frontend(tcp+udp)':
|
|
676
|
-
databaseConfig =
|
|
610
|
+
databaseConfig = models_1.Models__NS__DatabaseConfig.from({
|
|
677
611
|
database: `context-db-${this.contextName}`,
|
|
678
612
|
location: tcpUdpDatabaseSqliteRelativeFileLocation,
|
|
679
613
|
type: 'sqljs',
|
|
@@ -701,9 +635,9 @@ export class EndpointContext {
|
|
|
701
635
|
// this.displayRoutes(this.expressApp);
|
|
702
636
|
this.serverTcpUdp.listen(Number(this.uriPort), '0.0.0.0', () => {
|
|
703
637
|
this.logFramework &&
|
|
704
|
-
Helpers__NS__log(`[ctx=${this.contextName}] Express server (inside docker) started 0.0.0.0:${this.uriPort}`);
|
|
638
|
+
(0, lib_prod_13.Helpers__NS__log)(`[ctx=${this.contextName}] Express server (inside docker) started 0.0.0.0:${this.uriPort}`);
|
|
705
639
|
this.logFramework &&
|
|
706
|
-
Helpers__NS__log(`[taon][express-server]listening on port: ${this.uriPort}, hostname: ${this.uriPathname},
|
|
640
|
+
(0, lib_prod_13.Helpers__NS__log)(`[taon][express-server]listening on port: ${this.uriPort}, hostname: ${this.uriPathname},
|
|
707
641
|
address: ${this.uriProtocol}//localhost:${this.uriPort}${this.uriPathname}
|
|
708
642
|
ExpressJS mode: ${this.expressApp.settings.env}
|
|
709
643
|
`);
|
|
@@ -714,9 +648,9 @@ export class EndpointContext {
|
|
|
714
648
|
// this.displayRoutes(this.expressApp);
|
|
715
649
|
this.serverTcpUdp.listen(Number(this.uriPort), () => {
|
|
716
650
|
this.logFramework &&
|
|
717
|
-
Helpers__NS__log(`[ctx=${this.contextName}] Express server (inside nodejs app) started on localhost:${this.uriPort}`);
|
|
651
|
+
(0, lib_prod_13.Helpers__NS__log)(`[ctx=${this.contextName}] Express server (inside nodejs app) started on localhost:${this.uriPort}`);
|
|
718
652
|
this.logFramework &&
|
|
719
|
-
Helpers__NS__log(`[taon][express-server]listening on port: ${this.uriPort}, hostname: ${this.uriPathname},
|
|
653
|
+
(0, lib_prod_13.Helpers__NS__log)(`[taon][express-server]listening on port: ${this.uriPort}, hostname: ${this.uriPathname},
|
|
720
654
|
address: ${this.uriProtocol}//localhost:${this.uriPort}${this.uriPathname}
|
|
721
655
|
expressJS mode: ${this.expressApp.settings.env}
|
|
722
656
|
`);
|
|
@@ -727,7 +661,7 @@ export class EndpointContext {
|
|
|
727
661
|
}
|
|
728
662
|
else {
|
|
729
663
|
this.logFramework &&
|
|
730
|
-
Helpers__NS__info('Ipc communication enable instead tcp/upd');
|
|
664
|
+
(0, lib_prod_13.Helpers__NS__info)('Ipc communication enable instead tcp/upd');
|
|
731
665
|
}
|
|
732
666
|
//#endregion
|
|
733
667
|
}
|
|
@@ -771,11 +705,100 @@ export class EndpointContext {
|
|
|
771
705
|
this.mode === 'backend-frontend(ipc-electron)');
|
|
772
706
|
}
|
|
773
707
|
//#endregion
|
|
708
|
+
//#region methods & getters / clone class
|
|
709
|
+
cloneClassWithNewMetadata = ({ TaonBaseClass, className, config, ctx, classType, }) => {
|
|
710
|
+
// Return a new class that extends the base class
|
|
711
|
+
const cloneClass = () => {
|
|
712
|
+
if (TaonBaseClass[symbols_1.Symbols__NS__fullClassNameStaticProperty] ===
|
|
713
|
+
`${ctx.contextName}.${className}`) {
|
|
714
|
+
return TaonBaseClass;
|
|
715
|
+
}
|
|
716
|
+
return class extends TaonBaseClass {
|
|
717
|
+
// static ['_'] = TaonBaseClass['_'];
|
|
718
|
+
// @ts-ignore
|
|
719
|
+
static [symbols_1.Symbols__NS__orignalClass] = TaonBaseClass;
|
|
720
|
+
// @ts-ignore
|
|
721
|
+
static [symbols_1.Symbols__NS__fullClassNameStaticProperty] = `${ctx.contextName}.${className}`;
|
|
722
|
+
// @ts-ignore
|
|
723
|
+
static [symbols_1.Symbols__NS__classNameStaticProperty] = className;
|
|
724
|
+
static [symbols_1.Symbols__NS__ctxInClassOrClassObj] = ctx;
|
|
725
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
726
|
+
static __getFullPathForClass__(arr = []) {
|
|
727
|
+
const name = this[symbols_1.Symbols__NS__fullClassNameStaticProperty];
|
|
728
|
+
arr.push(name);
|
|
729
|
+
// @ts-ignore
|
|
730
|
+
if (this[symbols_1.Symbols__NS__orignalClass] && // @ts-ignore
|
|
731
|
+
this[symbols_1.Symbols__NS__orignalClass].__getFullPathForClass__) {
|
|
732
|
+
// @ts-ignore
|
|
733
|
+
this[symbols_1.Symbols__NS__orignalClass].__getFullPathForClass__(arr);
|
|
734
|
+
}
|
|
735
|
+
return arr.join('/');
|
|
736
|
+
}
|
|
737
|
+
static get fullPathForClass() {
|
|
738
|
+
return this.__getFullPathForClass__();
|
|
739
|
+
}
|
|
740
|
+
[symbols_1.Symbols__NS__ctxInClassOrClassObj] = ctx;
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
const cloneClassFunction = cloneClass();
|
|
744
|
+
//#region gather all instances for all contexts
|
|
745
|
+
// TODO this is not needed anymore - for typeorm I use normal entities
|
|
746
|
+
// this thinng belowe is nice for debugging purpose
|
|
747
|
+
// if (___NS__isUndefined(cloneClassFunction[Symbols__NS__orignalClassClonesObj])) {
|
|
748
|
+
// cloneClassFunction[Symbols__NS__orignalClassClonesObj] = {};
|
|
749
|
+
// }
|
|
750
|
+
// if (___NS__isUndefined(TaonBaseClass[Symbols__NS__orignalClassClonesObj])) {
|
|
751
|
+
// TaonBaseClass[Symbols__NS__orignalClassClonesObj] = {};
|
|
752
|
+
// }
|
|
753
|
+
// const all = {
|
|
754
|
+
// ...TaonBaseClass[Symbols__NS__orignalClassClonesObj],
|
|
755
|
+
// ...cloneClassFunction[Symbols__NS__orignalClassClonesObj],
|
|
756
|
+
// };
|
|
757
|
+
// all[ctx.contextName] = cloneClassFunction;
|
|
758
|
+
// cloneClassFunction[Symbols__NS__orignalClassClonesObj] = all;
|
|
759
|
+
// TaonBaseClass[Symbols__NS__orignalClassClonesObj] = all;
|
|
760
|
+
//#endregion
|
|
761
|
+
return cloneClassFunction;
|
|
762
|
+
};
|
|
763
|
+
//#endregion
|
|
764
|
+
//#region methods & getters / clone classes obj with new metadata
|
|
765
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
766
|
+
cloneClassesObjWithNewMetadata = ({ classesInput, config, ctx, classType, }) => {
|
|
767
|
+
const classes = {};
|
|
768
|
+
// console.log(Object.keys(classesInput))
|
|
769
|
+
for (const key of Object.keys(classesInput || {})) {
|
|
770
|
+
const TaonBaseClass = classesInput[key];
|
|
771
|
+
if (!TaonBaseClass) {
|
|
772
|
+
(0, lib_prod_13.Helpers__NS__error)(`Class ${key} is not defined in context ${ctx.contextName}
|
|
773
|
+
|
|
774
|
+
Please check if you have correct import in context file
|
|
775
|
+
|
|
776
|
+
`);
|
|
777
|
+
}
|
|
778
|
+
var className = Reflect.getMetadata(symbols_1.Symbols__NS__metadata.className, TaonBaseClass);
|
|
779
|
+
// console.log('Metadata className', className, TaonBaseClass);
|
|
780
|
+
// if (!className) {
|
|
781
|
+
// console.warn(`Please provide className for ${TaonBaseClass.name} class`);
|
|
782
|
+
// }
|
|
783
|
+
className = className || key;
|
|
784
|
+
TaonBaseClass[symbols_1.Symbols__NS__classNameStaticProperty] = className;
|
|
785
|
+
const clonedClass = this.cloneClassWithNewMetadata({
|
|
786
|
+
TaonBaseClass,
|
|
787
|
+
className,
|
|
788
|
+
config,
|
|
789
|
+
ctx,
|
|
790
|
+
classType,
|
|
791
|
+
});
|
|
792
|
+
classes[className] = clonedClass;
|
|
793
|
+
}
|
|
794
|
+
return classes;
|
|
795
|
+
};
|
|
796
|
+
//#endregion
|
|
774
797
|
//#region methods & getters / get recursive classes from contexts
|
|
775
798
|
async getRecrusiveClassesfromContextsObj(classType) {
|
|
776
799
|
const arr = await this.getRecrusiveClassesfromContexts(classType);
|
|
777
800
|
return arr.reduce((acc, c) => {
|
|
778
|
-
acc[ClassHelpers__NS__getName(c)] = c;
|
|
801
|
+
acc[(0, class_helpers_1.ClassHelpers__NS__getName)(c)] = c;
|
|
779
802
|
return acc;
|
|
780
803
|
}, {});
|
|
781
804
|
}
|
|
@@ -815,9 +838,9 @@ export class EndpointContext {
|
|
|
815
838
|
//#endregion
|
|
816
839
|
//#region methods & getters / inject
|
|
817
840
|
inject(ctor, options) {
|
|
818
|
-
const className = ClassHelpers__NS__getName(ctor);
|
|
841
|
+
const className = (0, class_helpers_1.ClassHelpers__NS__getName)(ctor);
|
|
819
842
|
const locaInstanceConstructorArgs = options.locaInstanceConstructorArgs || [];
|
|
820
|
-
if (this.isCLassType(
|
|
843
|
+
if (this.isCLassType(models_1.Models__NS__ClassType.REPOSITORY, ctor)) {
|
|
821
844
|
options.localInstance = true;
|
|
822
845
|
}
|
|
823
846
|
if (options?.localInstance) {
|
|
@@ -825,9 +848,9 @@ export class EndpointContext {
|
|
|
825
848
|
let entityName = '';
|
|
826
849
|
// entity thing is only for repositories local repositories
|
|
827
850
|
// if (className === 'TaonBaseRepository') {
|
|
828
|
-
const entityFn = ___NS__first(locaInstanceConstructorArgs);
|
|
851
|
+
const entityFn = (0, lib_prod_13.___NS__first)(locaInstanceConstructorArgs);
|
|
829
852
|
const entity = entityFn && entityFn();
|
|
830
|
-
entityName = (entity && ClassHelpers__NS__getName(entity)) || '';
|
|
853
|
+
entityName = (entity && (0, class_helpers_1.ClassHelpers__NS__getName)(entity)) || '';
|
|
831
854
|
// console.log(`entityName `, entityName);
|
|
832
855
|
// }
|
|
833
856
|
if (!options.contextClassInstance[this.localInstaceObjSymbol]) {
|
|
@@ -869,7 +892,7 @@ export class EndpointContext {
|
|
|
869
892
|
getInstanceBy(ctor) {
|
|
870
893
|
// if (!!this.__contextForControllerInstanceAccess) {
|
|
871
894
|
// const className = ClassHelpers__NS__getName(ctor);
|
|
872
|
-
// const allControllers = this.getClassFunByArr(
|
|
895
|
+
// const allControllers = this.getClassFunByArr(Models__NS__ClassType.CONTROLLER);
|
|
873
896
|
// // TODO QUICK_FIX cache controllers
|
|
874
897
|
// for (const ctrl of allControllers) {
|
|
875
898
|
// if (ClassHelpers__NS__getName(ctrl) === className) {
|
|
@@ -888,7 +911,7 @@ export class EndpointContext {
|
|
|
888
911
|
//#endregion
|
|
889
912
|
//#region methods & getters / check if context initialized
|
|
890
913
|
checkIfContextInitialized() {
|
|
891
|
-
if (___NS__isUndefined(this.config)) {
|
|
914
|
+
if ((0, lib_prod_13.___NS__isUndefined)(this.config)) {
|
|
892
915
|
throw new Error(`Please check if your context has been initialized.
|
|
893
916
|
|
|
894
917
|
// ...
|
|
@@ -904,24 +927,24 @@ export class EndpointContext {
|
|
|
904
927
|
getClassFunBy(classType) {
|
|
905
928
|
this.checkIfContextInitialized();
|
|
906
929
|
switch (classType) {
|
|
907
|
-
case
|
|
930
|
+
case models_1.Models__NS__ClassType.CONTROLLER:
|
|
908
931
|
return this.config.controllers;
|
|
909
|
-
case
|
|
932
|
+
case models_1.Models__NS__ClassType.ENTITY:
|
|
910
933
|
return this.config.entities;
|
|
911
|
-
case
|
|
934
|
+
case models_1.Models__NS__ClassType.PROVIDER:
|
|
912
935
|
return this.config.providers;
|
|
913
|
-
case
|
|
936
|
+
case models_1.Models__NS__ClassType.MIDDLEWARE:
|
|
914
937
|
return this.config.middlewares;
|
|
915
|
-
case
|
|
938
|
+
case models_1.Models__NS__ClassType.REPOSITORY:
|
|
916
939
|
return this.config.repositories;
|
|
917
|
-
case
|
|
940
|
+
case models_1.Models__NS__ClassType.SUBSCRIBER:
|
|
918
941
|
return this.config.subscribers;
|
|
919
|
-
case
|
|
942
|
+
case models_1.Models__NS__ClassType.MIGRATION:
|
|
920
943
|
return this.config.migrations;
|
|
921
944
|
}
|
|
922
945
|
}
|
|
923
946
|
isCLassType(classType, classFn) {
|
|
924
|
-
return !!this.getClassFunBy(classType)[ClassHelpers__NS__getName(classFn)];
|
|
947
|
+
return !!this.getClassFunBy(classType)[(0, class_helpers_1.ClassHelpers__NS__getName)(classFn)];
|
|
925
948
|
}
|
|
926
949
|
/**
|
|
927
950
|
* Only for injectable types
|
|
@@ -929,14 +952,14 @@ export class EndpointContext {
|
|
|
929
952
|
*/
|
|
930
953
|
getClassFunByClassName(className) {
|
|
931
954
|
for (const classTypeName of this.allTypesfromContexts) {
|
|
932
|
-
const classesForInjectableType = this.config[Models__NS__ClassTypeKey[classTypeName]];
|
|
955
|
+
const classesForInjectableType = this.config[models_1.Models__NS__ClassTypeKey[classTypeName]];
|
|
933
956
|
if (classesForInjectableType[className]) {
|
|
934
957
|
return classesForInjectableType[className];
|
|
935
958
|
}
|
|
936
959
|
}
|
|
937
960
|
}
|
|
938
961
|
getClassFunByClass(classFunction) {
|
|
939
|
-
const className = ClassHelpers__NS__getName(classFunction);
|
|
962
|
+
const className = (0, class_helpers_1.ClassHelpers__NS__getName)(classFunction);
|
|
940
963
|
return this.getClassFunByClassName(className);
|
|
941
964
|
}
|
|
942
965
|
getClassFunByArr(classType) {
|
|
@@ -953,13 +976,13 @@ export class EndpointContext {
|
|
|
953
976
|
// ...recrusiveValuesFromContext,
|
|
954
977
|
...Object.values(classes),
|
|
955
978
|
]) {
|
|
956
|
-
const instance = DITaonContainer.resolve(classFn);
|
|
979
|
+
const instance = di_container_1.DITaonContainer.resolve(classFn);
|
|
957
980
|
const classInstancesByNameObj = this.classInstancesByNameObj[classType];
|
|
958
|
-
const className = ClassHelpers__NS__getName(classFn);
|
|
981
|
+
const className = (0, class_helpers_1.ClassHelpers__NS__getName)(classFn);
|
|
959
982
|
// console.log({ classFn, classType, instance, place, className, 'classInstancesByNameObj': this.classInstancesByNameObj });
|
|
960
983
|
classInstancesByNameObj[className] = instance;
|
|
961
984
|
// update config
|
|
962
|
-
this.config[Models__NS__ClassTypeKey[classType]][className] = classFn;
|
|
985
|
+
this.config[models_1.Models__NS__ClassTypeKey[classType]][className] = classFn;
|
|
963
986
|
this.objWithClassesInstancesArr[classType].push(instance);
|
|
964
987
|
this.allClassesInstances[className] = instance;
|
|
965
988
|
}
|
|
@@ -971,40 +994,40 @@ export class EndpointContext {
|
|
|
971
994
|
return;
|
|
972
995
|
}
|
|
973
996
|
//#region @websql
|
|
974
|
-
for (const classFun of this.getClassFunByArr(
|
|
975
|
-
const repo = (await this.connection.getRepository(ClassHelpers__NS__getOrginalClass(classFun)));
|
|
976
|
-
this.repos.set(ClassHelpers__NS__getName(classFun), repo);
|
|
997
|
+
for (const classFun of this.getClassFunByArr(models_1.Models__NS__ClassType.ENTITY)) {
|
|
998
|
+
const repo = (await this.connection.getRepository((0, class_helpers_1.ClassHelpers__NS__getOrginalClass)(classFun)));
|
|
999
|
+
this.repos.set((0, class_helpers_1.ClassHelpers__NS__getName)(classFun), repo);
|
|
977
1000
|
}
|
|
978
1001
|
//#endregion
|
|
979
1002
|
for (const classTypeName of [
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1003
|
+
models_1.Models__NS__ClassType.MIDDLEWARE,
|
|
1004
|
+
models_1.Models__NS__ClassType.PROVIDER,
|
|
1005
|
+
models_1.Models__NS__ClassType.REPOSITORY,
|
|
1006
|
+
models_1.Models__NS__ClassType.CONTROLLER,
|
|
1007
|
+
models_1.Models__NS__ClassType.ENTITY,
|
|
1008
|
+
models_1.Models__NS__ClassType.MIGRATION,
|
|
986
1009
|
]) {
|
|
987
1010
|
//#region init class static _ property
|
|
988
1011
|
for (const classFun of this.getClassFunByArr(classTypeName)) {
|
|
989
|
-
if (___NS__isFunction(classFun._)) {
|
|
1012
|
+
if ((0, lib_prod_13.___NS__isFunction)(classFun._)) {
|
|
990
1013
|
await classFun._();
|
|
991
1014
|
}
|
|
992
1015
|
}
|
|
993
1016
|
//#endregion
|
|
994
1017
|
}
|
|
995
1018
|
for (const classTypeName of [
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1019
|
+
models_1.Models__NS__ClassType.MIDDLEWARE,
|
|
1020
|
+
models_1.Models__NS__ClassType.PROVIDER,
|
|
1021
|
+
models_1.Models__NS__ClassType.REPOSITORY,
|
|
1022
|
+
models_1.Models__NS__ClassType.CONTROLLER,
|
|
1023
|
+
models_1.Models__NS__ClassType.MIGRATION,
|
|
1001
1024
|
]) {
|
|
1002
1025
|
//#region init providers, repositories _ property
|
|
1003
1026
|
// Helpers__NS__taskStarted(
|
|
1004
1027
|
// `[taon] REINITING _ INS FN ${classTypeName} ${this.contextName} STARTED`,
|
|
1005
1028
|
// );
|
|
1006
1029
|
for (const ctrl of this.getClassesInstancesArrBy(classTypeName)) {
|
|
1007
|
-
if (___NS__isFunction(ctrl._)) {
|
|
1030
|
+
if ((0, lib_prod_13.___NS__isFunction)(ctrl._)) {
|
|
1008
1031
|
await ctrl._();
|
|
1009
1032
|
}
|
|
1010
1033
|
}
|
|
@@ -1017,7 +1040,7 @@ export class EndpointContext {
|
|
|
1017
1040
|
//#endregion
|
|
1018
1041
|
//#region methods & getters / is active on
|
|
1019
1042
|
isActiveOn(classInstance) {
|
|
1020
|
-
let contextRef = classInstance[Symbols__NS__ctxInClassOrClassObj];
|
|
1043
|
+
let contextRef = classInstance[symbols_1.Symbols__NS__ctxInClassOrClassObj];
|
|
1021
1044
|
return this === contextRef;
|
|
1022
1045
|
}
|
|
1023
1046
|
//#endregion
|
|
@@ -1026,11 +1049,11 @@ export class EndpointContext {
|
|
|
1026
1049
|
const url = this.config?.frontendHost?.startsWith('http')
|
|
1027
1050
|
? this.config.frontendHost
|
|
1028
1051
|
: `${globalThis?.location?.protocol || 'http:'}//${this.config?.frontendHost}`;
|
|
1029
|
-
const uri = new URL(url.replace(/\/$/, ''));
|
|
1052
|
+
const uri = new url_1.URL(url.replace(/\/$/, ''));
|
|
1030
1053
|
return uri;
|
|
1031
1054
|
}
|
|
1032
1055
|
get uri() {
|
|
1033
|
-
const url = this.host ? new URL(this.host) : void 0;
|
|
1056
|
+
const url = this.host ? new url_1.URL(this.host) : void 0;
|
|
1034
1057
|
return url;
|
|
1035
1058
|
}
|
|
1036
1059
|
//#endregion
|
|
@@ -1188,12 +1211,12 @@ export class EndpointContext {
|
|
|
1188
1211
|
if (this.isRemoteHost) {
|
|
1189
1212
|
return;
|
|
1190
1213
|
}
|
|
1191
|
-
const subscriberClasses = this.getClassFunByArr(
|
|
1214
|
+
const subscriberClasses = this.getClassFunByArr(models_1.Models__NS__ClassType.SUBSCRIBER);
|
|
1192
1215
|
for (const subscriberClassFn of subscriberClasses) {
|
|
1193
|
-
const options = Reflect.getMetadata(Symbols__NS__metadata.options.subscriber, subscriberClassFn);
|
|
1216
|
+
const options = Reflect.getMetadata(symbols_1.Symbols__NS__metadata.options.subscriber, subscriberClassFn);
|
|
1194
1217
|
// console.log('subscriber options', options);
|
|
1195
1218
|
// const nameForSubscriber = ClassHelpers__NS__getName(subscriber);
|
|
1196
|
-
EventSubscriber()(subscriberClassFn);
|
|
1219
|
+
(0, lib_prod_4.EventSubscriber)()(subscriberClassFn);
|
|
1197
1220
|
}
|
|
1198
1221
|
//#endregion
|
|
1199
1222
|
}
|
|
@@ -1204,18 +1227,18 @@ export class EndpointContext {
|
|
|
1204
1227
|
if (this.isRemoteHost) {
|
|
1205
1228
|
return;
|
|
1206
1229
|
}
|
|
1207
|
-
const entities = this.getClassFunByArr(
|
|
1230
|
+
const entities = this.getClassFunByArr(models_1.Models__NS__ClassType.ENTITY);
|
|
1208
1231
|
for (const entity of entities) {
|
|
1209
|
-
const options = Reflect.getMetadata(Symbols__NS__metadata.options.entity, entity);
|
|
1210
|
-
const createTable = ___NS__isUndefined(options.createTable)
|
|
1232
|
+
const options = Reflect.getMetadata(symbols_1.Symbols__NS__metadata.options.entity, entity);
|
|
1233
|
+
const createTable = (0, lib_prod_13.___NS__isUndefined)(options.createTable)
|
|
1211
1234
|
? true
|
|
1212
1235
|
: options.createTable;
|
|
1213
|
-
const nameForEntity = ClassHelpers__NS__getName(entity);
|
|
1236
|
+
const nameForEntity = (0, class_helpers_1.ClassHelpers__NS__getName)(entity);
|
|
1214
1237
|
if (createTable) {
|
|
1215
1238
|
this.logDb &&
|
|
1216
1239
|
console.info(`[taon][typeorm] create table for entity "${nameForEntity}" ? '${createTable}'`);
|
|
1217
1240
|
// console.log('TypeormEntity', { TypeormEntity });
|
|
1218
|
-
|
|
1241
|
+
(0, lib_prod_5.Entity)(nameForEntity)(entity);
|
|
1219
1242
|
}
|
|
1220
1243
|
else {
|
|
1221
1244
|
this.logDb &&
|
|
@@ -1250,12 +1273,12 @@ export class EndpointContext {
|
|
|
1250
1273
|
if (this.isRemoteHost || !this.databaseConfig) {
|
|
1251
1274
|
return;
|
|
1252
1275
|
}
|
|
1253
|
-
const entities = this.getClassFunByArr(
|
|
1254
|
-
return ClassHelpers__NS__getOrginalClass(entityFn);
|
|
1276
|
+
const entities = this.getClassFunByArr(models_1.Models__NS__ClassType.ENTITY).map(entityFn => {
|
|
1277
|
+
return (0, class_helpers_1.ClassHelpers__NS__getOrginalClass)(entityFn);
|
|
1255
1278
|
});
|
|
1256
|
-
const subscribers = this.getClassFunByArr(
|
|
1279
|
+
const subscribers = this.getClassFunByArr(models_1.Models__NS__ClassType.SUBSCRIBER);
|
|
1257
1280
|
let autoSave = false;
|
|
1258
|
-
if (!___NS__isNil(this.databaseConfig.autoSave)) {
|
|
1281
|
+
if (!(0, lib_prod_13.___NS__isNil)(this.databaseConfig.autoSave)) {
|
|
1259
1282
|
autoSave = this.databaseConfig.autoSave;
|
|
1260
1283
|
}
|
|
1261
1284
|
else {
|
|
@@ -1266,7 +1289,7 @@ export class EndpointContext {
|
|
|
1266
1289
|
autoSave = true; // on docker with sqljs I need to save db
|
|
1267
1290
|
}
|
|
1268
1291
|
}
|
|
1269
|
-
const dataSourceDbConfig = ___NS__isObject(this.databaseConfig)
|
|
1292
|
+
const dataSourceDbConfig = (0, lib_prod_13.___NS__isObject)(this.databaseConfig)
|
|
1270
1293
|
? {
|
|
1271
1294
|
type: this.databaseConfig.type,
|
|
1272
1295
|
port: this.databaseConfig.databasePort,
|
|
@@ -1295,9 +1318,9 @@ export class EndpointContext {
|
|
|
1295
1318
|
if (this.modeAllowsDatabaseCreation && this.databaseConfig) {
|
|
1296
1319
|
this.logDb &&
|
|
1297
1320
|
this.logFramework &&
|
|
1298
|
-
Helpers__NS__info('[taon][database] prepare typeorm connection...');
|
|
1321
|
+
(0, lib_prod_13.Helpers__NS__info)('[taon][database] prepare typeorm connection...');
|
|
1299
1322
|
try {
|
|
1300
|
-
const connection = new DataSource(dataSourceDbConfig);
|
|
1323
|
+
const connection = new lib_prod_6.DataSource(dataSourceDbConfig);
|
|
1301
1324
|
this.connection = connection;
|
|
1302
1325
|
await this.connection.initialize();
|
|
1303
1326
|
}
|
|
@@ -1337,7 +1360,7 @@ export class EndpointContext {
|
|
|
1337
1360
|
// debugger;
|
|
1338
1361
|
}
|
|
1339
1362
|
else {
|
|
1340
|
-
Helpers__NS__info(`[taon][typeorm] Not initing db for mode ${this.mode}`);
|
|
1363
|
+
(0, lib_prod_13.Helpers__NS__info)(`[taon][typeorm] Not initing db for mode ${this.mode}`);
|
|
1341
1364
|
}
|
|
1342
1365
|
//#endregion
|
|
1343
1366
|
}
|
|
@@ -1345,27 +1368,27 @@ export class EndpointContext {
|
|
|
1345
1368
|
//#region methods & getters / initialize metadata
|
|
1346
1369
|
//#region methods & getters / update class calculate path
|
|
1347
1370
|
updateCalculatedPathsForControllers(rawConfigs, classConfig, controllerClassFn) {
|
|
1348
|
-
const parentsCalculatedPath = ___NS__slice(rawConfigs, 1)
|
|
1371
|
+
const parentsCalculatedPath = (0, lib_prod_13.___NS__slice)(rawConfigs, 1)
|
|
1349
1372
|
.reverse()
|
|
1350
1373
|
.map(bc => {
|
|
1351
|
-
if (TaonHelpers__NS__isGoodPath(bc.path)) {
|
|
1374
|
+
if ((0, taon_helpers_1.TaonHelpers__NS__isGoodPath)(bc.path)) {
|
|
1352
1375
|
return bc.path;
|
|
1353
1376
|
}
|
|
1354
1377
|
return bc.className;
|
|
1355
1378
|
})
|
|
1356
1379
|
.join('/');
|
|
1357
1380
|
const contextNameForCommunication = this.contextNameForCommunication;
|
|
1358
|
-
if (TaonHelpers__NS__isGoodPath(classConfig.path)) {
|
|
1381
|
+
if ((0, taon_helpers_1.TaonHelpers__NS__isGoodPath)(classConfig.path)) {
|
|
1359
1382
|
classConfig.calculatedPath = classConfig.path;
|
|
1360
1383
|
}
|
|
1361
1384
|
else {
|
|
1362
1385
|
classConfig.calculatedPath = (`${this.uriPathnameOrNothingIfRoot}` +
|
|
1363
|
-
`/${apiPrefix}/${contextNameForCommunication}/tcp${parentsCalculatedPath}/` +
|
|
1364
|
-
`${ClassHelpers__NS__getName(controllerClassFn)}`)
|
|
1386
|
+
`/${constants_1.apiPrefix}/${contextNameForCommunication}/tcp${parentsCalculatedPath}/` +
|
|
1387
|
+
`${(0, class_helpers_1.ClassHelpers__NS__getName)(controllerClassFn)}`)
|
|
1365
1388
|
.replace(/\/\//g, '/')
|
|
1366
1389
|
.split('/')
|
|
1367
1390
|
.reduce((acc, bc) => {
|
|
1368
|
-
return ___NS__last(acc) === bc ? acc : [...acc, bc];
|
|
1391
|
+
return (0, lib_prod_13.___NS__last)(acc) === bc ? acc : [...acc, bc];
|
|
1369
1392
|
}, [])
|
|
1370
1393
|
.join('/');
|
|
1371
1394
|
}
|
|
@@ -1375,8 +1398,8 @@ export class EndpointContext {
|
|
|
1375
1398
|
//#region methods & getters / dedupe class configs
|
|
1376
1399
|
mergeControllerMethodsConfigs(rawConfigs, classConfig, controllerClassFn) {
|
|
1377
1400
|
const currentControllerMethodsConfig = classConfig.methods;
|
|
1378
|
-
___NS__slice(rawConfigs, 1).forEach(bc => {
|
|
1379
|
-
const parentControllerMethods = ___NS__cloneDeep(bc.methods);
|
|
1401
|
+
(0, lib_prod_13.___NS__slice)(rawConfigs, 1).forEach(bc => {
|
|
1402
|
+
const parentControllerMethods = (0, lib_prod_13.___NS__cloneDeep)(bc.methods);
|
|
1380
1403
|
for (const methodsName in parentControllerMethods) {
|
|
1381
1404
|
if (parentControllerMethods.hasOwnProperty(methodsName)) {
|
|
1382
1405
|
if (!currentControllerMethodsConfig[methodsName]) {
|
|
@@ -1394,10 +1417,10 @@ export class EndpointContext {
|
|
|
1394
1417
|
if (this.isRunOrRevertOnlyMigrationAppStart) {
|
|
1395
1418
|
return;
|
|
1396
1419
|
}
|
|
1397
|
-
const allControllers = this.getClassFunByArr(
|
|
1420
|
+
const allControllers = this.getClassFunByArr(models_1.Models__NS__ClassType.CONTROLLER);
|
|
1398
1421
|
for (const controllerClassFn of allControllers) {
|
|
1399
1422
|
const instance = this.getInstanceBy(controllerClassFn);
|
|
1400
|
-
if (___NS__isFunction(instance.afterAllCtxInited)) {
|
|
1423
|
+
if ((0, lib_prod_13.___NS__isFunction)(instance.afterAllCtxInited)) {
|
|
1401
1424
|
await instance.afterAllCtxInited({ ctxStorage });
|
|
1402
1425
|
}
|
|
1403
1426
|
}
|
|
@@ -1406,7 +1429,7 @@ export class EndpointContext {
|
|
|
1406
1429
|
if (this.isRunOrRevertOnlyMigrationAppStart) {
|
|
1407
1430
|
return;
|
|
1408
1431
|
}
|
|
1409
|
-
const allControllers = this.getClassFunByArr(
|
|
1432
|
+
const allControllers = this.getClassFunByArr(models_1.Models__NS__ClassType.CONTROLLER);
|
|
1410
1433
|
// debugger
|
|
1411
1434
|
// console.log('allControllers', allControllers);
|
|
1412
1435
|
for (const controllerClassFn of allControllers) {
|
|
@@ -1416,9 +1439,9 @@ export class EndpointContext {
|
|
|
1416
1439
|
// `for ${controllerName}`,
|
|
1417
1440
|
// ClassHelpers__NS__getClassConfig(controllerClassFn),
|
|
1418
1441
|
// );
|
|
1419
|
-
controllerClassFn[Symbols__NS__classMethodsNames] =
|
|
1420
|
-
ClassHelpers__NS__getMethodsNames(controllerClassFn);
|
|
1421
|
-
const rawConfigs = ClassHelpers__NS__getControllerConfigs(controllerClassFn);
|
|
1442
|
+
controllerClassFn[symbols_1.Symbols__NS__classMethodsNames] =
|
|
1443
|
+
(0, class_helpers_1.ClassHelpers__NS__getMethodsNames)(controllerClassFn);
|
|
1444
|
+
const rawConfigs = (0, class_helpers_1.ClassHelpers__NS__getControllerConfigs)(controllerClassFn);
|
|
1422
1445
|
// console.log(controllerName, { rawConfigs });
|
|
1423
1446
|
// console.log(`Class config for ${ClassHelpers__NS__getName(controllerClassFn)}`, configs)
|
|
1424
1447
|
const classConfig = rawConfigs[0];
|
|
@@ -1427,11 +1450,11 @@ export class EndpointContext {
|
|
|
1427
1450
|
//#region combine middlewares from controllers
|
|
1428
1451
|
classConfig.calculatedMiddlewaresControllerObj = {};
|
|
1429
1452
|
[...rawConfigs].reverse().forEach(rc => {
|
|
1430
|
-
if (___NS__isFunction(rc.middlewares)) {
|
|
1453
|
+
if ((0, lib_prod_13.___NS__isFunction)(rc.middlewares)) {
|
|
1431
1454
|
classConfig.calculatedMiddlewaresControllerObj = rc.middlewares({
|
|
1432
1455
|
parentMiddlewares: classConfig.calculatedMiddlewaresControllerObj,
|
|
1433
1456
|
className(middlewareClass) {
|
|
1434
|
-
return ClassHelpers__NS__getName(controllerClassFn);
|
|
1457
|
+
return (0, class_helpers_1.ClassHelpers__NS__getName)(controllerClassFn);
|
|
1435
1458
|
},
|
|
1436
1459
|
});
|
|
1437
1460
|
}
|
|
@@ -1439,7 +1462,7 @@ export class EndpointContext {
|
|
|
1439
1462
|
//#endregion
|
|
1440
1463
|
//#region group start
|
|
1441
1464
|
//#region @backend
|
|
1442
|
-
if (!UtilsOs__NS__isRunningInCliMode()) {
|
|
1465
|
+
if (!(0, lib_prod_11.UtilsOs__NS__isRunningInCliMode)()) {
|
|
1443
1466
|
//#endregion
|
|
1444
1467
|
this.logHttp &&
|
|
1445
1468
|
console.groupCollapsed(`[taon][express-server] routes [${classConfig.className}]`);
|
|
@@ -1456,11 +1479,11 @@ export class EndpointContext {
|
|
|
1456
1479
|
[...rawConfigs].reverse().forEach(rc => {
|
|
1457
1480
|
if (rc.methods[methodName]) {
|
|
1458
1481
|
const parentMethodConfig = rc.methods[methodName];
|
|
1459
|
-
if (___NS__isFunction(parentMethodConfig.middlewares)) {
|
|
1482
|
+
if ((0, lib_prod_13.___NS__isFunction)(parentMethodConfig.middlewares)) {
|
|
1460
1483
|
calculatedMiddlewaresMethodObj = parentMethodConfig.middlewares({
|
|
1461
1484
|
parentMiddlewares: calculatedMiddlewaresMethodObj,
|
|
1462
1485
|
className(middlewareClass) {
|
|
1463
|
-
return ClassHelpers__NS__getName(controllerClassFn);
|
|
1486
|
+
return (0, class_helpers_1.ClassHelpers__NS__getName)(controllerClassFn);
|
|
1464
1487
|
},
|
|
1465
1488
|
});
|
|
1466
1489
|
}
|
|
@@ -1479,15 +1502,15 @@ export class EndpointContext {
|
|
|
1479
1502
|
// this is quick fix - in docker global path should not be used
|
|
1480
1503
|
const globalPathPart = this.isRunningInsideDocker ||
|
|
1481
1504
|
!this.frontendHostUri?.origin?.includes('localhost') // fe with domain -> is in docker
|
|
1482
|
-
? `${this.uriPathnameOrNothingIfRoot.replace(/\/$/, '')}/${apiPrefix}/${this.contextName}`.replace(/\/\//, '/')
|
|
1505
|
+
? `${this.uriPathnameOrNothingIfRoot.replace(/\/$/, '')}/${constants_1.apiPrefix}/${this.contextName}`.replace(/\/\//, '/')
|
|
1483
1506
|
: '';
|
|
1484
1507
|
const expressPath = methodConfig.global
|
|
1485
1508
|
? `${globalPathPart}/${methodConfig.path?.replace(/\/$/, '')}`.replace(/\/\//, '/')
|
|
1486
|
-
: TaonHelpers__NS__getExpressPath(classConfig, methodConfig);
|
|
1509
|
+
: (0, taon_helpers_1.TaonHelpers__NS__getExpressPath)(classConfig, methodConfig);
|
|
1487
1510
|
//#endregion
|
|
1488
1511
|
//#region init server
|
|
1489
1512
|
// console.log({ expressPath });
|
|
1490
|
-
if (UtilsOs__NS__isNode || UtilsOs__NS__isWebSQL) {
|
|
1513
|
+
if (lib_prod_11.UtilsOs__NS__isNode || lib_prod_11.UtilsOs__NS__isWebSQL) {
|
|
1491
1514
|
//#region @websql
|
|
1492
1515
|
const route = this.initServer(httpMethodType, methodConfig, classConfig, expressPath, controllerClassFn);
|
|
1493
1516
|
this.activeRoutes.push({
|
|
@@ -1498,7 +1521,7 @@ export class EndpointContext {
|
|
|
1498
1521
|
}
|
|
1499
1522
|
//#endregion
|
|
1500
1523
|
//#region init client
|
|
1501
|
-
const shouldInitClient = UtilsOs__NS__isBrowser || this.isRemoteHost || UtilsOs__NS__isWebSQL;
|
|
1524
|
+
const shouldInitClient = lib_prod_11.UtilsOs__NS__isBrowser || this.isRemoteHost || lib_prod_11.UtilsOs__NS__isWebSQL;
|
|
1502
1525
|
// console.log('shouldInitClient', shouldInitClient);
|
|
1503
1526
|
if (shouldInitClient) {
|
|
1504
1527
|
// console.log(
|
|
@@ -1515,7 +1538,7 @@ export class EndpointContext {
|
|
|
1515
1538
|
//#endregion
|
|
1516
1539
|
//#region group end
|
|
1517
1540
|
//#region @backend
|
|
1518
|
-
if (!UtilsOs__NS__isRunningInCliMode()) {
|
|
1541
|
+
if (!(0, lib_prod_11.UtilsOs__NS__isRunningInCliMode)()) {
|
|
1519
1542
|
//#endregion
|
|
1520
1543
|
this.logHttp && console.groupEnd();
|
|
1521
1544
|
//#region @backend
|
|
@@ -1532,12 +1555,12 @@ export class EndpointContext {
|
|
|
1532
1555
|
}
|
|
1533
1556
|
// const contexts: EndpointContext[] = [this];
|
|
1534
1557
|
//#region @websql
|
|
1535
|
-
const troutes = Utils__NS__uniqArray(this.activeRoutes.map(f => {
|
|
1558
|
+
const troutes = (0, lib_prod_11.Utils__NS__uniqArray)(this.activeRoutes.map(f => {
|
|
1536
1559
|
return `${f.method} ${f.expressPath}`;
|
|
1537
1560
|
})).map(f => {
|
|
1538
1561
|
const [method, expressPath] = f.split(' ');
|
|
1539
|
-
return (`\n### ${___NS__startCase(___NS__last(expressPath.split('/')))}\n` +
|
|
1540
|
-
TaonHelpers__NS__fillUpTo(method.toUpperCase() + ' ', 10) +
|
|
1562
|
+
return (`\n### ${(0, lib_prod_13.___NS__startCase)((0, lib_prod_13.___NS__last)(expressPath.split('/')))}\n` +
|
|
1563
|
+
(0, taon_helpers_1.TaonHelpers__NS__fillUpTo)(method.toUpperCase() + ' ', 10) +
|
|
1541
1564
|
this.uriOrigin +
|
|
1542
1565
|
expressPath);
|
|
1543
1566
|
// return `${TaonHelpers.string(method.toUpperCase() + ':')
|
|
@@ -1547,7 +1570,7 @@ export class EndpointContext {
|
|
|
1547
1570
|
...['', `# ROUTES FOR HOST ${this.uriOrigin} `],
|
|
1548
1571
|
...troutes,
|
|
1549
1572
|
].join('\n');
|
|
1550
|
-
const fileName = crossPlatformPath([
|
|
1573
|
+
const fileName = (0, lib_prod_12.crossPlatformPath)([
|
|
1551
1574
|
//#region @backend
|
|
1552
1575
|
process.cwd(),
|
|
1553
1576
|
//#endregion
|
|
@@ -1556,8 +1579,8 @@ export class EndpointContext {
|
|
|
1556
1579
|
this.logFramework && console.log(`[taon] routes file: ${fileName} `);
|
|
1557
1580
|
this.logRoutes && console.log(routes);
|
|
1558
1581
|
//#region @backend
|
|
1559
|
-
if (!UtilsOs__NS__isElectron && !this.skipWritingServerRoutes) {
|
|
1560
|
-
Helpers__NS__writeFile(fileName, routes);
|
|
1582
|
+
if (!lib_prod_11.UtilsOs__NS__isElectron && !this.skipWritingServerRoutes) {
|
|
1583
|
+
(0, lib_prod_13.Helpers__NS__writeFile)(fileName, routes);
|
|
1561
1584
|
}
|
|
1562
1585
|
//#endregion
|
|
1563
1586
|
//#endregion
|
|
@@ -1572,16 +1595,16 @@ export class EndpointContext {
|
|
|
1572
1595
|
//#endregion
|
|
1573
1596
|
//#region methods & getters / init middlewares
|
|
1574
1597
|
async initCustomClientMiddlewares() {
|
|
1575
|
-
const middlewares = this.getClassesInstancesArrBy(
|
|
1598
|
+
const middlewares = this.getClassesInstancesArrBy(models_1.Models__NS__ClassType.MIDDLEWARE)
|
|
1576
1599
|
.map(f => f)
|
|
1577
|
-
.filter(f => ___NS__isFunction(f.interceptClient));
|
|
1600
|
+
.filter(f => (0, lib_prod_13.___NS__isFunction)(f.interceptClient));
|
|
1578
1601
|
middlewares.forEach(middlewareInstanceName => {
|
|
1579
1602
|
const contextName = this.contextName;
|
|
1580
|
-
const interceptorName = `${contextName}-${ClassHelpers__NS__getName(middlewareInstanceName)}`;
|
|
1581
|
-
Resource.request.interceptors.set(interceptorName, {
|
|
1603
|
+
const interceptorName = `${contextName}-${(0, class_helpers_1.ClassHelpers__NS__getName)(middlewareInstanceName)}`;
|
|
1604
|
+
lib_prod_3.Resource.request.interceptors.set(interceptorName, {
|
|
1582
1605
|
intercept: ({ req, next }) => {
|
|
1583
|
-
const url = new URL(req.url);
|
|
1584
|
-
if (url.pathname.startsWith(`${this.uriPathnameOrNothingIfRoot}/${apiPrefix}/${contextName}/`)) {
|
|
1606
|
+
const url = new url_1.URL(req.url);
|
|
1607
|
+
if (url.pathname.startsWith(`${this.uriPathnameOrNothingIfRoot}/${constants_1.apiPrefix}/${contextName}/`)) {
|
|
1585
1608
|
// console.log('intercepting', url.pathname, req);
|
|
1586
1609
|
return middlewareInstanceName.interceptClient({
|
|
1587
1610
|
req,
|
|
@@ -1596,12 +1619,12 @@ export class EndpointContext {
|
|
|
1596
1619
|
async initCustomBackendMiddlewares() {
|
|
1597
1620
|
//#region @backend
|
|
1598
1621
|
const app = this.expressApp;
|
|
1599
|
-
const middlewares = this.getClassesInstancesArrBy(
|
|
1622
|
+
const middlewares = this.getClassesInstancesArrBy(models_1.Models__NS__ClassType.MIDDLEWARE);
|
|
1600
1623
|
for (const middleware of middlewares) {
|
|
1601
1624
|
const middlewareInstance = middleware;
|
|
1602
|
-
if (___NS__isFunction(middlewareInstance.interceptServer)) {
|
|
1603
|
-
const middlewareFn = ClassHelpers__NS__asyncHandler(async (req, res, next) => {
|
|
1604
|
-
if (req.originalUrl.startsWith(`${this.uriPathnameOrNothingIfRoot}/${apiPrefix}/${this.contextName}/`)) {
|
|
1625
|
+
if ((0, lib_prod_13.___NS__isFunction)(middlewareInstance.interceptServer)) {
|
|
1626
|
+
const middlewareFn = (0, class_helpers_1.ClassHelpers__NS__asyncHandler)(async (req, res, next) => {
|
|
1627
|
+
if (req.originalUrl.startsWith(`${this.uriPathnameOrNothingIfRoot}/${constants_1.apiPrefix}/${this.contextName}/`)) {
|
|
1605
1628
|
await middlewareInstance.interceptServer({
|
|
1606
1629
|
req,
|
|
1607
1630
|
res,
|
|
@@ -1635,7 +1658,7 @@ export class EndpointContext {
|
|
|
1635
1658
|
app.use(methodOverride());
|
|
1636
1659
|
app.use(cookieParser());
|
|
1637
1660
|
if (this.session) {
|
|
1638
|
-
Helpers__NS__info('[taon][express-server] session enabled for this context ' +
|
|
1661
|
+
(0, lib_prod_13.Helpers__NS__info)('[taon][express-server] session enabled for this context ' +
|
|
1639
1662
|
this.contextName);
|
|
1640
1663
|
const { cookieMaxAge } = this.session;
|
|
1641
1664
|
const frontendHost = this.config.frontendHost;
|
|
@@ -1661,7 +1684,7 @@ export class EndpointContext {
|
|
|
1661
1684
|
else {
|
|
1662
1685
|
// if(this.config?.serverLogs) {
|
|
1663
1686
|
this.logHttp &&
|
|
1664
|
-
Helpers__NS__info(`[taon][express-server] session not enabled for this context '${this.contextName}'`);
|
|
1687
|
+
(0, lib_prod_13.Helpers__NS__info)(`[taon][express-server] session not enabled for this context '${this.contextName}'`);
|
|
1665
1688
|
// }
|
|
1666
1689
|
app.use(cors({
|
|
1667
1690
|
// origin: "http://localhost:5555",
|
|
@@ -1695,10 +1718,10 @@ export class EndpointContext {
|
|
|
1695
1718
|
'Content-Type',
|
|
1696
1719
|
'Authorization',
|
|
1697
1720
|
'X-Requested-With',
|
|
1698
|
-
Symbols__NS__old.X_TOTAL_COUNT,
|
|
1699
|
-
Symbols__NS__old.MAPPING_CONFIG_HEADER,
|
|
1700
|
-
Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY,
|
|
1701
|
-
Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM,
|
|
1721
|
+
symbols_1.Symbols__NS__old.X_TOTAL_COUNT,
|
|
1722
|
+
symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER,
|
|
1723
|
+
symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY,
|
|
1724
|
+
symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM,
|
|
1702
1725
|
].join(', '));
|
|
1703
1726
|
next();
|
|
1704
1727
|
});
|
|
@@ -1718,8 +1741,8 @@ export class EndpointContext {
|
|
|
1718
1741
|
.map(middlewareClassFun => {
|
|
1719
1742
|
const middlewareInstance = this.getInstanceBy(middlewareClassFun);
|
|
1720
1743
|
if (middlewareInstance &&
|
|
1721
|
-
___NS__isFunction(middlewareInstance.interceptServerMethod)) {
|
|
1722
|
-
const middlewareFn = ClassHelpers__NS__asyncHandler(async (req, res, next) => {
|
|
1744
|
+
(0, lib_prod_13.___NS__isFunction)(middlewareInstance.interceptServerMethod)) {
|
|
1745
|
+
const middlewareFn = (0, class_helpers_1.ClassHelpers__NS__asyncHandler)(async (req, res, next) => {
|
|
1723
1746
|
await middlewareInstance.interceptServerMethod({
|
|
1724
1747
|
req,
|
|
1725
1748
|
res,
|
|
@@ -1746,18 +1769,18 @@ export class EndpointContext {
|
|
|
1746
1769
|
* Params for method @GET, @PUT etc.
|
|
1747
1770
|
*/
|
|
1748
1771
|
resolvedParams);
|
|
1749
|
-
let result = await getResponseValue(response, { req, res });
|
|
1772
|
+
let result = await (0, get_response_value_1.getResponseValue)(response, { req, res });
|
|
1750
1773
|
return result;
|
|
1751
1774
|
};
|
|
1752
1775
|
//#endregion
|
|
1753
1776
|
// console.log(`BACKEND: expressPath: "${expressPath}" `);
|
|
1754
1777
|
//#endregion
|
|
1755
|
-
if (UtilsOs__NS__isElectron) {
|
|
1778
|
+
if (lib_prod_11.UtilsOs__NS__isElectron) {
|
|
1756
1779
|
//#region @backend
|
|
1757
|
-
const ipcKeyName = TaonHelpers__NS__ipcKeyNameRequest(target, methodConfig, expressPath);
|
|
1758
|
-
ipcMain.on(ipcKeyName, async (event, paramsFromBrowser) => {
|
|
1780
|
+
const ipcKeyName = (0, taon_helpers_1.TaonHelpers__NS__ipcKeyNameRequest)(target, methodConfig, expressPath);
|
|
1781
|
+
electron_1.ipcMain.on(ipcKeyName, async (event, paramsFromBrowser) => {
|
|
1759
1782
|
const responseJsonData = await getResult(paramsFromBrowser, void 0, void 0);
|
|
1760
|
-
const sendToIpsMainOn = TaonHelpers__NS__ipcKeyNameResponse(target, methodConfig, expressPath);
|
|
1783
|
+
const sendToIpsMainOn = (0, taon_helpers_1.TaonHelpers__NS__ipcKeyNameResponse)(target, methodConfig, expressPath);
|
|
1761
1784
|
// console.log({ sendToIpsMainOn });
|
|
1762
1785
|
event.sender.send(sendToIpsMainOn, responseJsonData);
|
|
1763
1786
|
});
|
|
@@ -1770,7 +1793,7 @@ export class EndpointContext {
|
|
|
1770
1793
|
if (!this.isRemoteHost) {
|
|
1771
1794
|
//#region apply dummy websql express routers
|
|
1772
1795
|
//#region @websql
|
|
1773
|
-
if (UtilsOs__NS__isWebSQL) {
|
|
1796
|
+
if (lib_prod_11.UtilsOs__NS__isWebSQL) {
|
|
1774
1797
|
if (!this.expressApp[httpMethodType.toLowerCase()]) {
|
|
1775
1798
|
this.expressApp[httpMethodType.toLowerCase()] = () => { };
|
|
1776
1799
|
// TODO add middlewares for WEBSQL and ELECTRON mode
|
|
@@ -1788,60 +1811,60 @@ export class EndpointContext {
|
|
|
1788
1811
|
let tBody = req.body;
|
|
1789
1812
|
let tParams = req.params;
|
|
1790
1813
|
let tQuery = req.query;
|
|
1791
|
-
if (req.headers[Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY]) {
|
|
1814
|
+
if (req.headers[symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY]) {
|
|
1792
1815
|
try {
|
|
1793
|
-
tBody = JSON.parse(JSON.stringify(tBody), JSON.parse(TaonHelpers__NS__firstStringOrElemFromArray(req.headers[Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY])));
|
|
1816
|
+
tBody = JSON.parse(JSON.stringify(tBody), JSON.parse((0, taon_helpers_1.TaonHelpers__NS__firstStringOrElemFromArray)(req.headers[symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY])));
|
|
1794
1817
|
}
|
|
1795
1818
|
catch (e) { }
|
|
1796
1819
|
}
|
|
1797
|
-
if (req.headers[Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM]) {
|
|
1820
|
+
if (req.headers[symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM]) {
|
|
1798
1821
|
try {
|
|
1799
|
-
tQuery = JSON.parse(JSON.stringify(tQuery), JSON.parse(TaonHelpers__NS__firstStringOrElemFromArray(req.headers[Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM])));
|
|
1822
|
+
tQuery = JSON.parse(JSON.stringify(tQuery), JSON.parse((0, taon_helpers_1.TaonHelpers__NS__firstStringOrElemFromArray)(req.headers[symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM])));
|
|
1800
1823
|
}
|
|
1801
1824
|
catch (e) { }
|
|
1802
1825
|
}
|
|
1803
1826
|
// make class instance from body
|
|
1804
1827
|
// console.log('req.headers', req.headers)
|
|
1805
|
-
if (req.headers[Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS]) {
|
|
1828
|
+
if (req.headers[symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS]) {
|
|
1806
1829
|
try {
|
|
1807
|
-
const entity = JSON.parse(TaonHelpers__NS__firstStringOrElemFromArray(req.headers[Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS]));
|
|
1808
|
-
tBody = Mapping__NS__encode(tBody, entity);
|
|
1830
|
+
const entity = JSON.parse((0, taon_helpers_1.TaonHelpers__NS__firstStringOrElemFromArray)(req.headers[symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS]));
|
|
1831
|
+
tBody = (0, lib_prod_3.Mapping__NS__encode)(tBody, entity);
|
|
1809
1832
|
}
|
|
1810
1833
|
catch (e) { }
|
|
1811
1834
|
}
|
|
1812
1835
|
else {
|
|
1813
1836
|
Object.keys(tBody).forEach(paramName => {
|
|
1814
1837
|
try {
|
|
1815
|
-
const entityForParam = JSON.parse(TaonHelpers__NS__firstStringOrElemFromArray(req.headers[`${Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS}${paramName} `]));
|
|
1816
|
-
tBody[paramName] = Mapping__NS__encode(tBody[paramName], entityForParam);
|
|
1838
|
+
const entityForParam = JSON.parse((0, taon_helpers_1.TaonHelpers__NS__firstStringOrElemFromArray)(req.headers[`${symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS}${paramName} `]));
|
|
1839
|
+
tBody[paramName] = (0, lib_prod_3.Mapping__NS__encode)(tBody[paramName], entityForParam);
|
|
1817
1840
|
}
|
|
1818
1841
|
catch (e) { }
|
|
1819
1842
|
});
|
|
1820
1843
|
}
|
|
1821
1844
|
// make class instance from query params
|
|
1822
1845
|
// console.log('req.headers', tQuery)
|
|
1823
|
-
if (req.headers[Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS]) {
|
|
1846
|
+
if (req.headers[symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS]) {
|
|
1824
1847
|
try {
|
|
1825
|
-
const entity = JSON.parse(TaonHelpers__NS__firstStringOrElemFromArray(req.headers[Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS]));
|
|
1826
|
-
tQuery = TaonHelpers__NS__parseJSONwithStringJSONs(Mapping__NS__encode(tQuery, entity));
|
|
1848
|
+
const entity = JSON.parse((0, taon_helpers_1.TaonHelpers__NS__firstStringOrElemFromArray)(req.headers[symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS]));
|
|
1849
|
+
tQuery = (0, taon_helpers_1.TaonHelpers__NS__parseJSONwithStringJSONs)((0, lib_prod_3.Mapping__NS__encode)(tQuery, entity));
|
|
1827
1850
|
}
|
|
1828
1851
|
catch (e) { }
|
|
1829
1852
|
}
|
|
1830
1853
|
else {
|
|
1831
1854
|
Object.keys(tQuery).forEach(queryParamName => {
|
|
1832
1855
|
try {
|
|
1833
|
-
const entityForParam = JSON.parse(TaonHelpers__NS__firstStringOrElemFromArray(req.headers[`${Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS}${queryParamName} `]));
|
|
1856
|
+
const entityForParam = JSON.parse((0, taon_helpers_1.TaonHelpers__NS__firstStringOrElemFromArray)(req.headers[`${symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS}${queryParamName} `]));
|
|
1834
1857
|
let beforeTransofrm = tQuery[queryParamName];
|
|
1835
|
-
if (___NS__isString(beforeTransofrm)) {
|
|
1858
|
+
if ((0, lib_prod_13.___NS__isString)(beforeTransofrm)) {
|
|
1836
1859
|
try {
|
|
1837
|
-
const paresed = TaonHelpers__NS__tryTransformParam(beforeTransofrm);
|
|
1860
|
+
const paresed = (0, taon_helpers_1.TaonHelpers__NS__tryTransformParam)(beforeTransofrm);
|
|
1838
1861
|
beforeTransofrm = paresed;
|
|
1839
1862
|
}
|
|
1840
1863
|
catch (e) { }
|
|
1841
1864
|
}
|
|
1842
|
-
const afterEncoding = Mapping__NS__encode(beforeTransofrm, entityForParam);
|
|
1865
|
+
const afterEncoding = (0, lib_prod_3.Mapping__NS__encode)(beforeTransofrm, entityForParam);
|
|
1843
1866
|
tQuery[queryParamName] =
|
|
1844
|
-
TaonHelpers__NS__parseJSONwithStringJSONs(afterEncoding);
|
|
1867
|
+
(0, taon_helpers_1.TaonHelpers__NS__parseJSONwithStringJSONs)(afterEncoding);
|
|
1845
1868
|
}
|
|
1846
1869
|
catch (e) { }
|
|
1847
1870
|
});
|
|
@@ -1877,7 +1900,7 @@ export class EndpointContext {
|
|
|
1877
1900
|
//#endregion
|
|
1878
1901
|
const resolvedParams = args
|
|
1879
1902
|
.reverse()
|
|
1880
|
-
.map(v => TaonHelpers__NS__tryTransformParam(v));
|
|
1903
|
+
.map(v => (0, taon_helpers_1.TaonHelpers__NS__tryTransformParam)(v));
|
|
1881
1904
|
try {
|
|
1882
1905
|
let result = await getResult(resolvedParams, req, res);
|
|
1883
1906
|
if (methodConfig.responseType)
|
|
@@ -1904,7 +1927,7 @@ export class EndpointContext {
|
|
|
1904
1927
|
res.end(file);
|
|
1905
1928
|
//#endregion
|
|
1906
1929
|
}
|
|
1907
|
-
else if (___NS__isString(result) &&
|
|
1930
|
+
else if ((0, lib_prod_13.___NS__isString)(result) &&
|
|
1908
1931
|
methodConfig.responseType ===
|
|
1909
1932
|
'blob') {
|
|
1910
1933
|
// console.log('BASE64')
|
|
@@ -1925,7 +1948,7 @@ export class EndpointContext {
|
|
|
1925
1948
|
}
|
|
1926
1949
|
else {
|
|
1927
1950
|
//#region process json request
|
|
1928
|
-
await EntityProcess.init(result, res);
|
|
1951
|
+
await entity_process_1.EntityProcess.init(result, res);
|
|
1929
1952
|
//#endregion
|
|
1930
1953
|
}
|
|
1931
1954
|
}
|
|
@@ -1982,7 +2005,7 @@ export class EndpointContext {
|
|
|
1982
2005
|
message,
|
|
1983
2006
|
details,
|
|
1984
2007
|
code,
|
|
1985
|
-
[CoreModels__NS__TaonHttpErrorCustomProp]: true,
|
|
2008
|
+
[lib_prod_9.CoreModels__NS__TaonHttpErrorCustomProp]: true,
|
|
1986
2009
|
});
|
|
1987
2010
|
//#endregion
|
|
1988
2011
|
}
|
|
@@ -2001,12 +2024,12 @@ export class EndpointContext {
|
|
|
2001
2024
|
const middlewares = methodConfig.calculatedMiddlewares;
|
|
2002
2025
|
const middlewaresInstances = middlewares
|
|
2003
2026
|
.map(f => this.getInstanceBy(f))
|
|
2004
|
-
.filter(f => ___NS__isFunction(f.interceptClientMethod));
|
|
2027
|
+
.filter(f => (0, lib_prod_13.___NS__isFunction)(f.interceptClientMethod));
|
|
2005
2028
|
middlewaresInstances.forEach(instance => {
|
|
2006
|
-
const middlewareName = ClassHelpers__NS__getName(instance);
|
|
2029
|
+
const middlewareName = (0, class_helpers_1.ClassHelpers__NS__getName)(instance);
|
|
2007
2030
|
// middlewareName - only needed for inheritace and uniqness of interceptors
|
|
2008
2031
|
const interceptorKey = `${middlewareName}-${methodConfig.type?.toUpperCase()}-${expressPath}`;
|
|
2009
|
-
Resource.request.methodsInterceptors.set(interceptorKey, {
|
|
2032
|
+
lib_prod_3.Resource.request.methodsInterceptors.set(interceptorKey, {
|
|
2010
2033
|
intercept: ({ req, next }) => {
|
|
2011
2034
|
return instance.interceptClientMethod({
|
|
2012
2035
|
req,
|
|
@@ -2030,12 +2053,12 @@ export class EndpointContext {
|
|
|
2030
2053
|
//#endregion
|
|
2031
2054
|
const orgMethods = target.prototype[methodConfig.methodName];
|
|
2032
2055
|
//#region handle electron ipc request
|
|
2033
|
-
if (UtilsOs__NS__isElectron) {
|
|
2056
|
+
if (lib_prod_11.UtilsOs__NS__isElectron) {
|
|
2034
2057
|
const ipcRenderer = window.require('electron').ipcRenderer;
|
|
2035
2058
|
target.prototype[methodConfig.methodName] = function (...args) {
|
|
2036
2059
|
const received = new Promise(async (resolve, reject) => {
|
|
2037
2060
|
const headers = {};
|
|
2038
|
-
const { request, response } = TaonHelpers__NS__websqlMocks(headers);
|
|
2061
|
+
const { request, response } = (0, taon_helpers_1.TaonHelpers__NS__websqlMocks)(headers);
|
|
2039
2062
|
/* */
|
|
2040
2063
|
/* */
|
|
2041
2064
|
/* */
|
|
@@ -2073,7 +2096,7 @@ export class EndpointContext {
|
|
|
2073
2096
|
/* */
|
|
2074
2097
|
/* */
|
|
2075
2098
|
});
|
|
2076
|
-
received['observable'] = from(received);
|
|
2099
|
+
received['observable'] = (0, rxjs_1.from)(received);
|
|
2077
2100
|
return {
|
|
2078
2101
|
received,
|
|
2079
2102
|
request(axiosConfig) {
|
|
@@ -2241,34 +2264,34 @@ export class EndpointContext {
|
|
|
2241
2264
|
// console.log('[init method browser] FRONTEND expressPath', expressPath)
|
|
2242
2265
|
// const productionMode = FrameworkContext.isProductionMode;
|
|
2243
2266
|
//#region resolve frontend parameters
|
|
2244
|
-
if (!storage[Symbols__NS__old.ENDPOINT_META_CONFIG])
|
|
2245
|
-
storage[Symbols__NS__old.ENDPOINT_META_CONFIG] = {};
|
|
2246
|
-
if (!storage[Symbols__NS__old.ENDPOINT_META_CONFIG][ctx.uriOrigin])
|
|
2247
|
-
storage[Symbols__NS__old.ENDPOINT_META_CONFIG][ctx.uriOrigin] = {};
|
|
2248
|
-
const endpoints = storage[Symbols__NS__old.ENDPOINT_META_CONFIG];
|
|
2267
|
+
if (!storage[symbols_1.Symbols__NS__old.ENDPOINT_META_CONFIG])
|
|
2268
|
+
storage[symbols_1.Symbols__NS__old.ENDPOINT_META_CONFIG] = {};
|
|
2269
|
+
if (!storage[symbols_1.Symbols__NS__old.ENDPOINT_META_CONFIG][ctx.uriOrigin])
|
|
2270
|
+
storage[symbols_1.Symbols__NS__old.ENDPOINT_META_CONFIG][ctx.uriOrigin] = {};
|
|
2271
|
+
const endpoints = storage[symbols_1.Symbols__NS__old.ENDPOINT_META_CONFIG];
|
|
2249
2272
|
let rest;
|
|
2250
2273
|
if (!endpoints[ctx.uriOrigin][expressPath]) {
|
|
2251
2274
|
let headers = {};
|
|
2252
2275
|
if (methodConfig.contentType && !methodConfig.responseType) {
|
|
2253
|
-
rest = Resource.create(ctx.uriOrigin, expressPath, Symbols__NS__old.MAPPING_CONFIG_HEADER, Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, RestHeaders.from({
|
|
2276
|
+
rest = lib_prod_3.Resource.create(ctx.uriOrigin, expressPath, symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER, symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, lib_prod_3.RestHeaders.from({
|
|
2254
2277
|
'Content-Type': methodConfig.contentType,
|
|
2255
2278
|
Accept: methodConfig.contentType,
|
|
2256
2279
|
}));
|
|
2257
2280
|
}
|
|
2258
2281
|
else if (methodConfig.contentType && methodConfig.responseType) {
|
|
2259
|
-
rest = Resource.create(ctx.uriOrigin, expressPath, Symbols__NS__old.MAPPING_CONFIG_HEADER, Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, RestHeaders.from({
|
|
2282
|
+
rest = lib_prod_3.Resource.create(ctx.uriOrigin, expressPath, symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER, symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, lib_prod_3.RestHeaders.from({
|
|
2260
2283
|
'Content-Type': methodConfig.contentType,
|
|
2261
2284
|
Accept: methodConfig.contentType,
|
|
2262
2285
|
responsetypeaxios: methodConfig.responseType,
|
|
2263
2286
|
}));
|
|
2264
2287
|
}
|
|
2265
2288
|
else if (!methodConfig.contentType && methodConfig.responseType) {
|
|
2266
|
-
rest = Resource.create(ctx.uriOrigin, expressPath, Symbols__NS__old.MAPPING_CONFIG_HEADER, Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, RestHeaders.from({
|
|
2289
|
+
rest = lib_prod_3.Resource.create(ctx.uriOrigin, expressPath, symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER, symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, lib_prod_3.RestHeaders.from({
|
|
2267
2290
|
responsetypeaxios: methodConfig.responseType,
|
|
2268
2291
|
}));
|
|
2269
2292
|
}
|
|
2270
2293
|
else {
|
|
2271
|
-
rest = Resource.create(ctx.uriOrigin, expressPath, Symbols__NS__old.MAPPING_CONFIG_HEADER, Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY);
|
|
2294
|
+
rest = lib_prod_3.Resource.create(ctx.uriOrigin, expressPath, symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER, symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY);
|
|
2272
2295
|
}
|
|
2273
2296
|
endpoints[ctx.uriOrigin][expressPath] = rest;
|
|
2274
2297
|
}
|
|
@@ -2289,7 +2312,7 @@ export class EndpointContext {
|
|
|
2289
2312
|
}
|
|
2290
2313
|
}
|
|
2291
2314
|
if (!currentParam) {
|
|
2292
|
-
const errorMessage = `[${config.frameworkName}] Unable to resolve parameter` +
|
|
2315
|
+
const errorMessage = `[${lib_prod_8.config.frameworkName}] Unable to resolve parameter` +
|
|
2293
2316
|
` at index ${i} for method ${methodConfig.methodName} at path ${expressPath}.`;
|
|
2294
2317
|
//#region @backend
|
|
2295
2318
|
console.error(errorMessage);
|
|
@@ -2302,23 +2325,23 @@ export class EndpointContext {
|
|
|
2302
2325
|
}
|
|
2303
2326
|
if (currentParam.paramType === 'Query') {
|
|
2304
2327
|
if (currentParam.paramName) {
|
|
2305
|
-
const mapping = Mapping__NS__decode(param, !ctx.isProductionMode);
|
|
2328
|
+
const mapping = (0, lib_prod_3.Mapping__NS__decode)(param, !ctx.isProductionMode);
|
|
2306
2329
|
if (mapping) {
|
|
2307
|
-
rest.headers.set(`${Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS}${currentParam.paramName} `, JSON.stringify(mapping));
|
|
2330
|
+
rest.headers.set(`${symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS}${currentParam.paramName} `, JSON.stringify(mapping));
|
|
2308
2331
|
}
|
|
2309
2332
|
queryParams[currentParam.paramName] = param;
|
|
2310
2333
|
}
|
|
2311
2334
|
else {
|
|
2312
|
-
const mapping = Mapping__NS__decode(param, !ctx.isProductionMode);
|
|
2335
|
+
const mapping = (0, lib_prod_3.Mapping__NS__decode)(param, !ctx.isProductionMode);
|
|
2313
2336
|
if (mapping) {
|
|
2314
|
-
rest.headers.set(Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS, JSON.stringify(mapping));
|
|
2337
|
+
rest.headers.set(symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_QUERY_PARAMS, JSON.stringify(mapping));
|
|
2315
2338
|
}
|
|
2316
|
-
queryParams = ___NS__cloneDeep(param);
|
|
2339
|
+
queryParams = (0, lib_prod_13.___NS__cloneDeep)(param);
|
|
2317
2340
|
}
|
|
2318
2341
|
}
|
|
2319
2342
|
if (currentParam.paramType === 'Header') {
|
|
2320
2343
|
if (currentParam.paramName) {
|
|
2321
|
-
if (currentParam.paramName === Symbols__NS__old.MDC_KEY) {
|
|
2344
|
+
if (currentParam.paramName === symbols_1.Symbols__NS__old.MDC_KEY) {
|
|
2322
2345
|
// parese MDC
|
|
2323
2346
|
rest.headers.set(currentParam.paramName, encodeURIComponent(JSON.stringify(param)));
|
|
2324
2347
|
}
|
|
@@ -2333,11 +2356,11 @@ export class EndpointContext {
|
|
|
2333
2356
|
}
|
|
2334
2357
|
}
|
|
2335
2358
|
if (currentParam.paramType === 'Cookie') {
|
|
2336
|
-
Resource.Cookies.write(currentParam.paramName, param, currentParam.expireInSeconds);
|
|
2359
|
+
lib_prod_3.Resource.Cookies.write(currentParam.paramName, param, currentParam.expireInSeconds);
|
|
2337
2360
|
}
|
|
2338
2361
|
if (currentParam.paramType === 'Body') {
|
|
2339
2362
|
if (currentParam.paramName) {
|
|
2340
|
-
if (ClassHelpers__NS__getName(bodyObject) === 'FormData') {
|
|
2363
|
+
if ((0, class_helpers_1.ClassHelpers__NS__getName)(bodyObject) === 'FormData') {
|
|
2341
2364
|
throw new Error(`[taon - framework] Don use param names when posting / putting FormData.
|
|
2342
2365
|
Use this:
|
|
2343
2366
|
// ...
|
|
@@ -2350,35 +2373,35 @@ instead
|
|
|
2350
2373
|
// ...
|
|
2351
2374
|
`);
|
|
2352
2375
|
}
|
|
2353
|
-
const mapping = Mapping__NS__decode(param, !ctx.isProductionMode);
|
|
2376
|
+
const mapping = (0, lib_prod_3.Mapping__NS__decode)(param, !ctx.isProductionMode);
|
|
2354
2377
|
if (mapping) {
|
|
2355
|
-
rest.headers.set(`${Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS}${currentParam.paramName} `, JSON.stringify(mapping));
|
|
2378
|
+
rest.headers.set(`${symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS}${currentParam.paramName} `, JSON.stringify(mapping));
|
|
2356
2379
|
}
|
|
2357
2380
|
bodyObject[currentParam.paramName] = param;
|
|
2358
2381
|
}
|
|
2359
2382
|
else {
|
|
2360
|
-
const mapping = Mapping__NS__decode(param, !ctx.isProductionMode);
|
|
2383
|
+
const mapping = (0, lib_prod_3.Mapping__NS__decode)(param, !ctx.isProductionMode);
|
|
2361
2384
|
if (mapping) {
|
|
2362
|
-
rest.headers.set(Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS, JSON.stringify(mapping));
|
|
2385
|
+
rest.headers.set(symbols_1.Symbols__NS__old.MAPPING_CONFIG_HEADER_BODY_PARAMS, JSON.stringify(mapping));
|
|
2363
2386
|
}
|
|
2364
2387
|
bodyObject = param;
|
|
2365
2388
|
}
|
|
2366
2389
|
}
|
|
2367
2390
|
});
|
|
2368
2391
|
if (typeof bodyObject === 'object' &&
|
|
2369
|
-
ClassHelpers__NS__getName(bodyObject) !== 'FormData') {
|
|
2392
|
+
(0, class_helpers_1.ClassHelpers__NS__getName)(bodyObject) !== 'FormData') {
|
|
2370
2393
|
let circuralFromItem = [];
|
|
2371
|
-
bodyObject = JSON10.parse(JSON10.stringify(bodyObject, void 0, void 0, circs => {
|
|
2394
|
+
bodyObject = lib_prod_1.JSON10.parse(lib_prod_1.JSON10.stringify(bodyObject, void 0, void 0, circs => {
|
|
2372
2395
|
circuralFromItem = circs;
|
|
2373
2396
|
}));
|
|
2374
|
-
rest.headers.set(Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, JSON10.stringify(circuralFromItem));
|
|
2397
|
+
rest.headers.set(symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_BODY, lib_prod_1.JSON10.stringify(circuralFromItem));
|
|
2375
2398
|
}
|
|
2376
2399
|
if (typeof queryParams === 'object') {
|
|
2377
2400
|
let circuralFromQueryParams = [];
|
|
2378
|
-
queryParams = JSON10.parse(JSON10.stringify(queryParams, void 0, void 0, circs => {
|
|
2401
|
+
queryParams = lib_prod_1.JSON10.parse(lib_prod_1.JSON10.stringify(queryParams, void 0, void 0, circs => {
|
|
2379
2402
|
circuralFromQueryParams = circs;
|
|
2380
2403
|
}));
|
|
2381
|
-
rest.headers.set(Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM, JSON10.stringify(circuralFromQueryParams));
|
|
2404
|
+
rest.headers.set(symbols_1.Symbols__NS__old.CIRCURAL_OBJECTS_MAP_QUERY_PARAM, lib_prod_1.JSON10.stringify(circuralFromQueryParams));
|
|
2382
2405
|
}
|
|
2383
2406
|
//#endregion
|
|
2384
2407
|
const httpResultObj = {
|
|
@@ -2395,3 +2418,5 @@ instead
|
|
|
2395
2418
|
//#endregion
|
|
2396
2419
|
}
|
|
2397
2420
|
}
|
|
2421
|
+
exports.EndpointContext = EndpointContext;
|
|
2422
|
+
//# sourceMappingURL=endpoint-context.js.map
|