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
|
@@ -1,58 +1,51 @@
|
|
|
1
|
-
export default VelociousDatabaseRecord;
|
|
2
|
-
/**
|
|
3
|
-
* Defines this typedef.
|
|
4
|
-
*/
|
|
5
1
|
export type ValidationErrorObjectType = {
|
|
6
2
|
type: string;
|
|
7
3
|
message: string;
|
|
8
4
|
};
|
|
9
|
-
|
|
10
|
-
* LifecycleCallbackType type.
|
|
11
|
-
*/
|
|
12
|
-
export type LifecycleCallbackType<T = VelociousDatabaseRecord<Record<string, any>>> = ((model: T) => void | Promise<void>) | string;
|
|
13
|
-
/**
|
|
14
|
-
* Model class constructor type used for static `this` typing.
|
|
15
|
-
*/
|
|
5
|
+
export type LifecycleCallbackType<T = VelociousDatabaseRecord> = ((model: T) => void | Promise<void>) | string;
|
|
16
6
|
export type ModelConstructor<T> = {
|
|
17
7
|
new (changes?: Record<string, unknown>): T;
|
|
18
8
|
};
|
|
19
|
-
/**
|
|
20
|
-
* RestrictInstanceRelationship type.
|
|
21
|
-
*/
|
|
22
9
|
export type RestrictInstanceRelationship = import("./instance-relationships/base.js").default & {
|
|
23
10
|
query: () => ModelClassQuery<typeof VelociousDatabaseRecord>;
|
|
24
11
|
};
|
|
25
12
|
export type TenantDatabaseProviderType = import("../../configuration-types.js").TenantDatabaseProviderType;
|
|
26
13
|
/**
|
|
27
|
-
*
|
|
14
|
+
* Defines this typedef.
|
|
15
|
+
* @typedef {{type: string, message: string}} ValidationErrorObjectType
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* LifecycleCallbackType type.
|
|
19
|
+
* @template [T=VelociousDatabaseRecord]
|
|
20
|
+
* @typedef {((model: T) => void | Promise<void>) | string} LifecycleCallbackType
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
* Model class constructor type used for static `this` typing.
|
|
24
|
+
* @template T
|
|
25
|
+
* @typedef {{new (changes?: Record<string, unknown>): T}} ModelConstructor
|
|
26
|
+
*/
|
|
27
|
+
/**
|
|
28
|
+
* RestrictInstanceRelationship type.
|
|
29
|
+
* @typedef {import("./instance-relationships/base.js").default & {query: () => ModelClassQuery<typeof VelociousDatabaseRecord>}} RestrictInstanceRelationship
|
|
28
30
|
*/
|
|
31
|
+
/** @typedef {import("../../configuration-types.js").TenantDatabaseProviderType} TenantDatabaseProviderType */
|
|
32
|
+
import { AdvisoryLockBusyError, AdvisoryLockHoldTimeoutError, AdvisoryLockTimeoutError } from "../advisory-lock-runner.js";
|
|
33
|
+
import Configuration from "../../configuration.js";
|
|
34
|
+
import RecordAttachmentHandle from "./attachments/handle.js";
|
|
35
|
+
import ModelClassQuery from "../query/model-class-query.js";
|
|
36
|
+
import TenantModelScope from "../../tenants/tenant-model-scope.js";
|
|
29
37
|
export type TranslationBase = VelociousDatabaseRecord & {
|
|
30
38
|
locale: () => string;
|
|
31
39
|
};
|
|
32
|
-
/**
|
|
33
|
-
* AttachmentDriverConstructor type.
|
|
34
|
-
*/
|
|
35
40
|
export type AttachmentDriverConstructor = import("../../configuration-types.js").AttachmentDriverConstructor;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export class TenantDatabaseScopeError extends Error {
|
|
40
|
-
/**
|
|
41
|
-
* Runs constructor.
|
|
42
|
-
* @param {string} message - Error message.
|
|
43
|
-
* @param {{modelName: string}} args - Context for the failed tenant-scoped model.
|
|
44
|
-
*/
|
|
45
|
-
constructor(message: string, { modelName }: {
|
|
46
|
-
modelName: string;
|
|
47
|
-
});
|
|
48
|
-
modelName: string;
|
|
49
|
-
}
|
|
50
|
-
export class ValidationError extends Error {
|
|
41
|
+
declare class ValidationError extends Error {
|
|
42
|
+
_model: VelociousDatabaseRecord<Record<string, any>> | undefined;
|
|
43
|
+
_validationErrors: Record<string, ValidationErrorObjectType[]> | undefined;
|
|
51
44
|
/**
|
|
52
45
|
* Narrows the runtime value to the documented type.
|
|
53
|
-
* @type {Record<string,
|
|
46
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>> | undefined} - Velocious metadata for frontend-model error reporting.
|
|
54
47
|
*/
|
|
55
|
-
velocious: Record<string,
|
|
48
|
+
velocious: Record<string, ReturnType<typeof JSON.parse>> | undefined;
|
|
56
49
|
/**
|
|
57
50
|
* Runs get model.
|
|
58
51
|
* @returns {VelociousDatabaseRecord} - The model.
|
|
@@ -64,7 +57,6 @@ export class ValidationError extends Error {
|
|
|
64
57
|
* @returns {void} - No return value.
|
|
65
58
|
*/
|
|
66
59
|
setModel(model: VelociousDatabaseRecord): void;
|
|
67
|
-
_model: VelociousDatabaseRecord<Record<string, any>> | undefined;
|
|
68
60
|
/**
|
|
69
61
|
* Runs get validation errors.
|
|
70
62
|
* @returns {Record<string, ValidationErrorObjectType[]>} - The validation errors.
|
|
@@ -75,13 +67,1945 @@ export class ValidationError extends Error {
|
|
|
75
67
|
* @param {Record<string, ValidationErrorObjectType[]>} validationErrors - Validation errors to assign.
|
|
76
68
|
*/
|
|
77
69
|
setValidationErrors(validationErrors: Record<string, ValidationErrorObjectType[]>): void;
|
|
78
|
-
_validationErrors: Record<string, ValidationErrorObjectType[]> | undefined;
|
|
79
70
|
}
|
|
71
|
+
declare class TenantDatabaseScopeError extends Error {
|
|
72
|
+
modelName: string;
|
|
73
|
+
/**
|
|
74
|
+
* Runs constructor.
|
|
75
|
+
* @param {string} message - Error message.
|
|
76
|
+
* @param {{modelName: string}} args - Context for the failed tenant-scoped model.
|
|
77
|
+
*/
|
|
78
|
+
constructor(message: string, { modelName }: {
|
|
79
|
+
modelName: string;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
export type RelationshipScopeCallback = (query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void);
|
|
83
|
+
export type RelationshipDataArgumentType = {
|
|
84
|
+
/**
|
|
85
|
+
* - Disable auto-batch-preload for this relationship by passing false. Default true.
|
|
86
|
+
*/
|
|
87
|
+
autoload?: boolean;
|
|
88
|
+
/**
|
|
89
|
+
* - Model class name for the related record.
|
|
90
|
+
*/
|
|
91
|
+
className?: string;
|
|
92
|
+
/**
|
|
93
|
+
* - Dependent action when parent is destroyed (e.g. "destroy").
|
|
94
|
+
*/
|
|
95
|
+
dependent?: string;
|
|
96
|
+
/**
|
|
97
|
+
* - Model class for the related record.
|
|
98
|
+
*/
|
|
99
|
+
klass?: typeof VelociousDatabaseRecord;
|
|
100
|
+
/**
|
|
101
|
+
* - Optional scope callback for the relationship.
|
|
102
|
+
*/
|
|
103
|
+
scope?: RelationshipScopeCallback;
|
|
104
|
+
/**
|
|
105
|
+
* - Relationship type (e.g. "hasMany", "belongsTo").
|
|
106
|
+
*/
|
|
107
|
+
type?: string;
|
|
108
|
+
};
|
|
80
109
|
/**
|
|
81
110
|
* Base database record.
|
|
82
|
-
* @template {Record<string,
|
|
111
|
+
* @template {Record<string, ReturnType<typeof JSON.parse>>} [WriteAttributes=Record<string, ReturnType<typeof JSON.parse>>]
|
|
83
112
|
*/
|
|
84
|
-
declare class VelociousDatabaseRecord<WriteAttributes extends Record<string,
|
|
113
|
+
declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, ReturnType<typeof JSON.parse>> = Record<string, ReturnType<typeof JSON.parse>>> {
|
|
114
|
+
static _configuration: Configuration | undefined;
|
|
115
|
+
static _initialized: boolean | undefined;
|
|
116
|
+
static _databaseType: string | undefined;
|
|
117
|
+
static _table: import("../drivers/base-table.js").default | undefined;
|
|
118
|
+
static _columns: import("../drivers/base-column.js").default[] | undefined;
|
|
119
|
+
static _databaseIdentifier: string | undefined;
|
|
120
|
+
static _tenantDatabaseIdentifierResolver: string | ((args: {
|
|
121
|
+
modelClass: typeof VelociousDatabaseRecord;
|
|
122
|
+
tenant: Record<string, unknown> | null | undefined;
|
|
123
|
+
}) => string | undefined) | undefined;
|
|
124
|
+
static _primaryKey: string | undefined;
|
|
125
|
+
static _tableName: string | undefined;
|
|
126
|
+
static _translationClass: {
|
|
127
|
+
new (changes?: Record<string, any>): {
|
|
128
|
+
/**
|
|
129
|
+
* Attributes.
|
|
130
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
131
|
+
_attributes: Record<string, ReturnType<typeof JSON.parse>>;
|
|
132
|
+
/**
|
|
133
|
+
* Changes.
|
|
134
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
135
|
+
_changes: Record<string, ReturnType<typeof JSON.parse>>;
|
|
136
|
+
/**
|
|
137
|
+
* Changes captured before a create audit is written.
|
|
138
|
+
* @type {import("./auditing.js").AuditChanges | undefined} */
|
|
139
|
+
_pendingCreateAuditChanges: import("./auditing.js").AuditChanges | undefined;
|
|
140
|
+
/**
|
|
141
|
+
* Changes captured before an update audit is written.
|
|
142
|
+
* @type {import("./auditing.js").AuditChanges | undefined} */
|
|
143
|
+
_pendingUpdateAuditChanges: import("./auditing.js").AuditChanges | undefined;
|
|
144
|
+
/**
|
|
145
|
+
* Attribute names explicitly assigned in the current update call.
|
|
146
|
+
* @type {Set<string> | undefined}
|
|
147
|
+
*/
|
|
148
|
+
_assignedAttributeNames: Set<string> | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Columns as hash.
|
|
151
|
+
* @type {Record<string, import("../drivers/base-column.js").default>} */
|
|
152
|
+
_columnsAsHash: Record<string, import("../drivers/base-column.js").default>;
|
|
153
|
+
/**
|
|
154
|
+
* Connection.
|
|
155
|
+
* @type {import("../drivers/base.js").default | undefined} */
|
|
156
|
+
__connection: import("../drivers/base.js").default | undefined;
|
|
157
|
+
/**
|
|
158
|
+
* Explicit operation owning this record's database work.
|
|
159
|
+
* @type {import("../operation.js").default | undefined} */
|
|
160
|
+
_databaseOperation: import("../operation.js").default | undefined;
|
|
161
|
+
/**
|
|
162
|
+
* Instance relationships.
|
|
163
|
+
* @type {Record<string, import("./instance-relationships/base.js").default>} */
|
|
164
|
+
_instanceRelationships: Record<string, import("./instance-relationships/base.js").default>;
|
|
165
|
+
/**
|
|
166
|
+
* Attachments.
|
|
167
|
+
* @type {Record<string, RecordAttachmentHandle>} */
|
|
168
|
+
_attachments: Record<string, RecordAttachmentHandle>;
|
|
169
|
+
/**
|
|
170
|
+
* Load cohort.
|
|
171
|
+
* @type {Array<VelociousDatabaseRecord> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-preload.
|
|
172
|
+
*/
|
|
173
|
+
_loadCohort: Array<VelociousDatabaseRecord> | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Table name.
|
|
176
|
+
* @type {string | undefined} */
|
|
177
|
+
__tableName: string | undefined;
|
|
178
|
+
/**
|
|
179
|
+
* Validation errors.
|
|
180
|
+
* @type {Record<string, ValidationErrorObjectType[]>} */
|
|
181
|
+
_validationErrors: Record<string, ValidationErrorObjectType[]>;
|
|
182
|
+
/**
|
|
183
|
+
* Runs get relationship by name.
|
|
184
|
+
* @param {string} relationshipName - Relationship name.
|
|
185
|
+
* @returns {import("./instance-relationships/base.js").default} - The relationship by name.
|
|
186
|
+
*/
|
|
187
|
+
getRelationshipByName(relationshipName: string): import("./instance-relationships/base.js").default;
|
|
188
|
+
/**
|
|
189
|
+
* Preloads relationship(s) onto this already-loaded record. Accepts either a
|
|
190
|
+
* query built via `Model.preload(...).select(...)` or a raw preload spec
|
|
191
|
+
* (string / array / nested object). A relationship that is already preloaded
|
|
192
|
+
* with all the required columns present is left untouched unless `force` is
|
|
193
|
+
* set. Preloading onto the relationship cache lets later accessors reuse the
|
|
194
|
+
* loaded data instead of issuing identical queries.
|
|
195
|
+
* @param {import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
|
|
196
|
+
* @param {{force?: boolean}} [options] - Options.
|
|
197
|
+
* @returns {Promise<void>} - Resolves when preloading completes.
|
|
198
|
+
*/
|
|
199
|
+
preload(queryOrSpec: import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>, options?: {
|
|
200
|
+
force?: boolean;
|
|
201
|
+
}): Promise<void>;
|
|
202
|
+
/**
|
|
203
|
+
* Runs load relationship.
|
|
204
|
+
* @param {string} relationshipName - Relationship name.
|
|
205
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
|
|
206
|
+
*/
|
|
207
|
+
loadRelationship(relationshipName: string): Promise<ReturnType<typeof JSON.parse>>;
|
|
208
|
+
/**
|
|
209
|
+
* Runs relationship or load.
|
|
210
|
+
* @param {string} relationshipName - Relationship name.
|
|
211
|
+
* @param {{preloadTranslations?: boolean}} [options] - Load options.
|
|
212
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
|
|
213
|
+
*/
|
|
214
|
+
relationshipOrLoad(relationshipName: string, options?: {
|
|
215
|
+
preloadTranslations?: boolean;
|
|
216
|
+
}): Promise<ReturnType<typeof JSON.parse>>;
|
|
217
|
+
/**
|
|
218
|
+
* Preloads translations on a loaded relationship target when explicitly requested.
|
|
219
|
+
* @param {ReturnType<typeof JSON.parse>} loaded - Loaded relationship value.
|
|
220
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Relationship value after translation preload.
|
|
221
|
+
*/
|
|
222
|
+
_preloadLoadedRelationshipTranslations(loaded: ReturnType<typeof JSON.parse>): Promise<ReturnType<typeof JSON.parse>>;
|
|
223
|
+
/**
|
|
224
|
+
* Runs get attachment by name.
|
|
225
|
+
* @param {string} attachmentName - Attachment name.
|
|
226
|
+
* @returns {RecordAttachmentHandle} - Attachment handle.
|
|
227
|
+
*/
|
|
228
|
+
getAttachmentByName(attachmentName: string): RecordAttachmentHandle;
|
|
229
|
+
/**
|
|
230
|
+
* Runs get configuration.
|
|
231
|
+
* @returns {import("../../configuration.js").default} - The configuration.
|
|
232
|
+
*/
|
|
233
|
+
_getConfiguration(): import("../../configuration.js").default;
|
|
234
|
+
/**
|
|
235
|
+
* Runs has attribute.
|
|
236
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to use.
|
|
237
|
+
* @returns {boolean} - Whether attribute.
|
|
238
|
+
*/
|
|
239
|
+
_hasAttribute(value: ReturnType<typeof JSON.parse>): boolean;
|
|
240
|
+
/**
|
|
241
|
+
* Runs get attribute.
|
|
242
|
+
* @param {string} name - Name.
|
|
243
|
+
* @returns {ReturnType<typeof JSON.parse>} - The attribute.
|
|
244
|
+
*/
|
|
245
|
+
getAttribute(name: string): ReturnType<typeof JSON.parse>;
|
|
246
|
+
/**
|
|
247
|
+
* Runs get model class.
|
|
248
|
+
* @abstract
|
|
249
|
+
* @returns {typeof VelociousDatabaseRecord} - The model class.
|
|
250
|
+
*/
|
|
251
|
+
getModelClass(): typeof VelociousDatabaseRecord;
|
|
252
|
+
/**
|
|
253
|
+
* Runs set attribute.
|
|
254
|
+
* @param {string} name - Name.
|
|
255
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
256
|
+
* @returns {void} - No return value.
|
|
257
|
+
*/
|
|
258
|
+
setAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
|
|
259
|
+
/**
|
|
260
|
+
* Runs set column attribute.
|
|
261
|
+
* @param {string} name - Name.
|
|
262
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
263
|
+
*/
|
|
264
|
+
_setColumnAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
|
|
265
|
+
/**
|
|
266
|
+
* Clears loaded belongs-to caches when callers assign the foreign key directly.
|
|
267
|
+
* @param {string} columnName - Changed database column name.
|
|
268
|
+
* @param {ReturnType<typeof JSON.parse>} normalizedValue - New normalized column value.
|
|
269
|
+
* @returns {void} - No return value.
|
|
270
|
+
*/
|
|
271
|
+
_clearBelongsToRelationshipForChangedForeignKey(columnName: string, normalizedValue: ReturnType<typeof JSON.parse>): void;
|
|
272
|
+
/**
|
|
273
|
+
* Runs belongs to relationships for foreign key.
|
|
274
|
+
* @param {string} columnName - Changed database column name.
|
|
275
|
+
* @returns {Array<ReturnType<typeof JSON.parse>>} - Loaded relationship instances that use the changed foreign key.
|
|
276
|
+
*/
|
|
277
|
+
_belongsToRelationshipsForForeignKey(columnName: string): Array<ReturnType<typeof JSON.parse>>;
|
|
278
|
+
/**
|
|
279
|
+
* Runs belongs to relationship uses foreign key.
|
|
280
|
+
* @param {object} args - Relationship match arguments.
|
|
281
|
+
* @param {string} args.columnName - Changed database column name.
|
|
282
|
+
* @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
|
|
283
|
+
* @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
|
|
284
|
+
*/
|
|
285
|
+
_belongsToRelationshipUsesForeignKey({ columnName, relationship }: {
|
|
286
|
+
columnName: string;
|
|
287
|
+
relationship: ReturnType<typeof JSON.parse>;
|
|
288
|
+
}): boolean;
|
|
289
|
+
/**
|
|
290
|
+
* Runs belongs to relationship matches foreign key value.
|
|
291
|
+
* @param {object} args - Relationship cache arguments.
|
|
292
|
+
* @param {ReturnType<typeof JSON.parse>} args.normalizedValue - New normalized column value.
|
|
293
|
+
* @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
|
|
294
|
+
* @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
|
|
295
|
+
*/
|
|
296
|
+
_belongsToRelationshipMatchesForeignKeyValue({ normalizedValue, relationship }: {
|
|
297
|
+
normalizedValue: ReturnType<typeof JSON.parse>;
|
|
298
|
+
relationship: ReturnType<typeof JSON.parse>;
|
|
299
|
+
}): boolean;
|
|
300
|
+
/**
|
|
301
|
+
* Returns the foreign key value for a belongs-to relationship assignment.
|
|
302
|
+
* @param {object} args - Relationship assignment arguments.
|
|
303
|
+
* @param {VelociousDatabaseRecord | null | undefined} args.model - Assigned model.
|
|
304
|
+
* @param {import("./instance-relationships/base.js").default} args.relationship - Belongs-to relationship instance.
|
|
305
|
+
* @returns {string | number | null | undefined} - Foreign key value for the assignment.
|
|
306
|
+
*/
|
|
307
|
+
_belongsToForeignKeyValue({ model, relationship }: {
|
|
308
|
+
model: VelociousDatabaseRecord | null | undefined;
|
|
309
|
+
relationship: import("./instance-relationships/base.js").default;
|
|
310
|
+
}): string | number | null | undefined;
|
|
311
|
+
/**
|
|
312
|
+
* Runs clear loaded belongs to relationship.
|
|
313
|
+
* @param {ReturnType<typeof JSON.parse>} relationship - Relationship instance.
|
|
314
|
+
* @returns {void} - No return value.
|
|
315
|
+
*/
|
|
316
|
+
_clearLoadedBelongsToRelationship(relationship: ReturnType<typeof JSON.parse>): void;
|
|
317
|
+
/**
|
|
318
|
+
* Runs normalize date value.
|
|
319
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to use.
|
|
320
|
+
* @returns {ReturnType<typeof JSON.parse>} - The date value.
|
|
321
|
+
*/
|
|
322
|
+
_normalizeDateValue(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
323
|
+
/**
|
|
324
|
+
* Runs normalize sqlite boolean value.
|
|
325
|
+
* @param {object} args - Options object.
|
|
326
|
+
* @param {string | undefined} args.columnType - Column type.
|
|
327
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
328
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
329
|
+
*/
|
|
330
|
+
_normalizeSqliteBooleanValue({ columnType, value }: {
|
|
331
|
+
columnType: string | undefined;
|
|
332
|
+
value: ReturnType<typeof JSON.parse>;
|
|
333
|
+
}): ReturnType<typeof JSON.parse>;
|
|
334
|
+
/**
|
|
335
|
+
* Normalizes a boolean value before storing. A declared `"boolean"` attribute cast stores
|
|
336
|
+
* booleans as 1/0 only for integer-backed columns (e.g. an MSSQL `bit`). Columns whose
|
|
337
|
+
* underlying type is already a native boolean (e.g. Postgres `boolean`) keep `true`/`false`
|
|
338
|
+
* so the driver can emit the proper boolean literal; otherwise the sqlite-only normalizer applies.
|
|
339
|
+
* @param {object} args - Options object.
|
|
340
|
+
* @param {string} args.attributeName - Attribute name being written.
|
|
341
|
+
* @param {string | undefined} args.columnType - Column type.
|
|
342
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
343
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
344
|
+
*/
|
|
345
|
+
_normalizeBooleanValueForWrite({ attributeName, columnType, value }: {
|
|
346
|
+
attributeName: string;
|
|
347
|
+
columnType: string | undefined;
|
|
348
|
+
value: ReturnType<typeof JSON.parse>;
|
|
349
|
+
}): ReturnType<typeof JSON.parse>;
|
|
350
|
+
/**
|
|
351
|
+
* Runs save.
|
|
352
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
353
|
+
*/
|
|
354
|
+
save(): Promise<void>;
|
|
355
|
+
_autoSaveBelongsToRelationships(): Promise<{
|
|
356
|
+
savedCount: number;
|
|
357
|
+
}>;
|
|
358
|
+
_autoSaveHasManyAndHasOneRelationshipsToSave(): import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>[];
|
|
359
|
+
/**
|
|
360
|
+
* Resolves a relationship foreign-key column to this model's public attribute name.
|
|
361
|
+
* @param {import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>} instanceRelationship - Relationship instance.
|
|
362
|
+
* @returns {string} Attribute name accepted by setAttribute/assign.
|
|
363
|
+
*/
|
|
364
|
+
_relationshipForeignKeyAttribute(instanceRelationship: import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>): string;
|
|
365
|
+
/**
|
|
366
|
+
* Runs auto save has many and has one relationships.
|
|
367
|
+
* @param {object} args - Options object.
|
|
368
|
+
* @param {boolean} args.isNewRecord - Whether is new record.
|
|
369
|
+
*/
|
|
370
|
+
_autoSaveHasManyAndHasOneRelationships({ isNewRecord }: {
|
|
371
|
+
isNewRecord: boolean;
|
|
372
|
+
}): Promise<void>;
|
|
373
|
+
/**
|
|
374
|
+
* Runs auto save attachments.
|
|
375
|
+
* @returns {Promise<void>} - Resolves when pending attachments have been saved.
|
|
376
|
+
*/
|
|
377
|
+
_autoSaveAttachments(): Promise<void>;
|
|
378
|
+
/**
|
|
379
|
+
* Runs translations loaded.
|
|
380
|
+
* @abstract
|
|
381
|
+
* @returns {TranslationBase[]} - The translations loaded.
|
|
382
|
+
*/
|
|
383
|
+
translationsLoaded(): TranslationBase[];
|
|
384
|
+
/**
|
|
385
|
+
* Runs get translated attribute.
|
|
386
|
+
* @param {string} name - Name.
|
|
387
|
+
* @param {string} locale - Locale.
|
|
388
|
+
* @returns {string | undefined} - The translated attribute, if found.
|
|
389
|
+
*/
|
|
390
|
+
_getTranslatedAttribute(name: string, locale: string): string | undefined;
|
|
391
|
+
/**
|
|
392
|
+
* Runs get translated attribute with fallback.
|
|
393
|
+
* @param {string} name - Name.
|
|
394
|
+
* @param {string} locale - Locale.
|
|
395
|
+
* @returns {string | undefined} - The translated attribute with fallback, if found.
|
|
396
|
+
*/
|
|
397
|
+
_getTranslatedAttributeWithFallback(name: string, locale: string): string | undefined;
|
|
398
|
+
/**
|
|
399
|
+
* Runs set translated attribute.
|
|
400
|
+
* @param {string} name - Name.
|
|
401
|
+
* @param {string} locale - Locale.
|
|
402
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
403
|
+
* @returns {void} - No return value.
|
|
404
|
+
*/
|
|
405
|
+
_setTranslatedAttribute(name: string, locale: string, newValue: ReturnType<typeof JSON.parse>): void;
|
|
406
|
+
_isNewRecord: boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Binds future query, lifecycle, relationship, and persistence work to an operation.
|
|
409
|
+
* @param {import("../operation.js").default} operation - Owning operation.
|
|
410
|
+
* @returns {this} - Bound record.
|
|
411
|
+
*/
|
|
412
|
+
bindDatabaseOperation(operation: import("../operation.js").default): /*elided*/ any;
|
|
413
|
+
/**
|
|
414
|
+
* Releases this record from a completed eager-helper operation while
|
|
415
|
+
* preserving the legacy ambient follow-up behavior of `usingTenant` finders.
|
|
416
|
+
* @param {import("../operation.js").default} operation - Releasing operation.
|
|
417
|
+
* @returns {this} - Record.
|
|
418
|
+
*/
|
|
419
|
+
releaseDatabaseOperation(operation: import("../operation.js").default): /*elided*/ any;
|
|
420
|
+
/**
|
|
421
|
+
* Returns the explicit operation owning this record, if any.
|
|
422
|
+
* @returns {import("../operation.js").default | undefined} - Owning operation.
|
|
423
|
+
*/
|
|
424
|
+
databaseOperation(): import("../operation.js").default | undefined;
|
|
425
|
+
/**
|
|
426
|
+
* Binds a related record to the same operation as this record.
|
|
427
|
+
* @template {VelociousDatabaseRecord} Model
|
|
428
|
+
* @param {Model} record - Related record.
|
|
429
|
+
* @returns {Model} - Related record.
|
|
430
|
+
*/
|
|
431
|
+
bindRelatedRecord<Model extends VelociousDatabaseRecord>(record: Model): Model;
|
|
432
|
+
/**
|
|
433
|
+
* Builds a model query preserving this record's operation ownership.
|
|
434
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
435
|
+
* @param {MC} ModelClass - Target model class.
|
|
436
|
+
* @returns {ModelClassQuery<MC>} - Target query.
|
|
437
|
+
*/
|
|
438
|
+
queryForModel<MC extends typeof VelociousDatabaseRecord>(ModelClass: MC): ModelClassQuery<MC>;
|
|
439
|
+
/**
|
|
440
|
+
* Initializes a relationship/preload target without dropping this record's
|
|
441
|
+
* explicit operation connection.
|
|
442
|
+
* @param {typeof VelociousDatabaseRecord} ModelClass - Target model class.
|
|
443
|
+
* @param {import("../../configuration.js").default} configuration - Owning configuration.
|
|
444
|
+
* @returns {Promise<void>} - Resolves when initialized.
|
|
445
|
+
*/
|
|
446
|
+
ensureModelClassInitialized(ModelClass: typeof VelociousDatabaseRecord, configuration: import("../../configuration.js").default): Promise<void>;
|
|
447
|
+
/**
|
|
448
|
+
* Runs load existing record.
|
|
449
|
+
* @param {object} attributes - Attributes.
|
|
450
|
+
* @returns {void} - No return value.
|
|
451
|
+
*/
|
|
452
|
+
loadExistingRecord(attributes: object): void;
|
|
453
|
+
/**
|
|
454
|
+
* Assigns the given attributes to the record.
|
|
455
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} attributesToAssign - Attributes to assign.
|
|
456
|
+
* @returns {void} - No return value.
|
|
457
|
+
*/
|
|
458
|
+
assign(attributesToAssign: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
459
|
+
/**
|
|
460
|
+
* Returns a the current attributes of the record (original attributes from database plus changes)
|
|
461
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - The attributes.
|
|
462
|
+
*/
|
|
463
|
+
attributes(): Record<string, ReturnType<typeof JSON.parse>>;
|
|
464
|
+
/**
|
|
465
|
+
* Returns column-name keyed data (original attributes from database plus changes)
|
|
466
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - The raw attributes.
|
|
467
|
+
*/
|
|
468
|
+
rawAttributes(): Record<string, ReturnType<typeof JSON.parse>>;
|
|
469
|
+
/**
|
|
470
|
+
* Runs connection.
|
|
471
|
+
* @returns {import("../drivers/base.js").default} - The connection.
|
|
472
|
+
*/
|
|
473
|
+
_connection(): import("../drivers/base.js").default;
|
|
474
|
+
/**
|
|
475
|
+
* Returns the connection that owns this record's database work.
|
|
476
|
+
* @returns {import("../drivers/base.js").default} - Connection.
|
|
477
|
+
*/
|
|
478
|
+
connection(): import("../drivers/base.js").default;
|
|
479
|
+
/**
|
|
480
|
+
* Counts dependent records for a `dependent: "restrict"` relationship.
|
|
481
|
+
* @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
|
|
482
|
+
* @returns {Promise<number>} - Dependent row count.
|
|
483
|
+
*/
|
|
484
|
+
_dependentRestrictCount(instanceRelationship: RestrictInstanceRelationship): Promise<number>;
|
|
485
|
+
/**
|
|
486
|
+
* Counts tenant-scoped dependent records across all provider-listed tenants.
|
|
487
|
+
* @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
|
|
488
|
+
* @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
|
|
489
|
+
* @returns {Promise<number>} - Dependent row count.
|
|
490
|
+
*/
|
|
491
|
+
_dependentRestrictTenantCount(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord): Promise<number>;
|
|
492
|
+
/**
|
|
493
|
+
* Counts tenant-scoped dependent records for one configured tenant provider.
|
|
494
|
+
* @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
|
|
495
|
+
* @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
|
|
496
|
+
* @param {string} identifier - Tenant database identifier.
|
|
497
|
+
* @param {TenantDatabaseProviderType} provider - Tenant database provider.
|
|
498
|
+
* @returns {Promise<number>} - Dependent row count.
|
|
499
|
+
*/
|
|
500
|
+
_dependentRestrictProviderCount(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<number>;
|
|
501
|
+
/**
|
|
502
|
+
* Lists restrict-check tenants for one configured tenant provider.
|
|
503
|
+
* @param {RestrictInstanceRelationship} instanceRelationship - Relationship instance to count.
|
|
504
|
+
* @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
|
|
505
|
+
* @param {string} identifier - Tenant database identifier.
|
|
506
|
+
* @param {TenantDatabaseProviderType} provider - Tenant database provider.
|
|
507
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Listed tenant objects.
|
|
508
|
+
*/
|
|
509
|
+
_dependentRestrictProviderTenants(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<Array<ReturnType<typeof JSON.parse>>>;
|
|
510
|
+
/**
|
|
511
|
+
* Destroys the record in the database and all of its dependent records.
|
|
512
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
513
|
+
*/
|
|
514
|
+
destroy(): Promise<void>;
|
|
515
|
+
/**
|
|
516
|
+
* Emits a committed record-change event after the surrounding transaction
|
|
517
|
+
* commits, so live queries re-run uniformly for local writes, pull applies, and
|
|
518
|
+
* realtime applies (which all end as local saves/destroys). Registered through
|
|
519
|
+
* the connection's afterCommit hook so a rolled-back save emits nothing, and
|
|
520
|
+
* skipped entirely when nothing observes this model class so server-side saves
|
|
521
|
+
* stay free of live-query overhead.
|
|
522
|
+
* @param {import("../record-changes.js").RecordChangeOperation} operation - The committed operation.
|
|
523
|
+
* @returns {Promise<void>}
|
|
524
|
+
*/
|
|
525
|
+
_emitRecordChangeAfterCommit(operation: import("../record-changes.js").RecordChangeOperation): Promise<void>;
|
|
526
|
+
/**
|
|
527
|
+
* Stores an audit row for this record.
|
|
528
|
+
* @param {import("./auditing.js").CreateAuditArgs} args - Audit row options.
|
|
529
|
+
* @returns {Promise<number | string>} Created audit row id.
|
|
530
|
+
*/
|
|
531
|
+
createAudit(args: import("./auditing.js").CreateAuditArgs): Promise<number | string>;
|
|
532
|
+
/**
|
|
533
|
+
* Captures create changes before persistence clears the change set.
|
|
534
|
+
* @returns {void}
|
|
535
|
+
*/
|
|
536
|
+
captureCreateAuditChanges(): void;
|
|
537
|
+
/**
|
|
538
|
+
* Writes the create audit row.
|
|
539
|
+
* @returns {Promise<void>}
|
|
540
|
+
*/
|
|
541
|
+
createCreateAudit(): Promise<void>;
|
|
542
|
+
/**
|
|
543
|
+
* Captures update changes before persistence clears the change set.
|
|
544
|
+
* @returns {void}
|
|
545
|
+
*/
|
|
546
|
+
captureUpdateAuditChanges(): void;
|
|
547
|
+
/**
|
|
548
|
+
* Writes the update audit row.
|
|
549
|
+
* @returns {Promise<void>}
|
|
550
|
+
*/
|
|
551
|
+
createUpdateAudit(): Promise<void>;
|
|
552
|
+
/**
|
|
553
|
+
* Writes the destroy audit row.
|
|
554
|
+
* @returns {Promise<void>}
|
|
555
|
+
*/
|
|
556
|
+
createDestroyAudit(): Promise<void>;
|
|
557
|
+
/**
|
|
558
|
+
* Runs run lifecycle callbacks.
|
|
559
|
+
* @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
|
|
560
|
+
* @returns {Promise<void>}
|
|
561
|
+
*/
|
|
562
|
+
_runLifecycleCallbacks(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"): Promise<void>;
|
|
563
|
+
/**
|
|
564
|
+
* Runs has changes.
|
|
565
|
+
* @returns {boolean} - Whether changes.
|
|
566
|
+
*/
|
|
567
|
+
_hasChanges(): boolean;
|
|
568
|
+
/**
|
|
569
|
+
* Returns true if the model has been changed since it was loaded from the database.
|
|
570
|
+
* @returns {boolean} - Whether changed.
|
|
571
|
+
*/
|
|
572
|
+
isChanged(): boolean;
|
|
573
|
+
/**
|
|
574
|
+
* Returns the changes that have been made to this record since it was loaded from the database.
|
|
575
|
+
* @returns {Record<string, Array<ReturnType<typeof JSON.parse>>>} - The changes.
|
|
576
|
+
*/
|
|
577
|
+
changes(): Record<string, Array<ReturnType<typeof JSON.parse>>>;
|
|
578
|
+
/**
|
|
579
|
+
* Runs table name.
|
|
580
|
+
* @returns {string} - The table name.
|
|
581
|
+
*/
|
|
582
|
+
_tableName(): string;
|
|
583
|
+
/**
|
|
584
|
+
* Reads an attribute value from the record. Read dynamically by name, so the value can be any
|
|
585
|
+
* column type and may be overridden by a user-defined getter on the model.
|
|
586
|
+
* @template V
|
|
587
|
+
* @param {string} attributeName The name of the attribute to read. This is the attribute name, not the column name.
|
|
588
|
+
* @returns {V} The attribute value, typed by the caller's accessor contract.
|
|
589
|
+
*/
|
|
590
|
+
readAttribute<V>(attributeName: string): V;
|
|
591
|
+
/**
|
|
592
|
+
* Read an association count attached by `.withCount(...)`. Counts are
|
|
593
|
+
* stored on a separate map from the record's `_attributes` so a
|
|
594
|
+
* virtual count like `tasksCount` cannot silently shadow a real
|
|
595
|
+
* column of the same name. Returns the attached number, or 0 when
|
|
596
|
+
* `.withCount(...)` wasn't requested for this attribute.
|
|
597
|
+
* @param {string} attributeName - Attribute name, e.g. `"tasksCount"` or a custom `"activeMembersCount"` from `.withCount({activeMembersCount: {...}})`.
|
|
598
|
+
* @returns {number} - Attached association count, or zero when absent.
|
|
599
|
+
*/
|
|
600
|
+
readCount(attributeName: string): number;
|
|
601
|
+
/**
|
|
602
|
+
* Attach an association count to this record. Internal helper used by
|
|
603
|
+
* the `withCount` runner; outside code should not call this directly.
|
|
604
|
+
* @param {string} attributeName - Attribute name.
|
|
605
|
+
* @param {number} value - Count value.
|
|
606
|
+
* @returns {void}
|
|
607
|
+
*/
|
|
608
|
+
_setAssociationCount(attributeName: string, value: number): void;
|
|
609
|
+
/**
|
|
610
|
+
* All attached association counts as a plain object. Used by the
|
|
611
|
+
* frontend-model serializer to ship counts alongside the record
|
|
612
|
+
* attributes on the wire.
|
|
613
|
+
* @returns {Record<string, number>} - Association counts keyed by attribute name.
|
|
614
|
+
*/
|
|
615
|
+
associationCounts(): Record<string, number>;
|
|
616
|
+
/**
|
|
617
|
+
* Read a value attached by `.queryData(...)`. Stored on a dedicated
|
|
618
|
+
* map rather than on `_attributes`, so a virtual queryData key like
|
|
619
|
+
* `transportSecondsSum` cannot silently shadow a real column of the
|
|
620
|
+
* same name. Returns `null` when the key wasn't produced by any
|
|
621
|
+
* registered fn for this record (e.g. no child rows matched the
|
|
622
|
+
* aggregate).
|
|
623
|
+
* @param {string} name - queryData attribute name (matches a SELECT alias from the registered fn).
|
|
624
|
+
* @returns {ReturnType<typeof JSON.parse>} - Attached query-data value.
|
|
625
|
+
*/
|
|
626
|
+
queryData(name: string): ReturnType<typeof JSON.parse>;
|
|
627
|
+
/**
|
|
628
|
+
* Attach a queryData value to this record. Internal helper used by
|
|
629
|
+
* the `queryData` runner and by frontend-model hydration; outside
|
|
630
|
+
* code should not call this directly.
|
|
631
|
+
* @param {string} name - queryData attribute name.
|
|
632
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to attach.
|
|
633
|
+
* @returns {void}
|
|
634
|
+
*/
|
|
635
|
+
_setQueryData(name: string, value: ReturnType<typeof JSON.parse>): void;
|
|
636
|
+
/**
|
|
637
|
+
* All attached queryData values as a plain object. Used by the
|
|
638
|
+
* frontend-model serializer to ship queryData alongside the record
|
|
639
|
+
* attributes on the wire.
|
|
640
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Query-data values keyed by name.
|
|
641
|
+
*/
|
|
642
|
+
queryDataValues(): Record<string, ReturnType<typeof JSON.parse>>;
|
|
643
|
+
/**
|
|
644
|
+
* Read a per-record ability result attached by `.abilities(...)`. The
|
|
645
|
+
* backend evaluates each requested action against the current ability
|
|
646
|
+
* for this record instance and ships the result alongside the
|
|
647
|
+
* record's attributes. Returns `false` when the action wasn't
|
|
648
|
+
* requested for this record — so UI code can safely branch on
|
|
649
|
+
* `record.can("update")` without first checking whether the ability
|
|
650
|
+
* was loaded.
|
|
651
|
+
* @param {string} action - Ability action name, e.g. `"update"`.
|
|
652
|
+
* @returns {boolean} - Whether the requested ability is allowed.
|
|
653
|
+
*/
|
|
654
|
+
can(action: string): boolean;
|
|
655
|
+
/**
|
|
656
|
+
* Attach a per-record ability result to this record. Internal helper
|
|
657
|
+
* used by the `abilities` runner and by frontend-model hydration;
|
|
658
|
+
* outside code should not call this directly.
|
|
659
|
+
* @param {string} action - Ability action name.
|
|
660
|
+
* @param {boolean} value - Whether the current ability permits the action on this record.
|
|
661
|
+
* @returns {void}
|
|
662
|
+
*/
|
|
663
|
+
_setComputedAbility(action: string, value: boolean): void;
|
|
664
|
+
/**
|
|
665
|
+
* All attached per-record ability results as a plain object. Used
|
|
666
|
+
* by the frontend-model serializer to ship results alongside the
|
|
667
|
+
* record attributes on the wire.
|
|
668
|
+
* @returns {Record<string, boolean>} - Ability results keyed by action.
|
|
669
|
+
*/
|
|
670
|
+
computedAbilities(): Record<string, boolean>;
|
|
671
|
+
/**
|
|
672
|
+
* Reads a column value from the record.
|
|
673
|
+
* @param {string} attributeName The name of the column to read. This is the column name, not the attribute name.
|
|
674
|
+
* @returns {ReturnType<typeof JSON.parse>} - The column.
|
|
675
|
+
*/
|
|
676
|
+
readColumn(attributeName: string): ReturnType<typeof JSON.parse>;
|
|
677
|
+
/**
|
|
678
|
+
* Resolves any declared per-attribute cast for a database column name.
|
|
679
|
+
* @param {string} columnName - Database column name.
|
|
680
|
+
* @returns {string | undefined} - Declared cast type, or undefined when none is declared.
|
|
681
|
+
*/
|
|
682
|
+
_declaredAttributeCastForColumn(columnName: string): string | undefined;
|
|
683
|
+
/**
|
|
684
|
+
* Converts a stored value to a real boolean for a declared `"boolean"` cast.
|
|
685
|
+
* Leaves null/undefined untouched; treats 1/true/"1" as true and 0/false/"0" as false.
|
|
686
|
+
* @param {ReturnType<typeof JSON.parse>} value - Stored database value.
|
|
687
|
+
* @returns {ReturnType<typeof JSON.parse>} - Converted boolean, or the original value when not recognized.
|
|
688
|
+
*/
|
|
689
|
+
_castDeclaredBooleanForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
690
|
+
/**
|
|
691
|
+
* Whether a column value is currently loaded on this record (either as a
|
|
692
|
+
* persisted attribute or a pending change). Used to decide whether a preload
|
|
693
|
+
* can be skipped because the required columns are already present.
|
|
694
|
+
* @param {string} columnName - The column name to check.
|
|
695
|
+
* @returns {boolean} - Whether the column is loaded.
|
|
696
|
+
*/
|
|
697
|
+
hasLoadedColumn(columnName: string): boolean;
|
|
698
|
+
/**
|
|
699
|
+
* Runs normalize boolean value for read. A declared `"boolean"` attribute cast converts the
|
|
700
|
+
* stored value (e.g. an MSSQL `bit` 0/1) to a real boolean; otherwise the existing
|
|
701
|
+
* introspected-type normalization applies (no behaviour change for non-declared columns).
|
|
702
|
+
* @param {object} args - Options object.
|
|
703
|
+
* @param {string} args.columnName - Database column name being read.
|
|
704
|
+
* @param {string | undefined} args.columnType - Column type.
|
|
705
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
706
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
707
|
+
*/
|
|
708
|
+
_normalizeBooleanValueForRead({ columnName, columnType, value }: {
|
|
709
|
+
columnName: string;
|
|
710
|
+
columnType: string | undefined;
|
|
711
|
+
value: ReturnType<typeof JSON.parse>;
|
|
712
|
+
}): ReturnType<typeof JSON.parse>;
|
|
713
|
+
/**
|
|
714
|
+
* Runs normalize date value for read.
|
|
715
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value from database.
|
|
716
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
717
|
+
*/
|
|
718
|
+
_normalizeDateValueForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
719
|
+
_belongsToChanges(): Record<string, any>;
|
|
720
|
+
/**
|
|
721
|
+
* Runs create new record.
|
|
722
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
723
|
+
*/
|
|
724
|
+
_createNewRecord(): Promise<void>;
|
|
725
|
+
/**
|
|
726
|
+
* Marks only relationships with in-memory loaded values as preloaded after create.
|
|
727
|
+
* @returns {void} - No return value.
|
|
728
|
+
*/
|
|
729
|
+
_markLoadedRelationshipsPreloadedAfterCreate(): void;
|
|
730
|
+
/**
|
|
731
|
+
* Applies the database insert response to this record.
|
|
732
|
+
* @param {{connection: import("../drivers/base.js").default, data: Record<string, string | number | boolean | Date | null | undefined>, insertResult: Array<Record<string, string | number | boolean | Date | null | undefined>> | null | undefined, primaryKey: string}} options - Pinned insert connection, inserted data, connection result, and primary key column name.
|
|
733
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
734
|
+
*/
|
|
735
|
+
_applyInsertResult({ connection, data, insertResult, primaryKey }: {
|
|
736
|
+
connection: import("../drivers/base.js").default;
|
|
737
|
+
data: Record<string, string | number | boolean | Date | null | undefined>;
|
|
738
|
+
insertResult: Array<Record<string, string | number | boolean | Date | null | undefined>> | null | undefined;
|
|
739
|
+
primaryKey: string;
|
|
740
|
+
}): Promise<void>;
|
|
741
|
+
/**
|
|
742
|
+
* Sets timestamp defaults for a new record insert.
|
|
743
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
|
|
744
|
+
* @returns {void} - No return value.
|
|
745
|
+
*/
|
|
746
|
+
_setDefaultTimestampValues(data: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
747
|
+
/**
|
|
748
|
+
* Runs normalize date values for write.
|
|
749
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
|
|
750
|
+
* @returns {void} - No return value.
|
|
751
|
+
*/
|
|
752
|
+
_normalizeDateValuesForWrite(data: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
753
|
+
/**
|
|
754
|
+
* Runs update record with changes.
|
|
755
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
756
|
+
*/
|
|
757
|
+
_updateRecordWithChanges(): Promise<void>;
|
|
758
|
+
/**
|
|
759
|
+
* Runs id.
|
|
760
|
+
* @returns {number|string} - The id.
|
|
761
|
+
*/
|
|
762
|
+
id(): number | string;
|
|
763
|
+
/**
|
|
764
|
+
* Runs is persisted.
|
|
765
|
+
* @returns {boolean} - Whether persisted.
|
|
766
|
+
*/
|
|
767
|
+
isPersisted(): boolean;
|
|
768
|
+
/**
|
|
769
|
+
* Runs is new record.
|
|
770
|
+
* @returns {boolean} - Whether new record.
|
|
771
|
+
*/
|
|
772
|
+
isNewRecord(): boolean;
|
|
773
|
+
/**
|
|
774
|
+
* Runs set is new record.
|
|
775
|
+
* @param {boolean} newIsNewRecord - New is new record.
|
|
776
|
+
* @returns {void} - No return value.
|
|
777
|
+
*/
|
|
778
|
+
setIsNewRecord(newIsNewRecord: boolean): void;
|
|
779
|
+
/**
|
|
780
|
+
* Runs reload with id.
|
|
781
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
782
|
+
* @param {string | number} id - Record identifier.
|
|
783
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
784
|
+
*/
|
|
785
|
+
_reloadWithId<MC extends typeof VelociousDatabaseRecord>(id: string | number): Promise<void>;
|
|
786
|
+
/**
|
|
787
|
+
* Runs reload.
|
|
788
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
789
|
+
*/
|
|
790
|
+
reload(): Promise<void>;
|
|
791
|
+
_runValidations(): Promise<void>;
|
|
792
|
+
/**
|
|
793
|
+
* Runs full error messages.
|
|
794
|
+
* @returns {string[]} - The full error messages.
|
|
795
|
+
*/
|
|
796
|
+
fullErrorMessages(): string[];
|
|
797
|
+
/**
|
|
798
|
+
* Assigns the attributes to the record and saves it.
|
|
799
|
+
* @param {WriteAttributes} attributesToAssign - The attributes to assign to the record.
|
|
800
|
+
*/
|
|
801
|
+
update(attributesToAssign: Record<string, any>): Promise<void>;
|
|
802
|
+
};
|
|
803
|
+
/** @type {Record<string, string> | undefined} */
|
|
804
|
+
_attributeNameToColumnName: Record<string, string> | undefined;
|
|
805
|
+
/** @type {Record<string, string> | undefined} */
|
|
806
|
+
_columnNameToAttributeName: Record<string, string> | undefined;
|
|
807
|
+
/** @type {Record<string, object> | undefined} */
|
|
808
|
+
_translations: Record<string, object> | undefined;
|
|
809
|
+
/** @type {Record<string, import("./validators/base.js").default[]> | undefined} */
|
|
810
|
+
_validators: Record<string, import("./validators/base.js").default[]> | undefined;
|
|
811
|
+
/** @type {Record<string, LifecycleCallbackType[]> | undefined} */
|
|
812
|
+
_lifecycleCallbacks: Record<string, LifecycleCallbackType[]> | undefined;
|
|
813
|
+
/** @type {Record<string, typeof import("./validators/base.js").default> | undefined} */
|
|
814
|
+
_validatorTypes: Record<string, typeof import("./validators/base.js").default> | undefined;
|
|
815
|
+
/** @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}> | undefined} */
|
|
816
|
+
_attachmentsMap: Record<string, {
|
|
817
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
818
|
+
type: "hasOne" | "hasMany";
|
|
819
|
+
}> | undefined;
|
|
820
|
+
/** @type {Record<string, import("./relationships/base.js").default> | undefined} */
|
|
821
|
+
_relationships: Record<string, import("./relationships/base.js").default> | undefined;
|
|
822
|
+
/** @type {Record<string, import("../query/query-data.js").QueryDataFn> | undefined} */
|
|
823
|
+
_queryDataRegistrations: Record<string, import("../query/query-data.js").QueryDataFn> | undefined;
|
|
824
|
+
/** @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}> | undefined} */
|
|
825
|
+
_acceptedNestedAttributes: Record<string, {
|
|
826
|
+
allowDestroy?: boolean;
|
|
827
|
+
limit?: number;
|
|
828
|
+
rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
|
|
829
|
+
}> | undefined;
|
|
830
|
+
/** @type {Record<string, string> | undefined} */
|
|
831
|
+
_attributeCasts: Record<string, string> | undefined;
|
|
832
|
+
/** @type {Record<string, import("../drivers/base-column.js").default> | undefined} */
|
|
833
|
+
_columnsAsHash: Record<string, import("../drivers/base-column.js").default> | undefined;
|
|
834
|
+
/** @type {Array<string> | undefined} */
|
|
835
|
+
_columnNames: Array<string> | undefined;
|
|
836
|
+
/** @type {Record<string, string> | undefined} */
|
|
837
|
+
_columnTypeByName: Record<string, string> | undefined;
|
|
838
|
+
/**
|
|
839
|
+
* Narrows the runtime value to the documented type.
|
|
840
|
+
* @type {string | undefined} */
|
|
841
|
+
modelName: string | undefined;
|
|
842
|
+
/**
|
|
843
|
+
* Opt-in client sync declaration consumed by `SyncClient.fromConfiguration(...)`.
|
|
844
|
+
* Declare `static sync = true` (all defaults) or a declaration object like
|
|
845
|
+
* `static sync = {track: ["create", "update"], syncType: "upsert"}` to have the
|
|
846
|
+
* sync client auto-discover this model and derive its resource config from
|
|
847
|
+
* column metadata.
|
|
848
|
+
* @type {import("../../sync/sync-client-types.js").ModelSyncDeclaration | undefined} */
|
|
849
|
+
sync: import("../../sync/sync-client-types.js").ModelSyncDeclaration | undefined;
|
|
850
|
+
/**
|
|
851
|
+
* Narrows the runtime value to the documented type.
|
|
852
|
+
* @type {Promise<void> | null | undefined} */
|
|
853
|
+
_initializeRecordPromise: Promise<void> | null | undefined;
|
|
854
|
+
/**
|
|
855
|
+
* Narrows the runtime value to the documented type.
|
|
856
|
+
* @type {boolean | undefined} */
|
|
857
|
+
_eagerLoadRecordMetadata: boolean | undefined;
|
|
858
|
+
/**
|
|
859
|
+
* Narrows the runtime value to the documented type.
|
|
860
|
+
* @type {Record<string, import("./auditing.js").AuditCallback[]> | undefined} */
|
|
861
|
+
_auditCallbacks: Record<string, import("./auditing.js").AuditCallback[]> | undefined;
|
|
862
|
+
/**
|
|
863
|
+
* Narrows the runtime value to the documented type.
|
|
864
|
+
* @type {boolean | undefined} */
|
|
865
|
+
_auditLifecycleCallbacksRegistered: boolean | undefined;
|
|
866
|
+
/**
|
|
867
|
+
* Returns the model name, preferring an explicit `static modelName` declaration
|
|
868
|
+
* over the JavaScript class `.name` property. This allows minified builds to
|
|
869
|
+
* preserve correct model names without relying on `keep_classnames`.
|
|
870
|
+
* @returns {string} - The model name.
|
|
871
|
+
*/
|
|
872
|
+
getModelName(): string;
|
|
873
|
+
getAttributeNameToColumnNameMap(): Record<string, string>;
|
|
874
|
+
/**
|
|
875
|
+
* Resolves the database column name for a record attribute name.
|
|
876
|
+
* @param {string} attributeName - Attribute name to resolve.
|
|
877
|
+
* @returns {string} - Mapped column name, or the underscored attribute name when no mapping exists.
|
|
878
|
+
*/
|
|
879
|
+
getColumnNameForAttributeName(attributeName: string): string;
|
|
880
|
+
/**
|
|
881
|
+
* Resolves an incoming attribute or column name to the canonical attribute name this model exposes.
|
|
882
|
+
* Accepts the canonical (deburred) attribute name, a raw umlaut/acronym column name, a pre-deburr
|
|
883
|
+
* camelization, and camelCase casing variants (e.g. "vAFunktionID" vs "vAFunktionid"). Returns null
|
|
884
|
+
* when nothing matches, so callers keep their own not-found handling.
|
|
885
|
+
* @param {string} name - Attribute name or column name to resolve.
|
|
886
|
+
* @returns {string | null} - Canonical attribute name, or null.
|
|
887
|
+
*/
|
|
888
|
+
resolveAttributeName(name: string): string | null;
|
|
889
|
+
/**
|
|
890
|
+
* Finds the member name on a target's prototype chain matching `memberName`, falling back to a
|
|
891
|
+
* case-insensitive match. Resolves setters when a read-only attribute alias differs only in camelCase
|
|
892
|
+
* casing from the generated accessor (e.g. a "vAFunktionID" alias whose setter is "setVAFunktionid").
|
|
893
|
+
* @param {object} target - Instance or prototype to search.
|
|
894
|
+
* @param {string} memberName - Member name to find.
|
|
895
|
+
* @returns {string | null} - Matching member name, or null when absent.
|
|
896
|
+
*/
|
|
897
|
+
findMemberNameInsensitive(target: object, memberName: string): string | null;
|
|
898
|
+
/**
|
|
899
|
+
* Runs define scope.
|
|
900
|
+
* @param {(...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>} callback - Scope callback.
|
|
901
|
+
* @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.
|
|
902
|
+
*/
|
|
903
|
+
defineScope(callback: (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>): ((...args: Array<ReturnType<typeof JSON.parse>>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {
|
|
904
|
+
scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../../utils/model-scope.js").ModelScopeDescriptor;
|
|
905
|
+
};
|
|
906
|
+
getColumnNameToAttributeNameMap(): Record<string, string>;
|
|
907
|
+
getTranslationsMap(): Record<string, object>;
|
|
908
|
+
getValidatorsMap(): Record<string, import("./validators/base.js").default[]>;
|
|
909
|
+
/**
|
|
910
|
+
* Runs get lifecycle callbacks map.
|
|
911
|
+
* @returns {Record<string, LifecycleCallbackType[]>} - Lifecycle callbacks keyed by name.
|
|
912
|
+
*/
|
|
913
|
+
getLifecycleCallbacksMap(): Record<string, LifecycleCallbackType[]>;
|
|
914
|
+
getValidatorTypesMap(): Record<string, typeof import("./validators/base.js").default>;
|
|
915
|
+
/**
|
|
916
|
+
* Runs get attachments map.
|
|
917
|
+
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions keyed by name.
|
|
918
|
+
*/
|
|
919
|
+
getAttachmentsMap(): Record<string, {
|
|
920
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
921
|
+
type: "hasOne" | "hasMany";
|
|
922
|
+
}>;
|
|
923
|
+
validatorTypes(): Record<string, typeof import("./validators/base.js").default>;
|
|
924
|
+
/**
|
|
925
|
+
* Runs register validator type.
|
|
926
|
+
* @param {string} name - Name.
|
|
927
|
+
* @param {typeof import("./validators/base.js").default} validatorClass - Validator class.
|
|
928
|
+
*/
|
|
929
|
+
registerValidatorType(name: string, validatorClass: typeof import("./validators/base.js").default): void;
|
|
930
|
+
/**
|
|
931
|
+
* Runs register lifecycle callback.
|
|
932
|
+
* @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
|
|
933
|
+
* @param {LifecycleCallbackType} callback - Callback function or instance method name.
|
|
934
|
+
* @returns {void}
|
|
935
|
+
*/
|
|
936
|
+
registerLifecycleCallback(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation", callback: LifecycleCallbackType): void;
|
|
937
|
+
/**
|
|
938
|
+
* Runs unregister lifecycle callback.
|
|
939
|
+
* @param {"afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation"} callbackName - Callback type.
|
|
940
|
+
* @param {LifecycleCallbackType} callback - Previously registered callback.
|
|
941
|
+
* @returns {void}
|
|
942
|
+
*/
|
|
943
|
+
unregisterLifecycleCallback(callbackName: "afterCreate" | "afterDestroy" | "afterSave" | "afterUpdate" | "beforeCreate" | "beforeDestroy" | "beforeSave" | "beforeUpdate" | "beforeValidation", callback: LifecycleCallbackType): void;
|
|
944
|
+
/**
|
|
945
|
+
* Runs before validation.
|
|
946
|
+
* @template R
|
|
947
|
+
* @this {ModelConstructor<R>}
|
|
948
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
949
|
+
* @returns {void}
|
|
950
|
+
*/
|
|
951
|
+
beforeValidation<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
952
|
+
/**
|
|
953
|
+
* Runs before save.
|
|
954
|
+
* @template R
|
|
955
|
+
* @this {ModelConstructor<R>}
|
|
956
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
957
|
+
* @returns {void}
|
|
958
|
+
*/
|
|
959
|
+
beforeSave<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
960
|
+
/**
|
|
961
|
+
* Runs before create.
|
|
962
|
+
* @template R
|
|
963
|
+
* @this {ModelConstructor<R>}
|
|
964
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
965
|
+
* @returns {void}
|
|
966
|
+
*/
|
|
967
|
+
beforeCreate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
968
|
+
/**
|
|
969
|
+
* Runs before update.
|
|
970
|
+
* @template R
|
|
971
|
+
* @this {ModelConstructor<R>}
|
|
972
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
973
|
+
* @returns {void}
|
|
974
|
+
*/
|
|
975
|
+
beforeUpdate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
976
|
+
/**
|
|
977
|
+
* Runs before destroy.
|
|
978
|
+
* @template R
|
|
979
|
+
* @this {ModelConstructor<R>}
|
|
980
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
981
|
+
* @returns {void}
|
|
982
|
+
*/
|
|
983
|
+
beforeDestroy<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
984
|
+
/**
|
|
985
|
+
* Runs after save.
|
|
986
|
+
* @template R
|
|
987
|
+
* @this {ModelConstructor<R>}
|
|
988
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
989
|
+
* @returns {void}
|
|
990
|
+
*/
|
|
991
|
+
afterSave<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
992
|
+
/**
|
|
993
|
+
* Runs after create.
|
|
994
|
+
* @template R
|
|
995
|
+
* @this {ModelConstructor<R>}
|
|
996
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
997
|
+
* @returns {void}
|
|
998
|
+
*/
|
|
999
|
+
afterCreate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
1000
|
+
/**
|
|
1001
|
+
* Runs after update.
|
|
1002
|
+
* @template R
|
|
1003
|
+
* @this {ModelConstructor<R>}
|
|
1004
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
1005
|
+
* @returns {void}
|
|
1006
|
+
*/
|
|
1007
|
+
afterUpdate<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
1008
|
+
/**
|
|
1009
|
+
* Runs after destroy.
|
|
1010
|
+
* @template R
|
|
1011
|
+
* @this {ModelConstructor<R>}
|
|
1012
|
+
* @param {LifecycleCallbackType<R>} callback - Callback function or instance method name.
|
|
1013
|
+
* @returns {void}
|
|
1014
|
+
*/
|
|
1015
|
+
afterDestroy<R>(this: ModelConstructor<R>, callback: LifecycleCallbackType<R>): void;
|
|
1016
|
+
/**
|
|
1017
|
+
* Enables automatic create/update/destroy auditing for this model.
|
|
1018
|
+
* @returns {void}
|
|
1019
|
+
*/
|
|
1020
|
+
audited(): void;
|
|
1021
|
+
/**
|
|
1022
|
+
* Declares an aasm-style state machine on this model: named states, events
|
|
1023
|
+
* (guarded transitions), and enter/exit + before/after transition hooks. See
|
|
1024
|
+
* `state-machine.js`. Generates `event()` / `eventAndSave()` / `canEvent()`
|
|
1025
|
+
* transition methods per declared event.
|
|
1026
|
+
* @param {import("./state-machine.js").StateMachineDefinition} definition - State machine definition.
|
|
1027
|
+
* @returns {void}
|
|
1028
|
+
*/
|
|
1029
|
+
stateMachine(definition: import("./state-machine.js").StateMachineDefinition): void;
|
|
1030
|
+
/**
|
|
1031
|
+
* Returns this model's state machine definition, or null when it declares none.
|
|
1032
|
+
* `Model.stateMachine(...)` overrides this on classes that declare a machine.
|
|
1033
|
+
* @returns {import("./state-machine.js").StateMachineDefinition | null} - The state machine definition, or null when none is declared.
|
|
1034
|
+
*/
|
|
1035
|
+
getStateMachineDefinition(): import("./state-machine.js").StateMachineDefinition | null;
|
|
1036
|
+
/**
|
|
1037
|
+
* Returns this model's state column, or null when it declares no state machine.
|
|
1038
|
+
* @returns {string | null} - The state column name, or null when no state machine is declared.
|
|
1039
|
+
*/
|
|
1040
|
+
getStateMachineColumn(): string | null;
|
|
1041
|
+
/**
|
|
1042
|
+
* Returns this model's declared state names (empty when it has no state machine).
|
|
1043
|
+
* @returns {string[]} - The declared state names, or an empty array when no state machine is declared.
|
|
1044
|
+
*/
|
|
1045
|
+
getStateMachineStateNames(): string[];
|
|
1046
|
+
/**
|
|
1047
|
+
* Maintains a counter column on a `belongsTo` parent as the sum of a per-record
|
|
1048
|
+
* magnitude, kept current by atomic increments diffed on every create/update/
|
|
1049
|
+
* destroy (and moved between parents when the foreign key changes). See
|
|
1050
|
+
* `counter-cache-magnitude.js`.
|
|
1051
|
+
* @param {import("./counter-cache-magnitude.js").MagnitudeCounterCacheDefinition} definition - Counter cache definition.
|
|
1052
|
+
* @returns {void}
|
|
1053
|
+
*/
|
|
1054
|
+
magnitudeCounterCache(definition: import("./counter-cache-magnitude.js").MagnitudeCounterCacheDefinition): void;
|
|
1055
|
+
/**
|
|
1056
|
+
* Registers a callback invoked after this model writes an audit row for the action.
|
|
1057
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1058
|
+
* @this {MC}
|
|
1059
|
+
* @param {string} action - Audit action name.
|
|
1060
|
+
* @param {import("./auditing.js").AuditCallback} callback - Callback to run after audit creation.
|
|
1061
|
+
* @returns {() => void} Unsubscribe function.
|
|
1062
|
+
*/
|
|
1063
|
+
onAudit<MC extends typeof VelociousDatabaseRecord>(this: MC, action: string, callback: import("./auditing.js").AuditCallback): () => void;
|
|
1064
|
+
/**
|
|
1065
|
+
* Returns records that do not have an audit row for the given action.
|
|
1066
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1067
|
+
* @this {MC}
|
|
1068
|
+
* @param {string} action - Audit action name.
|
|
1069
|
+
* @returns {ModelClassQuery<MC>} Query scoped to records without that audit action.
|
|
1070
|
+
*/
|
|
1071
|
+
withoutAudit<MC extends typeof VelociousDatabaseRecord>(this: MC, action: string): ModelClassQuery<MC>;
|
|
1072
|
+
/**
|
|
1073
|
+
* Runs get validator type.
|
|
1074
|
+
* @param {string} validatorName - Validator name.
|
|
1075
|
+
* @returns {typeof import("./validators/base.js").default} - The validator type.
|
|
1076
|
+
*/
|
|
1077
|
+
getValidatorType(validatorName: string): typeof import("./validators/base.js").default;
|
|
1078
|
+
/**
|
|
1079
|
+
* Runs relationship exists.
|
|
1080
|
+
* @param {string} relationshipName - Relationship name.
|
|
1081
|
+
* @returns {boolean} - Whether relationship exists.
|
|
1082
|
+
*/
|
|
1083
|
+
_relationshipExists(relationshipName: string): boolean;
|
|
1084
|
+
/**
|
|
1085
|
+
* RelationshipScopeCallback type.
|
|
1086
|
+
* @typedef {(query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)} RelationshipScopeCallback
|
|
1087
|
+
*/
|
|
1088
|
+
/**
|
|
1089
|
+
* RelationshipDataArgumentType type.
|
|
1090
|
+
* @typedef {object} RelationshipDataArgumentType
|
|
1091
|
+
* @property {boolean} [autoload] - Disable auto-batch-preload for this relationship by passing false. Default true.
|
|
1092
|
+
* @property {string} [className] - Model class name for the related record.
|
|
1093
|
+
* @property {string} [dependent] - Dependent action when parent is destroyed (e.g. "destroy").
|
|
1094
|
+
* @property {typeof VelociousDatabaseRecord} [klass] - Model class for the related record.
|
|
1095
|
+
* @property {RelationshipScopeCallback} [scope] - Optional scope callback for the relationship.
|
|
1096
|
+
* @property {string} [type] - Relationship type (e.g. "hasMany", "belongsTo").
|
|
1097
|
+
*/
|
|
1098
|
+
/**
|
|
1099
|
+
* Runs define relationship.
|
|
1100
|
+
* @param {string} relationshipName - Relationship name.
|
|
1101
|
+
* @param {RelationshipDataArgumentType} data - Data payload.
|
|
1102
|
+
*/
|
|
1103
|
+
_defineRelationship(relationshipName: string, data: RelationshipDataArgumentType): void;
|
|
1104
|
+
/**
|
|
1105
|
+
* Runs normalize relationship args.
|
|
1106
|
+
* @param {RelationshipScopeCallback | object | undefined} scopeOrOptions - Scope callback or options.
|
|
1107
|
+
* @param {object | undefined} options - Options.
|
|
1108
|
+
* @returns {{scope: (RelationshipScopeCallback | undefined), relationshipOptions: object}} - Normalized arguments.
|
|
1109
|
+
*/
|
|
1110
|
+
_normalizeRelationshipArgs(scopeOrOptions: RelationshipScopeCallback | object | undefined, options: object | undefined): {
|
|
1111
|
+
scope: (RelationshipScopeCallback | undefined);
|
|
1112
|
+
relationshipOptions: object;
|
|
1113
|
+
};
|
|
1114
|
+
/**
|
|
1115
|
+
* Registers afterCreate, afterSave, and afterDestroy callbacks to sync
|
|
1116
|
+
* a counter cache column on the parent model. The column name follows
|
|
1117
|
+
* the convention `<childModelPluralCamelCase>Count`.
|
|
1118
|
+
* @param {string} relationshipName - The belongsTo relationship name.
|
|
1119
|
+
*/
|
|
1120
|
+
_registerCounterCacheCallbacks(relationshipName: string): void;
|
|
1121
|
+
/**
|
|
1122
|
+
* Runs get relationship by name.
|
|
1123
|
+
* @param {string} relationshipName - Relationship name.
|
|
1124
|
+
* @returns {import("./relationships/base.js").default} - The relationship by name.
|
|
1125
|
+
*/
|
|
1126
|
+
getRelationshipByName(relationshipName: string): import("./relationships/base.js").default;
|
|
1127
|
+
/**
|
|
1128
|
+
* Runs get relationships.
|
|
1129
|
+
* @returns {Array<import("./relationships/base.js").default>} - The relationships.
|
|
1130
|
+
*/
|
|
1131
|
+
getRelationships(): Array<import("./relationships/base.js").default>;
|
|
1132
|
+
/**
|
|
1133
|
+
* Runs get relationships map.
|
|
1134
|
+
* @returns {Record<string, import("./relationships/base.js").default>} - Relationship definitions keyed by name.
|
|
1135
|
+
*/
|
|
1136
|
+
getRelationshipsMap(): Record<string, import("./relationships/base.js").default>;
|
|
1137
|
+
/**
|
|
1138
|
+
* Runs get relationship names.
|
|
1139
|
+
* @returns {Array<string>} - The relationship names.
|
|
1140
|
+
*/
|
|
1141
|
+
getRelationshipNames(): Array<string>;
|
|
1142
|
+
/**
|
|
1143
|
+
* Register a consumer-defined queryData entry. The callback receives
|
|
1144
|
+
* a grouped query already joined down the relationship chain from the
|
|
1145
|
+
* root of `.queryData(...)` to this model, already filtered by the
|
|
1146
|
+
* root parent IDs, and with `parent_id` pre-selected — so the fn
|
|
1147
|
+
* only needs to add its own SELECT (and optionally joins/where). Any
|
|
1148
|
+
* aliases the fn selects are attached to each **root** record via
|
|
1149
|
+
* `record.queryData(aliasName)`. Multi-column selects are fine — one
|
|
1150
|
+
* alias maps to one queryData key.
|
|
1151
|
+
*
|
|
1152
|
+
* **Quote AS aliases on PostgreSQL.** PostgreSQL folds unquoted
|
|
1153
|
+
* identifiers (including SELECT aliases) to lowercase, so a
|
|
1154
|
+
* `... AS manualTasksCount` lands in the result row as
|
|
1155
|
+
* `manualtaskscount` while the lookup `record.queryData("manualTasksCount")`
|
|
1156
|
+
* never finds it. Use `driver.quoteColumn("manualTasksCount")` for the
|
|
1157
|
+
* alias to preserve the case on every supported driver:
|
|
1158
|
+
* query.select(`COUNT(...) AS ${driver.quoteColumn("manualTasksCount")}`)
|
|
1159
|
+
* @param {string} name - Identifier used in the `.queryData(...)` spec.
|
|
1160
|
+
* @param {import("../query/query-data.js").QueryDataFn} fn - Callback that mutates the query.
|
|
1161
|
+
* @returns {void}
|
|
1162
|
+
*/
|
|
1163
|
+
queryData(name: string, fn: import("../query/query-data.js").QueryDataFn): void;
|
|
1164
|
+
/**
|
|
1165
|
+
* Runs get query data map.
|
|
1166
|
+
* @returns {Record<string, import("../query/query-data.js").QueryDataFn>} - queryData registrations keyed by name.
|
|
1167
|
+
*/
|
|
1168
|
+
getQueryDataMap(): Record<string, import("../query/query-data.js").QueryDataFn>;
|
|
1169
|
+
/**
|
|
1170
|
+
* Runs get query data by name.
|
|
1171
|
+
* @param {string} name - queryData name.
|
|
1172
|
+
* @returns {import("../query/query-data.js").QueryDataFn | null} - Registered fn or null when not found.
|
|
1173
|
+
*/
|
|
1174
|
+
getQueryDataByName(name: string): import("../query/query-data.js").QueryDataFn | null;
|
|
1175
|
+
/**
|
|
1176
|
+
* Runs get attachments.
|
|
1177
|
+
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions.
|
|
1178
|
+
*/
|
|
1179
|
+
getAttachments(): Record<string, {
|
|
1180
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
1181
|
+
type: "hasOne" | "hasMany";
|
|
1182
|
+
}>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Runs get attachment by name.
|
|
1185
|
+
* @param {string} attachmentName - Attachment name.
|
|
1186
|
+
* @returns {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}} - Attachment definition.
|
|
1187
|
+
*/
|
|
1188
|
+
getAttachmentByName(attachmentName: string): {
|
|
1189
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
1190
|
+
type: "hasOne" | "hasMany";
|
|
1191
|
+
};
|
|
1192
|
+
/**
|
|
1193
|
+
* Adds a belongs-to-relationship to the model.
|
|
1194
|
+
* @param {string} relationshipName The name of the relationship.
|
|
1195
|
+
* @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
|
|
1196
|
+
* @param {object} [options] The options for the relationship.
|
|
1197
|
+
*/
|
|
1198
|
+
belongsTo(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
|
|
1199
|
+
/**
|
|
1200
|
+
* Runs connection.
|
|
1201
|
+
* @param {object} [args] - Options.
|
|
1202
|
+
* @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
|
|
1203
|
+
* @returns {import("../drivers/base.js").default} - The connection.
|
|
1204
|
+
*/
|
|
1205
|
+
connection({ enforceTenantDatabaseScope, ...restArgs }?: {
|
|
1206
|
+
enforceTenantDatabaseScope?: boolean;
|
|
1207
|
+
}): import("../drivers/base.js").default;
|
|
1208
|
+
/**
|
|
1209
|
+
* Runs create.
|
|
1210
|
+
* @template {Record<string, ReturnType<typeof JSON.parse>>} CreateAttributes
|
|
1211
|
+
* @template {VelociousDatabaseRecord<CreateAttributes>} Model
|
|
1212
|
+
* @this {{new (changes?: CreateAttributes): Model} & typeof VelociousDatabaseRecord}
|
|
1213
|
+
* @param {CreateAttributes} [attributes] - Attributes.
|
|
1214
|
+
* @returns {Promise<Model>} - Resolves with the create.
|
|
1215
|
+
*/
|
|
1216
|
+
create<CreateAttributes extends Record<string, ReturnType<typeof JSON.parse>>, Model extends VelociousDatabaseRecord<CreateAttributes>>(this: {
|
|
1217
|
+
new (changes?: CreateAttributes): Model;
|
|
1218
|
+
} & typeof VelociousDatabaseRecord, attributes?: CreateAttributes): Promise<Model>;
|
|
1219
|
+
/**
|
|
1220
|
+
* Runs get configuration.
|
|
1221
|
+
* @returns {import("../../configuration.js").default} - The configuration.
|
|
1222
|
+
*/
|
|
1223
|
+
_getConfiguration(): import("../../configuration.js").default;
|
|
1224
|
+
_configuration: Configuration | undefined;
|
|
1225
|
+
/**
|
|
1226
|
+
* Adds a has-many-relationship to the model class.
|
|
1227
|
+
* @param {string} relationshipName The name of the relationship (e.g. "posts")
|
|
1228
|
+
* @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
|
|
1229
|
+
* @param {object} [options] The options for the relationship (e.g. {className: "Post"})
|
|
1230
|
+
* @returns {void} - No return value.
|
|
1231
|
+
*/
|
|
1232
|
+
hasMany(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
|
|
1233
|
+
/**
|
|
1234
|
+
* Rails-style declaration that this model accepts nested-attribute writes
|
|
1235
|
+
* for a relationship when saved through a parent. Required — Velocious
|
|
1236
|
+
* will refuse nested writes for any relationship not listed here, even
|
|
1237
|
+
* if a frontend-model resource permits them.
|
|
1238
|
+
*
|
|
1239
|
+
* Options:
|
|
1240
|
+
* - allowDestroy: whether `_destroy: true` entries are allowed. Default false.
|
|
1241
|
+
* - limit: optional upper bound on the number of nested entries per request.
|
|
1242
|
+
* - rejectIf: optional predicate `(attributes) => boolean` that silently skips entries.
|
|
1243
|
+
*
|
|
1244
|
+
* Usage:
|
|
1245
|
+
* class Project extends Record {}
|
|
1246
|
+
* Project.hasMany("tasks")
|
|
1247
|
+
* Project.acceptsNestedAttributesFor("tasks", {allowDestroy: true})
|
|
1248
|
+
* @param {string} relationshipName - Relationship name on this model.
|
|
1249
|
+
* @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}} [options] - Policy options.
|
|
1250
|
+
* @returns {void}
|
|
1251
|
+
*/
|
|
1252
|
+
acceptsNestedAttributesFor(relationshipName: string, options?: {
|
|
1253
|
+
allowDestroy?: boolean;
|
|
1254
|
+
limit?: number;
|
|
1255
|
+
rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
|
|
1256
|
+
}): void;
|
|
1257
|
+
/**
|
|
1258
|
+
* Runs accepted nested attributes for.
|
|
1259
|
+
* @param {string} relationshipName - Relationship name.
|
|
1260
|
+
* @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean} | null} - Policy declared via `acceptsNestedAttributesFor`, or null when not accepted.
|
|
1261
|
+
*/
|
|
1262
|
+
acceptedNestedAttributesFor(relationshipName: string): {
|
|
1263
|
+
allowDestroy?: boolean;
|
|
1264
|
+
limit?: number;
|
|
1265
|
+
rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
|
|
1266
|
+
} | null;
|
|
1267
|
+
/**
|
|
1268
|
+
* Adds a has-one-relationship to the model class.
|
|
1269
|
+
* @param {string} relationshipName The name of the relationship (e.g. "post")
|
|
1270
|
+
* @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
|
|
1271
|
+
* @param {object} [options] The options for the relationship (e.g. {className: "Post"})
|
|
1272
|
+
* @returns {void} - No return value.
|
|
1273
|
+
*/
|
|
1274
|
+
hasOne(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
|
|
1275
|
+
/**
|
|
1276
|
+
* Runs define attachment.
|
|
1277
|
+
* @param {string} attachmentName - Attachment name.
|
|
1278
|
+
* @param {object} args - Attachment args.
|
|
1279
|
+
* @param {string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>} [args.driver] - Attachment driver name, class, or instance.
|
|
1280
|
+
* @param {"hasOne" | "hasMany"} args.type - Attachment type.
|
|
1281
|
+
* @returns {void} - No return value.
|
|
1282
|
+
*/
|
|
1283
|
+
_defineAttachment(attachmentName: string, { driver, type }: {
|
|
1284
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
1285
|
+
type: "hasOne" | "hasMany";
|
|
1286
|
+
}): void;
|
|
1287
|
+
/**
|
|
1288
|
+
* Adds a single attachment helper to the model.
|
|
1289
|
+
* @param {string} attachmentName - Attachment name.
|
|
1290
|
+
* @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
|
|
1291
|
+
* @returns {void} - No return value.
|
|
1292
|
+
*/
|
|
1293
|
+
hasOneAttachment(attachmentName: string, args?: {
|
|
1294
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
1295
|
+
}): void;
|
|
1296
|
+
/**
|
|
1297
|
+
* Adds a collection attachment helper to the model.
|
|
1298
|
+
* @param {string} attachmentName - Attachment name.
|
|
1299
|
+
* @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
|
|
1300
|
+
* @returns {void} - No return value.
|
|
1301
|
+
*/
|
|
1302
|
+
hasManyAttachments(attachmentName: string, args?: {
|
|
1303
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
1304
|
+
}): void;
|
|
1305
|
+
/**
|
|
1306
|
+
* Runs human attribute name.
|
|
1307
|
+
* @param {string} attributeName - Attribute name.
|
|
1308
|
+
* @returns {string} - The human attribute name.
|
|
1309
|
+
*/
|
|
1310
|
+
humanAttributeName(attributeName: string): string;
|
|
1311
|
+
/**
|
|
1312
|
+
* Runs get database type.
|
|
1313
|
+
* @returns {string} - The database type.
|
|
1314
|
+
*/
|
|
1315
|
+
getDatabaseType(): string;
|
|
1316
|
+
/**
|
|
1317
|
+
* Runs set eager load record metadata.
|
|
1318
|
+
* @param {boolean} eagerLoadRecordMetadata - Whether require-context initialization should load table metadata for this model.
|
|
1319
|
+
* @returns {void} - No return value.
|
|
1320
|
+
*/
|
|
1321
|
+
setEagerLoadRecordMetadata(eagerLoadRecordMetadata: boolean): void;
|
|
1322
|
+
/**
|
|
1323
|
+
* Runs get eager load record metadata.
|
|
1324
|
+
* @returns {boolean} - Whether require-context initialization should load table metadata for this model.
|
|
1325
|
+
*/
|
|
1326
|
+
getEagerLoadRecordMetadata(): boolean;
|
|
1327
|
+
/**
|
|
1328
|
+
* Runs reset record metadata.
|
|
1329
|
+
* @returns {void} - No return value.
|
|
1330
|
+
*/
|
|
1331
|
+
resetRecordMetadata(): void;
|
|
1332
|
+
_initialized: boolean | undefined;
|
|
1333
|
+
_databaseType: string | undefined;
|
|
1334
|
+
_table: import("../drivers/base-table.js").default | undefined;
|
|
1335
|
+
_columns: import("../drivers/base-column.js").default[] | undefined;
|
|
1336
|
+
/**
|
|
1337
|
+
* Registers the model class with a configuration without loading table metadata.
|
|
1338
|
+
* @param {object} args - Options object.
|
|
1339
|
+
* @param {import("../../configuration.js").default} args.configuration - Configuration instance.
|
|
1340
|
+
* @returns {void} - No return value.
|
|
1341
|
+
*/
|
|
1342
|
+
registerRecordClass({ configuration, ...restArgs }: {
|
|
1343
|
+
configuration: import("../../configuration.js").default;
|
|
1344
|
+
}): void;
|
|
1345
|
+
/**
|
|
1346
|
+
* Runs initialize record.
|
|
1347
|
+
* @param {object} args - Options object.
|
|
1348
|
+
* @param {import("../../configuration.js").default} args.configuration - Configuration instance.
|
|
1349
|
+
* @param {import("../drivers/base.js").default} [args.connection] - Explicit metadata connection.
|
|
1350
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
1351
|
+
*/
|
|
1352
|
+
initializeRecord({ configuration, connection: explicitConnection, ...restArgs }: {
|
|
1353
|
+
configuration: import("../../configuration.js").default;
|
|
1354
|
+
connection?: import("../drivers/base.js").default;
|
|
1355
|
+
}): Promise<void>;
|
|
1356
|
+
/**
|
|
1357
|
+
* Initializes the model class the first time an async record API needs table
|
|
1358
|
+
* metadata. Concurrent callers share the same initialization promise, and a
|
|
1359
|
+
* failed initialization can be retried by a later call.
|
|
1360
|
+
* @param {{configuration?: import("../../configuration.js").default, connection?: import("../drivers/base.js").default}} [args] - Optional configuration and explicit metadata connection.
|
|
1361
|
+
* @returns {Promise<void>} - Resolves when the model class is initialized.
|
|
1362
|
+
*/
|
|
1363
|
+
ensureInitialized(args?: {
|
|
1364
|
+
configuration?: import("../../configuration.js").default;
|
|
1365
|
+
connection?: import("../drivers/base.js").default;
|
|
1366
|
+
}): Promise<void>;
|
|
1367
|
+
/**
|
|
1368
|
+
* Runs is initialized.
|
|
1369
|
+
* @returns {boolean} - Whether initialized.
|
|
1370
|
+
*/
|
|
1371
|
+
isInitialized(): boolean;
|
|
1372
|
+
/**
|
|
1373
|
+
* Runs assert has been initialized.
|
|
1374
|
+
* @returns {void} - No return value.
|
|
1375
|
+
*/
|
|
1376
|
+
_assertHasBeenInitialized(): void;
|
|
1377
|
+
/**
|
|
1378
|
+
* Defines translation accessors and initializes the generated translation
|
|
1379
|
+
* class through the same metadata connection as the translated model.
|
|
1380
|
+
* @param {import("../drivers/base.js").default} connection - Metadata connection.
|
|
1381
|
+
* @returns {Promise<void>} - Resolves when translation metadata is ready.
|
|
1382
|
+
*/
|
|
1383
|
+
_defineTranslationMethods(connection: import("../drivers/base.js").default): Promise<void>;
|
|
1384
|
+
/**
|
|
1385
|
+
* Runs get configured database identifier.
|
|
1386
|
+
* @returns {string} - The configured non-tenant database identifier.
|
|
1387
|
+
*/
|
|
1388
|
+
getConfiguredDatabaseIdentifier(): string;
|
|
1389
|
+
/**
|
|
1390
|
+
* Runs get database identifier.
|
|
1391
|
+
* @param {object} [args] - Options.
|
|
1392
|
+
* @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
|
|
1393
|
+
* @param {object} [args.tenant] - Explicit tenant descriptor instead of the ambient tenant.
|
|
1394
|
+
* @returns {string} - The database identifier.
|
|
1395
|
+
*/
|
|
1396
|
+
getDatabaseIdentifier({ enforceTenantDatabaseScope, tenant, ...restArgs }?: {
|
|
1397
|
+
enforceTenantDatabaseScope?: boolean;
|
|
1398
|
+
tenant?: object;
|
|
1399
|
+
}): string;
|
|
1400
|
+
/**
|
|
1401
|
+
* Runs set database identifier.
|
|
1402
|
+
* @param {string} databaseIdentifier - Database identifier.
|
|
1403
|
+
* @returns {void} - No return value.
|
|
1404
|
+
*/
|
|
1405
|
+
setDatabaseIdentifier(databaseIdentifier: string): void;
|
|
1406
|
+
_databaseIdentifier: string | undefined;
|
|
1407
|
+
/**
|
|
1408
|
+
* Declares a tenant-aware database identifier resolver for this model class.
|
|
1409
|
+
* @param {string | ((args: {modelClass: typeof VelociousDatabaseRecord, tenant: Record<string, unknown> | null | undefined}) => string | undefined)} databaseIdentifierOrResolver - Static identifier or resolver.
|
|
1410
|
+
* @returns {void} - No return value.
|
|
1411
|
+
*/
|
|
1412
|
+
switchesTenantDatabase(databaseIdentifierOrResolver: string | ((args: {
|
|
1413
|
+
modelClass: typeof VelociousDatabaseRecord;
|
|
1414
|
+
tenant: Record<string, unknown> | null | undefined;
|
|
1415
|
+
}) => string | undefined)): void;
|
|
1416
|
+
_tenantDatabaseIdentifierResolver: string | ((args: {
|
|
1417
|
+
modelClass: typeof VelociousDatabaseRecord;
|
|
1418
|
+
tenant: Record<string, unknown> | null | undefined;
|
|
1419
|
+
}) => string | undefined) | undefined;
|
|
1420
|
+
/**
|
|
1421
|
+
* Runs has tenant database identifier resolver.
|
|
1422
|
+
* @returns {boolean} - Whether this model resolves its database from the current tenant.
|
|
1423
|
+
*/
|
|
1424
|
+
hasTenantDatabaseIdentifierResolver(): boolean;
|
|
1425
|
+
/**
|
|
1426
|
+
* Runs get tenant database identifier.
|
|
1427
|
+
* @param {ReturnType<typeof JSON.parse>} [tenant] - Tenant override.
|
|
1428
|
+
* @returns {string | undefined} - Tenant-scoped database identifier when configured.
|
|
1429
|
+
*/
|
|
1430
|
+
getTenantDatabaseIdentifier(tenant?: ReturnType<typeof JSON.parse>): string | undefined;
|
|
1431
|
+
/**
|
|
1432
|
+
* Whether a declared `"boolean"` attribute cast is backed by an integer column (e.g. an MSSQL
|
|
1433
|
+
* `bit`), so booleans must be stored as 1/0. A native boolean column (e.g. Postgres `boolean`)
|
|
1434
|
+
* returns false and keeps `true`/`false` for the driver.
|
|
1435
|
+
* @param {string} attributeName - Attribute name.
|
|
1436
|
+
* @returns {boolean} - Whether the declared boolean is stored as an integer.
|
|
1437
|
+
*/
|
|
1438
|
+
_declaredBooleanStoresAsInteger(attributeName: string): boolean;
|
|
1439
|
+
/**
|
|
1440
|
+
* Runs get columns.
|
|
1441
|
+
* @returns {import("../drivers/base-column.js").default[]} - The columns.
|
|
1442
|
+
*/
|
|
1443
|
+
getColumns(): import("../drivers/base-column.js").default[];
|
|
1444
|
+
/**
|
|
1445
|
+
* Runs get columns hash.
|
|
1446
|
+
* @returns {Record<string, import("../drivers/base-column.js").default>} - The columns hash.
|
|
1447
|
+
*/
|
|
1448
|
+
getColumnsHash(): Record<string, import("../drivers/base-column.js").default>;
|
|
1449
|
+
/**
|
|
1450
|
+
* Runs get column type by name.
|
|
1451
|
+
* @param {string} name - Name.
|
|
1452
|
+
* @returns {string | undefined} - The column type by name.
|
|
1453
|
+
*/
|
|
1454
|
+
getColumnTypeByName(name: string): string | undefined;
|
|
1455
|
+
/**
|
|
1456
|
+
* Runs is date like type.
|
|
1457
|
+
* @param {string} type - Type identifier.
|
|
1458
|
+
* @returns {boolean} - Whether date like type.
|
|
1459
|
+
*/
|
|
1460
|
+
_isDateLikeType(type: string): boolean;
|
|
1461
|
+
/**
|
|
1462
|
+
* Runs get column names.
|
|
1463
|
+
* @returns {Array<string>} - The column names.
|
|
1464
|
+
*/
|
|
1465
|
+
getColumnNames(): Array<string>;
|
|
1466
|
+
/**
|
|
1467
|
+
* Runs get table.
|
|
1468
|
+
* @returns {import("../drivers/base-table.js").default} - The table.
|
|
1469
|
+
*/
|
|
1470
|
+
_getTable(): import("../drivers/base-table.js").default;
|
|
1471
|
+
/**
|
|
1472
|
+
* Runs insert multiple.
|
|
1473
|
+
* @param {Array<string>} columns - Column names.
|
|
1474
|
+
* @param {Array<Array<ReturnType<typeof JSON.parse>>>} rows - Rows to insert.
|
|
1475
|
+
* @param {object} [args] - Options object.
|
|
1476
|
+
* @param {boolean} [args.cast] - Whether to cast values based on column types.
|
|
1477
|
+
* @param {boolean} [args.retryIndividuallyOnFailure] - Retry rows individually if a batch insert fails.
|
|
1478
|
+
* @param {boolean} [args.returnResults] - Return succeeded/failed rows instead of throwing when retries fail.
|
|
1479
|
+
* @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.
|
|
1480
|
+
*/
|
|
1481
|
+
insertMultiple(columns: Array<string>, rows: Array<Array<ReturnType<typeof JSON.parse>>>, args?: {
|
|
1482
|
+
cast?: boolean;
|
|
1483
|
+
retryIndividuallyOnFailure?: boolean;
|
|
1484
|
+
returnResults?: boolean;
|
|
1485
|
+
}): Promise<void | {
|
|
1486
|
+
succeededRows: Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
1487
|
+
failedRows: Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
1488
|
+
errors: Array<{
|
|
1489
|
+
row: Array<ReturnType<typeof JSON.parse>>;
|
|
1490
|
+
error: ReturnType<typeof JSON.parse>;
|
|
1491
|
+
}>;
|
|
1492
|
+
}>;
|
|
1493
|
+
/**
|
|
1494
|
+
* Runs normalize insert multiple rows.
|
|
1495
|
+
* @param {object} args - Options object.
|
|
1496
|
+
* @param {Array<string>} args.columns - Column names.
|
|
1497
|
+
* @param {Array<Array<ReturnType<typeof JSON.parse>>>} args.rows - Rows to insert.
|
|
1498
|
+
* @returns {Array<Array<ReturnType<typeof JSON.parse>>>} - Normalized rows.
|
|
1499
|
+
*/
|
|
1500
|
+
_normalizeInsertMultipleRows({ columns, rows }: {
|
|
1501
|
+
columns: Array<string>;
|
|
1502
|
+
rows: Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
1503
|
+
}): Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
1504
|
+
/**
|
|
1505
|
+
* Runs safe serialize insert row.
|
|
1506
|
+
* @param {Array<ReturnType<typeof JSON.parse>>} row - Row to serialize.
|
|
1507
|
+
* @returns {string} - Safe row representation.
|
|
1508
|
+
*/
|
|
1509
|
+
_safeSerializeInsertRow(row: Array<ReturnType<typeof JSON.parse>>): string;
|
|
1510
|
+
/**
|
|
1511
|
+
* Runs normalize insert value for column.
|
|
1512
|
+
* @param {object} args - Options object.
|
|
1513
|
+
* @param {string} args.columnName - Column name.
|
|
1514
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Column value.
|
|
1515
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1516
|
+
*/
|
|
1517
|
+
_normalizeInsertValueForColumn({ columnName, value }: {
|
|
1518
|
+
columnName: string;
|
|
1519
|
+
value: ReturnType<typeof JSON.parse>;
|
|
1520
|
+
}): ReturnType<typeof JSON.parse>;
|
|
1521
|
+
/**
|
|
1522
|
+
* Runs is string type.
|
|
1523
|
+
* @param {string | undefined} columnType - Column type.
|
|
1524
|
+
* @returns {boolean} - Whether string-like type.
|
|
1525
|
+
*/
|
|
1526
|
+
_isStringType(columnType: string | undefined): boolean;
|
|
1527
|
+
/**
|
|
1528
|
+
* Runs is numeric type.
|
|
1529
|
+
* @param {string} columnType - Column type.
|
|
1530
|
+
* @returns {boolean} - Whether numeric-like type.
|
|
1531
|
+
*/
|
|
1532
|
+
_isNumericType(columnType: string): boolean;
|
|
1533
|
+
/**
|
|
1534
|
+
* Runs normalize numeric value.
|
|
1535
|
+
* @param {object} args - Options object.
|
|
1536
|
+
* @param {string} args.columnType - Column type.
|
|
1537
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
1538
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1539
|
+
*/
|
|
1540
|
+
_normalizeNumericValue({ columnType, value }: {
|
|
1541
|
+
columnType: string;
|
|
1542
|
+
value: ReturnType<typeof JSON.parse>;
|
|
1543
|
+
}): ReturnType<typeof JSON.parse>;
|
|
1544
|
+
/**
|
|
1545
|
+
* Runs normalize date value for insert.
|
|
1546
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to normalize.
|
|
1547
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1548
|
+
*/
|
|
1549
|
+
_normalizeDateValueForInsert(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
1550
|
+
/**
|
|
1551
|
+
* Runs normalize date string for insert.
|
|
1552
|
+
* @param {string} value - Date string value.
|
|
1553
|
+
* @returns {string | Date} - Parsed date or original string.
|
|
1554
|
+
*/
|
|
1555
|
+
_normalizeDateStringForInsert(value: string): string | Date;
|
|
1556
|
+
/**
|
|
1557
|
+
* Runs time zone for date writes.
|
|
1558
|
+
* @returns {string | undefined} - Active timezone identifier.
|
|
1559
|
+
*/
|
|
1560
|
+
_timeZoneForDateWrite(): string | undefined;
|
|
1561
|
+
/**
|
|
1562
|
+
* Runs normalize sqlite boolean value for insert.
|
|
1563
|
+
* @param {object} args - Options object.
|
|
1564
|
+
* @param {string | undefined} args.columnType - Column type.
|
|
1565
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
1566
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1567
|
+
*/
|
|
1568
|
+
_normalizeSqliteBooleanValueForInsert({ columnType, value }: {
|
|
1569
|
+
columnType: string | undefined;
|
|
1570
|
+
value: ReturnType<typeof JSON.parse>;
|
|
1571
|
+
}): ReturnType<typeof JSON.parse>;
|
|
1572
|
+
/**
|
|
1573
|
+
* Runs next primary key.
|
|
1574
|
+
* @returns {Promise<number>} - Resolves with the next primary key.
|
|
1575
|
+
*/
|
|
1576
|
+
nextPrimaryKey(): Promise<number>;
|
|
1577
|
+
/**
|
|
1578
|
+
* Runs set primary key.
|
|
1579
|
+
* @param {string} primaryKey - Primary key.
|
|
1580
|
+
* @returns {void} - No return value.
|
|
1581
|
+
*/
|
|
1582
|
+
setPrimaryKey(primaryKey: string): void;
|
|
1583
|
+
_primaryKey: string | undefined;
|
|
1584
|
+
/**
|
|
1585
|
+
* Returns this class's own attribute-cast map, creating it on the class itself
|
|
1586
|
+
* (never inherited from a parent) so subclasses don't share the same object.
|
|
1587
|
+
* @returns {Record<string, string>} - Declared casts keyed by attribute name.
|
|
1588
|
+
*/
|
|
1589
|
+
getAttributeCastsMap(): Record<string, string>;
|
|
1590
|
+
/**
|
|
1591
|
+
* Declares a Rails-style per-attribute cast so a column whose introspected type
|
|
1592
|
+
* isn't what the app wants (e.g. an MSSQL `bit` mapped to `number`) can be
|
|
1593
|
+
* exposed as another type with real runtime conversion. Currently fully
|
|
1594
|
+
* implements the `"boolean"` cast (0/1 <-> false/true); other types only record
|
|
1595
|
+
* the label so the effective type and generated typings reflect them.
|
|
1596
|
+
* @param {string} attributeName - Attribute name (camelCase), e.g. `"sichtbarVVK"`.
|
|
1597
|
+
* @param {string} type - Declared type, e.g. `"boolean"`.
|
|
1598
|
+
* @returns {void} - No return value.
|
|
1599
|
+
*/
|
|
1600
|
+
attribute(attributeName: string, type: string): void;
|
|
1601
|
+
/**
|
|
1602
|
+
* Returns the declared cast type for an attribute, if any.
|
|
1603
|
+
* @param {string} attributeName - Attribute name (camelCase).
|
|
1604
|
+
* @returns {string | undefined} - Declared cast type, or undefined when none is declared.
|
|
1605
|
+
*/
|
|
1606
|
+
getAttributeCast(attributeName: string): string | undefined;
|
|
1607
|
+
/**
|
|
1608
|
+
* Runs primary key.
|
|
1609
|
+
* @returns {string} - The primary key.
|
|
1610
|
+
*/
|
|
1611
|
+
primaryKey(): string;
|
|
1612
|
+
/**
|
|
1613
|
+
* Whether the model has a single primary key column. `setPrimaryKey(null)` (e.g. composite-key
|
|
1614
|
+
* legacy tables) declares no single primary key; `primaryKey()` still falls back to "id" for the
|
|
1615
|
+
* default case, so callers that must distinguish "no primary key" use this instead.
|
|
1616
|
+
* @returns {boolean} - False only when the primary key was explicitly set to null.
|
|
1617
|
+
*/
|
|
1618
|
+
hasPrimaryKey(): boolean;
|
|
1619
|
+
/**
|
|
1620
|
+
* Runs table name.
|
|
1621
|
+
* @returns {string} - The table name.
|
|
1622
|
+
*/
|
|
1623
|
+
tableName(): string;
|
|
1624
|
+
_tableName: string | undefined;
|
|
1625
|
+
/**
|
|
1626
|
+
* Runs set table name.
|
|
1627
|
+
* @param {string} tableName - Table name.
|
|
1628
|
+
* @returns {void} - No return value.
|
|
1629
|
+
*/
|
|
1630
|
+
setTableName(tableName: string): void;
|
|
1631
|
+
/**
|
|
1632
|
+
* Runs transaction.
|
|
1633
|
+
* @param {() => Promise<void>} callback - Callback function.
|
|
1634
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Resolves with the transaction.
|
|
1635
|
+
*/
|
|
1636
|
+
transaction(callback: () => Promise<void>): Promise<ReturnType<typeof JSON.parse>>;
|
|
1637
|
+
/**
|
|
1638
|
+
* Runs the callback while holding a named advisory lock. Calls without
|
|
1639
|
+
* By default calls use the caller connection. Calls with `dedicatedConnection`
|
|
1640
|
+
* use a spawned lock connection that is released after the callback finishes,
|
|
1641
|
+
* while the callback itself still runs against the caller/model connection.
|
|
1642
|
+
* Calls with a positive `holdTimeoutMs` use a dedicated lock connection so
|
|
1643
|
+
* timeout cleanup can release the lock even when callback database work is
|
|
1644
|
+
* stuck. Advisory locks are cooperative and session-scoped: they serialize
|
|
1645
|
+
* callers that opt into the same `name`, without touching row or table locks,
|
|
1646
|
+
* so unrelated traffic is free to proceed.
|
|
1647
|
+
*
|
|
1648
|
+
* The lock is acquired before the callback runs and released in a
|
|
1649
|
+
* `finally` block afterwards, so the callback's return value is
|
|
1650
|
+
* propagated and thrown errors still release the lock.
|
|
1651
|
+
* @template T
|
|
1652
|
+
* @param {string} name - Lock name.
|
|
1653
|
+
* @param {() => Promise<T>} callback - Callback to invoke while the lock is held.
|
|
1654
|
+
* @param {{timeoutMs?: number | null, holdTimeoutMs?: number | null, dedicatedConnection?: boolean}} [args] - `timeoutMs` caps how long we wait to acquire the lock; `holdTimeoutMs` caps how long the callback may hold it before the lock is released and `AdvisoryLockHoldTimeoutError` is thrown; `dedicatedConnection` spawns a separate lock session without enabling a hold timeout.
|
|
1655
|
+
* @returns {Promise<T>} - Resolves with the callback's return value.
|
|
1656
|
+
* @throws {AdvisoryLockTimeoutError} - If `timeoutMs` elapses before the lock is granted.
|
|
1657
|
+
* @throws {AdvisoryLockHoldTimeoutError} - If `holdTimeoutMs` elapses while the callback holds the lock.
|
|
1658
|
+
*/
|
|
1659
|
+
withAdvisoryLock<T>(name: string, callback: () => Promise<T>, args?: {
|
|
1660
|
+
timeoutMs?: number | null;
|
|
1661
|
+
holdTimeoutMs?: number | null;
|
|
1662
|
+
dedicatedConnection?: boolean;
|
|
1663
|
+
}): Promise<T>;
|
|
1664
|
+
/**
|
|
1665
|
+
* Runs the callback only if the named advisory lock can be acquired
|
|
1666
|
+
* immediately. If the lock is already held by any session, throws
|
|
1667
|
+
* `AdvisoryLockBusyError` without waiting.
|
|
1668
|
+
* Use this when contention is a signal that somebody else is already
|
|
1669
|
+
* doing the work and you want to bail out rather than queue up.
|
|
1670
|
+
* @template T
|
|
1671
|
+
* @param {string} name - Lock name.
|
|
1672
|
+
* @param {() => Promise<T>} callback - Callback to invoke while the lock is held.
|
|
1673
|
+
* @param {{holdTimeoutMs?: number | null, dedicatedConnection?: boolean}} [args] - `holdTimeoutMs` caps how long the callback may hold the lock before it is released and `AdvisoryLockHoldTimeoutError` is thrown; `dedicatedConnection` spawns a separate lock session without enabling a hold timeout.
|
|
1674
|
+
* @returns {Promise<T>} - Resolves with the callback's return value.
|
|
1675
|
+
* @throws {AdvisoryLockBusyError} - If the lock is already held.
|
|
1676
|
+
* @throws {AdvisoryLockHoldTimeoutError} - If `holdTimeoutMs` elapses while the callback holds the lock.
|
|
1677
|
+
*/
|
|
1678
|
+
withAdvisoryLockOrFail<T>(name: string, callback: () => Promise<T>, args?: {
|
|
1679
|
+
holdTimeoutMs?: number | null;
|
|
1680
|
+
dedicatedConnection?: boolean;
|
|
1681
|
+
}): Promise<T>;
|
|
1682
|
+
/**
|
|
1683
|
+
* Runs `callback`, rejecting with `AdvisoryLockHoldTimeoutError` if it has
|
|
1684
|
+
* not settled within `holdTimeoutMs`. The callback is not cancelled — this is
|
|
1685
|
+
* a safety net, not cancellation.
|
|
1686
|
+
* @template T
|
|
1687
|
+
* @param {string} name - Lock name (for the error message).
|
|
1688
|
+
* @param {() => Promise<T>} callback - Callback holding the lock.
|
|
1689
|
+
* @param {number | null} [holdTimeoutMs] - Max hold time; falsy disables the timeout.
|
|
1690
|
+
* @returns {Promise<T>} - Callback result after the lock-protected operation.
|
|
1691
|
+
*/
|
|
1692
|
+
runWithAdvisoryLockHoldTimeout<T>(name: string, callback: () => Promise<T>, holdTimeoutMs?: number | null): Promise<T>;
|
|
1693
|
+
/**
|
|
1694
|
+
* Returns true if the named advisory lock is currently held by any
|
|
1695
|
+
* session. Primarily useful as a diagnostic; callers that want to act
|
|
1696
|
+
* on the result should prefer `withAdvisoryLockOrFail` to avoid a
|
|
1697
|
+
* TOCTOU window between the check and the action.
|
|
1698
|
+
* @param {string} name - Lock name.
|
|
1699
|
+
* @returns {Promise<boolean>} - Whether the advisory lock is currently held.
|
|
1700
|
+
*/
|
|
1701
|
+
hasAdvisoryLock(name: string): Promise<boolean>;
|
|
1702
|
+
/**
|
|
1703
|
+
* Runs translates.
|
|
1704
|
+
* @param {...string} names - Names.
|
|
1705
|
+
* @returns {void} - No return value.
|
|
1706
|
+
*/
|
|
1707
|
+
translates(...names: string[]): void;
|
|
1708
|
+
/**
|
|
1709
|
+
* Runs current translation scope.
|
|
1710
|
+
* @param {ModelClassQuery} query - Translation query.
|
|
1711
|
+
* @returns {ModelClassQuery} - Scoped query.
|
|
1712
|
+
*/
|
|
1713
|
+
currentTranslationScope(query: ModelClassQuery): ModelClassQuery;
|
|
1714
|
+
/**
|
|
1715
|
+
* Runs get translation class.
|
|
1716
|
+
* @returns {typeof VelociousDatabaseRecord} - The translation class.
|
|
1717
|
+
*/
|
|
1718
|
+
getTranslationClass(): typeof VelociousDatabaseRecord;
|
|
1719
|
+
readonly name: string;
|
|
1720
|
+
_translationClass: /*elided*/ any | undefined;
|
|
1721
|
+
/**
|
|
1722
|
+
* Runs get translations table name.
|
|
1723
|
+
* @returns {string} - The translations table name.
|
|
1724
|
+
*/
|
|
1725
|
+
getTranslationsTableName(): string;
|
|
1726
|
+
/**
|
|
1727
|
+
* Runs has translations table.
|
|
1728
|
+
* @returns {Promise<boolean>} - Resolves with Whether it has translations table.
|
|
1729
|
+
*/
|
|
1730
|
+
hasTranslationsTable(): Promise<boolean>;
|
|
1731
|
+
/**
|
|
1732
|
+
* Adds a validation to an attribute.
|
|
1733
|
+
* @param {string} attributeName The name of the attribute to validate.
|
|
1734
|
+
* @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.
|
|
1735
|
+
*/
|
|
1736
|
+
validates(attributeName: string, validators: Record<string, boolean | Record<string, ReturnType<typeof JSON.parse>>>): Promise<void>;
|
|
1737
|
+
/**
|
|
1738
|
+
* Registers gap-less positional list callbacks for a column scoped by
|
|
1739
|
+
* another column. Inserts and moves shift surrounding positions so the
|
|
1740
|
+
* list stays compact (1,2,3,...). Destroys close the resulting gap.
|
|
1741
|
+
*
|
|
1742
|
+
* Callers must ensure a UNIQUE index on (scopeColumn, positionColumn)
|
|
1743
|
+
* exists in the database — use `Migration.addActsAsList()` for the
|
|
1744
|
+
* schema half.
|
|
1745
|
+
* @param {string} positionColumn - camelCase position attribute (e.g. "rowNumber").
|
|
1746
|
+
* @param {object} options - Options with a required scope attribute.
|
|
1747
|
+
* @param {string} options.scope - camelCase scope attribute (e.g. "boardColumnId").
|
|
1748
|
+
*/
|
|
1749
|
+
actsAsList(positionColumn: string, options: {
|
|
1750
|
+
scope: string;
|
|
1751
|
+
}): void;
|
|
1752
|
+
/**
|
|
1753
|
+
* Runs new query.
|
|
1754
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1755
|
+
* @this {MC}
|
|
1756
|
+
* @param {{driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default), operation?: import("../operation.js").default}} [args] - Explicit query ownership.
|
|
1757
|
+
* @returns {ModelClassQuery<MC>} - The new query.
|
|
1758
|
+
*/
|
|
1759
|
+
_newQuery<MC extends typeof VelociousDatabaseRecord>(this: MC, args?: {
|
|
1760
|
+
driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default);
|
|
1761
|
+
operation?: import("../operation.js").default;
|
|
1762
|
+
}): ModelClassQuery<MC>;
|
|
1763
|
+
/**
|
|
1764
|
+
* Runs orderable column.
|
|
1765
|
+
* @returns {string} - The orderable column.
|
|
1766
|
+
*/
|
|
1767
|
+
orderableColumn(): string;
|
|
1768
|
+
/**
|
|
1769
|
+
* Runs all.
|
|
1770
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1771
|
+
* @this {MC}
|
|
1772
|
+
* @returns {ModelClassQuery<MC>} - The all.
|
|
1773
|
+
*/
|
|
1774
|
+
all<MC extends typeof VelociousDatabaseRecord>(this: MC): ModelClassQuery<MC>;
|
|
1775
|
+
/**
|
|
1776
|
+
* Runs accessible for.
|
|
1777
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1778
|
+
* @this {MC}
|
|
1779
|
+
* @param {string} action - Ability action to scope by.
|
|
1780
|
+
* @param {import("../../authorization/ability.js").default | undefined} [ability] - Ability instance.
|
|
1781
|
+
* @returns {ModelClassQuery<MC>} - Authorized query.
|
|
1782
|
+
*/
|
|
1783
|
+
accessibleFor<MC extends typeof VelociousDatabaseRecord>(this: MC, action: string, ability?: import("../../authorization/ability.js").default | undefined): ModelClassQuery<MC>;
|
|
1784
|
+
/**
|
|
1785
|
+
* Runs accessible.
|
|
1786
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1787
|
+
* @this {MC}
|
|
1788
|
+
* @param {import("../../authorization/ability.js").default | undefined} [ability] - Ability instance.
|
|
1789
|
+
* @returns {ModelClassQuery<MC>} - Authorized query.
|
|
1790
|
+
*/
|
|
1791
|
+
accessible<MC extends typeof VelociousDatabaseRecord>(this: MC, ability?: import("../../authorization/ability.js").default | undefined): ModelClassQuery<MC>;
|
|
1792
|
+
/**
|
|
1793
|
+
* Runs accessible by.
|
|
1794
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1795
|
+
* @this {MC}
|
|
1796
|
+
* @param {import("../../authorization/ability.js").default} ability - Ability instance.
|
|
1797
|
+
* @returns {ModelClassQuery<MC>} - Authorized query.
|
|
1798
|
+
*/
|
|
1799
|
+
accessibleBy<MC extends typeof VelociousDatabaseRecord>(this: MC, ability: import("../../authorization/ability.js").default): ModelClassQuery<MC>;
|
|
1800
|
+
/**
|
|
1801
|
+
* Runs count.
|
|
1802
|
+
* @returns {Promise<number>} - Resolves with the count.
|
|
1803
|
+
*/
|
|
1804
|
+
count(): Promise<number>;
|
|
1805
|
+
/**
|
|
1806
|
+
* Runs group.
|
|
1807
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1808
|
+
* @this {MC}
|
|
1809
|
+
* @param {string} group - Group.
|
|
1810
|
+
* @returns {ModelClassQuery<MC>} - The group.
|
|
1811
|
+
*/
|
|
1812
|
+
group<MC extends typeof VelociousDatabaseRecord>(this: MC, group: string): ModelClassQuery<MC>;
|
|
1813
|
+
destroyAll(): Promise<void>;
|
|
1814
|
+
/**
|
|
1815
|
+
* Runs pluck.
|
|
1816
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1817
|
+
* @this {MC}
|
|
1818
|
+
* @param {...string|string[]} columns - Column names.
|
|
1819
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Resolves with the pluck.
|
|
1820
|
+
*/
|
|
1821
|
+
pluck<MC extends typeof VelociousDatabaseRecord>(this: MC, ...columns: (string | string[])[]): Promise<Array<ReturnType<typeof JSON.parse>>>;
|
|
1822
|
+
/**
|
|
1823
|
+
* Runs find.
|
|
1824
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1825
|
+
* @this {MC}
|
|
1826
|
+
* @param {number|string} recordId - Record id.
|
|
1827
|
+
* @returns {Promise<InstanceType<MC>>} - Resolves with the find.
|
|
1828
|
+
*/
|
|
1829
|
+
find<MC extends typeof VelociousDatabaseRecord>(this: MC, recordId: number | string): Promise<InstanceType<MC>>;
|
|
1830
|
+
/**
|
|
1831
|
+
* Runs find by.
|
|
1832
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1833
|
+
* @this {MC}
|
|
1834
|
+
* @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
|
|
1835
|
+
* @returns {Promise<InstanceType<MC> | null>} - Resolves with the by.
|
|
1836
|
+
*/
|
|
1837
|
+
findBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
|
|
1838
|
+
[key: string]: string | number;
|
|
1839
|
+
}): Promise<InstanceType<MC> | null>;
|
|
1840
|
+
/**
|
|
1841
|
+
* Runs find by or fail.
|
|
1842
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1843
|
+
* @this {MC}
|
|
1844
|
+
* @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
|
|
1845
|
+
* @returns {Promise<InstanceType<MC>>} - Resolves with the by or fail.
|
|
1846
|
+
*/
|
|
1847
|
+
findByOrFail<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
|
|
1848
|
+
[key: string]: string | number;
|
|
1849
|
+
}): Promise<InstanceType<MC>>;
|
|
1850
|
+
/**
|
|
1851
|
+
* Returns an immutable tenant-bound model scope. Eager helpers and explicit
|
|
1852
|
+
* databaseOperation/transaction callbacks execute from a captured physical
|
|
1853
|
+
* database configuration instead of ambient tenant state.
|
|
1854
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1855
|
+
* @this {MC}
|
|
1856
|
+
* @param {object} tenant - Ordinary or null-prototype JSON-compatible tenant descriptor to scope the model to.
|
|
1857
|
+
* @returns {TenantModelScope<MC>} - Model scope bound to the captured tenant database.
|
|
1858
|
+
*/
|
|
1859
|
+
usingTenant<MC extends typeof VelociousDatabaseRecord>(this: MC, tenant: object): TenantModelScope<MC>;
|
|
1860
|
+
/**
|
|
1861
|
+
* Runs find or create by.
|
|
1862
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1863
|
+
* @this {MC}
|
|
1864
|
+
* @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
|
|
1865
|
+
* @param {() => void} [callback] - Callback function.
|
|
1866
|
+
* @returns {Promise<InstanceType<MC>>} - Resolves with the or create by.
|
|
1867
|
+
*/
|
|
1868
|
+
findOrCreateBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
|
|
1869
|
+
[key: string]: string | number;
|
|
1870
|
+
}, callback?: () => void): Promise<InstanceType<MC>>;
|
|
1871
|
+
/**
|
|
1872
|
+
* Runs find or initialize by.
|
|
1873
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1874
|
+
* @this {MC}
|
|
1875
|
+
* @param {Record<string, string | number>} conditions - Conditions.
|
|
1876
|
+
* @param {(arg: InstanceType<MC>) => void} [callback] - Callback function.
|
|
1877
|
+
* @returns {Promise<InstanceType<MC>>} - Resolves with the or initialize by.
|
|
1878
|
+
*/
|
|
1879
|
+
findOrInitializeBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: Record<string, string | number>, callback?: (arg: InstanceType<MC>) => void): Promise<InstanceType<MC>>;
|
|
1880
|
+
/**
|
|
1881
|
+
* Runs first.
|
|
1882
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1883
|
+
* @this {MC}
|
|
1884
|
+
* @returns {Promise<InstanceType<MC>>} - Resolves with the first.
|
|
1885
|
+
*/
|
|
1886
|
+
first<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>>;
|
|
1887
|
+
/**
|
|
1888
|
+
* Runs joins.
|
|
1889
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1890
|
+
* @this {MC}
|
|
1891
|
+
* @param {string | import("../query/join-object.js").JoinObject} join - Join clause or join descriptor.
|
|
1892
|
+
* @returns {ModelClassQuery<MC>} - The joins.
|
|
1893
|
+
*/
|
|
1894
|
+
joins<MC extends typeof VelociousDatabaseRecord>(this: MC, join: string | import("../query/join-object.js").JoinObject): ModelClassQuery<MC>;
|
|
1895
|
+
/**
|
|
1896
|
+
* Runs last.
|
|
1897
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1898
|
+
* @this {MC}
|
|
1899
|
+
* @returns {Promise<InstanceType<MC>>} - Resolves with the last.
|
|
1900
|
+
*/
|
|
1901
|
+
last<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Runs limit.
|
|
1904
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1905
|
+
* @this {MC}
|
|
1906
|
+
* @param {number} value - Value to use.
|
|
1907
|
+
* @returns {ModelClassQuery<MC>} - The limit.
|
|
1908
|
+
*/
|
|
1909
|
+
limit<MC extends typeof VelociousDatabaseRecord>(this: MC, value: number): ModelClassQuery<MC>;
|
|
1910
|
+
/**
|
|
1911
|
+
* Runs order.
|
|
1912
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1913
|
+
* @this {MC}
|
|
1914
|
+
* @param {import("../query/index.js").OrderArgumentType} order - Order.
|
|
1915
|
+
* @returns {ModelClassQuery<MC>} - The order.
|
|
1916
|
+
*/
|
|
1917
|
+
order<MC extends typeof VelociousDatabaseRecord>(this: MC, order: import("../query/index.js").OrderArgumentType): ModelClassQuery<MC>;
|
|
1918
|
+
/**
|
|
1919
|
+
* Runs distinct.
|
|
1920
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1921
|
+
* @this {MC}
|
|
1922
|
+
* @param {boolean} [value] - Value to use.
|
|
1923
|
+
* @returns {ModelClassQuery<MC>} - The distinct.
|
|
1924
|
+
*/
|
|
1925
|
+
distinct<MC extends typeof VelociousDatabaseRecord>(this: MC, value?: boolean): ModelClassQuery<MC>;
|
|
1926
|
+
/**
|
|
1927
|
+
* Runs preload.
|
|
1928
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1929
|
+
* @this {MC}
|
|
1930
|
+
* @param {import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} preload - Preload.
|
|
1931
|
+
* @returns {ModelClassQuery<MC>} - The preload.
|
|
1932
|
+
*/
|
|
1933
|
+
preload<MC extends typeof VelociousDatabaseRecord>(this: MC, preload: import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>): ModelClassQuery<MC>;
|
|
1934
|
+
/**
|
|
1935
|
+
* Runs select.
|
|
1936
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1937
|
+
* @this {MC}
|
|
1938
|
+
* @param {import("../query/index.js").SelectArgumentType} select - Select.
|
|
1939
|
+
* @returns {ModelClassQuery<MC>} - The select.
|
|
1940
|
+
*/
|
|
1941
|
+
select<MC extends typeof VelociousDatabaseRecord>(this: MC, select: import("../query/index.js").SelectArgumentType): ModelClassQuery<MC>;
|
|
1942
|
+
/**
|
|
1943
|
+
* Runs to array.
|
|
1944
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1945
|
+
* @this {MC}
|
|
1946
|
+
* @returns {Promise<InstanceType<MC>[]>} - Resolves with the array.
|
|
1947
|
+
*/
|
|
1948
|
+
toArray<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>[]>;
|
|
1949
|
+
/**
|
|
1950
|
+
* Runs load.
|
|
1951
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1952
|
+
* @this {MC}
|
|
1953
|
+
* @returns {Promise<InstanceType<MC>[]>} - Resolves with the array.
|
|
1954
|
+
*/
|
|
1955
|
+
load<MC extends typeof VelociousDatabaseRecord>(this: MC): Promise<InstanceType<MC>[]>;
|
|
1956
|
+
/**
|
|
1957
|
+
* Runs where.
|
|
1958
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1959
|
+
* @this {MC}
|
|
1960
|
+
* @param {import("../query/index.js").WhereArgumentType} where - Where.
|
|
1961
|
+
* @returns {ModelClassQuery<MC>} - The where.
|
|
1962
|
+
*/
|
|
1963
|
+
where<MC extends typeof VelociousDatabaseRecord>(this: MC, where: import("../query/index.js").WhereArgumentType): ModelClassQuery<MC>;
|
|
1964
|
+
/**
|
|
1965
|
+
* Runs ransack.
|
|
1966
|
+
* @template {typeof VelociousDatabaseRecord} MC
|
|
1967
|
+
* @this {MC}
|
|
1968
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Ransack-style params hash.
|
|
1969
|
+
* @returns {ModelClassQuery<MC>} - Query with Ransack filters applied.
|
|
1970
|
+
*/
|
|
1971
|
+
ransack<MC extends typeof VelociousDatabaseRecord>(this: MC, params: Record<string, ReturnType<typeof JSON.parse>>): ModelClassQuery<MC>;
|
|
1972
|
+
} | undefined;
|
|
1973
|
+
_isNewRecord: boolean;
|
|
1974
|
+
/** @type {Record<string, string> | undefined} */
|
|
1975
|
+
static _attributeNameToColumnName: Record<string, string> | undefined;
|
|
1976
|
+
/** @type {Record<string, string> | undefined} */
|
|
1977
|
+
static _columnNameToAttributeName: Record<string, string> | undefined;
|
|
1978
|
+
/** @type {Record<string, object> | undefined} */
|
|
1979
|
+
static _translations: Record<string, object> | undefined;
|
|
1980
|
+
/** @type {Record<string, import("./validators/base.js").default[]> | undefined} */
|
|
1981
|
+
static _validators: Record<string, import("./validators/base.js").default[]> | undefined;
|
|
1982
|
+
/** @type {Record<string, LifecycleCallbackType[]> | undefined} */
|
|
1983
|
+
static _lifecycleCallbacks: Record<string, LifecycleCallbackType[]> | undefined;
|
|
1984
|
+
/** @type {Record<string, typeof import("./validators/base.js").default> | undefined} */
|
|
1985
|
+
static _validatorTypes: Record<string, typeof import("./validators/base.js").default> | undefined;
|
|
1986
|
+
/** @type {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}> | undefined} */
|
|
1987
|
+
static _attachmentsMap: Record<string, {
|
|
1988
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
1989
|
+
type: "hasOne" | "hasMany";
|
|
1990
|
+
}> | undefined;
|
|
1991
|
+
/** @type {Record<string, import("./relationships/base.js").default> | undefined} */
|
|
1992
|
+
static _relationships: Record<string, import("./relationships/base.js").default> | undefined;
|
|
1993
|
+
/** @type {Record<string, import("../query/query-data.js").QueryDataFn> | undefined} */
|
|
1994
|
+
static _queryDataRegistrations: Record<string, import("../query/query-data.js").QueryDataFn> | undefined;
|
|
1995
|
+
/** @type {Record<string, {allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}> | undefined} */
|
|
1996
|
+
static _acceptedNestedAttributes: Record<string, {
|
|
1997
|
+
allowDestroy?: boolean;
|
|
1998
|
+
limit?: number;
|
|
1999
|
+
rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
|
|
2000
|
+
}> | undefined;
|
|
2001
|
+
/** @type {Record<string, string> | undefined} */
|
|
2002
|
+
static _attributeCasts: Record<string, string> | undefined;
|
|
2003
|
+
/** @type {Record<string, import("../drivers/base-column.js").default> | undefined} */
|
|
2004
|
+
static _columnsAsHash: Record<string, import("../drivers/base-column.js").default> | undefined;
|
|
2005
|
+
/** @type {Array<string> | undefined} */
|
|
2006
|
+
static _columnNames: Array<string> | undefined;
|
|
2007
|
+
/** @type {Record<string, string> | undefined} */
|
|
2008
|
+
static _columnTypeByName: Record<string, string> | undefined;
|
|
85
2009
|
/**
|
|
86
2010
|
* Narrows the runtime value to the documented type.
|
|
87
2011
|
* @type {string | undefined} */
|
|
@@ -144,11 +2068,11 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
144
2068
|
static findMemberNameInsensitive(target: object, memberName: string): string | null;
|
|
145
2069
|
/**
|
|
146
2070
|
* Runs define scope.
|
|
147
|
-
* @param {(...args: Array
|
|
148
|
-
* @returns {((...args: Array
|
|
2071
|
+
* @param {(...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>} callback - Scope callback.
|
|
2072
|
+
* @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.
|
|
149
2073
|
*/
|
|
150
|
-
static defineScope(callback: (...args: Array<
|
|
151
|
-
scope: (...args: Array<
|
|
2074
|
+
static defineScope(callback: (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>): ((...args: Array<ReturnType<typeof JSON.parse>>) => import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) & {
|
|
2075
|
+
scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../../utils/model-scope.js").ModelScopeDescriptor;
|
|
152
2076
|
};
|
|
153
2077
|
static getColumnNameToAttributeNameMap(): Record<string, string>;
|
|
154
2078
|
static getTranslationsMap(): Record<string, object>;
|
|
@@ -161,12 +2085,66 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
161
2085
|
static getValidatorTypesMap(): Record<string, typeof import("./validators/base.js").default>;
|
|
162
2086
|
/**
|
|
163
2087
|
* Runs get attachments map.
|
|
164
|
-
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2088
|
+
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions keyed by name.
|
|
165
2089
|
*/
|
|
166
2090
|
static getAttachmentsMap(): Record<string, {
|
|
167
|
-
driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2091
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
168
2092
|
type: "hasOne" | "hasMany";
|
|
169
2093
|
}>;
|
|
2094
|
+
/**
|
|
2095
|
+
* Attributes.
|
|
2096
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
2097
|
+
_attributes: Record<string, ReturnType<typeof JSON.parse>>;
|
|
2098
|
+
/**
|
|
2099
|
+
* Changes.
|
|
2100
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
2101
|
+
_changes: Record<string, ReturnType<typeof JSON.parse>>;
|
|
2102
|
+
/**
|
|
2103
|
+
* Changes captured before a create audit is written.
|
|
2104
|
+
* @type {import("./auditing.js").AuditChanges | undefined} */
|
|
2105
|
+
_pendingCreateAuditChanges: import("./auditing.js").AuditChanges | undefined;
|
|
2106
|
+
/**
|
|
2107
|
+
* Changes captured before an update audit is written.
|
|
2108
|
+
* @type {import("./auditing.js").AuditChanges | undefined} */
|
|
2109
|
+
_pendingUpdateAuditChanges: import("./auditing.js").AuditChanges | undefined;
|
|
2110
|
+
/**
|
|
2111
|
+
* Attribute names explicitly assigned in the current update call.
|
|
2112
|
+
* @type {Set<string> | undefined}
|
|
2113
|
+
*/
|
|
2114
|
+
_assignedAttributeNames: Set<string> | undefined;
|
|
2115
|
+
/**
|
|
2116
|
+
* Columns as hash.
|
|
2117
|
+
* @type {Record<string, import("../drivers/base-column.js").default>} */
|
|
2118
|
+
_columnsAsHash: Record<string, import("../drivers/base-column.js").default>;
|
|
2119
|
+
/**
|
|
2120
|
+
* Connection.
|
|
2121
|
+
* @type {import("../drivers/base.js").default | undefined} */
|
|
2122
|
+
__connection: import("../drivers/base.js").default | undefined;
|
|
2123
|
+
/**
|
|
2124
|
+
* Explicit operation owning this record's database work.
|
|
2125
|
+
* @type {import("../operation.js").default | undefined} */
|
|
2126
|
+
_databaseOperation: import("../operation.js").default | undefined;
|
|
2127
|
+
/**
|
|
2128
|
+
* Instance relationships.
|
|
2129
|
+
* @type {Record<string, import("./instance-relationships/base.js").default>} */
|
|
2130
|
+
_instanceRelationships: Record<string, import("./instance-relationships/base.js").default>;
|
|
2131
|
+
/**
|
|
2132
|
+
* Attachments.
|
|
2133
|
+
* @type {Record<string, RecordAttachmentHandle>} */
|
|
2134
|
+
_attachments: Record<string, RecordAttachmentHandle>;
|
|
2135
|
+
/**
|
|
2136
|
+
* Load cohort.
|
|
2137
|
+
* @type {Array<VelociousDatabaseRecord> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-preload.
|
|
2138
|
+
*/
|
|
2139
|
+
_loadCohort: Array<VelociousDatabaseRecord> | undefined;
|
|
2140
|
+
/**
|
|
2141
|
+
* Table name.
|
|
2142
|
+
* @type {string | undefined} */
|
|
2143
|
+
__tableName: string | undefined;
|
|
2144
|
+
/**
|
|
2145
|
+
* Validation errors.
|
|
2146
|
+
* @type {Record<string, ValidationErrorObjectType[]>} */
|
|
2147
|
+
_validationErrors: Record<string, ValidationErrorObjectType[]>;
|
|
170
2148
|
static validatorTypes(): Record<string, typeof import("./validators/base.js").default>;
|
|
171
2149
|
/**
|
|
172
2150
|
* Runs register validator type.
|
|
@@ -347,40 +2325,15 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
347
2325
|
* @param {string} relationshipName - Relationship name.
|
|
348
2326
|
* @param {RelationshipDataArgumentType} data - Data payload.
|
|
349
2327
|
*/
|
|
350
|
-
static _defineRelationship(relationshipName: string, data:
|
|
351
|
-
/**
|
|
352
|
-
* - Disable auto-batch-preload for this relationship by passing false. Default true.
|
|
353
|
-
*/
|
|
354
|
-
autoload?: boolean | undefined;
|
|
355
|
-
/**
|
|
356
|
-
* - Model class name for the related record.
|
|
357
|
-
*/
|
|
358
|
-
className?: string | undefined;
|
|
359
|
-
/**
|
|
360
|
-
* - Dependent action when parent is destroyed (e.g. "destroy").
|
|
361
|
-
*/
|
|
362
|
-
dependent?: string | undefined;
|
|
363
|
-
/**
|
|
364
|
-
* - Model class for the related record.
|
|
365
|
-
*/
|
|
366
|
-
klass?: typeof VelociousDatabaseRecord | undefined;
|
|
367
|
-
/**
|
|
368
|
-
* - Optional scope callback for the relationship.
|
|
369
|
-
*/
|
|
370
|
-
scope?: ((query: import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord>) => (import("../query/model-class-query.js").default<typeof VelociousDatabaseRecord> | void)) | undefined;
|
|
371
|
-
/**
|
|
372
|
-
* - Relationship type (e.g. "hasMany", "belongsTo").
|
|
373
|
-
*/
|
|
374
|
-
type?: string | undefined;
|
|
375
|
-
}): void;
|
|
2328
|
+
static _defineRelationship(relationshipName: string, data: RelationshipDataArgumentType): void;
|
|
376
2329
|
/**
|
|
377
2330
|
* Runs normalize relationship args.
|
|
378
2331
|
* @param {RelationshipScopeCallback | object | undefined} scopeOrOptions - Scope callback or options.
|
|
379
2332
|
* @param {object | undefined} options - Options.
|
|
380
2333
|
* @returns {{scope: (RelationshipScopeCallback | undefined), relationshipOptions: object}} - Normalized arguments.
|
|
381
2334
|
*/
|
|
382
|
-
static _normalizeRelationshipArgs(scopeOrOptions:
|
|
383
|
-
scope: (
|
|
2335
|
+
static _normalizeRelationshipArgs(scopeOrOptions: RelationshipScopeCallback | object | undefined, options: object | undefined): {
|
|
2336
|
+
scope: (RelationshipScopeCallback | undefined);
|
|
384
2337
|
relationshipOptions: object;
|
|
385
2338
|
};
|
|
386
2339
|
/**
|
|
@@ -446,28 +2399,75 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
446
2399
|
static getQueryDataByName(name: string): import("../query/query-data.js").QueryDataFn | null;
|
|
447
2400
|
/**
|
|
448
2401
|
* Runs get attachments.
|
|
449
|
-
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2402
|
+
* @returns {Record<string, {driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}>} - Attachment definitions.
|
|
450
2403
|
*/
|
|
451
2404
|
static getAttachments(): Record<string, {
|
|
452
|
-
driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2405
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
453
2406
|
type: "hasOne" | "hasMany";
|
|
454
2407
|
}>;
|
|
455
2408
|
/**
|
|
456
2409
|
* Runs get attachment by name.
|
|
457
2410
|
* @param {string} attachmentName - Attachment name.
|
|
458
|
-
* @returns {{driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2411
|
+
* @returns {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>, type: "hasOne" | "hasMany"}} - Attachment definition.
|
|
459
2412
|
*/
|
|
460
2413
|
static getAttachmentByName(attachmentName: string): {
|
|
461
|
-
driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2414
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
462
2415
|
type: "hasOne" | "hasMany";
|
|
463
2416
|
};
|
|
2417
|
+
/**
|
|
2418
|
+
* Runs get relationship by name.
|
|
2419
|
+
* @param {string} relationshipName - Relationship name.
|
|
2420
|
+
* @returns {import("./instance-relationships/base.js").default} - The relationship by name.
|
|
2421
|
+
*/
|
|
2422
|
+
getRelationshipByName(relationshipName: string): import("./instance-relationships/base.js").default;
|
|
2423
|
+
/**
|
|
2424
|
+
* Preloads relationship(s) onto this already-loaded record. Accepts either a
|
|
2425
|
+
* query built via `Model.preload(...).select(...)` or a raw preload spec
|
|
2426
|
+
* (string / array / nested object). A relationship that is already preloaded
|
|
2427
|
+
* with all the required columns present is left untouched unless `force` is
|
|
2428
|
+
* set. Preloading onto the relationship cache lets later accessors reuse the
|
|
2429
|
+
* loaded data instead of issuing identical queries.
|
|
2430
|
+
* @param {import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
|
|
2431
|
+
* @param {{force?: boolean}} [options] - Options.
|
|
2432
|
+
* @returns {Promise<void>} - Resolves when preloading completes.
|
|
2433
|
+
*/
|
|
2434
|
+
preload(queryOrSpec: import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>, options?: {
|
|
2435
|
+
force?: boolean;
|
|
2436
|
+
}): Promise<void>;
|
|
2437
|
+
/**
|
|
2438
|
+
* Runs load relationship.
|
|
2439
|
+
* @param {string} relationshipName - Relationship name.
|
|
2440
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
|
|
2441
|
+
*/
|
|
2442
|
+
loadRelationship(relationshipName: string): Promise<ReturnType<typeof JSON.parse>>;
|
|
2443
|
+
/**
|
|
2444
|
+
* Runs relationship or load.
|
|
2445
|
+
* @param {string} relationshipName - Relationship name.
|
|
2446
|
+
* @param {{preloadTranslations?: boolean}} [options] - Load options.
|
|
2447
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Loaded relationship value.
|
|
2448
|
+
*/
|
|
2449
|
+
relationshipOrLoad(relationshipName: string, options?: {
|
|
2450
|
+
preloadTranslations?: boolean;
|
|
2451
|
+
}): Promise<ReturnType<typeof JSON.parse>>;
|
|
2452
|
+
/**
|
|
2453
|
+
* Preloads translations on a loaded relationship target when explicitly requested.
|
|
2454
|
+
* @param {ReturnType<typeof JSON.parse>} loaded - Loaded relationship value.
|
|
2455
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Relationship value after translation preload.
|
|
2456
|
+
*/
|
|
2457
|
+
_preloadLoadedRelationshipTranslations(loaded: ReturnType<typeof JSON.parse>): Promise<ReturnType<typeof JSON.parse>>;
|
|
2458
|
+
/**
|
|
2459
|
+
* Runs get attachment by name.
|
|
2460
|
+
* @param {string} attachmentName - Attachment name.
|
|
2461
|
+
* @returns {RecordAttachmentHandle} - Attachment handle.
|
|
2462
|
+
*/
|
|
2463
|
+
getAttachmentByName(attachmentName: string): RecordAttachmentHandle;
|
|
464
2464
|
/**
|
|
465
2465
|
* Adds a belongs-to-relationship to the model.
|
|
466
2466
|
* @param {string} relationshipName The name of the relationship.
|
|
467
2467
|
* @param {RelationshipScopeCallback | object} [scopeOrOptions] The scope callback or options for the relationship.
|
|
468
2468
|
* @param {object} [options] The options for the relationship.
|
|
469
2469
|
*/
|
|
470
|
-
static belongsTo(relationshipName: string, scopeOrOptions?:
|
|
2470
|
+
static belongsTo(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
|
|
471
2471
|
/**
|
|
472
2472
|
* Runs connection.
|
|
473
2473
|
* @param {object} [args] - Options.
|
|
@@ -475,22 +2475,29 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
475
2475
|
* @returns {import("../drivers/base.js").default} - The connection.
|
|
476
2476
|
*/
|
|
477
2477
|
static connection({ enforceTenantDatabaseScope, ...restArgs }?: {
|
|
478
|
-
enforceTenantDatabaseScope?: boolean
|
|
2478
|
+
enforceTenantDatabaseScope?: boolean;
|
|
479
2479
|
}): import("../drivers/base.js").default;
|
|
480
2480
|
/**
|
|
481
2481
|
* Runs create.
|
|
482
|
-
* @template {Record<string,
|
|
2482
|
+
* @template {Record<string, ReturnType<typeof JSON.parse>>} CreateAttributes
|
|
483
2483
|
* @template {VelociousDatabaseRecord<CreateAttributes>} Model
|
|
484
2484
|
* @this {{new (changes?: CreateAttributes): Model} & typeof VelociousDatabaseRecord}
|
|
485
2485
|
* @param {CreateAttributes} [attributes] - Attributes.
|
|
486
2486
|
* @returns {Promise<Model>} - Resolves with the create.
|
|
487
2487
|
*/
|
|
488
|
-
static create<CreateAttributes extends Record<string,
|
|
2488
|
+
static create<CreateAttributes extends Record<string, ReturnType<typeof JSON.parse>>, Model extends VelociousDatabaseRecord<CreateAttributes>>(this: {
|
|
2489
|
+
new (changes?: CreateAttributes): Model;
|
|
2490
|
+
} & typeof VelociousDatabaseRecord, attributes?: CreateAttributes): Promise<Model>;
|
|
489
2491
|
/**
|
|
490
2492
|
* Runs get configuration.
|
|
491
2493
|
* @returns {import("../../configuration.js").default} - The configuration.
|
|
492
2494
|
*/
|
|
493
2495
|
static _getConfiguration(): import("../../configuration.js").default;
|
|
2496
|
+
/**
|
|
2497
|
+
* Runs get configuration.
|
|
2498
|
+
* @returns {import("../../configuration.js").default} - The configuration.
|
|
2499
|
+
*/
|
|
2500
|
+
_getConfiguration(): import("../../configuration.js").default;
|
|
494
2501
|
/**
|
|
495
2502
|
* Adds a has-many-relationship to the model class.
|
|
496
2503
|
* @param {string} relationshipName The name of the relationship (e.g. "posts")
|
|
@@ -498,7 +2505,7 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
498
2505
|
* @param {object} [options] The options for the relationship (e.g. {className: "Post"})
|
|
499
2506
|
* @returns {void} - No return value.
|
|
500
2507
|
*/
|
|
501
|
-
static hasMany(relationshipName: string, scopeOrOptions?:
|
|
2508
|
+
static hasMany(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
|
|
502
2509
|
/**
|
|
503
2510
|
* Rails-style declaration that this model accepts nested-attribute writes
|
|
504
2511
|
* for a relationship when saved through a parent. Required — Velocious
|
|
@@ -515,23 +2522,23 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
515
2522
|
* Project.hasMany("tasks")
|
|
516
2523
|
* Project.acceptsNestedAttributesFor("tasks", {allowDestroy: true})
|
|
517
2524
|
* @param {string} relationshipName - Relationship name on this model.
|
|
518
|
-
* @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string,
|
|
2525
|
+
* @param {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean}} [options] - Policy options.
|
|
519
2526
|
* @returns {void}
|
|
520
2527
|
*/
|
|
521
2528
|
static acceptsNestedAttributesFor(relationshipName: string, options?: {
|
|
522
2529
|
allowDestroy?: boolean;
|
|
523
2530
|
limit?: number;
|
|
524
|
-
rejectIf?: (attributes: Record<string,
|
|
2531
|
+
rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
|
|
525
2532
|
}): void;
|
|
526
2533
|
/**
|
|
527
2534
|
* Runs accepted nested attributes for.
|
|
528
2535
|
* @param {string} relationshipName - Relationship name.
|
|
529
|
-
* @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string,
|
|
2536
|
+
* @returns {{allowDestroy?: boolean, limit?: number, rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean} | null} - Policy declared via `acceptsNestedAttributesFor`, or null when not accepted.
|
|
530
2537
|
*/
|
|
531
2538
|
static acceptedNestedAttributesFor(relationshipName: string): {
|
|
532
2539
|
allowDestroy?: boolean;
|
|
533
2540
|
limit?: number;
|
|
534
|
-
rejectIf?: (attributes: Record<string,
|
|
2541
|
+
rejectIf?: (attributes: Record<string, ReturnType<typeof JSON.parse>>) => boolean;
|
|
535
2542
|
} | null;
|
|
536
2543
|
/**
|
|
537
2544
|
* Adds a has-one-relationship to the model class.
|
|
@@ -540,36 +2547,36 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
540
2547
|
* @param {object} [options] The options for the relationship (e.g. {className: "Post"})
|
|
541
2548
|
* @returns {void} - No return value.
|
|
542
2549
|
*/
|
|
543
|
-
static hasOne(relationshipName: string, scopeOrOptions?:
|
|
2550
|
+
static hasOne(relationshipName: string, scopeOrOptions?: RelationshipScopeCallback | object, options?: object): void;
|
|
544
2551
|
/**
|
|
545
2552
|
* Runs define attachment.
|
|
546
2553
|
* @param {string} attachmentName - Attachment name.
|
|
547
2554
|
* @param {object} args - Attachment args.
|
|
548
|
-
* @param {string | AttachmentDriverConstructor | Record<string,
|
|
2555
|
+
* @param {string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>} [args.driver] - Attachment driver name, class, or instance.
|
|
549
2556
|
* @param {"hasOne" | "hasMany"} args.type - Attachment type.
|
|
550
2557
|
* @returns {void} - No return value.
|
|
551
2558
|
*/
|
|
552
2559
|
static _defineAttachment(attachmentName: string, { driver, type }: {
|
|
553
|
-
driver?: string | Record<string,
|
|
2560
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
554
2561
|
type: "hasOne" | "hasMany";
|
|
555
2562
|
}): void;
|
|
556
2563
|
/**
|
|
557
2564
|
* Adds a single attachment helper to the model.
|
|
558
2565
|
* @param {string} attachmentName - Attachment name.
|
|
559
|
-
* @param {{driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2566
|
+
* @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
|
|
560
2567
|
* @returns {void} - No return value.
|
|
561
2568
|
*/
|
|
562
2569
|
static hasOneAttachment(attachmentName: string, args?: {
|
|
563
|
-
driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2570
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
564
2571
|
}): void;
|
|
565
2572
|
/**
|
|
566
2573
|
* Adds a collection attachment helper to the model.
|
|
567
2574
|
* @param {string} attachmentName - Attachment name.
|
|
568
|
-
* @param {{driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2575
|
+
* @param {{driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>}} [args] - Attachment options.
|
|
569
2576
|
* @returns {void} - No return value.
|
|
570
2577
|
*/
|
|
571
2578
|
static hasManyAttachments(attachmentName: string, args?: {
|
|
572
|
-
driver?: string | AttachmentDriverConstructor | Record<string,
|
|
2579
|
+
driver?: string | AttachmentDriverConstructor | Record<string, ReturnType<typeof JSON.parse>>;
|
|
573
2580
|
}): void;
|
|
574
2581
|
/**
|
|
575
2582
|
* Runs human attribute name.
|
|
@@ -616,18 +2623,25 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
616
2623
|
*/
|
|
617
2624
|
static initializeRecord({ configuration, connection: explicitConnection, ...restArgs }: {
|
|
618
2625
|
configuration: import("../../configuration.js").default;
|
|
619
|
-
connection?: import("../drivers/base.js").default
|
|
2626
|
+
connection?: import("../drivers/base.js").default;
|
|
620
2627
|
}): Promise<void>;
|
|
621
2628
|
/**
|
|
622
2629
|
* Initializes the model class the first time an async record API needs table
|
|
623
2630
|
* metadata. Concurrent callers share the same initialization promise, and a
|
|
624
2631
|
* failed initialization can be retried by a later call.
|
|
625
|
-
* @param {{configuration?: import("../../configuration.js").default}} [args] - Optional configuration
|
|
2632
|
+
* @param {{configuration?: import("../../configuration.js").default, connection?: import("../drivers/base.js").default}} [args] - Optional configuration and explicit metadata connection.
|
|
626
2633
|
* @returns {Promise<void>} - Resolves when the model class is initialized.
|
|
627
2634
|
*/
|
|
628
2635
|
static ensureInitialized(args?: {
|
|
629
2636
|
configuration?: import("../../configuration.js").default;
|
|
2637
|
+
connection?: import("../drivers/base.js").default;
|
|
630
2638
|
}): Promise<void>;
|
|
2639
|
+
/**
|
|
2640
|
+
* Runs has attribute.
|
|
2641
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to use.
|
|
2642
|
+
* @returns {boolean} - Whether attribute.
|
|
2643
|
+
*/
|
|
2644
|
+
_hasAttribute(value: ReturnType<typeof JSON.parse>): boolean;
|
|
631
2645
|
/**
|
|
632
2646
|
* Runs is initialized.
|
|
633
2647
|
* @returns {boolean} - Whether initialized.
|
|
@@ -638,7 +2652,13 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
638
2652
|
* @returns {void} - No return value.
|
|
639
2653
|
*/
|
|
640
2654
|
static _assertHasBeenInitialized(): void;
|
|
641
|
-
|
|
2655
|
+
/**
|
|
2656
|
+
* Defines translation accessors and initializes the generated translation
|
|
2657
|
+
* class through the same metadata connection as the translated model.
|
|
2658
|
+
* @param {import("../drivers/base.js").default} connection - Metadata connection.
|
|
2659
|
+
* @returns {Promise<void>} - Resolves when translation metadata is ready.
|
|
2660
|
+
*/
|
|
2661
|
+
static _defineTranslationMethods(connection: import("../drivers/base.js").default): Promise<void>;
|
|
642
2662
|
/**
|
|
643
2663
|
* Runs get configured database identifier.
|
|
644
2664
|
* @returns {string} - The configured non-tenant database identifier.
|
|
@@ -648,10 +2668,12 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
648
2668
|
* Runs get database identifier.
|
|
649
2669
|
* @param {object} [args] - Options.
|
|
650
2670
|
* @param {boolean} [args.enforceTenantDatabaseScope] - Whether tenant-switched models must resolve a tenant database identifier.
|
|
2671
|
+
* @param {object} [args.tenant] - Explicit tenant descriptor instead of the ambient tenant.
|
|
651
2672
|
* @returns {string} - The database identifier.
|
|
652
2673
|
*/
|
|
653
|
-
static getDatabaseIdentifier({ enforceTenantDatabaseScope, ...restArgs }?: {
|
|
654
|
-
enforceTenantDatabaseScope?: boolean
|
|
2674
|
+
static getDatabaseIdentifier({ enforceTenantDatabaseScope, tenant, ...restArgs }?: {
|
|
2675
|
+
enforceTenantDatabaseScope?: boolean;
|
|
2676
|
+
tenant?: object;
|
|
655
2677
|
}): string;
|
|
656
2678
|
/**
|
|
657
2679
|
* Runs set database identifier.
|
|
@@ -675,10 +2697,120 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
675
2697
|
static hasTenantDatabaseIdentifierResolver(): boolean;
|
|
676
2698
|
/**
|
|
677
2699
|
* Runs get tenant database identifier.
|
|
678
|
-
* @param {
|
|
2700
|
+
* @param {ReturnType<typeof JSON.parse>} [tenant] - Tenant override.
|
|
679
2701
|
* @returns {string | undefined} - Tenant-scoped database identifier when configured.
|
|
680
2702
|
*/
|
|
681
|
-
static getTenantDatabaseIdentifier(tenant?:
|
|
2703
|
+
static getTenantDatabaseIdentifier(tenant?: ReturnType<typeof JSON.parse>): string | undefined;
|
|
2704
|
+
/**
|
|
2705
|
+
* Runs get attribute.
|
|
2706
|
+
* @param {string} name - Name.
|
|
2707
|
+
* @returns {ReturnType<typeof JSON.parse>} - The attribute.
|
|
2708
|
+
*/
|
|
2709
|
+
getAttribute(name: string): ReturnType<typeof JSON.parse>;
|
|
2710
|
+
/**
|
|
2711
|
+
* Runs get model class.
|
|
2712
|
+
* @abstract
|
|
2713
|
+
* @returns {typeof VelociousDatabaseRecord} - The model class.
|
|
2714
|
+
*/
|
|
2715
|
+
getModelClass(): typeof VelociousDatabaseRecord;
|
|
2716
|
+
/**
|
|
2717
|
+
* Runs set attribute.
|
|
2718
|
+
* @param {string} name - Name.
|
|
2719
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
2720
|
+
* @returns {void} - No return value.
|
|
2721
|
+
*/
|
|
2722
|
+
setAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
|
|
2723
|
+
/**
|
|
2724
|
+
* Runs set column attribute.
|
|
2725
|
+
* @param {string} name - Name.
|
|
2726
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
2727
|
+
*/
|
|
2728
|
+
_setColumnAttribute(name: string, newValue: ReturnType<typeof JSON.parse>): void;
|
|
2729
|
+
/**
|
|
2730
|
+
* Clears loaded belongs-to caches when callers assign the foreign key directly.
|
|
2731
|
+
* @param {string} columnName - Changed database column name.
|
|
2732
|
+
* @param {ReturnType<typeof JSON.parse>} normalizedValue - New normalized column value.
|
|
2733
|
+
* @returns {void} - No return value.
|
|
2734
|
+
*/
|
|
2735
|
+
_clearBelongsToRelationshipForChangedForeignKey(columnName: string, normalizedValue: ReturnType<typeof JSON.parse>): void;
|
|
2736
|
+
/**
|
|
2737
|
+
* Runs belongs to relationships for foreign key.
|
|
2738
|
+
* @param {string} columnName - Changed database column name.
|
|
2739
|
+
* @returns {Array<ReturnType<typeof JSON.parse>>} - Loaded relationship instances that use the changed foreign key.
|
|
2740
|
+
*/
|
|
2741
|
+
_belongsToRelationshipsForForeignKey(columnName: string): Array<ReturnType<typeof JSON.parse>>;
|
|
2742
|
+
/**
|
|
2743
|
+
* Runs belongs to relationship uses foreign key.
|
|
2744
|
+
* @param {object} args - Relationship match arguments.
|
|
2745
|
+
* @param {string} args.columnName - Changed database column name.
|
|
2746
|
+
* @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
|
|
2747
|
+
* @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
|
|
2748
|
+
*/
|
|
2749
|
+
_belongsToRelationshipUsesForeignKey({ columnName, relationship }: {
|
|
2750
|
+
columnName: string;
|
|
2751
|
+
relationship: ReturnType<typeof JSON.parse>;
|
|
2752
|
+
}): boolean;
|
|
2753
|
+
/**
|
|
2754
|
+
* Runs belongs to relationship matches foreign key value.
|
|
2755
|
+
* @param {object} args - Relationship cache arguments.
|
|
2756
|
+
* @param {ReturnType<typeof JSON.parse>} args.normalizedValue - New normalized column value.
|
|
2757
|
+
* @param {ReturnType<typeof JSON.parse>} args.relationship - Relationship instance.
|
|
2758
|
+
* @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
|
|
2759
|
+
*/
|
|
2760
|
+
_belongsToRelationshipMatchesForeignKeyValue({ normalizedValue, relationship }: {
|
|
2761
|
+
normalizedValue: ReturnType<typeof JSON.parse>;
|
|
2762
|
+
relationship: ReturnType<typeof JSON.parse>;
|
|
2763
|
+
}): boolean;
|
|
2764
|
+
/**
|
|
2765
|
+
* Returns the foreign key value for a belongs-to relationship assignment.
|
|
2766
|
+
* @param {object} args - Relationship assignment arguments.
|
|
2767
|
+
* @param {VelociousDatabaseRecord | null | undefined} args.model - Assigned model.
|
|
2768
|
+
* @param {import("./instance-relationships/base.js").default} args.relationship - Belongs-to relationship instance.
|
|
2769
|
+
* @returns {string | number | null | undefined} - Foreign key value for the assignment.
|
|
2770
|
+
*/
|
|
2771
|
+
_belongsToForeignKeyValue({ model, relationship }: {
|
|
2772
|
+
model: VelociousDatabaseRecord | null | undefined;
|
|
2773
|
+
relationship: import("./instance-relationships/base.js").default;
|
|
2774
|
+
}): string | number | null | undefined;
|
|
2775
|
+
/**
|
|
2776
|
+
* Runs clear loaded belongs to relationship.
|
|
2777
|
+
* @param {ReturnType<typeof JSON.parse>} relationship - Relationship instance.
|
|
2778
|
+
* @returns {void} - No return value.
|
|
2779
|
+
*/
|
|
2780
|
+
_clearLoadedBelongsToRelationship(relationship: ReturnType<typeof JSON.parse>): void;
|
|
2781
|
+
/**
|
|
2782
|
+
* Runs normalize date value.
|
|
2783
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to use.
|
|
2784
|
+
* @returns {ReturnType<typeof JSON.parse>} - The date value.
|
|
2785
|
+
*/
|
|
2786
|
+
_normalizeDateValue(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
2787
|
+
/**
|
|
2788
|
+
* Runs normalize sqlite boolean value.
|
|
2789
|
+
* @param {object} args - Options object.
|
|
2790
|
+
* @param {string | undefined} args.columnType - Column type.
|
|
2791
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
2792
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
2793
|
+
*/
|
|
2794
|
+
_normalizeSqliteBooleanValue({ columnType, value }: {
|
|
2795
|
+
columnType: string | undefined;
|
|
2796
|
+
value: ReturnType<typeof JSON.parse>;
|
|
2797
|
+
}): ReturnType<typeof JSON.parse>;
|
|
2798
|
+
/**
|
|
2799
|
+
* Normalizes a boolean value before storing. A declared `"boolean"` attribute cast stores
|
|
2800
|
+
* booleans as 1/0 only for integer-backed columns (e.g. an MSSQL `bit`). Columns whose
|
|
2801
|
+
* underlying type is already a native boolean (e.g. Postgres `boolean`) keep `true`/`false`
|
|
2802
|
+
* so the driver can emit the proper boolean literal; otherwise the sqlite-only normalizer applies.
|
|
2803
|
+
* @param {object} args - Options object.
|
|
2804
|
+
* @param {string} args.attributeName - Attribute name being written.
|
|
2805
|
+
* @param {string | undefined} args.columnType - Column type.
|
|
2806
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
2807
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
2808
|
+
*/
|
|
2809
|
+
_normalizeBooleanValueForWrite({ attributeName, columnType, value }: {
|
|
2810
|
+
attributeName: string;
|
|
2811
|
+
columnType: string | undefined;
|
|
2812
|
+
value: ReturnType<typeof JSON.parse>;
|
|
2813
|
+
}): ReturnType<typeof JSON.parse>;
|
|
682
2814
|
/**
|
|
683
2815
|
* Whether a declared `"boolean"` attribute cast is backed by an integer column (e.g. an MSSQL
|
|
684
2816
|
* `bit`), so booleans must be stored as 1/0. A native boolean column (e.g. Postgres `boolean`)
|
|
@@ -722,53 +2854,53 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
722
2854
|
/**
|
|
723
2855
|
* Runs insert multiple.
|
|
724
2856
|
* @param {Array<string>} columns - Column names.
|
|
725
|
-
* @param {Array<Array
|
|
2857
|
+
* @param {Array<Array<ReturnType<typeof JSON.parse>>>} rows - Rows to insert.
|
|
726
2858
|
* @param {object} [args] - Options object.
|
|
727
2859
|
* @param {boolean} [args.cast] - Whether to cast values based on column types.
|
|
728
2860
|
* @param {boolean} [args.retryIndividuallyOnFailure] - Retry rows individually if a batch insert fails.
|
|
729
2861
|
* @param {boolean} [args.returnResults] - Return succeeded/failed rows instead of throwing when retries fail.
|
|
730
|
-
* @returns {Promise<void | {succeededRows: Array<Array
|
|
2862
|
+
* @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.
|
|
731
2863
|
*/
|
|
732
|
-
static insertMultiple(columns: Array<string>, rows: Array<Array<
|
|
733
|
-
cast?: boolean
|
|
734
|
-
retryIndividuallyOnFailure?: boolean
|
|
735
|
-
returnResults?: boolean
|
|
2864
|
+
static insertMultiple(columns: Array<string>, rows: Array<Array<ReturnType<typeof JSON.parse>>>, args?: {
|
|
2865
|
+
cast?: boolean;
|
|
2866
|
+
retryIndividuallyOnFailure?: boolean;
|
|
2867
|
+
returnResults?: boolean;
|
|
736
2868
|
}): Promise<void | {
|
|
737
|
-
succeededRows: Array<Array<
|
|
738
|
-
failedRows: Array<Array<
|
|
2869
|
+
succeededRows: Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
2870
|
+
failedRows: Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
739
2871
|
errors: Array<{
|
|
740
|
-
row: Array<
|
|
741
|
-
error:
|
|
2872
|
+
row: Array<ReturnType<typeof JSON.parse>>;
|
|
2873
|
+
error: ReturnType<typeof JSON.parse>;
|
|
742
2874
|
}>;
|
|
743
2875
|
}>;
|
|
744
2876
|
/**
|
|
745
2877
|
* Runs normalize insert multiple rows.
|
|
746
2878
|
* @param {object} args - Options object.
|
|
747
2879
|
* @param {Array<string>} args.columns - Column names.
|
|
748
|
-
* @param {Array<Array
|
|
749
|
-
* @returns {Array<Array
|
|
2880
|
+
* @param {Array<Array<ReturnType<typeof JSON.parse>>>} args.rows - Rows to insert.
|
|
2881
|
+
* @returns {Array<Array<ReturnType<typeof JSON.parse>>>} - Normalized rows.
|
|
750
2882
|
*/
|
|
751
2883
|
static _normalizeInsertMultipleRows({ columns, rows }: {
|
|
752
2884
|
columns: Array<string>;
|
|
753
|
-
rows: Array<Array<
|
|
754
|
-
}): Array<Array<
|
|
2885
|
+
rows: Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
2886
|
+
}): Array<Array<ReturnType<typeof JSON.parse>>>;
|
|
755
2887
|
/**
|
|
756
2888
|
* Runs safe serialize insert row.
|
|
757
|
-
* @param {Array
|
|
2889
|
+
* @param {Array<ReturnType<typeof JSON.parse>>} row - Row to serialize.
|
|
758
2890
|
* @returns {string} - Safe row representation.
|
|
759
2891
|
*/
|
|
760
|
-
static _safeSerializeInsertRow(row: Array<
|
|
2892
|
+
static _safeSerializeInsertRow(row: Array<ReturnType<typeof JSON.parse>>): string;
|
|
761
2893
|
/**
|
|
762
2894
|
* Runs normalize insert value for column.
|
|
763
2895
|
* @param {object} args - Options object.
|
|
764
2896
|
* @param {string} args.columnName - Column name.
|
|
765
|
-
* @param {
|
|
766
|
-
* @returns {
|
|
2897
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Column value.
|
|
2898
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
767
2899
|
*/
|
|
768
2900
|
static _normalizeInsertValueForColumn({ columnName, value }: {
|
|
769
2901
|
columnName: string;
|
|
770
|
-
value:
|
|
771
|
-
}):
|
|
2902
|
+
value: ReturnType<typeof JSON.parse>;
|
|
2903
|
+
}): ReturnType<typeof JSON.parse>;
|
|
772
2904
|
/**
|
|
773
2905
|
* Runs is string type.
|
|
774
2906
|
* @param {string | undefined} columnType - Column type.
|
|
@@ -785,19 +2917,19 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
785
2917
|
* Runs normalize numeric value.
|
|
786
2918
|
* @param {object} args - Options object.
|
|
787
2919
|
* @param {string} args.columnType - Column type.
|
|
788
|
-
* @param {
|
|
789
|
-
* @returns {
|
|
2920
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
2921
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
790
2922
|
*/
|
|
791
2923
|
static _normalizeNumericValue({ columnType, value }: {
|
|
792
2924
|
columnType: string;
|
|
793
|
-
value:
|
|
794
|
-
}):
|
|
2925
|
+
value: ReturnType<typeof JSON.parse>;
|
|
2926
|
+
}): ReturnType<typeof JSON.parse>;
|
|
795
2927
|
/**
|
|
796
2928
|
* Runs normalize date value for insert.
|
|
797
|
-
* @param {
|
|
798
|
-
* @returns {
|
|
2929
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to normalize.
|
|
2930
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
799
2931
|
*/
|
|
800
|
-
static _normalizeDateValueForInsert(value:
|
|
2932
|
+
static _normalizeDateValueForInsert(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
801
2933
|
/**
|
|
802
2934
|
* Runs normalize date string for insert.
|
|
803
2935
|
* @param {string} value - Date string value.
|
|
@@ -813,13 +2945,13 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
813
2945
|
* Runs normalize sqlite boolean value for insert.
|
|
814
2946
|
* @param {object} args - Options object.
|
|
815
2947
|
* @param {string | undefined} args.columnType - Column type.
|
|
816
|
-
* @param {
|
|
817
|
-
* @returns {
|
|
2948
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
2949
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
818
2950
|
*/
|
|
819
2951
|
static _normalizeSqliteBooleanValueForInsert({ columnType, value }: {
|
|
820
2952
|
columnType: string | undefined;
|
|
821
|
-
value:
|
|
822
|
-
}):
|
|
2953
|
+
value: ReturnType<typeof JSON.parse>;
|
|
2954
|
+
}): ReturnType<typeof JSON.parse>;
|
|
823
2955
|
/**
|
|
824
2956
|
* Runs next primary key.
|
|
825
2957
|
* @returns {Promise<number>} - Resolves with the next primary key.
|
|
@@ -866,6 +2998,34 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
866
2998
|
* @returns {boolean} - False only when the primary key was explicitly set to null.
|
|
867
2999
|
*/
|
|
868
3000
|
static hasPrimaryKey(): boolean;
|
|
3001
|
+
/**
|
|
3002
|
+
* Runs save.
|
|
3003
|
+
* @returns {Promise<void>} - Resolves when complete.
|
|
3004
|
+
*/
|
|
3005
|
+
save(): Promise<void>;
|
|
3006
|
+
_autoSaveBelongsToRelationships(): Promise<{
|
|
3007
|
+
savedCount: number;
|
|
3008
|
+
}>;
|
|
3009
|
+
_autoSaveHasManyAndHasOneRelationshipsToSave(): import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>[];
|
|
3010
|
+
/**
|
|
3011
|
+
* Resolves a relationship foreign-key column to this model's public attribute name.
|
|
3012
|
+
* @param {import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>} instanceRelationship - Relationship instance.
|
|
3013
|
+
* @returns {string} Attribute name accepted by setAttribute/assign.
|
|
3014
|
+
*/
|
|
3015
|
+
_relationshipForeignKeyAttribute(instanceRelationship: import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>): string;
|
|
3016
|
+
/**
|
|
3017
|
+
* Runs auto save has many and has one relationships.
|
|
3018
|
+
* @param {object} args - Options object.
|
|
3019
|
+
* @param {boolean} args.isNewRecord - Whether is new record.
|
|
3020
|
+
*/
|
|
3021
|
+
_autoSaveHasManyAndHasOneRelationships({ isNewRecord }: {
|
|
3022
|
+
isNewRecord: boolean;
|
|
3023
|
+
}): Promise<void>;
|
|
3024
|
+
/**
|
|
3025
|
+
* Runs auto save attachments.
|
|
3026
|
+
* @returns {Promise<void>} - Resolves when pending attachments have been saved.
|
|
3027
|
+
*/
|
|
3028
|
+
_autoSaveAttachments(): Promise<void>;
|
|
869
3029
|
/**
|
|
870
3030
|
* Runs table name.
|
|
871
3031
|
* @returns {string} - The table name.
|
|
@@ -879,10 +3039,10 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
879
3039
|
static setTableName(tableName: string): void;
|
|
880
3040
|
/**
|
|
881
3041
|
* Runs transaction.
|
|
882
|
-
* @param {
|
|
883
|
-
* @returns {Promise
|
|
3042
|
+
* @param {() => Promise<void>} callback - Callback function.
|
|
3043
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Resolves with the transaction.
|
|
884
3044
|
*/
|
|
885
|
-
static transaction(callback: () => Promise<void>): Promise<
|
|
3045
|
+
static transaction(callback: () => Promise<void>): Promise<ReturnType<typeof JSON.parse>>;
|
|
886
3046
|
/**
|
|
887
3047
|
* Runs the callback while holding a named advisory lock. Calls without
|
|
888
3048
|
* By default calls use the caller connection. Calls with `dedicatedConnection`
|
|
@@ -978,9 +3138,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
978
3138
|
/**
|
|
979
3139
|
* Adds a validation to an attribute.
|
|
980
3140
|
* @param {string} attributeName The name of the attribute to validate.
|
|
981
|
-
* @param {Record<string, boolean | Record<string,
|
|
3141
|
+
* @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.
|
|
982
3142
|
*/
|
|
983
|
-
static validates(attributeName: string, validators: Record<string, boolean | Record<string,
|
|
3143
|
+
static validates(attributeName: string, validators: Record<string, boolean | Record<string, ReturnType<typeof JSON.parse>>>): Promise<void>;
|
|
984
3144
|
/**
|
|
985
3145
|
* Registers gap-less positional list callbacks for a column scoped by
|
|
986
3146
|
* another column. Inserts and moves shift surrounding positions so the
|
|
@@ -993,9 +3153,37 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
993
3153
|
* @param {object} options - Options with a required scope attribute.
|
|
994
3154
|
* @param {string} options.scope - camelCase scope attribute (e.g. "boardColumnId").
|
|
995
3155
|
*/
|
|
996
|
-
static actsAsList(positionColumn: string, options: {
|
|
997
|
-
scope: string;
|
|
998
|
-
}): void;
|
|
3156
|
+
static actsAsList(positionColumn: string, options: {
|
|
3157
|
+
scope: string;
|
|
3158
|
+
}): void;
|
|
3159
|
+
/**
|
|
3160
|
+
* Runs translations loaded.
|
|
3161
|
+
* @abstract
|
|
3162
|
+
* @returns {TranslationBase[]} - The translations loaded.
|
|
3163
|
+
*/
|
|
3164
|
+
translationsLoaded(): TranslationBase[];
|
|
3165
|
+
/**
|
|
3166
|
+
* Runs get translated attribute.
|
|
3167
|
+
* @param {string} name - Name.
|
|
3168
|
+
* @param {string} locale - Locale.
|
|
3169
|
+
* @returns {string | undefined} - The translated attribute, if found.
|
|
3170
|
+
*/
|
|
3171
|
+
_getTranslatedAttribute(name: string, locale: string): string | undefined;
|
|
3172
|
+
/**
|
|
3173
|
+
* Runs get translated attribute with fallback.
|
|
3174
|
+
* @param {string} name - Name.
|
|
3175
|
+
* @param {string} locale - Locale.
|
|
3176
|
+
* @returns {string | undefined} - The translated attribute with fallback, if found.
|
|
3177
|
+
*/
|
|
3178
|
+
_getTranslatedAttributeWithFallback(name: string, locale: string): string | undefined;
|
|
3179
|
+
/**
|
|
3180
|
+
* Runs set translated attribute.
|
|
3181
|
+
* @param {string} name - Name.
|
|
3182
|
+
* @param {string} locale - Locale.
|
|
3183
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
3184
|
+
* @returns {void} - No return value.
|
|
3185
|
+
*/
|
|
3186
|
+
_setTranslatedAttribute(name: string, locale: string, newValue: ReturnType<typeof JSON.parse>): void;
|
|
999
3187
|
/**
|
|
1000
3188
|
* Runs new query.
|
|
1001
3189
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
@@ -1003,7 +3191,7 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1003
3191
|
* @param {{driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default), operation?: import("../operation.js").default}} [args] - Explicit query ownership.
|
|
1004
3192
|
* @returns {ModelClassQuery<MC>} - The new query.
|
|
1005
3193
|
*/
|
|
1006
|
-
static _newQuery<MC extends typeof VelociousDatabaseRecord>(this: MC,
|
|
3194
|
+
static _newQuery<MC extends typeof VelociousDatabaseRecord>(this: MC, args?: {
|
|
1007
3195
|
driver?: import("../drivers/base.js").default | (() => import("../drivers/base.js").default);
|
|
1008
3196
|
operation?: import("../operation.js").default;
|
|
1009
3197
|
}): ModelClassQuery<MC>;
|
|
@@ -1063,9 +3251,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1063
3251
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
1064
3252
|
* @this {MC}
|
|
1065
3253
|
* @param {...string|string[]} columns - Column names.
|
|
1066
|
-
* @returns {Promise<Array
|
|
3254
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Resolves with the pluck.
|
|
1067
3255
|
*/
|
|
1068
|
-
static pluck<MC extends typeof VelociousDatabaseRecord>(this: MC, ...columns: (string | string[])[]): Promise<Array<
|
|
3256
|
+
static pluck<MC extends typeof VelociousDatabaseRecord>(this: MC, ...columns: (string | string[])[]): Promise<Array<ReturnType<typeof JSON.parse>>>;
|
|
1069
3257
|
/**
|
|
1070
3258
|
* Runs find.
|
|
1071
3259
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
@@ -1095,42 +3283,21 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1095
3283
|
[key: string]: string | number;
|
|
1096
3284
|
}): Promise<InstanceType<MC>>;
|
|
1097
3285
|
/**
|
|
1098
|
-
* Returns
|
|
1099
|
-
*
|
|
1100
|
-
*
|
|
1101
|
-
* tenant or in the default database from another tenant context — for example
|
|
1102
|
-
* `GithubWebhook.usingTenant(tenant).findBy({id})` — without depending on
|
|
1103
|
-
* which tenant happens to be active. The target tenant's connections are
|
|
1104
|
-
* ensured for the duration of each query.
|
|
3286
|
+
* Returns an immutable tenant-bound model scope. Eager helpers and explicit
|
|
3287
|
+
* databaseOperation/transaction callbacks execute from a captured physical
|
|
3288
|
+
* database configuration instead of ambient tenant state.
|
|
1105
3289
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
1106
3290
|
* @this {MC}
|
|
1107
|
-
* @param {
|
|
1108
|
-
* @returns {
|
|
3291
|
+
* @param {object} tenant - Ordinary or null-prototype JSON-compatible tenant descriptor to scope the model to.
|
|
3292
|
+
* @returns {TenantModelScope<MC>} - Model scope bound to the captured tenant database.
|
|
1109
3293
|
*/
|
|
1110
|
-
static usingTenant<MC extends typeof VelociousDatabaseRecord>(this: MC, tenant:
|
|
1111
|
-
find: (recordId: unknown) => Promise<InstanceType<MC> | null>;
|
|
1112
|
-
findBy: (conditions: {
|
|
1113
|
-
[key: string]: string | number;
|
|
1114
|
-
}) => Promise<InstanceType<MC> | null>;
|
|
1115
|
-
findByOrFail: (conditions: {
|
|
1116
|
-
[key: string]: string | number;
|
|
1117
|
-
}) => Promise<InstanceType<MC>>;
|
|
1118
|
-
};
|
|
1119
|
-
/**
|
|
1120
|
-
* Runs `callback` with the tenant switched to `tenant` and that tenant's
|
|
1121
|
-
* connections ensured. Backs `usingTenant`.
|
|
1122
|
-
* @template T
|
|
1123
|
-
* @param {?} tenant - Tenant descriptor.
|
|
1124
|
-
* @param {() => Promise<T>} callback - Query to run under the tenant.
|
|
1125
|
-
* @returns {Promise<T>} - Resolves with the callback's result.
|
|
1126
|
-
*/
|
|
1127
|
-
static _runUsingTenant<T>(tenant: unknown, callback: () => Promise<T>): Promise<T>;
|
|
3294
|
+
static usingTenant<MC extends typeof VelociousDatabaseRecord>(this: MC, tenant: object): TenantModelScope<MC>;
|
|
1128
3295
|
/**
|
|
1129
3296
|
* Runs find or create by.
|
|
1130
3297
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
1131
3298
|
* @this {MC}
|
|
1132
3299
|
* @param {{[key: string]: string | number}} conditions - Conditions hash keyed by attribute name.
|
|
1133
|
-
* @param {
|
|
3300
|
+
* @param {() => void} [callback] - Callback function.
|
|
1134
3301
|
* @returns {Promise<InstanceType<MC>>} - Resolves with the or create by.
|
|
1135
3302
|
*/
|
|
1136
3303
|
static findOrCreateBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: {
|
|
@@ -1141,10 +3308,10 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1141
3308
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
1142
3309
|
* @this {MC}
|
|
1143
3310
|
* @param {Record<string, string | number>} conditions - Conditions.
|
|
1144
|
-
* @param {
|
|
3311
|
+
* @param {(arg: InstanceType<MC>) => void} [callback] - Callback function.
|
|
1145
3312
|
* @returns {Promise<InstanceType<MC>>} - Resolves with the or initialize by.
|
|
1146
3313
|
*/
|
|
1147
|
-
static findOrInitializeBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: Record<string, string | number>, callback?: (
|
|
3314
|
+
static findOrInitializeBy<MC extends typeof VelociousDatabaseRecord>(this: MC, conditions: Record<string, string | number>, callback?: (arg: InstanceType<MC>) => void): Promise<InstanceType<MC>>;
|
|
1148
3315
|
/**
|
|
1149
3316
|
* Runs first.
|
|
1150
3317
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
@@ -1233,300 +3400,28 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1233
3400
|
* Runs ransack.
|
|
1234
3401
|
* @template {typeof VelociousDatabaseRecord} MC
|
|
1235
3402
|
* @this {MC}
|
|
1236
|
-
* @param {Record<string,
|
|
3403
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Ransack-style params hash.
|
|
1237
3404
|
* @returns {ModelClassQuery<MC>} - Query with Ransack filters applied.
|
|
1238
3405
|
*/
|
|
1239
|
-
static ransack<MC extends typeof VelociousDatabaseRecord>(this: MC, params: Record<string,
|
|
3406
|
+
static ransack<MC extends typeof VelociousDatabaseRecord>(this: MC, params: Record<string, ReturnType<typeof JSON.parse>>): ModelClassQuery<MC>;
|
|
1240
3407
|
/**
|
|
1241
3408
|
* Runs constructor.
|
|
1242
3409
|
* @param {WriteAttributes} changes - Changes.
|
|
1243
3410
|
*/
|
|
1244
3411
|
constructor(changes?: WriteAttributes);
|
|
1245
|
-
/**
|
|
1246
|
-
* Attributes.
|
|
1247
|
-
* @type {Record<string, ?>} */
|
|
1248
|
-
_attributes: Record<string, unknown>;
|
|
1249
|
-
/**
|
|
1250
|
-
* Changes.
|
|
1251
|
-
* @type {Record<string, ?>} */
|
|
1252
|
-
_changes: Record<string, unknown>;
|
|
1253
|
-
/**
|
|
1254
|
-
* Changes captured before a create audit is written.
|
|
1255
|
-
* @type {import("./auditing.js").AuditChanges | undefined} */
|
|
1256
|
-
_pendingCreateAuditChanges: import("./auditing.js").AuditChanges | undefined;
|
|
1257
|
-
/**
|
|
1258
|
-
* Changes captured before an update audit is written.
|
|
1259
|
-
* @type {import("./auditing.js").AuditChanges | undefined} */
|
|
1260
|
-
_pendingUpdateAuditChanges: import("./auditing.js").AuditChanges | undefined;
|
|
1261
|
-
/**
|
|
1262
|
-
* Attribute names explicitly assigned in the current update call.
|
|
1263
|
-
* @type {Set<string> | undefined}
|
|
1264
|
-
*/
|
|
1265
|
-
_assignedAttributeNames: Set<string> | undefined;
|
|
1266
|
-
/**
|
|
1267
|
-
* Columns as hash.
|
|
1268
|
-
* @type {Record<string, import("../drivers/base-column.js").default>} */
|
|
1269
|
-
_columnsAsHash: Record<string, import("../drivers/base-column.js").default>;
|
|
1270
|
-
/**
|
|
1271
|
-
* Connection.
|
|
1272
|
-
* @type {import("../drivers/base.js").default | undefined} */
|
|
1273
|
-
__connection: import("../drivers/base.js").default | undefined;
|
|
1274
|
-
/**
|
|
1275
|
-
* Explicit operation owning this record's database work.
|
|
1276
|
-
* @type {import("../operation.js").default | undefined} */
|
|
1277
|
-
_databaseOperation: import("../operation.js").default | undefined;
|
|
1278
|
-
/**
|
|
1279
|
-
* Instance relationships.
|
|
1280
|
-
* @type {Record<string, import("./instance-relationships/base.js").default>} */
|
|
1281
|
-
_instanceRelationships: Record<string, import("./instance-relationships/base.js").default>;
|
|
1282
|
-
/**
|
|
1283
|
-
* Attachments.
|
|
1284
|
-
* @type {Record<string, RecordAttachmentHandle>} */
|
|
1285
|
-
_attachments: Record<string, RecordAttachmentHandle>;
|
|
1286
|
-
/**
|
|
1287
|
-
* Load cohort.
|
|
1288
|
-
* @type {Array<VelociousDatabaseRecord> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-preload.
|
|
1289
|
-
*/
|
|
1290
|
-
_loadCohort: Array<VelociousDatabaseRecord> | undefined;
|
|
1291
|
-
/**
|
|
1292
|
-
* Table name.
|
|
1293
|
-
* @type {string | undefined} */
|
|
1294
|
-
__tableName: string | undefined;
|
|
1295
|
-
/**
|
|
1296
|
-
* Validation errors.
|
|
1297
|
-
* @type {Record<string, ValidationErrorObjectType[]>} */
|
|
1298
|
-
_validationErrors: Record<string, ValidationErrorObjectType[]>;
|
|
1299
|
-
/**
|
|
1300
|
-
* Runs get relationship by name.
|
|
1301
|
-
* @param {string} relationshipName - Relationship name.
|
|
1302
|
-
* @returns {import("./instance-relationships/base.js").default} - The relationship by name.
|
|
1303
|
-
*/
|
|
1304
|
-
getRelationshipByName(relationshipName: string): import("./instance-relationships/base.js").default;
|
|
1305
|
-
/**
|
|
1306
|
-
* Preloads relationship(s) onto this already-loaded record. Accepts either a
|
|
1307
|
-
* query built via `Model.preload(...).select(...)` or a raw preload spec
|
|
1308
|
-
* (string / array / nested object). A relationship that is already preloaded
|
|
1309
|
-
* with all the required columns present is left untouched unless `force` is
|
|
1310
|
-
* set. Preloading onto the relationship cache lets later accessors reuse the
|
|
1311
|
-
* loaded data instead of issuing identical queries.
|
|
1312
|
-
* @param {import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
|
|
1313
|
-
* @param {{force?: boolean}} [options] - Options.
|
|
1314
|
-
* @returns {Promise<void>} - Resolves when preloading completes.
|
|
1315
|
-
*/
|
|
1316
|
-
preload(queryOrSpec: import("../query/model-class-query.js").default | import("../query/index.js").NestedPreloadRecord | string | Array<string | import("../query/index.js").NestedPreloadRecord>, options?: {
|
|
1317
|
-
force?: boolean;
|
|
1318
|
-
}): Promise<void>;
|
|
1319
|
-
/**
|
|
1320
|
-
* Runs load relationship.
|
|
1321
|
-
* @param {string} relationshipName - Relationship name.
|
|
1322
|
-
* @returns {Promise<?>} - Loaded relationship value.
|
|
1323
|
-
*/
|
|
1324
|
-
loadRelationship(relationshipName: string): Promise<unknown>;
|
|
1325
|
-
/**
|
|
1326
|
-
* Runs relationship or load.
|
|
1327
|
-
* @param {string} relationshipName - Relationship name.
|
|
1328
|
-
* @param {{preloadTranslations?: boolean}} [options] - Load options.
|
|
1329
|
-
* @returns {Promise<?>} - Loaded relationship value.
|
|
1330
|
-
*/
|
|
1331
|
-
relationshipOrLoad(relationshipName: string, options?: {
|
|
1332
|
-
preloadTranslations?: boolean;
|
|
1333
|
-
}): Promise<unknown>;
|
|
1334
|
-
/**
|
|
1335
|
-
* Preloads translations on a loaded relationship target when explicitly requested.
|
|
1336
|
-
* @param {?} loaded - Loaded relationship value.
|
|
1337
|
-
* @returns {Promise<?>} - Relationship value after translation preload.
|
|
1338
|
-
*/
|
|
1339
|
-
_preloadLoadedRelationshipTranslations(loaded: unknown): Promise<unknown>;
|
|
1340
|
-
/**
|
|
1341
|
-
* Runs get attachment by name.
|
|
1342
|
-
* @param {string} attachmentName - Attachment name.
|
|
1343
|
-
* @returns {RecordAttachmentHandle} - Attachment handle.
|
|
1344
|
-
*/
|
|
1345
|
-
getAttachmentByName(attachmentName: string): RecordAttachmentHandle;
|
|
1346
|
-
/**
|
|
1347
|
-
* Runs get configuration.
|
|
1348
|
-
* @returns {import("../../configuration.js").default} - The configuration.
|
|
1349
|
-
*/
|
|
1350
|
-
_getConfiguration(): import("../../configuration.js").default;
|
|
1351
|
-
/**
|
|
1352
|
-
* Runs has attribute.
|
|
1353
|
-
* @param {?} value - Value to use.
|
|
1354
|
-
* @returns {boolean} - Whether attribute.
|
|
1355
|
-
*/
|
|
1356
|
-
_hasAttribute(value: unknown): boolean;
|
|
1357
|
-
/**
|
|
1358
|
-
* Runs get attribute.
|
|
1359
|
-
* @param {string} name - Name.
|
|
1360
|
-
* @returns {?} - The attribute.
|
|
1361
|
-
*/
|
|
1362
|
-
getAttribute(name: string): unknown;
|
|
1363
|
-
/**
|
|
1364
|
-
* Runs get model class.
|
|
1365
|
-
* @abstract
|
|
1366
|
-
* @returns {typeof VelociousDatabaseRecord} - The model class.
|
|
1367
|
-
*/
|
|
1368
|
-
getModelClass(): typeof VelociousDatabaseRecord;
|
|
1369
|
-
/**
|
|
1370
|
-
* Runs set attribute.
|
|
1371
|
-
* @param {string} name - Name.
|
|
1372
|
-
* @param {?} newValue - New value.
|
|
1373
|
-
* @returns {void} - No return value.
|
|
1374
|
-
*/
|
|
1375
|
-
setAttribute(name: string, newValue: unknown): void;
|
|
1376
|
-
/**
|
|
1377
|
-
* Runs set column attribute.
|
|
1378
|
-
* @param {string} name - Name.
|
|
1379
|
-
* @param {?} newValue - New value.
|
|
1380
|
-
*/
|
|
1381
|
-
_setColumnAttribute(name: string, newValue: unknown): void;
|
|
1382
|
-
/**
|
|
1383
|
-
* Clears loaded belongs-to caches when callers assign the foreign key directly.
|
|
1384
|
-
* @param {string} columnName - Changed database column name.
|
|
1385
|
-
* @param {?} normalizedValue - New normalized column value.
|
|
1386
|
-
* @returns {void} - No return value.
|
|
1387
|
-
*/
|
|
1388
|
-
_clearBelongsToRelationshipForChangedForeignKey(columnName: string, normalizedValue: unknown): void;
|
|
1389
|
-
/**
|
|
1390
|
-
* Runs belongs to relationships for foreign key.
|
|
1391
|
-
* @param {string} columnName - Changed database column name.
|
|
1392
|
-
* @returns {Array<?>} - Loaded relationship instances that use the changed foreign key.
|
|
1393
|
-
*/
|
|
1394
|
-
_belongsToRelationshipsForForeignKey(columnName: string): Array<unknown>;
|
|
1395
|
-
/**
|
|
1396
|
-
* Runs belongs to relationship uses foreign key.
|
|
1397
|
-
* @param {object} args - Relationship match arguments.
|
|
1398
|
-
* @param {string} args.columnName - Changed database column name.
|
|
1399
|
-
* @param {?} args.relationship - Relationship instance.
|
|
1400
|
-
* @returns {boolean} - Whether the relationship is a belongs-to using the changed foreign key.
|
|
1401
|
-
*/
|
|
1402
|
-
_belongsToRelationshipUsesForeignKey({ columnName, relationship }: {
|
|
1403
|
-
columnName: string;
|
|
1404
|
-
relationship: unknown;
|
|
1405
|
-
}): boolean;
|
|
1406
|
-
/**
|
|
1407
|
-
* Runs belongs to relationship matches foreign key value.
|
|
1408
|
-
* @param {object} args - Relationship cache arguments.
|
|
1409
|
-
* @param {?} args.normalizedValue - New normalized column value.
|
|
1410
|
-
* @param {?} args.relationship - Relationship instance.
|
|
1411
|
-
* @returns {boolean} - Whether the loaded related record still matches the changed foreign key.
|
|
1412
|
-
*/
|
|
1413
|
-
_belongsToRelationshipMatchesForeignKeyValue({ normalizedValue, relationship }: {
|
|
1414
|
-
normalizedValue: unknown;
|
|
1415
|
-
relationship: unknown;
|
|
1416
|
-
}): boolean;
|
|
1417
|
-
/**
|
|
1418
|
-
* Returns the foreign key value for a belongs-to relationship assignment.
|
|
1419
|
-
* @param {object} args - Relationship assignment arguments.
|
|
1420
|
-
* @param {VelociousDatabaseRecord | null | undefined} args.model - Assigned model.
|
|
1421
|
-
* @param {import("./instance-relationships/base.js").default} args.relationship - Belongs-to relationship instance.
|
|
1422
|
-
* @returns {string | number | null | undefined} - Foreign key value for the assignment.
|
|
1423
|
-
*/
|
|
1424
|
-
_belongsToForeignKeyValue({ model, relationship }: {
|
|
1425
|
-
model: VelociousDatabaseRecord | null | undefined;
|
|
1426
|
-
relationship: import("./instance-relationships/base.js").default;
|
|
1427
|
-
}): string | number | null | undefined;
|
|
1428
|
-
/**
|
|
1429
|
-
* Runs clear loaded belongs to relationship.
|
|
1430
|
-
* @param {?} relationship - Relationship instance.
|
|
1431
|
-
* @returns {void} - No return value.
|
|
1432
|
-
*/
|
|
1433
|
-
_clearLoadedBelongsToRelationship(relationship: unknown): void;
|
|
1434
|
-
/**
|
|
1435
|
-
* Runs normalize date value.
|
|
1436
|
-
* @param {?} value - Value to use.
|
|
1437
|
-
* @returns {?} - The date value.
|
|
1438
|
-
*/
|
|
1439
|
-
_normalizeDateValue(value: unknown): unknown;
|
|
1440
|
-
/**
|
|
1441
|
-
* Runs normalize sqlite boolean value.
|
|
1442
|
-
* @param {object} args - Options object.
|
|
1443
|
-
* @param {string | undefined} args.columnType - Column type.
|
|
1444
|
-
* @param {?} args.value - Value to normalize.
|
|
1445
|
-
* @returns {?} - Normalized value.
|
|
1446
|
-
*/
|
|
1447
|
-
_normalizeSqliteBooleanValue({ columnType, value }: {
|
|
1448
|
-
columnType: string | undefined;
|
|
1449
|
-
value: unknown;
|
|
1450
|
-
}): unknown;
|
|
1451
|
-
/**
|
|
1452
|
-
* Normalizes a boolean value before storing. A declared `"boolean"` attribute cast stores
|
|
1453
|
-
* booleans as 1/0 only for integer-backed columns (e.g. an MSSQL `bit`). Columns whose
|
|
1454
|
-
* underlying type is already a native boolean (e.g. Postgres `boolean`) keep `true`/`false`
|
|
1455
|
-
* so the driver can emit the proper boolean literal; otherwise the sqlite-only normalizer applies.
|
|
1456
|
-
* @param {object} args - Options object.
|
|
1457
|
-
* @param {string} args.attributeName - Attribute name being written.
|
|
1458
|
-
* @param {string | undefined} args.columnType - Column type.
|
|
1459
|
-
* @param {?} args.value - Value to normalize.
|
|
1460
|
-
* @returns {?} - Normalized value.
|
|
1461
|
-
*/
|
|
1462
|
-
_normalizeBooleanValueForWrite({ attributeName, columnType, value }: {
|
|
1463
|
-
attributeName: string;
|
|
1464
|
-
columnType: string | undefined;
|
|
1465
|
-
value: unknown;
|
|
1466
|
-
}): unknown;
|
|
1467
|
-
/**
|
|
1468
|
-
* Runs save.
|
|
1469
|
-
* @returns {Promise<void>} - Resolves when complete.
|
|
1470
|
-
*/
|
|
1471
|
-
save(): Promise<void>;
|
|
1472
|
-
_autoSaveBelongsToRelationships(): Promise<{
|
|
1473
|
-
savedCount: number;
|
|
1474
|
-
}>;
|
|
1475
|
-
_autoSaveHasManyAndHasOneRelationshipsToSave(): import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>[];
|
|
1476
|
-
/**
|
|
1477
|
-
* Resolves a relationship foreign-key column to this model's public attribute name.
|
|
1478
|
-
* @param {import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>} instanceRelationship - Relationship instance.
|
|
1479
|
-
* @returns {string} Attribute name accepted by setAttribute/assign.
|
|
1480
|
-
*/
|
|
1481
|
-
_relationshipForeignKeyAttribute(instanceRelationship: import("./instance-relationships/base.js").default<typeof VelociousDatabaseRecord, typeof VelociousDatabaseRecord>): string;
|
|
1482
|
-
/**
|
|
1483
|
-
* Runs auto save has many and has one relationships.
|
|
1484
|
-
* @param {object} args - Options object.
|
|
1485
|
-
* @param {boolean} args.isNewRecord - Whether is new record.
|
|
1486
|
-
*/
|
|
1487
|
-
_autoSaveHasManyAndHasOneRelationships({ isNewRecord }: {
|
|
1488
|
-
isNewRecord: boolean;
|
|
1489
|
-
}): Promise<void>;
|
|
1490
|
-
/**
|
|
1491
|
-
* Runs auto save attachments.
|
|
1492
|
-
* @returns {Promise<void>} - Resolves when pending attachments have been saved.
|
|
1493
|
-
*/
|
|
1494
|
-
_autoSaveAttachments(): Promise<void>;
|
|
1495
|
-
/**
|
|
1496
|
-
* Runs translations loaded.
|
|
1497
|
-
* @abstract
|
|
1498
|
-
* @returns {TranslationBase[]} - The translations loaded.
|
|
1499
|
-
*/
|
|
1500
|
-
translationsLoaded(): TranslationBase[];
|
|
1501
|
-
/**
|
|
1502
|
-
* Runs get translated attribute.
|
|
1503
|
-
* @param {string} name - Name.
|
|
1504
|
-
* @param {string} locale - Locale.
|
|
1505
|
-
* @returns {string | undefined} - The translated attribute, if found.
|
|
1506
|
-
*/
|
|
1507
|
-
_getTranslatedAttribute(name: string, locale: string): string | undefined;
|
|
1508
|
-
/**
|
|
1509
|
-
* Runs get translated attribute with fallback.
|
|
1510
|
-
* @param {string} name - Name.
|
|
1511
|
-
* @param {string} locale - Locale.
|
|
1512
|
-
* @returns {string | undefined} - The translated attribute with fallback, if found.
|
|
1513
|
-
*/
|
|
1514
|
-
_getTranslatedAttributeWithFallback(name: string, locale: string): string | undefined;
|
|
1515
|
-
/**
|
|
1516
|
-
* Runs set translated attribute.
|
|
1517
|
-
* @param {string} name - Name.
|
|
1518
|
-
* @param {string} locale - Locale.
|
|
1519
|
-
* @param {?} newValue - New value.
|
|
1520
|
-
* @returns {void} - No return value.
|
|
1521
|
-
*/
|
|
1522
|
-
_setTranslatedAttribute(name: string, locale: string, newValue: unknown): void;
|
|
1523
|
-
_isNewRecord: boolean;
|
|
1524
3412
|
/**
|
|
1525
3413
|
* Binds future query, lifecycle, relationship, and persistence work to an operation.
|
|
1526
3414
|
* @param {import("../operation.js").default} operation - Owning operation.
|
|
1527
3415
|
* @returns {this} - Bound record.
|
|
1528
3416
|
*/
|
|
1529
3417
|
bindDatabaseOperation(operation: import("../operation.js").default): this;
|
|
3418
|
+
/**
|
|
3419
|
+
* Releases this record from a completed eager-helper operation while
|
|
3420
|
+
* preserving the legacy ambient follow-up behavior of `usingTenant` finders.
|
|
3421
|
+
* @param {import("../operation.js").default} operation - Releasing operation.
|
|
3422
|
+
* @returns {this} - Record.
|
|
3423
|
+
*/
|
|
3424
|
+
releaseDatabaseOperation(operation: import("../operation.js").default): this;
|
|
1530
3425
|
/**
|
|
1531
3426
|
* Returns the explicit operation owning this record, if any.
|
|
1532
3427
|
* @returns {import("../operation.js").default | undefined} - Owning operation.
|
|
@@ -1546,6 +3441,14 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1546
3441
|
* @returns {ModelClassQuery<MC>} - Target query.
|
|
1547
3442
|
*/
|
|
1548
3443
|
queryForModel<MC extends typeof VelociousDatabaseRecord>(ModelClass: MC): ModelClassQuery<MC>;
|
|
3444
|
+
/**
|
|
3445
|
+
* Initializes a relationship/preload target without dropping this record's
|
|
3446
|
+
* explicit operation connection.
|
|
3447
|
+
* @param {typeof VelociousDatabaseRecord} ModelClass - Target model class.
|
|
3448
|
+
* @param {import("../../configuration.js").default} configuration - Owning configuration.
|
|
3449
|
+
* @returns {Promise<void>} - Resolves when initialized.
|
|
3450
|
+
*/
|
|
3451
|
+
ensureModelClassInitialized(ModelClass: typeof VelociousDatabaseRecord, configuration: import("../../configuration.js").default): Promise<void>;
|
|
1549
3452
|
/**
|
|
1550
3453
|
* Runs load existing record.
|
|
1551
3454
|
* @param {object} attributes - Attributes.
|
|
@@ -1554,20 +3457,20 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1554
3457
|
loadExistingRecord(attributes: object): void;
|
|
1555
3458
|
/**
|
|
1556
3459
|
* Assigns the given attributes to the record.
|
|
1557
|
-
* @param {Record<string,
|
|
3460
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} attributesToAssign - Attributes to assign.
|
|
1558
3461
|
* @returns {void} - No return value.
|
|
1559
3462
|
*/
|
|
1560
|
-
assign(attributesToAssign: Record<string,
|
|
3463
|
+
assign(attributesToAssign: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
1561
3464
|
/**
|
|
1562
3465
|
* Returns a the current attributes of the record (original attributes from database plus changes)
|
|
1563
|
-
* @returns {Record<string,
|
|
3466
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - The attributes.
|
|
1564
3467
|
*/
|
|
1565
|
-
attributes(): Record<string,
|
|
3468
|
+
attributes(): Record<string, ReturnType<typeof JSON.parse>>;
|
|
1566
3469
|
/**
|
|
1567
3470
|
* Returns column-name keyed data (original attributes from database plus changes)
|
|
1568
|
-
* @returns {Record<string,
|
|
3471
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - The raw attributes.
|
|
1569
3472
|
*/
|
|
1570
|
-
rawAttributes(): Record<string,
|
|
3473
|
+
rawAttributes(): Record<string, ReturnType<typeof JSON.parse>>;
|
|
1571
3474
|
/**
|
|
1572
3475
|
* Runs connection.
|
|
1573
3476
|
* @returns {import("../drivers/base.js").default} - The connection.
|
|
@@ -1606,9 +3509,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1606
3509
|
* @param {typeof VelociousDatabaseRecord} TargetModelClass - Related model class.
|
|
1607
3510
|
* @param {string} identifier - Tenant database identifier.
|
|
1608
3511
|
* @param {TenantDatabaseProviderType} provider - Tenant database provider.
|
|
1609
|
-
* @returns {Promise<Array
|
|
3512
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Listed tenant objects.
|
|
1610
3513
|
*/
|
|
1611
|
-
_dependentRestrictProviderTenants(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<Array<
|
|
3514
|
+
_dependentRestrictProviderTenants(instanceRelationship: RestrictInstanceRelationship, TargetModelClass: typeof VelociousDatabaseRecord, identifier: string, provider: TenantDatabaseProviderType): Promise<Array<ReturnType<typeof JSON.parse>>>;
|
|
1612
3515
|
/**
|
|
1613
3516
|
* Destroys the record in the database and all of its dependent records.
|
|
1614
3517
|
* @returns {Promise<void>} - Resolves when complete.
|
|
@@ -1674,9 +3577,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1674
3577
|
isChanged(): boolean;
|
|
1675
3578
|
/**
|
|
1676
3579
|
* Returns the changes that have been made to this record since it was loaded from the database.
|
|
1677
|
-
* @returns {Record<string, Array
|
|
3580
|
+
* @returns {Record<string, Array<ReturnType<typeof JSON.parse>>>} - The changes.
|
|
1678
3581
|
*/
|
|
1679
|
-
changes(): Record<string, Array<
|
|
3582
|
+
changes(): Record<string, Array<ReturnType<typeof JSON.parse>>>;
|
|
1680
3583
|
/**
|
|
1681
3584
|
* Runs table name.
|
|
1682
3585
|
* @returns {string} - The table name.
|
|
@@ -1723,25 +3626,25 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1723
3626
|
* registered fn for this record (e.g. no child rows matched the
|
|
1724
3627
|
* aggregate).
|
|
1725
3628
|
* @param {string} name - queryData attribute name (matches a SELECT alias from the registered fn).
|
|
1726
|
-
* @returns {
|
|
3629
|
+
* @returns {ReturnType<typeof JSON.parse>} - Attached query-data value.
|
|
1727
3630
|
*/
|
|
1728
|
-
queryData(name: string):
|
|
3631
|
+
queryData(name: string): ReturnType<typeof JSON.parse>;
|
|
1729
3632
|
/**
|
|
1730
3633
|
* Attach a queryData value to this record. Internal helper used by
|
|
1731
3634
|
* the `queryData` runner and by frontend-model hydration; outside
|
|
1732
3635
|
* code should not call this directly.
|
|
1733
3636
|
* @param {string} name - queryData attribute name.
|
|
1734
|
-
* @param {
|
|
3637
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value to attach.
|
|
1735
3638
|
* @returns {void}
|
|
1736
3639
|
*/
|
|
1737
|
-
_setQueryData(name: string, value:
|
|
3640
|
+
_setQueryData(name: string, value: ReturnType<typeof JSON.parse>): void;
|
|
1738
3641
|
/**
|
|
1739
3642
|
* All attached queryData values as a plain object. Used by the
|
|
1740
3643
|
* frontend-model serializer to ship queryData alongside the record
|
|
1741
3644
|
* attributes on the wire.
|
|
1742
|
-
* @returns {Record<string,
|
|
3645
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Query-data values keyed by name.
|
|
1743
3646
|
*/
|
|
1744
|
-
queryDataValues(): Record<string,
|
|
3647
|
+
queryDataValues(): Record<string, ReturnType<typeof JSON.parse>>;
|
|
1745
3648
|
/**
|
|
1746
3649
|
* Read a per-record ability result attached by `.abilities(...)`. The
|
|
1747
3650
|
* backend evaluates each requested action against the current ability
|
|
@@ -1773,9 +3676,9 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1773
3676
|
/**
|
|
1774
3677
|
* Reads a column value from the record.
|
|
1775
3678
|
* @param {string} attributeName The name of the column to read. This is the column name, not the attribute name.
|
|
1776
|
-
* @returns {
|
|
3679
|
+
* @returns {ReturnType<typeof JSON.parse>} - The column.
|
|
1777
3680
|
*/
|
|
1778
|
-
readColumn(attributeName: string):
|
|
3681
|
+
readColumn(attributeName: string): ReturnType<typeof JSON.parse>;
|
|
1779
3682
|
/**
|
|
1780
3683
|
* Resolves any declared per-attribute cast for a database column name.
|
|
1781
3684
|
* @param {string} columnName - Database column name.
|
|
@@ -1785,10 +3688,10 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1785
3688
|
/**
|
|
1786
3689
|
* Converts a stored value to a real boolean for a declared `"boolean"` cast.
|
|
1787
3690
|
* Leaves null/undefined untouched; treats 1/true/"1" as true and 0/false/"0" as false.
|
|
1788
|
-
* @param {
|
|
1789
|
-
* @returns {
|
|
3691
|
+
* @param {ReturnType<typeof JSON.parse>} value - Stored database value.
|
|
3692
|
+
* @returns {ReturnType<typeof JSON.parse>} - Converted boolean, or the original value when not recognized.
|
|
1790
3693
|
*/
|
|
1791
|
-
_castDeclaredBooleanForRead(value:
|
|
3694
|
+
_castDeclaredBooleanForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
1792
3695
|
/**
|
|
1793
3696
|
* Whether a column value is currently loaded on this record (either as a
|
|
1794
3697
|
* persisted attribute or a pending change). Used to decide whether a preload
|
|
@@ -1804,20 +3707,20 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1804
3707
|
* @param {object} args - Options object.
|
|
1805
3708
|
* @param {string} args.columnName - Database column name being read.
|
|
1806
3709
|
* @param {string | undefined} args.columnType - Column type.
|
|
1807
|
-
* @param {
|
|
1808
|
-
* @returns {
|
|
3710
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Value to normalize.
|
|
3711
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1809
3712
|
*/
|
|
1810
3713
|
_normalizeBooleanValueForRead({ columnName, columnType, value }: {
|
|
1811
3714
|
columnName: string;
|
|
1812
3715
|
columnType: string | undefined;
|
|
1813
|
-
value:
|
|
1814
|
-
}):
|
|
3716
|
+
value: ReturnType<typeof JSON.parse>;
|
|
3717
|
+
}): ReturnType<typeof JSON.parse>;
|
|
1815
3718
|
/**
|
|
1816
3719
|
* Runs normalize date value for read.
|
|
1817
|
-
* @param {
|
|
1818
|
-
* @returns {
|
|
3720
|
+
* @param {ReturnType<typeof JSON.parse>} value - Value from database.
|
|
3721
|
+
* @returns {ReturnType<typeof JSON.parse>} - Normalized value.
|
|
1819
3722
|
*/
|
|
1820
|
-
_normalizeDateValueForRead(value:
|
|
3723
|
+
_normalizeDateValueForRead(value: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
1821
3724
|
_belongsToChanges(): Record<string, any>;
|
|
1822
3725
|
/**
|
|
1823
3726
|
* Runs create new record.
|
|
@@ -1842,16 +3745,16 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1842
3745
|
}): Promise<void>;
|
|
1843
3746
|
/**
|
|
1844
3747
|
* Sets timestamp defaults for a new record insert.
|
|
1845
|
-
* @param {Record<string,
|
|
3748
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
|
|
1846
3749
|
* @returns {void} - No return value.
|
|
1847
3750
|
*/
|
|
1848
|
-
_setDefaultTimestampValues(data: Record<string,
|
|
3751
|
+
_setDefaultTimestampValues(data: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
1849
3752
|
/**
|
|
1850
3753
|
* Runs normalize date values for write.
|
|
1851
|
-
* @param {Record<string,
|
|
3754
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} data - Column-keyed data.
|
|
1852
3755
|
* @returns {void} - No return value.
|
|
1853
3756
|
*/
|
|
1854
|
-
_normalizeDateValuesForWrite(data: Record<string,
|
|
3757
|
+
_normalizeDateValuesForWrite(data: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
1855
3758
|
/**
|
|
1856
3759
|
* Runs update record with changes.
|
|
1857
3760
|
* @returns {Promise<void>} - Resolves when complete.
|
|
@@ -1902,7 +3805,6 @@ declare class VelociousDatabaseRecord<WriteAttributes extends Record<string, unk
|
|
|
1902
3805
|
*/
|
|
1903
3806
|
update(attributesToAssign: WriteAttributes): Promise<void>;
|
|
1904
3807
|
}
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
export { AdvisoryLockBusyError, AdvisoryLockHoldTimeoutError, AdvisoryLockTimeoutError };
|
|
3808
|
+
export { AdvisoryLockBusyError, AdvisoryLockHoldTimeoutError, AdvisoryLockTimeoutError, TenantDatabaseScopeError, ValidationError };
|
|
3809
|
+
export default VelociousDatabaseRecord;
|
|
1908
3810
|
//# sourceMappingURL=index.d.ts.map
|