velocious 1.0.577 → 1.0.579
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -6
- package/build/application.js +3 -3
- package/build/authorization/ability.js +6 -6
- package/build/authorization/base-resource.js +1 -1
- package/build/background-jobs/client.js +2 -2
- package/build/background-jobs/forked-runner-child.js +4 -4
- package/build/background-jobs/job-runner.js +2 -2
- package/build/background-jobs/job.js +6 -6
- package/build/background-jobs/json-socket.js +1 -1
- package/build/background-jobs/main.js +13 -13
- package/build/background-jobs/normalize-error.js +2 -2
- package/build/background-jobs/pooled-runner-child.js +3 -3
- package/build/background-jobs/scheduler.js +1 -1
- package/build/background-jobs/status-reporter.js +2 -2
- package/build/background-jobs/store.js +23 -23
- package/build/background-jobs/types.js +6 -6
- package/build/background-jobs/web/controller.js +6 -6
- package/build/background-jobs/web/counts-channel.js +1 -1
- package/build/background-jobs/worker.js +8 -8
- package/build/beacon/client.js +3 -3
- package/build/beacon/in-process-client.js +3 -3
- package/build/beacon/types.js +1 -1
- package/build/cli/base-command.js +1 -1
- package/build/cli/commands/console.js +1 -1
- package/build/cli/commands/db/schema/dump.js +1 -1
- package/build/cli/commands/db/schema/load.js +1 -1
- package/build/cli/commands/db/seed.js +1 -1
- package/build/cli/commands/generate/frontend-models.js +1 -1
- package/build/cli/commands/lint/relationships.js +1 -1
- package/build/cli/commands/run-script.js +1 -1
- package/build/cli/commands/runner.js +1 -1
- package/build/cli/index.js +2 -2
- package/build/cli/tenant-database-command-helper.js +2 -2
- package/build/configuration-types.js +48 -47
- package/build/configuration.js +150 -65
- package/build/controller.js +11 -8
- package/build/current.js +2 -2
- package/build/database/annotations-async-hooks.js +3 -3
- package/build/database/annotations.js +1 -1
- package/build/database/drivers/base-column.js +1 -1
- package/build/database/drivers/base-foreign-key.js +1 -1
- package/build/database/drivers/base-table.js +1 -1
- package/build/database/drivers/base.js +18 -18
- package/build/database/drivers/mssql/column.js +1 -1
- package/build/database/drivers/mssql/index.js +2 -2
- package/build/database/drivers/mssql/options.js +1 -1
- package/build/database/drivers/mssql/structure-sql.js +1 -1
- package/build/database/drivers/mssql/table.js +1 -1
- package/build/database/drivers/mysql/column.js +1 -1
- package/build/database/drivers/mysql/index.js +4 -4
- package/build/database/drivers/mysql/options.js +1 -1
- package/build/database/drivers/mysql/query.js +7 -7
- package/build/database/drivers/mysql/structure-sql.js +71 -10
- package/build/database/drivers/pgsql/column.js +1 -1
- package/build/database/drivers/pgsql/index.js +6 -6
- package/build/database/drivers/pgsql/structure-sql.js +1 -1
- package/build/database/drivers/sqlite/base.js +7 -7
- package/build/database/drivers/sqlite/column.js +1 -1
- package/build/database/drivers/sqlite/connection-sql-js.js +1 -1
- package/build/database/drivers/sqlite/foreign-key.js +1 -1
- package/build/database/drivers/sqlite/index.js +1 -1
- package/build/database/drivers/sqlite/index.native.js +2 -2
- package/build/database/drivers/sqlite/index.web.js +2 -2
- package/build/database/drivers/sqlite/query.js +2 -2
- package/build/database/drivers/sqlite/query.native.js +2 -2
- package/build/database/drivers/sqlite/query.web.js +2 -2
- package/build/database/drivers/sqlite/table-rebuilder.js +1 -1
- package/build/database/migration/index.js +2 -2
- package/build/database/migrator/types.js +2 -2
- package/build/database/operation.js +59 -6
- package/build/database/pool/async-tracked-multi-connection.js +75 -24
- package/build/database/pool/base-methods-forward.js +2 -2
- package/build/database/pool/base.js +48 -17
- package/build/database/pool/single-multi-use.js +501 -103
- package/build/database/query/delete-base.js +1 -1
- package/build/database/query/index.js +3 -3
- package/build/database/query/insert-base.js +4 -4
- package/build/database/query/model-class-query.js +39 -39
- package/build/database/query/preloader/belongs-to.js +2 -2
- package/build/database/query/preloader/ensure-model-class-initialized.js +3 -2
- package/build/database/query/preloader/has-many.js +3 -3
- package/build/database/query/preloader/has-one.js +1 -1
- package/build/database/query/preloader.js +9 -2
- package/build/database/query/query-data.js +7 -7
- package/build/database/query/update-base.js +3 -3
- package/build/database/query/upsert-base.js +2 -2
- package/build/database/query/where-model-class-hash.js +13 -13
- package/build/database/query/with-count.js +12 -12
- package/build/database/query-parser/options.js +2 -2
- package/build/database/query-parser/select-parser.js +1 -1
- package/build/database/record/acts-as-list.js +2 -2
- package/build/database/record/attachments/handle.js +6 -6
- package/build/database/record/attachments/normalize-input.js +11 -11
- package/build/database/record/attachments/storage-drivers/filesystem.js +1 -1
- package/build/database/record/attachments/storage-drivers/native.js +5 -5
- package/build/database/record/attachments/storage-drivers/s3.js +10 -10
- package/build/database/record/attachments/store.js +24 -20
- package/build/database/record/auditing.js +123 -29
- package/build/database/record/counter-cache-magnitude.js +11 -11
- package/build/database/record/index.js +227 -174
- package/build/database/record/instance-relationships/base.js +4 -4
- package/build/database/record/instance-relationships/belongs-to.js +1 -1
- package/build/database/record/instance-relationships/has-many.js +3 -3
- package/build/database/record/instance-relationships/has-one.js +1 -1
- package/build/database/record/record-not-found-error.js +1 -0
- package/build/database/record/relationships/base.js +22 -0
- package/build/database/record/state-machine.js +6 -6
- package/build/database/record/validators/base.js +1 -1
- package/build/database/structure-sql-loader.js +3 -3
- package/build/database/table-data/table-column.js +3 -3
- package/build/database/use-live-query.js +3 -3
- package/build/environment-handlers/base.js +56 -37
- package/build/environment-handlers/browser.js +1 -1
- package/build/environment-handlers/node/cli/commands/console.js +4 -4
- package/build/environment-handlers/node/cli/commands/db/seed.js +2 -2
- package/build/environment-handlers/node/cli/commands/generate/base-models.js +1 -1
- package/build/environment-handlers/node/cli/commands/run-script.js +2 -2
- package/build/environment-handlers/node/cli/commands/runner.js +2 -2
- package/build/environment-handlers/node/cli/commands/server.js +1 -1
- package/build/environment-handlers/node.js +36 -36
- package/build/error-logger.js +2 -2
- package/build/error-reporting/request-details.js +32 -32
- package/build/frontend-model-controller.js +215 -213
- package/build/frontend-model-resource/base-resource.js +44 -44
- package/build/frontend-model-resource/velocious-attachment-resource.js +1 -1
- package/build/frontend-models/base.js +146 -142
- package/build/frontend-models/clear-pending-debounced-callback.js +2 -2
- package/build/frontend-models/model-registry.js +4 -4
- package/build/frontend-models/outgoing-event-buffer.js +1 -1
- package/build/frontend-models/preloader.js +1 -1
- package/build/frontend-models/query.js +60 -60
- package/build/frontend-models/resource-definition.js +9 -9
- package/build/frontend-models/transport-serialization.js +27 -27
- package/build/frontend-models/websocket-channel.js +4 -4
- package/build/frontend-models/websocket-publishers.js +1 -1
- package/build/http-client/request.js +1 -1
- package/build/http-client/response.js +1 -1
- package/build/http-server/client/index.js +4 -4
- package/build/http-server/client/params-to-object.js +16 -16
- package/build/http-server/client/request-buffer/index.js +5 -2
- package/build/http-server/client/request-parser.js +2 -2
- package/build/http-server/client/request-runner.js +2 -2
- package/build/http-server/client/request.js +2 -2
- package/build/http-server/client/websocket-request.js +6 -6
- package/build/http-server/client/websocket-session.js +28 -28
- package/build/http-server/cookie.js +2 -2
- package/build/http-server/development-reloader.js +1 -1
- package/build/http-server/index.js +5 -5
- package/build/http-server/remote-address.js +1 -1
- package/build/http-server/server-lock.js +4 -4
- package/build/http-server/websocket-channel-subscribers.js +4 -4
- package/build/http-server/websocket-channel.js +1 -1
- package/build/http-server/websocket-connection.js +3 -3
- package/build/http-server/websocket-event-log-store.js +9 -9
- package/build/http-server/websocket-events-host.js +7 -7
- package/build/http-server/websocket-events.js +4 -4
- package/build/http-server/worker-handler/channel-subscriber-dispatch.js +1 -1
- package/build/http-server/worker-handler/in-process.js +5 -5
- package/build/http-server/worker-handler/index.js +10 -10
- package/build/http-server/worker-handler/worker-thread.js +8 -8
- package/build/index.d.ts.map +1 -1
- package/build/logger/base-logger.js +1 -1
- package/build/logger.js +12 -12
- package/build/mailer/backends/smtp.js +3 -3
- package/build/mailer/base.js +14 -14
- package/build/mailer/delivery.js +3 -3
- package/build/mailer/index.js +1 -1
- package/build/mailer.js +1 -1
- package/build/plugins/sqljs-wasm-route-controller.js +1 -1
- package/build/record-payload-values.js +3 -3
- package/build/routes/base-route.js +5 -5
- package/build/routes/basic-route.js +4 -4
- package/build/routes/get-route.js +2 -2
- package/build/routes/hooks/frontend-model-command-route-hook.js +1 -1
- package/build/routes/index.js +3 -3
- package/build/routes/namespace-route.js +1 -1
- package/build/routes/plugin-routes.js +1 -1
- package/build/routes/post-route.js +2 -2
- package/build/routes/resolver.js +5 -5
- package/build/routes/resource-route.js +1 -1
- package/build/src/application.d.ts +26 -29
- package/build/src/application.d.ts.map +1 -1
- package/build/src/application.js +4 -4
- package/build/src/authorization/ability.d.ts +47 -53
- package/build/src/authorization/ability.d.ts.map +1 -1
- package/build/src/authorization/ability.js +7 -7
- package/build/src/authorization/base-resource.d.ts +13 -13
- package/build/src/authorization/base-resource.d.ts.map +1 -1
- package/build/src/authorization/base-resource.js +2 -2
- package/build/src/background-jobs/client.d.ts +9 -9
- package/build/src/background-jobs/client.d.ts.map +1 -1
- package/build/src/background-jobs/client.js +3 -3
- package/build/src/background-jobs/cron-expression.d.ts +25 -16
- package/build/src/background-jobs/cron-expression.d.ts.map +1 -1
- package/build/src/background-jobs/forked-runner-child.js +5 -5
- package/build/src/background-jobs/job-record.d.ts +4 -3
- package/build/src/background-jobs/job-record.d.ts.map +1 -1
- package/build/src/background-jobs/job-registry.d.ts +6 -6
- package/build/src/background-jobs/job-registry.d.ts.map +1 -1
- package/build/src/background-jobs/job-runner.d.ts +9 -9
- package/build/src/background-jobs/job-runner.d.ts.map +1 -1
- package/build/src/background-jobs/job-runner.js +3 -3
- package/build/src/background-jobs/job.d.ts +14 -14
- package/build/src/background-jobs/job.d.ts.map +1 -1
- package/build/src/background-jobs/job.js +7 -7
- package/build/src/background-jobs/json-socket.d.ts +9 -10
- package/build/src/background-jobs/json-socket.d.ts.map +1 -1
- package/build/src/background-jobs/json-socket.js +2 -2
- package/build/src/background-jobs/main.d.ts +56 -59
- package/build/src/background-jobs/main.d.ts.map +1 -1
- package/build/src/background-jobs/main.js +14 -14
- package/build/src/background-jobs/normalize-error.d.ts +2 -2
- package/build/src/background-jobs/normalize-error.d.ts.map +1 -1
- package/build/src/background-jobs/normalize-error.js +3 -3
- package/build/src/background-jobs/pooled-runner-child.js +4 -4
- package/build/src/background-jobs/runner-graceful-shutdown.d.ts +7 -12
- package/build/src/background-jobs/runner-graceful-shutdown.d.ts.map +1 -1
- package/build/src/background-jobs/runner-process-title.d.ts.map +1 -1
- package/build/src/background-jobs/scheduler.d.ts +41 -41
- package/build/src/background-jobs/scheduler.d.ts.map +1 -1
- package/build/src/background-jobs/scheduler.js +2 -2
- package/build/src/background-jobs/socket-request.d.ts +14 -14
- package/build/src/background-jobs/socket-request.d.ts.map +1 -1
- package/build/src/background-jobs/status-reporter.d.ts +28 -28
- package/build/src/background-jobs/status-reporter.d.ts.map +1 -1
- package/build/src/background-jobs/status-reporter.js +3 -3
- package/build/src/background-jobs/store.d.ts +100 -103
- package/build/src/background-jobs/store.d.ts.map +1 -1
- package/build/src/background-jobs/store.js +24 -24
- package/build/src/background-jobs/types.d.ts +124 -124
- package/build/src/background-jobs/types.d.ts.map +1 -1
- package/build/src/background-jobs/types.js +7 -7
- package/build/src/background-jobs/web/authorization.d.ts +2 -2
- package/build/src/background-jobs/web/authorization.d.ts.map +1 -1
- package/build/src/background-jobs/web/controller.d.ts +13 -13
- package/build/src/background-jobs/web/controller.d.ts.map +1 -1
- package/build/src/background-jobs/web/controller.js +7 -7
- package/build/src/background-jobs/web/counts-channel.d.ts +8 -8
- package/build/src/background-jobs/web/counts-channel.d.ts.map +1 -1
- package/build/src/background-jobs/web/counts-channel.js +2 -2
- package/build/src/background-jobs/web/index.d.ts +4 -4
- package/build/src/background-jobs/web/index.d.ts.map +1 -1
- package/build/src/background-jobs/web/path-matcher.d.ts +18 -13
- package/build/src/background-jobs/web/path-matcher.d.ts.map +1 -1
- package/build/src/background-jobs/web/registry.d.ts +21 -24
- package/build/src/background-jobs/web/registry.d.ts.map +1 -1
- package/build/src/background-jobs/worker.d.ts +74 -77
- package/build/src/background-jobs/worker.d.ts.map +1 -1
- package/build/src/background-jobs/worker.js +9 -9
- package/build/src/beacon/client.d.ts +30 -34
- package/build/src/beacon/client.d.ts.map +1 -1
- package/build/src/beacon/client.js +4 -4
- package/build/src/beacon/in-process-broker.d.ts +6 -9
- package/build/src/beacon/in-process-broker.d.ts.map +1 -1
- package/build/src/beacon/in-process-client.d.ts +17 -21
- package/build/src/beacon/in-process-client.d.ts.map +1 -1
- package/build/src/beacon/in-process-client.js +4 -4
- package/build/src/beacon/server.d.ts +15 -15
- package/build/src/beacon/server.d.ts.map +1 -1
- package/build/src/beacon/types.d.ts +21 -46
- package/build/src/beacon/types.d.ts.map +1 -1
- package/build/src/beacon/types.js +2 -2
- package/build/src/cli/base-command.d.ts +25 -28
- package/build/src/cli/base-command.d.ts.map +1 -1
- package/build/src/cli/base-command.js +2 -2
- package/build/src/cli/browser-cli.d.ts +1 -1
- package/build/src/cli/browser-cli.d.ts.map +1 -1
- package/build/src/cli/commands/background-jobs-main.d.ts +2 -1
- package/build/src/cli/commands/background-jobs-main.d.ts.map +1 -1
- package/build/src/cli/commands/background-jobs-runner.d.ts +2 -1
- package/build/src/cli/commands/background-jobs-runner.d.ts.map +1 -1
- package/build/src/cli/commands/background-jobs-worker.d.ts +2 -1
- package/build/src/cli/commands/background-jobs-worker.d.ts.map +1 -1
- package/build/src/cli/commands/beacon.d.ts +2 -1
- package/build/src/cli/commands/beacon.d.ts.map +1 -1
- package/build/src/cli/commands/console.d.ts +6 -1
- package/build/src/cli/commands/console.d.ts.map +1 -1
- package/build/src/cli/commands/console.js +2 -2
- package/build/src/cli/commands/db/base-command.d.ts +1 -1
- package/build/src/cli/commands/db/base-command.d.ts.map +1 -1
- package/build/src/cli/commands/db/create.d.ts +1 -1
- package/build/src/cli/commands/db/create.d.ts.map +1 -1
- package/build/src/cli/commands/db/drop.d.ts +1 -1
- package/build/src/cli/commands/db/drop.d.ts.map +1 -1
- package/build/src/cli/commands/db/migrate.d.ts +1 -1
- package/build/src/cli/commands/db/migrate.d.ts.map +1 -1
- package/build/src/cli/commands/db/reset.d.ts +1 -1
- package/build/src/cli/commands/db/reset.d.ts.map +1 -1
- package/build/src/cli/commands/db/rollback.d.ts +1 -1
- package/build/src/cli/commands/db/rollback.d.ts.map +1 -1
- package/build/src/cli/commands/db/schema/dump.d.ts +6 -1
- package/build/src/cli/commands/db/schema/dump.d.ts.map +1 -1
- package/build/src/cli/commands/db/schema/dump.js +2 -2
- package/build/src/cli/commands/db/schema/load.d.ts +6 -1
- package/build/src/cli/commands/db/schema/load.d.ts.map +1 -1
- package/build/src/cli/commands/db/schema/load.js +2 -2
- package/build/src/cli/commands/db/seed.d.ts +6 -1
- package/build/src/cli/commands/db/seed.d.ts.map +1 -1
- package/build/src/cli/commands/db/seed.js +2 -2
- package/build/src/cli/commands/db/tenants/check.d.ts +1 -1
- package/build/src/cli/commands/db/tenants/check.d.ts.map +1 -1
- package/build/src/cli/commands/db/tenants/create.d.ts +1 -1
- package/build/src/cli/commands/db/tenants/create.d.ts.map +1 -1
- package/build/src/cli/commands/db/tenants/drop.d.ts +1 -1
- package/build/src/cli/commands/db/tenants/drop.d.ts.map +1 -1
- package/build/src/cli/commands/db/tenants/migrate.d.ts +1 -1
- package/build/src/cli/commands/db/tenants/migrate.d.ts.map +1 -1
- package/build/src/cli/commands/destroy/migration.d.ts +2 -1
- package/build/src/cli/commands/destroy/migration.d.ts.map +1 -1
- package/build/src/cli/commands/generate/base-models.d.ts +2 -1
- package/build/src/cli/commands/generate/base-models.d.ts.map +1 -1
- package/build/src/cli/commands/generate/frontend-models.d.ts +6 -1
- package/build/src/cli/commands/generate/frontend-models.d.ts.map +1 -1
- package/build/src/cli/commands/generate/frontend-models.js +2 -2
- package/build/src/cli/commands/generate/migration.d.ts +2 -1
- package/build/src/cli/commands/generate/migration.d.ts.map +1 -1
- package/build/src/cli/commands/generate/model.d.ts +2 -1
- package/build/src/cli/commands/generate/model.d.ts.map +1 -1
- package/build/src/cli/commands/init.d.ts +4 -2
- package/build/src/cli/commands/init.d.ts.map +1 -1
- package/build/src/cli/commands/lint/relationships.d.ts +6 -1
- package/build/src/cli/commands/lint/relationships.d.ts.map +1 -1
- package/build/src/cli/commands/lint/relationships.js +2 -2
- package/build/src/cli/commands/routes.d.ts +2 -1
- package/build/src/cli/commands/routes.d.ts.map +1 -1
- package/build/src/cli/commands/run-script.d.ts +6 -1
- package/build/src/cli/commands/run-script.d.ts.map +1 -1
- package/build/src/cli/commands/run-script.js +2 -2
- package/build/src/cli/commands/runner.d.ts +6 -1
- package/build/src/cli/commands/runner.d.ts.map +1 -1
- package/build/src/cli/commands/runner.js +2 -2
- package/build/src/cli/commands/server.d.ts +2 -1
- package/build/src/cli/commands/server.d.ts.map +1 -1
- package/build/src/cli/commands/test.d.ts +2 -1
- package/build/src/cli/commands/test.d.ts.map +1 -1
- package/build/src/cli/index.d.ts +20 -20
- package/build/src/cli/index.d.ts.map +1 -1
- package/build/src/cli/index.js +3 -3
- package/build/src/cli/tenant-database-command-helper.d.ts +13 -13
- package/build/src/cli/tenant-database-command-helper.d.ts.map +1 -1
- package/build/src/cli/tenant-database-command-helper.js +3 -3
- package/build/src/cli/use-browser-cli.d.ts +1 -1
- package/build/src/cli/use-browser-cli.d.ts.map +1 -1
- package/build/src/configuration-resolver.d.ts +1 -1
- package/build/src/configuration-resolver.d.ts.map +1 -1
- package/build/src/configuration-types.d.ts +947 -1038
- package/build/src/configuration-types.d.ts.map +1 -1
- package/build/src/configuration-types.js +49 -48
- package/build/src/configuration.d.ts +145 -139
- package/build/src/configuration.d.ts.map +1 -1
- package/build/src/configuration.js +149 -66
- package/build/src/controller.d.ts +37 -35
- package/build/src/controller.d.ts.map +1 -1
- package/build/src/controller.js +11 -9
- package/build/src/current-configuration.d.ts +5 -4
- package/build/src/current-configuration.d.ts.map +1 -1
- package/build/src/current.d.ts +3 -3
- package/build/src/current.d.ts.map +1 -1
- package/build/src/current.js +3 -3
- package/build/src/database/advisory-lock-runner.d.ts +61 -60
- package/build/src/database/advisory-lock-runner.d.ts.map +1 -1
- package/build/src/database/annotations-async-hooks.js +4 -4
- package/build/src/database/annotations.d.ts +4 -6
- package/build/src/database/annotations.d.ts.map +1 -1
- package/build/src/database/annotations.js +2 -2
- package/build/src/database/column-types.d.ts +1 -1
- package/build/src/database/column-types.d.ts.map +1 -1
- package/build/src/database/datetime-storage.d.ts +6 -6
- package/build/src/database/datetime-storage.d.ts.map +1 -1
- package/build/src/database/drivers/base-column.d.ts +3 -3
- package/build/src/database/drivers/base-column.d.ts.map +1 -1
- package/build/src/database/drivers/base-column.js +2 -2
- package/build/src/database/drivers/base-columns-index.d.ts +2 -2
- package/build/src/database/drivers/base-columns-index.d.ts.map +1 -1
- package/build/src/database/drivers/base-foreign-key.d.ts +7 -7
- package/build/src/database/drivers/base-foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/base-foreign-key.js +2 -2
- package/build/src/database/drivers/base-table.d.ts +3 -3
- package/build/src/database/drivers/base-table.d.ts.map +1 -1
- package/build/src/database/drivers/base-table.js +2 -2
- package/build/src/database/drivers/base.d.ts +297 -342
- package/build/src/database/drivers/base.d.ts.map +1 -1
- package/build/src/database/drivers/base.js +19 -19
- package/build/src/database/drivers/index-metadata.d.ts +15 -18
- package/build/src/database/drivers/index-metadata.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/column.d.ts +10 -5
- package/build/src/database/drivers/mssql/column.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/column.js +2 -2
- package/build/src/database/drivers/mssql/columns-index.d.ts +30 -22
- package/build/src/database/drivers/mssql/columns-index.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/connect-connection.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/foreign-key.d.ts +1 -1
- package/build/src/database/drivers/mssql/foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/index.d.ts +250 -9
- package/build/src/database/drivers/mssql/index.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/index.js +3 -3
- package/build/src/database/drivers/mssql/options.d.ts +31 -1
- package/build/src/database/drivers/mssql/options.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/options.js +2 -2
- package/build/src/database/drivers/mssql/query-parser.d.ts +1 -1
- package/build/src/database/drivers/mssql/query-parser.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/alter-table.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/alter-table.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/create-database.d.ts +3 -2
- package/build/src/database/drivers/mssql/sql/create-database.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/create-index.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/create-index.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/create-table.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/create-table.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/delete.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/delete.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/drop-database.d.ts +14 -1
- package/build/src/database/drivers/mssql/sql/drop-database.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/drop-table.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/drop-table.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/insert.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/insert.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/remove-index.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/remove-index.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/update.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/update.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/upsert.d.ts +1 -1
- package/build/src/database/drivers/mssql/sql/upsert.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/structure-sql.d.ts +3 -3
- package/build/src/database/drivers/mssql/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/structure-sql.js +2 -2
- package/build/src/database/drivers/mssql/table.d.ts +39 -29
- package/build/src/database/drivers/mssql/table.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/table.js +2 -2
- package/build/src/database/drivers/mysql/column.d.ts +10 -6
- package/build/src/database/drivers/mysql/column.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/column.js +2 -2
- package/build/src/database/drivers/mysql/columns-index.d.ts +3 -1
- package/build/src/database/drivers/mysql/columns-index.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/foreign-key.d.ts +1 -1
- package/build/src/database/drivers/mysql/foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/index.d.ts +225 -6
- package/build/src/database/drivers/mysql/index.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/index.js +5 -5
- package/build/src/database/drivers/mysql/options.d.ts +7 -1
- package/build/src/database/drivers/mysql/options.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/options.js +2 -2
- package/build/src/database/drivers/mysql/query-parser.d.ts +1 -1
- package/build/src/database/drivers/mysql/query-parser.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/query-stream.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/query.d.ts +2 -2
- package/build/src/database/drivers/mysql/query.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/query.js +8 -8
- package/build/src/database/drivers/mysql/sql/alter-table.d.ts +12 -1
- package/build/src/database/drivers/mysql/sql/alter-table.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/create-database.d.ts +6 -1
- package/build/src/database/drivers/mysql/sql/create-database.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/create-index.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/create-index.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/create-table.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/create-table.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/delete.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/delete.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/drop-database.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/drop-database.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/drop-table.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/drop-table.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/insert.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/insert.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/remove-index.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/remove-index.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/update.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/update.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/upsert.d.ts +1 -1
- package/build/src/database/drivers/mysql/sql/upsert.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/structure-sql.d.ts +14 -3
- package/build/src/database/drivers/mysql/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/structure-sql.js +62 -11
- package/build/src/database/drivers/mysql/table.d.ts +11 -6
- package/build/src/database/drivers/mysql/table.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/column.d.ts +10 -5
- package/build/src/database/drivers/pgsql/column.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/column.js +2 -2
- package/build/src/database/drivers/pgsql/columns-index.d.ts +30 -22
- package/build/src/database/drivers/pgsql/columns-index.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/foreign-key.d.ts +1 -1
- package/build/src/database/drivers/pgsql/foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/index.d.ts +157 -6
- package/build/src/database/drivers/pgsql/index.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/index.js +7 -7
- package/build/src/database/drivers/pgsql/options.d.ts +1 -1
- package/build/src/database/drivers/pgsql/options.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/query-parser.d.ts +1 -1
- package/build/src/database/drivers/pgsql/query-parser.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/alter-table.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/alter-table.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/create-database.d.ts +2 -1
- package/build/src/database/drivers/pgsql/sql/create-database.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/create-index.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/create-index.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/create-table.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/create-table.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/delete.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/delete.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/drop-database.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/drop-database.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/drop-table.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/drop-table.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/insert.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/insert.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/remove-index.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/remove-index.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/update.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/update.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/sql/upsert.d.ts +1 -1
- package/build/src/database/drivers/pgsql/sql/upsert.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/structure-sql.d.ts +3 -3
- package/build/src/database/drivers/pgsql/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/structure-sql.js +2 -2
- package/build/src/database/drivers/pgsql/table.d.ts +33 -31
- package/build/src/database/drivers/pgsql/table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/base.d.ts +162 -12
- package/build/src/database/drivers/sqlite/base.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/base.js +8 -8
- package/build/src/database/drivers/sqlite/column.d.ts +12 -6
- package/build/src/database/drivers/sqlite/column.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/column.js +2 -2
- package/build/src/database/drivers/sqlite/columns-index.d.ts +5 -1
- package/build/src/database/drivers/sqlite/columns-index.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/connection-sql-js.d.ts +9 -9
- package/build/src/database/drivers/sqlite/connection-sql-js.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/connection-sql-js.js +2 -2
- package/build/src/database/drivers/sqlite/foreign-key.d.ts +5 -4
- package/build/src/database/drivers/sqlite/foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/foreign-key.js +2 -2
- package/build/src/database/drivers/sqlite/index.d.ts +53 -3
- package/build/src/database/drivers/sqlite/index.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.js +2 -2
- package/build/src/database/drivers/sqlite/index.native.d.ts +13 -5
- package/build/src/database/drivers/sqlite/index.native.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.native.js +3 -3
- package/build/src/database/drivers/sqlite/index.web.d.ts +48 -14
- package/build/src/database/drivers/sqlite/index.web.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.web.js +3 -3
- package/build/src/database/drivers/sqlite/options.d.ts +1 -1
- package/build/src/database/drivers/sqlite/options.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/query-parser.d.ts +1 -1
- package/build/src/database/drivers/sqlite/query-parser.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/query.d.ts +2 -2
- package/build/src/database/drivers/sqlite/query.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/query.js +3 -3
- package/build/src/database/drivers/sqlite/query.native.d.ts +4 -4
- package/build/src/database/drivers/sqlite/query.native.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/query.native.js +3 -3
- package/build/src/database/drivers/sqlite/query.web.d.ts +2 -2
- package/build/src/database/drivers/sqlite/query.web.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/query.web.js +3 -3
- package/build/src/database/drivers/sqlite/sql/alter-table.d.ts +19 -4
- package/build/src/database/drivers/sqlite/sql/alter-table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/create-index.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/create-index.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/create-table.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/create-table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/delete.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/delete.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/drop-table.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/drop-table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/insert.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/insert.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/remove-index.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/remove-index.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/update.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/update.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/upsert.d.ts +1 -1
- package/build/src/database/drivers/sqlite/sql/upsert.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/structure-sql.d.ts +1 -1
- package/build/src/database/drivers/sqlite/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/table-rebuilder.d.ts +5 -5
- package/build/src/database/drivers/sqlite/table-rebuilder.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/table-rebuilder.js +2 -2
- package/build/src/database/drivers/sqlite/table.d.ts +15 -5
- package/build/src/database/drivers/sqlite/table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/web-persistence.d.ts +28 -34
- package/build/src/database/drivers/sqlite/web-persistence.d.ts.map +1 -1
- package/build/src/database/drivers/structure-sql/utils.d.ts +2 -2
- package/build/src/database/drivers/structure-sql/utils.d.ts.map +1 -1
- package/build/src/database/handler.d.ts.map +1 -1
- package/build/src/database/initializer-from-require-context.d.ts +18 -16
- package/build/src/database/initializer-from-require-context.d.ts.map +1 -1
- package/build/src/database/live-query.d.ts +13 -24
- package/build/src/database/live-query.d.ts.map +1 -1
- package/build/src/database/migration/index.d.ts +146 -169
- package/build/src/database/migration/index.d.ts.map +1 -1
- package/build/src/database/migration/index.js +3 -3
- package/build/src/database/migrations-ledger.d.ts.map +1 -1
- package/build/src/database/migrator/files-finder.d.ts +1 -1
- package/build/src/database/migrator/files-finder.d.ts.map +1 -1
- package/build/src/database/migrator/types.d.ts +26 -2
- package/build/src/database/migrator/types.d.ts.map +1 -1
- package/build/src/database/migrator/types.js +24 -1
- package/build/src/database/migrator.d.ts +10 -10
- package/build/src/database/migrator.d.ts.map +1 -1
- package/build/src/database/operation-connection.d.ts +3 -3
- package/build/src/database/operation-connection.d.ts.map +1 -1
- package/build/src/database/operation-lease.d.ts +4 -4
- package/build/src/database/operation-lease.d.ts.map +1 -1
- package/build/src/database/operation.d.ts +38 -7
- package/build/src/database/operation.d.ts.map +1 -1
- package/build/src/database/operation.js +55 -8
- package/build/src/database/pool/async-tracked-multi-connection.d.ts +174 -79
- package/build/src/database/pool/async-tracked-multi-connection.d.ts.map +1 -1
- package/build/src/database/pool/async-tracked-multi-connection.js +70 -25
- package/build/src/database/pool/base-methods-forward.d.ts.map +1 -1
- package/build/src/database/pool/base-methods-forward.js +3 -3
- package/build/src/database/pool/base.d.ts +93 -71
- package/build/src/database/pool/base.d.ts.map +1 -1
- package/build/src/database/pool/base.js +47 -17
- package/build/src/database/pool/single-multi-use.d.ts +243 -10
- package/build/src/database/pool/single-multi-use.d.ts.map +1 -1
- package/build/src/database/pool/single-multi-use.js +467 -103
- package/build/src/database/query/alter-table-base.d.ts +8 -3
- package/build/src/database/query/alter-table-base.d.ts.map +1 -1
- package/build/src/database/query/base.d.ts +3 -3
- package/build/src/database/query/base.d.ts.map +1 -1
- package/build/src/database/query/create-database-base.d.ts +28 -22
- package/build/src/database/query/create-database-base.d.ts.map +1 -1
- package/build/src/database/query/create-index-base.d.ts +32 -30
- package/build/src/database/query/create-index-base.d.ts.map +1 -1
- package/build/src/database/query/create-table-base.d.ts +7 -7
- package/build/src/database/query/create-table-base.d.ts.map +1 -1
- package/build/src/database/query/delete-base.d.ts +5 -5
- package/build/src/database/query/delete-base.d.ts.map +1 -1
- package/build/src/database/query/delete-base.js +2 -2
- package/build/src/database/query/drop-database-base.d.ts +22 -18
- package/build/src/database/query/drop-database-base.d.ts.map +1 -1
- package/build/src/database/query/drop-table-base.d.ts +11 -6
- package/build/src/database/query/drop-table-base.d.ts.map +1 -1
- package/build/src/database/query/from-base.d.ts.map +1 -1
- package/build/src/database/query/from-plain.d.ts +3 -2
- package/build/src/database/query/from-plain.d.ts.map +1 -1
- package/build/src/database/query/from-table.d.ts +3 -2
- package/build/src/database/query/from-table.d.ts.map +1 -1
- package/build/src/database/query/index.d.ts +92 -107
- package/build/src/database/query/index.d.ts.map +1 -1
- package/build/src/database/query/index.js +4 -4
- package/build/src/database/query/insert-base.d.ts +18 -18
- package/build/src/database/query/insert-base.d.ts.map +1 -1
- package/build/src/database/query/insert-base.js +5 -5
- package/build/src/database/query/join-base.d.ts +1 -1
- package/build/src/database/query/join-base.d.ts.map +1 -1
- package/build/src/database/query/join-object.d.ts +9 -15
- package/build/src/database/query/join-object.d.ts.map +1 -1
- package/build/src/database/query/join-plain.d.ts +2 -2
- package/build/src/database/query/join-plain.d.ts.map +1 -1
- package/build/src/database/query/join-tracker.d.ts +3 -3
- package/build/src/database/query/join-tracker.d.ts.map +1 -1
- package/build/src/database/query/model-class-query.d.ts +39 -36
- package/build/src/database/query/model-class-query.d.ts.map +1 -1
- package/build/src/database/query/model-class-query.js +40 -40
- package/build/src/database/query/order-base.d.ts +1 -1
- package/build/src/database/query/order-base.d.ts.map +1 -1
- package/build/src/database/query/order-column.d.ts +19 -22
- package/build/src/database/query/order-column.d.ts.map +1 -1
- package/build/src/database/query/order-plain.d.ts +3 -3
- package/build/src/database/query/order-plain.d.ts.map +1 -1
- package/build/src/database/query/preloader/belongs-to.d.ts +5 -5
- package/build/src/database/query/preloader/belongs-to.d.ts.map +1 -1
- package/build/src/database/query/preloader/belongs-to.js +3 -3
- package/build/src/database/query/preloader/ensure-model-class-initialized.d.ts +2 -1
- package/build/src/database/query/preloader/ensure-model-class-initialized.d.ts.map +1 -1
- package/build/src/database/query/preloader/ensure-model-class-initialized.js +4 -3
- package/build/src/database/query/preloader/has-many.d.ts +6 -6
- package/build/src/database/query/preloader/has-many.d.ts.map +1 -1
- package/build/src/database/query/preloader/has-many.js +4 -4
- package/build/src/database/query/preloader/has-one.d.ts +5 -5
- package/build/src/database/query/preloader/has-one.d.ts.map +1 -1
- package/build/src/database/query/preloader/has-one.js +2 -2
- package/build/src/database/query/preloader/query-for-model.d.ts.map +1 -1
- package/build/src/database/query/preloader/selection.d.ts +6 -6
- package/build/src/database/query/preloader/selection.d.ts.map +1 -1
- package/build/src/database/query/preloader.d.ts +8 -8
- package/build/src/database/query/preloader.d.ts.map +1 -1
- package/build/src/database/query/preloader.js +9 -3
- package/build/src/database/query/query-data.d.ts +43 -55
- package/build/src/database/query/query-data.d.ts.map +1 -1
- package/build/src/database/query/query-data.js +8 -8
- package/build/src/database/query/remove-index-base.d.ts +21 -19
- package/build/src/database/query/remove-index-base.d.ts.map +1 -1
- package/build/src/database/query/select-base.d.ts +1 -1
- package/build/src/database/query/select-base.d.ts.map +1 -1
- package/build/src/database/query/select-plain.d.ts +3 -2
- package/build/src/database/query/select-plain.d.ts.map +1 -1
- package/build/src/database/query/select-table-and-column.d.ts +4 -3
- package/build/src/database/query/select-table-and-column.d.ts.map +1 -1
- package/build/src/database/query/update-base.d.ts +10 -10
- package/build/src/database/query/update-base.d.ts.map +1 -1
- package/build/src/database/query/update-base.js +4 -4
- package/build/src/database/query/upsert-base.d.ts +9 -9
- package/build/src/database/query/upsert-base.d.ts.map +1 -1
- package/build/src/database/query/upsert-base.js +3 -3
- package/build/src/database/query/where-base.d.ts +1 -1
- package/build/src/database/query/where-base.d.ts.map +1 -1
- package/build/src/database/query/where-combinator.d.ts +9 -4
- package/build/src/database/query/where-combinator.d.ts.map +1 -1
- package/build/src/database/query/where-hash.d.ts +11 -9
- package/build/src/database/query/where-hash.d.ts.map +1 -1
- package/build/src/database/query/where-model-class-hash.d.ts +28 -26
- package/build/src/database/query/where-model-class-hash.d.ts.map +1 -1
- package/build/src/database/query/where-model-class-hash.js +14 -14
- package/build/src/database/query/where-not.d.ts +8 -3
- package/build/src/database/query/where-not.d.ts.map +1 -1
- package/build/src/database/query/where-plain.d.ts +4 -3
- package/build/src/database/query/where-plain.d.ts.map +1 -1
- package/build/src/database/query/with-count.d.ts +22 -28
- package/build/src/database/query/with-count.d.ts.map +1 -1
- package/build/src/database/query/with-count.js +12 -12
- package/build/src/database/query-aborted-error.d.ts +5 -5
- package/build/src/database/query-aborted-error.d.ts.map +1 -1
- package/build/src/database/query-parser/base-query-parser.d.ts +3 -3
- package/build/src/database/query-parser/base-query-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/from-parser.d.ts +2 -2
- package/build/src/database/query-parser/from-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/group-parser.d.ts +2 -2
- package/build/src/database/query-parser/group-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/joins-parser.d.ts +3 -3
- package/build/src/database/query-parser/joins-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/limit-parser.d.ts +2 -2
- package/build/src/database/query-parser/limit-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/options.d.ts +31 -34
- package/build/src/database/query-parser/options.d.ts.map +1 -1
- package/build/src/database/query-parser/options.js +3 -3
- package/build/src/database/query-parser/order-parser.d.ts +2 -2
- package/build/src/database/query-parser/order-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/select-parser.d.ts +2 -2
- package/build/src/database/query-parser/select-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/select-parser.js +2 -2
- package/build/src/database/query-parser/where-parser.d.ts +2 -2
- package/build/src/database/query-parser/where-parser.d.ts.map +1 -1
- package/build/src/database/record/acts-as-list.d.ts.map +1 -1
- package/build/src/database/record/acts-as-list.js +3 -3
- package/build/src/database/record/attachments/attachment-record.d.ts +7 -3
- package/build/src/database/record/attachments/attachment-record.d.ts.map +1 -1
- package/build/src/database/record/attachments/download.d.ts +9 -9
- package/build/src/database/record/attachments/download.d.ts.map +1 -1
- package/build/src/database/record/attachments/handle.d.ts +12 -12
- package/build/src/database/record/attachments/handle.d.ts.map +1 -1
- package/build/src/database/record/attachments/handle.js +7 -7
- package/build/src/database/record/attachments/normalize-input.d.ts +16 -22
- package/build/src/database/record/attachments/normalize-input.d.ts.map +1 -1
- package/build/src/database/record/attachments/normalize-input.js +12 -12
- package/build/src/database/record/attachments/storage-drivers/filesystem.d.ts +4 -4
- package/build/src/database/record/attachments/storage-drivers/filesystem.d.ts.map +1 -1
- package/build/src/database/record/attachments/storage-drivers/filesystem.js +2 -2
- package/build/src/database/record/attachments/storage-drivers/native.d.ts +12 -12
- package/build/src/database/record/attachments/storage-drivers/native.d.ts.map +1 -1
- package/build/src/database/record/attachments/storage-drivers/native.js +6 -6
- package/build/src/database/record/attachments/storage-drivers/s3.d.ts +17 -17
- package/build/src/database/record/attachments/storage-drivers/s3.d.ts.map +1 -1
- package/build/src/database/record/attachments/storage-drivers/s3.js +11 -11
- package/build/src/database/record/attachments/store.d.ts +38 -41
- package/build/src/database/record/attachments/store.d.ts.map +1 -1
- package/build/src/database/record/attachments/store.js +24 -21
- package/build/src/database/record/auditing.d.ts +67 -87
- package/build/src/database/record/auditing.d.ts.map +1 -1
- package/build/src/database/record/auditing.js +109 -30
- package/build/src/database/record/counter-cache-magnitude.d.ts +15 -35
- package/build/src/database/record/counter-cache-magnitude.d.ts.map +1 -1
- package/build/src/database/record/counter-cache-magnitude.js +12 -12
- package/build/src/database/record/index.d.ts +2390 -488
- package/build/src/database/record/index.d.ts.map +1 -1
- package/build/src/database/record/index.js +222 -172
- package/build/src/database/record/instance-relationships/base.d.ts +20 -23
- package/build/src/database/record/instance-relationships/base.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/base.js +5 -5
- package/build/src/database/record/instance-relationships/belongs-to.d.ts +9 -1
- package/build/src/database/record/instance-relationships/belongs-to.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/belongs-to.js +2 -2
- package/build/src/database/record/instance-relationships/has-many.d.ts +15 -3
- package/build/src/database/record/instance-relationships/has-many.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/has-many.js +4 -4
- package/build/src/database/record/instance-relationships/has-one.d.ts +19 -1
- package/build/src/database/record/instance-relationships/has-one.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/has-one.js +2 -2
- package/build/src/database/record/record-not-found-error.d.ts +1 -0
- package/build/src/database/record/record-not-found-error.d.ts.map +1 -1
- package/build/src/database/record/record-not-found-error.js +2 -1
- package/build/src/database/record/relationships/base.d.ts +83 -71
- package/build/src/database/record/relationships/base.d.ts.map +1 -1
- package/build/src/database/record/relationships/base.js +21 -1
- package/build/src/database/record/relationships/belongs-to.d.ts +11 -1
- package/build/src/database/record/relationships/belongs-to.d.ts.map +1 -1
- package/build/src/database/record/relationships/has-many.d.ts +11 -1
- package/build/src/database/record/relationships/has-many.d.ts.map +1 -1
- package/build/src/database/record/relationships/has-one.d.ts +11 -1
- package/build/src/database/record/relationships/has-one.d.ts.map +1 -1
- package/build/src/database/record/state-machine.d.ts +20 -29
- package/build/src/database/record/state-machine.d.ts.map +1 -1
- package/build/src/database/record/state-machine.js +7 -7
- package/build/src/database/record/user-module.d.ts +1 -1
- package/build/src/database/record/user-module.d.ts.map +1 -1
- package/build/src/database/record/validation-messages.d.ts +19 -22
- package/build/src/database/record/validation-messages.d.ts.map +1 -1
- package/build/src/database/record/validators/base.d.ts +4 -4
- package/build/src/database/record/validators/base.d.ts.map +1 -1
- package/build/src/database/record/validators/base.js +2 -2
- package/build/src/database/record/validators/format.d.ts +12 -1
- package/build/src/database/record/validators/format.d.ts.map +1 -1
- package/build/src/database/record/validators/length.d.ts +14 -1
- package/build/src/database/record/validators/length.d.ts.map +1 -1
- package/build/src/database/record/validators/presence.d.ts +11 -1
- package/build/src/database/record/validators/presence.d.ts.map +1 -1
- package/build/src/database/record/validators/uniqueness.d.ts +12 -1
- package/build/src/database/record/validators/uniqueness.d.ts.map +1 -1
- package/build/src/database/record-changes.d.ts +7 -18
- package/build/src/database/record-changes.d.ts.map +1 -1
- package/build/src/database/structure-sql-loader.d.ts +2 -2
- package/build/src/database/structure-sql-loader.d.ts.map +1 -1
- package/build/src/database/structure-sql-loader.js +4 -4
- package/build/src/database/table-data/index.d.ts +21 -24
- package/build/src/database/table-data/index.d.ts.map +1 -1
- package/build/src/database/table-data/table-column.d.ts +74 -80
- package/build/src/database/table-data/table-column.d.ts.map +1 -1
- package/build/src/database/table-data/table-column.js +4 -4
- package/build/src/database/table-data/table-foreign-key.d.ts +10 -10
- package/build/src/database/table-data/table-foreign-key.d.ts.map +1 -1
- package/build/src/database/table-data/table-index.d.ts +12 -15
- package/build/src/database/table-data/table-index.d.ts.map +1 -1
- package/build/src/database/table-data/table-reference.d.ts +2 -2
- package/build/src/database/table-data/table-reference.d.ts.map +1 -1
- package/build/src/database/tenants/data-copier.d.ts +7 -7
- package/build/src/database/tenants/data-copier.d.ts.map +1 -1
- package/build/src/database/tenants/schema-cloner.d.ts +3 -3
- package/build/src/database/tenants/schema-cloner.d.ts.map +1 -1
- package/build/src/database/tenants/tenant-table-plan.d.ts +20 -14
- package/build/src/database/tenants/tenant-table-plan.d.ts.map +1 -1
- package/build/src/database/tenants/tenant-table-plan.js +17 -1
- package/build/src/database/use-database.d.ts.map +1 -1
- package/build/src/database/use-live-query.d.ts +17 -29
- package/build/src/database/use-live-query.d.ts.map +1 -1
- package/build/src/database/use-live-query.js +4 -4
- package/build/src/environment-handlers/base.d.ts +112 -103
- package/build/src/environment-handlers/base.d.ts.map +1 -1
- package/build/src/environment-handlers/base.js +54 -38
- package/build/src/environment-handlers/browser.d.ts +63 -56
- package/build/src/environment-handlers/browser.d.ts.map +1 -1
- package/build/src/environment-handlers/browser.js +2 -2
- package/build/src/environment-handlers/node/attachment-path-source.d.ts +9 -9
- package/build/src/environment-handlers/node/attachment-path-source.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/background-jobs-main.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/background-jobs-main.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/background-jobs-runner.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/background-jobs-runner.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/background-jobs-worker.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/background-jobs-worker.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/beacon.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/beacon.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/cli-command-context.d.ts +7 -10
- package/build/src/environment-handlers/node/cli/commands/cli-command-context.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/console.d.ts +9 -7
- package/build/src/environment-handlers/node/cli/commands/console.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/console.js +5 -5
- package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/seed.d.ts +7 -5
- package/build/src/environment-handlers/node/cli/commands/db/seed.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/seed.js +3 -3
- package/build/src/environment-handlers/node/cli/commands/destroy/migration.d.ts +4 -7
- package/build/src/environment-handlers/node/cli/commands/destroy/migration.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/base-models.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/base-models.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/base-models.js +2 -2
- package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts +93 -108
- package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/generated-file-banner.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/migration.d.ts +9 -12
- package/build/src/environment-handlers/node/cli/commands/generate/migration.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/model.d.ts +8 -11
- package/build/src/environment-handlers/node/cli/commands/generate/model.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/init.d.ts +7 -9
- package/build/src/environment-handlers/node/cli/commands/init.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/lint/relationships.d.ts +7 -7
- package/build/src/environment-handlers/node/cli/commands/lint/relationships.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/routes.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/routes.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/run-script.d.ts +7 -5
- package/build/src/environment-handlers/node/cli/commands/run-script.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/run-script.js +3 -3
- package/build/src/environment-handlers/node/cli/commands/runner.d.ts +9 -7
- package/build/src/environment-handlers/node/cli/commands/runner.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/runner.js +3 -3
- package/build/src/environment-handlers/node/cli/commands/server.d.ts +24 -30
- package/build/src/environment-handlers/node/cli/commands/server.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/server.js +2 -2
- package/build/src/environment-handlers/node/cli/commands/test.d.ts +5 -5
- package/build/src/environment-handlers/node/cli/commands/test.d.ts.map +1 -1
- package/build/src/environment-handlers/node/source-peer-package.d.ts +5 -7
- package/build/src/environment-handlers/node/source-peer-package.d.ts.map +1 -1
- package/build/src/environment-handlers/node/source-peer-package.js +1 -1
- package/build/src/environment-handlers/node.d.ts +362 -13
- package/build/src/environment-handlers/node.d.ts.map +1 -1
- package/build/src/environment-handlers/node.js +37 -37
- package/build/src/error-logger.d.ts +3 -3
- package/build/src/error-logger.d.ts.map +1 -1
- package/build/src/error-logger.js +3 -3
- package/build/src/error-reporting/request-details.d.ts +1 -1
- package/build/src/error-reporting/request-details.d.ts.map +1 -1
- package/build/src/error-reporting/request-details.js +33 -33
- package/build/src/frontend-model-controller.d.ts +216 -230
- package/build/src/frontend-model-controller.d.ts.map +1 -1
- package/build/src/frontend-model-controller.js +217 -211
- package/build/src/frontend-model-resource/base-resource.d.ts +315 -365
- package/build/src/frontend-model-resource/base-resource.d.ts.map +1 -1
- package/build/src/frontend-model-resource/base-resource.js +45 -45
- package/build/src/frontend-model-resource/velocious-attachment-resource.d.ts +11 -5
- package/build/src/frontend-model-resource/velocious-attachment-resource.d.ts.map +1 -1
- package/build/src/frontend-model-resource/velocious-attachment-resource.js +2 -2
- package/build/src/frontend-models/base.d.ts +632 -726
- package/build/src/frontend-models/base.d.ts.map +1 -1
- package/build/src/frontend-models/base.js +147 -143
- package/build/src/frontend-models/built-in-resources.d.ts +2 -2
- package/build/src/frontend-models/built-in-resources.d.ts.map +1 -1
- package/build/src/frontend-models/clear-pending-debounced-callback.d.ts +2 -2
- package/build/src/frontend-models/clear-pending-debounced-callback.d.ts.map +1 -1
- package/build/src/frontend-models/clear-pending-debounced-callback.js +3 -3
- package/build/src/frontend-models/event-hook-models.d.ts +3 -6
- package/build/src/frontend-models/event-hook-models.d.ts.map +1 -1
- package/build/src/frontend-models/model-registry.d.ts +5 -5
- package/build/src/frontend-models/model-registry.d.ts.map +1 -1
- package/build/src/frontend-models/model-registry.js +5 -5
- package/build/src/frontend-models/outgoing-event-buffer.d.ts +20 -17
- package/build/src/frontend-models/outgoing-event-buffer.d.ts.map +1 -1
- package/build/src/frontend-models/outgoing-event-buffer.js +2 -2
- package/build/src/frontend-models/preloader.d.ts.map +1 -1
- package/build/src/frontend-models/preloader.js +2 -2
- package/build/src/frontend-models/query.d.ts +286 -331
- package/build/src/frontend-models/query.d.ts.map +1 -1
- package/build/src/frontend-models/query.js +61 -61
- package/build/src/frontend-models/resource-config-validation.d.ts +2 -2
- package/build/src/frontend-models/resource-config-validation.d.ts.map +1 -1
- package/build/src/frontend-models/resource-definition.d.ts +30 -33
- package/build/src/frontend-models/resource-definition.d.ts.map +1 -1
- package/build/src/frontend-models/resource-definition.js +10 -10
- package/build/src/frontend-models/transport-deadline.d.ts.map +1 -1
- package/build/src/frontend-models/transport-serialization.d.ts +26 -32
- package/build/src/frontend-models/transport-serialization.d.ts.map +1 -1
- package/build/src/frontend-models/transport-serialization.js +28 -28
- package/build/src/frontend-models/use-created-event.d.ts +4 -4
- package/build/src/frontend-models/use-created-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-destroyed-event.d.ts +8 -29
- package/build/src/frontend-models/use-destroyed-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-model-class-event.d.ts +9 -33
- package/build/src/frontend-models/use-model-class-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-updated-event.d.ts +8 -29
- package/build/src/frontend-models/use-updated-event.d.ts.map +1 -1
- package/build/src/frontend-models/websocket-channel.d.ts +30 -34
- package/build/src/frontend-models/websocket-channel.d.ts.map +1 -1
- package/build/src/frontend-models/websocket-channel.js +5 -5
- package/build/src/frontend-models/websocket-publishers.d.ts +4 -4
- package/build/src/frontend-models/websocket-publishers.d.ts.map +1 -1
- package/build/src/frontend-models/websocket-publishers.js +2 -2
- package/build/src/http-client/header.d.ts +2 -2
- package/build/src/http-client/header.d.ts.map +1 -1
- package/build/src/http-client/index.d.ts +23 -23
- package/build/src/http-client/index.d.ts.map +1 -1
- package/build/src/http-client/request.d.ts +9 -9
- package/build/src/http-client/request.d.ts.map +1 -1
- package/build/src/http-client/request.js +2 -2
- package/build/src/http-client/response.d.ts +12 -12
- package/build/src/http-client/response.d.ts.map +1 -1
- package/build/src/http-client/response.js +2 -2
- package/build/src/http-client/websocket-client.d.ts +20 -4
- package/build/src/http-client/websocket-client.d.ts.map +1 -1
- package/build/src/http-server/client/index.d.ts +26 -26
- package/build/src/http-server/client/index.d.ts.map +1 -1
- package/build/src/http-server/client/index.js +5 -5
- package/build/src/http-server/client/params-to-object.d.ts +11 -11
- package/build/src/http-server/client/params-to-object.d.ts.map +1 -1
- package/build/src/http-server/client/params-to-object.js +17 -17
- package/build/src/http-server/client/request-buffer/form-data-part.d.ts +9 -9
- package/build/src/http-server/client/request-buffer/form-data-part.d.ts.map +1 -1
- package/build/src/http-server/client/request-buffer/header.d.ts +3 -3
- package/build/src/http-server/client/request-buffer/header.d.ts.map +1 -1
- package/build/src/http-server/client/request-buffer/index.d.ts +28 -30
- package/build/src/http-server/client/request-buffer/index.d.ts.map +1 -1
- package/build/src/http-server/client/request-buffer/index.js +5 -3
- package/build/src/http-server/client/request-parser.d.ts +11 -11
- package/build/src/http-server/client/request-parser.d.ts.map +1 -1
- package/build/src/http-server/client/request-parser.js +3 -3
- package/build/src/http-server/client/request-runner.d.ts +11 -11
- package/build/src/http-server/client/request-runner.d.ts.map +1 -1
- package/build/src/http-server/client/request-runner.js +3 -3
- package/build/src/http-server/client/request-timing.d.ts +5 -11
- package/build/src/http-server/client/request-timing.d.ts.map +1 -1
- package/build/src/http-server/client/request.d.ts +10 -10
- package/build/src/http-server/client/request.d.ts.map +1 -1
- package/build/src/http-server/client/request.js +3 -3
- package/build/src/http-server/client/response-compression.d.ts +5 -5
- package/build/src/http-server/client/response-compression.d.ts.map +1 -1
- package/build/src/http-server/client/response.d.ts +13 -13
- package/build/src/http-server/client/response.d.ts.map +1 -1
- package/build/src/http-server/client/uploaded-file/memory-uploaded-file.d.ts +8 -2
- package/build/src/http-server/client/uploaded-file/memory-uploaded-file.d.ts.map +1 -1
- package/build/src/http-server/client/uploaded-file/temporary-uploaded-file.d.ts +8 -2
- package/build/src/http-server/client/uploaded-file/temporary-uploaded-file.d.ts.map +1 -1
- package/build/src/http-server/client/uploaded-file/uploaded-file.d.ts +4 -4
- package/build/src/http-server/client/uploaded-file/uploaded-file.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-request.d.ts +26 -26
- package/build/src/http-server/client/websocket-request.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-request.js +7 -7
- package/build/src/http-server/client/websocket-session.d.ts +105 -108
- package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-session.js +29 -29
- package/build/src/http-server/client-delivery-queue.d.ts +30 -30
- package/build/src/http-server/client-delivery-queue.d.ts.map +1 -1
- package/build/src/http-server/cookie.d.ts +80 -108
- package/build/src/http-server/cookie.d.ts.map +1 -1
- package/build/src/http-server/cookie.js +3 -3
- package/build/src/http-server/development-reloader.d.ts +24 -24
- package/build/src/http-server/development-reloader.d.ts.map +1 -1
- package/build/src/http-server/development-reloader.js +2 -2
- package/build/src/http-server/index.d.ts +66 -72
- package/build/src/http-server/index.d.ts.map +1 -1
- package/build/src/http-server/index.js +6 -6
- package/build/src/http-server/remote-address.d.ts.map +1 -1
- package/build/src/http-server/remote-address.js +2 -2
- package/build/src/http-server/server-client.d.ts +9 -9
- package/build/src/http-server/server-client.d.ts.map +1 -1
- package/build/src/http-server/server-lock.d.ts +11 -11
- package/build/src/http-server/server-lock.d.ts.map +1 -1
- package/build/src/http-server/server-lock.js +5 -5
- package/build/src/http-server/websocket-channel-subscribers.d.ts +11 -10
- package/build/src/http-server/websocket-channel-subscribers.d.ts.map +1 -1
- package/build/src/http-server/websocket-channel-subscribers.js +6 -6
- package/build/src/http-server/websocket-channel.d.ts +8 -14
- package/build/src/http-server/websocket-channel.d.ts.map +1 -1
- package/build/src/http-server/websocket-channel.js +2 -2
- package/build/src/http-server/websocket-connection.d.ts +10 -10
- package/build/src/http-server/websocket-connection.d.ts.map +1 -1
- package/build/src/http-server/websocket-connection.js +4 -4
- package/build/src/http-server/websocket-event-log-store.d.ts +58 -64
- package/build/src/http-server/websocket-event-log-store.d.ts.map +1 -1
- package/build/src/http-server/websocket-event-log-store.js +10 -10
- package/build/src/http-server/websocket-events-host.d.ts +17 -16
- package/build/src/http-server/websocket-events-host.d.ts.map +1 -1
- package/build/src/http-server/websocket-events-host.js +8 -8
- package/build/src/http-server/websocket-events.d.ts +9 -9
- package/build/src/http-server/websocket-events.d.ts.map +1 -1
- package/build/src/http-server/websocket-events.js +5 -5
- package/build/src/http-server/worker-handler/channel-subscriber-dispatch.d.ts +2 -2
- package/build/src/http-server/worker-handler/channel-subscriber-dispatch.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/channel-subscriber-dispatch.js +2 -2
- package/build/src/http-server/worker-handler/in-process.d.ts +22 -22
- package/build/src/http-server/worker-handler/in-process.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/in-process.js +6 -6
- package/build/src/http-server/worker-handler/index.d.ts +50 -50
- package/build/src/http-server/worker-handler/index.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/index.js +11 -11
- package/build/src/http-server/worker-handler/worker-thread.d.ts +61 -61
- package/build/src/http-server/worker-handler/worker-thread.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/worker-thread.js +9 -9
- package/build/src/initializer.d.ts +2 -2
- package/build/src/initializer.d.ts.map +1 -1
- package/build/src/jobs/mail-delivery.d.ts +7 -2
- package/build/src/jobs/mail-delivery.d.ts.map +1 -1
- package/build/src/jobs/prune-terminal-background-jobs.d.ts +15 -2
- package/build/src/jobs/prune-terminal-background-jobs.d.ts.map +1 -1
- package/build/src/jobs/prune-terminal-background-jobs.js +1 -1
- package/build/src/logger/base-logger.d.ts.map +1 -1
- package/build/src/logger/base-logger.js +2 -2
- package/build/src/logger/console-logger.d.ts +3 -3
- package/build/src/logger/console-logger.d.ts.map +1 -1
- package/build/src/logger/file-logger.d.ts +4 -4
- package/build/src/logger/file-logger.d.ts.map +1 -1
- package/build/src/logger/outputs/array-output.d.ts +9 -12
- package/build/src/logger/outputs/array-output.d.ts.map +1 -1
- package/build/src/logger/outputs/console-output.d.ts +1 -4
- package/build/src/logger/outputs/console-output.d.ts.map +1 -1
- package/build/src/logger/outputs/file-output.d.ts +13 -16
- package/build/src/logger/outputs/file-output.d.ts.map +1 -1
- package/build/src/logger/outputs/stdout-output.d.ts +1 -4
- package/build/src/logger/outputs/stdout-output.d.ts.map +1 -1
- package/build/src/logger.d.ts +30 -29
- package/build/src/logger.d.ts.map +1 -1
- package/build/src/logger.js +13 -13
- package/build/src/mailer/backends/smtp.d.ts +8 -11
- package/build/src/mailer/backends/smtp.d.ts.map +1 -1
- package/build/src/mailer/backends/smtp.js +4 -4
- package/build/src/mailer/base.d.ts +61 -61
- package/build/src/mailer/base.d.ts.map +1 -1
- package/build/src/mailer/base.js +15 -15
- package/build/src/mailer/delivery.d.ts +16 -16
- package/build/src/mailer/delivery.d.ts.map +1 -1
- package/build/src/mailer/delivery.js +4 -4
- package/build/src/mailer/index.d.ts +8 -13
- package/build/src/mailer/index.d.ts.map +1 -1
- package/build/src/mailer/index.js +2 -2
- package/build/src/mailer.d.ts +9 -7
- package/build/src/mailer.d.ts.map +1 -1
- package/build/src/mailer.js +2 -2
- package/build/src/packages/velocious-package.d.ts +5 -5
- package/build/src/packages/velocious-package.d.ts.map +1 -1
- package/build/src/plugins/sqljs-wasm-route-controller.d.ts +1 -1
- package/build/src/plugins/sqljs-wasm-route-controller.d.ts.map +1 -1
- package/build/src/plugins/sqljs-wasm-route-controller.js +2 -2
- package/build/src/plugins/sqljs-wasm-route.d.ts +14 -20
- package/build/src/plugins/sqljs-wasm-route.d.ts.map +1 -1
- package/build/src/plugins/sqljs-wasm-route.js +1 -1
- package/build/src/record-payload-values.d.ts +14 -14
- package/build/src/record-payload-values.d.ts.map +1 -1
- package/build/src/record-payload-values.js +4 -4
- package/build/src/routes/app-routes.d.ts.map +1 -1
- package/build/src/routes/base-route.d.ts +11 -10
- package/build/src/routes/base-route.d.ts.map +1 -1
- package/build/src/routes/base-route.js +6 -6
- package/build/src/routes/basic-route.d.ts +36 -3
- package/build/src/routes/basic-route.d.ts.map +1 -1
- package/build/src/routes/basic-route.js +5 -5
- package/build/src/routes/built-in/api-manifest/controller.d.ts +1 -1
- package/build/src/routes/built-in/api-manifest/controller.d.ts.map +1 -1
- package/build/src/routes/built-in/debug/controller.d.ts +1 -1
- package/build/src/routes/built-in/debug/controller.d.ts.map +1 -1
- package/build/src/routes/built-in/errors/controller.d.ts +1 -1
- package/build/src/routes/built-in/errors/controller.d.ts.map +1 -1
- package/build/src/routes/get-route.d.ts +19 -4
- package/build/src/routes/get-route.d.ts.map +1 -1
- package/build/src/routes/get-route.js +3 -3
- package/build/src/routes/hooks/frontend-model-command-route-hook.d.ts +1 -1
- package/build/src/routes/hooks/frontend-model-command-route-hook.d.ts.map +1 -1
- package/build/src/routes/hooks/frontend-model-command-route-hook.js +2 -2
- package/build/src/routes/index.d.ts +5 -5
- package/build/src/routes/index.d.ts.map +1 -1
- package/build/src/routes/index.js +4 -4
- package/build/src/routes/namespace-route.d.ts +19 -4
- package/build/src/routes/namespace-route.d.ts.map +1 -1
- package/build/src/routes/namespace-route.js +2 -2
- package/build/src/routes/plugin-routes.d.ts +16 -19
- package/build/src/routes/plugin-routes.d.ts.map +1 -1
- package/build/src/routes/plugin-routes.js +2 -2
- package/build/src/routes/post-route.d.ts +19 -4
- package/build/src/routes/post-route.d.ts.map +1 -1
- package/build/src/routes/post-route.js +3 -3
- package/build/src/routes/resolver.d.ts +16 -16
- package/build/src/routes/resolver.d.ts.map +1 -1
- package/build/src/routes/resolver.js +6 -6
- package/build/src/routes/resource-route.d.ts +23 -8
- package/build/src/routes/resource-route.d.ts.map +1 -1
- package/build/src/routes/resource-route.js +2 -2
- package/build/src/routes/root-route.d.ts +1 -1
- package/build/src/routes/root-route.d.ts.map +1 -1
- package/build/src/sync/conflict-strategy.d.ts +50 -35
- package/build/src/sync/conflict-strategy.d.ts.map +1 -1
- package/build/src/sync/conflict-strategy.js +2 -2
- package/build/src/sync/device-identity.d.ts +109 -79
- package/build/src/sync/device-identity.d.ts.map +1 -1
- package/build/src/sync/local-mutation-log.d.ts +115 -92
- package/build/src/sync/local-mutation-log.d.ts.map +1 -1
- package/build/src/sync/offline-grant.d.ts +80 -63
- package/build/src/sync/offline-grant.d.ts.map +1 -1
- package/build/src/sync/peer-mutation-bundle.d.ts +33 -39
- package/build/src/sync/peer-mutation-bundle.d.ts.map +1 -1
- package/build/src/sync/query-scope.d.ts +3 -3
- package/build/src/sync/query-scope.d.ts.map +1 -1
- package/build/src/sync/query-scope.js +8 -8
- package/build/src/sync/server-change-feed.d.ts +129 -129
- package/build/src/sync/server-change-feed.d.ts.map +1 -1
- package/build/src/sync/server-change-feed.js +14 -14
- package/build/src/sync/server-sequence-allocator.d.ts +36 -36
- package/build/src/sync/server-sequence-allocator.d.ts.map +1 -1
- package/build/src/sync/server-sequence-allocator.js +6 -6
- package/build/src/sync/signed-sync-envelope-replay-service.d.ts +60 -48
- package/build/src/sync/signed-sync-envelope-replay-service.d.ts.map +1 -1
- package/build/src/sync/signed-sync-envelope-replay-service.js +21 -21
- package/build/src/sync/stable-json.d.ts +2 -2
- package/build/src/sync/stable-json.d.ts.map +1 -1
- package/build/src/sync/stable-json.js +5 -5
- package/build/src/sync/sync-api-client-types.d.ts +98 -25
- package/build/src/sync/sync-api-client-types.d.ts.map +1 -1
- package/build/src/sync/sync-api-client-types.js +73 -1
- package/build/src/sync/sync-api-client.d.ts +71 -71
- package/build/src/sync/sync-api-client.d.ts.map +1 -1
- package/build/src/sync/sync-api-client.js +30 -30
- package/build/src/sync/sync-api-controller.d.ts +23 -23
- package/build/src/sync/sync-api-controller.d.ts.map +1 -1
- package/build/src/sync/sync-change-fanout.d.ts +32 -38
- package/build/src/sync/sync-change-fanout.d.ts.map +1 -1
- package/build/src/sync/sync-change-fanout.js +7 -7
- package/build/src/sync/sync-channel-name.d.ts +1 -1
- package/build/src/sync/sync-channel-name.d.ts.map +1 -1
- package/build/src/sync/sync-client-registry.d.ts +4 -4
- package/build/src/sync/sync-client-registry.d.ts.map +1 -1
- package/build/src/sync/sync-client-registry.js +4 -4
- package/build/src/sync/sync-client-types.d.ts +130 -82
- package/build/src/sync/sync-client-types.d.ts.map +1 -1
- package/build/src/sync/sync-client-types.js +89 -1
- package/build/src/sync/sync-client.d.ts +76 -76
- package/build/src/sync/sync-client.d.ts.map +1 -1
- package/build/src/sync/sync-client.js +19 -19
- package/build/src/sync/sync-envelope-replay-service.d.ts +266 -298
- package/build/src/sync/sync-envelope-replay-service.d.ts.map +1 -1
- package/build/src/sync/sync-envelope-replay-service.js +77 -77
- package/build/src/sync/sync-model-change-feed-service.d.ts +23 -23
- package/build/src/sync/sync-model-change-feed-service.d.ts.map +1 -1
- package/build/src/sync/sync-model-change-feed-service.js +8 -8
- package/build/src/sync/sync-publish-suppression.d.ts +5 -5
- package/build/src/sync/sync-publish-suppression.d.ts.map +1 -1
- package/build/src/sync/sync-publish-suppression.js +3 -3
- package/build/src/sync/sync-publisher-types.d.ts +98 -55
- package/build/src/sync/sync-publisher-types.d.ts.map +1 -1
- package/build/src/sync/sync-publisher-types.js +75 -1
- package/build/src/sync/sync-publisher.d.ts +43 -43
- package/build/src/sync/sync-publisher.d.ts.map +1 -1
- package/build/src/sync/sync-publisher.js +20 -20
- package/build/src/sync/sync-realtime-bridge.d.ts +23 -23
- package/build/src/sync/sync-realtime-bridge.d.ts.map +1 -1
- package/build/src/sync/sync-realtime-bridge.js +9 -9
- package/build/src/sync/sync-replay-upsert-applier.d.ts +70 -70
- package/build/src/sync/sync-replay-upsert-applier.d.ts.map +1 -1
- package/build/src/sync/sync-replay-upsert-applier.js +17 -17
- package/build/src/sync/sync-resource-base.d.ts +52 -51
- package/build/src/sync/sync-resource-base.d.ts.map +1 -1
- package/build/src/sync/sync-resource-base.js +15 -15
- package/build/src/sync/sync-scope-attributes.d.ts +2 -2
- package/build/src/sync/sync-scope-attributes.d.ts.map +1 -1
- package/build/src/sync/sync-scope-attributes.js +2 -2
- package/build/src/sync/sync-scope-store.d.ts +36 -36
- package/build/src/sync/sync-scope-store.d.ts.map +1 -1
- package/build/src/sync/sync-scope-store.js +6 -6
- package/build/src/sync/sync-websocket-channel.d.ts +11 -6
- package/build/src/sync/sync-websocket-channel.d.ts.map +1 -1
- package/build/src/sync/sync-websocket-channel.js +6 -6
- package/build/src/tenants/default-tenant-database-provisioning.d.ts +4 -4
- package/build/src/tenants/default-tenant-database-provisioning.d.ts.map +1 -1
- package/build/src/tenants/default-tenant-database-provisioning.js +2 -2
- package/build/src/tenants/tenant-aggregator.d.ts +81 -81
- package/build/src/tenants/tenant-aggregator.d.ts.map +1 -1
- package/build/src/tenants/tenant-aggregator.js +13 -13
- package/build/src/tenants/tenant-handle.d.ts +64 -0
- package/build/src/tenants/tenant-handle.d.ts.map +1 -0
- package/build/src/tenants/tenant-handle.js +221 -0
- package/build/src/tenants/tenant-iterator.d.ts +17 -17
- package/build/src/tenants/tenant-iterator.d.ts.map +1 -1
- package/build/src/tenants/tenant-iterator.js +7 -7
- package/build/src/tenants/tenant-model-scope.d.ts +73 -0
- package/build/src/tenants/tenant-model-scope.d.ts.map +1 -0
- package/build/src/tenants/tenant-model-scope.js +115 -0
- package/build/src/tenants/tenant.d.ts +16 -6
- package/build/src/tenants/tenant.d.ts.map +1 -1
- package/build/src/tenants/tenant.js +15 -3
- package/build/src/testing/base-expect.d.ts.map +1 -1
- package/build/src/testing/browser-frontend-model-event-hook-scenarios.d.ts +19 -31
- package/build/src/testing/browser-frontend-model-event-hook-scenarios.d.ts.map +1 -1
- package/build/src/testing/browser-test-app.js +6 -6
- package/build/src/testing/expect-to-change.d.ts +9 -7
- package/build/src/testing/expect-to-change.d.ts.map +1 -1
- package/build/src/testing/expect-to-change.js +2 -2
- package/build/src/testing/expect-utils.d.ts +30 -29
- package/build/src/testing/expect-utils.d.ts.map +1 -1
- package/build/src/testing/expect-utils.js +30 -30
- package/build/src/testing/expect.d.ts +30 -30
- package/build/src/testing/expect.d.ts.map +1 -1
- package/build/src/testing/expect.js +19 -19
- package/build/src/testing/factory/association-declaration.d.ts +16 -16
- package/build/src/testing/factory/association-declaration.d.ts.map +1 -1
- package/build/src/testing/factory/association-declaration.js +3 -3
- package/build/src/testing/factory/declarations.d.ts +90 -115
- package/build/src/testing/factory/declarations.d.ts.map +1 -1
- package/build/src/testing/factory/declarations.js +6 -6
- package/build/src/testing/factory/definition-builder.d.ts +72 -70
- package/build/src/testing/factory/definition-builder.d.ts.map +1 -1
- package/build/src/testing/factory/definition-builder.js +40 -40
- package/build/src/testing/factory/errors.d.ts +30 -29
- package/build/src/testing/factory/errors.d.ts.map +1 -1
- package/build/src/testing/factory/evaluation-context.d.ts +29 -29
- package/build/src/testing/factory/evaluation-context.d.ts.map +1 -1
- package/build/src/testing/factory/evaluation-context.js +17 -17
- package/build/src/testing/factory/events.d.ts +4 -5
- package/build/src/testing/factory/events.d.ts.map +1 -1
- package/build/src/testing/factory/factory-definition.d.ts +14 -14
- package/build/src/testing/factory/factory-definition.d.ts.map +1 -1
- package/build/src/testing/factory/factory-definition.js +3 -3
- package/build/src/testing/factory/factory-registry.d.ts +56 -54
- package/build/src/testing/factory/factory-registry.d.ts.map +1 -1
- package/build/src/testing/factory/factory-registry.js +35 -35
- package/build/src/testing/factory/factory-runner.d.ts +67 -73
- package/build/src/testing/factory/factory-runner.d.ts.map +1 -1
- package/build/src/testing/factory/factory-runner.js +9 -9
- package/build/src/testing/factory/index.d.ts +7 -7
- package/build/src/testing/factory/index.d.ts.map +1 -1
- package/build/src/testing/factory/linter.d.ts +7 -7
- package/build/src/testing/factory/linter.d.ts.map +1 -1
- package/build/src/testing/factory/linter.js +3 -3
- package/build/src/testing/factory/model-contract.d.ts +3 -3
- package/build/src/testing/factory/model-contract.d.ts.map +1 -1
- package/build/src/testing/factory/model-contract.js +4 -4
- package/build/src/testing/factory/node/load-definitions.d.ts +2 -2
- package/build/src/testing/factory/node/load-definitions.d.ts.map +1 -1
- package/build/src/testing/factory/sequence.d.ts +19 -23
- package/build/src/testing/factory/sequence.d.ts.map +1 -1
- package/build/src/testing/factory/sequence.js +3 -3
- package/build/src/testing/factory/strategies/attributes-for.d.ts +3 -3
- package/build/src/testing/factory/strategies/attributes-for.d.ts.map +1 -1
- package/build/src/testing/factory/strategies/attributes-for.js +2 -2
- package/build/src/testing/factory/strategies/base.d.ts +32 -32
- package/build/src/testing/factory/strategies/base.d.ts.map +1 -1
- package/build/src/testing/factory/strategies/base.js +25 -25
- package/build/src/testing/factory/strategies/build.d.ts +3 -3
- package/build/src/testing/factory/strategies/build.d.ts.map +1 -1
- package/build/src/testing/factory/strategies/build.js +3 -3
- package/build/src/testing/factory/strategies/create.d.ts +6 -6
- package/build/src/testing/factory/strategies/create.d.ts.map +1 -1
- package/build/src/testing/factory/strategies/create.js +5 -5
- package/build/src/testing/factory/trait-definition.d.ts +4 -4
- package/build/src/testing/factory/trait-definition.d.ts.map +1 -1
- package/build/src/testing/request-client.d.ts +19 -19
- package/build/src/testing/request-client.d.ts.map +1 -1
- package/build/src/testing/test-files-finder.d.ts +15 -15
- package/build/src/testing/test-files-finder.d.ts.map +1 -1
- package/build/src/testing/test-files-finder.js +2 -2
- package/build/src/testing/test-filter-parser.d.ts +19 -12
- package/build/src/testing/test-filter-parser.d.ts.map +1 -1
- package/build/src/testing/test-runner.d.ts +204 -251
- package/build/src/testing/test-runner.d.ts.map +1 -1
- package/build/src/testing/test-runner.js +15 -15
- package/build/src/testing/test-suite-splitter.d.ts +25 -31
- package/build/src/testing/test-suite-splitter.d.ts.map +1 -1
- package/build/src/testing/test.d.ts +51 -55
- package/build/src/testing/test.d.ts.map +1 -1
- package/build/src/testing/test.js +20 -18
- package/build/src/testing/wait-for-event.d.ts +25 -25
- package/build/src/testing/wait-for-event.d.ts.map +1 -1
- package/build/src/testing/wait-for-event.js +6 -6
- package/build/src/time-zone.d.ts +3 -3
- package/build/src/time-zone.d.ts.map +1 -1
- package/build/src/utils/backtrace-cleaner-node.d.ts +35 -2
- package/build/src/utils/backtrace-cleaner-node.d.ts.map +1 -1
- package/build/src/utils/backtrace-cleaner-node.js +1 -1
- package/build/src/utils/backtrace-cleaner.d.ts +33 -28
- package/build/src/utils/backtrace-cleaner.d.ts.map +1 -1
- package/build/src/utils/bearer-token.d.ts +2 -2
- package/build/src/utils/bearer-token.d.ts.map +1 -1
- package/build/src/utils/deburr-column-name.d.ts.map +1 -1
- package/build/src/utils/event-emitter.d.ts +1 -1
- package/build/src/utils/event-emitter.d.ts.map +1 -1
- package/build/src/utils/event-emitter.js +2 -2
- package/build/src/utils/file-exists.d.ts.map +1 -1
- package/build/src/utils/format-value.d.ts +9 -8
- package/build/src/utils/format-value.d.ts.map +1 -1
- package/build/src/utils/format-value.js +7 -7
- package/build/src/utils/is-date.d.ts +2 -2
- package/build/src/utils/is-date.d.ts.map +1 -1
- package/build/src/utils/is-date.js +2 -2
- package/build/src/utils/model-scope.d.ts +29 -24
- package/build/src/utils/model-scope.d.ts.map +1 -1
- package/build/src/utils/model-scope.js +11 -11
- package/build/src/utils/mount-prefix.d.ts +2 -2
- package/build/src/utils/mount-prefix.d.ts.map +1 -1
- package/build/src/utils/nest-callbacks.d.ts.map +1 -1
- package/build/src/utils/plain-object.d.ts +3 -3
- package/build/src/utils/plain-object.d.ts.map +1 -1
- package/build/src/utils/plain-object.js +3 -3
- package/build/src/utils/ransack.d.ts +69 -90
- package/build/src/utils/ransack.d.ts.map +1 -1
- package/build/src/utils/ransack.js +36 -36
- package/build/src/utils/rest-args-error.d.ts.map +1 -1
- package/build/src/utils/sha256-hex.d.ts.map +1 -1
- package/build/src/utils/shutdown-lifecycle.d.ts +1 -1
- package/build/src/utils/shutdown-lifecycle.d.ts.map +1 -1
- package/build/src/utils/singularize-model-name.d.ts.map +1 -1
- package/build/src/utils/split-sql-statements.d.ts.map +1 -1
- package/build/src/utils/to-import-specifier.d.ts.map +1 -1
- package/build/src/utils/with-tracked-stack-async-hooks.d.ts +6 -5
- package/build/src/utils/with-tracked-stack-async-hooks.d.ts.map +1 -1
- package/build/src/utils/with-tracked-stack-async-hooks.js +9 -9
- package/build/src/utils/with-tracked-stack.d.ts +6 -5
- package/build/src/utils/with-tracked-stack.d.ts.map +1 -1
- package/build/src/utils/with-tracked-stack.js +7 -7
- package/build/src/velocious-error.d.ts +27 -17
- package/build/src/velocious-error.d.ts.map +1 -1
- package/build/src/velocious-error.js +10 -4
- package/build/sync/conflict-strategy.js +1 -1
- package/build/sync/query-scope.js +7 -7
- package/build/sync/server-change-feed.js +13 -13
- package/build/sync/server-sequence-allocator.js +5 -5
- package/build/sync/signed-sync-envelope-replay-service.js +20 -20
- package/build/sync/stable-json.js +4 -4
- package/build/sync/sync-api-client-types.js +7 -7
- package/build/sync/sync-api-client.js +26 -26
- package/build/sync/sync-change-fanout.js +6 -6
- package/build/sync/sync-client-registry.js +3 -3
- package/build/sync/sync-client-types.js +10 -10
- package/build/sync/sync-client.js +18 -18
- package/build/sync/sync-envelope-replay-service.js +76 -76
- package/build/sync/sync-model-change-feed-service.js +7 -7
- package/build/sync/sync-publish-suppression.js +2 -2
- package/build/sync/sync-publisher-types.js +11 -11
- package/build/sync/sync-publisher.js +19 -19
- package/build/sync/sync-realtime-bridge.js +8 -8
- package/build/sync/sync-replay-upsert-applier.js +16 -16
- package/build/sync/sync-resource-base.js +14 -14
- package/build/sync/sync-scope-attributes.js +1 -1
- package/build/sync/sync-scope-store.js +5 -5
- package/build/sync/sync-websocket-channel.js +5 -5
- package/build/tenants/default-tenant-database-provisioning.js +1 -1
- package/build/tenants/tenant-aggregator.js +13 -13
- package/build/tenants/tenant-handle.js +252 -0
- package/build/tenants/tenant-iterator.js +6 -6
- package/build/tenants/tenant-model-scope.js +132 -0
- package/build/tenants/tenant.js +15 -2
- package/build/testing/browser-test-app.js +2 -2
- package/build/testing/expect-to-change.js +1 -1
- package/build/testing/expect-utils.js +29 -29
- package/build/testing/expect.js +18 -18
- package/build/testing/factory/association-declaration.js +2 -2
- package/build/testing/factory/declarations.js +5 -5
- package/build/testing/factory/definition-builder.js +39 -39
- package/build/testing/factory/evaluation-context.js +16 -16
- package/build/testing/factory/factory-definition.js +2 -2
- package/build/testing/factory/factory-registry.js +34 -34
- package/build/testing/factory/factory-runner.js +8 -8
- package/build/testing/factory/linter.js +2 -2
- package/build/testing/factory/model-contract.js +3 -3
- package/build/testing/factory/sequence.js +2 -2
- package/build/testing/factory/strategies/attributes-for.js +1 -1
- package/build/testing/factory/strategies/base.js +24 -24
- package/build/testing/factory/strategies/build.js +2 -2
- package/build/testing/factory/strategies/create.js +4 -4
- package/build/testing/test-files-finder.js +1 -1
- package/build/testing/test-runner.js +14 -14
- package/build/testing/test.js +19 -17
- package/build/testing/wait-for-event.js +5 -5
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/utils/event-emitter.js +1 -1
- package/build/utils/format-value.js +6 -6
- package/build/utils/is-date.js +1 -1
- package/build/utils/model-scope.js +10 -10
- package/build/utils/plain-object.js +2 -2
- package/build/utils/ransack.js +35 -35
- package/build/utils/with-tracked-stack-async-hooks.js +8 -8
- package/build/utils/with-tracked-stack.js +6 -6
- package/build/velocious-error.js +9 -3
- package/package.json +3 -3
- package/src/application.js +3 -3
- package/src/authorization/ability.js +6 -6
- package/src/authorization/base-resource.js +1 -1
- package/src/background-jobs/client.js +2 -2
- package/src/background-jobs/forked-runner-child.js +4 -4
- package/src/background-jobs/job-runner.js +2 -2
- package/src/background-jobs/job.js +6 -6
- package/src/background-jobs/json-socket.js +1 -1
- package/src/background-jobs/main.js +13 -13
- package/src/background-jobs/normalize-error.js +2 -2
- package/src/background-jobs/pooled-runner-child.js +3 -3
- package/src/background-jobs/scheduler.js +1 -1
- package/src/background-jobs/status-reporter.js +2 -2
- package/src/background-jobs/store.js +23 -23
- package/src/background-jobs/types.js +6 -6
- package/src/background-jobs/web/controller.js +6 -6
- package/src/background-jobs/web/counts-channel.js +1 -1
- package/src/background-jobs/worker.js +8 -8
- package/src/beacon/client.js +3 -3
- package/src/beacon/in-process-client.js +3 -3
- package/src/beacon/types.js +1 -1
- package/src/cli/base-command.js +1 -1
- package/src/cli/commands/console.js +1 -1
- package/src/cli/commands/db/schema/dump.js +1 -1
- package/src/cli/commands/db/schema/load.js +1 -1
- package/src/cli/commands/db/seed.js +1 -1
- package/src/cli/commands/generate/frontend-models.js +1 -1
- package/src/cli/commands/lint/relationships.js +1 -1
- package/src/cli/commands/run-script.js +1 -1
- package/src/cli/commands/runner.js +1 -1
- package/src/cli/index.js +2 -2
- package/src/cli/tenant-database-command-helper.js +2 -2
- package/src/configuration-types.js +48 -47
- package/src/configuration.js +150 -65
- package/src/controller.js +11 -8
- package/src/current.js +2 -2
- package/src/database/annotations-async-hooks.js +3 -3
- package/src/database/annotations.js +1 -1
- package/src/database/drivers/base-column.js +1 -1
- package/src/database/drivers/base-foreign-key.js +1 -1
- package/src/database/drivers/base-table.js +1 -1
- package/src/database/drivers/base.js +18 -18
- package/src/database/drivers/mssql/column.js +1 -1
- package/src/database/drivers/mssql/index.js +2 -2
- package/src/database/drivers/mssql/options.js +1 -1
- package/src/database/drivers/mssql/structure-sql.js +1 -1
- package/src/database/drivers/mssql/table.js +1 -1
- package/src/database/drivers/mysql/column.js +1 -1
- package/src/database/drivers/mysql/index.js +4 -4
- package/src/database/drivers/mysql/options.js +1 -1
- package/src/database/drivers/mysql/query.js +7 -7
- package/src/database/drivers/mysql/structure-sql.js +71 -10
- package/src/database/drivers/pgsql/column.js +1 -1
- package/src/database/drivers/pgsql/index.js +6 -6
- package/src/database/drivers/pgsql/structure-sql.js +1 -1
- package/src/database/drivers/sqlite/base.js +7 -7
- package/src/database/drivers/sqlite/column.js +1 -1
- package/src/database/drivers/sqlite/connection-sql-js.js +1 -1
- package/src/database/drivers/sqlite/foreign-key.js +1 -1
- package/src/database/drivers/sqlite/index.js +1 -1
- package/src/database/drivers/sqlite/index.native.js +2 -2
- package/src/database/drivers/sqlite/index.web.js +2 -2
- package/src/database/drivers/sqlite/query.js +2 -2
- package/src/database/drivers/sqlite/query.native.js +2 -2
- package/src/database/drivers/sqlite/query.web.js +2 -2
- package/src/database/drivers/sqlite/table-rebuilder.js +1 -1
- package/src/database/migration/index.js +2 -2
- package/src/database/migrator/types.js +2 -2
- package/src/database/operation.js +59 -6
- package/src/database/pool/async-tracked-multi-connection.js +75 -24
- package/src/database/pool/base-methods-forward.js +2 -2
- package/src/database/pool/base.js +48 -17
- package/src/database/pool/single-multi-use.js +501 -103
- package/src/database/query/delete-base.js +1 -1
- package/src/database/query/index.js +3 -3
- package/src/database/query/insert-base.js +4 -4
- package/src/database/query/model-class-query.js +39 -39
- package/src/database/query/preloader/belongs-to.js +2 -2
- package/src/database/query/preloader/ensure-model-class-initialized.js +3 -2
- package/src/database/query/preloader/has-many.js +3 -3
- package/src/database/query/preloader/has-one.js +1 -1
- package/src/database/query/preloader.js +9 -2
- package/src/database/query/query-data.js +7 -7
- package/src/database/query/update-base.js +3 -3
- package/src/database/query/upsert-base.js +2 -2
- package/src/database/query/where-model-class-hash.js +13 -13
- package/src/database/query/with-count.js +12 -12
- package/src/database/query-parser/options.js +2 -2
- package/src/database/query-parser/select-parser.js +1 -1
- package/src/database/record/acts-as-list.js +2 -2
- package/src/database/record/attachments/handle.js +6 -6
- package/src/database/record/attachments/normalize-input.js +11 -11
- package/src/database/record/attachments/storage-drivers/filesystem.js +1 -1
- package/src/database/record/attachments/storage-drivers/native.js +5 -5
- package/src/database/record/attachments/storage-drivers/s3.js +10 -10
- package/src/database/record/attachments/store.js +24 -20
- package/src/database/record/auditing.js +123 -29
- package/src/database/record/counter-cache-magnitude.js +11 -11
- package/src/database/record/index.js +227 -174
- package/src/database/record/instance-relationships/base.js +4 -4
- package/src/database/record/instance-relationships/belongs-to.js +1 -1
- package/src/database/record/instance-relationships/has-many.js +3 -3
- package/src/database/record/instance-relationships/has-one.js +1 -1
- package/src/database/record/record-not-found-error.js +1 -0
- package/src/database/record/relationships/base.js +22 -0
- package/src/database/record/state-machine.js +6 -6
- package/src/database/record/validators/base.js +1 -1
- package/src/database/structure-sql-loader.js +3 -3
- package/src/database/table-data/table-column.js +3 -3
- package/src/database/use-live-query.js +3 -3
- package/src/environment-handlers/base.js +56 -37
- package/src/environment-handlers/browser.js +1 -1
- package/src/environment-handlers/node/cli/commands/console.js +4 -4
- package/src/environment-handlers/node/cli/commands/db/seed.js +2 -2
- package/src/environment-handlers/node/cli/commands/generate/base-models.js +1 -1
- package/src/environment-handlers/node/cli/commands/run-script.js +2 -2
- package/src/environment-handlers/node/cli/commands/runner.js +2 -2
- package/src/environment-handlers/node/cli/commands/server.js +1 -1
- package/src/environment-handlers/node.js +36 -36
- package/src/error-logger.js +2 -2
- package/src/error-reporting/request-details.js +32 -32
- package/src/frontend-model-controller.js +215 -213
- package/src/frontend-model-resource/base-resource.js +44 -44
- package/src/frontend-model-resource/velocious-attachment-resource.js +1 -1
- package/src/frontend-models/base.js +146 -142
- package/src/frontend-models/clear-pending-debounced-callback.js +2 -2
- package/src/frontend-models/model-registry.js +4 -4
- package/src/frontend-models/outgoing-event-buffer.js +1 -1
- package/src/frontend-models/preloader.js +1 -1
- package/src/frontend-models/query.js +60 -60
- package/src/frontend-models/resource-definition.js +9 -9
- package/src/frontend-models/transport-serialization.js +27 -27
- package/src/frontend-models/websocket-channel.js +4 -4
- package/src/frontend-models/websocket-publishers.js +1 -1
- package/src/http-client/request.js +1 -1
- package/src/http-client/response.js +1 -1
- package/src/http-server/client/index.js +4 -4
- package/src/http-server/client/params-to-object.js +16 -16
- package/src/http-server/client/request-buffer/index.js +5 -2
- package/src/http-server/client/request-parser.js +2 -2
- package/src/http-server/client/request-runner.js +2 -2
- package/src/http-server/client/request.js +2 -2
- package/src/http-server/client/websocket-request.js +6 -6
- package/src/http-server/client/websocket-session.js +28 -28
- package/src/http-server/cookie.js +2 -2
- package/src/http-server/development-reloader.js +1 -1
- package/src/http-server/index.js +5 -5
- package/src/http-server/remote-address.js +1 -1
- package/src/http-server/server-lock.js +4 -4
- package/src/http-server/websocket-channel-subscribers.js +4 -4
- package/src/http-server/websocket-channel.js +1 -1
- package/src/http-server/websocket-connection.js +3 -3
- package/src/http-server/websocket-event-log-store.js +9 -9
- package/src/http-server/websocket-events-host.js +7 -7
- package/src/http-server/websocket-events.js +4 -4
- package/src/http-server/worker-handler/channel-subscriber-dispatch.js +1 -1
- package/src/http-server/worker-handler/in-process.js +5 -5
- package/src/http-server/worker-handler/index.js +10 -10
- package/src/http-server/worker-handler/worker-thread.js +8 -8
- package/src/logger/base-logger.js +1 -1
- package/src/logger.js +12 -12
- package/src/mailer/backends/smtp.js +3 -3
- package/src/mailer/base.js +14 -14
- package/src/mailer/delivery.js +3 -3
- package/src/mailer/index.js +1 -1
- package/src/mailer.js +1 -1
- package/src/plugins/sqljs-wasm-route-controller.js +1 -1
- package/src/record-payload-values.js +3 -3
- package/src/routes/base-route.js +5 -5
- package/src/routes/basic-route.js +4 -4
- package/src/routes/get-route.js +2 -2
- package/src/routes/hooks/frontend-model-command-route-hook.js +1 -1
- package/src/routes/index.js +3 -3
- package/src/routes/namespace-route.js +1 -1
- package/src/routes/plugin-routes.js +1 -1
- package/src/routes/post-route.js +2 -2
- package/src/routes/resolver.js +5 -5
- package/src/routes/resource-route.js +1 -1
- package/src/sync/conflict-strategy.js +1 -1
- package/src/sync/query-scope.js +7 -7
- package/src/sync/server-change-feed.js +13 -13
- package/src/sync/server-sequence-allocator.js +5 -5
- package/src/sync/signed-sync-envelope-replay-service.js +20 -20
- package/src/sync/stable-json.js +4 -4
- package/src/sync/sync-api-client-types.js +7 -7
- package/src/sync/sync-api-client.js +26 -26
- package/src/sync/sync-change-fanout.js +6 -6
- package/src/sync/sync-client-registry.js +3 -3
- package/src/sync/sync-client-types.js +10 -10
- package/src/sync/sync-client.js +18 -18
- package/src/sync/sync-envelope-replay-service.js +76 -76
- package/src/sync/sync-model-change-feed-service.js +7 -7
- package/src/sync/sync-publish-suppression.js +2 -2
- package/src/sync/sync-publisher-types.js +11 -11
- package/src/sync/sync-publisher.js +19 -19
- package/src/sync/sync-realtime-bridge.js +8 -8
- package/src/sync/sync-replay-upsert-applier.js +16 -16
- package/src/sync/sync-resource-base.js +14 -14
- package/src/sync/sync-scope-attributes.js +1 -1
- package/src/sync/sync-scope-store.js +5 -5
- package/src/sync/sync-websocket-channel.js +5 -5
- package/src/tenants/default-tenant-database-provisioning.js +1 -1
- package/src/tenants/tenant-aggregator.js +13 -13
- package/src/tenants/tenant-handle.js +252 -0
- package/src/tenants/tenant-iterator.js +6 -6
- package/src/tenants/tenant-model-scope.js +132 -0
- package/src/tenants/tenant.js +15 -2
- package/src/testing/browser-test-app.js +2 -2
- package/src/testing/expect-to-change.js +1 -1
- package/src/testing/expect-utils.js +29 -29
- package/src/testing/expect.js +18 -18
- package/src/testing/factory/association-declaration.js +2 -2
- package/src/testing/factory/declarations.js +5 -5
- package/src/testing/factory/definition-builder.js +39 -39
- package/src/testing/factory/evaluation-context.js +16 -16
- package/src/testing/factory/factory-definition.js +2 -2
- package/src/testing/factory/factory-registry.js +34 -34
- package/src/testing/factory/factory-runner.js +8 -8
- package/src/testing/factory/linter.js +2 -2
- package/src/testing/factory/model-contract.js +3 -3
- package/src/testing/factory/sequence.js +2 -2
- package/src/testing/factory/strategies/attributes-for.js +1 -1
- package/src/testing/factory/strategies/base.js +24 -24
- package/src/testing/factory/strategies/build.js +2 -2
- package/src/testing/factory/strategies/create.js +4 -4
- package/src/testing/test-files-finder.js +1 -1
- package/src/testing/test-runner.js +14 -14
- package/src/testing/test.js +19 -17
- package/src/testing/wait-for-event.js +5 -5
- package/src/utils/event-emitter.js +1 -1
- package/src/utils/format-value.js +6 -6
- package/src/utils/is-date.js +1 -1
- package/src/utils/model-scope.js +10 -10
- package/src/utils/plain-object.js +2 -2
- package/src/utils/ransack.js +35 -35
- package/src/utils/with-tracked-stack-async-hooks.js +8 -8
- package/src/utils/with-tracked-stack.js +6 -6
- package/src/velocious-error.js +9 -3
|
@@ -55,11 +55,12 @@ import ValidatorsLength from "./validators/length.js"
|
|
|
55
55
|
import ValidatorsPresence from "./validators/presence.js"
|
|
56
56
|
import ValidatorsUniqueness from "./validators/uniqueness.js"
|
|
57
57
|
import registerActsAsListCallbacks from "./acts-as-list.js"
|
|
58
|
+
import TenantModelScope from "../../tenants/tenant-model-scope.js"
|
|
58
59
|
import UUID from "pure-uuid"
|
|
59
60
|
|
|
60
61
|
/**
|
|
61
62
|
* Translation record shape used by translated attributes.
|
|
62
|
-
* @typedef {VelociousDatabaseRecord & {locale:
|
|
63
|
+
* @typedef {VelociousDatabaseRecord & {locale: () => string}} TranslationBase
|
|
63
64
|
*/
|
|
64
65
|
/**
|
|
65
66
|
* AttachmentDriverConstructor type.
|
|
@@ -75,7 +76,7 @@ const declaredBooleanFalsyValues = new Set([0, false, "0"])
|
|
|
75
76
|
class ValidationError extends Error {
|
|
76
77
|
/**
|
|
77
78
|
* Narrows the runtime value to the documented type.
|
|
78
|
-
* @type {Record<string,
|
|
79
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>> | undefined} - Velocious metadata for frontend-model error reporting.
|
|
79
80
|
*/
|
|
80
81
|
velocious
|
|
81
82
|
|
|
@@ -150,9 +151,9 @@ function applyBuiltRecordInverseRelationship({allowHasMany, inverseOf, parent, r
|
|
|
150
151
|
* Build a related record and wire its inverse relationship to the parent.
|
|
151
152
|
* @param {VelociousDatabaseRecord} parent - Parent record building the relationship.
|
|
152
153
|
* @param {string} relationshipName - Relationship name being built.
|
|
153
|
-
* @param {Record<string,
|
|
154
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} attributes - Attributes for the new related record.
|
|
154
155
|
* @param {boolean} allowHasMany - Whether has-many inverse relationships should append the parent.
|
|
155
|
-
* @returns {Record<string,
|
|
156
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Built related record.
|
|
156
157
|
*/
|
|
157
158
|
function buildRelatedRecordWithInverse(parent, relationshipName, attributes, allowHasMany) {
|
|
158
159
|
const instanceRelationship = parent.getRelationshipByName(relationshipName)
|
|
@@ -184,9 +185,38 @@ class TenantDatabaseScopeError extends Error {
|
|
|
184
185
|
|
|
185
186
|
/**
|
|
186
187
|
* Base database record.
|
|
187
|
-
* @template {Record<string,
|
|
188
|
+
* @template {Record<string, ReturnType<typeof JSON.parse>>} [WriteAttributes=Record<string, ReturnType<typeof JSON.parse>>]
|
|
188
189
|
*/
|
|
189
190
|
class VelociousDatabaseRecord {
|
|
191
|
+
/** @type {Record<string, string> | undefined} */
|
|
192
|
+
static _attributeNameToColumnName = undefined
|
|
193
|
+
/** @type {Record<string, string> | undefined} */
|
|
194
|
+
static _columnNameToAttributeName = undefined
|
|
195
|
+
/** @type {Record<string, object> | undefined} */
|
|
196
|
+
static _translations = undefined
|
|
197
|
+
/** @type {Record<string, import("./validators/base.js").default[]> | undefined} */
|
|
198
|
+
static _validators = undefined
|
|
199
|
+
/** @type {Record<string, LifecycleCallbackType[]> | undefined} */
|
|
200
|
+
static _lifecycleCallbacks = undefined
|
|
201
|
+
/** @type {Record<string, typeof import("./validators/base.js").default> | undefined} */
|
|
202
|
+
static _validatorTypes = undefined
|
|
203
|
+
/** @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}> | undefined} */
|
|
204
|
+
static _attachmentsMap = undefined
|
|
205
|
+
/** @type {Record<string, import("./relationships/base.js").default> | undefined} */
|
|
206
|
+
static _relationships = undefined
|
|
207
|
+
/** @type {Record<string, import("../query/query-data.js").QueryDataFn> | undefined} */
|
|
208
|
+
static _queryDataRegistrations = undefined
|
|
209
|
+
/** @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}> | undefined} */
|
|
210
|
+
static _acceptedNestedAttributes = undefined
|
|
211
|
+
/** @type {Record<string, string> | undefined} */
|
|
212
|
+
static _attributeCasts = undefined
|
|
213
|
+
/** @type {Record<string, import("../drivers/base-column.js").default> | undefined} */
|
|
214
|
+
static _columnsAsHash = undefined
|
|
215
|
+
/** @type {Array<string> | undefined} */
|
|
216
|
+
static _columnNames = undefined
|
|
217
|
+
/** @type {Record<string, string> | undefined} */
|
|
218
|
+
static _columnTypeByName = undefined
|
|
219
|
+
|
|
190
220
|
/**
|
|
191
221
|
* Narrows the runtime value to the documented type.
|
|
192
222
|
* @type {string | undefined} */
|
|
@@ -323,8 +353,8 @@ class VelociousDatabaseRecord {
|
|
|
323
353
|
|
|
324
354
|
/**
|
|
325
355
|
* Runs define scope.
|
|
326
|
-
* @param {(...args: Array
|
|
327
|
-
* @returns {((...args: Array
|
|
356
|
+
* @param {(...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>} callback - Scope callback.
|
|
357
|
+
* @returns {((...args: Array<ReturnType<typeof JSON.parse>>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
|
|
328
358
|
*/
|
|
329
359
|
static defineScope(callback) {
|
|
330
360
|
return defineModelScope({
|
|
@@ -395,13 +425,13 @@ class VelociousDatabaseRecord {
|
|
|
395
425
|
|
|
396
426
|
/**
|
|
397
427
|
* Runs get attachments map.
|
|
398
|
-
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string,
|
|
428
|
+
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions keyed by name.
|
|
399
429
|
*/
|
|
400
430
|
static getAttachmentsMap() {
|
|
401
431
|
if (!this._attachmentsMap) {
|
|
402
432
|
/**
|
|
403
433
|
* Narrows the runtime value to the documented type.
|
|
404
|
-
* @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string,
|
|
434
|
+
* @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} */
|
|
405
435
|
this._attachmentsMap = {}
|
|
406
436
|
}
|
|
407
437
|
|
|
@@ -410,12 +440,12 @@ class VelociousDatabaseRecord {
|
|
|
410
440
|
|
|
411
441
|
/**
|
|
412
442
|
* Attributes.
|
|
413
|
-
* @type {Record<string,
|
|
443
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
414
444
|
_attributes = {}
|
|
415
445
|
|
|
416
446
|
/**
|
|
417
447
|
* Changes.
|
|
418
|
-
* @type {Record<string,
|
|
448
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
419
449
|
_changes = {}
|
|
420
450
|
|
|
421
451
|
/**
|
|
@@ -759,7 +789,7 @@ class VelociousDatabaseRecord {
|
|
|
759
789
|
}
|
|
760
790
|
|
|
761
791
|
let relationship
|
|
762
|
-
const prototype = /** @type {Record<string,
|
|
792
|
+
const prototype = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this.prototype))
|
|
763
793
|
|
|
764
794
|
if (actualData.type == "belongsTo") {
|
|
765
795
|
relationship = new BelongsToRelationship(actualData)
|
|
@@ -770,7 +800,7 @@ class VelociousDatabaseRecord {
|
|
|
770
800
|
return relationship.loaded()
|
|
771
801
|
}
|
|
772
802
|
|
|
773
|
-
prototype[`build${inflection.camelize(relationshipName)}`] = function(/** @type {Record<string,
|
|
803
|
+
prototype[`build${inflection.camelize(relationshipName)}`] = function(/** @type {Record<string, ReturnType<typeof JSON.parse>>} */ attributes) {
|
|
774
804
|
return buildRelatedRecordWithInverse(/** @type {VelociousDatabaseRecord} */ (this), relationshipName, attributes, true)
|
|
775
805
|
}
|
|
776
806
|
|
|
@@ -795,7 +825,7 @@ class VelociousDatabaseRecord {
|
|
|
795
825
|
relationship = new HasManyRelationship(actualData)
|
|
796
826
|
|
|
797
827
|
prototype[relationshipName] = function() {
|
|
798
|
-
return /** @type {import("./instance-relationships/has-many.js").default
|
|
828
|
+
return /** @type {import("./instance-relationships/has-many.js").default<ReturnType<typeof JSON.parse>, ReturnType<typeof JSON.parse>>} */ (this.getRelationshipByName(relationshipName))
|
|
799
829
|
}
|
|
800
830
|
|
|
801
831
|
prototype[`${relationshipName}Loaded`] = function() {
|
|
@@ -816,7 +846,7 @@ class VelociousDatabaseRecord {
|
|
|
816
846
|
return this.getRelationshipByName(relationshipName).loaded()
|
|
817
847
|
}
|
|
818
848
|
|
|
819
|
-
prototype[`build${inflection.camelize(relationshipName)}`] = function(/** @type {Record<string,
|
|
849
|
+
prototype[`build${inflection.camelize(relationshipName)}`] = function(/** @type {Record<string, ReturnType<typeof JSON.parse>>} */ attributes) {
|
|
820
850
|
return buildRelatedRecordWithInverse(/** @type {VelociousDatabaseRecord} */ (this), relationshipName, attributes, false)
|
|
821
851
|
}
|
|
822
852
|
|
|
@@ -898,8 +928,8 @@ class VelociousDatabaseRecord {
|
|
|
898
928
|
|
|
899
929
|
/**
|
|
900
930
|
* Runs read fk attribute.
|
|
901
|
-
* @param {
|
|
902
|
-
* @returns {
|
|
931
|
+
* @param {ReturnType<typeof JSON.parse>} record - Child record instance.
|
|
932
|
+
* @returns {ReturnType<typeof JSON.parse>} - Current foreign-key attribute value.
|
|
903
933
|
*/
|
|
904
934
|
function readFkAttribute(record) {
|
|
905
935
|
const relationship = ChildModel.getRelationshipByName(relationshipName)
|
|
@@ -917,7 +947,7 @@ class VelociousDatabaseRecord {
|
|
|
917
947
|
})
|
|
918
948
|
|
|
919
949
|
ChildModel.beforeSave(async (record) => {
|
|
920
|
-
const model = /** @type {
|
|
950
|
+
const model = /** @type {ReturnType<typeof JSON.parse>} */ (record)
|
|
921
951
|
|
|
922
952
|
if (model.isNewRecord()) return
|
|
923
953
|
|
|
@@ -934,7 +964,7 @@ class VelociousDatabaseRecord {
|
|
|
934
964
|
})
|
|
935
965
|
|
|
936
966
|
ChildModel.afterSave(async (record) => {
|
|
937
|
-
const model = /** @type {
|
|
967
|
+
const model = /** @type {ReturnType<typeof JSON.parse>} */ (record)
|
|
938
968
|
const prevKey = `_counterCachePrev_${relationshipName}`
|
|
939
969
|
const previousParentId = model[prevKey]
|
|
940
970
|
|
|
@@ -972,7 +1002,7 @@ class VelociousDatabaseRecord {
|
|
|
972
1002
|
* @returns {Record<string, import("./relationships/base.js").default>} - Relationship definitions keyed by name.
|
|
973
1003
|
*/
|
|
974
1004
|
static getRelationshipsMap() {
|
|
975
|
-
if (!Object.hasOwn(this, "_relationships")) {
|
|
1005
|
+
if (!Object.hasOwn(this, "_relationships") || !this._relationships) {
|
|
976
1006
|
/**
|
|
977
1007
|
* Narrows the runtime value to the documented type.
|
|
978
1008
|
* @type {Record<string, import("./relationships/base.js").default>} */
|
|
@@ -1037,7 +1067,7 @@ class VelociousDatabaseRecord {
|
|
|
1037
1067
|
* @returns {Record<string, import("../query/query-data.js").QueryDataFn>} - queryData registrations keyed by name.
|
|
1038
1068
|
*/
|
|
1039
1069
|
static getQueryDataMap() {
|
|
1040
|
-
if (!Object.hasOwn(this, "_queryDataRegistrations")) {
|
|
1070
|
+
if (!Object.hasOwn(this, "_queryDataRegistrations") || !this._queryDataRegistrations) {
|
|
1041
1071
|
// Prototype-less map so bracket access can only ever surface
|
|
1042
1072
|
// registrations actually made on this class — never inherited
|
|
1043
1073
|
// Object.prototype members.
|
|
@@ -1066,7 +1096,7 @@ class VelociousDatabaseRecord {
|
|
|
1066
1096
|
|
|
1067
1097
|
/**
|
|
1068
1098
|
* Runs get attachments.
|
|
1069
|
-
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string,
|
|
1099
|
+
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions.
|
|
1070
1100
|
*/
|
|
1071
1101
|
static getAttachments() {
|
|
1072
1102
|
return this.getAttachmentsMap()
|
|
@@ -1075,7 +1105,7 @@ class VelociousDatabaseRecord {
|
|
|
1075
1105
|
/**
|
|
1076
1106
|
* Runs get attachment by name.
|
|
1077
1107
|
* @param {string} attachmentName - Attachment name.
|
|
1078
|
-
* @returns {{driver?: string | AttachmentDriverConstructor | Record<string,
|
|
1108
|
+
* @returns {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}} - Attachment definition.
|
|
1079
1109
|
*/
|
|
1080
1110
|
static getAttachmentByName(attachmentName) {
|
|
1081
1111
|
const definition = this.getAttachmentsMap()[attachmentName]
|
|
@@ -1092,7 +1122,9 @@ class VelociousDatabaseRecord {
|
|
|
1092
1122
|
*/
|
|
1093
1123
|
getRelationshipByName(relationshipName) {
|
|
1094
1124
|
if (!(relationshipName in this._instanceRelationships)) {
|
|
1095
|
-
const modelClassRelationship = this.getModelClass()
|
|
1125
|
+
const modelClassRelationship = this.getModelClass()
|
|
1126
|
+
.getRelationshipByName(relationshipName)
|
|
1127
|
+
.resolveForRecord(this)
|
|
1096
1128
|
const relationshipType = modelClassRelationship.getType()
|
|
1097
1129
|
let instanceRelationship
|
|
1098
1130
|
|
|
@@ -1130,7 +1162,7 @@ class VelociousDatabaseRecord {
|
|
|
1130
1162
|
/**
|
|
1131
1163
|
* Runs load relationship.
|
|
1132
1164
|
* @param {string} relationshipName - Relationship name.
|
|
1133
|
-
* @returns {Promise
|
|
1165
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
|
|
1134
1166
|
*/
|
|
1135
1167
|
async loadRelationship(relationshipName) {
|
|
1136
1168
|
const relationship = this.getRelationshipByName(relationshipName)
|
|
@@ -1144,7 +1176,7 @@ class VelociousDatabaseRecord {
|
|
|
1144
1176
|
* Runs relationship or load.
|
|
1145
1177
|
* @param {string} relationshipName - Relationship name.
|
|
1146
1178
|
* @param {{preloadTranslations?: boolean}} [options] - Load options.
|
|
1147
|
-
* @returns {Promise
|
|
1179
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
|
|
1148
1180
|
*/
|
|
1149
1181
|
async relationshipOrLoad(relationshipName, options = {}) {
|
|
1150
1182
|
const relationship = this.getRelationshipByName(relationshipName)
|
|
@@ -1159,8 +1191,8 @@ class VelociousDatabaseRecord {
|
|
|
1159
1191
|
|
|
1160
1192
|
/**
|
|
1161
1193
|
* Preloads translations on a loaded relationship target when explicitly requested.
|
|
1162
|
-
* @param {
|
|
1163
|
-
* @returns {Promise
|
|
1194
|
+
* @param {ReturnType<typeof JSON.parse>} loaded - Loaded relationship value.
|
|
1195
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Relationship value after translation preload.
|
|
1164
1196
|
*/
|
|
1165
1197
|
async _preloadLoadedRelationshipTranslations(loaded) {
|
|
1166
1198
|
if (!loaded || !loaded.isPersisted() || !await loaded.getModelClass().hasTranslationsTable()) return loaded
|
|
@@ -1204,7 +1236,7 @@ class VelociousDatabaseRecord {
|
|
|
1204
1236
|
|
|
1205
1237
|
this._defineRelationship(relationshipName, Object.assign({type: "belongsTo", scope}, relationshipOptions))
|
|
1206
1238
|
|
|
1207
|
-
if (/** @type {
|
|
1239
|
+
if (/** @type {ReturnType<typeof JSON.parse>} */ (relationshipOptions)?.counterCache) {
|
|
1208
1240
|
this._registerCounterCacheCallbacks(relationshipName)
|
|
1209
1241
|
}
|
|
1210
1242
|
}
|
|
@@ -1228,7 +1260,7 @@ class VelociousDatabaseRecord {
|
|
|
1228
1260
|
|
|
1229
1261
|
/**
|
|
1230
1262
|
* Runs create.
|
|
1231
|
-
* @template {Record<string,
|
|
1263
|
+
* @template {Record<string, ReturnType<typeof JSON.parse>>} CreateAttributes
|
|
1232
1264
|
* @template {VelociousDatabaseRecord<CreateAttributes>} Model
|
|
1233
1265
|
* @this {{new (changes?: CreateAttributes): Model} & typeof VelociousDatabaseRecord}
|
|
1234
1266
|
* @param {CreateAttributes} [attributes] - Attributes.
|
|
@@ -1297,7 +1329,7 @@ class VelociousDatabaseRecord {
|
|
|
1297
1329
|
* Project.hasMany("tasks")
|
|
1298
1330
|
* Project.acceptsNestedAttributesFor("tasks", {allowDestroy: true})
|
|
1299
1331
|
* @param {string} relationshipName - Relationship name on this model.
|
|
1300
|
-
* @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string,
|
|
1332
|
+
* @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}} [options] - Policy options.
|
|
1301
1333
|
* @returns {void}
|
|
1302
1334
|
*/
|
|
1303
1335
|
static acceptsNestedAttributesFor(relationshipName, options = {}) {
|
|
@@ -1308,17 +1340,17 @@ class VelociousDatabaseRecord {
|
|
|
1308
1340
|
if (!Object.prototype.hasOwnProperty.call(this, "_acceptedNestedAttributes")) {
|
|
1309
1341
|
/**
|
|
1310
1342
|
* Narrows the runtime value to the documented type.
|
|
1311
|
-
* @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string,
|
|
1343
|
+
* @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}>} */
|
|
1312
1344
|
this._acceptedNestedAttributes = {}
|
|
1313
1345
|
}
|
|
1314
1346
|
|
|
1315
|
-
/** @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string,
|
|
1347
|
+
/** @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}>} */ (this._acceptedNestedAttributes)[relationshipName] = {...options}
|
|
1316
1348
|
}
|
|
1317
1349
|
|
|
1318
1350
|
/**
|
|
1319
1351
|
* Runs accepted nested attributes for.
|
|
1320
1352
|
* @param {string} relationshipName - Relationship name.
|
|
1321
|
-
* @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string,
|
|
1353
|
+
* @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean} | null} - Policy declared via `acceptsNestedAttributesFor`, or null when not accepted.
|
|
1322
1354
|
*/
|
|
1323
1355
|
static acceptedNestedAttributesFor(relationshipName) {
|
|
1324
1356
|
return this._acceptedNestedAttributes?.[relationshipName] || null
|
|
@@ -1341,7 +1373,7 @@ class VelociousDatabaseRecord {
|
|
|
1341
1373
|
* Runs define attachment.
|
|
1342
1374
|
* @param {string} attachmentName - Attachment name.
|
|
1343
1375
|
* @param {object} args - Attachment args.
|
|
1344
|
-
* @param {string | AttachmentDriverConstructor | Record<string,
|
|
1376
|
+
* @param {string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>} [args.driver] - Attachment driver name, class, or instance.
|
|
1345
1377
|
* @param {"hasOne" | "hasMany"} args.type - Attachment type.
|
|
1346
1378
|
* @returns {void} - No return value.
|
|
1347
1379
|
*/
|
|
@@ -1351,13 +1383,13 @@ class VelociousDatabaseRecord {
|
|
|
1351
1383
|
|
|
1352
1384
|
this.getAttachmentsMap()[attachmentName] = {driver, type}
|
|
1353
1385
|
|
|
1354
|
-
const prototype = /** @type {Record<string,
|
|
1386
|
+
const prototype = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this.prototype))
|
|
1355
1387
|
|
|
1356
1388
|
prototype[attachmentName] = function() {
|
|
1357
1389
|
return this.getAttachmentByName(attachmentName)
|
|
1358
1390
|
}
|
|
1359
1391
|
|
|
1360
|
-
prototype[`set${inflection.camelize(attachmentName)}`] = function(/** @type {
|
|
1392
|
+
prototype[`set${inflection.camelize(attachmentName)}`] = function(/** @type {ReturnType<typeof JSON.parse>} */ newValue) {
|
|
1361
1393
|
this.getAttachmentByName(attachmentName).queueAttach(newValue)
|
|
1362
1394
|
return newValue
|
|
1363
1395
|
}
|
|
@@ -1366,7 +1398,7 @@ class VelociousDatabaseRecord {
|
|
|
1366
1398
|
/**
|
|
1367
1399
|
* Adds a single attachment helper to the model.
|
|
1368
1400
|
* @param {string} attachmentName - Attachment name.
|
|
1369
|
-
* @param {{driver?: string | AttachmentDriverConstructor | Record<string,
|
|
1401
|
+
* @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
|
|
1370
1402
|
* @returns {void} - No return value.
|
|
1371
1403
|
*/
|
|
1372
1404
|
static hasOneAttachment(attachmentName, args = {}) {
|
|
@@ -1376,7 +1408,7 @@ class VelociousDatabaseRecord {
|
|
|
1376
1408
|
/**
|
|
1377
1409
|
* Adds a collection attachment helper to the model.
|
|
1378
1410
|
* @param {string} attachmentName - Attachment name.
|
|
1379
|
-
* @param {{driver?: string | AttachmentDriverConstructor | Record<string,
|
|
1411
|
+
* @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
|
|
1380
1412
|
* @returns {void} - No return value.
|
|
1381
1413
|
*/
|
|
1382
1414
|
static hasManyAttachments(attachmentName, args = {}) {
|
|
@@ -1483,7 +1515,7 @@ class VelociousDatabaseRecord {
|
|
|
1483
1515
|
|
|
1484
1516
|
const columnNameToAttributeName = this.getColumnNameToAttributeNameMap()
|
|
1485
1517
|
const attributeNameToColumnName = this.getAttributeNameToColumnNameMap()
|
|
1486
|
-
const prototype = /** @type {Record<string,
|
|
1518
|
+
const prototype = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this.prototype))
|
|
1487
1519
|
|
|
1488
1520
|
for (const column of this._columns) {
|
|
1489
1521
|
this._columnsAsHash[column.getName()] = column
|
|
@@ -1502,14 +1534,14 @@ class VelociousDatabaseRecord {
|
|
|
1502
1534
|
}
|
|
1503
1535
|
|
|
1504
1536
|
if (!(`set${camelizedColumnNameBigFirst}` in prototype)) {
|
|
1505
|
-
prototype[`set${camelizedColumnNameBigFirst}`] = function(/** @type {
|
|
1537
|
+
prototype[`set${camelizedColumnNameBigFirst}`] = function(/** @type {ReturnType<typeof JSON.parse>} */ newValue) {
|
|
1506
1538
|
return this._setColumnAttribute(camelizedColumnName, newValue)
|
|
1507
1539
|
}
|
|
1508
1540
|
}
|
|
1509
1541
|
|
|
1510
1542
|
if (!(`has${camelizedColumnNameBigFirst}` in prototype)) {
|
|
1511
1543
|
prototype[`has${camelizedColumnNameBigFirst}`] = function() {
|
|
1512
|
-
const dynamicThis = /** @type {Record<string, (...args: Array
|
|
1544
|
+
const dynamicThis = /** @type {Record<string, (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
1513
1545
|
const value = dynamicThis[camelizedColumnName]()
|
|
1514
1546
|
|
|
1515
1547
|
return this._hasAttribute(value)
|
|
@@ -1517,7 +1549,7 @@ class VelociousDatabaseRecord {
|
|
|
1517
1549
|
}
|
|
1518
1550
|
}
|
|
1519
1551
|
|
|
1520
|
-
await this._defineTranslationMethods()
|
|
1552
|
+
await this._defineTranslationMethods(connection)
|
|
1521
1553
|
await initializeAuditing(this)
|
|
1522
1554
|
this._initialized = true
|
|
1523
1555
|
}
|
|
@@ -1526,11 +1558,11 @@ class VelociousDatabaseRecord {
|
|
|
1526
1558
|
* Initializes the model class the first time an async record API needs table
|
|
1527
1559
|
* metadata. Concurrent callers share the same initialization promise, and a
|
|
1528
1560
|
* failed initialization can be retried by a later call.
|
|
1529
|
-
* @param {{configuration?: import("../../configuration.js").default}} [args] - Optional configuration
|
|
1561
|
+
* @param {{configuration?: import("../../configuration.js").default, connection?: import("../drivers/base.js").default}} [args] - Optional configuration and explicit metadata connection.
|
|
1530
1562
|
* @returns {Promise<void>} - Resolves when the model class is initialized.
|
|
1531
1563
|
*/
|
|
1532
1564
|
static async ensureInitialized(args = {}) {
|
|
1533
|
-
const {configuration, ...restArgs} = args
|
|
1565
|
+
const {configuration, connection, ...restArgs} = args
|
|
1534
1566
|
|
|
1535
1567
|
restArgsError(restArgs)
|
|
1536
1568
|
|
|
@@ -1543,7 +1575,7 @@ class VelociousDatabaseRecord {
|
|
|
1543
1575
|
|
|
1544
1576
|
const resolvedConfiguration = configuration || this._configuration || Configuration.current()
|
|
1545
1577
|
|
|
1546
|
-
const initializeRecordPromise = this.initializeRecord({configuration: resolvedConfiguration})
|
|
1578
|
+
const initializeRecordPromise = this.initializeRecord({configuration: resolvedConfiguration, connection})
|
|
1547
1579
|
|
|
1548
1580
|
this._initializeRecordPromise = initializeRecordPromise
|
|
1549
1581
|
|
|
@@ -1558,7 +1590,7 @@ class VelociousDatabaseRecord {
|
|
|
1558
1590
|
|
|
1559
1591
|
/**
|
|
1560
1592
|
* Runs has attribute.
|
|
1561
|
-
* @param {
|
|
1593
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to use.
|
|
1562
1594
|
* @returns {boolean} - Whether attribute.
|
|
1563
1595
|
*/
|
|
1564
1596
|
_hasAttribute(value) {
|
|
@@ -1593,18 +1625,27 @@ class VelociousDatabaseRecord {
|
|
|
1593
1625
|
throw new Error(`${this.name} used before initialization. Call ${this.name}.initializeRecord(...) or configuration.initialize().`)
|
|
1594
1626
|
}
|
|
1595
1627
|
|
|
1596
|
-
|
|
1628
|
+
/**
|
|
1629
|
+
* Defines translation accessors and initializes the generated translation
|
|
1630
|
+
* class through the same metadata connection as the translated model.
|
|
1631
|
+
* @param {import("../drivers/base.js").default} connection - Metadata connection.
|
|
1632
|
+
* @returns {Promise<void>} - Resolves when translation metadata is ready.
|
|
1633
|
+
*/
|
|
1634
|
+
static async _defineTranslationMethods(connection) {
|
|
1597
1635
|
if (this._translations && Object.keys(this._translations).length > 0) {
|
|
1598
1636
|
const locales = this._getConfiguration().getLocales()
|
|
1599
1637
|
|
|
1600
1638
|
if (!locales) throw new Error("Locales hasn't been set in the configuration")
|
|
1601
1639
|
|
|
1602
|
-
await this.getTranslationClass().initializeRecord({
|
|
1640
|
+
await this.getTranslationClass().initializeRecord({
|
|
1641
|
+
configuration: this._getConfiguration(),
|
|
1642
|
+
connection
|
|
1643
|
+
})
|
|
1603
1644
|
|
|
1604
1645
|
for (const name in this._translations) {
|
|
1605
1646
|
const nameCamelized = inflection.camelize(name)
|
|
1606
1647
|
const setterMethodName = `set${nameCamelized}`
|
|
1607
|
-
const prototype = /** @type {Record<string,
|
|
1648
|
+
const prototype = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this.prototype))
|
|
1608
1649
|
|
|
1609
1650
|
prototype[name] = function getTranslatedAttribute() {
|
|
1610
1651
|
const locale = this._getConfiguration().getLocale()
|
|
@@ -1613,7 +1654,7 @@ class VelociousDatabaseRecord {
|
|
|
1613
1654
|
}
|
|
1614
1655
|
|
|
1615
1656
|
prototype[`has${nameCamelized}`] = function hasTranslatedAttribute() {
|
|
1616
|
-
const dynamicThis = /** @type {Record<string,
|
|
1657
|
+
const dynamicThis = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
1617
1658
|
const candidate = dynamicThis[name]
|
|
1618
1659
|
|
|
1619
1660
|
if (typeof candidate == "function") {
|
|
@@ -1625,7 +1666,7 @@ class VelociousDatabaseRecord {
|
|
|
1625
1666
|
}
|
|
1626
1667
|
}
|
|
1627
1668
|
|
|
1628
|
-
prototype[setterMethodName] = function setTranslatedAttribute(/** @type {
|
|
1669
|
+
prototype[setterMethodName] = function setTranslatedAttribute(/** @type {ReturnType<typeof JSON.parse>} */ newValue) {
|
|
1629
1670
|
const locale = this._getConfiguration().getLocale()
|
|
1630
1671
|
|
|
1631
1672
|
return this._setTranslatedAttribute(name, locale, newValue)
|
|
@@ -1641,12 +1682,12 @@ class VelociousDatabaseRecord {
|
|
|
1641
1682
|
return this._getTranslatedAttribute(name, locale)
|
|
1642
1683
|
}
|
|
1643
1684
|
|
|
1644
|
-
prototype[setterMethodNameLocalized] = function setTranslatedAttributeWithLocale(/** @type {
|
|
1685
|
+
prototype[setterMethodNameLocalized] = function setTranslatedAttributeWithLocale(/** @type {ReturnType<typeof JSON.parse>} */ newValue) {
|
|
1645
1686
|
return this._setTranslatedAttribute(name, locale, newValue)
|
|
1646
1687
|
}
|
|
1647
1688
|
|
|
1648
1689
|
prototype[hasMethodNameLocalized] = function hasTranslatedAttribute() {
|
|
1649
|
-
const dynamicThis = /** @type {Record<string,
|
|
1690
|
+
const dynamicThis = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
1650
1691
|
const candidate = dynamicThis[getterMethodNameLocalized]
|
|
1651
1692
|
|
|
1652
1693
|
if (typeof candidate == "function") {
|
|
@@ -1674,12 +1715,12 @@ class VelociousDatabaseRecord {
|
|
|
1674
1715
|
* Runs get database identifier.
|
|
1675
1716
|
* @param {object} [args] - Options.
|
|
1676
1717
|
* @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
|
|
1718
|
+
* @param {object} [args.tenant] - Explicit tenant descriptor instead of the ambient tenant.
|
|
1677
1719
|
* @returns {string} - The database identifier.
|
|
1678
1720
|
*/
|
|
1679
|
-
static getDatabaseIdentifier({enforceTenantDatabaseScope = true, ...restArgs} = {}) {
|
|
1721
|
+
static getDatabaseIdentifier({enforceTenantDatabaseScope = true, tenant = Current.tenant(), ...restArgs} = {}) {
|
|
1680
1722
|
restArgsError(restArgs)
|
|
1681
1723
|
|
|
1682
|
-
const tenant = Current.tenant()
|
|
1683
1724
|
const tenantDatabaseIdentifier = this.getTenantDatabaseIdentifier(tenant)
|
|
1684
1725
|
|
|
1685
1726
|
if (tenantDatabaseIdentifier) {
|
|
@@ -1741,7 +1782,7 @@ class VelociousDatabaseRecord {
|
|
|
1741
1782
|
|
|
1742
1783
|
/**
|
|
1743
1784
|
* Runs get tenant database identifier.
|
|
1744
|
-
* @param {
|
|
1785
|
+
* @param {ReturnType<typeof JSON.parse>} [tenant] - Tenant override.
|
|
1745
1786
|
* @returns {string | undefined} - Tenant-scoped database identifier when configured.
|
|
1746
1787
|
*/
|
|
1747
1788
|
static getTenantDatabaseIdentifier(tenant = Current.tenant()) {
|
|
@@ -1764,7 +1805,7 @@ class VelociousDatabaseRecord {
|
|
|
1764
1805
|
/**
|
|
1765
1806
|
* Runs get attribute.
|
|
1766
1807
|
* @param {string} name - Name.
|
|
1767
|
-
* @returns {
|
|
1808
|
+
* @returns {ReturnType<typeof JSON.parse>} - The attribute.
|
|
1768
1809
|
*/
|
|
1769
1810
|
getAttribute(name) {
|
|
1770
1811
|
const columnName = inflection.underscore(name)
|
|
@@ -1790,7 +1831,7 @@ class VelociousDatabaseRecord {
|
|
|
1790
1831
|
/**
|
|
1791
1832
|
* Runs set attribute.
|
|
1792
1833
|
* @param {string} name - Name.
|
|
1793
|
-
* @param {
|
|
1834
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
1794
1835
|
* @returns {void} - No return value.
|
|
1795
1836
|
*/
|
|
1796
1837
|
setAttribute(name, newValue) {
|
|
@@ -1799,7 +1840,7 @@ class VelociousDatabaseRecord {
|
|
|
1799
1840
|
const canonicalName = this.getModelClass().resolveAttributeName(name) ?? name
|
|
1800
1841
|
const requestedSetterName = `set${inflection.camelize(canonicalName)}`
|
|
1801
1842
|
const setterName = this.getModelClass().findMemberNameInsensitive(this, requestedSetterName)
|
|
1802
|
-
const dynamicThis = /** @type {Record<string, (value:
|
|
1843
|
+
const dynamicThis = /** @type {Record<string, (value: ReturnType<typeof JSON.parse>) => void>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
1803
1844
|
|
|
1804
1845
|
this.getModelClass()._assertHasBeenInitialized()
|
|
1805
1846
|
if (!this.getModelClass().isInitialized()) throw new Error(`${this.constructor.name} model isn't initialized yet`)
|
|
@@ -1811,7 +1852,7 @@ class VelociousDatabaseRecord {
|
|
|
1811
1852
|
/**
|
|
1812
1853
|
* Runs set column attribute.
|
|
1813
1854
|
* @param {string} name - Name.
|
|
1814
|
-
* @param {
|
|
1855
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
1815
1856
|
*/
|
|
1816
1857
|
_setColumnAttribute(name, newValue) {
|
|
1817
1858
|
this.getModelClass()._assertHasBeenInitialized()
|
|
@@ -1840,7 +1881,7 @@ class VelociousDatabaseRecord {
|
|
|
1840
1881
|
/**
|
|
1841
1882
|
* Clears loaded belongs-to caches when callers assign the foreign key directly.
|
|
1842
1883
|
* @param {string} columnName - Changed database column name.
|
|
1843
|
-
* @param {
|
|
1884
|
+
* @param {ReturnType<typeof JSON.parse>} normalizedValue - New normalized column value.
|
|
1844
1885
|
* @returns {void} - No return value.
|
|
1845
1886
|
*/
|
|
1846
1887
|
_clearBelongsToRelationshipForChangedForeignKey(columnName, normalizedValue) {
|
|
@@ -1854,7 +1895,7 @@ class VelociousDatabaseRecord {
|
|
|
1854
1895
|
/**
|
|
1855
1896
|
* Runs belongs to relationships for foreign key.
|
|
1856
1897
|
* @param {string} columnName - Changed database column name.
|
|
1857
|
-
* @returns {Array
|
|
1898
|
+
* @returns {Array<ReturnType<typeof JSON.parse>>} - Loaded relationship instances that use the changed foreign key.
|
|
1858
1899
|
*/
|
|
1859
1900
|
_belongsToRelationshipsForForeignKey(columnName) {
|
|
1860
1901
|
if (!this._instanceRelationships) return []
|
|
@@ -1868,7 +1909,7 @@ class VelociousDatabaseRecord {
|
|
|
1868
1909
|
* Runs belongs to relationship uses foreign key.
|
|
1869
1910
|
* @param {object} args - Relationship match arguments.
|
|
1870
1911
|
* @param {string} args.columnName - Changed database column name.
|
|
1871
|
-
* @param {
|
|
1912
|
+
* @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
|
|
1872
1913
|
* @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
|
|
1873
1914
|
*/
|
|
1874
1915
|
_belongsToRelationshipUsesForeignKey({columnName, relationship}) {
|
|
@@ -1883,8 +1924,8 @@ class VelociousDatabaseRecord {
|
|
|
1883
1924
|
/**
|
|
1884
1925
|
* Runs belongs to relationship matches foreign key value.
|
|
1885
1926
|
* @param {object} args - Relationship cache arguments.
|
|
1886
|
-
* @param {
|
|
1887
|
-
* @param {
|
|
1927
|
+
* @param {ReturnType<typeof JSON.parse>} args.normalizedValue - New normalized column value.
|
|
1928
|
+
* @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
|
|
1888
1929
|
* @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
|
|
1889
1930
|
*/
|
|
1890
1931
|
_belongsToRelationshipMatchesForeignKeyValue({normalizedValue, relationship}) {
|
|
@@ -1913,7 +1954,7 @@ class VelociousDatabaseRecord {
|
|
|
1913
1954
|
|
|
1914
1955
|
/**
|
|
1915
1956
|
* Runs clear loaded belongs to relationship.
|
|
1916
|
-
* @param {
|
|
1957
|
+
* @param {ReturnType<typeof JSON.parse>} relationship - Relationship instance.
|
|
1917
1958
|
* @returns {void} - No return value.
|
|
1918
1959
|
*/
|
|
1919
1960
|
_clearLoadedBelongsToRelationship(relationship) {
|
|
@@ -1924,8 +1965,8 @@ class VelociousDatabaseRecord {
|
|
|
1924
1965
|
|
|
1925
1966
|
/**
|
|
1926
1967
|
* Runs normalize date value.
|
|
1927
|
-
* @param {
|
|
1928
|
-
* @returns {
|
|
1968
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to use.
|
|
1969
|
+
* @returns {ReturnType<typeof JSON.parse>} - The date value.
|
|
1929
1970
|
*/
|
|
1930
1971
|
_normalizeDateValue(value) {
|
|
1931
1972
|
return normalizeDateValueForWrite(value, {timeZone: this.getModelClass()._timeZoneForDateWrite()})
|
|
@@ -1935,8 +1976,8 @@ class VelociousDatabaseRecord {
|
|
|
1935
1976
|
* Runs normalize sqlite boolean value.
|
|
1936
1977
|
* @param {object} args - Options object.
|
|
1937
1978
|
* @param {string | undefined} args.columnType - Column type.
|
|
1938
|
-
* @param {
|
|
1939
|
-
* @returns {
|
|
1979
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
1980
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1940
1981
|
*/
|
|
1941
1982
|
_normalizeSqliteBooleanValue({columnType, value}) {
|
|
1942
1983
|
if (this.getModelClass().getDatabaseType() != "sqlite") return value
|
|
@@ -1956,8 +1997,8 @@ class VelociousDatabaseRecord {
|
|
|
1956
1997
|
* @param {object} args - Options object.
|
|
1957
1998
|
* @param {string} args.attributeName - Attribute name being written.
|
|
1958
1999
|
* @param {string | undefined} args.columnType - Column type.
|
|
1959
|
-
* @param {
|
|
1960
|
-
* @returns {
|
|
2000
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
2001
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1961
2002
|
*/
|
|
1962
2003
|
_normalizeBooleanValueForWrite({attributeName, columnType, value}) {
|
|
1963
2004
|
if (!this.getModelClass()._declaredBooleanStoresAsInteger(attributeName)) {
|
|
@@ -2084,12 +2125,12 @@ class VelociousDatabaseRecord {
|
|
|
2084
2125
|
/**
|
|
2085
2126
|
* Runs insert multiple.
|
|
2086
2127
|
* @param {Array<string>} columns - Column names.
|
|
2087
|
-
* @param {Array<Array
|
|
2128
|
+
* @param {Array<Array<ReturnType<typeof JSON.parse>>>} rows - Rows to insert.
|
|
2088
2129
|
* @param {object} [args] - Options object.
|
|
2089
2130
|
* @param {boolean} [args.cast] - Whether to cast values based on column types.
|
|
2090
2131
|
* @param {boolean} [args.retryIndividuallyOnFailure] - Retry rows individually if a batch insert fails.
|
|
2091
2132
|
* @param {boolean} [args.returnResults] - Return succeeded/failed rows instead of throwing when retries fail.
|
|
2092
|
-
* @returns {Promise<void | {succeededRows: Array<Array
|
|
2133
|
+
* @returns {Promise<void | {succeededRows: Array<Array<ReturnType<typeof JSON.parse>>>, failedRows: Array<Array<ReturnType<typeof JSON.parse>>>, errors: Array<{row: Array<ReturnType<typeof JSON.parse>>, error: ReturnType<typeof JSON.parse>}>}>} - Resolves when complete.
|
|
2093
2134
|
*/
|
|
2094
2135
|
static async insertMultiple(columns, rows, args = {}) {
|
|
2095
2136
|
const {cast = true, retryIndividuallyOnFailure = false, returnResults = false, ...restArgs} = args
|
|
@@ -2123,7 +2164,7 @@ class VelociousDatabaseRecord {
|
|
|
2123
2164
|
} catch {
|
|
2124
2165
|
/**
|
|
2125
2166
|
* Results.
|
|
2126
|
-
* @type {{succeededRows: Array
|
|
2167
|
+
* @type {{succeededRows: Array<ReturnType<typeof JSON.parse>>[], failedRows: Array<ReturnType<typeof JSON.parse>>[], errors: Array<{row: Array<ReturnType<typeof JSON.parse>>, error: ReturnType<typeof JSON.parse>}>}} */
|
|
2127
2168
|
const results = {
|
|
2128
2169
|
succeededRows: [],
|
|
2129
2170
|
failedRows: [],
|
|
@@ -2164,8 +2205,8 @@ class VelociousDatabaseRecord {
|
|
|
2164
2205
|
* Runs normalize insert multiple rows.
|
|
2165
2206
|
* @param {object} args - Options object.
|
|
2166
2207
|
* @param {Array<string>} args.columns - Column names.
|
|
2167
|
-
* @param {Array<Array
|
|
2168
|
-
* @returns {Array<Array
|
|
2208
|
+
* @param {Array<Array<ReturnType<typeof JSON.parse>>>} args.rows - Rows to insert.
|
|
2209
|
+
* @returns {Array<Array<ReturnType<typeof JSON.parse>>>} - Normalized rows.
|
|
2169
2210
|
*/
|
|
2170
2211
|
static _normalizeInsertMultipleRows({columns, rows}) {
|
|
2171
2212
|
return rows.map((row) => {
|
|
@@ -2190,7 +2231,7 @@ class VelociousDatabaseRecord {
|
|
|
2190
2231
|
|
|
2191
2232
|
/**
|
|
2192
2233
|
* Runs safe serialize insert row.
|
|
2193
|
-
* @param {Array
|
|
2234
|
+
* @param {Array<ReturnType<typeof JSON.parse>>} row - Row to serialize.
|
|
2194
2235
|
* @returns {string} - Safe row representation.
|
|
2195
2236
|
*/
|
|
2196
2237
|
static _safeSerializeInsertRow(row) {
|
|
@@ -2201,8 +2242,8 @@ class VelociousDatabaseRecord {
|
|
|
2201
2242
|
* Runs normalize insert value for column.
|
|
2202
2243
|
* @param {object} args - Options object.
|
|
2203
2244
|
* @param {string} args.columnName - Column name.
|
|
2204
|
-
* @param {
|
|
2205
|
-
* @returns {
|
|
2245
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Column value.
|
|
2246
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
2206
2247
|
*/
|
|
2207
2248
|
static _normalizeInsertValueForColumn({columnName, value}) {
|
|
2208
2249
|
const column = this.getColumnsHash()[columnName]
|
|
@@ -2263,8 +2304,8 @@ class VelociousDatabaseRecord {
|
|
|
2263
2304
|
* Runs normalize numeric value.
|
|
2264
2305
|
* @param {object} args - Options object.
|
|
2265
2306
|
* @param {string} args.columnType - Column type.
|
|
2266
|
-
* @param {
|
|
2267
|
-
* @returns {
|
|
2307
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
2308
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
2268
2309
|
*/
|
|
2269
2310
|
static _normalizeNumericValue({columnType, value}) {
|
|
2270
2311
|
if (value === "" || value === null || value === undefined) return value
|
|
@@ -2288,8 +2329,8 @@ class VelociousDatabaseRecord {
|
|
|
2288
2329
|
|
|
2289
2330
|
/**
|
|
2290
2331
|
* Runs normalize date value for insert.
|
|
2291
|
-
* @param {
|
|
2292
|
-
* @returns {
|
|
2332
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to normalize.
|
|
2333
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
2293
2334
|
*/
|
|
2294
2335
|
static _normalizeDateValueForInsert(value) {
|
|
2295
2336
|
return normalizeDateValueForWrite(value, {timeZone: this._timeZoneForDateWrite()})
|
|
@@ -2318,8 +2359,8 @@ class VelociousDatabaseRecord {
|
|
|
2318
2359
|
* Runs normalize sqlite boolean value for insert.
|
|
2319
2360
|
* @param {object} args - Options object.
|
|
2320
2361
|
* @param {string | undefined} args.columnType - Column type.
|
|
2321
|
-
* @param {
|
|
2322
|
-
* @returns {
|
|
2362
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
2363
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
2323
2364
|
*/
|
|
2324
2365
|
static _normalizeSqliteBooleanValueForInsert({columnType, value}) {
|
|
2325
2366
|
if (this.getDatabaseType() != "sqlite") return value
|
|
@@ -2432,7 +2473,7 @@ class VelociousDatabaseRecord {
|
|
|
2432
2473
|
const isNewRecord = this.isNewRecord()
|
|
2433
2474
|
let result
|
|
2434
2475
|
|
|
2435
|
-
|
|
2476
|
+
const save = async () => {
|
|
2436
2477
|
await this._runLifecycleCallbacks("beforeValidation")
|
|
2437
2478
|
await this._runValidations()
|
|
2438
2479
|
|
|
@@ -2470,7 +2511,13 @@ class VelociousDatabaseRecord {
|
|
|
2470
2511
|
} else {
|
|
2471
2512
|
await this.getModelClass().transaction(saveInTransaction)
|
|
2472
2513
|
}
|
|
2473
|
-
}
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2516
|
+
if (this._databaseOperation) {
|
|
2517
|
+
await save()
|
|
2518
|
+
} else {
|
|
2519
|
+
await this._getConfiguration().ensureConnections({name: `${this.getModelClass().name} save`}, save)
|
|
2520
|
+
}
|
|
2474
2521
|
|
|
2475
2522
|
this._assignedAttributeNames = undefined
|
|
2476
2523
|
|
|
@@ -2660,8 +2707,8 @@ class VelociousDatabaseRecord {
|
|
|
2660
2707
|
|
|
2661
2708
|
/**
|
|
2662
2709
|
* Runs transaction.
|
|
2663
|
-
* @param {
|
|
2664
|
-
* @returns {Promise
|
|
2710
|
+
* @param {() => Promise<void>} callback - Callback function.
|
|
2711
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Resolves with the transaction.
|
|
2665
2712
|
*/
|
|
2666
2713
|
static async transaction(callback) {
|
|
2667
2714
|
await this.ensureInitialized()
|
|
@@ -2884,13 +2931,13 @@ class VelociousDatabaseRecord {
|
|
|
2884
2931
|
/**
|
|
2885
2932
|
* Adds a validation to an attribute.
|
|
2886
2933
|
* @param {string} attributeName The name of the attribute to validate.
|
|
2887
|
-
* @param {Record<string, boolean | Record<string,
|
|
2934
|
+
* @param {Record<string, boolean | Record<string, ReturnType<typeof JSON.parse>>>} validators The validators to add. Key is the validator name, value is the validator arguments.
|
|
2888
2935
|
*/
|
|
2889
2936
|
static async validates(attributeName, validators) {
|
|
2890
2937
|
for (const validatorName in validators) {
|
|
2891
2938
|
/**
|
|
2892
2939
|
* Defines validatorArgs.
|
|
2893
|
-
* @type {Record<string,
|
|
2940
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
2894
2941
|
let validatorArgs
|
|
2895
2942
|
|
|
2896
2943
|
/**
|
|
@@ -2964,10 +3011,10 @@ class VelociousDatabaseRecord {
|
|
|
2964
3011
|
if (translation) {
|
|
2965
3012
|
/**
|
|
2966
3013
|
* Dict.
|
|
2967
|
-
* @type {Record<string,
|
|
3014
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
2968
3015
|
const dict = translation
|
|
2969
3016
|
|
|
2970
|
-
const attributeMethod = /** @type {
|
|
3017
|
+
const attributeMethod = /** @type {() => string | undefined} */ (dict[name])
|
|
2971
3018
|
|
|
2972
3019
|
if (typeof attributeMethod == "function") {
|
|
2973
3020
|
return attributeMethod.bind(translation)()
|
|
@@ -3010,7 +3057,7 @@ class VelociousDatabaseRecord {
|
|
|
3010
3057
|
* Runs set translated attribute.
|
|
3011
3058
|
* @param {string} name - Name.
|
|
3012
3059
|
* @param {string} locale - Locale.
|
|
3013
|
-
* @param {
|
|
3060
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
3014
3061
|
* @returns {void} - No return value.
|
|
3015
3062
|
*/
|
|
3016
3063
|
_setTranslatedAttribute(name, locale, newValue) {
|
|
@@ -3029,7 +3076,7 @@ class VelociousDatabaseRecord {
|
|
|
3029
3076
|
|
|
3030
3077
|
/**
|
|
3031
3078
|
* Assignments.
|
|
3032
|
-
* @type {Record<string,
|
|
3079
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
3033
3080
|
const assignments = {}
|
|
3034
3081
|
|
|
3035
3082
|
assignments[name] = newValue
|
|
@@ -3044,7 +3091,8 @@ class VelociousDatabaseRecord {
|
|
|
3044
3091
|
* @param {{driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default), operation?: import("../operation.js").default}} [args] - Explicit query ownership.
|
|
3045
3092
|
* @returns {ModelClassQuery<MC>} - The new query.
|
|
3046
3093
|
*/
|
|
3047
|
-
static _newQuery(
|
|
3094
|
+
static _newQuery(args = {}) {
|
|
3095
|
+
const {driver = () => this.connection(), operation, ...restArgs} = args
|
|
3048
3096
|
restArgsError(restArgs)
|
|
3049
3097
|
this._assertHasBeenInitialized()
|
|
3050
3098
|
const handler = new Handler()
|
|
@@ -3159,7 +3207,7 @@ class VelociousDatabaseRecord {
|
|
|
3159
3207
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
3160
3208
|
* @this {MC}
|
|
3161
3209
|
* @param {...string|string[]} columns - Column names.
|
|
3162
|
-
* @returns {Promise<Array
|
|
3210
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Resolves with the pluck.
|
|
3163
3211
|
*/
|
|
3164
3212
|
static async pluck(...columns) {
|
|
3165
3213
|
await this.ensureInitialized()
|
|
@@ -3207,47 +3255,20 @@ class VelociousDatabaseRecord {
|
|
|
3207
3255
|
}
|
|
3208
3256
|
|
|
3209
3257
|
/**
|
|
3210
|
-
* Returns
|
|
3211
|
-
*
|
|
3212
|
-
*
|
|
3213
|
-
* tenant or in the default database from another tenant context — for example
|
|
3214
|
-
* `GithubWebhook.usingTenant(tenant).findBy({id})` — without depending on
|
|
3215
|
-
* which tenant happens to be active. The target tenant's connections are
|
|
3216
|
-
* ensured for the duration of each query.
|
|
3258
|
+
* Returns an immutable tenant-bound model scope. Eager helpers and explicit
|
|
3259
|
+
* databaseOperation/transaction callbacks execute from a captured physical
|
|
3260
|
+
* database configuration instead of ambient tenant state.
|
|
3217
3261
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
3218
3262
|
* @this {MC}
|
|
3219
|
-
* @param {
|
|
3220
|
-
* @returns {
|
|
3263
|
+
* @param {object} tenant - Ordinary or null-prototype JSON-compatible tenant descriptor to scope the model to.
|
|
3264
|
+
* @returns {TenantModelScope<MC>} - Model scope bound to the captured tenant database.
|
|
3221
3265
|
*/
|
|
3222
3266
|
static usingTenant(tenant) {
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
findByOrFail: (conditions) => ModelClass._runUsingTenant(tenant, () => ModelClass.findByOrFail(conditions))
|
|
3229
|
-
}
|
|
3230
|
-
}
|
|
3231
|
-
|
|
3232
|
-
/**
|
|
3233
|
-
* Runs `callback` with the tenant switched to `tenant` and that tenant's
|
|
3234
|
-
* connections ensured. Backs `usingTenant`.
|
|
3235
|
-
* @template T
|
|
3236
|
-
* @param {?} tenant - Tenant descriptor.
|
|
3237
|
-
* @param {() => Promise<T>} callback - Query to run under the tenant.
|
|
3238
|
-
* @returns {Promise<T>} - Resolves with the callback's result.
|
|
3239
|
-
*/
|
|
3240
|
-
static async _runUsingTenant(tenant, callback) {
|
|
3241
|
-
const configuration = this._getConfiguration()
|
|
3242
|
-
|
|
3243
|
-
// Do NOT ensureInitialized() out here: for a tenant-switched model whose
|
|
3244
|
-
// first initialization would resolve metadata from the ambient tenant's
|
|
3245
|
-
// database, that must happen under the requested tenant. The finders inside
|
|
3246
|
-
// `callback` call ensureInitialized() themselves, now within this scope.
|
|
3247
|
-
return await configuration.runWithTenant(tenant, () => configuration.ensureConnections({
|
|
3248
|
-
databaseIdentifiers: [this.getDatabaseIdentifier()],
|
|
3249
|
-
name: `usingTenant: ${this.getModelName()}`
|
|
3250
|
-
}, callback))
|
|
3267
|
+
return new TenantModelScope({
|
|
3268
|
+
configuration: this._getConfiguration(),
|
|
3269
|
+
modelClass: this,
|
|
3270
|
+
tenant
|
|
3271
|
+
})
|
|
3251
3272
|
}
|
|
3252
3273
|
|
|
3253
3274
|
/**
|
|
@@ -3255,7 +3276,7 @@ class VelociousDatabaseRecord {
|
|
|
3255
3276
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
3256
3277
|
* @this {MC}
|
|
3257
3278
|
* @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
|
|
3258
|
-
* @param {
|
|
3279
|
+
* @param {() => void} [callback] - Callback function.
|
|
3259
3280
|
* @returns {Promise<InstanceType<MC>>} - Resolves with the or create by.
|
|
3260
3281
|
*/
|
|
3261
3282
|
static async findOrCreateBy(conditions, callback) {
|
|
@@ -3269,7 +3290,7 @@ class VelociousDatabaseRecord {
|
|
|
3269
3290
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
3270
3291
|
* @this {MC}
|
|
3271
3292
|
* @param {Record<string, string | number>} conditions - Conditions.
|
|
3272
|
-
* @param {
|
|
3293
|
+
* @param {(arg: InstanceType<MC>) => void} [callback] - Callback function.
|
|
3273
3294
|
* @returns {Promise<InstanceType<MC>>} - Resolves with the or initialize by.
|
|
3274
3295
|
*/
|
|
3275
3296
|
static async findOrInitializeBy(conditions, callback) {
|
|
@@ -3417,7 +3438,7 @@ class VelociousDatabaseRecord {
|
|
|
3417
3438
|
* Runs ransack.
|
|
3418
3439
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
3419
3440
|
* @this {MC}
|
|
3420
|
-
* @param {Record<string,
|
|
3441
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Ransack-style params hash.
|
|
3421
3442
|
* @returns {ModelClassQuery<MC>} - Query with Ransack filters applied.
|
|
3422
3443
|
*/
|
|
3423
3444
|
static ransack(params) {
|
|
@@ -3454,6 +3475,22 @@ class VelociousDatabaseRecord {
|
|
|
3454
3475
|
return this
|
|
3455
3476
|
}
|
|
3456
3477
|
|
|
3478
|
+
/**
|
|
3479
|
+
* Releases this record from a completed eager-helper operation while
|
|
3480
|
+
* preserving the legacy ambient follow-up behavior of `usingTenant` finders.
|
|
3481
|
+
* @param {import("../operation.js").default} operation - Releasing operation.
|
|
3482
|
+
* @returns {this} - Record.
|
|
3483
|
+
*/
|
|
3484
|
+
releaseDatabaseOperation(operation) {
|
|
3485
|
+
if (this._databaseOperation !== operation) {
|
|
3486
|
+
throw new Error("Record is not bound to the releasing database operation")
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3489
|
+
this._databaseOperation = undefined
|
|
3490
|
+
|
|
3491
|
+
return this
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3457
3494
|
/**
|
|
3458
3495
|
* Returns the explicit operation owning this record, if any.
|
|
3459
3496
|
* @returns {import("../operation.js").default | undefined} - Owning operation.
|
|
@@ -3486,6 +3523,22 @@ class VelociousDatabaseRecord {
|
|
|
3486
3523
|
return ModelClass._newQuery()
|
|
3487
3524
|
}
|
|
3488
3525
|
|
|
3526
|
+
/**
|
|
3527
|
+
* Initializes a relationship/preload target without dropping this record's
|
|
3528
|
+
* explicit operation connection.
|
|
3529
|
+
* @param {typeof VelociousDatabaseRecord} ModelClass - Target model class.
|
|
3530
|
+
* @param {import("../../configuration.js").default} configuration - Owning configuration.
|
|
3531
|
+
* @returns {Promise<void>} - Resolves when initialized.
|
|
3532
|
+
*/
|
|
3533
|
+
async ensureModelClassInitialized(ModelClass, configuration) {
|
|
3534
|
+
if (this._databaseOperation) {
|
|
3535
|
+
await this._databaseOperation.ensureModelInitialized(ModelClass)
|
|
3536
|
+
return
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3539
|
+
await ModelClass.ensureInitialized({configuration})
|
|
3540
|
+
}
|
|
3541
|
+
|
|
3489
3542
|
/**
|
|
3490
3543
|
* Runs load existing record.
|
|
3491
3544
|
* @param {object} attributes - Attributes.
|
|
@@ -3498,7 +3551,7 @@ class VelociousDatabaseRecord {
|
|
|
3498
3551
|
|
|
3499
3552
|
/**
|
|
3500
3553
|
* Assigns the given attributes to the record.
|
|
3501
|
-
* @param {Record<string,
|
|
3554
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} attributesToAssign - Attributes to assign.
|
|
3502
3555
|
* @returns {void} - No return value.
|
|
3503
3556
|
*/
|
|
3504
3557
|
assign(attributesToAssign) {
|
|
@@ -3511,14 +3564,14 @@ class VelociousDatabaseRecord {
|
|
|
3511
3564
|
|
|
3512
3565
|
/**
|
|
3513
3566
|
* Returns a the current attributes of the record (original attributes from database plus changes)
|
|
3514
|
-
* @returns {Record<string,
|
|
3567
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - The attributes.
|
|
3515
3568
|
*/
|
|
3516
3569
|
attributes() {
|
|
3517
3570
|
const data = this.rawAttributes()
|
|
3518
3571
|
const columnNameToAttributeName = this.getModelClass().getColumnNameToAttributeNameMap()
|
|
3519
3572
|
/**
|
|
3520
3573
|
* Attributes.
|
|
3521
|
-
* @type {Record<string,
|
|
3574
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
3522
3575
|
const attributes = {}
|
|
3523
3576
|
|
|
3524
3577
|
for (const columnName in data) {
|
|
@@ -3532,7 +3585,7 @@ class VelociousDatabaseRecord {
|
|
|
3532
3585
|
|
|
3533
3586
|
/**
|
|
3534
3587
|
* Returns column-name keyed data (original attributes from database plus changes)
|
|
3535
|
-
* @returns {Record<string,
|
|
3588
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - The raw attributes.
|
|
3536
3589
|
*/
|
|
3537
3590
|
rawAttributes() {
|
|
3538
3591
|
return Object.assign({}, this._attributes, this._changes)
|
|
@@ -3670,7 +3723,7 @@ class VelociousDatabaseRecord {
|
|
|
3670
3723
|
* @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
|
|
3671
3724
|
* @param {string} identifier - Tenant database identifier.
|
|
3672
3725
|
* @param {TenantDatabaseProviderType} provider - Tenant database provider.
|
|
3673
|
-
* @returns {Promise<Array
|
|
3726
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Listed tenant objects.
|
|
3674
3727
|
*/
|
|
3675
3728
|
async _dependentRestrictProviderTenants(instanceRelationship, TargetModelClass, identifier, provider) {
|
|
3676
3729
|
const configuration = this.getModelClass()._getConfiguration()
|
|
@@ -3766,7 +3819,7 @@ class VelociousDatabaseRecord {
|
|
|
3766
3819
|
|
|
3767
3820
|
/**
|
|
3768
3821
|
* Conditions.
|
|
3769
|
-
* @type {Record<string,
|
|
3822
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
3770
3823
|
const conditions = {}
|
|
3771
3824
|
|
|
3772
3825
|
conditions[this.getModelClass().primaryKey()] = this.id()
|
|
@@ -3866,7 +3919,7 @@ class VelociousDatabaseRecord {
|
|
|
3866
3919
|
if (callback == callbackName) {
|
|
3867
3920
|
callbackNameRegisteredAsString = true
|
|
3868
3921
|
}
|
|
3869
|
-
const dynamicThis = /** @type {Record<string,
|
|
3922
|
+
const dynamicThis = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
3870
3923
|
const methodCallback = dynamicThis[callback]
|
|
3871
3924
|
|
|
3872
3925
|
if (typeof methodCallback != "function") {
|
|
@@ -3879,7 +3932,7 @@ class VelociousDatabaseRecord {
|
|
|
3879
3932
|
}
|
|
3880
3933
|
}
|
|
3881
3934
|
|
|
3882
|
-
const dynamicThis = /** @type {Record<string,
|
|
3935
|
+
const dynamicThis = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
3883
3936
|
const instanceCallback = dynamicThis[callbackName]
|
|
3884
3937
|
|
|
3885
3938
|
if (!callbackNameRegisteredAsString && typeof instanceCallback === "function") {
|
|
@@ -3928,12 +3981,12 @@ class VelociousDatabaseRecord {
|
|
|
3928
3981
|
|
|
3929
3982
|
/**
|
|
3930
3983
|
* Returns the changes that have been made to this record since it was loaded from the database.
|
|
3931
|
-
* @returns {Record<string, Array
|
|
3984
|
+
* @returns {Record<string, Array<ReturnType<typeof JSON.parse>>>} - The changes.
|
|
3932
3985
|
*/
|
|
3933
3986
|
changes() {
|
|
3934
3987
|
/**
|
|
3935
3988
|
* Changes.
|
|
3936
|
-
* @type {Record<string, Array
|
|
3989
|
+
* @type {Record<string, Array<ReturnType<typeof JSON.parse>>>} */
|
|
3937
3990
|
const changes = {}
|
|
3938
3991
|
|
|
3939
3992
|
for (const changeKey in this._changes) {
|
|
@@ -3983,7 +4036,7 @@ class VelociousDatabaseRecord {
|
|
|
3983
4036
|
* @returns {number} - Attached association count, or zero when absent.
|
|
3984
4037
|
*/
|
|
3985
4038
|
readCount(attributeName) {
|
|
3986
|
-
return readPayloadAssociationCount(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4039
|
+
return readPayloadAssociationCount(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this)), attributeName)
|
|
3987
4040
|
}
|
|
3988
4041
|
|
|
3989
4042
|
/**
|
|
@@ -3994,7 +4047,7 @@ class VelociousDatabaseRecord {
|
|
|
3994
4047
|
* @returns {void}
|
|
3995
4048
|
*/
|
|
3996
4049
|
_setAssociationCount(attributeName, value) {
|
|
3997
|
-
setPayloadAssociationCount(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4050
|
+
setPayloadAssociationCount(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this)), attributeName, value)
|
|
3998
4051
|
}
|
|
3999
4052
|
|
|
4000
4053
|
/**
|
|
@@ -4009,7 +4062,7 @@ class VelociousDatabaseRecord {
|
|
|
4009
4062
|
* @type {Record<string, number>} */
|
|
4010
4063
|
const result = {}
|
|
4011
4064
|
|
|
4012
|
-
const target = /** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4065
|
+
const target = /** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
4013
4066
|
|
|
4014
4067
|
if (!target._associationCounts) return result
|
|
4015
4068
|
|
|
@@ -4028,10 +4081,10 @@ class VelociousDatabaseRecord {
|
|
|
4028
4081
|
* registered fn for this record (e.g. no child rows matched the
|
|
4029
4082
|
* aggregate).
|
|
4030
4083
|
* @param {string} name - queryData attribute name (matches a SELECT alias from the registered fn).
|
|
4031
|
-
* @returns {
|
|
4084
|
+
* @returns {ReturnType<typeof JSON.parse>} - Attached query-data value.
|
|
4032
4085
|
*/
|
|
4033
4086
|
queryData(name) {
|
|
4034
|
-
return readPayloadQueryData(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4087
|
+
return readPayloadQueryData(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this)), name)
|
|
4035
4088
|
}
|
|
4036
4089
|
|
|
4037
4090
|
/**
|
|
@@ -4039,26 +4092,26 @@ class VelociousDatabaseRecord {
|
|
|
4039
4092
|
* the `queryData` runner and by frontend-model hydration; outside
|
|
4040
4093
|
* code should not call this directly.
|
|
4041
4094
|
* @param {string} name - queryData attribute name.
|
|
4042
|
-
* @param {
|
|
4095
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to attach.
|
|
4043
4096
|
* @returns {void}
|
|
4044
4097
|
*/
|
|
4045
4098
|
_setQueryData(name, value) {
|
|
4046
|
-
setPayloadQueryData(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4099
|
+
setPayloadQueryData(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this)), name, value)
|
|
4047
4100
|
}
|
|
4048
4101
|
|
|
4049
4102
|
/**
|
|
4050
4103
|
* All attached queryData values as a plain object. Used by the
|
|
4051
4104
|
* frontend-model serializer to ship queryData alongside the record
|
|
4052
4105
|
* attributes on the wire.
|
|
4053
|
-
* @returns {Record<string,
|
|
4106
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Query-data values keyed by name.
|
|
4054
4107
|
*/
|
|
4055
4108
|
queryDataValues() {
|
|
4056
4109
|
/**
|
|
4057
4110
|
* Result.
|
|
4058
|
-
* @type {Record<string,
|
|
4111
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
4059
4112
|
const result = {}
|
|
4060
4113
|
|
|
4061
|
-
const target = /** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4114
|
+
const target = /** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
4062
4115
|
|
|
4063
4116
|
if (!target._queryDataValues) return result
|
|
4064
4117
|
|
|
@@ -4081,7 +4134,7 @@ class VelociousDatabaseRecord {
|
|
|
4081
4134
|
* @returns {boolean} - Whether the requested ability is allowed.
|
|
4082
4135
|
*/
|
|
4083
4136
|
can(action) {
|
|
4084
|
-
return readPayloadComputedAbility(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4137
|
+
return readPayloadComputedAbility(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this)), action)
|
|
4085
4138
|
}
|
|
4086
4139
|
|
|
4087
4140
|
/**
|
|
@@ -4093,7 +4146,7 @@ class VelociousDatabaseRecord {
|
|
|
4093
4146
|
* @returns {void}
|
|
4094
4147
|
*/
|
|
4095
4148
|
_setComputedAbility(action, value) {
|
|
4096
|
-
setPayloadComputedAbility(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4149
|
+
setPayloadComputedAbility(/** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this)), action, value)
|
|
4097
4150
|
}
|
|
4098
4151
|
|
|
4099
4152
|
/**
|
|
@@ -4108,7 +4161,7 @@ class VelociousDatabaseRecord {
|
|
|
4108
4161
|
* @type {Record<string, boolean>} */
|
|
4109
4162
|
const result = {}
|
|
4110
4163
|
|
|
4111
|
-
const target = /** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {
|
|
4164
|
+
const target = /** @type {import("../../record-payload-values.js").RecordPayloadValuesTarget} */ (/** @type {ReturnType<typeof JSON.parse>} */ (this))
|
|
4112
4165
|
|
|
4113
4166
|
if (!target._computedAbilities) return result
|
|
4114
4167
|
|
|
@@ -4122,7 +4175,7 @@ class VelociousDatabaseRecord {
|
|
|
4122
4175
|
/**
|
|
4123
4176
|
* Reads a column value from the record.
|
|
4124
4177
|
* @param {string} attributeName The name of the column to read. This is the column name, not the attribute name.
|
|
4125
|
-
* @returns {
|
|
4178
|
+
* @returns {ReturnType<typeof JSON.parse>} - The column.
|
|
4126
4179
|
*/
|
|
4127
4180
|
readColumn(attributeName) {
|
|
4128
4181
|
this.getModelClass()._assertHasBeenInitialized()
|
|
@@ -4166,8 +4219,8 @@ class VelociousDatabaseRecord {
|
|
|
4166
4219
|
/**
|
|
4167
4220
|
* Converts a stored value to a real boolean for a declared `"boolean"` cast.
|
|
4168
4221
|
* Leaves null/undefined untouched; treats 1/true/"1" as true and 0/false/"0" as false.
|
|
4169
|
-
* @param {
|
|
4170
|
-
* @returns {
|
|
4222
|
+
* @param {ReturnType<typeof JSON.parse>} value - Stored database value.
|
|
4223
|
+
* @returns {ReturnType<typeof JSON.parse>} - Converted boolean, or the original value when not recognized.
|
|
4171
4224
|
*/
|
|
4172
4225
|
_castDeclaredBooleanForRead(value) {
|
|
4173
4226
|
if (value === null || value === undefined) return value
|
|
@@ -4195,8 +4248,8 @@ class VelociousDatabaseRecord {
|
|
|
4195
4248
|
* @param {object} args - Options object.
|
|
4196
4249
|
* @param {string} args.columnName - Database column name being read.
|
|
4197
4250
|
* @param {string | undefined} args.columnType - Column type.
|
|
4198
|
-
* @param {
|
|
4199
|
-
* @returns {
|
|
4251
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
4252
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
4200
4253
|
*/
|
|
4201
4254
|
_normalizeBooleanValueForRead({columnName, columnType, value}) {
|
|
4202
4255
|
if (this._declaredAttributeCastForColumn(columnName) === "boolean") {
|
|
@@ -4213,8 +4266,8 @@ class VelociousDatabaseRecord {
|
|
|
4213
4266
|
|
|
4214
4267
|
/**
|
|
4215
4268
|
* Runs normalize date value for read.
|
|
4216
|
-
* @param {
|
|
4217
|
-
* @returns {
|
|
4269
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value from database.
|
|
4270
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
4218
4271
|
*/
|
|
4219
4272
|
_normalizeDateValueForRead(value) {
|
|
4220
4273
|
return normalizeDateValueForRead(value, {databaseType: this.getModelClass().getDatabaseType()})
|
|
@@ -4223,7 +4276,7 @@ class VelociousDatabaseRecord {
|
|
|
4223
4276
|
_belongsToChanges() {
|
|
4224
4277
|
/**
|
|
4225
4278
|
* Belongs to changes.
|
|
4226
|
-
* @type {Record<string,
|
|
4279
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
4227
4280
|
const belongsToChanges = {}
|
|
4228
4281
|
|
|
4229
4282
|
if (this._instanceRelationships) {
|
|
@@ -4344,7 +4397,7 @@ class VelociousDatabaseRecord {
|
|
|
4344
4397
|
|
|
4345
4398
|
/**
|
|
4346
4399
|
* Sets timestamp defaults for a new record insert.
|
|
4347
|
-
* @param {Record<string,
|
|
4400
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
|
|
4348
4401
|
* @returns {void} - No return value.
|
|
4349
4402
|
*/
|
|
4350
4403
|
_setDefaultTimestampValues(data) {
|
|
@@ -4362,7 +4415,7 @@ class VelociousDatabaseRecord {
|
|
|
4362
4415
|
|
|
4363
4416
|
/**
|
|
4364
4417
|
* Runs normalize date values for write.
|
|
4365
|
-
* @param {Record<string,
|
|
4418
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
|
|
4366
4419
|
* @returns {void} - No return value.
|
|
4367
4420
|
*/
|
|
4368
4421
|
_normalizeDateValuesForWrite(data) {
|
|
@@ -4384,7 +4437,7 @@ class VelociousDatabaseRecord {
|
|
|
4384
4437
|
async _updateRecordWithChanges() {
|
|
4385
4438
|
/**
|
|
4386
4439
|
* Conditions.
|
|
4387
|
-
* @type {Record<string,
|
|
4440
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
4388
4441
|
const conditions = {}
|
|
4389
4442
|
|
|
4390
4443
|
conditions[this.getModelClass().primaryKey()] = this.id()
|
|
@@ -4460,7 +4513,7 @@ class VelociousDatabaseRecord {
|
|
|
4460
4513
|
|
|
4461
4514
|
/**
|
|
4462
4515
|
* Where object.
|
|
4463
|
-
* @type {Record<string,
|
|
4516
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
4464
4517
|
const whereObject = {}
|
|
4465
4518
|
|
|
4466
4519
|
whereObject[primaryKey] = id
|