@tstdl/base 0.81.3 → 0.81.5
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/api/client/client.d.ts +6 -6
- package/api/client/client.js +4 -4
- package/api/client/client.js.map +1 -1
- package/api/default-error-handlers.d.ts +2 -2
- package/api/default-error-handlers.js +1 -1
- package/api/default-error-handlers.js.map +1 -1
- package/api/response.d.ts +8 -8
- package/api/response.js +1 -1
- package/api/response.js.map +1 -1
- package/api/server/api-controller.d.ts +3 -3
- package/api/server/api-controller.js +3 -3
- package/api/server/api-controller.js.map +1 -1
- package/api/server/error-handler.d.ts +3 -3
- package/api/server/error-handler.js +2 -2
- package/api/server/error-handler.js.map +1 -1
- package/api/server/gateway.d.ts +17 -17
- package/api/server/gateway.js +12 -12
- package/api/server/gateway.js.map +1 -1
- package/api/server/middlewares/allowed-methods.middleware.d.ts +3 -3
- package/api/server/middlewares/allowed-methods.middleware.js +3 -3
- package/api/server/middlewares/allowed-methods.middleware.js.map +1 -1
- package/api/server/middlewares/catch-error.middleware.d.ts +2 -2
- package/api/server/middlewares/cors.middleware.d.ts +2 -2
- package/api/server/middlewares/cors.middleware.js +2 -2
- package/api/server/middlewares/cors.middleware.js.map +1 -1
- package/api/server/middlewares/response-time.middleware.d.ts +1 -1
- package/api/server/middlewares/response-time.middleware.js +2 -2
- package/api/server/middlewares/response-time.middleware.js.map +1 -1
- package/api/server/module.d.ts +2 -2
- package/api/server/module.js +2 -2
- package/api/server/module.js.map +1 -1
- package/api/server/tokens.d.ts +1 -1
- package/api/server/tokens.js +1 -1
- package/api/server/tokens.js.map +1 -1
- package/api/types.d.ts +34 -34
- package/api/types.js +2 -2
- package/api/types.js.map +1 -1
- package/api/utils.d.ts +1 -1
- package/api/utils.js +3 -3
- package/api/utils.js.map +1 -1
- package/application/application.d.ts +5 -5
- package/application/application.js +19 -19
- package/application/application.js.map +1 -1
- package/collections/awaitable/awaitable-list.js +6 -6
- package/collections/awaitable/awaitable-list.js.map +1 -1
- package/collections/awaitable/awaitable-map.js +7 -7
- package/collections/awaitable/awaitable-map.js.map +1 -1
- package/collections/awaitable/awaitable-set.js +7 -7
- package/collections/awaitable/awaitable-set.js.map +1 -1
- package/collections/keyed-set.d.ts +1 -1
- package/collections/observable/observable-array.js +4 -4
- package/collections/observable/observable-array.js.map +1 -1
- package/collections/observable/observable-collection-base.js +9 -9
- package/collections/observable/observable-collection-base.js.map +1 -1
- package/collections/observable/observable-collection.d.ts +1 -1
- package/collections/observable/observable-list-base.js +6 -6
- package/collections/observable/observable-list-base.js.map +1 -1
- package/collections/observable/observable-list.d.ts +2 -2
- package/collections/observable/observable-map.js +5 -5
- package/collections/observable/observable-map.js.map +1 -1
- package/collections/observable/observable-set.js +5 -5
- package/collections/observable/observable-set.js.map +1 -1
- package/collections/observable/observable-sorted-array-list.d.ts +1 -1
- package/collections/observable/observable-sorted-array-list.js +8 -8
- package/collections/observable/observable-sorted-array-list.js.map +1 -1
- package/collections/sorted-array-list.d.ts +1 -1
- package/collections/sorted-array-list.js +5 -5
- package/collections/sorted-array-list.js.map +1 -1
- package/collections/sorted-map.js +4 -4
- package/collections/sorted-map.js.map +1 -1
- package/container/container.d.ts +4 -4
- package/container/container.js +12 -12
- package/container/container.js.map +1 -1
- package/container/decorators.d.ts +5 -5
- package/container/decorators.js +3 -3
- package/container/decorators.js.map +1 -1
- package/container/interfaces.d.ts +1 -1
- package/container/provider.d.ts +7 -7
- package/container/provider.js +1 -1
- package/container/provider.js.map +1 -1
- package/container/resolve-chain.d.ts +3 -3
- package/container/resolve-chain.js +5 -5
- package/container/resolve-chain.js.map +1 -1
- package/container/resolve.error.d.ts +1 -1
- package/container/resolve.error.js +2 -2
- package/container/resolve.error.js.map +1 -1
- package/container/token.d.ts +4 -4
- package/container/token.js +1 -1
- package/container/token.js.map +1 -1
- package/container/type-info.d.ts +1 -1
- package/container/types.d.ts +4 -4
- package/container/utils.d.ts +1 -1
- package/container/utils.js +1 -1
- package/container/utils.js.map +1 -1
- package/core.d.ts +1 -1
- package/css/theme/theme.model.d.ts +2 -2
- package/css/theme/theme.service.js +4 -4
- package/css/theme/theme.service.js.map +1 -1
- package/data-structures/array-list.d.ts +2 -1
- package/data-structures/array-list.js +3 -0
- package/data-structures/array-list.js.map +1 -1
- package/data-structures/circular-buffer.d.ts +2 -1
- package/data-structures/circular-buffer.js +22 -14
- package/data-structures/circular-buffer.js.map +1 -1
- package/data-structures/collection.d.ts +2 -1
- package/data-structures/collection.js +13 -13
- package/data-structures/collection.js.map +1 -1
- package/data-structures/index-out-of-bounds.error.d.ts +1 -1
- package/data-structures/index-out-of-bounds.error.js +2 -2
- package/data-structures/index-out-of-bounds.error.js.map +1 -1
- package/data-structures/iterable-weak-map.d.ts +1 -0
- package/data-structures/iterable-weak-map.js +17 -11
- package/data-structures/iterable-weak-map.js.map +1 -1
- package/data-structures/linked-list.d.ts +5 -4
- package/data-structures/linked-list.js +16 -8
- package/data-structures/linked-list.js.map +1 -1
- package/data-structures/list.d.ts +1 -1
- package/data-structures/list.js +1 -1
- package/data-structures/list.js.map +1 -1
- package/data-structures/map.d.ts +1 -0
- package/data-structures/map.js +6 -0
- package/data-structures/map.js.map +1 -1
- package/data-structures/multi-key-map.d.ts +3 -2
- package/data-structures/multi-key-map.js +8 -2
- package/data-structures/multi-key-map.js.map +1 -1
- package/data-structures/set.d.ts +1 -0
- package/data-structures/set.js +3 -0
- package/data-structures/set.js.map +1 -1
- package/data-structures/sorted-array-list.d.ts +6 -5
- package/data-structures/sorted-array-list.js +9 -5
- package/data-structures/sorted-array-list.js.map +1 -1
- package/data-structures/weak-ref-map.d.ts +1 -0
- package/data-structures/weak-ref-map.js +14 -8
- package/data-structures/weak-ref-map.js.map +1 -1
- package/database/entity-repository.d.ts +2 -2
- package/database/entity.d.ts +3 -3
- package/database/id.js +1 -1
- package/database/id.js.map +1 -1
- package/database/module.d.ts +1 -1
- package/database/module.js +1 -1
- package/database/module.js.map +1 -1
- package/database/mongo/classes.d.ts +6 -6
- package/database/mongo/classes.js +1 -1
- package/database/mongo/classes.js.map +1 -1
- package/database/mongo/model/document.d.ts +4 -4
- package/database/mongo/model/document.js +2 -2
- package/database/mongo/model/document.js.map +1 -1
- package/database/mongo/module.d.ts +1 -1
- package/database/mongo/module.js +4 -4
- package/database/mongo/module.js.map +1 -1
- package/database/mongo/mongo-base.repository.d.ts +13 -13
- package/database/mongo/mongo-base.repository.js +4 -4
- package/database/mongo/mongo-base.repository.js.map +1 -1
- package/database/mongo/mongo-bulk.d.ts +2 -2
- package/database/mongo/mongo-entity-repository.d.ts +12 -12
- package/database/mongo/mongo-entity-repository.js +6 -6
- package/database/mongo/mongo-entity-repository.js.map +1 -1
- package/database/mongo/operations.d.ts +1 -1
- package/database/mongo/query-converter.d.ts +2 -2
- package/database/mongo/query-converter.js +3 -3
- package/database/mongo/query-converter.js.map +1 -1
- package/database/mongo/simple-entity-repository.d.ts +2 -2
- package/database/mongo/types.d.ts +18 -18
- package/database/query.d.ts +40 -40
- package/disposable/async-disposer.d.ts +3 -3
- package/disposable/async-disposer.js +10 -10
- package/disposable/async-disposer.js.map +1 -1
- package/disposable/disposable.js +1 -1
- package/disposable/disposable.js.map +1 -1
- package/distributed-loop/distributed-loop.d.ts +6 -6
- package/distributed-loop/distributed-loop.js +6 -6
- package/distributed-loop/distributed-loop.js.map +1 -1
- package/distributed-loop/provider.d.ts +1 -1
- package/distributed-loop/provider.js +2 -2
- package/distributed-loop/provider.js.map +1 -1
- package/enumerable/async-enumerable.d.ts +3 -3
- package/enumerable/async-enumerable.js +2 -2
- package/enumerable/async-enumerable.js.map +1 -1
- package/enumerable/enumerable.d.ts +2 -2
- package/error/custom.error.d.ts +1 -1
- package/error/not-supported.error.d.ts +1 -1
- package/error/not-supported.error.js +1 -1
- package/error/not-supported.error.js.map +1 -1
- package/examples/api/basic-overview.js +11 -11
- package/examples/api/basic-overview.js.map +1 -1
- package/examples/api/streaming.js +14 -14
- package/examples/api/streaming.js.map +1 -1
- package/examples/http/client.js +3 -3
- package/examples/http/client.js.map +1 -1
- package/examples/mail/basic.js +9 -9
- package/examples/mail/basic.js.map +1 -1
- package/examples/mail/templates/hello-name.d.ts +1 -1
- package/examples/mail/templates/hello-name.js +2 -2
- package/examples/mail/templates/hello-name.js.map +1 -1
- package/examples/pdf/basic.js +9 -9
- package/examples/pdf/basic.js.map +1 -1
- package/examples/pdf/templates/hello-name.d.ts +1 -1
- package/examples/pdf/templates/hello-name.js +3 -3
- package/examples/pdf/templates/hello-name.js.map +1 -1
- package/examples/reflection/basic.d.ts +1 -1
- package/examples/reflection/basic.js +4 -4
- package/examples/reflection/basic.js.map +1 -1
- package/examples/template/basic.js +7 -7
- package/examples/template/basic.js.map +1 -1
- package/examples/template/templates/hello-name.d.ts +1 -1
- package/examples/template/templates/hello-name.js +3 -3
- package/examples/template/templates/hello-name.js.map +1 -1
- package/http/client/adapters/undici-http-client.adapter.d.ts +1 -1
- package/http/client/adapters/undici-http-client.adapter.js +4 -4
- package/http/client/adapters/undici-http-client.adapter.js.map +1 -1
- package/http/client/http-client-request.d.ts +9 -9
- package/http/client/http-client-request.js +10 -10
- package/http/client/http-client-request.js.map +1 -1
- package/http/client/http-client-response.d.ts +3 -3
- package/http/client/http-client-response.js +3 -3
- package/http/client/http-client-response.js.map +1 -1
- package/http/client/http-client.d.ts +10 -10
- package/http/client/http-client.js +10 -10
- package/http/client/http-client.js.map +1 -1
- package/http/cookie-parser.js +2 -2
- package/http/cookie-parser.js.map +1 -1
- package/http/http-body.d.ts +3 -3
- package/http/http-body.js +5 -5
- package/http/http-body.js.map +1 -1
- package/http/http-form.d.ts +2 -2
- package/http/http-headers.d.ts +3 -3
- package/http/http-headers.js +3 -3
- package/http/http-headers.js.map +1 -1
- package/http/http-query.d.ts +2 -2
- package/http/http-url-parameters.d.ts +2 -2
- package/http/http-value-map.d.ts +2 -2
- package/http/http-value-map.js +5 -5
- package/http/http-value-map.js.map +1 -1
- package/http/http.error.d.ts +2 -2
- package/http/http.error.js +2 -2
- package/http/http.error.js.map +1 -1
- package/http/server/http-server-request.d.ts +2 -2
- package/http/server/http-server-request.js +3 -3
- package/http/server/http-server-request.js.map +1 -1
- package/http/server/http-server-response.d.ts +3 -3
- package/http/server/http-server.d.ts +4 -4
- package/http/server/http-server.js +1 -1
- package/http/server/http-server.js.map +1 -1
- package/http/server/node/module.js +1 -1
- package/http/server/node/module.js.map +1 -1
- package/http/server/node/node-http-server.d.ts +6 -6
- package/http/server/node/node-http-server.js +16 -16
- package/http/server/node/node-http-server.js.map +1 -1
- package/http/types.d.ts +6 -6
- package/http/types.js +1 -1
- package/http/types.js.map +1 -1
- package/http/utils.d.ts +5 -5
- package/http/utils.js +10 -10
- package/http/utils.js.map +1 -1
- package/image-service/image-service.js +1 -1
- package/image-service/image-service.js.map +1 -1
- package/image-service/imgproxy/imgproxy-image-service.d.ts +4 -4
- package/image-service/imgproxy/imgproxy-image-service.js +6 -6
- package/image-service/imgproxy/imgproxy-image-service.js.map +1 -1
- package/json-path/json-path.d.ts +4 -4
- package/json-path/json-path.js +17 -17
- package/json-path/json-path.js.map +1 -1
- package/key-value-store/key-value.store.d.ts +3 -3
- package/key-value-store/key-value.store.js +1 -1
- package/key-value-store/key-value.store.js.map +1 -1
- package/key-value-store/mongo/module.d.ts +2 -2
- package/key-value-store/mongo/module.js +1 -1
- package/key-value-store/mongo/module.js.map +1 -1
- package/key-value-store/mongo/mongo-key-value-store.provider.d.ts +2 -2
- package/key-value-store/mongo/mongo-key-value-store.provider.js +1 -1
- package/key-value-store/mongo/mongo-key-value-store.provider.js.map +1 -1
- package/key-value-store/mongo/mongo-key-value.model.d.ts +2 -2
- package/key-value-store/mongo/mongo-key-value.repository.d.ts +5 -5
- package/key-value-store/mongo/mongo-key-value.repository.js +3 -3
- package/key-value-store/mongo/mongo-key-value.repository.js.map +1 -1
- package/key-value-store/mongo/mongo-key-value.store.d.ts +2 -2
- package/key-value-store/mongo/mongo-key-value.store.js +6 -6
- package/key-value-store/mongo/mongo-key-value.store.js.map +1 -1
- package/lock/lock.d.ts +6 -6
- package/lock/lock.js +1 -1
- package/lock/lock.js.map +1 -1
- package/lock/mongo/lock.d.ts +3 -3
- package/lock/mongo/lock.js +10 -10
- package/lock/mongo/lock.js.map +1 -1
- package/lock/mongo/model.d.ts +2 -2
- package/lock/mongo/module.d.ts +2 -2
- package/lock/mongo/module.js +1 -1
- package/lock/mongo/module.js.map +1 -1
- package/lock/mongo/mongo-lock-repository.d.ts +5 -5
- package/lock/mongo/mongo-lock-repository.js +5 -5
- package/lock/mongo/mongo-lock-repository.js.map +1 -1
- package/lock/mongo/provider.d.ts +3 -3
- package/lock/mongo/provider.js +4 -4
- package/lock/mongo/provider.js.map +1 -1
- package/lock/provider.d.ts +3 -3
- package/lock/provider.js +1 -1
- package/lock/provider.js.map +1 -1
- package/logger/console/logger.js +4 -4
- package/logger/console/logger.js.map +1 -1
- package/logger/logger.d.ts +8 -8
- package/logger/logger.js +3 -3
- package/logger/logger.js.map +1 -1
- package/mail/clients/nodemailer.mail-client.js +2 -2
- package/mail/clients/nodemailer.mail-client.js.map +1 -1
- package/mail/mail-log.repository.d.ts +1 -1
- package/mail/mail-log.repository.js +1 -1
- package/mail/mail-log.repository.js.map +1 -1
- package/mail/mail.client.d.ts +3 -3
- package/mail/mail.client.js +1 -1
- package/mail/mail.client.js.map +1 -1
- package/mail/mail.service.d.ts +3 -3
- package/mail/mail.service.js +6 -6
- package/mail/mail.service.js.map +1 -1
- package/mail/models/mail-address.model.d.ts +1 -1
- package/mail/models/mail-content.model.d.ts +1 -1
- package/mail/models/mail-data.model.d.ts +2 -2
- package/mail/models/mail-log.model.d.ts +3 -3
- package/mail/models/mail-send-result.model.d.ts +1 -1
- package/mail/models/mail-template.model.d.ts +2 -2
- package/mail/module.d.ts +2 -2
- package/mail/module.js +2 -2
- package/mail/module.js.map +1 -1
- package/mail/repositories/mongo-mail-log.repository.d.ts +7 -7
- package/mail/repositories/mongo-mail-log.repository.js +3 -3
- package/mail/repositories/mongo-mail-log.repository.js.map +1 -1
- package/mail/tokens.d.ts +1 -1
- package/mail/tokens.js +1 -1
- package/mail/tokens.js.map +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.d.ts +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.d.ts +1 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.js +5 -5
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.js.map +1 -1
- package/message-bus/local/local-message-bus-provider.d.ts +1 -1
- package/message-bus/local/local-message-bus-provider.js +5 -5
- package/message-bus/local/local-message-bus-provider.js.map +1 -1
- package/message-bus/local/local-message-bus.d.ts +1 -1
- package/message-bus/local/local-message-bus.js +3 -3
- package/message-bus/local/local-message-bus.js.map +1 -1
- package/message-bus/local/types.d.ts +1 -1
- package/message-bus/message-bus-base.d.ts +1 -1
- package/message-bus/message-bus.d.ts +3 -3
- package/message-bus/message-bus.js +1 -1
- package/message-bus/message-bus.js.map +1 -1
- package/migration/migration-state-repository.d.ts +1 -1
- package/migration/migration-state-repository.js +1 -1
- package/migration/migration-state-repository.js.map +1 -1
- package/migration/migration-state.d.ts +3 -3
- package/migration/migrator.d.ts +6 -6
- package/migration/migrator.js +9 -9
- package/migration/migrator.js.map +1 -1
- package/migration/mongo/migration-state-repository.d.ts +4 -4
- package/migration/mongo/migration-state-repository.js +2 -2
- package/migration/mongo/migration-state-repository.js.map +1 -1
- package/migration/mongo/module.d.ts +3 -3
- package/migration/mongo/module.js +2 -2
- package/migration/mongo/module.js.map +1 -1
- package/module/module-base.d.ts +3 -3
- package/module/module-base.js +7 -7
- package/module/module-base.js.map +1 -1
- package/module/module-metric-reporter.d.ts +5 -5
- package/module/module-metric-reporter.js +3 -3
- package/module/module-metric-reporter.js.map +1 -1
- package/module/module.d.ts +2 -2
- package/module/modules/function.module.d.ts +2 -2
- package/module/modules/web-server.module.d.ts +7 -7
- package/module/modules/web-server.module.js +4 -4
- package/module/modules/web-server.module.js.map +1 -1
- package/module/utils.d.ts +1 -1
- package/notification/api.d.ts +4 -4
- package/notification/api.js +3 -3
- package/notification/api.js.map +1 -1
- package/notification/model.js +1 -1
- package/notification/model.js.map +1 -1
- package/notification/module.d.ts +1 -1
- package/object-storage/object-storage.d.ts +3 -3
- package/object-storage/object-storage.js +1 -1
- package/object-storage/object-storage.js.map +1 -1
- package/object-storage/object.d.ts +2 -2
- package/object-storage/s3/s3.object-storage-provider.d.ts +3 -3
- package/object-storage/s3/s3.object-storage-provider.js +3 -3
- package/object-storage/s3/s3.object-storage-provider.js.map +1 -1
- package/object-storage/s3/s3.object-storage.d.ts +2 -2
- package/object-storage/s3/s3.object-storage.js +6 -6
- package/object-storage/s3/s3.object-storage.js.map +1 -1
- package/object-storage/s3/s3.object.d.ts +3 -3
- package/openid-connect/cached-oidc-configuration.service.d.ts +1 -1
- package/openid-connect/cached-oidc-configuration.service.js +5 -5
- package/openid-connect/cached-oidc-configuration.service.js.map +1 -1
- package/openid-connect/index.js +1 -1
- package/openid-connect/index.js.map +1 -1
- package/openid-connect/mongo-oidc-state.repository.d.ts +7 -7
- package/openid-connect/mongo-oidc-state.repository.js +3 -3
- package/openid-connect/mongo-oidc-state.repository.js.map +1 -1
- package/openid-connect/oidc-configuration.service.d.ts +2 -2
- package/openid-connect/oidc-configuration.service.js +3 -3
- package/openid-connect/oidc-configuration.service.js.map +1 -1
- package/openid-connect/oidc-state.model.d.ts +3 -3
- package/openid-connect/oidc-state.repository.d.ts +1 -1
- package/openid-connect/oidc-state.repository.js +1 -1
- package/openid-connect/oidc-state.repository.js.map +1 -1
- package/openid-connect/oidc.service-model.d.ts +8 -8
- package/openid-connect/oidc.service.d.ts +1 -1
- package/openid-connect/oidc.service.js +14 -14
- package/openid-connect/oidc.service.js.map +1 -1
- package/orm/sql/sql-repository.js +1 -1
- package/orm/sql/sql-repository.js.map +1 -1
- package/orm/test.js +1 -1
- package/orm/test.js.map +1 -1
- package/orm/types.d.ts +5 -5
- package/orm/types.js +6 -6
- package/orm/types.js.map +1 -1
- package/package.json +2 -2
- package/pdf/pdf.service.d.ts +8 -8
- package/pdf/pdf.service.js +13 -13
- package/pdf/pdf.service.js.map +1 -1
- package/pool/pool.d.ts +7 -7
- package/pool/pool.js +7 -7
- package/pool/pool.js.map +1 -1
- package/process-shutdown.d.ts +2 -2
- package/process-shutdown.js +2 -2
- package/promise/cancelable-promise.d.ts +1 -1
- package/promise/deferred-promise.js +7 -7
- package/promise/deferred-promise.js.map +1 -1
- package/promise/lazy-promise.d.ts +1 -1
- package/promise/lazy-promise.js +2 -2
- package/promise/lazy-promise.js.map +1 -1
- package/queue/mongo/job.d.ts +5 -5
- package/queue/mongo/mongo-job.repository.d.ts +6 -6
- package/queue/mongo/mongo-job.repository.js +5 -5
- package/queue/mongo/mongo-job.repository.js.map +1 -1
- package/queue/mongo/queue.d.ts +5 -5
- package/queue/mongo/queue.js +12 -12
- package/queue/mongo/queue.js.map +1 -1
- package/queue/mongo/queue.provider.d.ts +7 -7
- package/queue/mongo/queue.provider.js +4 -4
- package/queue/mongo/queue.provider.js.map +1 -1
- package/queue/queue.d.ts +8 -8
- package/queue/queue.js +2 -2
- package/queue/queue.js.map +1 -1
- package/reflection/decorator-data.js +1 -1
- package/reflection/decorator-data.js.map +1 -1
- package/reflection/decorators.js +1 -1
- package/reflection/decorators.js.map +1 -1
- package/reflection/reflection-data-map.d.ts +1 -1
- package/reflection/reflection-data-map.js +3 -3
- package/reflection/reflection-data-map.js.map +1 -1
- package/reflection/registry.d.ts +10 -10
- package/reflection/registry.js +4 -4
- package/reflection/registry.js.map +1 -1
- package/reflection/types.d.ts +33 -33
- package/reflection/utils.d.ts +6 -6
- package/reflection/utils.js +3 -3
- package/reflection/utils.js.map +1 -1
- package/rpc/endpoints/message-port.rpc-endpoint.d.ts +3 -3
- package/rpc/endpoints/message-port.rpc-endpoint.js +1 -1
- package/rpc/endpoints/message-port.rpc-endpoint.js.map +1 -1
- package/rpc/model.d.ts +24 -24
- package/rpc/model.js +1 -1
- package/rpc/model.js.map +1 -1
- package/rpc/rpc-error.d.ts +1 -1
- package/rpc/rpc-error.js +3 -3
- package/rpc/rpc-error.js.map +1 -1
- package/rpc/rpc.d.ts +2 -2
- package/rpc/rpc.js +7 -7
- package/rpc/rpc.js.map +1 -1
- package/rxjs/intersection-observer.d.ts +1 -1
- package/rxjs/intersection-observer.js +2 -2
- package/rxjs/intersection-observer.js.map +1 -1
- package/rxjs/mutation-observer.d.ts +1 -1
- package/rxjs/mutation-observer.js +2 -2
- package/rxjs/mutation-observer.js.map +1 -1
- package/rxjs/performance-observer.d.ts +1 -1
- package/rxjs/performance-observer.js +2 -2
- package/rxjs/performance-observer.js.map +1 -1
- package/rxjs/resize-observer.d.ts +1 -1
- package/rxjs/resize-observer.js +2 -2
- package/rxjs/resize-observer.js.map +1 -1
- package/rxjs/retry-backoff.d.ts +1 -1
- package/rxjs/retry-backoff.js +1 -1
- package/rxjs/retry-backoff.js.map +1 -1
- package/rxjs/slow-array.d.ts +1 -1
- package/rxjs/touch.d.ts +1 -1
- package/schema/array-constraints/maximum-length.d.ts +2 -2
- package/schema/array-constraints/minimum-length.d.ts +2 -2
- package/schema/coercers/boolean.coercer.d.ts +1 -1
- package/schema/coercers/boolean.coercer.js +1 -1
- package/schema/coercers/boolean.coercer.js.map +1 -1
- package/schema/coercers/date.coercer.d.ts +1 -1
- package/schema/coercers/date.coercer.js +1 -1
- package/schema/coercers/date.coercer.js.map +1 -1
- package/schema/coercers/number.coercer.d.ts +1 -1
- package/schema/coercers/regexp.coercer.d.ts +1 -1
- package/schema/coercers/string.coercer.d.ts +1 -1
- package/schema/coercers/string.coercer.js +1 -1
- package/schema/coercers/string.coercer.js.map +1 -1
- package/schema/coercers/uint8-array.coercer.d.ts +1 -1
- package/schema/constraints/enumeration.d.ts +2 -2
- package/schema/constraints/enumeration.js +3 -3
- package/schema/constraints/enumeration.js.map +1 -1
- package/schema/constraints/generic.d.ts +4 -4
- package/schema/constraints/generic.js +1 -1
- package/schema/constraints/generic.js.map +1 -1
- package/schema/constraints/integer.d.ts +2 -2
- package/schema/constraints/length.d.ts +2 -2
- package/schema/constraints/length.js +1 -1
- package/schema/constraints/length.js.map +1 -1
- package/schema/constraints/literal.d.ts +1 -1
- package/schema/constraints/literal.js +1 -1
- package/schema/constraints/literal.js.map +1 -1
- package/schema/constraints/maximum-date.d.ts +2 -2
- package/schema/constraints/maximum-date.js +1 -1
- package/schema/constraints/maximum-date.js.map +1 -1
- package/schema/constraints/maximum-length.d.ts +2 -2
- package/schema/constraints/maximum-length.js +1 -1
- package/schema/constraints/maximum-length.js.map +1 -1
- package/schema/constraints/maximum.d.ts +2 -2
- package/schema/constraints/minimum-date.d.ts +2 -2
- package/schema/constraints/minimum-date.js +1 -1
- package/schema/constraints/minimum-date.js.map +1 -1
- package/schema/constraints/minimum-length.d.ts +2 -2
- package/schema/constraints/minimum-length.js +1 -1
- package/schema/constraints/minimum-length.js.map +1 -1
- package/schema/constraints/minimum.d.ts +2 -2
- package/schema/constraints/pattern.d.ts +2 -2
- package/schema/decorators/class.d.ts +1 -1
- package/schema/decorators/class.js +1 -1
- package/schema/decorators/class.js.map +1 -1
- package/schema/decorators/coerce.d.ts +1 -1
- package/schema/decorators/constraint.d.ts +2 -2
- package/schema/decorators/property.d.ts +2 -2
- package/schema/decorators/property.js +2 -2
- package/schema/decorators/property.js.map +1 -1
- package/schema/decorators/types.d.ts +4 -4
- package/schema/decorators/utils.d.ts +2 -2
- package/schema/decorators/utils.js +5 -5
- package/schema/decorators/utils.js.map +1 -1
- package/schema/schema.d.ts +4 -4
- package/schema/schema.error.d.ts +6 -6
- package/schema/schema.error.js +3 -3
- package/schema/schema.error.js.map +1 -1
- package/schema/schema.js +6 -6
- package/schema/schema.js.map +1 -1
- package/schema/schemas/any.d.ts +2 -2
- package/schema/schemas/array.d.ts +3 -3
- package/schema/schemas/array.js +2 -2
- package/schema/schemas/array.js.map +1 -1
- package/schema/schemas/assign.d.ts +1 -1
- package/schema/schemas/assign.js +2 -2
- package/schema/schemas/assign.js.map +1 -1
- package/schema/schemas/boolean.d.ts +2 -2
- package/schema/schemas/constraint.d.ts +1 -1
- package/schema/schemas/date.d.ts +2 -2
- package/schema/schemas/date.js +2 -2
- package/schema/schemas/date.js.map +1 -1
- package/schema/schemas/defaulted.d.ts +2 -2
- package/schema/schemas/enumeration.d.ts +3 -3
- package/schema/schemas/enumeration.js +1 -1
- package/schema/schemas/enumeration.js.map +1 -1
- package/schema/schemas/instance.d.ts +1 -1
- package/schema/schemas/literal.d.ts +2 -2
- package/schema/schemas/literal.js +1 -1
- package/schema/schemas/literal.js.map +1 -1
- package/schema/schemas/nullable.d.ts +2 -2
- package/schema/schemas/number.d.ts +2 -2
- package/schema/schemas/number.js +2 -2
- package/schema/schemas/number.js.map +1 -1
- package/schema/schemas/object.d.ts +2 -2
- package/schema/schemas/omit.d.ts +1 -1
- package/schema/schemas/omit.js +2 -2
- package/schema/schemas/omit.js.map +1 -1
- package/schema/schemas/one-or-many.d.ts +4 -4
- package/schema/schemas/one-or-many.js +1 -1
- package/schema/schemas/one-or-many.js.map +1 -1
- package/schema/schemas/optional.d.ts +3 -3
- package/schema/schemas/partial.d.ts +1 -1
- package/schema/schemas/partial.js +3 -3
- package/schema/schemas/partial.js.map +1 -1
- package/schema/schemas/pick.d.ts +1 -1
- package/schema/schemas/pick.js +2 -2
- package/schema/schemas/pick.js.map +1 -1
- package/schema/schemas/readable-stream.d.ts +2 -2
- package/schema/schemas/record.d.ts +2 -2
- package/schema/schemas/regexp.d.ts +2 -2
- package/schema/schemas/string.d.ts +2 -2
- package/schema/schemas/string.js +2 -2
- package/schema/schemas/string.js.map +1 -1
- package/schema/schemas/transform.d.ts +1 -1
- package/schema/schemas/uint8-array.d.ts +2 -2
- package/schema/schemas/uint8-array.js +2 -2
- package/schema/schemas/uint8-array.js.map +1 -1
- package/schema/schemas/union.d.ts +2 -2
- package/schema/schemas/union.js +1 -1
- package/schema/schemas/union.js.map +1 -1
- package/schema/schemas/unknown.d.ts +2 -2
- package/schema/transformers/generic.d.ts +3 -3
- package/schema/transformers/lowercase.d.ts +1 -1
- package/schema/transformers/trim.d.ts +1 -1
- package/schema/transformers/uppercase.d.ts +1 -1
- package/schema/types.d.ts +33 -33
- package/schema/types.js +2 -2
- package/schema/types.js.map +1 -1
- package/schema/utils/schema.d.ts +1 -1
- package/schema/utils/schema.js +5 -5
- package/schema/utils/schema.js.map +1 -1
- package/schema/utils/value-type.d.ts +1 -1
- package/schema/utils/value-type.js +2 -2
- package/schema/utils/value-type.js.map +1 -1
- package/search-index/elastic/config.d.ts +4 -4
- package/search-index/elastic/config.js +2 -2
- package/search-index/elastic/config.js.map +1 -1
- package/search-index/elastic/model/elastic-query.d.ts +15 -15
- package/search-index/elastic/model/index-mapping.d.ts +16 -16
- package/search-index/elastic/model/index-mapping.js +1 -1
- package/search-index/elastic/model/index-mapping.js.map +1 -1
- package/search-index/elastic/model/sort.d.ts +4 -4
- package/search-index/elastic/module.d.ts +3 -3
- package/search-index/elastic/module.js +4 -4
- package/search-index/elastic/module.js.map +1 -1
- package/search-index/elastic/query-builder/boolean-query-builder.js +3 -3
- package/search-index/elastic/query-builder/boolean-query-builder.js.map +1 -1
- package/search-index/elastic/query-converter.d.ts +2 -2
- package/search-index/elastic/query-converter.js +2 -2
- package/search-index/elastic/query-converter.js.map +1 -1
- package/search-index/elastic/search-index.d.ts +6 -6
- package/search-index/elastic/search-index.js +8 -8
- package/search-index/elastic/search-index.js.map +1 -1
- package/search-index/elastic/sort-converter.d.ts +1 -1
- package/search-index/error.d.ts +1 -1
- package/search-index/error.js +2 -2
- package/search-index/error.js.map +1 -1
- package/search-index/memory/memory-search-index.d.ts +1 -1
- package/search-index/memory/memory-search-index.js +7 -7
- package/search-index/memory/memory-search-index.js.map +1 -1
- package/search-index/search-index.d.ts +3 -3
- package/search-index/search-index.js +1 -1
- package/search-index/search-index.js.map +1 -1
- package/search-index/search-result.d.ts +3 -3
- package/serializer/handlers/binary.d.ts +2 -2
- package/serializer/handlers/binary.js +1 -1
- package/serializer/handlers/binary.js.map +1 -1
- package/serializer/handlers/error.d.ts +1 -1
- package/serializer/handlers/map.d.ts +1 -1
- package/serializer/handlers/regex.d.ts +1 -1
- package/serializer/handlers/register.js +2 -2
- package/serializer/handlers/register.js.map +1 -1
- package/serializer/handlers/set.d.ts +1 -1
- package/serializer/serializable.d.ts +7 -7
- package/serializer/serializable.js +1 -1
- package/serializer/serializable.js.map +1 -1
- package/serializer/serializer.d.ts +2 -2
- package/serializer/serializer.js +6 -6
- package/serializer/serializer.js.map +1 -1
- package/serializer/types.d.ts +16 -16
- package/sse/server-sent-events.d.ts +3 -3
- package/sse/server-sent-events.js +7 -7
- package/sse/server-sent-events.js.map +1 -1
- package/tailwind/colors.d.ts +2 -2
- package/tailwind/colors.js +2 -2
- package/tailwind/colors.js.map +1 -1
- package/templates/module.d.ts +2 -2
- package/templates/module.js +1 -1
- package/templates/module.js.map +1 -1
- package/templates/providers/file.provider-template.d.ts +4 -4
- package/templates/providers/file.provider-template.js +5 -4
- package/templates/providers/file.provider-template.js.map +1 -1
- package/templates/providers/memory.template-provider.js +2 -2
- package/templates/providers/memory.template-provider.js.map +1 -1
- package/templates/renderers/handlebars.template-renderer.d.ts +10 -10
- package/templates/renderers/handlebars.template-renderer.js +4 -4
- package/templates/renderers/handlebars.template-renderer.js.map +1 -1
- package/templates/renderers/mjml.template-renderer.d.ts +3 -3
- package/templates/renderers/mjml.template-renderer.js +1 -1
- package/templates/renderers/mjml.template-renderer.js.map +1 -1
- package/templates/renderers/string.template-renderer.d.ts +1 -1
- package/templates/renderers/string.template-renderer.js +1 -1
- package/templates/renderers/string.template-renderer.js.map +1 -1
- package/templates/resolvers/file.template-resolver.d.ts +5 -5
- package/templates/resolvers/file.template-resolver.js +3 -3
- package/templates/resolvers/file.template-resolver.js.map +1 -1
- package/templates/resolvers/string.template-resolver.d.ts +1 -1
- package/templates/resolvers/string.template-resolver.js +2 -2
- package/templates/resolvers/string.template-resolver.js.map +1 -1
- package/templates/template-renderer.provider.js +1 -1
- package/templates/template-renderer.provider.js.map +1 -1
- package/templates/template-resolver.provider.js +1 -1
- package/templates/template-resolver.provider.js.map +1 -1
- package/templates/template.model.d.ts +2 -2
- package/templates/template.model.js +1 -1
- package/templates/template.model.js.map +1 -1
- package/templates/template.renderer.d.ts +4 -4
- package/templates/template.service.d.ts +2 -2
- package/templates/template.service.js +4 -4
- package/templates/template.service.js.map +1 -1
- package/templates/tokens.d.ts +2 -2
- package/templates/tokens.js +1 -1
- package/templates/tokens.js.map +1 -1
- package/text/dynamic-text.model.d.ts +1 -1
- package/text/dynamic-text.model.js +2 -2
- package/text/dynamic-text.model.js.map +1 -1
- package/text/localizable-text.model.d.ts +1 -1
- package/text/localization.service.d.ts +13 -13
- package/text/localization.service.js +13 -13
- package/text/localization.service.js.map +1 -1
- package/threading/thread-pool.d.ts +4 -4
- package/threading/thread-pool.js +5 -5
- package/threading/thread-pool.js.map +1 -1
- package/threading/thread-worker.d.ts +2 -2
- package/threading/thread-worker.js +1 -1
- package/threading/thread-worker.js.map +1 -1
- package/types/geo-json.d.ts +13 -13
- package/types.d.ts +89 -89
- package/utils/any-iterable-iterator.d.ts +3 -3
- package/utils/array/array-backtracker.js +3 -3
- package/utils/array/array-backtracker.js.map +1 -1
- package/utils/async-iterable-helpers/buffer.js +1 -1
- package/utils/async-iterable-helpers/buffer.js.map +1 -1
- package/utils/async-iterable-helpers/parallel/types.d.ts +2 -2
- package/utils/async-iterable-helpers/types.d.ts +7 -7
- package/utils/backoff.d.ts +5 -5
- package/utils/base64.js +1 -1
- package/utils/base64.js.map +1 -1
- package/utils/benchmark.d.ts +1 -1
- package/utils/binary-search.d.ts +1 -1
- package/utils/binary.d.ts +1 -1
- package/utils/binary.js +1 -1
- package/utils/binary.js.map +1 -1
- package/utils/cancellation-token.d.ts +1 -1
- package/utils/cancellation-token.js +13 -13
- package/utils/cancellation-token.js.map +1 -1
- package/utils/clone.js +1 -1
- package/utils/clone.js.map +1 -1
- package/utils/compression.d.ts +1 -1
- package/utils/compression.js +3 -3
- package/utils/compression.js.map +1 -1
- package/utils/cryptography.d.ts +12 -12
- package/utils/date-time.d.ts +7 -7
- package/utils/encoding.d.ts +1 -1
- package/utils/encoding.js +1 -1
- package/utils/encoding.js.map +1 -1
- package/utils/enum.d.ts +1 -1
- package/utils/equals.d.ts +4 -4
- package/utils/factory-map.d.ts +1 -1
- package/utils/factory-map.js +3 -3
- package/utils/factory-map.js.map +1 -1
- package/utils/feedable-async-iterable.js +6 -6
- package/utils/feedable-async-iterable.js.map +1 -1
- package/utils/format-error.d.ts +2 -2
- package/utils/function/memoize.d.ts +1 -1
- package/utils/function/memoize.js +2 -2
- package/utils/function/memoize.js.map +1 -1
- package/utils/helpers.d.ts +1 -1
- package/utils/helpers.js +1 -1
- package/utils/helpers.js.map +1 -1
- package/utils/image.js +1 -1
- package/utils/image.js.map +1 -1
- package/utils/iterable-helpers/types.d.ts +6 -6
- package/utils/jwt.d.ts +4 -4
- package/utils/math.d.ts +1 -1
- package/utils/math.js +1 -1
- package/utils/math.js.map +1 -1
- package/utils/merge.d.ts +2 -2
- package/utils/middleware.d.ts +9 -9
- package/utils/moving-metric.d.ts +1 -1
- package/utils/object/decycle.d.ts +2 -2
- package/utils/object/decycle.js +1 -1
- package/utils/object/decycle.js.map +1 -1
- package/utils/object/dereference.d.ts +2 -2
- package/utils/object/dereference.js +1 -1
- package/utils/object/dereference.js.map +1 -1
- package/utils/object/forward-ref.d.ts +2 -2
- package/utils/object/lazy-property.d.ts +6 -6
- package/utils/object/merge.d.ts +1 -1
- package/utils/object/object.d.ts +1 -1
- package/utils/object/property-name.d.ts +6 -6
- package/utils/ordered-feedable-async-iterable.js +5 -5
- package/utils/ordered-feedable-async-iterable.js.map +1 -1
- package/utils/patch-worker.d.ts +2 -2
- package/utils/periodic-reporter.js +3 -3
- package/utils/periodic-reporter.js.map +1 -1
- package/utils/periodic-sampler.d.ts +1 -1
- package/utils/provider-function-iterable.d.ts +2 -2
- package/utils/proxy.d.ts +1 -1
- package/utils/reflection.d.ts +1 -1
- package/utils/singleton.d.ts +2 -2
- package/utils/sort.d.ts +2 -2
- package/utils/stream/size-limited-stream.d.ts +1 -1
- package/utils/stream/size-limited-stream.js +1 -1
- package/utils/stream/size-limited-stream.js.map +1 -1
- package/utils/stream/stream-helper-types.d.ts +5 -5
- package/utils/stream/stream-reader.js +1 -1
- package/utils/stream/stream-reader.js.map +1 -1
- package/utils/type-guards.d.ts +4 -4
- package/utils/type-guards.js +1 -1
- package/utils/type-guards.js.map +1 -1
- package/utils/url-builder.d.ts +4 -4
- package/utils/url-builder.js +1 -1
- package/utils/url-builder.js.map +1 -1
- package/utils/z-base32.d.ts +1 -1
- package/web-types.d.ts +4 -4
package/api/client/client.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Injectable } from
|
|
2
|
-
import type { HttpClientOptions } from
|
|
3
|
-
import { HttpClient } from
|
|
1
|
+
import type { Injectable } from '#/container';
|
|
2
|
+
import type { HttpClientOptions } from '#/http/client';
|
|
3
|
+
import { HttpClient } from '#/http/client';
|
|
4
4
|
import type { ApiClientImplementation, ApiDefinition, ApiEndpointDefinition } from '../types';
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type ApiClient<T extends ApiDefinition> = new (httpClient: HttpClient) => ApiClientImplementation<T> & Injectable<HttpClientOptions>;
|
|
6
|
+
export type ClientOptions = {
|
|
7
7
|
/**
|
|
8
8
|
* url prefix
|
|
9
9
|
* @default `api/`
|
|
@@ -11,7 +11,7 @@ export declare type ClientOptions = {
|
|
|
11
11
|
prefix?: string;
|
|
12
12
|
defaultHttpClientOptions?: HttpClientOptions;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type ApiClientHttpRequestContext = {
|
|
15
15
|
endpoint: ApiEndpointDefinition;
|
|
16
16
|
};
|
|
17
17
|
export declare const httpClientSymbol: unique symbol;
|
package/api/client/client.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.compileClient = exports.apiDefinitionSymbol = exports.httpClientSymbol = void 0;
|
|
4
|
-
const container_1 = require("
|
|
5
|
-
const client_1 = require("
|
|
6
|
-
const schema_1 = require("
|
|
7
|
-
const type_guards_1 = require("
|
|
4
|
+
const container_1 = require("#/container");
|
|
5
|
+
const client_1 = require("#/http/client");
|
|
6
|
+
const schema_1 = require("#/schema");
|
|
7
|
+
const type_guards_1 = require("#/utils/type-guards");
|
|
8
8
|
const types_1 = require("../types");
|
|
9
9
|
const utils_1 = require("../utils");
|
|
10
10
|
exports.httpClientSymbol = Symbol('ApiTransport');
|
package/api/client/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../source/api/client/client.ts"],"names":[],"mappings":";;;AACA
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../source/api/client/client.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAE7D,0CAA8D;AAC9D,qCAAkC;AAElC,qDAA6G;AAE7G,oCAAmE;AACnE,oCAAsD;AAkBzC,QAAA,gBAAgB,GAAG,MAAM,CAAC,cAAc,CAAC,CAAC;AAC1C,QAAA,mBAAmB,GAAG,MAAM,CAAC,eAAe,CAAC,CAAC;AAE3D,kDAAkD;AAClD,SAAgB,aAAa,CAA0B,UAAa,EAAE,UAAyB,EAAE;IAC/F,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,UAAU,CAAC;IACjD,MAAM,kBAAkB,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,GAAG,kBA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AAI,EAAE,IAAI,EAAE,CAAC;KACvB;IAED,IAAI,IAAA,sBAAQ,EAAC,IAAI,CAAC,EAAE;QAClB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;KACvB;IAED,OAAO,EAAE,IAAI,EAAE,IAAW,EAAE,CAAC;AAC/B,CAAC;AAED,KAAK,UAAU,eAAe,CAAC,QAA4B,EAAE,MAA+C;IAC1G,IAAI,IAAA,yBAAW,EAAC,MAAM,CAAC,EAAE;QACvB,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,SAAS,CAAC;KAClB;IAED,MAAM,IAAI,GAAG,QAAQ,CAAC,OAAO;QAC3B,CAAC,CAAC,CAAC,MAAM,IAAI,cAAc,CAAC;YAC1B,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,EAAE;YACpC,CAAC,CAAC,CAAC,MAAM,IAAI,UAAU,CAAC;gBACtB,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE;gBACpC,CAAC,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC;oBAClB,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE;oBAClC,CAAC,CAAC,MAAM,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE;QAClC,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,eAAM,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAqB,CAAC;AACxE,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.deserializeSchemaError = exports.serializeSchemaError = void 0;
|
|
4
|
-
const schema_1 = require("
|
|
4
|
+
const schema_1 = require("#/schema");
|
|
5
5
|
function serializeSchemaError(error) {
|
|
6
6
|
return {
|
|
7
7
|
message: error.message,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-error-handlers.js","sourceRoot":"","sources":["../../source/api/default-error-handlers.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"default-error-handlers.js","sourceRoot":"","sources":["../../source/api/default-error-handlers.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAQvC,SAAgB,oBAAoB,CAAC,KAAkB;IACrD,OAAO;QACL,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,OAAO,EAAE,KAAK,CAAC,OAAO;QACtB,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;AACJ,CAAC;AAND,oDAMC;AAED,SAAgB,sBAAsB,CAAC,eAAsC;IAC3E,OAAO,IAAI,oBAAW,CAAC,eAAe,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,eAAe,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;AACpH,CAAC;AAFD,wDAEC"}
|
package/api/response.d.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import type { CustomError, CustomErrorStatic } from '../error';
|
|
2
2
|
import type { UndefinableJson } from '../types';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
3
|
+
export type ErrorHandlerData = undefined | UndefinableJson;
|
|
4
|
+
export type ErrorSerializer<T extends CustomError, TData extends ErrorHandlerData> = (error: T) => TData;
|
|
5
|
+
export type ErrorDeserializer<T extends CustomError, TData extends ErrorHandlerData> = (data: TData, responseError: ResponseError) => T;
|
|
6
|
+
export type ErrorHandler<T extends CustomError = CustomError, TData extends ErrorHandlerData = undefined> = {
|
|
7
7
|
statusCode: number;
|
|
8
8
|
serializer: ErrorSerializer<T, TData>;
|
|
9
9
|
deserializer: ErrorDeserializer<T, TData>;
|
|
10
10
|
};
|
|
11
|
-
export
|
|
11
|
+
export type ResultResponse<T> = {
|
|
12
12
|
result: T;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
14
|
+
export type ErrorResponse = {
|
|
15
15
|
error: ResponseError;
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type Response<T> = ResultResponse<T> | ErrorResponse;
|
|
18
|
+
export type ResponseError = {
|
|
19
19
|
name: string;
|
|
20
20
|
message: string;
|
|
21
21
|
details?: any;
|
package/api/response.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.isResponse = exports.isErrorResponse = exports.isResultResponse = exports.parseErrorResponse = exports.parseResponse = exports.createErrorResponse = exports.createResultResponse = exports.getErrorStatusCode = exports.hasErrorHandler = exports.registerErrorHandler = void 0;
|
|
4
|
-
const schema_error_1 = require("
|
|
4
|
+
const schema_error_1 = require("#/schema/schema.error");
|
|
5
5
|
const error_1 = require("../error");
|
|
6
6
|
const type_guards_1 = require("../utils/type-guards");
|
|
7
7
|
const default_error_handlers_1 = require("./default-error-handlers");
|
package/api/response.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../source/api/response.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"response.js","sourceRoot":"","sources":["../../source/api/response.ts"],"names":[],"mappings":";;;AAAA,wDAAoD;AAEpD,oCAA2O;AAE3O,sDAAiF;AACjF,qEAAwF;AA6BxF,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkC,CAAC;AAEhE,SAAgB,oBAAoB,CAAwD,WAAiC,EAAE,UAAkB,EAAE,UAAqC,EAAE,YAAyC;IACjO,IAAI,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,SAAS,CAAC,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,iBAAiB,WAAW,CAAC,SAAS,sBAAsB,CAAC,CAAC;KAC/E;IAED,aAAa,CAAC,GAAG,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,UAAU,EA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Lifecycle } from
|
|
2
|
-
import type { Constructor, Type } from
|
|
1
|
+
import type { InjectableOptionsWithoutLifecycle } from '#/container';
|
|
2
|
+
import type { Constructor, Type } from '#/types';
|
|
3
3
|
import type { ApiController, ApiDefinition } from '../types';
|
|
4
|
-
|
|
4
|
+
type ApiDefinitionProvider = () => ApiDefinition;
|
|
5
5
|
export declare const apiControllerDefinition: unique symbol;
|
|
6
6
|
export declare function getApiControllerDefinition(controller: Type): ApiDefinition;
|
|
7
7
|
export declare function isApiController(controller: Type): boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.implementApi = exports.apiController = exports.ensureApiController = exports.isApiController = exports.getApiControllerDefinition = exports.apiControllerDefinition = void 0;
|
|
4
|
-
const container_1 = require("
|
|
5
|
-
const object_1 = require("
|
|
6
|
-
const type_guards_1 = require("
|
|
4
|
+
const container_1 = require("#/container");
|
|
5
|
+
const object_1 = require("#/utils/object/object");
|
|
6
|
+
const type_guards_1 = require("#/utils/type-guards");
|
|
7
7
|
exports.apiControllerDefinition = Symbol('ApiController definition');
|
|
8
8
|
const registeredApiControllers = new Map();
|
|
9
9
|
function getApiControllerDefinition(controller) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-controller.js","sourceRoot":"","sources":["../../../source/api/server/api-controller.ts"],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"api-controller.js","sourceRoot":"","sources":["../../../source/api/server/api-controller.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AAExC,kDAAsD;AACtD,qDAAiD;AAKpC,QAAA,uBAAuB,GAAkB,MAAM,CAAC,0BAA0B,CAAC,CAAC;AAEzF,MAAM,wBAAwB,GAAG,IAAI,GAAG,EAA8D,CAAC;AAEvG,SAAgB,0BAA0B,CAAC,UAAgB;IACzD,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAEhC,MAAM,oBA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,MAAM,qBAAqB,GAAG,IAAA,sBAAa,EAAC,cAAc,CAAC,CAAC;IAE5D,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,qBAAqB,EAAE;QACnD,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,SAAS,EAAE,IAAI,EAAE;YACzC,UAAU,EAAE,IAAI;YAChB,YAAY,EAAE,IAAI;YAClB,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,OAAO;SACf,CAAC,CAAC;KACJ;IAED,OAAO,GAA+C,CAAC;AACzD,CAAC;AAvBD,oCAuBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpServerResponse } from
|
|
2
|
-
import type { Logger } from
|
|
3
|
-
import type { Type } from
|
|
1
|
+
import { HttpServerResponse } from '#/http/server';
|
|
2
|
+
import type { Logger } from '#/logger';
|
|
3
|
+
import type { Type } from '#/types';
|
|
4
4
|
export declare function handleApiError(error: unknown, supressedErrors: Set<Type<Error>>, logger: Logger): HttpServerResponse;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleApiError = void 0;
|
|
4
|
-
const server_1 = require("
|
|
5
|
-
const format_error_1 = require("
|
|
4
|
+
const server_1 = require("#/http/server");
|
|
5
|
+
const format_error_1 = require("#/utils/format-error");
|
|
6
6
|
const response_1 = require("../response");
|
|
7
7
|
function handleApiError(error, supressedErrors, logger) {
|
|
8
8
|
const response = new server_1.HttpServerResponse();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../../source/api/server/error-handler.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../../source/api/server/error-handler.ts"],"names":[],"mappings":";;;AACA,0CAAmD;AAGnD,uDAAmD;AACnD,0CAAuF;AAEvF,SAAgB,cAAc,CAAC,KA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entType } from
|
|
3
|
-
import type { HttpServerRequest } from
|
|
4
|
-
import { HttpServerResponse } from
|
|
5
|
-
import type { HttpServerRequestContext } from
|
|
6
|
-
import { Logger } from
|
|
7
|
-
import type { Type } from
|
|
8
|
-
import type { AsyncMiddleware, AsyncMiddlewareNext } from
|
|
1
|
+
import type { Injectable } from '#/container';
|
|
2
|
+
import { resolveArgumentType } from '#/container';
|
|
3
|
+
import type { HttpServerRequest } from '#/http/server';
|
|
4
|
+
import { HttpServerResponse } from '#/http/server';
|
|
5
|
+
import type { HttpServerRequestContext } from '#/http/server/http-server';
|
|
6
|
+
import { Logger } from '#/logger';
|
|
7
|
+
import type { Type } from '#/types';
|
|
8
|
+
import type { AsyncMiddleware, AsyncMiddlewareNext } from '#/utils/middleware';
|
|
9
9
|
import 'urlpattern-polyfill';
|
|
10
10
|
import type { ApiController, ApiDefinition, ApiEndpointDefinition, ApiEndpointMethod, ApiEndpointServerImplementation } from '../types';
|
|
11
11
|
import type { CorsMiddlewareOptions } from './middlewares';
|
|
12
|
-
export
|
|
12
|
+
export type ApiGatewayMiddlewareContext = {
|
|
13
13
|
api: ApiItem;
|
|
14
14
|
/** can be undefined if used before allowedMethods middleware */
|
|
15
15
|
endpoint: GatewayEndpoint;
|
|
16
16
|
resourcePatternResult: URLPatternResult;
|
|
17
17
|
};
|
|
18
|
-
export
|
|
19
|
-
export
|
|
20
|
-
export
|
|
18
|
+
export type ApiGatewayMiddlewareNext = AsyncMiddlewareNext<HttpServerRequest, HttpServerResponse>;
|
|
19
|
+
export type ApiGatewayMiddleware = AsyncMiddleware<HttpServerRequest, HttpServerResponse, ApiGatewayMiddlewareContext>;
|
|
20
|
+
export type ApiGatewayOptions = {
|
|
21
21
|
/**
|
|
22
22
|
* Api prefix. Pass `null` to disable prefix.
|
|
23
23
|
* @default api
|
|
@@ -35,18 +35,18 @@ export declare type ApiGatewayOptions = {
|
|
|
35
35
|
*/
|
|
36
36
|
defaultMaxBytes?: number;
|
|
37
37
|
};
|
|
38
|
-
export
|
|
38
|
+
export type GatewayEndpoint = {
|
|
39
39
|
definition: ApiEndpointDefinition;
|
|
40
40
|
implementation: ApiEndpointServerImplementation;
|
|
41
41
|
};
|
|
42
|
-
export
|
|
42
|
+
export type ApiItem = {
|
|
43
43
|
resource: string;
|
|
44
44
|
pattern: URLPattern;
|
|
45
45
|
endpoints: Map<ApiEndpointMethod, GatewayEndpoint>;
|
|
46
46
|
};
|
|
47
|
-
export
|
|
48
|
-
export
|
|
49
|
-
export
|
|
47
|
+
export type EndpointMetadataBodyType = 'none' | 'text' | 'json' | 'buffer' | 'stream';
|
|
48
|
+
export type ApiGatewayArgument = ApiGatewayOptions;
|
|
49
|
+
export type ApiMetadata = {
|
|
50
50
|
api: ApiItem;
|
|
51
51
|
patternResult: URLPatternResult;
|
|
52
52
|
};
|
package/api/server/gateway.js
CHANGED
|
@@ -14,18 +14,18 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
var ApiGateway_1;
|
|
15
15
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
16
|
exports.ApiGateway = void 0;
|
|
17
|
-
const container_1 = require("
|
|
18
|
-
const bad_request_error_1 = require("
|
|
19
|
-
const not_found_error_1 = require("
|
|
20
|
-
const not_implemented_error_1 = require("
|
|
21
|
-
const server_1 = require("
|
|
22
|
-
const logger_1 = require("
|
|
23
|
-
const schema_1 = require("
|
|
24
|
-
const array_1 = require("
|
|
25
|
-
const middleware_1 = require("
|
|
26
|
-
const throw_1 = require("
|
|
27
|
-
const type_guards_1 = require("
|
|
28
|
-
const units_1 = require("
|
|
17
|
+
const container_1 = require("#/container");
|
|
18
|
+
const bad_request_error_1 = require("#/error/bad-request.error");
|
|
19
|
+
const not_found_error_1 = require("#/error/not-found.error");
|
|
20
|
+
const not_implemented_error_1 = require("#/error/not-implemented.error");
|
|
21
|
+
const server_1 = require("#/http/server");
|
|
22
|
+
const logger_1 = require("#/logger");
|
|
23
|
+
const schema_1 = require("#/schema");
|
|
24
|
+
const array_1 = require("#/utils/array");
|
|
25
|
+
const middleware_1 = require("#/utils/middleware");
|
|
26
|
+
const throw_1 = require("#/utils/throw");
|
|
27
|
+
const type_guards_1 = require("#/utils/type-guards");
|
|
28
|
+
const units_1 = require("#/utils/units");
|
|
29
29
|
require("urlpattern-polyfill");
|
|
30
30
|
const types_1 = require("../types");
|
|
31
31
|
const utils_1 = require("../utils");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../source/api/server/gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../../source/api/server/gateway.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,2CAA+F;AAC/F,iEAA4D;AAC5D,6DAAwD;AACxD,yEAAoE;AAEpE,0CAAmD;AAInD,qCAAkC;AAElC,qCAAkC;AAElC,yCAAwC;AAExC,mDAA4D;AAC5D,yCAA2C;AAC3C,qDAAmJ;AACnJ,yCAAyC;AACzC,+BAA6B;AAE7B,oCAAmE;AACnE,oCAAsD;AACtD,qDAA8D;AAC9D,mDAAiD;AAEjD,+CAAuH;AACvH,qCAA8C;AAE9C,MAAM,eAAe,GAAG,EAAE,GAAG,gBAAQ,CAAC;AAwDtC;;;GAGG;AAII,IAAM,UAAU,kBAAhB,MAAM,UAAU;IAYrB,YAAyD,MAAc,EAAe,UAA6B,EAAE;QACnH,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,IAAI,CAAC,MAAM,GAAG,IAAA,oBAAM,EAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC;QACxE,IAAI,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QACtB,IAAI,CAA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/C;iBACI,IAAI,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;gBAChE,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;aAC/C;iBACI,IAAI,OAAO,CAAC,OAAO,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE;gBAC9D,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;aAC/C;iBACI;gBACH,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;aACjD;SACF;QAED,OAAO,eAAM,CAAC,KAAK,CAAC,MAAuE,EAAE,IAAI,CAAC,CAAC;IACrG,CAAC;CACF,CAAA;AAvNY,UAAU;IAHtB,IAAA,qBAAS,EAAC;QACT,uBAAuB,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,2BAAkB,CAAC,CAAC,cAAc;KACzF,CAAC;IAaa,WAAA,IAAA,sBAAU,EAAiB,YAAU,CAAC,IAAI,CAAC,CAAA;IAAkB,WAAA,IAAA,qBAAS,GAAE,CAAA;qCAApB,eAAM;GAZ5D,UAAU,CAuNtB;AAvNY,gCAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { HttpServerRequest } from
|
|
2
|
-
import { HttpServerResponse } from
|
|
3
|
-
import type { AsyncMiddlewareNext } from
|
|
1
|
+
import type { HttpServerRequest } from '#/http/server';
|
|
2
|
+
import { HttpServerResponse } from '#/http/server';
|
|
3
|
+
import type { AsyncMiddlewareNext } from '#/utils/middleware';
|
|
4
4
|
import type { ApiGatewayMiddlewareContext } from '../gateway';
|
|
5
5
|
export declare function allowedMethodsMiddleware(request: HttpServerRequest, next: AsyncMiddlewareNext<HttpServerRequest, HttpServerResponse>, context: ApiGatewayMiddlewareContext): Promise<HttpServerResponse>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.allowedMethodsMiddleware = void 0;
|
|
4
|
-
const method_not_allowed_error_1 = require("
|
|
5
|
-
const server_1 = require("
|
|
6
|
-
const type_guards_1 = require("
|
|
4
|
+
const method_not_allowed_error_1 = require("#/error/method-not-allowed.error");
|
|
5
|
+
const server_1 = require("#/http/server");
|
|
6
|
+
const type_guards_1 = require("#/utils/type-guards");
|
|
7
7
|
async function allowedMethodsMiddleware(request, next, context) {
|
|
8
8
|
if (request.method != 'OPTIONS') {
|
|
9
9
|
if ((0, type_guards_1.isUndefined)(context.endpoint)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowed-methods.middleware.js","sourceRoot":"","sources":["../../../../source/api/server/middlewares/allowed-methods.middleware.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"allowed-methods.middleware.js","sourceRoot":"","sources":["../../../../source/api/server/middlewares/allowed-methods.middleware.ts"],"names":[],"mappings":";;;AAAA,+EAAyE;AAEzE,0CAAmD;AAEnD,qDAAkD;AAG3C,KAAK,UAAU,wBAAwB,CAAC,OAA0B,EAAE,IAAgE,EAAE,OAAoC;IAC/K,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE;QAC/B,IAAI,IAAA,yBAAW,EAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACjC,MAAM,IAAI,gDAAqB,CAAC,UAAU,OAAO,CAAC,MAAM,iBAAiB,OAAO,CAAC,GAAG,CAAC,QAAQ,iBAAiB,CAAC,CAAC;SACjH;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC;KACtB;IAED,MAAM,YAAY,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAElE,OAAO,2BAAkB,CAAC,UAAU,CAAC;QACnC,UAAU,EAAE,GAAG;QACf,aAAa,EAAE,YAAY;QAC3B,OAAO,EAAE;YACP,KAAK,EAAE,YAAY;SACpB;KACF,CAAC,CAAC;AACL,CAAC;AAlBD,4DAkBC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Logger } from
|
|
2
|
-
import type { Type } from
|
|
1
|
+
import type { Logger } from '#/logger';
|
|
2
|
+
import type { Type } from '#/types';
|
|
3
3
|
import type { ApiGatewayMiddleware } from '../gateway';
|
|
4
4
|
export declare function catchErrorMiddleware(supressedErrors: Set<Type<Error>>, logger: Logger): ApiGatewayMiddleware;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ApiEndpointDefinitionCors } from
|
|
1
|
+
import type { ApiEndpointDefinitionCors } from '#/api/types';
|
|
2
2
|
import type { ApiGatewayMiddleware } from '../gateway';
|
|
3
|
-
export
|
|
3
|
+
export type CorsMiddlewareOptions = {
|
|
4
4
|
default?: ApiEndpointDefinitionCors;
|
|
5
5
|
};
|
|
6
6
|
export declare function corsMiddleware(options?: CorsMiddlewareOptions): ApiGatewayMiddleware;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.corsMiddleware = void 0;
|
|
4
|
-
const types_1 = require("
|
|
5
|
-
const type_guards_1 = require("
|
|
4
|
+
const types_1 = require("#/api/types");
|
|
5
|
+
const type_guards_1 = require("#/utils/type-guards");
|
|
6
6
|
function corsMiddleware(options = {}) {
|
|
7
7
|
// eslint-disable-next-line max-statements, @typescript-eslint/no-shadow
|
|
8
8
|
async function corsMiddleware(request, next, context) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cors.middleware.js","sourceRoot":"","sources":["../../../../source/api/server/middlewares/cors.middleware.ts"],"names":[],"mappings":";;;AACA,uCAA6D;AAG7D,
|
|
1
|
+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AI,CAAC,yBAAyB,CAAC,EAAE;gBAC7C,MAAM,KAAK,GAAG,MAAM,IAAA,sCAA8B,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;gBACrG,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,8BAA8B,EAAE,KAAK,CAAC,CAAC;aACtE;YAED,IAAI,IAAA,uBAAS,EAAC,IAAI,CAAC,0BAA0B,CAAC,EAAE;gBAC9C,MAAM,KAAK,GAAG,MAAM,IAAA,sCAA8B,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,0BAA0B,CAAC,CAAC;gBACtG,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,+BAA+B,EAAE,KAAK,CAAC,CAAC;aACvE;YAED,IAAI,IAAA,uBAAS,EAAC,IAAI,CAAC,mBAAmB,CAAC,EAAE;gBACvC,MAAM,KAAK,GAAG,MAAM,IAAA,sCAA8B,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;gBAC/F,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;aAChE;SACF;QAED,IAAI,IAAA,uBAAS,EAAC,IAAI,CAAC,wBAAwB,CAAC,EAAE;YAC5C,MAAM,KAAK,GAAG,MAAM,IAAA,sCAA8B,EAAC,OAAO,EAAE,OAAO,EAAE,IAAI,CAAC,wBAAwB,CAAC,CAAC;YACpG,QAAQ,CAAC,OAAO,CAAC,YAAY,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;SACrE;QAED,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,cAAc,CAAC;AACxB,CAAC;AA3CD,wCA2CC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { HttpServerRequest, HttpServerResponse } from
|
|
1
|
+
import type { HttpServerRequest, HttpServerResponse } from '#/http/server';
|
|
2
2
|
import type { ApiGatewayMiddlewareNext } from '../gateway';
|
|
3
3
|
export declare function responseTimeMiddleware(request: HttpServerRequest, next: ApiGatewayMiddlewareNext): Promise<HttpServerResponse>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.responseTimeMiddleware = void 0;
|
|
4
|
-
const math_1 = require("
|
|
5
|
-
const timer_1 = require("
|
|
4
|
+
const math_1 = require("#/utils/math");
|
|
5
|
+
const timer_1 = require("#/utils/timer");
|
|
6
6
|
async function responseTimeMiddleware(request, next) {
|
|
7
7
|
const timer = new timer_1.Timer(true);
|
|
8
8
|
const response = await next(request);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response-time.middleware.js","sourceRoot":"","sources":["../../../../source/api/server/middlewares/response-time.middleware.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"response-time.middleware.js","sourceRoot":"","sources":["../../../../source/api/server/middlewares/response-time.middleware.ts"],"names":[],"mappings":";;;AACA,uCAAqC;AACrC,yCAAsC;AAG/B,KAAK,UAAU,sBAAsB,CAAC,OAA0B,EAAE,IAA8B;IACrG,MAAM,KAAK,GAAG,IAAI,aAAK,CAAC,IAAI,CAAC,CAAC;IAE9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,IAAA,YAAK,EAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAE1C,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,GAAG,IAAI,IAAI,CAAC,CAAC;IAErD,OAAO,QAAQ,CAAC;AAClB,CAAC;AATD,wDASC"}
|
package/api/server/module.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Type } from
|
|
1
|
+
import type { Type } from '#/types';
|
|
2
2
|
import type { ApiGatewayOptions } from './gateway';
|
|
3
|
-
export
|
|
3
|
+
export type ApiModuleOptions = {
|
|
4
4
|
controllers: Type[];
|
|
5
5
|
gatewayOptions?: ApiGatewayOptions;
|
|
6
6
|
};
|
package/api/server/module.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.configureApiServer = exports.apiModuleOptions = void 0;
|
|
4
|
-
const container_1 = require("
|
|
5
|
-
const type_guards_1 = require("
|
|
4
|
+
const container_1 = require("#/container");
|
|
5
|
+
const type_guards_1 = require("#/utils/type-guards");
|
|
6
6
|
const api_controller_1 = require("./api-controller");
|
|
7
7
|
const tokens_1 = require("./tokens");
|
|
8
8
|
exports.apiModuleOptions = {
|
package/api/server/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../source/api/server/module.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../source/api/server/module.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAExC,qDAAgD;AAChD,qDAAuD;AAEvD,qCAA8C;AAOjC,QAAA,gBAAgB,GAAqB;IAChD,WAAW,EAAE,EAAE;CAChB,CAAC;AAEF,SAAgB,kBAAkB,CAAC,OAAkC;IACnE,IAAI,IAAA,uBAAS,EAAC,OAAO,CAAC,WAAW,CAAC,EAAE;QAClC,KAAK,MAAM,UAAU,IAAI,OAAO,CAAC,WAAW,EAAE;YAC5C,IAAA,oCAAmB,EAAC,UAAU,CAAC,CAAC;SACjC;QAED,wBAAgB,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;KACpD;IAED,wBAAgB,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,IAAI,wBAAgB,CAAC,cAAc,CAAC;IAE5F,qBAAS,CAAC,QAAQ,CAAC,2BAAkB,EAAE,EAAE,QAAQ,EAAE,wBAAgB,EAAE,CAAC,CAAC;AACzE,CAAC;AAZD,gDAYC"}
|
package/api/server/tokens.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { ApiModuleOptions } from './module';
|
|
2
|
-
export declare const API_MODULE_OPTIONS: import("
|
|
2
|
+
export declare const API_MODULE_OPTIONS: import("#/container").InjectionToken<ApiModuleOptions, any>;
|
package/api/server/tokens.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.API_MODULE_OPTIONS = void 0;
|
|
4
|
-
const container_1 = require("
|
|
4
|
+
const container_1 = require("#/container");
|
|
5
5
|
exports.API_MODULE_OPTIONS = (0, container_1.injectionToken)('API_MODULE_OPTIONS');
|
|
6
6
|
//# sourceMappingURL=tokens.js.map
|
package/api/server/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../source/api/server/tokens.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../../../source/api/server/tokens.ts"],"names":[],"mappings":";;;AAAA,2CAA6C;AAGhC,QAAA,kBAAkB,GAAG,IAAA,0BAAc,EAAmB,oBAAoB,CAAC,CAAC"}
|