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,5 +1,163 @@
|
|
|
1
|
+
import FrontendModelQuery from "./query.js";
|
|
2
|
+
export type FrontendModelRelationship = FrontendModelHasManyRelationship<any, any, any> | FrontendModelSingularRelationship<any, any, any>;
|
|
3
|
+
export type FrontendModelModelEventCallbackEntry = {
|
|
4
|
+
callback: (payload: {
|
|
5
|
+
id: string;
|
|
6
|
+
model: FrontendModelBase;
|
|
7
|
+
}) => void;
|
|
8
|
+
eventFilterKey: string | null;
|
|
9
|
+
eventFilterPayload: import("./query.js").FrontendModelEventFilterPayload | null;
|
|
10
|
+
projectionPayload: import("./query.js").FrontendModelProjectionPayload;
|
|
11
|
+
};
|
|
12
|
+
export type FrontendModelDestroyEventCallbackEntry = {
|
|
13
|
+
callback: (payload: {
|
|
14
|
+
id: string;
|
|
15
|
+
}) => void;
|
|
16
|
+
};
|
|
17
|
+
export type FrontendModelCommandType = "create" | "find" | "index" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url";
|
|
18
|
+
export type FrontendModelRequestCommandType = FrontendModelCommandType | string;
|
|
19
|
+
export type FrontendModelTransportModelValue = {
|
|
20
|
+
attributes: () => Record<string, unknown>;
|
|
21
|
+
};
|
|
22
|
+
export type FrontendModelTransportScalarValue = undefined | null | boolean | number | string | bigint | Date | FrontendModelTransportModelValue;
|
|
23
|
+
export type FrontendModelTransportObject = Record<string, unknown>;
|
|
24
|
+
export type FrontendModelTransportValue = FrontendModelTransportScalarValue | FrontendModelTransportObject | Array<unknown>;
|
|
25
|
+
export type FrontendModelAttributeValue = FrontendModelTransportValue;
|
|
26
|
+
export type FrontendModelAttachmentDefinition = {
|
|
27
|
+
type: "hasOne" | "hasMany";
|
|
28
|
+
};
|
|
29
|
+
export type FrontendModelAttributeDefinition = {
|
|
30
|
+
columnType?: string;
|
|
31
|
+
dataType?: string;
|
|
32
|
+
jsDocType?: string;
|
|
33
|
+
name?: string;
|
|
34
|
+
null?: boolean;
|
|
35
|
+
selectedByDefault?: boolean;
|
|
36
|
+
sqlType?: string;
|
|
37
|
+
type?: string;
|
|
38
|
+
};
|
|
39
|
+
export type FrontendModelAttachmentInput = Record<string, ReturnType<typeof JSON.parse>> | {
|
|
40
|
+
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
41
|
+
type?: string;
|
|
42
|
+
name?: string;
|
|
43
|
+
} | null | undefined;
|
|
44
|
+
export type FrontendModelSyncMetadata = Record<string, FrontendModelTransportValue>;
|
|
45
|
+
export type FrontendModelSyncConflictStrategy = "optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly";
|
|
46
|
+
export type FrontendModelSyncConfig = {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
operations: string[];
|
|
49
|
+
policyHash: string;
|
|
50
|
+
policyVersion: string | null;
|
|
51
|
+
conflictStrategy?: FrontendModelSyncConflictStrategy;
|
|
52
|
+
metadata?: FrontendModelSyncMetadata;
|
|
53
|
+
};
|
|
54
|
+
export type FrontendModelResourceConfig = {
|
|
55
|
+
attributes?: Array<string | FrontendModelAttributeDefinition> | Record<string, FrontendModelAttributeDefinition>;
|
|
56
|
+
builtInCollectionCommands?: string[];
|
|
57
|
+
builtInMemberCommands?: string[];
|
|
58
|
+
collectionCommands?: string[];
|
|
59
|
+
commands?: string[];
|
|
60
|
+
memberCommands?: string[];
|
|
61
|
+
attachments?: Record<string, FrontendModelAttachmentDefinition>;
|
|
62
|
+
modelName?: string;
|
|
63
|
+
nestedAttributes?: Record<string, {
|
|
64
|
+
allowDestroy?: boolean;
|
|
65
|
+
limit?: number;
|
|
66
|
+
}>;
|
|
67
|
+
primaryKey?: string;
|
|
68
|
+
relationships?: string[];
|
|
69
|
+
sync?: FrontendModelSyncConfig;
|
|
70
|
+
};
|
|
71
|
+
export type FrontendModelConstructor<T extends FrontendModelBase = FrontendModelBase> = {
|
|
72
|
+
new (attributes?: Record<string, FrontendModelAttributeValue>): T;
|
|
73
|
+
};
|
|
74
|
+
export type FrontendModelClass<T extends FrontendModelBase = FrontendModelBase<any, any, any>, Attributes extends object = any, CreateAttributes extends object = any> = {
|
|
75
|
+
new (): T;
|
|
76
|
+
create(attributes?: CreateAttributes): Promise<T>;
|
|
77
|
+
} & Omit<typeof FrontendModelBase, "create" | "prototype">;
|
|
78
|
+
export type FrontendModelCreateAttributesFor<T extends FrontendModelBase> = T extends FrontendModelBase<Record<string, FrontendModelAttributeValue>, infer CreateAttributes, infer _UpdateAttributes> ? CreateAttributes : Record<string, FrontendModelAttributeValue>;
|
|
79
|
+
export type FrontendModelRelationshipModel<T extends FrontendModelBase<any, any, any> | typeof FrontendModelBase> = T extends typeof FrontendModelBase ? InstanceType<T> : T;
|
|
80
|
+
export type FrontendModelTransportConfig = {
|
|
81
|
+
/**
|
|
82
|
+
* - Optional frontend-model URL. This should be the shared endpoint (for example `"/frontend-models"` or `"https://example.com/frontend-models"`).
|
|
83
|
+
*/
|
|
84
|
+
url?: string | (() => string | undefined | null);
|
|
85
|
+
/**
|
|
86
|
+
* - Deprecated shared-endpoint flag retained for compatibility. Frontend-model CRUD/custom commands use the shared frontend-model API envelope by default.
|
|
87
|
+
*/
|
|
88
|
+
shared?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* - Optional websocket URL. When set, Velocious creates and manages its own websocket client internally. Subscriptions use the websocket; CRUD uses HTTP and falls back gracefully. Example: `"ws://localhost:3006/websocket"`.
|
|
91
|
+
*/
|
|
92
|
+
websocketUrl?: string | (() => string | undefined | null);
|
|
93
|
+
/**
|
|
94
|
+
* - Optional websocket client for shared frontend-model API requests and subscriptions. Its `post` receives the bounded-deadline `signal` and should forward it into the underlying transport so the deadline can abort the live request and its response-body read.
|
|
95
|
+
*/
|
|
96
|
+
websocketClient?: {
|
|
97
|
+
post: (path: string, body?: ReturnType<typeof JSON.parse>, options?: {
|
|
98
|
+
headers?: Record<string, string>;
|
|
99
|
+
signal?: AbortSignal;
|
|
100
|
+
}) => Promise<{
|
|
101
|
+
json: () => ReturnType<typeof JSON.parse>;
|
|
102
|
+
}>;
|
|
103
|
+
subscribe: (channel: string, options: {
|
|
104
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
105
|
+
}, callback: (payload: ReturnType<typeof JSON.parse>) => void) => (() => void);
|
|
106
|
+
subscribeAndWait?: (channel: string, options: {
|
|
107
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
108
|
+
}, callback: (payload: ReturnType<typeof JSON.parse>) => void) => Promise<(() => void)>;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* - Extra HTTP/WS headers to attach to every frontend-model API request. Pass a function to compute them at request time (for example to include the current locale).
|
|
112
|
+
*/
|
|
113
|
+
requestHeaders?: Record<string, string> | (() => Record<string, string>);
|
|
114
|
+
/**
|
|
115
|
+
* - Bounded deadline in milliseconds covering connection, response headers, and response-body consumption for each frontend-model API request. On expiry the live fetch/adapter request is aborted (built on awaitery's `timeout`) and awaitery's `TimeoutError` is thrown, so callers can classify a timeout via `error instanceof TimeoutError`. Pass a function to resolve it per request. Falsy/absent means no deadline.
|
|
116
|
+
*/
|
|
117
|
+
timeout?: number | (() => number | undefined | null);
|
|
118
|
+
/**
|
|
119
|
+
* - Optional caller/session AbortSignal composed with the deadline. Aborting it cancels the live request (for example on session shutdown or offline transition); the resulting abort error stays distinguishable from a timeout. Pass a function to resolve the current signal per request.
|
|
120
|
+
*/
|
|
121
|
+
signal?: AbortSignal | (() => AbortSignal | undefined | null);
|
|
122
|
+
/**
|
|
123
|
+
* - Optional sessionId persistence hook forwarded to the internal `VelociousWebsocketClient` so WS sessions can be resumed across page reloads / app restarts.
|
|
124
|
+
*/
|
|
125
|
+
sessionStore?: {
|
|
126
|
+
get: () => string | null | undefined | Promise<string | null | undefined>;
|
|
127
|
+
set: (sessionId: string) => void | Promise<void>;
|
|
128
|
+
clear: () => void | Promise<void>;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* - IANA timezone sent with every frontend-model API request for timezone-less datetime parsing.
|
|
132
|
+
*/
|
|
133
|
+
timeZone?: string | (() => string | null | undefined);
|
|
134
|
+
/**
|
|
135
|
+
* - Offline mutation queue configuration.
|
|
136
|
+
*/
|
|
137
|
+
offlineSync?: {
|
|
138
|
+
actorDeviceId: string;
|
|
139
|
+
actorUserId: string;
|
|
140
|
+
clientMutationId?: () => string;
|
|
141
|
+
enabled?: boolean;
|
|
142
|
+
mutationLog: import("../sync/local-mutation-log.js").default;
|
|
143
|
+
now?: () => Date;
|
|
144
|
+
offlineGrant: {
|
|
145
|
+
id: string;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export type FrontendModelIdleWaitArgs = {
|
|
150
|
+
/**
|
|
151
|
+
* - Milliseconds the transport must stay idle before resolving.
|
|
152
|
+
*/
|
|
153
|
+
quietMs?: number;
|
|
154
|
+
/**
|
|
155
|
+
* - Timeout in milliseconds.
|
|
156
|
+
*/
|
|
157
|
+
timeout?: number;
|
|
158
|
+
};
|
|
1
159
|
/** Error raised when reading an attribute that was not selected in query payloads. */
|
|
2
|
-
export class AttributeNotSelectedError extends Error {
|
|
160
|
+
export declare class AttributeNotSelectedError extends Error {
|
|
3
161
|
/**
|
|
4
162
|
* Runs constructor.
|
|
5
163
|
* @param {string} modelName - Model class name.
|
|
@@ -13,7 +171,13 @@ export class AttributeNotSelectedError extends Error {
|
|
|
13
171
|
* @template {FrontendModelBase<any, any, any> | typeof FrontendModelBase} T
|
|
14
172
|
* @template {object} [TargetCreateAttributes=Record<string, FrontendModelAttributeValue>]
|
|
15
173
|
*/
|
|
16
|
-
export class FrontendModelSingularRelationship<S extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, T extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, TargetCreateAttributes extends object = Record<string,
|
|
174
|
+
export declare class FrontendModelSingularRelationship<S extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, T extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, TargetCreateAttributes extends object = Record<string, FrontendModelAttributeValue>> {
|
|
175
|
+
model: FrontendModelBase<any, any, any>;
|
|
176
|
+
relationshipName: string;
|
|
177
|
+
targetModelClass: FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelTransportValue>, TargetCreateAttributes> | null;
|
|
178
|
+
_preloaded: boolean;
|
|
179
|
+
/** @type {FrontendModelRelationshipModel<T> | null} */
|
|
180
|
+
_loadedValue: FrontendModelRelationshipModel<T> | null;
|
|
17
181
|
/**
|
|
18
182
|
* Runs constructor.
|
|
19
183
|
* @param {FrontendModelBase} model - Parent model.
|
|
@@ -21,12 +185,6 @@ export class FrontendModelSingularRelationship<S extends FrontendModelBase<any,
|
|
|
21
185
|
* @param {FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelAttributeValue>, TargetCreateAttributes> | null} targetModelClass - Target model class.
|
|
22
186
|
*/
|
|
23
187
|
constructor(model: FrontendModelBase, relationshipName: string, targetModelClass: FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelAttributeValue>, TargetCreateAttributes> | null);
|
|
24
|
-
model: FrontendModelBase<any, any, any>;
|
|
25
|
-
relationshipName: string;
|
|
26
|
-
targetModelClass: FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelTransportValue>, TargetCreateAttributes> | null;
|
|
27
|
-
_preloaded: boolean;
|
|
28
|
-
/** @type {FrontendModelRelationshipModel<T> | null} */
|
|
29
|
-
_loadedValue: FrontendModelRelationshipModel<T> | null;
|
|
30
188
|
/**
|
|
31
189
|
* Runs set loaded.
|
|
32
190
|
* @param {FrontendModelRelationshipModel<T> | null | undefined} loadedValue - Loaded relationship value.
|
|
@@ -72,7 +230,15 @@ export class FrontendModelSingularRelationship<S extends FrontendModelBase<any,
|
|
|
72
230
|
* @template {FrontendModelBase<any, any, any> | typeof FrontendModelBase} T
|
|
73
231
|
* @template {object} [TargetCreateAttributes=Record<string, FrontendModelAttributeValue>]
|
|
74
232
|
*/
|
|
75
|
-
export class FrontendModelHasManyRelationship<S extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, T extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, TargetCreateAttributes extends object = Record<string,
|
|
233
|
+
export declare class FrontendModelHasManyRelationship<S extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, T extends FrontendModelBase<any, any, any> | typeof FrontendModelBase, TargetCreateAttributes extends object = Record<string, FrontendModelAttributeValue>> {
|
|
234
|
+
model: FrontendModelBase<any, any, any>;
|
|
235
|
+
relationshipName: string;
|
|
236
|
+
targetModelClass: FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelTransportValue>, TargetCreateAttributes> | null;
|
|
237
|
+
_preloaded: boolean;
|
|
238
|
+
/**
|
|
239
|
+
* Narrows the runtime value to the documented type.
|
|
240
|
+
* @type {Array<FrontendModelRelationshipModel<T>>} */
|
|
241
|
+
_loadedValue: Array<FrontendModelRelationshipModel<T>>;
|
|
76
242
|
/**
|
|
77
243
|
* Runs constructor.
|
|
78
244
|
* @param {FrontendModelBase} model - Parent model.
|
|
@@ -80,14 +246,6 @@ export class FrontendModelHasManyRelationship<S extends FrontendModelBase<any, a
|
|
|
80
246
|
* @param {FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelAttributeValue>, TargetCreateAttributes> | null} targetModelClass - Target model class.
|
|
81
247
|
*/
|
|
82
248
|
constructor(model: FrontendModelBase, relationshipName: string, targetModelClass: FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelAttributeValue>, TargetCreateAttributes> | null);
|
|
83
|
-
/**
|
|
84
|
-
* Narrows the runtime value to the documented type.
|
|
85
|
-
* @type {Array<FrontendModelRelationshipModel<T>>} */
|
|
86
|
-
_loadedValue: Array<FrontendModelRelationshipModel<T>>;
|
|
87
|
-
model: FrontendModelBase<any, any, any>;
|
|
88
|
-
relationshipName: string;
|
|
89
|
-
targetModelClass: FrontendModelClass<FrontendModelRelationshipModel<T>, Record<string, FrontendModelTransportValue>, TargetCreateAttributes> | null;
|
|
90
|
-
_preloaded: boolean;
|
|
91
249
|
/**
|
|
92
250
|
* Runs set loaded.
|
|
93
251
|
* @param {Array<FrontendModelRelationshipModel<T>>} loadedValue - Loaded relationship value.
|
|
@@ -140,7 +298,13 @@ export class FrontendModelHasManyRelationship<S extends FrontendModelBase<any, a
|
|
|
140
298
|
/**
|
|
141
299
|
* Downloaded frontend-model attachment payload wrapper.
|
|
142
300
|
*/
|
|
143
|
-
export class FrontendModelAttachmentDownload {
|
|
301
|
+
export declare class FrontendModelAttachmentDownload {
|
|
302
|
+
idValue: string;
|
|
303
|
+
filenameValue: string;
|
|
304
|
+
contentTypeValue: string | null;
|
|
305
|
+
byteSizeValue: number;
|
|
306
|
+
contentValue: Uint8Array<ArrayBufferLike>;
|
|
307
|
+
urlValue: string | null;
|
|
144
308
|
/**
|
|
145
309
|
* Runs constructor.
|
|
146
310
|
* @param {object} args - Options.
|
|
@@ -157,14 +321,8 @@ export class FrontendModelAttachmentDownload {
|
|
|
157
321
|
contentType: string | null;
|
|
158
322
|
byteSize: number;
|
|
159
323
|
content: Uint8Array;
|
|
160
|
-
url?: string | null
|
|
324
|
+
url?: string | null;
|
|
161
325
|
});
|
|
162
|
-
idValue: string;
|
|
163
|
-
filenameValue: string;
|
|
164
|
-
contentTypeValue: string | null;
|
|
165
|
-
byteSizeValue: number;
|
|
166
|
-
contentValue: Uint8Array<ArrayBufferLike>;
|
|
167
|
-
urlValue: string | null;
|
|
168
326
|
/**
|
|
169
327
|
* Runs byte size.
|
|
170
328
|
* @returns {number} - File size in bytes.
|
|
@@ -199,7 +357,14 @@ export class FrontendModelAttachmentDownload {
|
|
|
199
357
|
/**
|
|
200
358
|
* Frontend-model attachment helper for one attachment name.
|
|
201
359
|
*/
|
|
202
|
-
export class FrontendModelAttachmentHandle {
|
|
360
|
+
export declare class FrontendModelAttachmentHandle {
|
|
361
|
+
model: FrontendModelBase<any, any, any>;
|
|
362
|
+
attachmentName: string;
|
|
363
|
+
/**
|
|
364
|
+
* Pending attachment inputs queued for the next model save.
|
|
365
|
+
* @type {FrontendModelAttachmentInput[]}
|
|
366
|
+
*/
|
|
367
|
+
pendingInputs: FrontendModelAttachmentInput[];
|
|
203
368
|
/**
|
|
204
369
|
* Runs constructor.
|
|
205
370
|
* @param {object} args - Options.
|
|
@@ -210,13 +375,6 @@ export class FrontendModelAttachmentHandle {
|
|
|
210
375
|
model: FrontendModelBase;
|
|
211
376
|
attachmentName: string;
|
|
212
377
|
});
|
|
213
|
-
/**
|
|
214
|
-
* Pending attachment inputs queued for the next model save.
|
|
215
|
-
* @type {FrontendModelAttachmentInput[]}
|
|
216
|
-
*/
|
|
217
|
-
pendingInputs: FrontendModelAttachmentInput[];
|
|
218
|
-
model: FrontendModelBase<any, any, any>;
|
|
219
|
-
attachmentName: string;
|
|
220
378
|
/**
|
|
221
379
|
* Queue attachment input for the parent model's next save.
|
|
222
380
|
* @param {FrontendModelAttachmentInput | FrontendModelAttachmentInput[]} input - Attachment input.
|
|
@@ -230,17 +388,17 @@ export class FrontendModelAttachmentHandle {
|
|
|
230
388
|
hasPendingAttachments(): boolean;
|
|
231
389
|
/**
|
|
232
390
|
* Builds the save payload for queued attachment inputs.
|
|
233
|
-
* @returns {Promise<Record<string,
|
|
391
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>> | Record<string, ReturnType<typeof JSON.parse>>[] | undefined>} Normalized attachment payload.
|
|
234
392
|
*/
|
|
235
|
-
pendingAttachmentsPayload(): Promise<Record<string,
|
|
393
|
+
pendingAttachmentsPayload(): Promise<Record<string, ReturnType<typeof JSON.parse>> | Record<string, ReturnType<typeof JSON.parse>>[] | undefined>;
|
|
236
394
|
/** Clears queued attachment inputs after a successful model save. */
|
|
237
395
|
clearPendingAttachments(): void;
|
|
238
396
|
/**
|
|
239
397
|
* Runs attach.
|
|
240
|
-
* @param {
|
|
398
|
+
* @param {ReturnType<typeof JSON.parse>} input - Attachment input.
|
|
241
399
|
* @returns {Promise<void>} - Resolves when attached.
|
|
242
400
|
*/
|
|
243
|
-
attach(input:
|
|
401
|
+
attach(input: ReturnType<typeof JSON.parse>): Promise<void>;
|
|
244
402
|
/**
|
|
245
403
|
* Runs download.
|
|
246
404
|
* @param {string} [attachmentId] - Optional attachment id for has-many attachments.
|
|
@@ -301,6 +459,7 @@ export class FrontendModelAttachmentHandle {
|
|
|
301
459
|
* @template {object} [UpdateAttributes=any]
|
|
302
460
|
*/
|
|
303
461
|
export default class FrontendModelBase<Attributes extends object = any, CreateAttributes extends object = any, UpdateAttributes extends object = any> {
|
|
462
|
+
static _generatedAttachmentMethods: boolean | undefined;
|
|
304
463
|
/**
|
|
305
464
|
* Narrows the runtime value to the documented type.
|
|
306
465
|
* @type {string | undefined} */
|
|
@@ -321,12 +480,55 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
321
480
|
* @returns {void}
|
|
322
481
|
*/
|
|
323
482
|
static setAutoload(newValue: boolean): void;
|
|
483
|
+
/**
|
|
484
|
+
* Narrows the runtime value to the documented type.
|
|
485
|
+
* @type {Record<string, FrontendModelAttributeValue>} */
|
|
486
|
+
_attributes: Record<string, FrontendModelAttributeValue>;
|
|
487
|
+
/**
|
|
488
|
+
* Narrows the runtime value to the documented type.
|
|
489
|
+
* @type {Record<string, FrontendModelHasManyRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>> | FrontendModelSingularRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>>>} */
|
|
490
|
+
_relationships: Record<string, FrontendModelHasManyRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>> | FrontendModelSingularRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>>>;
|
|
491
|
+
/**
|
|
492
|
+
* Narrows the runtime value to the documented type.
|
|
493
|
+
* @type {Record<string, FrontendModelAttachmentHandle>} */
|
|
494
|
+
_attachments: Record<string, FrontendModelAttachmentHandle>;
|
|
495
|
+
/**
|
|
496
|
+
* Rails-style nested attribute payloads queued for the next save.
|
|
497
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>}
|
|
498
|
+
*/
|
|
499
|
+
_pendingNestedAttributes: Record<string, ReturnType<typeof JSON.parse>>;
|
|
500
|
+
/**
|
|
501
|
+
* Narrows the runtime value to the documented type.
|
|
502
|
+
* @type {Set<string> | null} */
|
|
503
|
+
_selectedAttributes: Set<string> | null;
|
|
504
|
+
/**
|
|
505
|
+
* Narrows the runtime value to the documented type.
|
|
506
|
+
* @type {boolean} */
|
|
507
|
+
_isNewRecord: boolean;
|
|
508
|
+
/**
|
|
509
|
+
* Narrows the runtime value to the documented type.
|
|
510
|
+
* @type {boolean} */
|
|
511
|
+
_markedForDestruction: boolean;
|
|
512
|
+
/**
|
|
513
|
+
* Narrows the runtime value to the documented type.
|
|
514
|
+
* @type {Record<string, FrontendModelAttributeValue>} */
|
|
515
|
+
_persistedAttributes: Record<string, FrontendModelAttributeValue>;
|
|
516
|
+
/**
|
|
517
|
+
* Narrows the runtime value to the documented type.
|
|
518
|
+
* @type {Array<FrontendModelBase> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-batch-preload.
|
|
519
|
+
*/
|
|
520
|
+
_loadCohort: Array<FrontendModelBase> | undefined;
|
|
521
|
+
/**
|
|
522
|
+
* Runs constructor.
|
|
523
|
+
* @param {Attributes | CreateAttributes} [attributes] - Initial attributes.
|
|
524
|
+
*/
|
|
525
|
+
constructor(attributes?: Attributes | CreateAttributes);
|
|
324
526
|
/**
|
|
325
527
|
* Runs ensure generated attachment methods.
|
|
326
528
|
* @this {FrontendModelClass}
|
|
327
529
|
* @returns {void} - Ensures attachment helper methods exist on the prototype.
|
|
328
530
|
*/
|
|
329
|
-
static ensureGeneratedAttachmentMethods(this: FrontendModelClass
|
|
531
|
+
static ensureGeneratedAttachmentMethods(this: FrontendModelClass): void;
|
|
330
532
|
/**
|
|
331
533
|
* Runs resource config.
|
|
332
534
|
* @returns {FrontendModelResourceConfig} - Resource configuration.
|
|
@@ -337,7 +539,7 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
337
539
|
* @this {FrontendModelClass}
|
|
338
540
|
* @returns {Record<string, FrontendModelClass | string>} - Relationship model classes (or class name strings) keyed by relationship name.
|
|
339
541
|
*/
|
|
340
|
-
static relationshipModelClasses(this: FrontendModelClass
|
|
542
|
+
static relationshipModelClasses(this: FrontendModelClass): Record<string, FrontendModelClass | string>;
|
|
341
543
|
/**
|
|
342
544
|
* Register a frontend model class so it can be resolved by name in relationship lookups.
|
|
343
545
|
* @param {FrontendModelClass} modelClass - Model class to register.
|
|
@@ -346,11 +548,11 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
346
548
|
static registerModel(modelClass: FrontendModelClass): void;
|
|
347
549
|
/**
|
|
348
550
|
* Runs define scope.
|
|
349
|
-
* @param {(...args: Array
|
|
350
|
-
* @returns {((...args: Array
|
|
551
|
+
* @param {(...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>} callback - Scope callback.
|
|
552
|
+
* @returns {((...args: Array<ReturnType<typeof JSON.parse>>) => import("./query.js").default<FrontendModelClass>) & {scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
|
|
351
553
|
*/
|
|
352
|
-
static defineScope(callback: (...args: Array<
|
|
353
|
-
scope: (...args: Array<
|
|
554
|
+
static defineScope(callback: (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>): ((...args: Array<ReturnType<typeof JSON.parse>>) => import("./query.js").default<FrontendModelClass>) & {
|
|
555
|
+
scope: (...args: Array<ReturnType<typeof JSON.parse>>) => import("../utils/model-scope.js").ModelScopeDescriptor;
|
|
354
556
|
};
|
|
355
557
|
/**
|
|
356
558
|
* Resolve a relationship model class value that may be a class reference or a string name.
|
|
@@ -363,7 +565,7 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
363
565
|
* @this {FrontendModelClass}
|
|
364
566
|
* @returns {Record<string, {type: "belongsTo" | "hasOne" | "hasMany", autoload?: boolean}>} - Relationship definitions keyed by relationship name.
|
|
365
567
|
*/
|
|
366
|
-
static relationshipDefinitions(this: FrontendModelClass
|
|
568
|
+
static relationshipDefinitions(this: FrontendModelClass): Record<string, {
|
|
367
569
|
type: "belongsTo" | "hasOne" | "hasMany";
|
|
368
570
|
autoload?: boolean;
|
|
369
571
|
}>;
|
|
@@ -372,21 +574,21 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
372
574
|
* @this {FrontendModelClass}
|
|
373
575
|
* @returns {Record<string, FrontendModelAttachmentDefinition>} - Attachment definitions keyed by attachment name.
|
|
374
576
|
*/
|
|
375
|
-
static attachmentDefinitions(this: FrontendModelClass
|
|
577
|
+
static attachmentDefinitions(this: FrontendModelClass): Record<string, FrontendModelAttachmentDefinition>;
|
|
376
578
|
/**
|
|
377
579
|
* Runs attachment definition.
|
|
378
580
|
* @this {FrontendModelClass}
|
|
379
581
|
* @param {string} attachmentName - Attachment name.
|
|
380
582
|
* @returns {FrontendModelAttachmentDefinition | null} - Attachment definition.
|
|
381
583
|
*/
|
|
382
|
-
static attachmentDefinition(this: FrontendModelClass
|
|
584
|
+
static attachmentDefinition(this: FrontendModelClass, attachmentName: string): FrontendModelAttachmentDefinition | null;
|
|
383
585
|
/**
|
|
384
586
|
* Runs relationship definition.
|
|
385
587
|
* @this {FrontendModelClass}
|
|
386
588
|
* @param {string} relationshipName - Relationship name.
|
|
387
589
|
* @returns {{type: "belongsTo" | "hasOne" | "hasMany", autoload?: boolean} | null} - Relationship definition.
|
|
388
590
|
*/
|
|
389
|
-
static relationshipDefinition(this: FrontendModelClass
|
|
591
|
+
static relationshipDefinition(this: FrontendModelClass, relationshipName: string): {
|
|
390
592
|
type: "belongsTo" | "hasOne" | "hasMany";
|
|
391
593
|
autoload?: boolean;
|
|
392
594
|
} | null;
|
|
@@ -396,40 +598,248 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
396
598
|
* @param {string} attributeName - Candidate attribute name, such as `tasksAttributes`.
|
|
397
599
|
* @returns {string | null} Relationship name when nested attributes are configured.
|
|
398
600
|
*/
|
|
399
|
-
static nestedAttributesRelationshipName(this: FrontendModelClass
|
|
601
|
+
static nestedAttributesRelationshipName(this: FrontendModelClass, attributeName: string): string | null;
|
|
400
602
|
/**
|
|
401
603
|
* Runs relationship model class.
|
|
402
604
|
* @this {FrontendModelClass}
|
|
403
605
|
* @param {string} relationshipName - Relationship name.
|
|
404
606
|
* @returns {FrontendModelClass | null} - Target relationship model class.
|
|
405
607
|
*/
|
|
406
|
-
static relationshipModelClass(this: FrontendModelClass
|
|
608
|
+
static relationshipModelClass(this: FrontendModelClass, relationshipName: string): FrontendModelClass | null;
|
|
407
609
|
/**
|
|
408
|
-
* Runs
|
|
409
|
-
* @
|
|
410
|
-
* @returns {string} - Primary key name.
|
|
610
|
+
* Runs attributes.
|
|
611
|
+
* @returns {Attributes} - Attributes hash.
|
|
411
612
|
*/
|
|
412
|
-
|
|
613
|
+
attributes(): Attributes;
|
|
413
614
|
/**
|
|
414
|
-
* Runs
|
|
415
|
-
* @
|
|
416
|
-
* @returns {string} - Derived resource path.
|
|
615
|
+
* Runs is new record.
|
|
616
|
+
* @returns {boolean} - Whether this model has not yet been persisted.
|
|
417
617
|
*/
|
|
418
|
-
|
|
618
|
+
isNewRecord(): boolean;
|
|
419
619
|
/**
|
|
420
|
-
* Runs
|
|
421
|
-
* @
|
|
422
|
-
* @param {FrontendModelCommandType} commandType - Command type.
|
|
423
|
-
* @returns {string} - Resolved command name.
|
|
620
|
+
* Runs is persisted.
|
|
621
|
+
* @returns {boolean} - Whether this model has been persisted.
|
|
424
622
|
*/
|
|
425
|
-
|
|
623
|
+
isPersisted(): boolean;
|
|
426
624
|
/**
|
|
427
|
-
* Runs
|
|
625
|
+
* Runs set is new record.
|
|
626
|
+
* @param {boolean} newIsNewRecord - New persisted-state flag.
|
|
627
|
+
* @returns {void}
|
|
628
|
+
*/
|
|
629
|
+
setIsNewRecord(newIsNewRecord: boolean): void;
|
|
630
|
+
/**
|
|
631
|
+
* Marks this record for destruction when its parent is next saved through
|
|
632
|
+
* nested-attribute support. The record is not removed from the parent's
|
|
633
|
+
* relationship collection until the server confirms the delete.
|
|
634
|
+
* @returns {void} - No return value.
|
|
635
|
+
*/
|
|
636
|
+
markForDestruction(): void;
|
|
637
|
+
/**
|
|
638
|
+
* Runs marked for destruction.
|
|
639
|
+
* @returns {boolean} - Whether this record is queued for nested destruction on next parent save.
|
|
640
|
+
*/
|
|
641
|
+
markedForDestruction(): boolean;
|
|
642
|
+
/**
|
|
643
|
+
* Runs changes.
|
|
644
|
+
* @returns {Record<string, Array<ReturnType<typeof JSON.parse>>>} - Changed attributes as `[oldValue, newValue]`.
|
|
645
|
+
*/
|
|
646
|
+
changes(): Record<string, Array<ReturnType<typeof JSON.parse>>>;
|
|
647
|
+
/**
|
|
648
|
+
* Runs is changed.
|
|
649
|
+
* @returns {boolean} - Whether any tracked attribute has changed.
|
|
650
|
+
*/
|
|
651
|
+
isChanged(): boolean;
|
|
652
|
+
/**
|
|
653
|
+
* Runs get relationship by name.
|
|
654
|
+
* @param {string} relationshipName - Relationship name.
|
|
655
|
+
* @returns {FrontendModelRelationship} - Relationship state object.
|
|
656
|
+
*/
|
|
657
|
+
getRelationshipByName(relationshipName: string): FrontendModelRelationship;
|
|
658
|
+
/**
|
|
659
|
+
* Runs get attachment by name.
|
|
660
|
+
* @param {string} attachmentName - Attachment name.
|
|
661
|
+
* @returns {FrontendModelAttachmentHandle} - Attachment helper.
|
|
662
|
+
*/
|
|
663
|
+
getAttachmentByName(attachmentName: string): FrontendModelAttachmentHandle;
|
|
664
|
+
/**
|
|
665
|
+
* Runs load relationship.
|
|
666
|
+
* @param {string} relationshipName - Relationship name.
|
|
667
|
+
* @returns {Promise<FrontendModelBase | Array<FrontendModelBase> | null>} - Loaded relationship value.
|
|
668
|
+
*/
|
|
669
|
+
loadRelationship(relationshipName: string): Promise<FrontendModelBase | Array<FrontendModelBase> | null>;
|
|
670
|
+
/**
|
|
671
|
+
* Preloads relationship(s) onto this already-loaded record. Accepts either a
|
|
672
|
+
* query built via `Model.preload(...).select(...)` or a raw preload spec
|
|
673
|
+
* (string / array / nested object). Relationships already preloaded with the
|
|
674
|
+
* required columns present are left untouched unless `force` is set. Carries
|
|
675
|
+
* the query's preload graph, select, selectsExtra, withCount, abilities, and
|
|
676
|
+
* queryData when re-fetching.
|
|
677
|
+
* @param {import("./query.js").default<FrontendModelClass> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
|
|
678
|
+
* @param {{force?: boolean}} [options] - Options.
|
|
679
|
+
* @returns {Promise<void>} - Resolves when preloading completes.
|
|
680
|
+
*/
|
|
681
|
+
preload(queryOrSpec: import("./query.js").default<FrontendModelClass> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>, options?: {
|
|
682
|
+
force?: boolean;
|
|
683
|
+
}): Promise<void>;
|
|
684
|
+
/**
|
|
685
|
+
* Runs relationship or load.
|
|
686
|
+
* @param {string} relationshipName - Relationship name.
|
|
687
|
+
* @returns {Promise<FrontendModelBase | Array<FrontendModelBase> | null>} - Loaded relationship value.
|
|
688
|
+
*/
|
|
689
|
+
relationshipOrLoad(relationshipName: string): Promise<FrontendModelBase | Array<FrontendModelBase> | null>;
|
|
690
|
+
/**
|
|
691
|
+
* Attempts to batch-load `relationshipName` across cohort siblings via a
|
|
692
|
+
* single `preload([name]).where({pk: [ids]}).toArray()` request, then copies
|
|
693
|
+
* the preloaded relationship state onto each sibling. Returns true when a
|
|
694
|
+
* batch ran, false when autoload is off, there is no cohort, or no batch
|
|
695
|
+
* candidates remain. Siblings whose relationship state is already set
|
|
696
|
+
* (preloaded or locally manipulated via `build` / `setRelationship`) are
|
|
697
|
+
* skipped so their cached/edited value is preserved.
|
|
698
|
+
* @param {string} relationshipName - Relationship name.
|
|
699
|
+
* @returns {Promise<boolean>} - Whether a cohort batch preload ran.
|
|
700
|
+
*/
|
|
701
|
+
_tryCohortPreload(relationshipName: string): Promise<boolean>;
|
|
702
|
+
/**
|
|
703
|
+
* Runs set relationship.
|
|
704
|
+
* @param {string} relationshipName - Relationship name.
|
|
705
|
+
* @param {FrontendModelBase | null | undefined} relationshipValue - Relationship value.
|
|
706
|
+
* @returns {FrontendModelBase | null | undefined} - Assigned relationship value.
|
|
707
|
+
*/
|
|
708
|
+
setRelationship(relationshipName: string, relationshipValue: FrontendModelBase | null | undefined): FrontendModelBase | null | undefined;
|
|
709
|
+
/**
|
|
710
|
+
* Runs assign attributes.
|
|
711
|
+
* @param {Attributes | CreateAttributes | UpdateAttributes | Record<string, FrontendModelAttributeValue>} attributes - Attributes to assign.
|
|
712
|
+
* @returns {void} - No return value.
|
|
713
|
+
*/
|
|
714
|
+
assignAttributes(attributes: Attributes | CreateAttributes | UpdateAttributes | Record<string, FrontendModelAttributeValue>): void;
|
|
715
|
+
/**
|
|
716
|
+
* Runs clear relationship cache.
|
|
717
|
+
* @returns {void} - Clears cached relationship state.
|
|
718
|
+
*/
|
|
719
|
+
clearRelationshipCache(): void;
|
|
720
|
+
/**
|
|
721
|
+
* Runs primary key.
|
|
722
|
+
* @this {FrontendModelClass}
|
|
723
|
+
* @returns {string} - Primary key name.
|
|
724
|
+
*/
|
|
725
|
+
static primaryKey(this: FrontendModelClass): string;
|
|
726
|
+
/**
|
|
727
|
+
* Runs primary key value.
|
|
728
|
+
* @returns {number | string} - Primary key value.
|
|
729
|
+
*/
|
|
730
|
+
primaryKeyValue(): number | string;
|
|
731
|
+
/**
|
|
732
|
+
* Runs read attribute.
|
|
733
|
+
* @param {string} attributeName - Attribute name.
|
|
734
|
+
* @returns {ReturnType<typeof JSON.parse>} - Attribute value.
|
|
735
|
+
*/
|
|
736
|
+
readAttribute(attributeName: string): ReturnType<typeof JSON.parse>;
|
|
737
|
+
/**
|
|
738
|
+
* Whether an attribute value is currently loaded on this record. Used by the
|
|
739
|
+
* preloader to decide whether a relationship can be skipped because the
|
|
740
|
+
* requested columns are already present.
|
|
741
|
+
* @param {string} attributeName - Attribute name.
|
|
742
|
+
* @returns {boolean} - Whether the attribute is loaded.
|
|
743
|
+
*/
|
|
744
|
+
hasLoadedAttribute(attributeName: string): boolean;
|
|
745
|
+
/**
|
|
746
|
+
* Read an association count attached by `.withCount(...)`. Counts
|
|
747
|
+
* live on a dedicated map separate from the record's attributes so
|
|
748
|
+
* a virtual count like `tasksCount` can't silently shadow a real
|
|
749
|
+
* column of the same name. Returns the attached value, or 0 when
|
|
750
|
+
* `.withCount(...)` wasn't requested for this attribute.
|
|
751
|
+
* @param {string} attributeName - Attribute name, e.g. `"tasksCount"` or a custom name from `.withCount({customName: {...}})`.
|
|
752
|
+
* @returns {number} - Attached association count, or zero when absent.
|
|
753
|
+
*/
|
|
754
|
+
readCount(attributeName: string): number;
|
|
755
|
+
/**
|
|
756
|
+
* Internal setter called by `instantiateFromResponse` when hydrating
|
|
757
|
+
* association counts that rode along with the record payload.
|
|
758
|
+
* @param {string} attributeName - Attribute name.
|
|
759
|
+
* @param {number} value - Count value.
|
|
760
|
+
* @returns {void}
|
|
761
|
+
*/
|
|
762
|
+
_setAssociationCount(attributeName: string, value: number): void;
|
|
763
|
+
/**
|
|
764
|
+
* Read a per-record ability result attached by `.abilities(...)`. The
|
|
765
|
+
* backend evaluates each requested action against the current
|
|
766
|
+
* ability for this record instance and ships the result alongside
|
|
767
|
+
* the record's attributes. Returns `false` when the action wasn't
|
|
768
|
+
* requested (or the ability denied it), so UI code can safely branch
|
|
769
|
+
* on `record.can("update")` without first checking whether the
|
|
770
|
+
* ability was loaded.
|
|
771
|
+
* @param {string} action - Ability action name, e.g. `"update"`.
|
|
772
|
+
* @returns {boolean} - Whether the requested ability is allowed.
|
|
773
|
+
*/
|
|
774
|
+
can(action: string): boolean;
|
|
775
|
+
/**
|
|
776
|
+
* Internal setter called by `instantiateFromResponse` when hydrating
|
|
777
|
+
* per-record ability results that rode along with the record
|
|
778
|
+
* payload.
|
|
779
|
+
* @param {string} action - Ability action name.
|
|
780
|
+
* @param {boolean} value - Whether the current ability permits the action on this record.
|
|
781
|
+
* @returns {void}
|
|
782
|
+
*/
|
|
783
|
+
_setComputedAbility(action: string, value: boolean): void;
|
|
784
|
+
/**
|
|
785
|
+
* Read a consumer-defined value attached by `.queryData(...)`. Stored
|
|
786
|
+
* on a dedicated map rather than `_attributes`, so a virtual alias
|
|
787
|
+
* like `tasksCount` cannot silently shadow a real column of the same
|
|
788
|
+
* name. Returns `null` when no registered fn produced that alias for
|
|
789
|
+
* this record (e.g. no child rows matched the aggregate).
|
|
790
|
+
* @param {string} name - queryData alias name.
|
|
791
|
+
* @returns {ReturnType<typeof JSON.parse>} - Attached query-data value.
|
|
792
|
+
*/
|
|
793
|
+
queryData(name: string): ReturnType<typeof JSON.parse>;
|
|
794
|
+
/**
|
|
795
|
+
* Internal setter used by `instantiateFromResponse` when hydrating
|
|
796
|
+
* queryData values that rode along with the record payload.
|
|
797
|
+
* @param {string} name - queryData alias name.
|
|
798
|
+
* @param {ReturnType<typeof JSON.parse>} value - Attached value.
|
|
799
|
+
* @returns {void}
|
|
800
|
+
*/
|
|
801
|
+
_setQueryData(name: string, value: ReturnType<typeof JSON.parse>): void;
|
|
802
|
+
/**
|
|
803
|
+
* Runs set attribute.
|
|
804
|
+
* @param {string} attributeName - Attribute name.
|
|
805
|
+
* @param {ReturnType<typeof JSON.parse>} newValue - New value.
|
|
806
|
+
* @returns {ReturnType<typeof JSON.parse>} - Assigned value.
|
|
807
|
+
*/
|
|
808
|
+
setAttribute(attributeName: string, newValue: ReturnType<typeof JSON.parse>): ReturnType<typeof JSON.parse>;
|
|
809
|
+
/**
|
|
810
|
+
* Invalidates any cached belongsTo relationship whose foreign key matches the
|
|
811
|
+
* changed attribute. HasMany / hasOne relationships are left untouched because
|
|
812
|
+
* their foreign key lives on the child, not on this model, and blanket-clearing
|
|
813
|
+
* them would destroy nested-save state and preloaded children the caller never
|
|
814
|
+
* asked to invalidate.
|
|
815
|
+
*
|
|
816
|
+
* Foreign keys are inferred when not declared: for belongsTo `projectId` is
|
|
817
|
+
* inferred from relationship name `project`. Explicit `foreignKey` on the
|
|
818
|
+
* relationship definition takes precedence.
|
|
819
|
+
* @param {string} attributeName - Attribute name that changed.
|
|
820
|
+
* @returns {void}
|
|
821
|
+
*/
|
|
822
|
+
_invalidateRelationshipsForAttribute(attributeName: string): void;
|
|
823
|
+
/**
|
|
824
|
+
* Runs resource path.
|
|
825
|
+
* @this {FrontendModelClass}
|
|
826
|
+
* @returns {string} - Derived resource path.
|
|
827
|
+
*/
|
|
828
|
+
static resourcePath(this: FrontendModelClass): string;
|
|
829
|
+
/**
|
|
830
|
+
* Runs command name.
|
|
831
|
+
* @this {FrontendModelClass}
|
|
832
|
+
* @param {FrontendModelCommandType} commandType - Command type.
|
|
833
|
+
* @returns {string} - Resolved command name.
|
|
834
|
+
*/
|
|
835
|
+
static commandName(this: FrontendModelClass, commandType: FrontendModelCommandType): string;
|
|
836
|
+
/**
|
|
837
|
+
* Runs normalize custom command payload arguments.
|
|
428
838
|
* @this {FrontendModelClass}
|
|
429
|
-
* @param {Array
|
|
430
|
-
* @returns {Record<string,
|
|
839
|
+
* @param {Array<ReturnType<typeof JSON.parse>>} args - Command arguments.
|
|
840
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Command payload.
|
|
431
841
|
*/
|
|
432
|
-
static normalizeCustomCommandPayloadArguments(this: FrontendModelClass
|
|
842
|
+
static normalizeCustomCommandPayloadArguments(this: FrontendModelClass, args: Array<ReturnType<typeof JSON.parse>>): Record<string, ReturnType<typeof JSON.parse>>;
|
|
433
843
|
/**
|
|
434
844
|
* Returns the model name, preferring an explicit `static modelName` declaration
|
|
435
845
|
* over the JavaScript class `.name` property. This allows minified builds to
|
|
@@ -437,7 +847,7 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
437
847
|
* @this {FrontendModelClass}
|
|
438
848
|
* @returns {string} - The model name.
|
|
439
849
|
*/
|
|
440
|
-
static getModelName(this: FrontendModelClass
|
|
850
|
+
static getModelName(this: FrontendModelClass): string;
|
|
441
851
|
/**
|
|
442
852
|
* Runs configure transport.
|
|
443
853
|
* @param {FrontendModelTransportConfig} config - Frontend model transport configuration.
|
|
@@ -484,10 +894,10 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
484
894
|
* Sets global metadata on the WebSocket connection. Sent to the server immediately
|
|
485
895
|
* over WebSocket and exposed to WebSocket-borne requests as request metadata.
|
|
486
896
|
* @param {string} key - Metadata key.
|
|
487
|
-
* @param {
|
|
897
|
+
* @param {ReturnType<typeof JSON.parse>} value - Metadata value (null to clear).
|
|
488
898
|
* @returns {void}
|
|
489
899
|
*/
|
|
490
|
-
static setWebsocketMetadata(key: string, value:
|
|
900
|
+
static setWebsocketMetadata(key: string, value: ReturnType<typeof JSON.parse>): void;
|
|
491
901
|
/**
|
|
492
902
|
* Opens a managed connection that auto-opens, auto-closes, and
|
|
493
903
|
* auto-reconnects based on `shouldConnect()` and `params()`.
|
|
@@ -495,14 +905,14 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
495
905
|
* functions change (e.g. current-user sign-in/out). The handle
|
|
496
906
|
* retries when the WS client isn't ready and reopens on close.
|
|
497
907
|
* @param {string} connectionType - Connection class name registered on the server.
|
|
498
|
-
* @param {{shouldConnect: () => boolean, params: () => Record<string,
|
|
908
|
+
* @param {{shouldConnect: () => boolean, params: () => Record<string, ReturnType<typeof JSON.parse>>, signal?: AbortSignal, onMessage?: (body: ReturnType<typeof JSON.parse>) => void}} options - Connection lifecycle, cancellation, and payload callbacks.
|
|
499
909
|
* @returns {{sync: () => void, close: () => void}} - Handle used to resync or close the managed connection.
|
|
500
910
|
*/
|
|
501
911
|
static openManagedConnection(connectionType: string, options: {
|
|
502
912
|
shouldConnect: () => boolean;
|
|
503
|
-
params: () => Record<string,
|
|
913
|
+
params: () => Record<string, ReturnType<typeof JSON.parse>>;
|
|
504
914
|
signal?: AbortSignal;
|
|
505
|
-
onMessage?: (body:
|
|
915
|
+
onMessage?: (body: ReturnType<typeof JSON.parse>) => void;
|
|
506
916
|
}): {
|
|
507
917
|
sync: () => void;
|
|
508
918
|
close: () => void;
|
|
@@ -513,11 +923,11 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
513
923
|
* `openConnection`. Apps use this for per-session state/messaging
|
|
514
924
|
* that doesn't fit the pub/sub Channel model (locale, presence).
|
|
515
925
|
* @param {string} connectionType - Name the server registered the class under.
|
|
516
|
-
* @param {{params?: Record<string,
|
|
926
|
+
* @param {{params?: Record<string, ReturnType<typeof JSON.parse>>, timeoutMs?: number, signal?: AbortSignal, onConnect?: () => void, onMessage?: (body: Record<string, unknown>) => void, onDisconnect?: () => void, onResume?: () => void, onClose?: (reason: string) => void}} [options] - Connection options, readiness controls, and event handlers. Connect the client first; the timeout covers server-confirmed readiness and the signal cancels readiness without entering the wire payload.
|
|
517
927
|
* @returns {{ready: Promise<void>, close: () => void}} - Websocket connection handle.
|
|
518
928
|
*/
|
|
519
929
|
static openWebsocketConnection(connectionType: string, options?: {
|
|
520
|
-
params?: Record<string,
|
|
930
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
521
931
|
timeoutMs?: number;
|
|
522
932
|
signal?: AbortSignal;
|
|
523
933
|
onConnect?: () => void;
|
|
@@ -533,11 +943,11 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
533
943
|
* Subscribes to a pub/sub `WebsocketChannel`. Thin wrapper around
|
|
534
944
|
* the internal client's `subscribeChannel`.
|
|
535
945
|
* @param {string} channelType - Channel class name registered on the server.
|
|
536
|
-
* @param {{params?: Record<string,
|
|
946
|
+
* @param {{params?: Record<string, ReturnType<typeof JSON.parse>>, timeoutMs?: number, signal?: AbortSignal, onMessage?: (body: Record<string, unknown>) => void, onDisconnect?: () => void, onResume?: () => void, onClose?: (reason: string) => void}} [options] - Channel options, startup controls, and event handlers. The timeout covers connect and server-confirmed readiness only; the signal cancels startup without entering the wire payload.
|
|
537
947
|
* @returns {{ready: Promise<void>, close: () => void}} - Websocket channel handle from the configured client.
|
|
538
948
|
*/
|
|
539
949
|
static subscribeWebsocketChannel(channelType: string, options?: {
|
|
540
|
-
params?: Record<string,
|
|
950
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
541
951
|
timeoutMs?: number;
|
|
542
952
|
signal?: AbortSignal;
|
|
543
953
|
onMessage?: (body: Record<string, unknown>) => void;
|
|
@@ -560,14 +970,14 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
560
970
|
* @param {object} response - Response payload.
|
|
561
971
|
* @returns {Record<string, FrontendModelAttributeValue>} - Attributes from payload.
|
|
562
972
|
*/
|
|
563
|
-
static attributesFromResponse(this: FrontendModelClass
|
|
973
|
+
static attributesFromResponse(this: FrontendModelClass, response: object): Record<string, FrontendModelAttributeValue>;
|
|
564
974
|
/**
|
|
565
975
|
* Runs model data from response.
|
|
566
976
|
* @this {FrontendModelClass}
|
|
567
977
|
* @param {object} response - Response payload.
|
|
568
978
|
* @returns {{abilities: Record<string, boolean>, attributes: Record<string, FrontendModelAttributeValue>, associationCounts: Record<string, number>, queryData: Record<string, FrontendModelAttributeValue>, preloadedRelationships: Record<string, FrontendModelAttributeValue>, selectedAttributes: Set<string>}} - Attributes, preloaded relationships, association counts, queryData, abilities, and the selected-attributes set.
|
|
569
979
|
*/
|
|
570
|
-
static modelDataFromResponse(this: FrontendModelClass
|
|
980
|
+
static modelDataFromResponse(this: FrontendModelClass, response: object): {
|
|
571
981
|
abilities: Record<string, boolean>;
|
|
572
982
|
attributes: Record<string, FrontendModelAttributeValue>;
|
|
573
983
|
associationCounts: Record<string, number>;
|
|
@@ -579,26 +989,26 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
579
989
|
* Runs apply preloaded relationships.
|
|
580
990
|
* @this {FrontendModelClass}
|
|
581
991
|
* @param {FrontendModelBase} model - Model instance.
|
|
582
|
-
* @param {Record<string,
|
|
992
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} preloadedRelationships - Preloaded relationship payload.
|
|
583
993
|
* @returns {void}
|
|
584
994
|
*/
|
|
585
|
-
static applyPreloadedRelationships(this: FrontendModelClass
|
|
995
|
+
static applyPreloadedRelationships(this: FrontendModelClass, model: FrontendModelBase, preloadedRelationships: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
586
996
|
/**
|
|
587
997
|
* Runs instantiate relationship value.
|
|
588
998
|
* @this {FrontendModelClass}
|
|
589
|
-
* @param {
|
|
999
|
+
* @param {ReturnType<typeof JSON.parse>} relationshipPayload - Relationship payload value.
|
|
590
1000
|
* @param {FrontendModelClass | null} targetModelClass - Target model class.
|
|
591
|
-
* @returns {
|
|
1001
|
+
* @returns {ReturnType<typeof JSON.parse>} - Instantiated relationship value.
|
|
592
1002
|
*/
|
|
593
|
-
static instantiateRelationshipValue(this: FrontendModelClass
|
|
1003
|
+
static instantiateRelationshipValue(this: FrontendModelClass, relationshipPayload: ReturnType<typeof JSON.parse>, targetModelClass: FrontendModelClass | null): ReturnType<typeof JSON.parse>;
|
|
594
1004
|
/**
|
|
595
1005
|
* Runs instantiate from response.
|
|
596
1006
|
* @template {FrontendModelClass} T
|
|
597
1007
|
* @this {T}
|
|
598
|
-
* @param {Record<string,
|
|
1008
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>> | InstanceType<T>} response - Response payload, or an already-hydrated instance of this class.
|
|
599
1009
|
* @returns {InstanceType<T>} - New model instance, or the same instance unchanged if it was already hydrated.
|
|
600
1010
|
*/
|
|
601
|
-
static instantiateFromResponse<T extends FrontendModelClass>(this: T, response: Record<string,
|
|
1011
|
+
static instantiateFromResponse<T extends FrontendModelClass>(this: T, response: Record<string, ReturnType<typeof JSON.parse>> | InstanceType<T>): InstanceType<T>;
|
|
602
1012
|
/**
|
|
603
1013
|
* Runs find.
|
|
604
1014
|
* @template {FrontendModelClass} T
|
|
@@ -611,18 +1021,18 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
611
1021
|
* Runs find by.
|
|
612
1022
|
* @template {FrontendModelClass} T
|
|
613
1023
|
* @this {T}
|
|
614
|
-
* @param {Record<string,
|
|
1024
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} conditions - Attribute match conditions.
|
|
615
1025
|
* @returns {Promise<InstanceType<T> | null>} - Found model or null.
|
|
616
1026
|
*/
|
|
617
|
-
static findBy<T extends FrontendModelClass>(this: T, conditions: Record<string,
|
|
1027
|
+
static findBy<T extends FrontendModelClass>(this: T, conditions: Record<string, ReturnType<typeof JSON.parse>>): Promise<InstanceType<T> | null>;
|
|
618
1028
|
/**
|
|
619
1029
|
* Runs find by or fail.
|
|
620
1030
|
* @template {FrontendModelClass} T
|
|
621
1031
|
* @this {T}
|
|
622
|
-
* @param {Record<string,
|
|
1032
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} conditions - Attribute match conditions.
|
|
623
1033
|
* @returns {Promise<InstanceType<T>>} - Found model.
|
|
624
1034
|
*/
|
|
625
|
-
static findByOrFail<T extends FrontendModelClass>(this: T, conditions: Record<string,
|
|
1035
|
+
static findByOrFail<T extends FrontendModelClass>(this: T, conditions: Record<string, ReturnType<typeof JSON.parse>>): Promise<InstanceType<T>>;
|
|
626
1036
|
/**
|
|
627
1037
|
* Runs to array.
|
|
628
1038
|
* @template {FrontendModelClass} T
|
|
@@ -648,18 +1058,18 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
648
1058
|
* Runs where.
|
|
649
1059
|
* @template {FrontendModelClass} T
|
|
650
1060
|
* @this {T}
|
|
651
|
-
* @param {Record<string,
|
|
1061
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} conditions - Root-model where conditions.
|
|
652
1062
|
* @returns {import("./query.js").default<T>} - Query with where conditions.
|
|
653
1063
|
*/
|
|
654
|
-
static where<T extends FrontendModelClass>(this: T, conditions: Record<string,
|
|
1064
|
+
static where<T extends FrontendModelClass>(this: T, conditions: Record<string, ReturnType<typeof JSON.parse>>): import("./query.js").default<T>;
|
|
655
1065
|
/**
|
|
656
1066
|
* Runs joins.
|
|
657
1067
|
* @template {FrontendModelClass} T
|
|
658
1068
|
* @this {T}
|
|
659
|
-
* @param {Record<string,
|
|
1069
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>} joins - Relationship descriptor joins.
|
|
660
1070
|
* @returns {import("./query.js").default<T>} - Query with joins.
|
|
661
1071
|
*/
|
|
662
|
-
static joins<T extends FrontendModelClass>(this: T, joins: Record<string,
|
|
1072
|
+
static joins<T extends FrontendModelClass>(this: T, joins: Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>): import("./query.js").default<T>;
|
|
663
1073
|
/**
|
|
664
1074
|
* Runs limit.
|
|
665
1075
|
* @template {FrontendModelClass} T
|
|
@@ -710,7 +1120,7 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
710
1120
|
* @param {import("./query.js").FrontendModelEventOptions} [options] - Event query or record projection options.
|
|
711
1121
|
* @returns {Promise<() => void>} - Unsubscribe callback.
|
|
712
1122
|
*/
|
|
713
|
-
static onCreate(this: FrontendModelClass
|
|
1123
|
+
static onCreate(this: FrontendModelClass, callback: (payload: {
|
|
714
1124
|
id: string;
|
|
715
1125
|
model: FrontendModelBase;
|
|
716
1126
|
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
@@ -721,7 +1131,7 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
721
1131
|
* @param {import("./query.js").FrontendModelEventOptions} [options] - Event query or record projection options.
|
|
722
1132
|
* @returns {Promise<() => void>} - Unsubscribe callback.
|
|
723
1133
|
*/
|
|
724
|
-
static onUpdate(this: FrontendModelClass
|
|
1134
|
+
static onUpdate(this: FrontendModelClass, callback: (payload: {
|
|
725
1135
|
id: string;
|
|
726
1136
|
model: FrontendModelBase;
|
|
727
1137
|
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
@@ -732,17 +1142,39 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
732
1142
|
* @param {import("./query.js").FrontendModelEventOptions} [options] - Accepted for API symmetry; destroy events carry ids only.
|
|
733
1143
|
* @returns {Promise<() => void>} - Unsubscribe callback.
|
|
734
1144
|
*/
|
|
735
|
-
static onDestroy(this: FrontendModelClass
|
|
1145
|
+
static onDestroy(this: FrontendModelClass, callback: (payload: {
|
|
1146
|
+
id: string;
|
|
1147
|
+
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
1148
|
+
/**
|
|
1149
|
+
* Instance-level hook fired when THIS record is updated. The
|
|
1150
|
+
* instance's attributes are auto-merged with the broadcast payload
|
|
1151
|
+
* before the callback runs, so callers can read fresh values via
|
|
1152
|
+
* `this.someAttr()` without re-fetching.
|
|
1153
|
+
* @param {(payload: {id: string, model: FrontendModelBase}) => void} callback - Event callback.
|
|
1154
|
+
* @param {import("./query.js").FrontendModelEventOptions} [options] - Event query or record projection options.
|
|
1155
|
+
* @returns {Promise<() => void>} - Unsubscribe callback.
|
|
1156
|
+
*/
|
|
1157
|
+
onUpdate(callback: (payload: {
|
|
1158
|
+
id: string;
|
|
1159
|
+
model: FrontendModelBase;
|
|
1160
|
+
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
1161
|
+
/**
|
|
1162
|
+
* Instance-level hook fired when THIS record is destroyed.
|
|
1163
|
+
* @param {(payload: {id: string}) => void} callback - Event callback.
|
|
1164
|
+
* @param {import("./query.js").FrontendModelEventOptions} [options] - Accepted for API symmetry; destroy events carry ids only.
|
|
1165
|
+
* @returns {Promise<() => void>} - Unsubscribe callback.
|
|
1166
|
+
*/
|
|
1167
|
+
onDestroy(callback: (payload: {
|
|
736
1168
|
id: string;
|
|
737
1169
|
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
738
1170
|
/**
|
|
739
1171
|
* Runs pluck.
|
|
740
1172
|
* @template {FrontendModelClass} T
|
|
741
1173
|
* @this {T}
|
|
742
|
-
* @param {...(string | string[] | Record<string,
|
|
743
|
-
* @returns {Promise<Array
|
|
1174
|
+
* @param {...(string | string[] | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>)} columns - Pluck definition(s).
|
|
1175
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Plucked values.
|
|
744
1176
|
*/
|
|
745
|
-
static pluck<T extends FrontendModelClass>(this: T, ...columns: (string | string[] | Record<string,
|
|
1177
|
+
static pluck<T extends FrontendModelClass>(this: T, ...columns: (string | string[] | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>)[]): Promise<Array<ReturnType<typeof JSON.parse>>>;
|
|
746
1178
|
/**
|
|
747
1179
|
* Runs search.
|
|
748
1180
|
* @template {FrontendModelClass} T
|
|
@@ -750,42 +1182,42 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
750
1182
|
* @param {string[]} path - Relationship path.
|
|
751
1183
|
* @param {string} column - Column or attribute name.
|
|
752
1184
|
* @param {"eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<="} operator - Search operator.
|
|
753
|
-
* @param {
|
|
1185
|
+
* @param {ReturnType<typeof JSON.parse>} value - Search value.
|
|
754
1186
|
* @returns {FrontendModelQuery<T>} - Query builder with search filter.
|
|
755
1187
|
*/
|
|
756
|
-
static search<T extends FrontendModelClass>(this: T, path: string[], column: string, operator: "eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<=", value:
|
|
1188
|
+
static search<T extends FrontendModelClass>(this: T, path: string[], column: string, operator: "eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<=", value: ReturnType<typeof JSON.parse>): FrontendModelQuery<T>;
|
|
757
1189
|
/**
|
|
758
1190
|
* Runs ransack.
|
|
759
1191
|
* @template {FrontendModelClass} T
|
|
760
1192
|
* @this {T}
|
|
761
|
-
* @param {Record<string,
|
|
1193
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Ransack-style params hash.
|
|
762
1194
|
* @returns {FrontendModelQuery<T>} - Query builder with Ransack filters applied.
|
|
763
1195
|
*/
|
|
764
|
-
static ransack<T extends FrontendModelClass>(this: T, params: Record<string,
|
|
1196
|
+
static ransack<T extends FrontendModelClass>(this: T, params: Record<string, ReturnType<typeof JSON.parse>>): FrontendModelQuery<T>;
|
|
765
1197
|
/**
|
|
766
1198
|
* Runs sort.
|
|
767
1199
|
* @template {FrontendModelClass} T
|
|
768
1200
|
* @this {T}
|
|
769
|
-
* @param {string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string,
|
|
1201
|
+
* @param {string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>} sort - Sort definition(s).
|
|
770
1202
|
* @returns {FrontendModelQuery<T>} - Query builder with sort definitions.
|
|
771
1203
|
*/
|
|
772
|
-
static sort<T extends FrontendModelClass>(this: T, sort: string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string,
|
|
1204
|
+
static sort<T extends FrontendModelClass>(this: T, sort: string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>): FrontendModelQuery<T>;
|
|
773
1205
|
/**
|
|
774
1206
|
* Runs order.
|
|
775
1207
|
* @template {FrontendModelClass} T
|
|
776
1208
|
* @this {T}
|
|
777
|
-
* @param {string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string,
|
|
1209
|
+
* @param {string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>} sort - Sort definition(s).
|
|
778
1210
|
* @returns {FrontendModelQuery<T>} - Query builder with sort definitions.
|
|
779
1211
|
*/
|
|
780
|
-
static order<T extends FrontendModelClass>(this: T, sort: string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string,
|
|
1212
|
+
static order<T extends FrontendModelClass>(this: T, sort: string | string[] | string[][] | [string, string] | Array<[string, string]> | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>): FrontendModelQuery<T>;
|
|
781
1213
|
/**
|
|
782
1214
|
* Runs group.
|
|
783
1215
|
* @template {FrontendModelClass} T
|
|
784
1216
|
* @this {T}
|
|
785
|
-
* @param {string | string[] | Record<string,
|
|
1217
|
+
* @param {string | string[] | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>} group - Group definition(s).
|
|
786
1218
|
* @returns {FrontendModelQuery<T>} - Query builder with group definitions.
|
|
787
1219
|
*/
|
|
788
|
-
static group<T extends FrontendModelClass>(this: T, group: string | string[] | Record<string,
|
|
1220
|
+
static group<T extends FrontendModelClass>(this: T, group: string | string[] | Record<string, ReturnType<typeof JSON.parse>> | Array<Record<string, ReturnType<typeof JSON.parse>>>): FrontendModelQuery<T>;
|
|
789
1221
|
/**
|
|
790
1222
|
* Runs distinct.
|
|
791
1223
|
* @template {FrontendModelClass} T
|
|
@@ -843,19 +1275,19 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
843
1275
|
* Runs find or initialize by.
|
|
844
1276
|
* @template {FrontendModelClass} T
|
|
845
1277
|
* @this {T}
|
|
846
|
-
* @param {Record<string,
|
|
1278
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} conditions - Attribute match conditions.
|
|
847
1279
|
* @returns {Promise<InstanceType<T>>} - Existing or initialized model.
|
|
848
1280
|
*/
|
|
849
|
-
static findOrInitializeBy<T extends FrontendModelClass>(this: T, conditions: Record<string,
|
|
1281
|
+
static findOrInitializeBy<T extends FrontendModelClass>(this: T, conditions: Record<string, ReturnType<typeof JSON.parse>>): Promise<InstanceType<T>>;
|
|
850
1282
|
/**
|
|
851
1283
|
* Runs find or create by.
|
|
852
1284
|
* @template {FrontendModelClass} T
|
|
853
1285
|
* @this {T}
|
|
854
|
-
* @param {Record<string,
|
|
1286
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} conditions - Attribute match conditions.
|
|
855
1287
|
* @param {(model: InstanceType<T>) => Promise<void> | void} [callback] - Optional callback before save when created.
|
|
856
1288
|
* @returns {Promise<InstanceType<T>>} - Existing or newly created model.
|
|
857
1289
|
*/
|
|
858
|
-
static findOrCreateBy<T extends FrontendModelClass>(this: T, conditions: Record<string,
|
|
1290
|
+
static findOrCreateBy<T extends FrontendModelClass>(this: T, conditions: Record<string, ReturnType<typeof JSON.parse>>, callback?: (model: InstanceType<T>) => Promise<void> | void): Promise<InstanceType<T>>;
|
|
859
1291
|
/**
|
|
860
1292
|
* Runs create.
|
|
861
1293
|
* @template {FrontendModelClass} ModelClass
|
|
@@ -867,34 +1299,34 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
867
1299
|
/**
|
|
868
1300
|
* Runs assert find by conditions.
|
|
869
1301
|
* @this {FrontendModelClass}
|
|
870
|
-
* @param {Record<string,
|
|
1302
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} conditions - findBy conditions.
|
|
871
1303
|
* @returns {void}
|
|
872
1304
|
*/
|
|
873
|
-
static assertFindByConditions(this: FrontendModelClass
|
|
1305
|
+
static assertFindByConditions(this: FrontendModelClass, conditions: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
874
1306
|
/**
|
|
875
1307
|
* Runs matches find by conditions.
|
|
876
1308
|
* @this {FrontendModelClass}
|
|
877
1309
|
* @param {FrontendModelBase} model - Candidate model.
|
|
878
|
-
* @param {Record<string,
|
|
1310
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} conditions - Match conditions.
|
|
879
1311
|
* @returns {boolean} - Whether the model matches all conditions.
|
|
880
1312
|
*/
|
|
881
|
-
static matchesFindByConditions(this: FrontendModelClass
|
|
1313
|
+
static matchesFindByConditions(this: FrontendModelClass, model: FrontendModelBase, conditions: Record<string, ReturnType<typeof JSON.parse>>): boolean;
|
|
882
1314
|
/**
|
|
883
1315
|
* Runs find by condition value matches.
|
|
884
1316
|
* @this {FrontendModelClass}
|
|
885
|
-
* @param {
|
|
886
|
-
* @param {
|
|
1317
|
+
* @param {ReturnType<typeof JSON.parse>} actualValue - Actual model value.
|
|
1318
|
+
* @param {ReturnType<typeof JSON.parse>} expectedValue - Expected find condition value.
|
|
887
1319
|
* @returns {boolean} - Whether values match.
|
|
888
1320
|
*/
|
|
889
|
-
static findByConditionValueMatches(this: FrontendModelClass
|
|
1321
|
+
static findByConditionValueMatches(this: FrontendModelClass, actualValue: ReturnType<typeof JSON.parse>, expectedValue: ReturnType<typeof JSON.parse>): boolean;
|
|
890
1322
|
/**
|
|
891
1323
|
* Runs find by primitive values match.
|
|
892
1324
|
* @this {FrontendModelClass}
|
|
893
|
-
* @param {
|
|
894
|
-
* @param {
|
|
1325
|
+
* @param {ReturnType<typeof JSON.parse>} actualValue - Actual model value.
|
|
1326
|
+
* @param {ReturnType<typeof JSON.parse>} expectedValue - Expected find condition value.
|
|
895
1327
|
* @returns {boolean} - Whether primitive values match after safe coercion.
|
|
896
1328
|
*/
|
|
897
|
-
static findByPrimitiveValuesMatch(this: FrontendModelClass
|
|
1329
|
+
static findByPrimitiveValuesMatch(this: FrontendModelClass, actualValue: ReturnType<typeof JSON.parse>, expectedValue: ReturnType<typeof JSON.parse>): boolean;
|
|
898
1330
|
/**
|
|
899
1331
|
* Runs find by numeric string matches number.
|
|
900
1332
|
* @this {FrontendModelClass}
|
|
@@ -902,350 +1334,33 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
902
1334
|
* @param {number} expectedNumber - Number value.
|
|
903
1335
|
* @returns {boolean} - Whether values represent the same number.
|
|
904
1336
|
*/
|
|
905
|
-
static findByNumericStringMatchesNumber(this: FrontendModelClass
|
|
1337
|
+
static findByNumericStringMatchesNumber(this: FrontendModelClass, numericString: string, expectedNumber: number): boolean;
|
|
906
1338
|
/**
|
|
907
|
-
* Runs
|
|
908
|
-
* @
|
|
909
|
-
* @
|
|
910
|
-
* @param {Record<string, ?>} payload - Command payload.
|
|
911
|
-
* @returns {Promise<Record<string, ?>>} - Parsed JSON response.
|
|
1339
|
+
* Runs update.
|
|
1340
|
+
* @param {UpdateAttributes} [newAttributes] - New values to assign before update.
|
|
1341
|
+
* @returns {Promise<this>} - Updated model.
|
|
912
1342
|
*/
|
|
913
|
-
|
|
1343
|
+
update(newAttributes?: UpdateAttributes): Promise<this>;
|
|
914
1344
|
/**
|
|
915
|
-
* Runs
|
|
916
|
-
* @
|
|
917
|
-
* @
|
|
918
|
-
* @param {string} args.commandName - Raw command path segment.
|
|
919
|
-
* @param {FrontendModelRequestCommandType} args.commandType - Logical command type for error handling.
|
|
920
|
-
* @param {string | number | null} [args.memberId] - Optional member id for member-scoped commands.
|
|
921
|
-
* @param {Record<string, ?>} args.payload - Request payload.
|
|
922
|
-
* @param {string} args.resourcePath - Direct resource path.
|
|
923
|
-
* @returns {Promise<Record<string, FrontendModelAttributeValue>>} - Decoded response payload.
|
|
1345
|
+
* Runs attach.
|
|
1346
|
+
* @param {ReturnType<typeof JSON.parse>} attachmentInput - Attachment input or named attachment payload.
|
|
1347
|
+
* @returns {Promise<void>} - Resolves when attached.
|
|
924
1348
|
*/
|
|
925
|
-
|
|
926
|
-
commandName: string;
|
|
927
|
-
commandType: FrontendModelRequestCommandType;
|
|
928
|
-
memberId?: string | number | null | undefined;
|
|
929
|
-
payload: Record<string, unknown>;
|
|
930
|
-
resourcePath: string;
|
|
931
|
-
}): Promise<Record<string, FrontendModelAttributeValue>>;
|
|
1349
|
+
attach(attachmentInput: ReturnType<typeof JSON.parse>): Promise<void>;
|
|
932
1350
|
/**
|
|
933
|
-
* Runs
|
|
934
|
-
* @
|
|
935
|
-
* @param {object} args - Arguments.
|
|
936
|
-
* @param {FrontendModelRequestCommandType} args.commandType - Command type.
|
|
937
|
-
* @param {Record<string, ?>} args.response - Decoded response.
|
|
938
|
-
* @returns {void}
|
|
1351
|
+
* Runs save.
|
|
1352
|
+
* @returns {Promise<this>} - Saved model.
|
|
939
1353
|
*/
|
|
940
|
-
|
|
941
|
-
commandType: FrontendModelRequestCommandType;
|
|
942
|
-
response: Record<string, unknown>;
|
|
943
|
-
}): void;
|
|
1354
|
+
save(): Promise<this>;
|
|
944
1355
|
/**
|
|
945
|
-
*
|
|
946
|
-
*
|
|
947
|
-
*
|
|
1356
|
+
* Returns the subset of `_attributes` whose value has diverged from
|
|
1357
|
+
* `_persistedAttributes`. Used by `save()` so the server receives only the
|
|
1358
|
+
* fields the caller actually changed — avoiding strict permit rejections on
|
|
1359
|
+
* framework-managed fields like `id`, `createdAt`, `updatedAt`, or owner
|
|
1360
|
+
* foreign keys that the resource never lists in `permittedParams`.
|
|
1361
|
+
* @returns {Record<string, FrontendModelAttributeValue>} - Changed attributes hash.
|
|
948
1362
|
*/
|
|
949
|
-
|
|
950
|
-
/**
|
|
951
|
-
* Runs constructor.
|
|
952
|
-
* @param {Attributes | CreateAttributes} [attributes] - Initial attributes.
|
|
953
|
-
*/
|
|
954
|
-
constructor(attributes?: Attributes | CreateAttributes);
|
|
955
|
-
/**
|
|
956
|
-
* Narrows the runtime value to the documented type.
|
|
957
|
-
* @type {Record<string, FrontendModelAttributeValue>} */
|
|
958
|
-
_attributes: Record<string, FrontendModelAttributeValue>;
|
|
959
|
-
/**
|
|
960
|
-
* Narrows the runtime value to the documented type.
|
|
961
|
-
* @type {Record<string, FrontendModelHasManyRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>> | FrontendModelSingularRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>>>} */
|
|
962
|
-
_relationships: Record<string, FrontendModelHasManyRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>> | FrontendModelSingularRelationship<FrontendModelBase, FrontendModelBase, Record<string, FrontendModelAttributeValue>>>;
|
|
963
|
-
/**
|
|
964
|
-
* Narrows the runtime value to the documented type.
|
|
965
|
-
* @type {Record<string, FrontendModelAttachmentHandle>} */
|
|
966
|
-
_attachments: Record<string, FrontendModelAttachmentHandle>;
|
|
967
|
-
/**
|
|
968
|
-
* Rails-style nested attribute payloads queued for the next save.
|
|
969
|
-
* @type {Record<string, ?>}
|
|
970
|
-
*/
|
|
971
|
-
_pendingNestedAttributes: Record<string, unknown>;
|
|
972
|
-
/**
|
|
973
|
-
* Narrows the runtime value to the documented type.
|
|
974
|
-
* @type {Set<string> | null} */
|
|
975
|
-
_selectedAttributes: Set<string> | null;
|
|
976
|
-
/**
|
|
977
|
-
* Narrows the runtime value to the documented type.
|
|
978
|
-
* @type {boolean} */
|
|
979
|
-
_isNewRecord: boolean;
|
|
980
|
-
/**
|
|
981
|
-
* Narrows the runtime value to the documented type.
|
|
982
|
-
* @type {boolean} */
|
|
983
|
-
_markedForDestruction: boolean;
|
|
984
|
-
/**
|
|
985
|
-
* Narrows the runtime value to the documented type.
|
|
986
|
-
* @type {Record<string, FrontendModelAttributeValue>} */
|
|
987
|
-
_persistedAttributes: Record<string, FrontendModelAttributeValue>;
|
|
988
|
-
/**
|
|
989
|
-
* Narrows the runtime value to the documented type.
|
|
990
|
-
* @type {Array<FrontendModelBase> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-batch-preload.
|
|
991
|
-
*/
|
|
992
|
-
_loadCohort: Array<FrontendModelBase> | undefined;
|
|
993
|
-
/**
|
|
994
|
-
* Runs attributes.
|
|
995
|
-
* @returns {Attributes} - Attributes hash.
|
|
996
|
-
*/
|
|
997
|
-
attributes(): Attributes;
|
|
998
|
-
/**
|
|
999
|
-
* Runs is new record.
|
|
1000
|
-
* @returns {boolean} - Whether this model has not yet been persisted.
|
|
1001
|
-
*/
|
|
1002
|
-
isNewRecord(): boolean;
|
|
1003
|
-
/**
|
|
1004
|
-
* Runs is persisted.
|
|
1005
|
-
* @returns {boolean} - Whether this model has been persisted.
|
|
1006
|
-
*/
|
|
1007
|
-
isPersisted(): boolean;
|
|
1008
|
-
/**
|
|
1009
|
-
* Runs set is new record.
|
|
1010
|
-
* @param {boolean} newIsNewRecord - New persisted-state flag.
|
|
1011
|
-
* @returns {void}
|
|
1012
|
-
*/
|
|
1013
|
-
setIsNewRecord(newIsNewRecord: boolean): void;
|
|
1014
|
-
/**
|
|
1015
|
-
* Marks this record for destruction when its parent is next saved through
|
|
1016
|
-
* nested-attribute support. The record is not removed from the parent's
|
|
1017
|
-
* relationship collection until the server confirms the delete.
|
|
1018
|
-
* @returns {void} - No return value.
|
|
1019
|
-
*/
|
|
1020
|
-
markForDestruction(): void;
|
|
1021
|
-
/**
|
|
1022
|
-
* Runs marked for destruction.
|
|
1023
|
-
* @returns {boolean} - Whether this record is queued for nested destruction on next parent save.
|
|
1024
|
-
*/
|
|
1025
|
-
markedForDestruction(): boolean;
|
|
1026
|
-
/**
|
|
1027
|
-
* Runs changes.
|
|
1028
|
-
* @returns {Record<string, Array<?>>} - Changed attributes as `[oldValue, newValue]`.
|
|
1029
|
-
*/
|
|
1030
|
-
changes(): Record<string, Array<unknown>>;
|
|
1031
|
-
/**
|
|
1032
|
-
* Runs is changed.
|
|
1033
|
-
* @returns {boolean} - Whether any tracked attribute has changed.
|
|
1034
|
-
*/
|
|
1035
|
-
isChanged(): boolean;
|
|
1036
|
-
/**
|
|
1037
|
-
* Runs get relationship by name.
|
|
1038
|
-
* @param {string} relationshipName - Relationship name.
|
|
1039
|
-
* @returns {FrontendModelRelationship} - Relationship state object.
|
|
1040
|
-
*/
|
|
1041
|
-
getRelationshipByName(relationshipName: string): FrontendModelRelationship;
|
|
1042
|
-
/**
|
|
1043
|
-
* Runs get attachment by name.
|
|
1044
|
-
* @param {string} attachmentName - Attachment name.
|
|
1045
|
-
* @returns {FrontendModelAttachmentHandle} - Attachment helper.
|
|
1046
|
-
*/
|
|
1047
|
-
getAttachmentByName(attachmentName: string): FrontendModelAttachmentHandle;
|
|
1048
|
-
/**
|
|
1049
|
-
* Runs load relationship.
|
|
1050
|
-
* @param {string} relationshipName - Relationship name.
|
|
1051
|
-
* @returns {Promise<FrontendModelBase | Array<FrontendModelBase> | null>} - Loaded relationship value.
|
|
1052
|
-
*/
|
|
1053
|
-
loadRelationship(relationshipName: string): Promise<FrontendModelBase | Array<FrontendModelBase> | null>;
|
|
1054
|
-
/**
|
|
1055
|
-
* Preloads relationship(s) onto this already-loaded record. Accepts either a
|
|
1056
|
-
* query built via `Model.preload(...).select(...)` or a raw preload spec
|
|
1057
|
-
* (string / array / nested object). Relationships already preloaded with the
|
|
1058
|
-
* required columns present are left untouched unless `force` is set. Carries
|
|
1059
|
-
* the query's preload graph, select, selectsExtra, withCount, abilities, and
|
|
1060
|
-
* queryData when re-fetching.
|
|
1061
|
-
* @param {import("./query.js").default<FrontendModelClass> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
|
|
1062
|
-
* @param {{force?: boolean}} [options] - Options.
|
|
1063
|
-
* @returns {Promise<void>} - Resolves when preloading completes.
|
|
1064
|
-
*/
|
|
1065
|
-
preload(queryOrSpec: import("./query.js").default<FrontendModelClass> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>, options?: {
|
|
1066
|
-
force?: boolean;
|
|
1067
|
-
}): Promise<void>;
|
|
1068
|
-
/**
|
|
1069
|
-
* Runs relationship or load.
|
|
1070
|
-
* @param {string} relationshipName - Relationship name.
|
|
1071
|
-
* @returns {Promise<FrontendModelBase | Array<FrontendModelBase> | null>} - Loaded relationship value.
|
|
1072
|
-
*/
|
|
1073
|
-
relationshipOrLoad(relationshipName: string): Promise<FrontendModelBase | Array<FrontendModelBase> | null>;
|
|
1074
|
-
/**
|
|
1075
|
-
* Attempts to batch-load `relationshipName` across cohort siblings via a
|
|
1076
|
-
* single `preload([name]).where({pk: [ids]}).toArray()` request, then copies
|
|
1077
|
-
* the preloaded relationship state onto each sibling. Returns true when a
|
|
1078
|
-
* batch ran, false when autoload is off, there is no cohort, or no batch
|
|
1079
|
-
* candidates remain. Siblings whose relationship state is already set
|
|
1080
|
-
* (preloaded or locally manipulated via `build` / `setRelationship`) are
|
|
1081
|
-
* skipped so their cached/edited value is preserved.
|
|
1082
|
-
* @param {string} relationshipName - Relationship name.
|
|
1083
|
-
* @returns {Promise<boolean>} - Whether a cohort batch preload ran.
|
|
1084
|
-
*/
|
|
1085
|
-
_tryCohortPreload(relationshipName: string): Promise<boolean>;
|
|
1086
|
-
/**
|
|
1087
|
-
* Runs set relationship.
|
|
1088
|
-
* @param {string} relationshipName - Relationship name.
|
|
1089
|
-
* @param {FrontendModelBase | null | undefined} relationshipValue - Relationship value.
|
|
1090
|
-
* @returns {FrontendModelBase | null | undefined} - Assigned relationship value.
|
|
1091
|
-
*/
|
|
1092
|
-
setRelationship(relationshipName: string, relationshipValue: FrontendModelBase | null | undefined): FrontendModelBase | null | undefined;
|
|
1093
|
-
/**
|
|
1094
|
-
* Runs assign attributes.
|
|
1095
|
-
* @param {Attributes | CreateAttributes | UpdateAttributes | Record<string, FrontendModelAttributeValue>} attributes - Attributes to assign.
|
|
1096
|
-
* @returns {void} - No return value.
|
|
1097
|
-
*/
|
|
1098
|
-
assignAttributes(attributes: Attributes | CreateAttributes | UpdateAttributes | Record<string, FrontendModelAttributeValue>): void;
|
|
1099
|
-
/**
|
|
1100
|
-
* Runs clear relationship cache.
|
|
1101
|
-
* @returns {void} - Clears cached relationship state.
|
|
1102
|
-
*/
|
|
1103
|
-
clearRelationshipCache(): void;
|
|
1104
|
-
/**
|
|
1105
|
-
* Runs primary key value.
|
|
1106
|
-
* @returns {number | string} - Primary key value.
|
|
1107
|
-
*/
|
|
1108
|
-
primaryKeyValue(): number | string;
|
|
1109
|
-
/**
|
|
1110
|
-
* Runs read attribute.
|
|
1111
|
-
* @param {string} attributeName - Attribute name.
|
|
1112
|
-
* @returns {?} - Attribute value.
|
|
1113
|
-
*/
|
|
1114
|
-
readAttribute(attributeName: string): unknown;
|
|
1115
|
-
/**
|
|
1116
|
-
* Whether an attribute value is currently loaded on this record. Used by the
|
|
1117
|
-
* preloader to decide whether a relationship can be skipped because the
|
|
1118
|
-
* requested columns are already present.
|
|
1119
|
-
* @param {string} attributeName - Attribute name.
|
|
1120
|
-
* @returns {boolean} - Whether the attribute is loaded.
|
|
1121
|
-
*/
|
|
1122
|
-
hasLoadedAttribute(attributeName: string): boolean;
|
|
1123
|
-
/**
|
|
1124
|
-
* Read an association count attached by `.withCount(...)`. Counts
|
|
1125
|
-
* live on a dedicated map separate from the record's attributes so
|
|
1126
|
-
* a virtual count like `tasksCount` can't silently shadow a real
|
|
1127
|
-
* column of the same name. Returns the attached value, or 0 when
|
|
1128
|
-
* `.withCount(...)` wasn't requested for this attribute.
|
|
1129
|
-
* @param {string} attributeName - Attribute name, e.g. `"tasksCount"` or a custom name from `.withCount({customName: {...}})`.
|
|
1130
|
-
* @returns {number} - Attached association count, or zero when absent.
|
|
1131
|
-
*/
|
|
1132
|
-
readCount(attributeName: string): number;
|
|
1133
|
-
/**
|
|
1134
|
-
* Internal setter called by `instantiateFromResponse` when hydrating
|
|
1135
|
-
* association counts that rode along with the record payload.
|
|
1136
|
-
* @param {string} attributeName - Attribute name.
|
|
1137
|
-
* @param {number} value - Count value.
|
|
1138
|
-
* @returns {void}
|
|
1139
|
-
*/
|
|
1140
|
-
_setAssociationCount(attributeName: string, value: number): void;
|
|
1141
|
-
/**
|
|
1142
|
-
* Read a per-record ability result attached by `.abilities(...)`. The
|
|
1143
|
-
* backend evaluates each requested action against the current
|
|
1144
|
-
* ability for this record instance and ships the result alongside
|
|
1145
|
-
* the record's attributes. Returns `false` when the action wasn't
|
|
1146
|
-
* requested (or the ability denied it), so UI code can safely branch
|
|
1147
|
-
* on `record.can("update")` without first checking whether the
|
|
1148
|
-
* ability was loaded.
|
|
1149
|
-
* @param {string} action - Ability action name, e.g. `"update"`.
|
|
1150
|
-
* @returns {boolean} - Whether the requested ability is allowed.
|
|
1151
|
-
*/
|
|
1152
|
-
can(action: string): boolean;
|
|
1153
|
-
/**
|
|
1154
|
-
* Internal setter called by `instantiateFromResponse` when hydrating
|
|
1155
|
-
* per-record ability results that rode along with the record
|
|
1156
|
-
* payload.
|
|
1157
|
-
* @param {string} action - Ability action name.
|
|
1158
|
-
* @param {boolean} value - Whether the current ability permits the action on this record.
|
|
1159
|
-
* @returns {void}
|
|
1160
|
-
*/
|
|
1161
|
-
_setComputedAbility(action: string, value: boolean): void;
|
|
1162
|
-
/**
|
|
1163
|
-
* Read a consumer-defined value attached by `.queryData(...)`. Stored
|
|
1164
|
-
* on a dedicated map rather than `_attributes`, so a virtual alias
|
|
1165
|
-
* like `tasksCount` cannot silently shadow a real column of the same
|
|
1166
|
-
* name. Returns `null` when no registered fn produced that alias for
|
|
1167
|
-
* this record (e.g. no child rows matched the aggregate).
|
|
1168
|
-
* @param {string} name - queryData alias name.
|
|
1169
|
-
* @returns {?} - Attached query-data value.
|
|
1170
|
-
*/
|
|
1171
|
-
queryData(name: string): unknown;
|
|
1172
|
-
/**
|
|
1173
|
-
* Internal setter used by `instantiateFromResponse` when hydrating
|
|
1174
|
-
* queryData values that rode along with the record payload.
|
|
1175
|
-
* @param {string} name - queryData alias name.
|
|
1176
|
-
* @param {?} value - Attached value.
|
|
1177
|
-
* @returns {void}
|
|
1178
|
-
*/
|
|
1179
|
-
_setQueryData(name: string, value: unknown): void;
|
|
1180
|
-
/**
|
|
1181
|
-
* Runs set attribute.
|
|
1182
|
-
* @param {string} attributeName - Attribute name.
|
|
1183
|
-
* @param {?} newValue - New value.
|
|
1184
|
-
* @returns {?} - Assigned value.
|
|
1185
|
-
*/
|
|
1186
|
-
setAttribute(attributeName: string, newValue: unknown): unknown;
|
|
1187
|
-
/**
|
|
1188
|
-
* Invalidates any cached belongsTo relationship whose foreign key matches the
|
|
1189
|
-
* changed attribute. HasMany / hasOne relationships are left untouched because
|
|
1190
|
-
* their foreign key lives on the child, not on this model, and blanket-clearing
|
|
1191
|
-
* them would destroy nested-save state and preloaded children the caller never
|
|
1192
|
-
* asked to invalidate.
|
|
1193
|
-
*
|
|
1194
|
-
* Foreign keys are inferred when not declared: for belongsTo `projectId` is
|
|
1195
|
-
* inferred from relationship name `project`. Explicit `foreignKey` on the
|
|
1196
|
-
* relationship definition takes precedence.
|
|
1197
|
-
* @param {string} attributeName - Attribute name that changed.
|
|
1198
|
-
* @returns {void}
|
|
1199
|
-
*/
|
|
1200
|
-
_invalidateRelationshipsForAttribute(attributeName: string): void;
|
|
1201
|
-
/**
|
|
1202
|
-
* Instance-level hook fired when THIS record is updated. The
|
|
1203
|
-
* instance's attributes are auto-merged with the broadcast payload
|
|
1204
|
-
* before the callback runs, so callers can read fresh values via
|
|
1205
|
-
* `this.someAttr()` without re-fetching.
|
|
1206
|
-
* @param {(payload: {id: string, model: FrontendModelBase}) => void} callback - Event callback.
|
|
1207
|
-
* @param {import("./query.js").FrontendModelEventOptions} [options] - Event query or record projection options.
|
|
1208
|
-
* @returns {Promise<() => void>} - Unsubscribe callback.
|
|
1209
|
-
*/
|
|
1210
|
-
onUpdate(callback: (payload: {
|
|
1211
|
-
id: string;
|
|
1212
|
-
model: FrontendModelBase;
|
|
1213
|
-
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
1214
|
-
/**
|
|
1215
|
-
* Instance-level hook fired when THIS record is destroyed.
|
|
1216
|
-
* @param {(payload: {id: string}) => void} callback - Event callback.
|
|
1217
|
-
* @param {import("./query.js").FrontendModelEventOptions} [options] - Accepted for API symmetry; destroy events carry ids only.
|
|
1218
|
-
* @returns {Promise<() => void>} - Unsubscribe callback.
|
|
1219
|
-
*/
|
|
1220
|
-
onDestroy(callback: (payload: {
|
|
1221
|
-
id: string;
|
|
1222
|
-
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
1223
|
-
/**
|
|
1224
|
-
* Runs update.
|
|
1225
|
-
* @param {UpdateAttributes} [newAttributes] - New values to assign before update.
|
|
1226
|
-
* @returns {Promise<this>} - Updated model.
|
|
1227
|
-
*/
|
|
1228
|
-
update(newAttributes?: UpdateAttributes): Promise<this>;
|
|
1229
|
-
/**
|
|
1230
|
-
* Runs attach.
|
|
1231
|
-
* @param {?} attachmentInput - Attachment input or named attachment payload.
|
|
1232
|
-
* @returns {Promise<void>} - Resolves when attached.
|
|
1233
|
-
*/
|
|
1234
|
-
attach(attachmentInput: unknown): Promise<void>;
|
|
1235
|
-
/**
|
|
1236
|
-
* Runs save.
|
|
1237
|
-
* @returns {Promise<this>} - Saved model.
|
|
1238
|
-
*/
|
|
1239
|
-
save(): Promise<this>;
|
|
1240
|
-
/**
|
|
1241
|
-
* Returns the subset of `_attributes` whose value has diverged from
|
|
1242
|
-
* `_persistedAttributes`. Used by `save()` so the server receives only the
|
|
1243
|
-
* fields the caller actually changed — avoiding strict permit rejections on
|
|
1244
|
-
* framework-managed fields like `id`, `createdAt`, `updatedAt`, or owner
|
|
1245
|
-
* foreign keys that the resource never lists in `permittedParams`.
|
|
1246
|
-
* @returns {Record<string, FrontendModelAttributeValue>} - Changed attributes hash.
|
|
1247
|
-
*/
|
|
1248
|
-
_changedAttributesForSave(): Record<string, FrontendModelAttributeValue>;
|
|
1363
|
+
_changedAttributesForSave(): Record<string, FrontendModelAttributeValue>;
|
|
1249
1364
|
/**
|
|
1250
1365
|
* Marks the current value for an attribute as already persisted so the next
|
|
1251
1366
|
* save does not send it unless the caller changes it again.
|
|
@@ -1260,9 +1375,9 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
1260
1375
|
destroy(): Promise<void>;
|
|
1261
1376
|
/**
|
|
1262
1377
|
* Builds the attachment payload queued on this model for the next save.
|
|
1263
|
-
* @returns {Promise<Record<string,
|
|
1378
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} Attachment payload keyed by attachment name.
|
|
1264
1379
|
*/
|
|
1265
|
-
_buildAttachmentsPayload(): Promise<Record<string,
|
|
1380
|
+
_buildAttachmentsPayload(): Promise<Record<string, ReturnType<typeof JSON.parse>>>;
|
|
1266
1381
|
/** Clears queued attachment inputs after a successful save. */
|
|
1267
1382
|
_clearPendingAttachments(): void;
|
|
1268
1383
|
/**
|
|
@@ -1277,57 +1392,94 @@ export default class FrontendModelBase<Attributes extends object = any, CreateAt
|
|
|
1277
1392
|
*
|
|
1278
1393
|
* Loaded but untouched records are omitted so nested save preserves Rails-style
|
|
1279
1394
|
* "children not referenced in payload are left alone" semantics.
|
|
1280
|
-
* @returns {Promise<Record<string, Array<Record<string,
|
|
1395
|
+
* @returns {Promise<Record<string, Array<Record<string, ReturnType<typeof JSON.parse>>>>>} - Per-relationship list of nested-attribute entries.
|
|
1281
1396
|
*/
|
|
1282
|
-
_buildNestedAttributesPayload(): Promise<Record<string, Array<Record<string,
|
|
1397
|
+
_buildNestedAttributesPayload(): Promise<Record<string, Array<Record<string, ReturnType<typeof JSON.parse>>>>>;
|
|
1283
1398
|
/**
|
|
1284
1399
|
* Builds the payload entry for this child when walked by a parent's
|
|
1285
1400
|
* `_buildNestedAttributesPayload`. Returns `null` when the child has no
|
|
1286
1401
|
* dirty state and no dirty descendants, so the parent can omit it.
|
|
1287
|
-
* @returns {Promise<Record<string,
|
|
1402
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>> | null>} - Nested-attribute entry or null if clean.
|
|
1288
1403
|
*/
|
|
1289
|
-
_nestedAttributesEntryForParentSave(): Promise<Record<string,
|
|
1404
|
+
_nestedAttributesEntryForParentSave(): Promise<Record<string, ReturnType<typeof JSON.parse>> | null>;
|
|
1290
1405
|
/**
|
|
1291
1406
|
* Builds nested entries from a Rails-style submitted `*Attributes` value.
|
|
1292
1407
|
* @param {FrontendModelClass} ModelClass - Parent model class.
|
|
1293
1408
|
* @param {string} relationshipName - Nested relationship name.
|
|
1294
|
-
* @param {
|
|
1295
|
-
* @returns {Promise<Array<Record<string,
|
|
1409
|
+
* @param {ReturnType<typeof JSON.parse>} value - Submitted nested attributes value.
|
|
1410
|
+
* @returns {Promise<Array<Record<string, ReturnType<typeof JSON.parse>>>>} Nested entries for the transport payload.
|
|
1296
1411
|
*/
|
|
1297
|
-
_nestedAttributesPayloadForSubmittedValue(ModelClass: FrontendModelClass, relationshipName: string, value:
|
|
1412
|
+
_nestedAttributesPayloadForSubmittedValue(ModelClass: FrontendModelClass, relationshipName: string, value: ReturnType<typeof JSON.parse>): Promise<Array<Record<string, ReturnType<typeof JSON.parse>>>>;
|
|
1298
1413
|
/**
|
|
1299
1414
|
* Converts one submitted Rails-style nested attributes object into transport payload shape.
|
|
1300
1415
|
* @param {FrontendModelClass} ModelClass - Nested child model class.
|
|
1301
|
-
* @param {
|
|
1302
|
-
* @returns {Promise<Record<string,
|
|
1416
|
+
* @param {ReturnType<typeof JSON.parse>} submittedEntry - Submitted nested attributes entry.
|
|
1417
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} Transport nested-attributes entry.
|
|
1303
1418
|
*/
|
|
1304
|
-
_nestedAttributesEntryPayloadForSubmittedValue(ModelClass: FrontendModelClass, submittedEntry:
|
|
1419
|
+
_nestedAttributesEntryPayloadForSubmittedValue(ModelClass: FrontendModelClass, submittedEntry: ReturnType<typeof JSON.parse>): Promise<Record<string, ReturnType<typeof JSON.parse>>>;
|
|
1305
1420
|
/**
|
|
1306
1421
|
* Normalizes a submitted attachment value for transport.
|
|
1307
1422
|
* @param {FrontendModelClass} ModelClass - Model class owning the attachment.
|
|
1308
1423
|
* @param {string} attachmentName - Attachment name.
|
|
1309
|
-
* @param {
|
|
1310
|
-
* @returns {Promise<Record<string,
|
|
1424
|
+
* @param {ReturnType<typeof JSON.parse>} value - Submitted attachment value.
|
|
1425
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>> | Record<string, ReturnType<typeof JSON.parse>>[]>} Normalized attachment payload.
|
|
1311
1426
|
*/
|
|
1312
|
-
_attachmentPayloadForSubmittedValue(ModelClass: FrontendModelClass, attachmentName: string, value:
|
|
1427
|
+
_attachmentPayloadForSubmittedValue(ModelClass: FrontendModelClass, attachmentName: string, value: ReturnType<typeof JSON.parse>): Promise<Record<string, ReturnType<typeof JSON.parse>> | Record<string, ReturnType<typeof JSON.parse>>[]>;
|
|
1313
1428
|
/**
|
|
1314
1429
|
* After a parent save with `nestedAttributes`, the server response includes
|
|
1315
1430
|
* preloaded versions of the affected relationships. This replaces the local
|
|
1316
1431
|
* `_loadedValue` for each nested-writable relationship with the server's
|
|
1317
1432
|
* authoritative set, so destroyed children are dropped and newly-created
|
|
1318
1433
|
* children get their server-assigned ids + persisted state.
|
|
1319
|
-
* @param {Record<string,
|
|
1434
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} response - Command response payload.
|
|
1320
1435
|
* @returns {void}
|
|
1321
1436
|
*/
|
|
1322
|
-
_reconcileNestedAttributesFromResponse(response: Record<string,
|
|
1437
|
+
_reconcileNestedAttributesFromResponse(response: Record<string, ReturnType<typeof JSON.parse>>): void;
|
|
1438
|
+
/**
|
|
1439
|
+
* Runs execute command.
|
|
1440
|
+
* @this {FrontendModelClass}
|
|
1441
|
+
* @param {FrontendModelCommandType} commandType - Command type.
|
|
1442
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} payload - Command payload.
|
|
1443
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} - Parsed JSON response.
|
|
1444
|
+
*/
|
|
1445
|
+
static executeCommand(this: FrontendModelClass, commandType: FrontendModelCommandType, payload: Record<string, ReturnType<typeof JSON.parse>>): Promise<Record<string, ReturnType<typeof JSON.parse>>>;
|
|
1446
|
+
/**
|
|
1447
|
+
* Runs execute custom command.
|
|
1448
|
+
* @this {FrontendModelClass}
|
|
1449
|
+
* @param {{commandName: string, commandType: FrontendModelRequestCommandType, memberId?: string | number | null, payload: Record<string, ReturnType<typeof JSON.parse>>, resourcePath: string}} args - Command arguments.
|
|
1450
|
+
* @returns {Promise<Record<string, FrontendModelAttributeValue>>} - Decoded response payload.
|
|
1451
|
+
*/
|
|
1452
|
+
static executeCustomCommand(this: FrontendModelClass, args: {
|
|
1453
|
+
commandName: string;
|
|
1454
|
+
commandType: FrontendModelRequestCommandType;
|
|
1455
|
+
memberId?: string | number | null;
|
|
1456
|
+
payload: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1457
|
+
resourcePath: string;
|
|
1458
|
+
}): Promise<Record<string, FrontendModelAttributeValue>>;
|
|
1459
|
+
/**
|
|
1460
|
+
* Runs throw on error frontend model response.
|
|
1461
|
+
* @this {FrontendModelClass}
|
|
1462
|
+
* @param {{commandType: FrontendModelRequestCommandType, response: Record<string, ReturnType<typeof JSON.parse>>}} args - Arguments.
|
|
1463
|
+
* @returns {void}
|
|
1464
|
+
*/
|
|
1465
|
+
static throwOnErrorFrontendModelResponse(this: FrontendModelClass, args: {
|
|
1466
|
+
commandType: FrontendModelRequestCommandType;
|
|
1467
|
+
response: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1468
|
+
}): void;
|
|
1469
|
+
/**
|
|
1470
|
+
* Runs configured frontend model attribute names.
|
|
1471
|
+
* @this {FrontendModelClass}
|
|
1472
|
+
* @returns {Set<string>} - Configured frontend model attribute names.
|
|
1473
|
+
*/
|
|
1474
|
+
static configuredFrontendModelAttributeNames(this: FrontendModelClass): Set<string>;
|
|
1323
1475
|
}
|
|
1324
1476
|
/** Public frontend model for safe Velocious attachment metadata. */
|
|
1325
|
-
export class VelociousAttachment extends FrontendModelBase
|
|
1477
|
+
export declare class VelociousAttachment extends FrontendModelBase {
|
|
1326
1478
|
/**
|
|
1327
|
-
* Runs
|
|
1328
|
-
* @
|
|
1479
|
+
* Runs resource config.
|
|
1480
|
+
* @returns {FrontendModelResourceConfig} - Resource config.
|
|
1329
1481
|
*/
|
|
1330
|
-
|
|
1482
|
+
static resourceConfig(): FrontendModelResourceConfig;
|
|
1331
1483
|
/**
|
|
1332
1484
|
* Returns the attachment id.
|
|
1333
1485
|
* @returns {string} - Attachment id.
|
|
@@ -1379,250 +1531,4 @@ export class VelociousAttachment extends FrontendModelBase<any, any, any> {
|
|
|
1379
1531
|
*/
|
|
1380
1532
|
updatedAt(): Date;
|
|
1381
1533
|
}
|
|
1382
|
-
/**
|
|
1383
|
-
* Frontend model relationship helper type. Returned by `getRelationshipByName`,
|
|
1384
|
-
* which generated models immediately cast to their concrete relationship type
|
|
1385
|
-
* (e.g. `FrontendModelSingularRelationship<Owner, Target, TargetCreateAttributes>`).
|
|
1386
|
-
* The members use `any` type args so that cast is allowed regardless of the
|
|
1387
|
-
* target model's typed-attribute generics — a concrete `FrontendModelBase` member
|
|
1388
|
-
* here makes the cast a non-overlapping (TS2352) error for every typed model.
|
|
1389
|
-
*/
|
|
1390
|
-
export type FrontendModelRelationship = FrontendModelHasManyRelationship<any, any, any> | FrontendModelSingularRelationship<any, any, any>;
|
|
1391
|
-
/**
|
|
1392
|
-
* Defines this typedef.
|
|
1393
|
-
*/
|
|
1394
|
-
export type FrontendModelModelEventCallbackEntry = {
|
|
1395
|
-
callback: (payload: {
|
|
1396
|
-
id: string;
|
|
1397
|
-
model: FrontendModelBase;
|
|
1398
|
-
}) => void;
|
|
1399
|
-
eventFilterKey: string | null;
|
|
1400
|
-
eventFilterPayload: import("./query.js").FrontendModelEventFilterPayload | null;
|
|
1401
|
-
projectionPayload: import("./query.js").FrontendModelProjectionPayload;
|
|
1402
|
-
};
|
|
1403
|
-
/**
|
|
1404
|
-
* Defines this typedef.
|
|
1405
|
-
*/
|
|
1406
|
-
export type FrontendModelDestroyEventCallbackEntry = {
|
|
1407
|
-
callback: (payload: {
|
|
1408
|
-
id: string;
|
|
1409
|
-
}) => void;
|
|
1410
|
-
};
|
|
1411
|
-
/**
|
|
1412
|
-
* FrontendModelCommandType type.
|
|
1413
|
-
*/
|
|
1414
|
-
export type FrontendModelCommandType = "create" | "find" | "index" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url";
|
|
1415
|
-
/**
|
|
1416
|
-
* FrontendModelRequestCommandType type.
|
|
1417
|
-
*/
|
|
1418
|
-
export type FrontendModelRequestCommandType = FrontendModelCommandType | string;
|
|
1419
|
-
/**
|
|
1420
|
-
* Model-like instance value supported by frontend-model transport.
|
|
1421
|
-
*/
|
|
1422
|
-
export type FrontendModelTransportModelValue = {
|
|
1423
|
-
attributes: () => Record<string, unknown>;
|
|
1424
|
-
};
|
|
1425
|
-
/**
|
|
1426
|
-
* Special scalar values restored by frontend-model transport.
|
|
1427
|
-
*/
|
|
1428
|
-
export type FrontendModelTransportScalarValue = undefined | null | boolean | number | string | bigint | Date | FrontendModelTransportModelValue;
|
|
1429
|
-
/**
|
|
1430
|
-
* Plain object supported by frontend-model transport values.
|
|
1431
|
-
* Nested values are intentionally opaque because TypeScript rejects recursive
|
|
1432
|
-
* JSDoc typedefs for this transport value contract.
|
|
1433
|
-
*/
|
|
1434
|
-
export type FrontendModelTransportObject = Record<string, unknown>;
|
|
1435
|
-
/**
|
|
1436
|
-
* Value supported by frontend-model transport serialization and deserialization.
|
|
1437
|
-
*/
|
|
1438
|
-
export type FrontendModelTransportValue = FrontendModelTransportScalarValue | FrontendModelTransportObject | Array<unknown>;
|
|
1439
|
-
/**
|
|
1440
|
-
* Frontend model attribute value used when generated metadata cannot infer a narrower type.
|
|
1441
|
-
*/
|
|
1442
|
-
export type FrontendModelAttributeValue = FrontendModelTransportValue;
|
|
1443
|
-
/**
|
|
1444
|
-
* Defines this typedef.
|
|
1445
|
-
*/
|
|
1446
|
-
export type FrontendModelAttachmentDefinition = {
|
|
1447
|
-
type: "hasOne" | "hasMany";
|
|
1448
|
-
};
|
|
1449
|
-
/**
|
|
1450
|
-
* Defines frontend-model attribute metadata.
|
|
1451
|
-
*/
|
|
1452
|
-
export type FrontendModelAttributeDefinition = {
|
|
1453
|
-
columnType?: string;
|
|
1454
|
-
dataType?: string;
|
|
1455
|
-
jsDocType?: string;
|
|
1456
|
-
name?: string;
|
|
1457
|
-
null?: boolean;
|
|
1458
|
-
selectedByDefault?: boolean;
|
|
1459
|
-
sqlType?: string;
|
|
1460
|
-
type?: string;
|
|
1461
|
-
};
|
|
1462
|
-
/**
|
|
1463
|
-
* Attachment input accepted by frontend-model attachment helpers before normalization.
|
|
1464
|
-
*/
|
|
1465
|
-
export type FrontendModelAttachmentInput = Record<string, unknown> | {
|
|
1466
|
-
arrayBuffer: () => Promise<ArrayBuffer>;
|
|
1467
|
-
type?: string;
|
|
1468
|
-
name?: string;
|
|
1469
|
-
} | null | undefined;
|
|
1470
|
-
/**
|
|
1471
|
-
* Defines this typedef.
|
|
1472
|
-
*/
|
|
1473
|
-
export type FrontendModelSyncMetadata = Record<string, FrontendModelTransportValue>;
|
|
1474
|
-
/**
|
|
1475
|
-
* Defines this typedef.
|
|
1476
|
-
*/
|
|
1477
|
-
export type FrontendModelSyncConflictStrategy = "optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly";
|
|
1478
|
-
/**
|
|
1479
|
-
* Defines this typedef.
|
|
1480
|
-
*/
|
|
1481
|
-
export type FrontendModelSyncConfig = {
|
|
1482
|
-
enabled: boolean;
|
|
1483
|
-
operations: string[];
|
|
1484
|
-
policyHash: string;
|
|
1485
|
-
policyVersion: string | null;
|
|
1486
|
-
conflictStrategy?: FrontendModelSyncConflictStrategy;
|
|
1487
|
-
metadata?: FrontendModelSyncMetadata;
|
|
1488
|
-
};
|
|
1489
|
-
/**
|
|
1490
|
-
* Defines this typedef.
|
|
1491
|
-
*/
|
|
1492
|
-
export type FrontendModelResourceConfig = {
|
|
1493
|
-
attributes?: Array<string | FrontendModelAttributeDefinition> | Record<string, FrontendModelAttributeDefinition>;
|
|
1494
|
-
builtInCollectionCommands?: string[];
|
|
1495
|
-
builtInMemberCommands?: string[];
|
|
1496
|
-
collectionCommands?: string[];
|
|
1497
|
-
commands?: string[];
|
|
1498
|
-
memberCommands?: string[];
|
|
1499
|
-
attachments?: Record<string, FrontendModelAttachmentDefinition>;
|
|
1500
|
-
modelName?: string;
|
|
1501
|
-
nestedAttributes?: Record<string, {
|
|
1502
|
-
allowDestroy?: boolean;
|
|
1503
|
-
limit?: number;
|
|
1504
|
-
}>;
|
|
1505
|
-
primaryKey?: string;
|
|
1506
|
-
relationships?: string[];
|
|
1507
|
-
sync?: FrontendModelSyncConfig;
|
|
1508
|
-
};
|
|
1509
|
-
/**
|
|
1510
|
-
* Frontend model constructor type.
|
|
1511
|
-
*/
|
|
1512
|
-
export type FrontendModelConstructor<T extends FrontendModelBase = FrontendModelBase<any, any, any>> = {
|
|
1513
|
-
new (attributes?: Record<string, FrontendModelAttributeValue>): T;
|
|
1514
|
-
};
|
|
1515
|
-
/**
|
|
1516
|
-
* Frontend model static side.
|
|
1517
|
-
*
|
|
1518
|
-
* The template defaults are intentionally permissive (`any` model/attribute
|
|
1519
|
-
* params). The bare `FrontendModelClass` is the `@this`/constraint type on the
|
|
1520
|
-
* static query methods (findBy/find/where/preload/...); a generated subclass
|
|
1521
|
-
* declares typed-attribute generics (e.g. `FrontendModelBase<AccountAttributes,
|
|
1522
|
-
* AccountCreateAttributes, AccountUpdateAttributes>`) which, against a concrete
|
|
1523
|
-
* `Record<string, FrontendModelTransportValue>` default, fail the constraint by
|
|
1524
|
-
* invariance. Defaulting to `any` lets any subclass satisfy the constraint while
|
|
1525
|
-
* the methods' own `@template T` still captures the precise calling class for
|
|
1526
|
-
* their return types.
|
|
1527
|
-
*/
|
|
1528
|
-
export type FrontendModelClass<T extends FrontendModelBase = FrontendModelBase<any, any, any>, Attributes extends object = any, CreateAttributes extends object = any> = {
|
|
1529
|
-
new (): T;
|
|
1530
|
-
create(attributes?: CreateAttributes): Promise<T>;
|
|
1531
|
-
} & Omit<typeof FrontendModelBase, "create" | "prototype">;
|
|
1532
|
-
/**
|
|
1533
|
-
* Create attributes accepted by a frontend model instance.
|
|
1534
|
-
*/
|
|
1535
|
-
export type FrontendModelCreateAttributesFor<T extends FrontendModelBase> = T extends FrontendModelBase<Record<string, FrontendModelAttributeValue>, infer CreateAttributes, infer _UpdateAttributes> ? CreateAttributes : Record<string, FrontendModelAttributeValue>;
|
|
1536
|
-
/**
|
|
1537
|
-
* Loaded instance type for relationship helper generics. Older generated
|
|
1538
|
-
* frontend models passed model classes into relationship helpers, while newer
|
|
1539
|
-
* generated models pass instance types.
|
|
1540
|
-
*/
|
|
1541
|
-
export type FrontendModelRelationshipModel<T extends FrontendModelBase<any, any, any> | typeof FrontendModelBase> = T extends typeof FrontendModelBase ? InstanceType<T> : T;
|
|
1542
|
-
/**
|
|
1543
|
-
* FrontendModelTransportConfig type.
|
|
1544
|
-
*/
|
|
1545
|
-
export type FrontendModelTransportConfig = {
|
|
1546
|
-
/**
|
|
1547
|
-
* - Optional frontend-model URL. This should be the shared endpoint (for example `"/frontend-models"` or `"https://example.com/frontend-models"`).
|
|
1548
|
-
*/
|
|
1549
|
-
url?: string | (() => string | undefined | null) | undefined;
|
|
1550
|
-
/**
|
|
1551
|
-
* - Deprecated shared-endpoint flag retained for compatibility. Frontend-model CRUD/custom commands use the shared frontend-model API envelope by default.
|
|
1552
|
-
*/
|
|
1553
|
-
shared?: boolean | undefined;
|
|
1554
|
-
/**
|
|
1555
|
-
* - Optional websocket URL. When set, Velocious creates and manages its own websocket client internally. Subscriptions use the websocket; CRUD uses HTTP and falls back gracefully. Example: `"ws://localhost:3006/websocket"`.
|
|
1556
|
-
*/
|
|
1557
|
-
websocketUrl?: string | (() => string | undefined | null) | undefined;
|
|
1558
|
-
/**
|
|
1559
|
-
* - Optional websocket client for shared frontend-model API requests and subscriptions. Its `post` receives the bounded-deadline `signal` and should forward it into the underlying transport so the deadline can abort the live request and its response-body read.
|
|
1560
|
-
*/
|
|
1561
|
-
websocketClient?: {
|
|
1562
|
-
post: (path: string, body?: unknown, options?: {
|
|
1563
|
-
headers?: Record<string, string>;
|
|
1564
|
-
signal?: AbortSignal;
|
|
1565
|
-
}) => Promise<{
|
|
1566
|
-
json: () => unknown;
|
|
1567
|
-
}>;
|
|
1568
|
-
subscribe: (channel: string, options: {
|
|
1569
|
-
params?: Record<string, unknown>;
|
|
1570
|
-
}, callback: (payload: unknown) => void) => (() => void);
|
|
1571
|
-
subscribeAndWait?: (channel: string, options: {
|
|
1572
|
-
params?: Record<string, unknown>;
|
|
1573
|
-
}, callback: (payload: unknown) => void) => Promise<(() => void)>;
|
|
1574
|
-
} | undefined;
|
|
1575
|
-
/**
|
|
1576
|
-
* - Extra HTTP/WS headers to attach to every frontend-model API request. Pass a function to compute them at request time (for example to include the current locale).
|
|
1577
|
-
*/
|
|
1578
|
-
requestHeaders?: Record<string, string> | (() => Record<string, string>) | undefined;
|
|
1579
|
-
/**
|
|
1580
|
-
* - Bounded deadline in milliseconds covering connection, response headers, and response-body consumption for each frontend-model API request. On expiry the live fetch/adapter request is aborted (built on awaitery's `timeout`) and awaitery's `TimeoutError` is thrown, so callers can classify a timeout via `error instanceof TimeoutError`. Pass a function to resolve it per request. Falsy/absent means no deadline.
|
|
1581
|
-
*/
|
|
1582
|
-
timeout?: number | (() => number | undefined | null) | undefined;
|
|
1583
|
-
/**
|
|
1584
|
-
* - Optional caller/session AbortSignal composed with the deadline. Aborting it cancels the live request (for example on session shutdown or offline transition); the resulting abort error stays distinguishable from a timeout. Pass a function to resolve the current signal per request.
|
|
1585
|
-
*/
|
|
1586
|
-
signal?: AbortSignal | (() => AbortSignal | undefined | null) | undefined;
|
|
1587
|
-
/**
|
|
1588
|
-
* - Optional sessionId persistence hook forwarded to the internal `VelociousWebsocketClient` so WS sessions can be resumed across page reloads / app restarts.
|
|
1589
|
-
*/
|
|
1590
|
-
sessionStore?: {
|
|
1591
|
-
get: () => string | null | undefined | Promise<string | null | undefined>;
|
|
1592
|
-
set: (sessionId: string) => void | Promise<void>;
|
|
1593
|
-
clear: () => void | Promise<void>;
|
|
1594
|
-
} | undefined;
|
|
1595
|
-
/**
|
|
1596
|
-
* - IANA timezone sent with every frontend-model API request for timezone-less datetime parsing.
|
|
1597
|
-
*/
|
|
1598
|
-
timeZone?: string | (() => string | null | undefined) | undefined;
|
|
1599
|
-
/**
|
|
1600
|
-
* - Offline mutation queue configuration.
|
|
1601
|
-
*/
|
|
1602
|
-
offlineSync?: {
|
|
1603
|
-
actorDeviceId: string;
|
|
1604
|
-
actorUserId: string;
|
|
1605
|
-
clientMutationId?: () => string;
|
|
1606
|
-
enabled?: boolean;
|
|
1607
|
-
mutationLog: import("../sync/local-mutation-log.js").default;
|
|
1608
|
-
now?: () => Date;
|
|
1609
|
-
offlineGrant: {
|
|
1610
|
-
id: string;
|
|
1611
|
-
};
|
|
1612
|
-
} | undefined;
|
|
1613
|
-
};
|
|
1614
|
-
/**
|
|
1615
|
-
* FrontendModelIdleWaitArgs type.
|
|
1616
|
-
*/
|
|
1617
|
-
export type FrontendModelIdleWaitArgs = {
|
|
1618
|
-
/**
|
|
1619
|
-
* - Milliseconds the transport must stay idle before resolving.
|
|
1620
|
-
*/
|
|
1621
|
-
quietMs?: number | undefined;
|
|
1622
|
-
/**
|
|
1623
|
-
* - Timeout in milliseconds.
|
|
1624
|
-
*/
|
|
1625
|
-
timeout?: number | undefined;
|
|
1626
|
-
};
|
|
1627
|
-
import FrontendModelQuery from "./query.js";
|
|
1628
1534
|
//# sourceMappingURL=base.d.ts.map
|