@tstdl/base 0.92.122 → 0.92.124
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/ai/ai-file.service.js +23 -18
- package/ai/ai.service.js +79 -147
- package/api/server/gateway.js +6 -6
- package/authentication/authentication.api.js +24 -24
- package/authentication/server/authentication.service.js +20 -20
- package/browser/page-controller.js +1 -1
- package/context/context.js +5 -5
- package/document-management/api/document-management.api.js +32 -68
- package/document-management/models/document-assignment-scope.model.js +38 -0
- package/document-management/models/document-assignment-task.model.js +38 -0
- package/document-management/models/document-category.model.js +7 -1
- package/document-management/models/document-collection-assignment.model.js +39 -0
- package/document-management/models/document-collection.model.js +10 -0
- package/document-management/models/document-property-value.model.js +15 -46
- package/document-management/models/document-property.model.js +2 -2
- package/document-management/models/document-request-submission.model.js +34 -0
- package/document-management/models/document-request-template.js +3 -8
- package/document-management/models/document-request.model.js +22 -12
- package/document-management/models/document-type-validation.model.js +34 -0
- package/document-management/models/document-type.model.js +0 -5
- package/document-management/models/document-validation-definition.model.js +39 -0
- package/document-management/models/document-validation-execution-related-document.model.js +34 -0
- package/document-management/models/document-validation-execution.model.js +72 -0
- package/document-management/models/document-workflow.model.js +70 -0
- package/document-management/models/document.model.js +21 -5
- package/document-management/models/index.js +10 -5
- package/document-management/models/service-models/categories-and-types.view-model.js +2 -21
- package/document-management/models/service-models/document-folders.view-model.js +20 -44
- package/document-management/models/service-models/document-management.view-model.js +127 -0
- package/document-management/models/service-models/document.service-model.js +30 -28
- package/document-management/models/service-models/enriched/enriched-document-assignment.view.js +12 -0
- package/document-management/models/service-models/enriched/enriched-document-category.view.js +47 -0
- package/document-management/models/service-models/enriched/enriched-document-collection.view.js +89 -0
- package/document-management/models/service-models/enriched/enriched-document-file.view.js +16 -0
- package/document-management/models/service-models/enriched/enriched-document-management-data.view.js +130 -0
- package/document-management/models/service-models/enriched/enriched-document-request.view.js +52 -0
- package/document-management/models/service-models/enriched/enriched-document-type.view.js +10 -0
- package/document-management/models/service-models/enriched/enriched-document.view.js +77 -0
- package/document-management/models/service-models/enriched/enriched.js +39 -0
- package/document-management/models/service-models/enriched/index.js +9 -0
- package/document-management/models/service-models/index.js +2 -2
- package/document-management/models/service-models/normalized-requests-template-data.model.js +5 -4
- package/document-management/models/service-models/stats.view-model.js +19 -9
- package/document-management/server/module.js +3 -7
- package/document-management/server/schemas.js +18 -23
- package/document-management/server/services/document-category-type.service.js +66 -0
- package/document-management/server/services/document-collection.service.js +41 -0
- package/document-management/server/services/document-file.service.js +204 -0
- package/document-management/server/services/document-management-ai.service.js +340 -0
- package/document-management/server/services/document-management-ancillary.service.js +24 -0
- package/document-management/server/services/document-management.service.js +106 -888
- package/document-management/server/services/document-property.service.js +87 -0
- package/document-management/server/services/document-request.service.js +138 -0
- package/document-management/server/services/document-validation.service.js +145 -0
- package/document-management/server/services/document-workflow.service.js +132 -0
- package/document-management/server/services/document.service.js +81 -0
- package/document-management/server/services/index.js +9 -0
- package/document-management/server/validators/ai-validation-executor.js +51 -0
- package/document-management/server/validators/index.js +2 -0
- package/document-management/server/validators/single-document-validation-executor.js +20 -0
- package/document-management/server/validators/validator.js +2 -0
- package/eslint.config.js +31 -17
- package/examples/document-management/main.js +28 -12
- package/file/mime-type.js +2 -9
- package/formats.js +32 -23
- package/http/client/http-client.js +1 -1
- package/injector/injector.js +2 -2
- package/object-storage/s3/s3.object-storage.js +1 -1
- package/orm/data-types/bytea.js +8 -0
- package/orm/data-types/index.js +4 -0
- package/orm/data-types/numeric-date.js +9 -0
- package/orm/data-types/timestamp.js +9 -0
- package/orm/decorators.js +50 -0
- package/orm/entity.js +19 -0
- package/orm/index.js +5 -0
- package/orm/query.js +6 -0
- package/orm/server/database-schema.js +29 -0
- package/orm/server/database.js +17 -3
- package/orm/server/drizzle/schema-converter.js +12 -1
- package/orm/server/encryption.js +29 -4
- package/orm/server/index.js +7 -0
- package/orm/server/module.js +9 -0
- package/orm/server/query-converter.js +66 -11
- package/orm/server/repository.js +363 -81
- package/orm/server/transaction.js +5 -5
- package/orm/server/transactional.js +134 -0
- package/orm/sqls.js +60 -0
- package/orm/utils.js +12 -0
- package/package.json +33 -31
- package/password/password-check-result.model.js +8 -8
- package/password/password-check.js +5 -7
- package/password/password-check.localization.js +12 -12
- package/pdf/pdf.service.js +1 -1
- package/pdf/utils.js +19 -2
- package/process/spawn.js +42 -5
- package/queue/postgres/queue.js +5 -5
- package/queue/queue.js +6 -6
- package/schema/schemas/one-or-many.js +1 -1
- package/search-index/elastic/model/index-mapping.js +0 -1
- package/search-index/elastic/search-index.js +3 -3
- package/types/ai/ai-file.service.d.ts +27 -0
- package/types/ai/ai-session.d.ts +11 -0
- package/types/ai/ai.service.d.ts +60 -0
- package/types/ai/functions.d.ts +3 -0
- package/types/ai/types.d.ts +91 -0
- package/types/api/client/client.d.ts +23 -0
- package/types/api/default-error-handlers.d.ts +14 -0
- package/types/api/server/api-controller.d.ts +11 -0
- package/types/api/server/error-handler.d.ts +4 -0
- package/types/api/server/gateway.d.ts +77 -0
- package/types/api/server/middlewares/catch-error.middleware.d.ts +4 -0
- package/types/api/server/middlewares/cors.middleware.d.ts +6 -0
- package/types/api/server/module.d.ts +10 -0
- package/types/api/server/tokens.d.ts +5 -0
- package/types/api/types.d.ts +123 -0
- package/types/application/application.d.ts +34 -0
- package/types/authentication/authentication.api.d.ts +293 -0
- package/types/authentication/client/api.client.d.ts +9 -0
- package/types/authentication/client/authentication.service.d.ts +61 -0
- package/types/authentication/client/http-client.middleware.d.ts +4 -0
- package/types/authentication/client/module.d.ts +10 -0
- package/types/authentication/client/tokens.d.ts +4 -0
- package/types/authentication/errors/secret-requirements.error.d.ts +5 -0
- package/types/authentication/models/authentication-credentials.model.d.ts +7 -0
- package/types/authentication/models/authentication-session.model.d.ts +10 -0
- package/types/authentication/models/schemas.d.ts +5 -0
- package/types/authentication/models/secret-check-result.model.d.ts +3 -0
- package/types/authentication/models/token.model.d.ts +20 -0
- package/types/authentication/server/authentication-ancillary.service.d.ts +27 -0
- package/types/authentication/server/authentication-api-request-token.provider.d.ts +8 -0
- package/types/authentication/server/authentication.api-controller.d.ts +23 -0
- package/types/authentication/server/authentication.service.d.ts +110 -0
- package/types/authentication/server/helper.d.ts +15 -0
- package/types/authentication/server/module.d.ts +14 -0
- package/types/browser/browser-context-controller.d.ts +45 -0
- package/types/browser/browser-controller.d.ts +49 -0
- package/types/browser/browser.service.d.ts +42 -0
- package/types/browser/element-controller.d.ts +104 -0
- package/types/browser/locator-controller.d.ts +16 -0
- package/types/browser/page-controller.d.ts +40 -0
- package/types/browser/types.d.ts +15 -0
- package/types/browser/utils.d.ts +17 -0
- package/types/collections/observable/observable-sorted-array-list.d.ts +36 -0
- package/types/collections/sorted-array-list.d.ts +37 -0
- package/types/context/context.d.ts +10 -0
- package/types/data-structures/array-list.d.ts +30 -0
- package/types/data-structures/circular-buffer.d.ts +56 -0
- package/types/data-structures/collection.d.ts +65 -0
- package/types/data-structures/context-data-map.d.ts +11 -0
- package/types/data-structures/index-out-of-bounds.error.d.ts +8 -0
- package/types/data-structures/linked-list.d.ts +57 -0
- package/types/data-structures/list.d.ts +78 -0
- package/types/data-structures/sorted-array-list.d.ts +49 -0
- package/types/database/module.d.ts +8 -0
- package/types/database/mongo/classes.d.ts +21 -0
- package/types/database/mongo/model/document.d.ts +29 -0
- package/types/database/mongo/mongo-base.repository.d.ts +103 -0
- package/types/database/mongo/mongo-bulk.d.ts +35 -0
- package/types/database/mongo/mongo-entity-repository.d.ts +98 -0
- package/types/database/mongo/operations.d.ts +10 -0
- package/types/database/mongo/query-converter.d.ts +6 -0
- package/types/database/mongo/simple-entity-repository.d.ts +7 -0
- package/types/database/mongo/types.d.ts +50 -0
- package/types/database/query.d.ts +121 -0
- package/types/decorators/log.d.ts +3 -0
- package/types/disposable/async-disposer.d.ts +35 -0
- package/types/distributed-loop/distributed-loop.d.ts +32 -0
- package/types/distributed-loop/provider.d.ts +7 -0
- package/types/document-management/api/document-management.api.d.ts +634 -0
- package/types/document-management/localizations/localization.d.ts +9 -0
- package/types/document-management/models/document-assignment-scope.model.d.ts +11 -0
- package/types/document-management/models/document-assignment-task.model.d.ts +13 -0
- package/types/document-management/models/document-category.model.d.ts +7 -0
- package/types/document-management/models/document-collection-assignment.model.d.ts +7 -0
- package/types/document-management/models/document-collection.model.d.ts +5 -0
- package/types/document-management/models/document-file.model.d.ts +7 -0
- package/types/document-management/models/document-property-value.model.d.ts +12 -0
- package/types/document-management/models/document-property.model.d.ts +16 -0
- package/types/document-management/models/document-request-collection.model.d.ts +7 -0
- package/types/document-management/models/document-request-submission.model.d.ts +7 -0
- package/types/document-management/models/document-request-template.d.ts +8 -0
- package/types/document-management/models/document-request.model.d.ts +18 -0
- package/types/document-management/models/document-requests-template.d.ts +5 -0
- package/types/document-management/models/document-type-property.model.d.ts +6 -0
- package/types/document-management/models/document-type-validation.model.d.ts +6 -0
- package/types/document-management/models/document-type.model.d.ts +7 -0
- package/types/document-management/models/document-validation-definition.model.d.ts +10 -0
- package/types/document-management/models/document-validation-execution-related-document.model.d.ts +7 -0
- package/types/document-management/models/document-validation-execution.model.d.ts +26 -0
- package/types/document-management/models/document-workflow.model.d.ts +35 -0
- package/types/document-management/models/document.model.d.ts +24 -0
- package/types/document-management/models/index.d.ts +22 -0
- package/types/document-management/models/service-models/categories-and-types.view-model.d.ts +6 -0
- package/types/document-management/models/service-models/document-folders.view-model.d.ts +15 -0
- package/types/document-management/models/service-models/document-management.view-model.d.ts +41 -0
- package/types/document-management/models/service-models/document.service-model.d.ts +253 -0
- package/types/document-management/models/service-models/enriched/enriched-document-assignment.view.d.ts +11 -0
- package/types/document-management/models/service-models/enriched/enriched-document-category.view.d.ts +13 -0
- package/types/document-management/models/service-models/enriched/enriched-document-collection.view.d.ts +22 -0
- package/types/document-management/models/service-models/enriched/enriched-document-file.view.d.ts +12 -0
- package/types/document-management/models/service-models/enriched/enriched-document-management-data.view.d.ts +41 -0
- package/types/document-management/models/service-models/enriched/enriched-document-request.view.d.ts +17 -0
- package/types/document-management/models/service-models/enriched/enriched-document-type.view.d.ts +9 -0
- package/types/document-management/models/service-models/enriched/enriched-document.view.d.ts +28 -0
- package/types/document-management/models/service-models/enriched/enriched.d.ts +18 -0
- package/types/document-management/models/service-models/enriched/index.d.ts +9 -0
- package/types/document-management/models/service-models/index.d.ts +8 -0
- package/types/document-management/models/service-models/normalized-requests-template-data.model.d.ts +18 -0
- package/types/document-management/models/service-models/stats.view-model.d.ts +8 -0
- package/types/document-management/server/module.d.ts +12 -0
- package/types/document-management/server/schemas.d.ts +31 -0
- package/types/document-management/server/services/document-category-type.service.d.ts +25 -0
- package/types/document-management/server/services/document-collection.service.d.ts +13 -0
- package/types/document-management/server/services/document-file.service.d.ts +17 -0
- package/types/document-management/server/services/document-management-ai.service.d.ts +22 -0
- package/types/document-management/server/services/document-management-ancillary.service.d.ts +128 -0
- package/types/document-management/server/services/document-management.service.d.ts +13 -0
- package/types/document-management/server/services/document-property.service.d.ts +84 -0
- package/types/document-management/server/services/document-request.service.d.ts +30 -0
- package/types/document-management/server/services/document-validation.service.d.ts +20 -0
- package/types/document-management/server/services/document-workflow.service.d.ts +20 -0
- package/types/document-management/server/services/document.service.d.ts +16 -0
- package/types/document-management/server/services/index.d.ts +11 -0
- package/types/document-management/server/validators/ai-validation-executor.d.ts +19 -0
- package/types/document-management/server/validators/index.d.ts +2 -0
- package/types/document-management/server/validators/single-document-validation-executor.d.ts +16 -0
- package/types/document-management/server/validators/validator.d.ts +21 -0
- package/types/dom/file-select-dialog.d.ts +7 -0
- package/types/dom/observation/intersection-observer.d.ts +4 -0
- package/types/dom/observation/media-query-observer.d.ts +12 -0
- package/types/dom/observation/resize-observer.d.ts +4 -0
- package/types/enumerable/async-enumerable.d.ts +78 -0
- package/types/enumerable/enumerable.d.ts +63 -0
- package/types/enumeration/enumeration.d.ts +5 -0
- package/types/errors/errors.localization.d.ts +53 -0
- package/types/errors/not-supported.error.d.ts +7 -0
- package/types/examples/api/authentication.d.ts +1 -0
- package/types/examples/api/basic-overview.d.ts +1 -0
- package/types/examples/api/custom-authentication.d.ts +1 -0
- package/types/examples/api/streaming.d.ts +1 -0
- package/types/examples/browser/basic.d.ts +1 -0
- package/types/examples/document-management/main.d.ts +21 -0
- package/types/examples/http/client.d.ts +1 -0
- package/types/examples/mail/templates/hello-name.d.ts +5 -0
- package/types/examples/orm/schemas.d.ts +3 -0
- package/types/examples/orm/user.model.d.ts +13 -0
- package/types/examples/pdf/templates/hello-name.d.ts +2 -0
- package/types/examples/reflection/basic.d.ts +11 -0
- package/types/examples/template/templates/hello-jsx.d.ts +4 -0
- package/types/examples/template/templates/hello-name.d.ts +4 -0
- package/types/formats.d.ts +51 -0
- package/types/function/log.d.ts +8 -0
- package/types/http/client/adapters/undici.adapter.d.ts +20 -0
- package/types/http/client/http-client-request.d.ts +122 -0
- package/types/http/client/http-client-response.d.ts +28 -0
- package/types/http/client/http-client.d.ts +56 -0
- package/types/http/client/middleware.d.ts +10 -0
- package/types/http/client/module.d.ts +12 -0
- package/types/http/client/tokens.d.ts +2 -0
- package/types/http/http-body.d.ts +21 -0
- package/types/http/http-value-map.d.ts +36 -0
- package/types/http/http.error.d.ts +28 -0
- package/types/http/server/http-server-request.d.ts +23 -0
- package/types/http/server/http-server-response.d.ts +38 -0
- package/types/http/server/http-server.d.ts +16 -0
- package/types/http/server/node/node-http-server.d.ts +22 -0
- package/types/http/types.d.ts +10 -0
- package/types/http/utils.d.ts +18 -0
- package/types/image-service/imgproxy/imgproxy-image-service.d.ts +24 -0
- package/types/index.d.ts +8 -2
- package/types/injector/decorators.d.ts +82 -0
- package/types/injector/injector.d.ts +113 -0
- package/types/injector/interfaces.d.ts +17 -0
- package/types/injector/provider.d.ts +57 -0
- package/types/injector/resolution.d.ts +15 -0
- package/types/injector/resolve-chain.d.ts +34 -0
- package/types/injector/resolve.error.d.ts +5 -0
- package/types/injector/token.d.ts +25 -0
- package/types/injector/type-info.d.ts +22 -0
- package/types/injector/types.d.ts +64 -0
- package/types/key-value-store/key-value.store.d.ts +23 -0
- package/types/key-value-store/mongo/module.d.ts +8 -0
- package/types/key-value-store/mongo/mongo-key-value-store.provider.d.ts +8 -0
- package/types/key-value-store/mongo/mongo-key-value.model.d.ts +7 -0
- package/types/key-value-store/mongo/mongo-key-value.repository.d.ts +10 -0
- package/types/key-value-store/mongo/mongo-key-value.store.d.ts +14 -0
- package/types/key-value-store/mongo/tokens.d.ts +3 -0
- package/types/lock/lock.d.ts +48 -0
- package/types/lock/mongo/lock.d.ts +14 -0
- package/types/lock/mongo/model.d.ts +6 -0
- package/types/lock/mongo/module.d.ts +12 -0
- package/types/lock/mongo/mongo-lock-repository.d.ts +14 -0
- package/types/lock/mongo/provider.d.ts +8 -0
- package/types/lock/provider.d.ts +10 -0
- package/types/lock/web/web-lock.provider.d.ts +8 -0
- package/types/logger/logger.d.ts +41 -0
- package/types/logger/tokens.d.ts +2 -0
- package/types/mail/clients/nodemailer.mail-client.d.ts +13 -0
- package/types/mail/mail.client.d.ts +17 -0
- package/types/mail/mail.service.d.ts +10 -0
- package/types/mail/models/mail-data.model.d.ts +21 -0
- package/types/mail/models/mail-log.model.d.ts +10 -0
- package/types/mail/models/mail-template.model.d.ts +14 -0
- package/types/mail/models/schemas.d.ts +3 -0
- package/types/mail/module.d.ts +15 -0
- package/types/mail/tokens.d.ts +1 -0
- package/types/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.d.ts +8 -0
- package/types/message-bus/broadcast-channel/broadcast-channel-message-bus.d.ts +19 -0
- package/types/message-bus/local/local-message-bus-provider.d.ts +9 -0
- package/types/message-bus/local/local-message-bus.d.ts +14 -0
- package/types/message-bus/message-bus-base.d.ts +26 -0
- package/types/message-bus/message-bus.d.ts +15 -0
- package/types/migration/migration-state-repository.d.ts +4 -0
- package/types/migration/migration-state.d.ts +6 -0
- package/types/migration/mongo/migration-state-repository.d.ts +11 -0
- package/types/migration/mongo/module.d.ts +12 -0
- package/types/module/module-base.d.ts +18 -0
- package/types/module/module-metric-reporter.d.ts +29 -0
- package/types/module/module.d.ts +23 -0
- package/types/module/modules/function.module.d.ts +10 -0
- package/types/module/modules/web-server.module.d.ts +27 -0
- package/types/module/utils.d.ts +4 -0
- package/types/object-storage/object-storage.d.ts +75 -0
- package/types/object-storage/object.d.ts +12 -0
- package/types/object-storage/s3/s3.object-storage-provider.d.ts +41 -0
- package/types/object-storage/s3/s3.object-storage.d.ts +28 -0
- package/types/object-storage/s3/s3.object.d.ts +16 -0
- package/types/openid-connect/cached-oidc-configuration.service.d.ts +9 -0
- package/types/openid-connect/mongo-oidc-state.repository.d.ts +21 -0
- package/types/openid-connect/oidc-configuration.service.d.ts +13 -0
- package/types/openid-connect/oidc-state.model.d.ts +11 -0
- package/types/openid-connect/oidc-state.repository.d.ts +4 -0
- package/types/openid-connect/oidc.service.d.ts +20 -0
- package/types/orm/data-types/bytea.d.ts +18 -0
- package/types/orm/data-types/index.d.ts +7 -0
- package/types/orm/data-types/numeric-date.d.ts +19 -0
- package/types/orm/data-types/timestamp.d.ts +19 -0
- package/types/orm/decorators.d.ts +212 -0
- package/types/orm/entity.d.ts +41 -0
- package/types/orm/index.d.ts +12 -0
- package/types/orm/query.d.ts +164 -0
- package/types/orm/repository.types.d.ts +84 -0
- package/types/orm/schemas/json.d.ts +9 -0
- package/types/orm/schemas/numeric-date.d.ts +8 -0
- package/types/orm/schemas/timestamp.d.ts +10 -0
- package/types/orm/schemas/uuid.d.ts +11 -0
- package/types/orm/server/database-schema.d.ts +45 -0
- package/types/orm/server/database.d.ts +27 -0
- package/types/orm/server/drizzle/schema-converter.d.ts +15 -0
- package/types/orm/server/encryption.d.ts +18 -0
- package/types/orm/server/index.d.ts +13 -0
- package/types/orm/server/module.d.ts +32 -0
- package/types/orm/server/query-converter.d.ts +21 -0
- package/types/orm/server/repository.d.ts +487 -0
- package/types/orm/server/tokens.d.ts +1 -0
- package/types/orm/server/transaction.d.ts +29 -0
- package/types/orm/server/transactional.d.ts +75 -0
- package/types/orm/server/types.d.ts +47 -0
- package/types/orm/sqls.d.ts +71 -0
- package/types/orm/types.d.ts +93 -0
- package/types/orm/utils.d.ts +19 -0
- package/types/password/password-check-result.model.d.ts +19 -0
- package/types/password/password-check.localization.d.ts +20 -0
- package/types/pdf/pdf.service.d.ts +101 -0
- package/types/pdf/utils.d.ts +12 -0
- package/types/pool/pool.d.ts +49 -0
- package/types/process/spawn.d.ts +22 -0
- package/types/process-shutdown.d.ts +9 -0
- package/types/promise/cancelable-promise.d.ts +15 -0
- package/types/queue/mongo/job.d.ts +12 -0
- package/types/queue/mongo/mongo-job.repository.d.ts +13 -0
- package/types/queue/mongo/queue.d.ts +38 -0
- package/types/queue/mongo/queue.provider.d.ts +22 -0
- package/types/queue/postgres/job.model.d.ts +13 -0
- package/types/queue/postgres/module.d.ts +9 -0
- package/types/queue/postgres/queue.d.ts +31 -0
- package/types/queue/postgres/queue.provider.d.ts +7 -0
- package/types/queue/postgres/schemas.d.ts +3 -0
- package/types/queue/provider.d.ts +5 -0
- package/types/queue/queue.d.ts +91 -0
- package/types/reflection/decorators.d.ts +15 -0
- package/types/reflection/registry.d.ts +61 -0
- package/types/reflection/types.d.ts +90 -0
- package/types/reflection/utils.d.ts +33 -0
- package/types/rpc/model.d.ts +64 -0
- package/types/rpc/rpc.adapter.d.ts +19 -0
- package/types/rpc/rpc.d.ts +21 -0
- package/types/rpc/rpc.error.d.ts +8 -0
- package/types/rxjs-utils/retry-backoff.d.ts +4 -0
- package/types/schema/converters/openapi-converter.d.ts +3 -0
- package/types/schema/decorators/class.d.ts +3 -0
- package/types/schema/decorators/description.d.ts +3 -0
- package/types/schema/decorators/schema.d.ts +21 -0
- package/types/schema/decorators/types.d.ts +24 -0
- package/types/schema/decorators/utils.d.ts +7 -0
- package/types/schema/schema.d.ts +99 -0
- package/types/schema/schema.error.d.ts +25 -0
- package/types/schema/schemas/array.d.ts +20 -0
- package/types/schema/schemas/defaulted.d.ts +13 -0
- package/types/schema/schemas/deferred.d.ts +12 -0
- package/types/schema/schemas/enumeration.d.ts +13 -0
- package/types/schema/schemas/function.d.ts +23 -0
- package/types/schema/schemas/instance.d.ts +13 -0
- package/types/schema/schemas/literal.d.ts +12 -0
- package/types/schema/schemas/never.d.ts +8 -0
- package/types/schema/schemas/nullable.d.ts +12 -0
- package/types/schema/schemas/number.d.ts +19 -0
- package/types/schema/schemas/object.d.ts +91 -0
- package/types/schema/schemas/one-or-many.d.ts +15 -0
- package/types/schema/schemas/optional.d.ts +13 -0
- package/types/schema/schemas/simple.d.ts +27 -0
- package/types/schema/schemas/transform.d.ts +10 -0
- package/types/schema/schemas/union.d.ts +15 -0
- package/types/search-index/elastic/config.d.ts +8 -0
- package/types/search-index/elastic/model/index-mapping.d.ts +26 -0
- package/types/search-index/elastic/model/sort.d.ts +8 -0
- package/types/search-index/elastic/module.d.ts +10 -0
- package/types/search-index/elastic/query-converter.d.ts +9 -0
- package/types/search-index/elastic/search-index.d.ts +30 -0
- package/types/search-index/elastic/sort-converter.d.ts +4 -0
- package/types/search-index/error.d.ts +10 -0
- package/types/search-index/memory/memory-search-index.d.ts +19 -0
- package/types/search-index/search-index.d.ts +46 -0
- package/types/search-index/search-result.d.ts +12 -0
- package/types/serializer/handlers/binary.d.ts +12 -0
- package/types/serializer/serializable.d.ts +33 -0
- package/types/serializer/serializer.d.ts +20 -0
- package/types/serializer/types.d.ts +65 -0
- package/types/sse/server-sent-events-source.d.ts +12 -0
- package/types/templates/module.d.ts +14 -0
- package/types/templates/providers/file.template-provider.d.ts +15 -0
- package/types/templates/renderers/handlebars.template-renderer.d.ts +43 -0
- package/types/templates/renderers/jsx.template-renderer.d.ts +10 -0
- package/types/templates/renderers/mjml.template-renderer.d.ts +16 -0
- package/types/templates/renderers/string.template-renderer.d.ts +10 -0
- package/types/templates/resolvers/file.template-resolver.d.ts +22 -0
- package/types/templates/resolvers/jsx.template-resolver.d.ts +17 -0
- package/types/templates/resolvers/string.template-resolver.d.ts +13 -0
- package/types/templates/template.model.d.ts +25 -0
- package/types/templates/template.renderer.d.ts +20 -0
- package/types/templates/template.service.d.ts +18 -0
- package/types/templates/tokens.d.ts +4 -0
- package/types/test.d.ts +1 -0
- package/types/test2.d.ts +1 -0
- package/types/test3.d.ts +1 -0
- package/types/test4.d.ts +21 -0
- package/types/test5.d.ts +1 -0
- package/types/test6.d.ts +1 -0
- package/types/text/dynamic-text.model.d.ts +15 -0
- package/types/text/localization.service.d.ts +92 -0
- package/types/theme/adapters/tailwind-adapter.d.ts +18 -0
- package/types/theme/theme-service.d.ts +43 -0
- package/types/threading/thread-pool.d.ts +20 -0
- package/types/tools/fetch-mime-types.d.ts +1 -0
- package/types/types/geo-json.d.ts +36 -0
- package/types/types/index.d.ts +2 -0
- package/types/types/tagged.d.ts +16 -0
- package/types/types.d.ts +215 -0
- package/types/utils/async-hook/async-hook.d.ts +9 -0
- package/types/utils/async-hook/index.d.ts +1 -0
- package/types/utils/async-iterable-helpers/take-until.d.ts +3 -0
- package/types/utils/backoff.d.ts +77 -0
- package/types/utils/binary.d.ts +16 -0
- package/types/utils/cryptography.d.ts +122 -0
- package/types/utils/encoding.d.ts +36 -0
- package/types/utils/enum.d.ts +9 -0
- package/types/utils/equals.d.ts +30 -0
- package/types/utils/event-loop.d.ts +4 -0
- package/types/utils/format-error.d.ts +24 -0
- package/types/utils/function/class.d.ts +6 -0
- package/types/utils/function/index.d.ts +3 -0
- package/types/utils/function/memoize.d.ts +36 -0
- package/types/utils/iterable-helpers/take-until.d.ts +2 -0
- package/types/utils/jwt.d.ts +32 -0
- package/types/utils/math.d.ts +93 -0
- package/types/utils/merge.d.ts +19 -0
- package/types/utils/object/decycle.d.ts +16 -0
- package/types/utils/object/dereference.d.ts +34 -0
- package/types/utils/object/forward-ref.d.ts +21 -0
- package/types/utils/object/lazy-property.d.ts +49 -0
- package/types/utils/object/object.d.ts +30 -0
- package/types/utils/object/property-name.d.ts +61 -0
- package/types/utils/patch-worker.d.ts +25 -0
- package/types/utils/reactive-value-to-signal.d.ts +20 -0
- package/types/utils/reflection.d.ts +8 -0
- package/types/utils/repl.d.ts +9 -0
- package/types/utils/singleton.d.ts +7 -0
- package/types/utils/stream/from-promise.d.ts +3 -0
- package/types/utils/stream/index.d.ts +9 -0
- package/types/utils/stream/size-limited-stream.d.ts +2 -0
- package/types/utils/timing.d.ts +20 -0
- package/types/utils/try-ignore.d.ts +9 -0
- package/types/utils/type/extends.d.ts +3 -0
- package/types/utils/type-guards.d.ts +259 -0
- package/types/utils/z-base32.d.ts +3 -0
- package/utils/async-hook/async-hook.js +21 -0
- package/utils/async-hook/index.js +1 -0
- package/utils/compression.js +1 -1
- package/utils/function/class.js +9 -0
- package/utils/function/index.js +1 -0
- package/utils/function/memoize.js +41 -2
- package/utils/jwt.js +5 -5
- package/utils/object/forward-ref.js +12 -12
- package/utils/object/lazy-property.js +2 -2
- package/utils/proxy.js +1 -1
- package/utils/stream/from-promise.js +27 -0
- package/utils/stream/index.js +1 -1
- package/utils/stream/stream-reader.js +71 -31
- package/ai/ai-file.service.d.ts +0 -27
- package/ai/ai-session.d.ts +0 -11
- package/ai/ai.service.d.ts +0 -68
- package/ai/functions.d.ts +0 -3
- package/ai/types.d.ts +0 -89
- package/api/client/client.d.ts +0 -23
- package/api/default-error-handlers.d.ts +0 -14
- package/api/server/api-controller.d.ts +0 -11
- package/api/server/error-handler.d.ts +0 -4
- package/api/server/gateway.d.ts +0 -77
- package/api/server/middlewares/catch-error.middleware.d.ts +0 -4
- package/api/server/middlewares/cors.middleware.d.ts +0 -6
- package/api/server/module.d.ts +0 -10
- package/api/server/tokens.d.ts +0 -5
- package/api/types.d.ts +0 -123
- package/application/application.d.ts +0 -34
- package/authentication/authentication.api.d.ts +0 -293
- package/authentication/client/api.client.d.ts +0 -9
- package/authentication/client/authentication.service.d.ts +0 -61
- package/authentication/client/http-client.middleware.d.ts +0 -4
- package/authentication/client/module.d.ts +0 -10
- package/authentication/client/tokens.d.ts +0 -4
- package/authentication/errors/secret-requirements.error.d.ts +0 -5
- package/authentication/models/authentication-credentials.model.d.ts +0 -7
- package/authentication/models/authentication-session.model.d.ts +0 -10
- package/authentication/models/schemas.d.ts +0 -5
- package/authentication/models/secret-check-result.model.d.ts +0 -3
- package/authentication/models/token.model.d.ts +0 -20
- package/authentication/server/authentication-ancillary.service.d.ts +0 -27
- package/authentication/server/authentication-api-request-token.provider.d.ts +0 -8
- package/authentication/server/authentication.api-controller.d.ts +0 -23
- package/authentication/server/authentication.service.d.ts +0 -110
- package/authentication/server/helper.d.ts +0 -15
- package/authentication/server/module.d.ts +0 -14
- package/browser/browser-context-controller.d.ts +0 -45
- package/browser/browser-controller.d.ts +0 -49
- package/browser/browser.service.d.ts +0 -42
- package/browser/element-controller.d.ts +0 -104
- package/browser/locator-controller.d.ts +0 -16
- package/browser/page-controller.d.ts +0 -40
- package/browser/types.d.ts +0 -15
- package/browser/utils.d.ts +0 -17
- package/collections/observable/observable-sorted-array-list.d.ts +0 -36
- package/collections/sorted-array-list.d.ts +0 -37
- package/context/context.d.ts +0 -10
- package/data-structures/array-list.d.ts +0 -30
- package/data-structures/circular-buffer.d.ts +0 -56
- package/data-structures/collection.d.ts +0 -65
- package/data-structures/context-data-map.d.ts +0 -11
- package/data-structures/index-out-of-bounds.error.d.ts +0 -8
- package/data-structures/linked-list.d.ts +0 -57
- package/data-structures/list.d.ts +0 -78
- package/data-structures/sorted-array-list.d.ts +0 -49
- package/database/module.d.ts +0 -8
- package/database/mongo/classes.d.ts +0 -21
- package/database/mongo/model/document.d.ts +0 -29
- package/database/mongo/mongo-base.repository.d.ts +0 -103
- package/database/mongo/mongo-bulk.d.ts +0 -35
- package/database/mongo/mongo-entity-repository.d.ts +0 -98
- package/database/mongo/operations.d.ts +0 -10
- package/database/mongo/query-converter.d.ts +0 -6
- package/database/mongo/simple-entity-repository.d.ts +0 -7
- package/database/mongo/types.d.ts +0 -50
- package/database/query.d.ts +0 -121
- package/decorators/log.d.ts +0 -3
- package/disposable/async-disposer.d.ts +0 -35
- package/distributed-loop/distributed-loop.d.ts +0 -32
- package/distributed-loop/provider.d.ts +0 -7
- package/document-management/api/document-management.api.d.ts +0 -789
- package/document-management/localizations/localization.d.ts +0 -9
- package/document-management/models/document-category.model.d.ts +0 -5
- package/document-management/models/document-collection-document.model.d.ts +0 -7
- package/document-management/models/document-collection-document.model.js +0 -39
- package/document-management/models/document-collection.model.d.ts +0 -3
- package/document-management/models/document-file.model.d.ts +0 -7
- package/document-management/models/document-property-value.model.d.ts +0 -20
- package/document-management/models/document-property.model.d.ts +0 -15
- package/document-management/models/document-request-assignment-task-collection.model.d.ts +0 -7
- package/document-management/models/document-request-assignment-task-collection.model.js +0 -34
- package/document-management/models/document-request-assignment-task.model.d.ts +0 -14
- package/document-management/models/document-request-assignment-task.model.js +0 -77
- package/document-management/models/document-request-collection.model.d.ts +0 -7
- package/document-management/models/document-request-file.model.d.ts +0 -16
- package/document-management/models/document-request-file.model.js +0 -86
- package/document-management/models/document-request-template.d.ts +0 -10
- package/document-management/models/document-request.model.d.ts +0 -10
- package/document-management/models/document-requests-template.d.ts +0 -5
- package/document-management/models/document-type-property.model.d.ts +0 -6
- package/document-management/models/document-type.model.d.ts +0 -8
- package/document-management/models/document.model.d.ts +0 -13
- package/document-management/models/index.d.ts +0 -17
- package/document-management/models/service-models/categories-and-types.view-model.d.ts +0 -6
- package/document-management/models/service-models/document-folders.view-model.d.ts +0 -22
- package/document-management/models/service-models/document.service-model.d.ts +0 -283
- package/document-management/models/service-models/document.view-model.d.ts +0 -41
- package/document-management/models/service-models/document.view-model.js +0 -110
- package/document-management/models/service-models/index.d.ts +0 -8
- package/document-management/models/service-models/normalized-document-collection-view.model.d.ts +0 -73
- package/document-management/models/service-models/normalized-document-collection-view.model.js +0 -110
- package/document-management/models/service-models/normalized-requests-template-data.model.d.ts +0 -16
- package/document-management/models/service-models/stats.view-model.d.ts +0 -6
- package/document-management/server/module.d.ts +0 -12
- package/document-management/server/schemas.d.ts +0 -36
- package/document-management/server/services/document-management-ancillary.service.d.ts +0 -4
- package/document-management/server/services/document-management.service.d.ts +0 -125
- package/document-management/server/services/index.d.ts +0 -2
- package/dom/file-select-dialog.d.ts +0 -7
- package/dom/observation/intersection-observer.d.ts +0 -4
- package/dom/observation/media-query-observer.d.ts +0 -12
- package/dom/observation/resize-observer.d.ts +0 -4
- package/enumerable/async-enumerable.d.ts +0 -78
- package/enumerable/enumerable.d.ts +0 -63
- package/enumeration/enumeration.d.ts +0 -5
- package/errors/errors.localization.d.ts +0 -53
- package/errors/not-supported.error.d.ts +0 -7
- package/examples/api/authentication.d.ts +0 -1
- package/examples/api/basic-overview.d.ts +0 -1
- package/examples/api/custom-authentication.d.ts +0 -1
- package/examples/api/streaming.d.ts +0 -1
- package/examples/browser/basic.d.ts +0 -1
- package/examples/document-management/main.d.ts +0 -6
- package/examples/http/client.d.ts +0 -1
- package/examples/mail/templates/hello-name.d.ts +0 -5
- package/examples/orm/schemas.d.ts +0 -3
- package/examples/orm/user.model.d.ts +0 -13
- package/examples/pdf/templates/hello-name.d.ts +0 -2
- package/examples/reflection/basic.d.ts +0 -11
- package/examples/template/templates/hello-jsx.d.ts +0 -4
- package/examples/template/templates/hello-name.d.ts +0 -4
- package/formats.d.ts +0 -48
- package/function/log.d.ts +0 -8
- package/http/client/adapters/undici.adapter.d.ts +0 -20
- package/http/client/http-client-request.d.ts +0 -122
- package/http/client/http-client-response.d.ts +0 -28
- package/http/client/http-client.d.ts +0 -56
- package/http/client/middleware.d.ts +0 -10
- package/http/client/module.d.ts +0 -12
- package/http/client/tokens.d.ts +0 -2
- package/http/http-body.d.ts +0 -21
- package/http/http-value-map.d.ts +0 -36
- package/http/http.error.d.ts +0 -28
- package/http/server/http-server-request.d.ts +0 -23
- package/http/server/http-server-response.d.ts +0 -38
- package/http/server/http-server.d.ts +0 -16
- package/http/server/node/node-http-server.d.ts +0 -22
- package/http/types.d.ts +0 -10
- package/http/utils.d.ts +0 -18
- package/image-service/imgproxy/imgproxy-image-service.d.ts +0 -24
- package/index.d.ts +0 -8
- package/injector/decorators.d.ts +0 -82
- package/injector/injector.d.ts +0 -113
- package/injector/interfaces.d.ts +0 -17
- package/injector/provider.d.ts +0 -57
- package/injector/resolution.d.ts +0 -15
- package/injector/resolve-chain.d.ts +0 -34
- package/injector/resolve.error.d.ts +0 -5
- package/injector/token.d.ts +0 -25
- package/injector/type-info.d.ts +0 -22
- package/injector/types.d.ts +0 -64
- package/key-value-store/key-value.store.d.ts +0 -23
- package/key-value-store/mongo/module.d.ts +0 -8
- package/key-value-store/mongo/mongo-key-value-store.provider.d.ts +0 -8
- package/key-value-store/mongo/mongo-key-value.model.d.ts +0 -7
- package/key-value-store/mongo/mongo-key-value.repository.d.ts +0 -10
- package/key-value-store/mongo/mongo-key-value.store.d.ts +0 -14
- package/key-value-store/mongo/tokens.d.ts +0 -3
- package/lock/lock.d.ts +0 -48
- package/lock/mongo/lock.d.ts +0 -14
- package/lock/mongo/model.d.ts +0 -6
- package/lock/mongo/module.d.ts +0 -12
- package/lock/mongo/mongo-lock-repository.d.ts +0 -14
- package/lock/mongo/provider.d.ts +0 -8
- package/lock/provider.d.ts +0 -10
- package/lock/web/web-lock.provider.d.ts +0 -8
- package/logger/logger.d.ts +0 -41
- package/logger/tokens.d.ts +0 -2
- package/mail/clients/nodemailer.mail-client.d.ts +0 -13
- package/mail/mail.client.d.ts +0 -17
- package/mail/mail.service.d.ts +0 -10
- package/mail/models/mail-data.model.d.ts +0 -21
- package/mail/models/mail-log.model.d.ts +0 -10
- package/mail/models/mail-template.model.d.ts +0 -14
- package/mail/models/schemas.d.ts +0 -3
- package/mail/module.d.ts +0 -15
- package/mail/tokens.d.ts +0 -1
- package/message-bus/broadcast-channel/broadcast-channel-message-bus-provider.d.ts +0 -8
- package/message-bus/broadcast-channel/broadcast-channel-message-bus.d.ts +0 -19
- package/message-bus/local/local-message-bus-provider.d.ts +0 -9
- package/message-bus/local/local-message-bus.d.ts +0 -14
- package/message-bus/message-bus-base.d.ts +0 -26
- package/message-bus/message-bus.d.ts +0 -15
- package/migration/migration-state-repository.d.ts +0 -4
- package/migration/migration-state.d.ts +0 -6
- package/migration/mongo/migration-state-repository.d.ts +0 -11
- package/migration/mongo/module.d.ts +0 -12
- package/module/module-base.d.ts +0 -18
- package/module/module-metric-reporter.d.ts +0 -29
- package/module/module.d.ts +0 -23
- package/module/modules/function.module.d.ts +0 -10
- package/module/modules/web-server.module.d.ts +0 -27
- package/module/utils.d.ts +0 -4
- package/object-storage/object-storage.d.ts +0 -75
- package/object-storage/object.d.ts +0 -12
- package/object-storage/s3/s3.object-storage-provider.d.ts +0 -41
- package/object-storage/s3/s3.object-storage.d.ts +0 -28
- package/object-storage/s3/s3.object.d.ts +0 -16
- package/openid-connect/cached-oidc-configuration.service.d.ts +0 -9
- package/openid-connect/mongo-oidc-state.repository.d.ts +0 -21
- package/openid-connect/oidc-configuration.service.d.ts +0 -13
- package/openid-connect/oidc-state.model.d.ts +0 -11
- package/openid-connect/oidc-state.repository.d.ts +0 -4
- package/openid-connect/oidc.service.d.ts +0 -20
- package/orm/data-types/bytea.d.ts +0 -10
- package/orm/data-types/index.d.ts +0 -3
- package/orm/data-types/numeric-date.d.ts +0 -10
- package/orm/data-types/timestamp.d.ts +0 -10
- package/orm/decorators.d.ts +0 -78
- package/orm/entity.d.ts +0 -22
- package/orm/index.d.ts +0 -7
- package/orm/query.d.ts +0 -113
- package/orm/repository.types.d.ts +0 -32
- package/orm/schemas/json.d.ts +0 -9
- package/orm/schemas/numeric-date.d.ts +0 -8
- package/orm/schemas/timestamp.d.ts +0 -10
- package/orm/schemas/uuid.d.ts +0 -11
- package/orm/server/database-schema.d.ts +0 -11
- package/orm/server/database.d.ts +0 -9
- package/orm/server/drizzle/schema-converter.d.ts +0 -14
- package/orm/server/encryption.d.ts +0 -2
- package/orm/server/index.d.ts +0 -6
- package/orm/server/module.d.ts +0 -12
- package/orm/server/query-converter.d.ts +0 -4
- package/orm/server/repository.d.ts +0 -179
- package/orm/server/tokens.d.ts +0 -1
- package/orm/server/transaction.d.ts +0 -29
- package/orm/server/types.d.ts +0 -46
- package/orm/sqls.d.ts +0 -16
- package/orm/types.d.ts +0 -30
- package/orm/utils.d.ts +0 -3
- package/password/password-check-result.model.d.ts +0 -17
- package/password/password-check.localization.d.ts +0 -20
- package/pdf/pdf.service.d.ts +0 -101
- package/pdf/utils.d.ts +0 -3
- package/pool/pool.d.ts +0 -49
- package/process/spawn.d.ts +0 -15
- package/process-shutdown.d.ts +0 -9
- package/promise/cancelable-promise.d.ts +0 -15
- package/queue/mongo/job.d.ts +0 -12
- package/queue/mongo/mongo-job.repository.d.ts +0 -13
- package/queue/mongo/queue.d.ts +0 -38
- package/queue/mongo/queue.provider.d.ts +0 -22
- package/queue/postgres/job.model.d.ts +0 -13
- package/queue/postgres/module.d.ts +0 -9
- package/queue/postgres/queue.d.ts +0 -31
- package/queue/postgres/queue.provider.d.ts +0 -7
- package/queue/postgres/schemas.d.ts +0 -3
- package/queue/provider.d.ts +0 -5
- package/queue/queue.d.ts +0 -89
- package/reflection/decorators.d.ts +0 -15
- package/reflection/registry.d.ts +0 -61
- package/reflection/types.d.ts +0 -90
- package/reflection/utils.d.ts +0 -33
- package/rpc/model.d.ts +0 -64
- package/rpc/rpc.adapter.d.ts +0 -19
- package/rpc/rpc.d.ts +0 -21
- package/rpc/rpc.error.d.ts +0 -8
- package/rxjs-utils/retry-backoff.d.ts +0 -4
- package/schema/converters/openapi-converter.d.ts +0 -3
- package/schema/decorators/class.d.ts +0 -3
- package/schema/decorators/description.d.ts +0 -3
- package/schema/decorators/schema.d.ts +0 -21
- package/schema/decorators/types.d.ts +0 -24
- package/schema/decorators/utils.d.ts +0 -7
- package/schema/schema.d.ts +0 -99
- package/schema/schema.error.d.ts +0 -25
- package/schema/schemas/array.d.ts +0 -20
- package/schema/schemas/defaulted.d.ts +0 -13
- package/schema/schemas/deferred.d.ts +0 -12
- package/schema/schemas/enumeration.d.ts +0 -13
- package/schema/schemas/function.d.ts +0 -23
- package/schema/schemas/instance.d.ts +0 -13
- package/schema/schemas/literal.d.ts +0 -12
- package/schema/schemas/never.d.ts +0 -8
- package/schema/schemas/nullable.d.ts +0 -12
- package/schema/schemas/number.d.ts +0 -19
- package/schema/schemas/object.d.ts +0 -91
- package/schema/schemas/one-or-many.d.ts +0 -14
- package/schema/schemas/optional.d.ts +0 -13
- package/schema/schemas/simple.d.ts +0 -27
- package/schema/schemas/transform.d.ts +0 -10
- package/schema/schemas/union.d.ts +0 -15
- package/search-index/elastic/config.d.ts +0 -8
- package/search-index/elastic/model/index-mapping.d.ts +0 -26
- package/search-index/elastic/model/sort.d.ts +0 -8
- package/search-index/elastic/module.d.ts +0 -10
- package/search-index/elastic/query-converter.d.ts +0 -9
- package/search-index/elastic/search-index.d.ts +0 -31
- package/search-index/elastic/sort-converter.d.ts +0 -4
- package/search-index/error.d.ts +0 -10
- package/search-index/memory/memory-search-index.d.ts +0 -19
- package/search-index/search-index.d.ts +0 -46
- package/search-index/search-result.d.ts +0 -12
- package/serializer/handlers/binary.d.ts +0 -12
- package/serializer/serializable.d.ts +0 -33
- package/serializer/serializer.d.ts +0 -20
- package/serializer/types.d.ts +0 -65
- package/sse/server-sent-events-source.d.ts +0 -12
- package/templates/module.d.ts +0 -14
- package/templates/providers/file.template-provider.d.ts +0 -15
- package/templates/renderers/handlebars.template-renderer.d.ts +0 -43
- package/templates/renderers/jsx.template-renderer.d.ts +0 -10
- package/templates/renderers/mjml.template-renderer.d.ts +0 -16
- package/templates/renderers/string.template-renderer.d.ts +0 -10
- package/templates/resolvers/file.template-resolver.d.ts +0 -22
- package/templates/resolvers/jsx.template-resolver.d.ts +0 -17
- package/templates/resolvers/string.template-resolver.d.ts +0 -13
- package/templates/template.model.d.ts +0 -25
- package/templates/template.renderer.d.ts +0 -20
- package/templates/template.service.d.ts +0 -18
- package/templates/tokens.d.ts +0 -4
- package/text/dynamic-text.model.d.ts +0 -15
- package/text/localization.service.d.ts +0 -92
- package/theme/adapters/tailwind-adapter.d.ts +0 -18
- package/theme/theme-service.d.ts +0 -43
- package/threading/thread-pool.d.ts +0 -20
- package/types/geo-json.d.ts +0 -36
- package/types/tagged.d.ts +0 -16
- package/types.d.ts +0 -214
- package/utils/async-iterable-helpers/take-until.d.ts +0 -3
- package/utils/backoff.d.ts +0 -77
- package/utils/binary.d.ts +0 -16
- package/utils/cryptography.d.ts +0 -122
- package/utils/encoding.d.ts +0 -36
- package/utils/enum.d.ts +0 -9
- package/utils/equals.d.ts +0 -30
- package/utils/event-loop.d.ts +0 -4
- package/utils/format-error.d.ts +0 -24
- package/utils/function/index.d.ts +0 -2
- package/utils/function/memoize.d.ts +0 -18
- package/utils/iterable-helpers/take-until.d.ts +0 -2
- package/utils/jwt.d.ts +0 -32
- package/utils/math.d.ts +0 -93
- package/utils/merge.d.ts +0 -19
- package/utils/object/decycle.d.ts +0 -16
- package/utils/object/dereference.d.ts +0 -34
- package/utils/object/forward-ref.d.ts +0 -20
- package/utils/object/lazy-property.d.ts +0 -49
- package/utils/object/object.d.ts +0 -30
- package/utils/object/property-name.d.ts +0 -61
- package/utils/patch-worker.d.ts +0 -25
- package/utils/reactive-value-to-signal.d.ts +0 -20
- package/utils/reflection.d.ts +0 -8
- package/utils/repl.d.ts +0 -9
- package/utils/singleton.d.ts +0 -7
- package/utils/stream/index.d.ts +0 -9
- package/utils/stream/readable-stream-from-promise.d.ts +0 -2
- package/utils/stream/readable-stream-from-promise.js +0 -8
- package/utils/stream/size-limited-stream.d.ts +0 -2
- package/utils/timing.d.ts +0 -20
- package/utils/try-ignore.d.ts +0 -9
- package/utils/type/extends.d.ts +0 -3
- package/utils/type-guards.d.ts +0 -259
- package/utils/z-base32.d.ts +0 -3
- /package/{ai → types/ai}/index.d.ts +0 -0
- /package/{ai → types/ai}/module.d.ts +0 -0
- /package/{api → types/api}/client/index.d.ts +0 -0
- /package/{api → types/api}/index.d.ts +0 -0
- /package/{api → types/api}/response.d.ts +0 -0
- /package/{api → types/api}/server/api-request-token.provider.d.ts +0 -0
- /package/{api → types/api}/server/index.d.ts +0 -0
- /package/{api → types/api}/server/middlewares/allowed-methods.middleware.d.ts +0 -0
- /package/{api → types/api}/server/middlewares/content-type.middleware.d.ts +0 -0
- /package/{api → types/api}/server/middlewares/index.d.ts +0 -0
- /package/{api → types/api}/server/middlewares/response-time.middleware.d.ts +0 -0
- /package/{api → types/api}/utils.d.ts +0 -0
- /package/{application → types/application}/index.d.ts +0 -0
- /package/{authentication → types/authentication}/client/index.d.ts +0 -0
- /package/{authentication → types/authentication}/errors/index.d.ts +0 -0
- /package/{authentication → types/authentication}/index.d.ts +0 -0
- /package/{authentication → types/authentication}/models/index.d.ts +0 -0
- /package/{authentication → types/authentication}/models/init-secret-reset-data.model.d.ts +0 -0
- /package/{authentication → types/authentication}/models/token-payload-base.model.d.ts +0 -0
- /package/{authentication → types/authentication}/server/authentication-secret-requirements.validator.d.ts +0 -0
- /package/{authentication → types/authentication}/server/drizzle.config.d.ts +0 -0
- /package/{authentication → types/authentication}/server/index.d.ts +0 -0
- /package/{browser → types/browser}/document-controller.d.ts +0 -0
- /package/{browser → types/browser}/frame-controller.d.ts +0 -0
- /package/{browser → types/browser}/index.d.ts +0 -0
- /package/{browser → types/browser}/module.d.ts +0 -0
- /package/{browser → types/browser}/pdf-options.d.ts +0 -0
- /package/{cancellation → types/cancellation}/index.d.ts +0 -0
- /package/{cancellation → types/cancellation}/token.d.ts +0 -0
- /package/{collections → types/collections}/awaitable/awaitable-list.d.ts +0 -0
- /package/{collections → types/collections}/awaitable/awaitable-map.d.ts +0 -0
- /package/{collections → types/collections}/awaitable/awaitable-set.d.ts +0 -0
- /package/{collections → types/collections}/awaitable/index.d.ts +0 -0
- /package/{collections → types/collections}/collection.d.ts +0 -0
- /package/{collections → types/collections}/index.d.ts +0 -0
- /package/{collections → types/collections}/keyed-set.d.ts +0 -0
- /package/{collections → types/collections}/list.d.ts +0 -0
- /package/{collections → types/collections}/observable/index.d.ts +0 -0
- /package/{collections → types/collections}/observable/observable-array.d.ts +0 -0
- /package/{collections → types/collections}/observable/observable-collection-base.d.ts +0 -0
- /package/{collections → types/collections}/observable/observable-collection.d.ts +0 -0
- /package/{collections → types/collections}/observable/observable-list-base.d.ts +0 -0
- /package/{collections → types/collections}/observable/observable-list.d.ts +0 -0
- /package/{collections → types/collections}/observable/observable-map.d.ts +0 -0
- /package/{collections → types/collections}/observable/observable-set.d.ts +0 -0
- /package/{collections → types/collections}/sorted-list.d.ts +0 -0
- /package/{collections → types/collections}/sorted-map.d.ts +0 -0
- /package/{context → types/context}/index.d.ts +0 -0
- /package/{cookie → types/cookie}/cookie.d.ts +0 -0
- /package/{cookie → types/cookie}/index.d.ts +0 -0
- /package/{core.d.ts → types/core.d.ts} +0 -0
- /package/{data-structures → types/data-structures}/array-dictionary.d.ts +0 -0
- /package/{data-structures → types/data-structures}/cache.d.ts +0 -0
- /package/{data-structures → types/data-structures}/dictionary.d.ts +0 -0
- /package/{data-structures → types/data-structures}/distinct-collection.d.ts +0 -0
- /package/{data-structures → types/data-structures}/index.d.ts +0 -0
- /package/{data-structures → types/data-structures}/iterable-weak-map.d.ts +0 -0
- /package/{data-structures → types/data-structures}/map-dictionary.d.ts +0 -0
- /package/{data-structures → types/data-structures}/multi-key-map.d.ts +0 -0
- /package/{data-structures → types/data-structures}/multi-key-set.d.ts +0 -0
- /package/{data-structures → types/data-structures}/set-collection.d.ts +0 -0
- /package/{data-structures → types/data-structures}/weak-ref-map.d.ts +0 -0
- /package/{database → types/database}/entity-repository.d.ts +0 -0
- /package/{database → types/database}/entity.d.ts +0 -0
- /package/{database → types/database}/id.d.ts +0 -0
- /package/{database → types/database}/index.d.ts +0 -0
- /package/{database → types/database}/mongo/index.d.ts +0 -0
- /package/{database → types/database}/mongo/model/index.d.ts +0 -0
- /package/{database → types/database}/mongo/module.d.ts +0 -0
- /package/{database → types/database}/utils.d.ts +0 -0
- /package/{decorators → types/decorators}/index.d.ts +0 -0
- /package/{disposable → types/disposable}/disposable.d.ts +0 -0
- /package/{disposable → types/disposable}/index.d.ts +0 -0
- /package/{disposable → types/disposable}/using.d.ts +0 -0
- /package/{distributed-loop → types/distributed-loop}/controller.d.ts +0 -0
- /package/{distributed-loop → types/distributed-loop}/index.d.ts +0 -0
- /package/{document-management → types/document-management}/api/index.d.ts +0 -0
- /package/{document-management → types/document-management}/index.d.ts +0 -0
- /package/{document-management → types/document-management}/localizations/english.d.ts +0 -0
- /package/{document-management → types/document-management}/localizations/german.d.ts +0 -0
- /package/{document-management → types/document-management}/localizations/index.d.ts +0 -0
- /package/{document-management → types/document-management}/models/document-management-table.d.ts +0 -0
- /package/{document-management → types/document-management}/models/service-models/document-requests-template.view-model.d.ts +0 -0
- /package/{document-management → types/document-management}/server/drizzle.config.d.ts +0 -0
- /package/{document-management → types/document-management}/server/index.d.ts +0 -0
- /package/{dom → types/dom}/file-download.d.ts +0 -0
- /package/{dom → types/dom}/index.d.ts +0 -0
- /package/{dom → types/dom}/observation/index.d.ts +0 -0
- /package/{dom → types/dom}/observation/mutation-observer.d.ts +0 -0
- /package/{dom → types/dom}/observation/performance-observer.d.ts +0 -0
- /package/{dom → types/dom}/observation/touch-observer.d.ts +0 -0
- /package/{enumerable → types/enumerable}/enumerable-methods.d.ts +0 -0
- /package/{enumerable → types/enumerable}/index.d.ts +0 -0
- /package/{enumeration → types/enumeration}/index.d.ts +0 -0
- /package/{environment.d.ts → types/environment.d.ts} +0 -0
- /package/{errors → types/errors}/api.error.d.ts +0 -0
- /package/{errors → types/errors}/assertion.error.d.ts +0 -0
- /package/{errors → types/errors}/bad-request.error.d.ts +0 -0
- /package/{errors → types/errors}/custom.error.d.ts +0 -0
- /package/{errors → types/errors}/details.error.d.ts +0 -0
- /package/{errors → types/errors}/forbidden.error.d.ts +0 -0
- /package/{errors → types/errors}/index.d.ts +0 -0
- /package/{errors → types/errors}/invalid-credentials.error.d.ts +0 -0
- /package/{errors → types/errors}/invalid-token.error.d.ts +0 -0
- /package/{errors → types/errors}/max-bytes-exceeded.error.d.ts +0 -0
- /package/{errors → types/errors}/method-not-allowed.error.d.ts +0 -0
- /package/{errors → types/errors}/multi.error.d.ts +0 -0
- /package/{errors → types/errors}/not-found.error.d.ts +0 -0
- /package/{errors → types/errors}/not-implemented.error.d.ts +0 -0
- /package/{errors → types/errors}/timeout.error.d.ts +0 -0
- /package/{errors → types/errors}/unauthorized.error.d.ts +0 -0
- /package/{errors → types/errors}/unsupported-media-type.error.d.ts +0 -0
- /package/{errors → types/errors}/utils.d.ts +0 -0
- /package/{examples → types/examples}/mail/basic.d.ts +0 -0
- /package/{examples → types/examples}/orm/drizzle.config.d.ts +0 -0
- /package/{examples → types/examples}/orm/test.d.ts +0 -0
- /package/{examples → types/examples}/pdf/basic.d.ts +0 -0
- /package/{examples → types/examples}/template/basic.d.ts +0 -0
- /package/{file → types/file}/index.d.ts +0 -0
- /package/{file → types/file}/mime-type.d.ts +0 -0
- /package/{file → types/file}/mime-types.d.ts +0 -0
- /package/{file → types/file}/server/index.d.ts +0 -0
- /package/{file → types/file}/server/temporary-file.d.ts +0 -0
- /package/{function → types/function}/index.d.ts +0 -0
- /package/{http → types/http}/client/http-client-options.d.ts +0 -0
- /package/{http → types/http}/client/http-client.adapter.d.ts +0 -0
- /package/{http → types/http}/client/index.d.ts +0 -0
- /package/{http → types/http}/cookie-parser.d.ts +0 -0
- /package/{http → types/http}/http-form.d.ts +0 -0
- /package/{http → types/http}/http-headers.d.ts +0 -0
- /package/{http → types/http}/http-query.d.ts +0 -0
- /package/{http → types/http}/http-url-parameters.d.ts +0 -0
- /package/{http → types/http}/index.d.ts +0 -0
- /package/{http → types/http}/server/index.d.ts +0 -0
- /package/{http → types/http}/server/node/index.d.ts +0 -0
- /package/{http → types/http}/server/node/module.d.ts +0 -0
- /package/{image-service → types/image-service}/image-service.d.ts +0 -0
- /package/{image-service → types/image-service}/imgproxy/index.d.ts +0 -0
- /package/{image-service → types/image-service}/index.d.ts +0 -0
- /package/{import.d.ts → types/import.d.ts} +0 -0
- /package/{injector → types/injector}/index.d.ts +0 -0
- /package/{injector → types/injector}/inject.d.ts +0 -0
- /package/{injector → types/injector}/symbols.d.ts +0 -0
- /package/{interfaces.d.ts → types/interfaces.d.ts} +0 -0
- /package/{intl → types/intl}/index.d.ts +0 -0
- /package/{intl → types/intl}/number-parser.d.ts +0 -0
- /package/{json-path → types/json-path}/index.d.ts +0 -0
- /package/{json-path → types/json-path}/json-path.d.ts +0 -0
- /package/{jsx → types/jsx}/index.d.ts +0 -0
- /package/{jsx → types/jsx}/is-component-class.d.ts +0 -0
- /package/{jsx → types/jsx}/render-to-string.d.ts +0 -0
- /package/{key-value-store → types/key-value-store}/index.d.ts +0 -0
- /package/{key-value-store → types/key-value-store}/key-value-store.provider.d.ts +0 -0
- /package/{key-value-store → types/key-value-store}/mongo/index.d.ts +0 -0
- /package/{lock → types/lock}/index.d.ts +0 -0
- /package/{lock → types/lock}/mongo/index.d.ts +0 -0
- /package/{lock → types/lock}/web/index.d.ts +0 -0
- /package/{lock → types/lock}/web/module.d.ts +0 -0
- /package/{lock → types/lock}/web/web-lock.d.ts +0 -0
- /package/{logger → types/logger}/console/index.d.ts +0 -0
- /package/{logger → types/logger}/console/logger.d.ts +0 -0
- /package/{logger → types/logger}/index.d.ts +0 -0
- /package/{logger → types/logger}/level.d.ts +0 -0
- /package/{logger → types/logger}/noop/index.d.ts +0 -0
- /package/{logger → types/logger}/noop/logger.d.ts +0 -0
- /package/{mail → types/mail}/clients/index.d.ts +0 -0
- /package/{mail → types/mail}/drizzle.config.d.ts +0 -0
- /package/{mail → types/mail}/index.d.ts +0 -0
- /package/{mail → types/mail}/models/index.d.ts +0 -0
- /package/{mail → types/mail}/models/mail-address.model.d.ts +0 -0
- /package/{mail → types/mail}/models/mail-content.model.d.ts +0 -0
- /package/{mail → types/mail}/models/mail-send-result.model.d.ts +0 -0
- /package/{memory → types/memory}/finalization.d.ts +0 -0
- /package/{memory → types/memory}/index.d.ts +0 -0
- /package/{memory → types/memory}/observable-finalization-registry.d.ts +0 -0
- /package/{message-bus → types/message-bus}/broadcast-channel/index.d.ts +0 -0
- /package/{message-bus → types/message-bus}/broadcast-channel/module.d.ts +0 -0
- /package/{message-bus → types/message-bus}/index.d.ts +0 -0
- /package/{message-bus → types/message-bus}/local/index.d.ts +0 -0
- /package/{message-bus → types/message-bus}/local/module.d.ts +0 -0
- /package/{message-bus → types/message-bus}/local/types.d.ts +0 -0
- /package/{message-bus → types/message-bus}/message-bus-provider.d.ts +0 -0
- /package/{migration → types/migration}/index.d.ts +0 -0
- /package/{migration → types/migration}/migrator.d.ts +0 -0
- /package/{migration → types/migration}/mongo/index.d.ts +0 -0
- /package/{module → types/module}/index.d.ts +0 -0
- /package/{module → types/module}/modules/index.d.ts +0 -0
- /package/{object-storage → types/object-storage}/index.d.ts +0 -0
- /package/{object-storage → types/object-storage}/object-storage-provider.d.ts +0 -0
- /package/{object-storage → types/object-storage}/s3/index.d.ts +0 -0
- /package/{openid-connect → types/openid-connect}/index.d.ts +0 -0
- /package/{openid-connect → types/openid-connect}/oidc.service-model.d.ts +0 -0
- /package/{orm → types/orm}/schemas/index.d.ts +0 -0
- /package/{orm → types/orm}/server/drizzle/index.d.ts +0 -0
- /package/{password → types/password}/have-i-been-pwned.d.ts +0 -0
- /package/{password → types/password}/index.d.ts +0 -0
- /package/{password → types/password}/password-check.d.ts +0 -0
- /package/{pdf → types/pdf}/index.d.ts +0 -0
- /package/{polyfills.d.ts → types/polyfills.d.ts} +0 -0
- /package/{pool → types/pool}/index.d.ts +0 -0
- /package/{process → types/process}/index.d.ts +0 -0
- /package/{promise → types/promise}/custom-promise.d.ts +0 -0
- /package/{promise → types/promise}/deferred-promise.d.ts +0 -0
- /package/{promise → types/promise}/index.d.ts +0 -0
- /package/{promise → types/promise}/lazy-promise.d.ts +0 -0
- /package/{promise → types/promise}/types.d.ts +0 -0
- /package/{queue → types/queue}/enqueue-batch.d.ts +0 -0
- /package/{queue → types/queue}/index.d.ts +0 -0
- /package/{queue → types/queue}/mongo/index.d.ts +0 -0
- /package/{queue → types/queue}/postgres/drizzle.config.d.ts +0 -0
- /package/{queue → types/queue}/postgres/index.d.ts +0 -0
- /package/{random → types/random}/index.d.ts +0 -0
- /package/{random → types/random}/number-generator/index.d.ts +0 -0
- /package/{random → types/random}/number-generator/mulberry32.d.ts +0 -0
- /package/{random → types/random}/number-generator/random-number-generator-function.d.ts +0 -0
- /package/{random → types/random}/number-generator/random-number-generator.d.ts +0 -0
- /package/{random → types/random}/number-generator/seeded-random-number-generator.d.ts +0 -0
- /package/{random → types/random}/number-generator/sfc32.d.ts +0 -0
- /package/{random → types/random}/number-generator/utils.d.ts +0 -0
- /package/{random → types/random}/series.d.ts +0 -0
- /package/{reflection → types/reflection}/decorator-data.d.ts +0 -0
- /package/{reflection → types/reflection}/index.d.ts +0 -0
- /package/{require.d.ts → types/require.d.ts} +0 -0
- /package/{rpc → types/rpc}/adapters/index.d.ts +0 -0
- /package/{rpc → types/rpc}/adapters/readable-stream.adapter.d.ts +0 -0
- /package/{rpc → types/rpc}/endpoints/index.d.ts +0 -0
- /package/{rpc → types/rpc}/endpoints/message-port.rpc-endpoint.d.ts +0 -0
- /package/{rpc → types/rpc}/index.d.ts +0 -0
- /package/{rpc → types/rpc}/rpc.endpoint.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/cast.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/index.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/noop.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/reject-error.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/slow-array.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/start-with-provider.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/teardown.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/timing.d.ts +0 -0
- /package/{rxjs-utils → types/rxjs-utils}/untrack.d.ts +0 -0
- /package/{schema → types/schema}/converters/index.d.ts +0 -0
- /package/{schema → types/schema}/decorators/index.d.ts +0 -0
- /package/{schema → types/schema}/index.d.ts +0 -0
- /package/{schema → types/schema}/schemas/any.d.ts +0 -0
- /package/{schema → types/schema}/schemas/bigint.d.ts +0 -0
- /package/{schema → types/schema}/schemas/boolean.d.ts +0 -0
- /package/{schema → types/schema}/schemas/date.d.ts +0 -0
- /package/{schema → types/schema}/schemas/index.d.ts +0 -0
- /package/{schema → types/schema}/schemas/readable-stream.d.ts +0 -0
- /package/{schema → types/schema}/schemas/regexp.d.ts +0 -0
- /package/{schema → types/schema}/schemas/string.d.ts +0 -0
- /package/{schema → types/schema}/schemas/symbol.d.ts +0 -0
- /package/{schema → types/schema}/schemas/uint8-array.d.ts +0 -0
- /package/{schema → types/schema}/schemas/unknown.d.ts +0 -0
- /package/{schema → types/schema}/testable.d.ts +0 -0
- /package/{schema → types/schema}/types.d.ts +0 -0
- /package/{search-index → types/search-index}/elastic/index.d.ts +0 -0
- /package/{search-index → types/search-index}/elastic/keyword-rewriter.d.ts +0 -0
- /package/{search-index → types/search-index}/elastic/model/elastic-query.d.ts +0 -0
- /package/{search-index → types/search-index}/elastic/model/index.d.ts +0 -0
- /package/{search-index → types/search-index}/elastic/query-builder/boolean-query-builder.d.ts +0 -0
- /package/{search-index → types/search-index}/elastic/query-builder/index.d.ts +0 -0
- /package/{search-index → types/search-index}/elastic/types.d.ts +0 -0
- /package/{search-index → types/search-index}/index.d.ts +0 -0
- /package/{search-index → types/search-index}/memory/index.d.ts +0 -0
- /package/{serializer → types/serializer}/handlers/date.d.ts +0 -0
- /package/{serializer → types/serializer}/handlers/error.d.ts +0 -0
- /package/{serializer → types/serializer}/handlers/index.d.ts +0 -0
- /package/{serializer → types/serializer}/handlers/map.d.ts +0 -0
- /package/{serializer → types/serializer}/handlers/regex.d.ts +0 -0
- /package/{serializer → types/serializer}/handlers/register.d.ts +0 -0
- /package/{serializer → types/serializer}/handlers/set.d.ts +0 -0
- /package/{serializer → types/serializer}/index.d.ts +0 -0
- /package/{signals → types/signals}/api.d.ts +0 -0
- /package/{signals → types/signals}/computed-with-dependencies.d.ts +0 -0
- /package/{signals → types/signals}/effect-with-dependencies.d.ts +0 -0
- /package/{signals → types/signals}/implementation/api.d.ts +0 -0
- /package/{signals → types/signals}/implementation/asserts.d.ts +0 -0
- /package/{signals → types/signals}/implementation/computed.d.ts +0 -0
- /package/{signals → types/signals}/implementation/configure.d.ts +0 -0
- /package/{signals → types/signals}/implementation/effect.d.ts +0 -0
- /package/{signals → types/signals}/implementation/equality.d.ts +0 -0
- /package/{signals → types/signals}/implementation/errors.d.ts +0 -0
- /package/{signals → types/signals}/implementation/graph.d.ts +0 -0
- /package/{signals → types/signals}/implementation/index.d.ts +0 -0
- /package/{signals → types/signals}/implementation/signal.d.ts +0 -0
- /package/{signals → types/signals}/implementation/to-observable.d.ts +0 -0
- /package/{signals → types/signals}/implementation/to-signal.d.ts +0 -0
- /package/{signals → types/signals}/implementation/untracked.d.ts +0 -0
- /package/{signals → types/signals}/implementation/watch.d.ts +0 -0
- /package/{signals → types/signals}/implementation/writable-signal.d.ts +0 -0
- /package/{signals → types/signals}/index.d.ts +0 -0
- /package/{signals → types/signals}/notifier.d.ts +0 -0
- /package/{signals → types/signals}/operators/combine.d.ts +0 -0
- /package/{signals → types/signals}/operators/defer.d.ts +0 -0
- /package/{signals → types/signals}/operators/derive-async.d.ts +0 -0
- /package/{signals → types/signals}/operators/index.d.ts +0 -0
- /package/{signals → types/signals}/operators/map.d.ts +0 -0
- /package/{signals → types/signals}/operators/switchAll.d.ts +0 -0
- /package/{signals → types/signals}/pipe.d.ts +0 -0
- /package/{signals → types/signals}/symbol.d.ts +0 -0
- /package/{signals → types/signals}/to-lazy-signal.d.ts +0 -0
- /package/{signals → types/signals}/types.d.ts +0 -0
- /package/{signals → types/signals}/untracked-operator.d.ts +0 -0
- /package/{sse → types/sse}/index.d.ts +0 -0
- /package/{sse → types/sse}/model.d.ts +0 -0
- /package/{sse → types/sse}/server-sent-events.d.ts +0 -0
- /package/{supports.d.ts → types/supports.d.ts} +0 -0
- /package/{templates → types/templates}/index.d.ts +0 -0
- /package/{templates → types/templates}/providers/index.d.ts +0 -0
- /package/{templates → types/templates}/providers/memory.template-provider.d.ts +0 -0
- /package/{templates → types/templates}/renderers/index.d.ts +0 -0
- /package/{templates → types/templates}/resolvers/index.d.ts +0 -0
- /package/{templates → types/templates}/template-renderer.provider.d.ts +0 -0
- /package/{templates → types/templates}/template-resolver.provider.d.ts +0 -0
- /package/{templates → types/templates}/template.provider.d.ts +0 -0
- /package/{templates → types/templates}/template.resolver.d.ts +0 -0
- /package/{templates → types/templates}/types/index.d.ts +0 -0
- /package/{templates → types/templates}/types/jsx.intrinsic-elements.d.ts +0 -0
- /package/{text → types/text}/common-localization.d.ts +0 -0
- /package/{text → types/text}/index.d.ts +0 -0
- /package/{text → types/text}/localizable-text.model.d.ts +0 -0
- /package/{theme → types/theme}/adapters/css-adapter.d.ts +0 -0
- /package/{theme → types/theme}/adapters/index.d.ts +0 -0
- /package/{theme → types/theme}/index.d.ts +0 -0
- /package/{threading → types/threading}/index.d.ts +0 -0
- /package/{threading → types/threading}/thread-worker.d.ts +0 -0
- /package/{tokens.d.ts → types/tokens.d.ts} +0 -0
- /package/{utils → types/utils}/alphabet.d.ts +0 -0
- /package/{utils → types/utils}/any-iterable-iterator.d.ts +0 -0
- /package/{utils → types/utils}/array/array-backtracker.d.ts +0 -0
- /package/{utils → types/utils}/array/array.d.ts +0 -0
- /package/{utils → types/utils}/array/index.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/all.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/any.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/assert.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/batch.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/buffer.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/concat.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/default-if-empty.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/deferred.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/difference.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/distinct.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/drain.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/filter.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/first-or-default.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/first.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/for-each.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/group-single.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/group-to-map.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/group-to-single-map.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/group.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/includes.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/index.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/interrupt.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/is-async-iterable.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/last-or-default.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/last.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/map-many.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/map.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/materialize.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/metadata.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/multiplex.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/observable-iterable.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/pairwise.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/feed.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/filter.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/for-each.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/group.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/index.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/map.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/tap.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/parallel/types.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/reduce.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/retry.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/single-or-default.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/single.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/skip.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/sort.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/take-while.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/take.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/tap.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/throttle.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/to-array.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/to-async-iterable-iterator.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/to-async-iterator.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/to-set.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/to-sync-iterable.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/types.d.ts +0 -0
- /package/{utils → types/utils}/async-iterable-helpers/while.d.ts +0 -0
- /package/{utils → types/utils}/async-iterator-iterable-iterator.d.ts +0 -0
- /package/{utils → types/utils}/base64.d.ts +0 -0
- /package/{utils → types/utils}/benchmark.d.ts +0 -0
- /package/{utils → types/utils}/binary-search.d.ts +0 -0
- /package/{utils → types/utils}/clone.d.ts +0 -0
- /package/{utils → types/utils}/comparison.d.ts +0 -0
- /package/{utils → types/utils}/compression.d.ts +0 -0
- /package/{utils → types/utils}/config-parser.d.ts +0 -0
- /package/{utils → types/utils}/crc32.d.ts +0 -0
- /package/{utils → types/utils}/date-time.d.ts +0 -0
- /package/{utils → types/utils}/factory-map.d.ts +0 -0
- /package/{utils → types/utils}/feedable-async-iterable.d.ts +0 -0
- /package/{utils → types/utils}/file-reader.d.ts +0 -0
- /package/{utils → types/utils}/format.d.ts +0 -0
- /package/{utils → types/utils}/function/throttle.d.ts +0 -0
- /package/{utils → types/utils}/helpers.d.ts +0 -0
- /package/{utils → types/utils}/html-link-utils.d.ts +0 -0
- /package/{utils → types/utils}/image.d.ts +0 -0
- /package/{utils → types/utils}/index.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/all.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/any.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/assert.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/batch.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/concat.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/default-if-empty.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/deferred.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/difference.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/distinct.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/drain.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/filter.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/first-or-default.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/first.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/for-each.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/group-single.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/group-to-map.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/group-to-single-map.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/group.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/includes.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/index.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/is-iterable.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/last-or-default.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/last.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/map-many.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/map.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/materialize.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/metadata.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/pairwise.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/range.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/reduce.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/single-or-default.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/single.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/skip.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/sort.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/take-while.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/take.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/tap.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/types.d.ts +0 -0
- /package/{utils → types/utils}/iterable-helpers/while.d.ts +0 -0
- /package/{utils → types/utils}/map.d.ts +0 -0
- /package/{utils → types/utils}/middleware.d.ts +0 -0
- /package/{utils → types/utils}/moving-metric.d.ts +0 -0
- /package/{utils → types/utils}/noop.d.ts +0 -0
- /package/{utils → types/utils}/object/index.d.ts +0 -0
- /package/{utils → types/utils}/object/merge.d.ts +0 -0
- /package/{utils → types/utils}/ordered-feedable-async-iterable.d.ts +0 -0
- /package/{utils → types/utils}/patterns.d.ts +0 -0
- /package/{utils → types/utils}/periodic-reporter.d.ts +0 -0
- /package/{utils → types/utils}/periodic-sampler.d.ts +0 -0
- /package/{utils → types/utils}/provider-function-iterable.d.ts +0 -0
- /package/{utils → types/utils}/proxy.d.ts +0 -0
- /package/{utils → types/utils}/random.d.ts +0 -0
- /package/{utils → types/utils}/set.d.ts +0 -0
- /package/{utils → types/utils}/sort.d.ts +0 -0
- /package/{utils → types/utils}/stream/finalize-stream.d.ts +0 -0
- /package/{utils → types/utils}/stream/readable-stream-adapter.d.ts +0 -0
- /package/{utils → types/utils}/stream/slice.d.ts +0 -0
- /package/{utils → types/utils}/stream/stream-helper-types.d.ts +0 -0
- /package/{utils → types/utils}/stream/stream-reader.d.ts +0 -0
- /package/{utils → types/utils}/stream/to-bytes-stream.d.ts +0 -0
- /package/{utils → types/utils}/stream/to-readable-stream.d.ts +0 -0
- /package/{utils → types/utils}/string/hypenate.d.ts +0 -0
- /package/{utils → types/utils}/string/index.d.ts +0 -0
- /package/{utils → types/utils}/string/normalize.d.ts +0 -0
- /package/{utils → types/utils}/string/snake-case.d.ts +0 -0
- /package/{utils → types/utils}/string/title-case.d.ts +0 -0
- /package/{utils → types/utils}/string/trim.d.ts +0 -0
- /package/{utils → types/utils}/throw.d.ts +0 -0
- /package/{utils → types/utils}/timer.d.ts +0 -0
- /package/{utils → types/utils}/type/index.d.ts +0 -0
- /package/{utils → types/utils}/type-of.d.ts +0 -0
- /package/{utils → types/utils}/units.d.ts +0 -0
- /package/{utils → types/utils}/url-builder.d.ts +0 -0
- /package/{utils → types/utils}/value-or-provider.d.ts +0 -0
- /package/{web-types.d.ts → types/web-types.d.ts} +0 -0
package/orm/server/repository.js
CHANGED
|
@@ -5,16 +5,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
6
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
7
|
};
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
import { asc, count, desc, eq, inArray, isSQLWrapper, SQL, sql } from 'drizzle-orm';
|
|
12
|
-
import { PgTransaction as DrizzlePgTransaction } from 'drizzle-orm/pg-core';
|
|
13
|
-
import { createContextProvider } from '../../context/context.js';
|
|
8
|
+
import { and, asc, count, desc, eq, inArray, isNull, isSQLWrapper, SQL, sql } from 'drizzle-orm';
|
|
9
|
+
import { match } from 'ts-pattern';
|
|
14
10
|
import { NotFoundError } from '../../errors/not-found.error.js';
|
|
15
11
|
import { Singleton } from '../../injector/decorators.js';
|
|
16
|
-
import {
|
|
17
|
-
import { inject, injectArgument, runInInjectionContext } from '../../injector/inject.js';
|
|
12
|
+
import { inject, injectArgument } from '../../injector/inject.js';
|
|
18
13
|
import { resolveArgumentType } from '../../injector/interfaces.js';
|
|
19
14
|
import { Schema } from '../../schema/schema.js';
|
|
20
15
|
import { toArray } from '../../utils/array/array.js';
|
|
@@ -26,80 +21,55 @@ import { fromDeepObjectEntries, fromEntries, objectEntries } from '../../utils/o
|
|
|
26
21
|
import { assertDefinedPass, isArray, isDefined, isString, isUndefined } from '../../utils/type-guards.js';
|
|
27
22
|
import { Entity } from '../entity.js';
|
|
28
23
|
import { TRANSACTION_TIMESTAMP } from '../sqls.js';
|
|
29
|
-
import {
|
|
30
|
-
import { getColumnDefinitions, getDrizzleTableFromType } from './drizzle/schema-converter.js';
|
|
24
|
+
import { getColumnDefinitions, getColumnDefinitionsMap, getDrizzleTableFromType } from './drizzle/schema-converter.js';
|
|
31
25
|
import { convertQuery } from './query-converter.js';
|
|
32
26
|
import { ENCRYPTION_SECRET } from './tokens.js';
|
|
33
|
-
import {
|
|
27
|
+
import { getTransactionalContextData, isInTransactionalContext, Transactional } from './transactional.js';
|
|
34
28
|
export const repositoryType = Symbol('repositoryType');
|
|
29
|
+
/**
|
|
30
|
+
* Configuration class for EntityRepository.
|
|
31
|
+
* Specifies the database schema to be used.
|
|
32
|
+
*/
|
|
35
33
|
export class EntityRepositoryConfig {
|
|
34
|
+
/** The name of the database schema. */
|
|
36
35
|
schema;
|
|
37
36
|
}
|
|
38
37
|
const entityTypeToken = Symbol('EntityType');
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
#
|
|
42
|
-
#injector = inject(Injector);
|
|
43
|
-
#repositoryConstructor;
|
|
44
|
-
#withTransactionCache = new WeakMap();
|
|
45
|
-
#encryptionSecret = isInEntityRepositoryContext() ? this.#context.encryptionSecret : inject(ENCRYPTION_SECRET, undefined, { optional: true });
|
|
38
|
+
let EntityRepository = class EntityRepository extends Transactional {
|
|
39
|
+
#context = isInTransactionalContext() ? getTransactionalContextData(this) : {};
|
|
40
|
+
#encryptionSecret = isInTransactionalContext() ? this.#context.encryptionSecret : inject(ENCRYPTION_SECRET, undefined, { optional: true });
|
|
46
41
|
#transformContext = this.#context.transformContext;
|
|
47
42
|
type = this.#context.type ?? injectArgument(this, { optional: true }) ?? assertDefinedPass(this.constructor[entityTypeToken], 'Missing entity type.');
|
|
48
43
|
typeName = this.type.entityName ?? this.type.name;
|
|
49
44
|
#table = this.#context.table ?? getDrizzleTableFromType(this.type, inject(EntityRepositoryConfig, undefined, { optional: true })?.schema);
|
|
50
45
|
#tableWithMetadata = this.#table;
|
|
51
46
|
#columnDefinitions = this.#context.columnDefinitions ?? getColumnDefinitions(this.#table);
|
|
52
|
-
#columnDefinitionsMap = this.#context.columnDefinitionsMap ??
|
|
53
|
-
session = this.#context.session ?? inject(Database);
|
|
54
|
-
isInTransaction = this.session instanceof DrizzlePgTransaction;
|
|
47
|
+
#columnDefinitionsMap = this.#context.columnDefinitionsMap ?? getColumnDefinitionsMap(this.#table);
|
|
55
48
|
hasMetadata = typeExtends(this.type, Entity);
|
|
49
|
+
/**
|
|
50
|
+
* Gets the Drizzle table definition for the entity type.
|
|
51
|
+
*/
|
|
56
52
|
get table() {
|
|
57
53
|
return this.#table;
|
|
58
54
|
}
|
|
59
|
-
|
|
60
|
-
return this.isInTransaction;
|
|
61
|
-
}
|
|
62
|
-
constructor() {
|
|
63
|
-
this.#repositoryConstructor = new.target;
|
|
64
|
-
}
|
|
65
|
-
withOptionalTransaction(transaction) {
|
|
66
|
-
if (isUndefined(transaction)) {
|
|
67
|
-
return this;
|
|
68
|
-
}
|
|
69
|
-
return this.withTransaction(transaction);
|
|
70
|
-
}
|
|
71
|
-
withTransaction(transaction) {
|
|
72
|
-
if (this.#withTransactionCache.has(transaction)) {
|
|
73
|
-
return this.#withTransactionCache.get(transaction);
|
|
74
|
-
}
|
|
55
|
+
getTransactionalContextData() {
|
|
75
56
|
const context = {
|
|
76
57
|
type: this.type,
|
|
77
58
|
table: this.#table,
|
|
78
59
|
columnDefinitions: this.#columnDefinitions,
|
|
79
60
|
columnDefinitionsMap: this.#columnDefinitionsMap,
|
|
80
|
-
session: transaction.transaction,
|
|
81
61
|
encryptionSecret: this.#encryptionSecret,
|
|
82
|
-
transformContext: this.#transformContext
|
|
62
|
+
transformContext: this.#transformContext,
|
|
83
63
|
};
|
|
84
|
-
|
|
85
|
-
this.#withTransactionCache.set(transaction, repositoryWithTransaction);
|
|
86
|
-
return repositoryWithTransaction;
|
|
87
|
-
}
|
|
88
|
-
async startTransaction(config) {
|
|
89
|
-
return DrizzleTransaction.create(this.session, config);
|
|
90
|
-
}
|
|
91
|
-
async useTransaction(transaction, handler) {
|
|
92
|
-
if (isUndefined(transaction)) {
|
|
93
|
-
return this.transaction(handler);
|
|
94
|
-
}
|
|
95
|
-
const repository = this.withTransaction(transaction);
|
|
96
|
-
return transaction.use(async () => handler(repository, transaction));
|
|
97
|
-
}
|
|
98
|
-
async transaction(handler, config) {
|
|
99
|
-
const transaction = await DrizzleTransaction.create(this.session, config);
|
|
100
|
-
const repository = this.withTransaction(transaction);
|
|
101
|
-
return transaction.use(async () => handler(repository, transaction));
|
|
64
|
+
return context;
|
|
102
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Loads a single entity by its ID.
|
|
68
|
+
* Throws `NotFoundError` if the entity is not found.
|
|
69
|
+
* @param id The ID of the entity to load.
|
|
70
|
+
* @returns A promise that resolves to the loaded entity.
|
|
71
|
+
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
72
|
+
*/
|
|
103
73
|
async load(id) {
|
|
104
74
|
const entity = await this.tryLoad(id);
|
|
105
75
|
if (isUndefined(entity)) {
|
|
@@ -107,9 +77,23 @@ let EntityRepository = class EntityRepository {
|
|
|
107
77
|
}
|
|
108
78
|
return entity;
|
|
109
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* Tries to load a single entity by its ID.
|
|
82
|
+
* Returns `undefined` if the entity is not found.
|
|
83
|
+
* @param id The ID of the entity to load.
|
|
84
|
+
* @returns A promise that resolves to the loaded entity or `undefined` if not found.
|
|
85
|
+
*/
|
|
110
86
|
async tryLoad(id) {
|
|
111
87
|
return this.tryLoadByQuery(eq(this.#table.id, id));
|
|
112
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Loads a single entity based on a query.
|
|
91
|
+
* Throws `NotFoundError` if no entity matches the query.
|
|
92
|
+
* @param query The query to filter entities.
|
|
93
|
+
* @param options Optional loading options (e.g., offset, order).
|
|
94
|
+
* @returns A promise that resolves to the loaded entity.
|
|
95
|
+
* @throws {NotFoundError} If no entity matches the query.
|
|
96
|
+
*/
|
|
113
97
|
async loadByQuery(query, options) {
|
|
114
98
|
const entity = await this.tryLoadByQuery(query, options);
|
|
115
99
|
if (isUndefined(entity)) {
|
|
@@ -117,6 +101,13 @@ let EntityRepository = class EntityRepository {
|
|
|
117
101
|
}
|
|
118
102
|
return entity;
|
|
119
103
|
}
|
|
104
|
+
/**
|
|
105
|
+
* Tries to load a single entity based on a query.
|
|
106
|
+
* Returns `undefined` if no entity matches the query.
|
|
107
|
+
* @param query The query to filter entities.
|
|
108
|
+
* @param options Optional loading options (e.g., offset, order).
|
|
109
|
+
* @returns A promise that resolves to the loaded entity or `undefined` if not found.
|
|
110
|
+
*/
|
|
120
111
|
async tryLoadByQuery(query, options) {
|
|
121
112
|
const sqlQuery = this.convertQuery(query);
|
|
122
113
|
let dbQuery = this.session.select()
|
|
@@ -133,46 +124,97 @@ let EntityRepository = class EntityRepository {
|
|
|
133
124
|
}
|
|
134
125
|
return this.mapToEntity(row);
|
|
135
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Loads multiple entities by their IDs.
|
|
129
|
+
* @param ids An array of entity IDs to load.
|
|
130
|
+
* @param options Optional loading options (e.g., offset, limit, order).
|
|
131
|
+
* @returns A promise that resolves to an array of loaded entities.
|
|
132
|
+
*/
|
|
136
133
|
async loadMany(ids, options) {
|
|
137
134
|
return this.loadManyByQuery(inArray(this.#table.id, ids), options);
|
|
138
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Loads multiple entities by their IDs and returns them as an async iterable cursor.
|
|
138
|
+
* @param ids An array of entity IDs to load.
|
|
139
|
+
* @param options Optional loading options (e.g., offset, limit, order).
|
|
140
|
+
* @returns An async iterable iterator of loaded entities.
|
|
141
|
+
*/
|
|
139
142
|
async *loadManyCursor(ids, options) {
|
|
140
143
|
const entities = await this.loadMany(ids, options);
|
|
141
144
|
yield* entities;
|
|
142
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Loads multiple entities based on a query.
|
|
148
|
+
* @param query The query to filter entities.
|
|
149
|
+
* @param options Optional loading options (e.g., offset, limit, order).
|
|
150
|
+
* @returns A promise that resolves to an array of loaded entities.
|
|
151
|
+
*/
|
|
143
152
|
async loadManyByQuery(query, options) {
|
|
144
153
|
const sqlQuery = this.convertQuery(query);
|
|
145
|
-
let dbQuery =
|
|
154
|
+
let dbQuery = match(options?.distinct ?? false)
|
|
155
|
+
.with(false, () => this.session.select())
|
|
156
|
+
.with(true, () => this.session.selectDistinct())
|
|
157
|
+
.otherwise((targets) => {
|
|
158
|
+
const ons = targets.map((target) => isString(target) ? this.getColumn(target) : target);
|
|
159
|
+
return this.session.selectDistinctOn(ons);
|
|
160
|
+
})
|
|
146
161
|
.from(this.#table)
|
|
162
|
+
.$dynamic();
|
|
163
|
+
dbQuery = dbQuery
|
|
147
164
|
.where(sqlQuery)
|
|
148
|
-
.orderBy()
|
|
149
165
|
.offset(options?.offset)
|
|
150
|
-
.limit(options?.limit)
|
|
151
|
-
.$dynamic();
|
|
166
|
+
.limit(options?.limit);
|
|
152
167
|
if (isDefined(options?.order)) {
|
|
153
168
|
dbQuery = dbQuery.orderBy(...this.convertOrderBy(options.order));
|
|
154
169
|
}
|
|
155
170
|
const rows = await dbQuery;
|
|
156
171
|
return this.mapManyToEntity(rows);
|
|
157
172
|
}
|
|
173
|
+
/**
|
|
174
|
+
* Loads multiple entities based on a query and returns them as an async iterable cursor.
|
|
175
|
+
* @param query The query to filter entities.
|
|
176
|
+
* @param options Optional loading options (e.g., offset, limit, order).
|
|
177
|
+
* @returns An async iterable iterator of loaded entities.
|
|
178
|
+
*/
|
|
158
179
|
async *loadManyByQueryCursor(query, options) {
|
|
159
180
|
const entities = await this.loadManyByQuery(query, options);
|
|
160
181
|
yield* entities;
|
|
161
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Loads all entities of the repository's type.
|
|
185
|
+
* @param options Optional loading options (e.g., offset, limit, order).
|
|
186
|
+
* @returns A promise that resolves to an array of all entities.
|
|
187
|
+
*/
|
|
162
188
|
async loadAll(options) {
|
|
163
189
|
return this.loadManyByQuery({}, options);
|
|
164
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Loads all entities of the repository's type and returns them as an async iterable cursor.
|
|
193
|
+
* @param options Optional loading options (e.g., offset, limit, order).
|
|
194
|
+
* @returns An async iterable iterator of all entities.
|
|
195
|
+
*/
|
|
165
196
|
async *loadAllCursor(options) {
|
|
166
197
|
const entities = await this.loadAll(options);
|
|
167
198
|
yield* entities;
|
|
168
199
|
}
|
|
200
|
+
/**
|
|
201
|
+
* Counts the total number of entities of the repository's type.
|
|
202
|
+
* @returns A promise that resolves to the total count.
|
|
203
|
+
*/
|
|
169
204
|
async count() {
|
|
205
|
+
const sqlQuery = this.convertQuery({});
|
|
170
206
|
const dbQuery = this.session
|
|
171
207
|
.select({ count: count() })
|
|
172
|
-
.from(this.#table)
|
|
208
|
+
.from(this.#table)
|
|
209
|
+
.where(sqlQuery);
|
|
173
210
|
const [result] = await dbQuery;
|
|
174
211
|
return assertDefinedPass(result).count;
|
|
175
212
|
}
|
|
213
|
+
/**
|
|
214
|
+
* Counts the number of entities matching a query.
|
|
215
|
+
* @param query The query to filter entities.
|
|
216
|
+
* @returns A promise that resolves to the count of matching entities.
|
|
217
|
+
*/
|
|
176
218
|
async countByQuery(query) {
|
|
177
219
|
const sqlQuery = this.convertQuery(query);
|
|
178
220
|
const dbQuery = this.session
|
|
@@ -182,9 +224,19 @@ let EntityRepository = class EntityRepository {
|
|
|
182
224
|
const [result] = await dbQuery;
|
|
183
225
|
return assertDefinedPass(result).count;
|
|
184
226
|
}
|
|
227
|
+
/**
|
|
228
|
+
* Checks if an entity with the given ID exists.
|
|
229
|
+
* @param id The ID of the entity to check.
|
|
230
|
+
* @returns A promise that resolves to `true` if the entity exists, `false` otherwise.
|
|
231
|
+
*/
|
|
185
232
|
async has(id) {
|
|
186
233
|
return this.hasByQuery(eq(this.#table.id, id));
|
|
187
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Checks if any entity matches the given query.
|
|
237
|
+
* @param query The query to filter entities.
|
|
238
|
+
* @returns A promise that resolves to `true` if at least one entity matches the query, `false` otherwise.
|
|
239
|
+
*/
|
|
188
240
|
async hasByQuery(query) {
|
|
189
241
|
const sqlQuery = this.convertQuery(query);
|
|
190
242
|
const dbQuery = this.session
|
|
@@ -193,10 +245,17 @@ let EntityRepository = class EntityRepository {
|
|
|
193
245
|
const [result] = await dbQuery;
|
|
194
246
|
return assertDefinedPass(result).exists;
|
|
195
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* Checks if all entities with the given IDs exist.
|
|
250
|
+
* @param ids An array of entity IDs to check.
|
|
251
|
+
* @returns A promise that resolves to `true` if all entities exist, `false` otherwise.
|
|
252
|
+
*/
|
|
196
253
|
async hasAll(ids) {
|
|
254
|
+
const sqlQuery = this.convertQuery({});
|
|
197
255
|
const result = await this.session
|
|
198
256
|
.select({ contains: sql `array_agg(${this.#table.id}) @> ${ids}`.as('contains') })
|
|
199
|
-
.from(this.#table)
|
|
257
|
+
.from(this.#table)
|
|
258
|
+
.where(sqlQuery);
|
|
200
259
|
return assertDefinedPass(result[0]).contains;
|
|
201
260
|
}
|
|
202
261
|
/**
|
|
@@ -216,6 +275,11 @@ let EntityRepository = class EntityRepository {
|
|
|
216
275
|
}
|
|
217
276
|
return this.mapToEntity(row);
|
|
218
277
|
}
|
|
278
|
+
/**
|
|
279
|
+
* Inserts a new entity into the database.
|
|
280
|
+
* @param entity The entity to insert.
|
|
281
|
+
* @returns A promise that resolves to the inserted entity.
|
|
282
|
+
*/
|
|
219
283
|
async insert(entity) {
|
|
220
284
|
const columns = await this.mapToInsertColumns(entity);
|
|
221
285
|
const [row] = await this.session
|
|
@@ -224,11 +288,23 @@ let EntityRepository = class EntityRepository {
|
|
|
224
288
|
.returning();
|
|
225
289
|
return this.mapToEntity(row);
|
|
226
290
|
}
|
|
291
|
+
/**
|
|
292
|
+
* Inserts multiple new entities into the database.
|
|
293
|
+
* @param entities An array of entities to insert.
|
|
294
|
+
* @returns A promise that resolves to an array of the inserted entities.
|
|
295
|
+
*/
|
|
227
296
|
async insertMany(entities) {
|
|
228
297
|
const columns = await this.mapManyToInsertColumns(entities);
|
|
229
298
|
const rows = await this.session.insert(this.#table).values(columns).returning();
|
|
230
299
|
return this.mapManyToEntity(rows);
|
|
231
300
|
}
|
|
301
|
+
/**
|
|
302
|
+
* Inserts an entity or updates it if a conflict occurs based on the target columns.
|
|
303
|
+
* @param target The column(s) to use for conflict detection.
|
|
304
|
+
* @param entity The entity to insert.
|
|
305
|
+
* @param update Optional update to apply if a conflict occurs. Defaults to the inserted entity's values.
|
|
306
|
+
* @returns A promise that resolves to the inserted or updated entity.
|
|
307
|
+
*/
|
|
232
308
|
async upsert(target, entity, update) {
|
|
233
309
|
const targetColumns = toArray(target).map((path) => this.getColumn(path));
|
|
234
310
|
const columns = await this.mapToInsertColumns(entity);
|
|
@@ -238,11 +314,18 @@ let EntityRepository = class EntityRepository {
|
|
|
238
314
|
.values(columns)
|
|
239
315
|
.onConflictDoUpdate({
|
|
240
316
|
target: targetColumns,
|
|
241
|
-
set: mappedUpdate
|
|
317
|
+
set: mappedUpdate,
|
|
242
318
|
})
|
|
243
319
|
.returning();
|
|
244
320
|
return this.mapToEntity(row);
|
|
245
321
|
}
|
|
322
|
+
/**
|
|
323
|
+
* Inserts multiple entities or updates them if a conflict occurs based on the target columns.
|
|
324
|
+
* @param target The column(s) to use for conflict detection.
|
|
325
|
+
* @param entities An array of entities to insert.
|
|
326
|
+
* @param update Optional update to apply if a conflict occurs. Defaults to the inserted entity's values.
|
|
327
|
+
* @returns A promise that resolves to an array of the inserted or updated entities.
|
|
328
|
+
*/
|
|
246
329
|
async upsertMany(target, entities, update) {
|
|
247
330
|
const targetColumns = toArray(target).map((path) => this.getColumn(path));
|
|
248
331
|
const columns = await this.mapManyToInsertColumns(entities);
|
|
@@ -250,18 +333,26 @@ let EntityRepository = class EntityRepository {
|
|
|
250
333
|
? await this.mapUpdate(update)
|
|
251
334
|
: {
|
|
252
335
|
...fromEntries(this.#columnDefinitions.map((column) => [column.name, sql `excluded.${sql.identifier(this.getColumn(column).name)}`])),
|
|
253
|
-
...this._getMetadataUpdate(update)
|
|
336
|
+
...this._getMetadataUpdate(update),
|
|
254
337
|
};
|
|
255
338
|
const rows = await this.session
|
|
256
339
|
.insert(this.#table)
|
|
257
340
|
.values(columns)
|
|
258
341
|
.onConflictDoUpdate({
|
|
259
342
|
target: targetColumns,
|
|
260
|
-
set: mappedUpdate
|
|
343
|
+
set: mappedUpdate,
|
|
261
344
|
})
|
|
262
345
|
.returning();
|
|
263
346
|
return this.mapManyToEntity(rows);
|
|
264
347
|
}
|
|
348
|
+
/**
|
|
349
|
+
* Updates an entity by its ID.
|
|
350
|
+
* Throws `NotFoundError` if the entity is not found.
|
|
351
|
+
* @param id The ID of the entity to update.
|
|
352
|
+
* @param update The update to apply to the entity.
|
|
353
|
+
* @returns A promise that resolves to the updated entity.
|
|
354
|
+
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
355
|
+
*/
|
|
265
356
|
async update(id, update) {
|
|
266
357
|
const entity = await this.tryUpdate(id, update);
|
|
267
358
|
if (isUndefined(entity)) {
|
|
@@ -269,18 +360,34 @@ let EntityRepository = class EntityRepository {
|
|
|
269
360
|
}
|
|
270
361
|
return entity;
|
|
271
362
|
}
|
|
363
|
+
/**
|
|
364
|
+
* Tries to update an entity by its ID.
|
|
365
|
+
* Returns `undefined` if the entity is not found.
|
|
366
|
+
* @param id The ID of the entity to update.
|
|
367
|
+
* @param update The update to apply to the entity.
|
|
368
|
+
* @returns A promise that resolves to the updated entity or `undefined` if not found.
|
|
369
|
+
*/
|
|
272
370
|
async tryUpdate(id, update) {
|
|
371
|
+
const sqlQuery = this.convertQuery(eq(this.#table.id, id));
|
|
273
372
|
const mappedUpdate = await this.mapUpdate(update);
|
|
274
373
|
const [row] = await this.session
|
|
275
374
|
.update(this.#table)
|
|
276
375
|
.set(mappedUpdate)
|
|
277
|
-
.where(
|
|
376
|
+
.where(sqlQuery)
|
|
278
377
|
.returning();
|
|
279
378
|
if (isUndefined(row)) {
|
|
280
379
|
return undefined;
|
|
281
380
|
}
|
|
282
381
|
return this.mapToEntity(row);
|
|
283
382
|
}
|
|
383
|
+
/**
|
|
384
|
+
* Updates a single entity matching a query.
|
|
385
|
+
* Throws `NotFoundError` if no entity matches the query.
|
|
386
|
+
* @param query The query to filter entities.
|
|
387
|
+
* @param update The update to apply to the entity.
|
|
388
|
+
* @returns A promise that resolves to the updated entity.
|
|
389
|
+
* @throws {NotFoundError} If no entity matches the query.
|
|
390
|
+
*/
|
|
284
391
|
async updateByQuery(query, update) {
|
|
285
392
|
const entity = await this.tryUpdateByQuery(query, update);
|
|
286
393
|
if (isUndefined(entity)) {
|
|
@@ -288,6 +395,13 @@ let EntityRepository = class EntityRepository {
|
|
|
288
395
|
}
|
|
289
396
|
return entity;
|
|
290
397
|
}
|
|
398
|
+
/**
|
|
399
|
+
* Tries to update a single entity matching a query.
|
|
400
|
+
* Returns `undefined` if no entity matches the query.
|
|
401
|
+
* @param query The query to filter entities.
|
|
402
|
+
* @param update The update to apply to the entity.
|
|
403
|
+
* @returns A promise that resolves to the updated entity or `undefined` if not found.
|
|
404
|
+
*/
|
|
291
405
|
async tryUpdateByQuery(query, update) {
|
|
292
406
|
const mappedUpdate = await this.mapUpdate(update);
|
|
293
407
|
const idQuery = this.getIdLimitSelect(query);
|
|
@@ -301,9 +415,21 @@ let EntityRepository = class EntityRepository {
|
|
|
301
415
|
}
|
|
302
416
|
return this.mapToEntity(row);
|
|
303
417
|
}
|
|
418
|
+
/**
|
|
419
|
+
* Updates multiple entities by their IDs.
|
|
420
|
+
* @param ids An array of entity IDs to update.
|
|
421
|
+
* @param update The update to apply to the entities.
|
|
422
|
+
* @returns A promise that resolves to an array of the updated entities.
|
|
423
|
+
*/
|
|
304
424
|
async updateMany(ids, update) {
|
|
305
425
|
return this.updateManyByQuery(inArray(this.#table.id, ids), update);
|
|
306
426
|
}
|
|
427
|
+
/**
|
|
428
|
+
* Updates multiple entities matching a query.
|
|
429
|
+
* @param query The query to filter entities.
|
|
430
|
+
* @param update The update to apply to the entities.
|
|
431
|
+
* @returns A promise that resolves to an array of the updated entities.
|
|
432
|
+
*/
|
|
307
433
|
async updateManyByQuery(query, update) {
|
|
308
434
|
const sqlQuery = this.convertQuery(query);
|
|
309
435
|
const mappedUpdate = await this.mapUpdate(update);
|
|
@@ -314,6 +440,14 @@ let EntityRepository = class EntityRepository {
|
|
|
314
440
|
.returning();
|
|
315
441
|
return this.mapManyToEntity(rows);
|
|
316
442
|
}
|
|
443
|
+
/**
|
|
444
|
+
* Deletes an entity by its ID (soft delete if metadata is available).
|
|
445
|
+
* Throws `NotFoundError` if the entity is not found.
|
|
446
|
+
* @param id The ID of the entity to delete.
|
|
447
|
+
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
448
|
+
* @returns A promise that resolves to the deleted entity.
|
|
449
|
+
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
450
|
+
*/
|
|
317
451
|
async delete(id, metadataUpdate) {
|
|
318
452
|
const entity = await this.tryDelete(id, metadataUpdate);
|
|
319
453
|
if (isUndefined(entity)) {
|
|
@@ -321,23 +455,39 @@ let EntityRepository = class EntityRepository {
|
|
|
321
455
|
}
|
|
322
456
|
return entity;
|
|
323
457
|
}
|
|
458
|
+
/**
|
|
459
|
+
* Tries to delete an entity by its ID (soft delete if metadata is available).
|
|
460
|
+
* Returns `undefined` if the entity is not found.
|
|
461
|
+
* @param id The ID of the entity to delete.
|
|
462
|
+
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
463
|
+
* @returns A promise that resolves to the deleted entity or `undefined` if not found.
|
|
464
|
+
*/
|
|
324
465
|
async tryDelete(id, metadataUpdate) {
|
|
325
466
|
if (!this.hasMetadata) {
|
|
326
467
|
return this.tryHardDelete(id);
|
|
327
468
|
}
|
|
469
|
+
const sqlQuery = this.convertQuery(eq(this.#table.id, id));
|
|
328
470
|
const [row] = await this.session
|
|
329
471
|
.update(this.#tableWithMetadata)
|
|
330
472
|
.set({
|
|
331
473
|
deleteTimestamp: TRANSACTION_TIMESTAMP,
|
|
332
|
-
attributes: this.getAttributesUpdate(metadataUpdate?.attributes)
|
|
474
|
+
attributes: this.getAttributesUpdate(metadataUpdate?.attributes),
|
|
333
475
|
})
|
|
334
|
-
.where(
|
|
476
|
+
.where(sqlQuery)
|
|
335
477
|
.returning();
|
|
336
478
|
if (isUndefined(row)) {
|
|
337
479
|
return undefined;
|
|
338
480
|
}
|
|
339
481
|
return this.mapToEntity(row);
|
|
340
482
|
}
|
|
483
|
+
/**
|
|
484
|
+
* Deletes a single entity matching a query (soft delete if metadata is available).
|
|
485
|
+
* Throws `NotFoundError` if no entity matches the query.
|
|
486
|
+
* @param query The query to filter entities.
|
|
487
|
+
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
488
|
+
* @returns A promise that resolves to the deleted entity.
|
|
489
|
+
* @throws {NotFoundError} If no entity matches the query.
|
|
490
|
+
*/
|
|
341
491
|
async deleteByQuery(query, metadataUpdate) {
|
|
342
492
|
const entity = await this.tryDeleteByQuery(query, metadataUpdate);
|
|
343
493
|
if (isUndefined(entity)) {
|
|
@@ -345,6 +495,13 @@ let EntityRepository = class EntityRepository {
|
|
|
345
495
|
}
|
|
346
496
|
return entity;
|
|
347
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Tries to delete a single entity matching a query (soft delete if metadata is available).
|
|
500
|
+
* Returns `undefined` if no entity matches the query.
|
|
501
|
+
* @param query The query to filter entities.
|
|
502
|
+
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
503
|
+
* @returns A promise that resolves to the deleted entity or `undefined` if not found.
|
|
504
|
+
*/
|
|
348
505
|
async tryDeleteByQuery(query, metadataUpdate) {
|
|
349
506
|
if (!this.hasMetadata) {
|
|
350
507
|
return this.tryHardDeleteByQuery(query);
|
|
@@ -354,7 +511,7 @@ let EntityRepository = class EntityRepository {
|
|
|
354
511
|
.update(this.#tableWithMetadata)
|
|
355
512
|
.set({
|
|
356
513
|
deleteTimestamp: TRANSACTION_TIMESTAMP,
|
|
357
|
-
attributes: this.getAttributesUpdate(metadataUpdate?.attributes)
|
|
514
|
+
attributes: this.getAttributesUpdate(metadataUpdate?.attributes),
|
|
358
515
|
})
|
|
359
516
|
.where(inArray(this.#table.id, idQuery.for('update')))
|
|
360
517
|
.returning();
|
|
@@ -363,9 +520,21 @@ let EntityRepository = class EntityRepository {
|
|
|
363
520
|
}
|
|
364
521
|
return this.mapToEntity(row);
|
|
365
522
|
}
|
|
523
|
+
/**
|
|
524
|
+
* Deletes multiple entities by their IDs (soft delete if metadata is available).
|
|
525
|
+
* @param ids An array of entity IDs to delete.
|
|
526
|
+
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
527
|
+
* @returns A promise that resolves to an array of the deleted entities.
|
|
528
|
+
*/
|
|
366
529
|
async deleteMany(ids, metadataUpdate) {
|
|
367
530
|
return this.deleteManyByQuery(inArray(this.#table.id, ids), metadataUpdate);
|
|
368
531
|
}
|
|
532
|
+
/**
|
|
533
|
+
* Deletes multiple entities matching a query (soft delete if metadata is available).
|
|
534
|
+
* @param query The query to filter entities.
|
|
535
|
+
* @param metadataUpdate Optional metadata update to apply during soft delete.
|
|
536
|
+
* @returns A promise that resolves to an array of the deleted entities.
|
|
537
|
+
*/
|
|
369
538
|
async deleteManyByQuery(query, metadataUpdate) {
|
|
370
539
|
if (!this.hasMetadata) {
|
|
371
540
|
return this.hardDeleteManyByQuery(query);
|
|
@@ -375,12 +544,19 @@ let EntityRepository = class EntityRepository {
|
|
|
375
544
|
.update(this.#tableWithMetadata)
|
|
376
545
|
.set({
|
|
377
546
|
deleteTimestamp: TRANSACTION_TIMESTAMP,
|
|
378
|
-
attributes: this.getAttributesUpdate(metadataUpdate?.attributes)
|
|
547
|
+
attributes: this.getAttributesUpdate(metadataUpdate?.attributes),
|
|
379
548
|
})
|
|
380
549
|
.where(sqlQuery)
|
|
381
550
|
.returning();
|
|
382
551
|
return this.mapManyToEntity(rows);
|
|
383
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* Hard deletes an entity by its ID (removes from the database).
|
|
555
|
+
* Throws `NotFoundError` if the entity is not found.
|
|
556
|
+
* @param id The ID of the entity to hard delete.
|
|
557
|
+
* @returns A promise that resolves to the hard deleted entity.
|
|
558
|
+
* @throws {NotFoundError} If the entity with the given ID is not found.
|
|
559
|
+
*/
|
|
384
560
|
async hardDelete(id) {
|
|
385
561
|
const result = await this.tryHardDelete(id);
|
|
386
562
|
if (!result) {
|
|
@@ -388,16 +564,30 @@ let EntityRepository = class EntityRepository {
|
|
|
388
564
|
}
|
|
389
565
|
return result;
|
|
390
566
|
}
|
|
567
|
+
/**
|
|
568
|
+
* Tries to hard delete an entity by its ID (removes from the database).
|
|
569
|
+
* Returns `undefined` if the entity is not found.
|
|
570
|
+
* @param id The ID of the entity to hard delete.
|
|
571
|
+
* @returns A promise that resolves to the hard deleted entity or `undefined` if not found.
|
|
572
|
+
*/
|
|
391
573
|
async tryHardDelete(id) {
|
|
574
|
+
const sqlQuery = this.convertQuery(eq(this.#table.id, id));
|
|
392
575
|
const [row] = await this.session
|
|
393
576
|
.delete(this.#table)
|
|
394
|
-
.where(
|
|
577
|
+
.where(sqlQuery)
|
|
395
578
|
.returning();
|
|
396
579
|
if (isUndefined(row)) {
|
|
397
580
|
return undefined;
|
|
398
581
|
}
|
|
399
582
|
return this.mapToEntity(row);
|
|
400
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* Hard deletes a single entity matching a query (removes from the database).
|
|
586
|
+
* Throws `NotFoundError` if no entity matches the query.
|
|
587
|
+
* @param query The query to filter entities.
|
|
588
|
+
* @returns A promise that resolves to the hard deleted entity.
|
|
589
|
+
* @throws {NotFoundError} If no entity matches the query.
|
|
590
|
+
*/
|
|
401
591
|
async hardDeleteByQuery(query) {
|
|
402
592
|
const result = await this.tryHardDeleteByQuery(query);
|
|
403
593
|
if (!result) {
|
|
@@ -405,6 +595,12 @@ let EntityRepository = class EntityRepository {
|
|
|
405
595
|
}
|
|
406
596
|
return result;
|
|
407
597
|
}
|
|
598
|
+
/**
|
|
599
|
+
* Tries to hard delete a single entity matching a query (removes from the database).
|
|
600
|
+
* Returns `undefined` if no entity matches the query.
|
|
601
|
+
* @param query The query to filter entities.
|
|
602
|
+
* @returns A promise that resolves to the hard deleted entity or `undefined` if not found.
|
|
603
|
+
*/
|
|
408
604
|
async tryHardDeleteByQuery(query) {
|
|
409
605
|
const idQuery = this.getIdLimitSelect(query);
|
|
410
606
|
const [row] = await this.session
|
|
@@ -416,9 +612,19 @@ let EntityRepository = class EntityRepository {
|
|
|
416
612
|
}
|
|
417
613
|
return this.mapToEntity(row);
|
|
418
614
|
}
|
|
615
|
+
/**
|
|
616
|
+
* Hard deletes multiple entities by their IDs (removes from the database).
|
|
617
|
+
* @param ids An array of entity IDs to hard delete.
|
|
618
|
+
* @returns A promise that resolves to an array of the hard deleted entities.
|
|
619
|
+
*/
|
|
419
620
|
async hardDeleteMany(ids) {
|
|
420
621
|
return this.hardDeleteManyByQuery(inArray(this.#table.id, ids));
|
|
421
622
|
}
|
|
623
|
+
/**
|
|
624
|
+
* Hard deletes multiple entities matching a query (removes from the database).
|
|
625
|
+
* @param query The query to filter entities.
|
|
626
|
+
* @returns A promise that resolves to an array of the hard deleted entities.
|
|
627
|
+
*/
|
|
422
628
|
async hardDeleteManyByQuery(query) {
|
|
423
629
|
const sqlQuery = this.convertQuery(query);
|
|
424
630
|
const rows = await this.session
|
|
@@ -427,6 +633,11 @@ let EntityRepository = class EntityRepository {
|
|
|
427
633
|
.returning();
|
|
428
634
|
return this.mapManyToEntity(rows);
|
|
429
635
|
}
|
|
636
|
+
/**
|
|
637
|
+
* Retrieves the Drizzle PgColumn for a given object path or column definition.
|
|
638
|
+
* @param pathOrColumn The object path or column definition.
|
|
639
|
+
* @returns The corresponding PgColumn.
|
|
640
|
+
*/
|
|
430
641
|
getColumn(pathOrColumn) {
|
|
431
642
|
if (isString(pathOrColumn)) {
|
|
432
643
|
const columnName = assertDefinedPass(this.#columnDefinitionsMap.get(pathOrColumn), `Could not map ${pathOrColumn} to column.`).name;
|
|
@@ -434,6 +645,14 @@ let EntityRepository = class EntityRepository {
|
|
|
434
645
|
}
|
|
435
646
|
return this.#table[pathOrColumn.name];
|
|
436
647
|
}
|
|
648
|
+
getColumns(pathOrColumns) {
|
|
649
|
+
return pathOrColumns.map((column) => this.getColumn(column));
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Converts an Order object to an array of Drizzle SQL order expressions.
|
|
653
|
+
* @param order The order object.
|
|
654
|
+
* @returns An array of SQL order expressions.
|
|
655
|
+
*/
|
|
437
656
|
convertOrderBy(order) {
|
|
438
657
|
if (isArray(order)) {
|
|
439
658
|
return order.map((item) => {
|
|
@@ -453,37 +672,89 @@ let EntityRepository = class EntityRepository {
|
|
|
453
672
|
return direction == 'asc' ? asc(column) : desc(column);
|
|
454
673
|
});
|
|
455
674
|
}
|
|
456
|
-
|
|
457
|
-
|
|
675
|
+
/**
|
|
676
|
+
* Converts a Query object to a Drizzle SQL where clause.
|
|
677
|
+
* Automatically filters out soft-deleted entities unless `withDeleted` is true.
|
|
678
|
+
* @param query The query object.
|
|
679
|
+
* @param options Optional options, including `withDeleted` to include soft-deleted entities.
|
|
680
|
+
* @returns A Drizzle SQL condition.
|
|
681
|
+
*/
|
|
682
|
+
convertQuery(query, options) {
|
|
683
|
+
let sql = convertQuery(query, this.#table, this.#columnDefinitionsMap);
|
|
684
|
+
if (!this.hasMetadata || (options?.withDeleted == true)) {
|
|
685
|
+
return sql;
|
|
686
|
+
}
|
|
687
|
+
return and(isNull(this.#tableWithMetadata.deleteTimestamp), sql);
|
|
458
688
|
}
|
|
689
|
+
/**
|
|
690
|
+
* Maps multiple database rows to an array of entities.
|
|
691
|
+
* @param columns An array of database rows.
|
|
692
|
+
* @returns A promise that resolves to an array of entities.
|
|
693
|
+
*/
|
|
459
694
|
async mapManyToEntity(columns) {
|
|
460
695
|
const transformContext = await this.getTransformContext();
|
|
461
696
|
return this._mapManyToEntity(columns, transformContext);
|
|
462
697
|
}
|
|
698
|
+
/**
|
|
699
|
+
* Maps a single database row to an entity.
|
|
700
|
+
* @param columns A database row.
|
|
701
|
+
* @returns A promise that resolves to an entity.
|
|
702
|
+
*/
|
|
463
703
|
async mapToEntity(columns) {
|
|
464
704
|
const transformContext = await this.getTransformContext();
|
|
465
705
|
return this._mapToEntity(columns, transformContext);
|
|
466
706
|
}
|
|
707
|
+
/**
|
|
708
|
+
* Maps multiple entity-like objects to database column values for insertion or update.
|
|
709
|
+
* @param objects An array of entity-like objects.
|
|
710
|
+
* @returns A promise that resolves to an array of database column values.
|
|
711
|
+
*/
|
|
467
712
|
async mapManyToColumns(objects) {
|
|
468
713
|
const transformContext = await this.getTransformContext();
|
|
469
714
|
return this._mapManyToColumns(objects, transformContext);
|
|
470
715
|
}
|
|
716
|
+
/**
|
|
717
|
+
* Maps a single entity-like object to database column values for insertion or update.
|
|
718
|
+
* @param obj An entity-like object.
|
|
719
|
+
* @returns A promise that resolves to database column values.
|
|
720
|
+
*/
|
|
471
721
|
async mapToColumns(obj) {
|
|
472
722
|
const transformContext = await this.getTransformContext();
|
|
473
723
|
return this._mapToColumns(obj, transformContext);
|
|
474
724
|
}
|
|
725
|
+
/**
|
|
726
|
+
* Maps multiple new entity objects to database column values for insertion.
|
|
727
|
+
* @param objects An array of new entity objects.
|
|
728
|
+
* @returns A promise that resolves to an array of database column values for insertion.
|
|
729
|
+
*/
|
|
475
730
|
async mapManyToInsertColumns(objects) {
|
|
476
731
|
const transformContext = await this.getTransformContext();
|
|
477
732
|
return this._mapManyToInsertColumns(objects, transformContext);
|
|
478
733
|
}
|
|
734
|
+
/**
|
|
735
|
+
* Maps a new entity object to database column values for insertion.
|
|
736
|
+
* @param obj A new entity object.
|
|
737
|
+
* @returns A promise that resolves to database column values for insertion.
|
|
738
|
+
*/
|
|
479
739
|
async mapToInsertColumns(obj) {
|
|
480
740
|
const transformContext = await this.getTransformContext();
|
|
481
741
|
return this._mapToInsertColumns(obj, transformContext);
|
|
482
742
|
}
|
|
743
|
+
/**
|
|
744
|
+
* Maps an entity update object to database column values for updating.
|
|
745
|
+
* @param update The entity update object.
|
|
746
|
+
* @returns A promise that resolves to database column values for updating.
|
|
747
|
+
*/
|
|
483
748
|
async mapUpdate(update) {
|
|
484
749
|
const transformContext = await this.getTransformContext();
|
|
485
750
|
return this._mapUpdate(update, transformContext);
|
|
486
751
|
}
|
|
752
|
+
/**
|
|
753
|
+
* Gets a Drizzle select query for the ID of a single entity matching the provided query, limited to 1 result.
|
|
754
|
+
* Useful for subqueries in update/delete operations targeting a single entity.
|
|
755
|
+
* @param query The query to filter entities.
|
|
756
|
+
* @returns A Drizzle select query for the entity ID.
|
|
757
|
+
*/
|
|
487
758
|
getIdLimitQuery(query) {
|
|
488
759
|
return this.getIdLimitSelect(query);
|
|
489
760
|
}
|
|
@@ -531,9 +802,9 @@ let EntityRepository = class EntityRepository {
|
|
|
531
802
|
? {
|
|
532
803
|
revision: 1,
|
|
533
804
|
revisionTimestamp: TRANSACTION_TIMESTAMP,
|
|
534
|
-
createTimestamp: TRANSACTION_TIMESTAMP
|
|
805
|
+
createTimestamp: TRANSACTION_TIMESTAMP,
|
|
535
806
|
}
|
|
536
|
-
: undefined)
|
|
807
|
+
: undefined),
|
|
537
808
|
};
|
|
538
809
|
}
|
|
539
810
|
async _mapUpdate(update, transformContext) {
|
|
@@ -547,7 +818,7 @@ let EntityRepository = class EntityRepository {
|
|
|
547
818
|
}
|
|
548
819
|
return {
|
|
549
820
|
...mappedUpdate,
|
|
550
|
-
...this._getMetadataUpdate(update)
|
|
821
|
+
...this._getMetadataUpdate(update),
|
|
551
822
|
};
|
|
552
823
|
}
|
|
553
824
|
_getMetadataUpdate(update) {
|
|
@@ -555,7 +826,7 @@ let EntityRepository = class EntityRepository {
|
|
|
555
826
|
? {
|
|
556
827
|
attributes: this.getAttributesUpdate(update?.metadata?.attributes),
|
|
557
828
|
revision: sql `${this.#tableWithMetadata.revision} + 1`,
|
|
558
|
-
revisionTimestamp: TRANSACTION_TIMESTAMP
|
|
829
|
+
revisionTimestamp: TRANSACTION_TIMESTAMP,
|
|
559
830
|
}
|
|
560
831
|
: undefined;
|
|
561
832
|
}
|
|
@@ -580,19 +851,30 @@ let EntityRepository = class EntityRepository {
|
|
|
580
851
|
}
|
|
581
852
|
};
|
|
582
853
|
EntityRepository = __decorate([
|
|
583
|
-
Singleton()
|
|
584
|
-
__metadata("design:paramtypes", [])
|
|
854
|
+
Singleton()
|
|
585
855
|
], EntityRepository);
|
|
586
856
|
export { EntityRepository };
|
|
857
|
+
/**
|
|
858
|
+
* Injects an EntityRepository instance for the specified entity type.
|
|
859
|
+
* @template T The entity type.
|
|
860
|
+
* @param type The entity type.
|
|
861
|
+
* @returns An EntityRepository instance for the specified type.
|
|
862
|
+
*/
|
|
587
863
|
export function injectRepository(type) {
|
|
588
864
|
return inject((EntityRepository), type);
|
|
589
865
|
}
|
|
866
|
+
/**
|
|
867
|
+
* Gets or creates a singleton EntityRepository class for the specified entity type.
|
|
868
|
+
* @template T The entity type.
|
|
869
|
+
* @param type The entity type.
|
|
870
|
+
* @returns A singleton EntityRepository class for the specified type.
|
|
871
|
+
*/
|
|
590
872
|
export function getRepository(type) {
|
|
591
873
|
const className = `${type.name}Service`;
|
|
592
874
|
const entityRepositoryClass = {
|
|
593
875
|
[className]: class extends EntityRepository {
|
|
594
876
|
static [entityTypeToken] = type;
|
|
595
|
-
}
|
|
877
|
+
},
|
|
596
878
|
}[className];
|
|
597
879
|
Singleton()(entityRepositoryClass);
|
|
598
880
|
return entityRepositoryClass;
|