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,6 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
|
|
3
|
+
import {randomUUID} from "node:crypto"
|
|
3
4
|
import * as inflection from "inflection"
|
|
4
5
|
import Controller from "./controller.js"
|
|
5
6
|
import FrontendModelBaseResource from "./frontend-model-resource/base-resource.js"
|
|
@@ -14,6 +15,7 @@ import {assignSafeProperty, deserializeFrontendModelTransportValue, isBackendMod
|
|
|
14
15
|
import {requestDetails} from "./error-reporting/request-details.js"
|
|
15
16
|
import RoutesResolver from "./routes/resolver.js"
|
|
16
17
|
import {ValidationError} from "./database/record/index.js"
|
|
18
|
+
import RecordNotFoundError from "./database/record/record-not-found-error.js"
|
|
17
19
|
import { normalizeDateStringForWrite } from "./database/datetime-storage.js"
|
|
18
20
|
import VelociousError from "./velocious-error.js"
|
|
19
21
|
import isDate from "./utils/is-date.js"
|
|
@@ -26,7 +28,7 @@ import {RansackQueryError, normalizeRansackGroup, parseRansackSort} from "./util
|
|
|
26
28
|
* @property {string[]} path - Relationship path.
|
|
27
29
|
* @property {string} column - Column or attribute name.
|
|
28
30
|
* @property {"eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq"} operator - Search operator.
|
|
29
|
-
* @property {
|
|
31
|
+
* @property {ReturnType<typeof JSON.parse>} value - Search value.
|
|
30
32
|
*/
|
|
31
33
|
/**
|
|
32
34
|
* FrontendModelSort type.
|
|
@@ -88,8 +90,8 @@ function normalizeFrontendModelPreload(preload) {
|
|
|
88
90
|
|
|
89
91
|
/**
|
|
90
92
|
* Runs normalize frontend model joins.
|
|
91
|
-
* @param {
|
|
92
|
-
* @returns {Record<string,
|
|
93
|
+
* @param {ReturnType<typeof JSON.parse>} joins - Joins payload.
|
|
94
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>> | null} - Normalized relationship-object joins.
|
|
93
95
|
*/
|
|
94
96
|
function normalizeFrontendModelJoins(joins) {
|
|
95
97
|
if (!joins) return null
|
|
@@ -103,7 +105,7 @@ function normalizeFrontendModelJoins(joins) {
|
|
|
103
105
|
|
|
104
106
|
/**
|
|
105
107
|
* Runs normalize frontend model select.
|
|
106
|
-
* @param {
|
|
108
|
+
* @param {ReturnType<typeof JSON.parse>} select - Select payload.
|
|
107
109
|
* @param {string | null} [rootModelName] - Optional root model name for shorthand payloads.
|
|
108
110
|
* @returns {Record<string, string[]> | null} - Normalized model-name keyed select record.
|
|
109
111
|
*/
|
|
@@ -202,7 +204,7 @@ function frontendModelQueryError(message) {
|
|
|
202
204
|
|
|
203
205
|
/**
|
|
204
206
|
* Throws a client-safe frontend-model query error for typed query parser errors.
|
|
205
|
-
* @param {
|
|
207
|
+
* @param {ReturnType<typeof JSON.parse>} error - Error raised while normalizing client query params.
|
|
206
208
|
* @returns {never} Always throws.
|
|
207
209
|
*/
|
|
208
210
|
function throwFrontendModelQueryErrorForParserError(error) {
|
|
@@ -231,31 +233,18 @@ function frontendModelErrorHasVelociousMetadata(error) {
|
|
|
231
233
|
return isPlainObject(errorRecord.velocious)
|
|
232
234
|
}
|
|
233
235
|
|
|
234
|
-
/**
|
|
235
|
-
* Whether the error has a frontend-model error type marker.
|
|
236
|
-
* @param {unknown} error - Caught error.
|
|
237
|
-
* @returns {boolean} Whether the error has an error type.
|
|
238
|
-
*/
|
|
239
|
-
function frontendModelErrorHasErrorType(error) {
|
|
240
|
-
if (!error || typeof error !== "object") return false
|
|
241
|
-
|
|
242
|
-
// Runtime checks above narrow this caught value to the marker record shape.
|
|
243
|
-
const errorRecord = /** @type {{errorType?: string}} */ (error)
|
|
244
|
-
|
|
245
|
-
return typeof errorRecord.errorType === "string" && errorRecord.errorType.length > 0
|
|
246
|
-
}
|
|
247
|
-
|
|
248
236
|
/**
|
|
249
237
|
* Whether the error is an expected frontend-model user-flow failure.
|
|
250
238
|
* @param {unknown} error - Caught error.
|
|
251
239
|
* @returns {boolean} Whether the error is expected.
|
|
252
240
|
*/
|
|
253
241
|
function frontendModelExpectedError(error) {
|
|
242
|
+
if (error instanceof RecordNotFoundError) return true
|
|
254
243
|
if (error instanceof ValidationError) return true
|
|
255
244
|
if (error instanceof VelociousError && error.safeToExpose) return true
|
|
256
245
|
if (frontendModelErrorHasVelociousMetadata(error)) return true
|
|
257
246
|
|
|
258
|
-
return
|
|
247
|
+
return false
|
|
259
248
|
}
|
|
260
249
|
|
|
261
250
|
/**
|
|
@@ -285,6 +274,10 @@ function frontendModelVelociousMetadataForError(error) {
|
|
|
285
274
|
* @returns {string} - Message safe to return to API clients.
|
|
286
275
|
*/
|
|
287
276
|
function frontendModelClientMessageForError(error) {
|
|
277
|
+
if (error instanceof RecordNotFoundError) {
|
|
278
|
+
return "Record not found."
|
|
279
|
+
}
|
|
280
|
+
|
|
288
281
|
if (error instanceof VelociousError && error.safeToExpose) {
|
|
289
282
|
return error.message
|
|
290
283
|
}
|
|
@@ -323,6 +316,10 @@ function frontendModelDebugPayloadForError({configuration, environment, error})
|
|
|
323
316
|
return {}
|
|
324
317
|
}
|
|
325
318
|
|
|
319
|
+
if (error instanceof RecordNotFoundError) {
|
|
320
|
+
return {}
|
|
321
|
+
}
|
|
322
|
+
|
|
326
323
|
if (frontendModelErrorHasVelociousMetadata(error)) {
|
|
327
324
|
return {}
|
|
328
325
|
}
|
|
@@ -346,7 +343,7 @@ function frontendModelDebugPayloadForError({configuration, environment, error})
|
|
|
346
343
|
|
|
347
344
|
/**
|
|
348
345
|
* Runs normalize frontend model searches.
|
|
349
|
-
* @param {
|
|
346
|
+
* @param {ReturnType<typeof JSON.parse>} searches - Search payload.
|
|
350
347
|
* @returns {FrontendModelSearch[]} - Normalized searches.
|
|
351
348
|
*/
|
|
352
349
|
function normalizeFrontendModelSearches(searches) {
|
|
@@ -409,8 +406,8 @@ function normalizeFrontendModelSearches(searches) {
|
|
|
409
406
|
|
|
410
407
|
/**
|
|
411
408
|
* Runs normalize frontend model where.
|
|
412
|
-
* @param {
|
|
413
|
-
* @returns {Record<string,
|
|
409
|
+
* @param {ReturnType<typeof JSON.parse>} where - Where payload.
|
|
410
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>> | null} - Normalized where hash.
|
|
414
411
|
*/
|
|
415
412
|
function normalizeFrontendModelWhere(where) {
|
|
416
413
|
if (!where) return null
|
|
@@ -424,8 +421,8 @@ function normalizeFrontendModelWhere(where) {
|
|
|
424
421
|
|
|
425
422
|
/**
|
|
426
423
|
* Runs normalize frontend model ransack.
|
|
427
|
-
* @param {
|
|
428
|
-
* @returns {Record<string,
|
|
424
|
+
* @param {ReturnType<typeof JSON.parse>} ransack - Ransack payload.
|
|
425
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>> | null} - Normalized Ransack hash.
|
|
429
426
|
*/
|
|
430
427
|
function normalizeFrontendModelRansack(ransack) {
|
|
431
428
|
if (!ransack) return null
|
|
@@ -439,7 +436,7 @@ function normalizeFrontendModelRansack(ransack) {
|
|
|
439
436
|
|
|
440
437
|
/**
|
|
441
438
|
* Runs normalize frontend model integer param.
|
|
442
|
-
* @param {
|
|
439
|
+
* @param {ReturnType<typeof JSON.parse>} value - Candidate integer.
|
|
443
440
|
* @param {string} name - Param name for errors.
|
|
444
441
|
* @param {number} min - Minimum allowed value.
|
|
445
442
|
* @returns {number | null} - Normalized integer.
|
|
@@ -461,10 +458,10 @@ function normalizeFrontendModelIntegerParam(value, name, min) {
|
|
|
461
458
|
/**
|
|
462
459
|
* Runs normalize frontend model pagination.
|
|
463
460
|
* @param {object} args - Pagination args.
|
|
464
|
-
* @param {
|
|
465
|
-
* @param {
|
|
466
|
-
* @param {
|
|
467
|
-
* @param {
|
|
461
|
+
* @param {ReturnType<typeof JSON.parse>} args.limit - Limit payload.
|
|
462
|
+
* @param {ReturnType<typeof JSON.parse>} args.offset - Offset payload.
|
|
463
|
+
* @param {ReturnType<typeof JSON.parse>} args.page - Page payload.
|
|
464
|
+
* @param {ReturnType<typeof JSON.parse>} args.perPage - Per-page payload.
|
|
468
465
|
* @returns {FrontendModelPagination} - Normalized pagination data.
|
|
469
466
|
*/
|
|
470
467
|
function normalizeFrontendModelPagination({limit, offset, page, perPage}) {
|
|
@@ -478,7 +475,7 @@ function normalizeFrontendModelPagination({limit, offset, page, perPage}) {
|
|
|
478
475
|
|
|
479
476
|
/**
|
|
480
477
|
* Runs normalize frontend model distinct.
|
|
481
|
-
* @param {
|
|
478
|
+
* @param {ReturnType<typeof JSON.parse>} distinct - Distinct payload.
|
|
482
479
|
* @returns {boolean | null} - Normalized distinct flag when provided.
|
|
483
480
|
*/
|
|
484
481
|
function normalizeFrontendModelDistinct(distinct) {
|
|
@@ -494,16 +491,16 @@ function normalizeFrontendModelDistinct(distinct) {
|
|
|
494
491
|
/**
|
|
495
492
|
* Runs build frontend model join object from path.
|
|
496
493
|
* @param {string[]} path - Relationship path.
|
|
497
|
-
* @returns {Record<string,
|
|
494
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Join object.
|
|
498
495
|
*/
|
|
499
496
|
function buildFrontendModelJoinObjectFromPath(path) {
|
|
500
497
|
/**
|
|
501
498
|
* Join object.
|
|
502
|
-
* @type {Record<string,
|
|
499
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
503
500
|
const joinObject = {}
|
|
504
501
|
/**
|
|
505
502
|
* Current node.
|
|
506
|
-
* @type {Record<string,
|
|
503
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
507
504
|
let currentNode = joinObject
|
|
508
505
|
|
|
509
506
|
for (const relationshipName of path) {
|
|
@@ -516,8 +513,8 @@ function buildFrontendModelJoinObjectFromPath(path) {
|
|
|
516
513
|
|
|
517
514
|
/**
|
|
518
515
|
* Build a successful single-model frontend-model response payload.
|
|
519
|
-
* @param {Record<string,
|
|
520
|
-
* @returns {{model: Record<string,
|
|
516
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} model - Serialized model payload.
|
|
517
|
+
* @returns {{model: Record<string, ReturnType<typeof JSON.parse>>, status: "success"}} - Success response payload.
|
|
521
518
|
*/
|
|
522
519
|
function frontendModelSerializedModelSuccess(model) {
|
|
523
520
|
return {model, status: "success"}
|
|
@@ -525,7 +522,7 @@ function frontendModelSerializedModelSuccess(model) {
|
|
|
525
522
|
|
|
526
523
|
/**
|
|
527
524
|
* Resolve and validate attachment params shared by attachment commands.
|
|
528
|
-
* @param {Record<string,
|
|
525
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Frontend-model request params.
|
|
529
526
|
* @returns {{attachmentId: string | undefined, attachmentName: string} | string} - Attachment params or validation error message.
|
|
530
527
|
*/
|
|
531
528
|
function frontendModelAttachmentParams(params) {
|
|
@@ -543,8 +540,8 @@ function frontendModelAttachmentParams(params) {
|
|
|
543
540
|
|
|
544
541
|
/**
|
|
545
542
|
* Extract mutation attributes shared by create and update commands.
|
|
546
|
-
* @param {Record<string,
|
|
547
|
-
* @returns {{attributes: Record<string,
|
|
543
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Frontend-model request params.
|
|
544
|
+
* @returns {{attributes: Record<string, ReturnType<typeof JSON.parse>>, attachments: Record<string, ReturnType<typeof JSON.parse>> | null, nestedAttributes: Record<string, ReturnType<typeof JSON.parse>> | null} | string} - Mutation attributes or validation error message.
|
|
548
545
|
*/
|
|
549
546
|
function frontendModelMutationAttributes(params) {
|
|
550
547
|
const attributes = params.attributes
|
|
@@ -553,9 +550,9 @@ function frontendModelMutationAttributes(params) {
|
|
|
553
550
|
return "Expected model attributes."
|
|
554
551
|
}
|
|
555
552
|
|
|
556
|
-
/** @type {Record<string,
|
|
553
|
+
/** @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
557
554
|
const regularAttributes = {}
|
|
558
|
-
/** @type {Record<string,
|
|
555
|
+
/** @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
559
556
|
const nestedAttributes = {}
|
|
560
557
|
|
|
561
558
|
for (const [attributeName, value] of Object.entries(attributes)) {
|
|
@@ -590,11 +587,11 @@ function frontendModelMutationAttributes(params) {
|
|
|
590
587
|
export default class FrontendModelController extends Controller {
|
|
591
588
|
/**
|
|
592
589
|
* Frontend model params.
|
|
593
|
-
* @type {Record<string,
|
|
590
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>> | undefined} */
|
|
594
591
|
_frontendModelParams = undefined
|
|
595
592
|
/**
|
|
596
593
|
* Frontend model params override.
|
|
597
|
-
* @type {Record<string,
|
|
594
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>> | undefined} */
|
|
598
595
|
_frontendModelParamsOverride = undefined
|
|
599
596
|
/**
|
|
600
597
|
* Frontend model ability override.
|
|
@@ -604,19 +601,19 @@ export default class FrontendModelController extends Controller {
|
|
|
604
601
|
* Original deserialized custom-command client payload, captured before route
|
|
605
602
|
* framework params are merged in, so a typed command method receives the client's
|
|
606
603
|
* own arguments rather than the route metadata. Only set on the shared-endpoint path.
|
|
607
|
-
* @type {Record<string,
|
|
604
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>> | undefined} */
|
|
608
605
|
_frontendModelCustomCommandClientArguments = undefined
|
|
609
606
|
|
|
610
607
|
/**
|
|
611
608
|
* Runs frontend model params.
|
|
612
|
-
* @returns {Record<string,
|
|
609
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Decoded request params.
|
|
613
610
|
*/
|
|
614
611
|
frontendModelParams() {
|
|
615
612
|
if (this._frontendModelParamsOverride) {
|
|
616
613
|
return this._frontendModelParamsOverride
|
|
617
614
|
}
|
|
618
615
|
|
|
619
|
-
this._frontendModelParams ||= /** @type {Record<string,
|
|
616
|
+
this._frontendModelParams ||= /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (deserializeFrontendModelTransportValue(this.params()))
|
|
620
617
|
|
|
621
618
|
return this._frontendModelParams
|
|
622
619
|
}
|
|
@@ -624,7 +621,7 @@ export default class FrontendModelController extends Controller {
|
|
|
624
621
|
/**
|
|
625
622
|
* Runs with frontend model params.
|
|
626
623
|
* @template T
|
|
627
|
-
* @param {Record<string,
|
|
624
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Temporary frontend model params.
|
|
628
625
|
* @param {() => Promise<T>} callback - Callback executed with temporary params.
|
|
629
626
|
* @returns {Promise<T>} - Callback return value.
|
|
630
627
|
*/
|
|
@@ -646,7 +643,7 @@ export default class FrontendModelController extends Controller {
|
|
|
646
643
|
/**
|
|
647
644
|
* Runs with frontend model request context.
|
|
648
645
|
* @template T
|
|
649
|
-
* @param {Record<string,
|
|
646
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Request-scoped params.
|
|
650
647
|
* @param {import("./http-server/client/response.js").default} response - Response instance.
|
|
651
648
|
* @param {() => Promise<T>} callback - Callback executed inside resolved tenant and ability context.
|
|
652
649
|
* @returns {Promise<T>} - Callback return value.
|
|
@@ -974,7 +971,7 @@ export default class FrontendModelController extends Controller {
|
|
|
974
971
|
/**
|
|
975
972
|
* Runs frontend model resource path.
|
|
976
973
|
* @param {string} modelName - Model class name.
|
|
977
|
-
* @param {
|
|
974
|
+
* @param {ReturnType<typeof JSON.parse>} resourceDefinition - Resource definition.
|
|
978
975
|
* @returns {string} - Normalized resource path.
|
|
979
976
|
*/
|
|
980
977
|
frontendModelResourcePath(modelName, resourceDefinition) {
|
|
@@ -1154,9 +1151,9 @@ export default class FrontendModelController extends Controller {
|
|
|
1154
1151
|
|
|
1155
1152
|
/**
|
|
1156
1153
|
* Runs frontend model create record.
|
|
1157
|
-
* @param {Record<string,
|
|
1158
|
-
* @param {Record<string,
|
|
1159
|
-
* @param {Record<string,
|
|
1154
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} attributes - Create attributes.
|
|
1155
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>> | null} [nestedAttributes] - Optional nested-attribute payload for cascading writes.
|
|
1156
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>> | null} [attachments] - Optional attachment payloads keyed by attachment name.
|
|
1160
1157
|
* @returns {Promise<import("./database/record/index.js").default | null>} - Created model when authorized.
|
|
1161
1158
|
*/
|
|
1162
1159
|
async frontendModelCreateRecord(attributes, nestedAttributes = null, attachments = null) {
|
|
@@ -1218,7 +1215,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1218
1215
|
|
|
1219
1216
|
/**
|
|
1220
1217
|
* Runs frontend model where.
|
|
1221
|
-
* @returns {Record<string,
|
|
1218
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>> | null} - Frontend where filters.
|
|
1222
1219
|
*/
|
|
1223
1220
|
frontendModelWhere() {
|
|
1224
1221
|
return normalizeFrontendModelWhere(this.frontendModelParams().where)
|
|
@@ -1226,7 +1223,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1226
1223
|
|
|
1227
1224
|
/**
|
|
1228
1225
|
* Runs frontend model ransack.
|
|
1229
|
-
* @returns {Record<string,
|
|
1226
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>> | null} - Frontend Ransack filters.
|
|
1230
1227
|
*/
|
|
1231
1228
|
frontendModelRansack() {
|
|
1232
1229
|
return normalizeFrontendModelRansack(this.frontendModelParams().ransack)
|
|
@@ -1234,7 +1231,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1234
1231
|
|
|
1235
1232
|
/**
|
|
1236
1233
|
* Runs frontend model joins.
|
|
1237
|
-
* @returns {Record<string,
|
|
1234
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>> | null} - Frontend joins descriptors.
|
|
1238
1235
|
*/
|
|
1239
1236
|
frontendModelJoins() {
|
|
1240
1237
|
return normalizeFrontendModelJoins(this.frontendModelParams().joins)
|
|
@@ -1313,7 +1310,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1313
1310
|
|
|
1314
1311
|
/**
|
|
1315
1312
|
* Runs frontend model with count.
|
|
1316
|
-
* @returns {Array<{attributeName: string, relationshipName: string, where?: Record<string,
|
|
1313
|
+
* @returns {Array<{attributeName: string, relationshipName: string, where?: Record<string, ReturnType<typeof JSON.parse>>}>}
|
|
1317
1314
|
* Frontend withCount entries. Empty array when not requested.
|
|
1318
1315
|
*/
|
|
1319
1316
|
frontendModelWithCount() {
|
|
@@ -1323,7 +1320,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1323
1320
|
|
|
1324
1321
|
/**
|
|
1325
1322
|
* Entries.
|
|
1326
|
-
* @type {Array<{attributeName: string, relationshipName: string, where?: Record<string,
|
|
1323
|
+
* @type {Array<{attributeName: string, relationshipName: string, where?: Record<string, ReturnType<typeof JSON.parse>>}>} */
|
|
1327
1324
|
const entries = []
|
|
1328
1325
|
|
|
1329
1326
|
for (const entry of raw) {
|
|
@@ -1505,7 +1502,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1505
1502
|
if (!Array.isArray(entry.actions)) continue
|
|
1506
1503
|
|
|
1507
1504
|
const actions = entry.actions.filter(
|
|
1508
|
-
(/** @type {
|
|
1505
|
+
(/** @type {ReturnType<typeof JSON.parse>} */ action) => typeof action === "string" && action.length > 0
|
|
1509
1506
|
)
|
|
1510
1507
|
|
|
1511
1508
|
if (actions.length === 0) continue
|
|
@@ -1610,7 +1607,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1610
1607
|
for (const entry of withCount) {
|
|
1611
1608
|
/**
|
|
1612
1609
|
* Spec.
|
|
1613
|
-
* @type {Record<string, boolean | {relationship?: string, where?: Record<string,
|
|
1610
|
+
* @type {Record<string, boolean | {relationship?: string, where?: Record<string, ReturnType<typeof JSON.parse>>}>} */
|
|
1614
1611
|
const spec = {}
|
|
1615
1612
|
spec[entry.attributeName] = {relationship: entry.relationshipName, where: entry.where}
|
|
1616
1613
|
query.withCount(spec)
|
|
@@ -1663,7 +1660,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1663
1660
|
* @param {object} args - Pluck args.
|
|
1664
1661
|
* @param {import("./database/query/model-class-query.js").default} args.query - Query instance.
|
|
1665
1662
|
* @param {FrontendModelPluck[]} args.pluck - Pluck descriptors.
|
|
1666
|
-
* @returns {Promise<Array
|
|
1663
|
+
* @returns {Promise<Array<ReturnType<typeof JSON.parse>>>} - Plucked values.
|
|
1667
1664
|
*/
|
|
1668
1665
|
async frontendModelPluckValues({query, pluck}) {
|
|
1669
1666
|
if (pluck.length < 1) {
|
|
@@ -1716,11 +1713,11 @@ export default class FrontendModelController extends Controller {
|
|
|
1716
1713
|
if (aliases.length === 1) {
|
|
1717
1714
|
const [alias] = aliases
|
|
1718
1715
|
|
|
1719
|
-
return rows.map((row) => /** @type {Record<string,
|
|
1716
|
+
return rows.map((row) => /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (row)[alias])
|
|
1720
1717
|
}
|
|
1721
1718
|
|
|
1722
1719
|
return rows.map((row) => {
|
|
1723
|
-
const rowHash = /** @type {Record<string,
|
|
1720
|
+
const rowHash = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (row)
|
|
1724
1721
|
|
|
1725
1722
|
return aliases.map((alias) => rowHash[alias])
|
|
1726
1723
|
})
|
|
@@ -1817,7 +1814,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1817
1814
|
|
|
1818
1815
|
/**
|
|
1819
1816
|
* Asserts frontend-model Ransack definitions only reference exposed resource attributes.
|
|
1820
|
-
* @param {Record<string,
|
|
1817
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} ransack - Ransack descriptor.
|
|
1821
1818
|
* @returns {void}
|
|
1822
1819
|
*/
|
|
1823
1820
|
assertFrontendModelRansackAllowed(ransack) {
|
|
@@ -1842,7 +1839,7 @@ export default class FrontendModelController extends Controller {
|
|
|
1842
1839
|
|
|
1843
1840
|
/**
|
|
1844
1841
|
* Runs normalized frontend-model Ransack group.
|
|
1845
|
-
* @param {Record<string,
|
|
1842
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} filterParams - Ransack filter params.
|
|
1846
1843
|
* @returns {import("./utils/ransack.js").RansackGroup} Normalized Ransack group.
|
|
1847
1844
|
*/
|
|
1848
1845
|
frontendModelRansackGroup(filterParams) {
|
|
@@ -2050,7 +2047,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2050
2047
|
* Runs apply frontend model where.
|
|
2051
2048
|
* @param {object} args - Where args.
|
|
2052
2049
|
* @param {import("./database/query/model-class-query.js").default} args.query - Query instance.
|
|
2053
|
-
* @param {Record<string,
|
|
2050
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} args.where - Root-model where conditions.
|
|
2054
2051
|
* @returns {void}
|
|
2055
2052
|
*/
|
|
2056
2053
|
applyFrontendModelWhere({query, where}) {
|
|
@@ -2065,7 +2062,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2065
2062
|
/**
|
|
2066
2063
|
* Runs apply frontend model joins.
|
|
2067
2064
|
* @param {object} args - Joins args.
|
|
2068
|
-
* @param {Record<string,
|
|
2065
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} args.joins - Relationship-object joins.
|
|
2069
2066
|
* @param {import("./database/query/model-class-query.js").default} args.query - Query instance.
|
|
2070
2067
|
* @returns {void}
|
|
2071
2068
|
*/
|
|
@@ -2095,7 +2092,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2095
2092
|
/**
|
|
2096
2093
|
* Runs apply frontend model joins for path.
|
|
2097
2094
|
* @param {object} args - Joins args.
|
|
2098
|
-
* @param {Record<string,
|
|
2095
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} args.joins - Joins for current path.
|
|
2099
2096
|
* @param {Set<string>} args.joinPathKeys - Joined path keys.
|
|
2100
2097
|
* @param {typeof import("./database/record/index.js").default} args.modelClass - Model class for current path.
|
|
2101
2098
|
* @param {string[]} args.path - Relationship path.
|
|
@@ -2150,7 +2147,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2150
2147
|
if (typeof entry === "string") return entry
|
|
2151
2148
|
if (!entry || typeof entry !== "object") return null
|
|
2152
2149
|
|
|
2153
|
-
const name = /** @type {Record<string,
|
|
2150
|
+
const name = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (entry).name
|
|
2154
2151
|
|
|
2155
2152
|
return typeof name === "string" && name.length > 0 ? name : null
|
|
2156
2153
|
})
|
|
@@ -2262,7 +2259,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2262
2259
|
* @param {typeof import("./database/record/index.js").default} args.modelClass - Model class for current where scope.
|
|
2263
2260
|
* @param {string[]} args.path - Relationship path from root.
|
|
2264
2261
|
* @param {import("./database/query/model-class-query.js").default} args.query - Query instance.
|
|
2265
|
-
* @param {Record<string,
|
|
2262
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} args.where - Where conditions for current scope.
|
|
2266
2263
|
* @returns {void}
|
|
2267
2264
|
*/
|
|
2268
2265
|
applyFrontendModelWhereForPath({modelClass, path, query, where}) {
|
|
@@ -2344,8 +2341,8 @@ export default class FrontendModelController extends Controller {
|
|
|
2344
2341
|
* @param {object} args - Args.
|
|
2345
2342
|
* @param {typeof import("./database/record/index.js").default} args.modelClass - Model class.
|
|
2346
2343
|
* @param {string} args.columnName - Column name.
|
|
2347
|
-
* @param {
|
|
2348
|
-
* @returns {
|
|
2344
|
+
* @param {ReturnType<typeof JSON.parse>} args.value - Where value.
|
|
2345
|
+
* @returns {ReturnType<typeof JSON.parse> | symbol} - SQL-safe where value.
|
|
2349
2346
|
*/
|
|
2350
2347
|
normalizeFrontendModelWhereColumnValue({columnName, modelClass, value}) {
|
|
2351
2348
|
if (typeof value === "string") {
|
|
@@ -2469,7 +2466,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2469
2466
|
|
|
2470
2467
|
for (const attributeName of selectedAttributes) {
|
|
2471
2468
|
const hookName = `${attributeName}AttributeSelected`
|
|
2472
|
-
const dynamicResource = /** @type {Record<string,
|
|
2469
|
+
const dynamicResource = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (resource))
|
|
2473
2470
|
|
|
2474
2471
|
if (typeof dynamicResource[hookName] === "function") {
|
|
2475
2472
|
const result = dynamicResource[hookName]({query})
|
|
@@ -2657,13 +2654,13 @@ export default class FrontendModelController extends Controller {
|
|
|
2657
2654
|
.filter((entry) => {
|
|
2658
2655
|
if (typeof entry === "string") return true
|
|
2659
2656
|
|
|
2660
|
-
const config = /** @type {Record<string,
|
|
2657
|
+
const config = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (entry)
|
|
2661
2658
|
|
|
2662
2659
|
if (config && config.selectedByDefault === false) return false
|
|
2663
2660
|
|
|
2664
2661
|
return true
|
|
2665
2662
|
})
|
|
2666
|
-
.map((entry) => typeof entry === "string" ? entry : /** @type {Record<string,
|
|
2663
|
+
.map((entry) => typeof entry === "string" ? entry : /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (entry).name)
|
|
2667
2664
|
}
|
|
2668
2665
|
|
|
2669
2666
|
if (typeof attributes === "object") {
|
|
@@ -2671,7 +2668,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2671
2668
|
.filter(([, config]) => {
|
|
2672
2669
|
if (!config || typeof config !== "object") return true
|
|
2673
2670
|
|
|
2674
|
-
return /** @type {Record<string,
|
|
2671
|
+
return /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (config).selectedByDefault !== false
|
|
2675
2672
|
})
|
|
2676
2673
|
.map(([name]) => name)
|
|
2677
2674
|
}
|
|
@@ -2682,7 +2679,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2682
2679
|
/**
|
|
2683
2680
|
* Runs serialize frontend model attributes.
|
|
2684
2681
|
* @param {import("./database/record/index.js").default} model - Model instance.
|
|
2685
|
-
* @returns {Promise<Record<string,
|
|
2682
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} - Serialized attributes filtered by select map.
|
|
2686
2683
|
*/
|
|
2687
2684
|
async serializeFrontendModelAttributes(model) {
|
|
2688
2685
|
const modelClass = /** @type {typeof import("./database/record/index.js").default} */ (model.constructor)
|
|
@@ -2712,7 +2709,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2712
2709
|
/**
|
|
2713
2710
|
* Prototype attribute method.
|
|
2714
2711
|
* @param {string} attributeName - Attribute name.
|
|
2715
|
-
* @returns {{method: (...args: Array
|
|
2712
|
+
* @returns {{method: (...args: Array<ReturnType<typeof JSON.parse>>) => ReturnType<typeof JSON.parse>, ownerName: string} | undefined} - Prototype method details when present.
|
|
2716
2713
|
*/
|
|
2717
2714
|
const prototypeAttributeMethod = (attributeName) => {
|
|
2718
2715
|
let currentPrototype = Object.getPrototypeOf(model)
|
|
@@ -2734,7 +2731,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2734
2731
|
/**
|
|
2735
2732
|
* Serialized attribute value.
|
|
2736
2733
|
* @param {string} attributeName - Attribute name.
|
|
2737
|
-
* @returns {Promise
|
|
2734
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Serialized attribute value.
|
|
2738
2735
|
*/
|
|
2739
2736
|
const serializedAttributeValue = async (attributeName) => {
|
|
2740
2737
|
// Check resource instance first (virtual/computed attributes via ${name}Attribute convention)
|
|
@@ -2761,7 +2758,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2761
2758
|
* @returns {boolean} - Whether the attribute exists.
|
|
2762
2759
|
*/
|
|
2763
2760
|
const attributeExists = (attributeName) => {
|
|
2764
|
-
return (attributeName in modelAttributes) || (attributeName in /** @type {Record<string,
|
|
2761
|
+
return (attributeName in modelAttributes) || (attributeName in /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (model)) || Boolean(resourceAttributeMethod(attributeName))
|
|
2765
2762
|
}
|
|
2766
2763
|
|
|
2767
2764
|
if (!selectedAttributes) {
|
|
@@ -2771,7 +2768,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2771
2768
|
|
|
2772
2769
|
/**
|
|
2773
2770
|
* Serialized attributes.
|
|
2774
|
-
* @type {Record<string,
|
|
2771
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
2775
2772
|
const serializedAttributes = {}
|
|
2776
2773
|
|
|
2777
2774
|
for (const attributeName of defaultAttributes) {
|
|
@@ -2784,7 +2781,7 @@ export default class FrontendModelController extends Controller {
|
|
|
2784
2781
|
|
|
2785
2782
|
/**
|
|
2786
2783
|
* Serialized attributes.
|
|
2787
|
-
* @type {Record<string,
|
|
2784
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
2788
2785
|
const serializedAttributes = {}
|
|
2789
2786
|
|
|
2790
2787
|
for (const attributeName of selectedAttributes) {
|
|
@@ -2924,24 +2921,24 @@ export default class FrontendModelController extends Controller {
|
|
|
2924
2921
|
|
|
2925
2922
|
/**
|
|
2926
2923
|
* Runs is serializable frontend model.
|
|
2927
|
-
* @param {
|
|
2924
|
+
* @param {ReturnType<typeof JSON.parse>} value - Candidate preloaded value.
|
|
2928
2925
|
* @returns {value is import("./database/record/index.js").default} - Whether value behaves like a model.
|
|
2929
2926
|
*/
|
|
2930
2927
|
isSerializableFrontendModel(value) {
|
|
2931
|
-
return Boolean(value && typeof value === "object" && typeof /** @type {
|
|
2928
|
+
return Boolean(value && typeof value === "object" && typeof /** @type {ReturnType<typeof JSON.parse>} */ (value).attributes === "function")
|
|
2932
2929
|
}
|
|
2933
2930
|
|
|
2934
2931
|
/**
|
|
2935
2932
|
* Runs serialize frontend models.
|
|
2936
2933
|
* @param {import("./database/record/index.js").default[]} models - Models to serialize.
|
|
2937
|
-
* @returns {Promise<Record<string,
|
|
2934
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>[]>} - Serialized model payloads.
|
|
2938
2935
|
*/
|
|
2939
2936
|
async serializeFrontendModels(models) {
|
|
2940
2937
|
if (models.length < 1) return []
|
|
2941
2938
|
|
|
2942
2939
|
/**
|
|
2943
2940
|
* Preloaded relationships per model.
|
|
2944
|
-
* @type {Array<Record<string,
|
|
2941
|
+
* @type {Array<Record<string, ReturnType<typeof JSON.parse>>>} */
|
|
2945
2942
|
const preloadedRelationshipsPerModel = Array.from({length: models.length}, () => ({}))
|
|
2946
2943
|
|
|
2947
2944
|
/**
|
|
@@ -3024,7 +3021,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3024
3021
|
|
|
3025
3022
|
/**
|
|
3026
3023
|
* Serialized models.
|
|
3027
|
-
* @type {Record<string,
|
|
3024
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>[]} */
|
|
3028
3025
|
const serializedModels = []
|
|
3029
3026
|
|
|
3030
3027
|
for (const [modelIndex, model] of models.entries()) {
|
|
@@ -3045,7 +3042,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3045
3042
|
|
|
3046
3043
|
/**
|
|
3047
3044
|
* Serialized.
|
|
3048
|
-
* @type {Record<string,
|
|
3045
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
3049
3046
|
const serialized = {...serializedAttributes}
|
|
3050
3047
|
|
|
3051
3048
|
if (hasPreloaded) serialized.__preloadedRelationships = preloadedRelationships
|
|
@@ -3062,7 +3059,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3062
3059
|
/**
|
|
3063
3060
|
* Runs serialize frontend model.
|
|
3064
3061
|
* @param {import("./database/record/index.js").default} model - Frontend model record.
|
|
3065
|
-
* @returns {Promise<Record<string,
|
|
3062
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} - Serialized frontend model payload.
|
|
3066
3063
|
*/
|
|
3067
3064
|
async serializeFrontendModel(model) {
|
|
3068
3065
|
const serializedModels = await this.serializeFrontendModels([model])
|
|
@@ -3079,7 +3076,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3079
3076
|
await this.logger.error(`Frontend model request failed: ${errorMessage}`)
|
|
3080
3077
|
|
|
3081
3078
|
const renderError = /** @type {((errorMessage: string) => Promise<void>) | undefined} */ (
|
|
3082
|
-
/** @type {
|
|
3079
|
+
/** @type {ReturnType<typeof JSON.parse>} */ (this).renderError
|
|
3083
3080
|
)
|
|
3084
3081
|
|
|
3085
3082
|
if (typeof renderError === "function") {
|
|
@@ -3088,7 +3085,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3088
3085
|
}
|
|
3089
3086
|
|
|
3090
3087
|
await this.render({
|
|
3091
|
-
json: /** @type {Record<string,
|
|
3088
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue({
|
|
3092
3089
|
errorMessage: frontendModelClientSafeErrorMessage,
|
|
3093
3090
|
status: "error"
|
|
3094
3091
|
}, this.transportSerializationOptions()))
|
|
@@ -3098,18 +3095,23 @@ export default class FrontendModelController extends Controller {
|
|
|
3098
3095
|
/**
|
|
3099
3096
|
* Runs frontend model error payload.
|
|
3100
3097
|
* @param {string} errorMessage - Error message.
|
|
3101
|
-
* @
|
|
3098
|
+
* @param {object} [options] - Structured error fields.
|
|
3099
|
+
* @param {import("./configuration-types.js").ClientErrorPayloadReporterPayload} [options.details] - Client-safe details.
|
|
3100
|
+
* @param {"application_error" | "authorization_error" | "internal_error" | "record_not_found" | "validation_error"} [options.errorType] - Stable client-facing error category.
|
|
3101
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Error payload.
|
|
3102
3102
|
*/
|
|
3103
|
-
frontendModelErrorPayload(errorMessage) {
|
|
3103
|
+
frontendModelErrorPayload(errorMessage, options = {}) {
|
|
3104
3104
|
return {
|
|
3105
|
+
...(options.details ? {details: options.details} : {}),
|
|
3105
3106
|
errorMessage,
|
|
3107
|
+
...(options.errorType ? {errorType: options.errorType} : {}),
|
|
3106
3108
|
status: "error"
|
|
3107
3109
|
}
|
|
3108
3110
|
}
|
|
3109
3111
|
|
|
3110
3112
|
/**
|
|
3111
3113
|
* Runs frontend model client safe error payload.
|
|
3112
|
-
* @returns {Record<string,
|
|
3114
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Client-safe error payload.
|
|
3113
3115
|
*/
|
|
3114
3116
|
frontendModelClientSafeErrorPayload() {
|
|
3115
3117
|
return this.frontendModelErrorPayload(frontendModelClientSafeErrorMessage)
|
|
@@ -3127,6 +3129,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3127
3129
|
*/
|
|
3128
3130
|
frontendModelEndpointErrorContext({action, commandType, error, model, requestId}) {
|
|
3129
3131
|
let resolvedModel = model
|
|
3132
|
+
const expectedError = frontendModelExpectedError(error)
|
|
3130
3133
|
|
|
3131
3134
|
if (!resolvedModel) {
|
|
3132
3135
|
const cachedParams = this._frontendModelParamsOverride || this._frontendModelParams
|
|
@@ -3138,7 +3141,8 @@ export default class FrontendModelController extends Controller {
|
|
|
3138
3141
|
action,
|
|
3139
3142
|
commandType,
|
|
3140
3143
|
controller: this.constructor.name,
|
|
3141
|
-
expectedError:
|
|
3144
|
+
...(expectedError ? {} : {correlationId: randomUUID()}),
|
|
3145
|
+
expectedError,
|
|
3142
3146
|
frontendModelEndpoint: true,
|
|
3143
3147
|
model: resolvedModel,
|
|
3144
3148
|
requestId
|
|
@@ -3154,6 +3158,22 @@ export default class FrontendModelController extends Controller {
|
|
|
3154
3158
|
async frontendModelClientErrorPayloadForError(error, endpointErrorContext) {
|
|
3155
3159
|
const velociousMetadata = frontendModelVelociousMetadataForError(error)
|
|
3156
3160
|
const normalizedError = error instanceof Error ? error : new Error(String(error))
|
|
3161
|
+
/** @type {import("./configuration-types.js").ClientErrorPayloadReporterPayload} */
|
|
3162
|
+
const safeErrorPayload = {}
|
|
3163
|
+
|
|
3164
|
+
if (error instanceof VelociousError && error.safeToExpose) {
|
|
3165
|
+
if (error.errorType) safeErrorPayload.errorType = error.errorType
|
|
3166
|
+
if (error.details) safeErrorPayload.details = error.details
|
|
3167
|
+
} else if (error instanceof RecordNotFoundError) {
|
|
3168
|
+
safeErrorPayload.errorType = "record_not_found"
|
|
3169
|
+
} else if (velociousMetadata) {
|
|
3170
|
+
if (typeof velociousMetadata.errorType === "string") {
|
|
3171
|
+
safeErrorPayload.errorType = velociousMetadata.errorType
|
|
3172
|
+
}
|
|
3173
|
+
if (isPlainObject(velociousMetadata.details)) {
|
|
3174
|
+
safeErrorPayload.details = velociousMetadata.details
|
|
3175
|
+
}
|
|
3176
|
+
}
|
|
3157
3177
|
|
|
3158
3178
|
let validationErrorsPayload = {}
|
|
3159
3179
|
|
|
@@ -3179,7 +3199,14 @@ export default class FrontendModelController extends Controller {
|
|
|
3179
3199
|
}
|
|
3180
3200
|
}
|
|
3181
3201
|
|
|
3202
|
+
const reporterPayload = await this.getConfiguration().clientErrorPayloadForError({
|
|
3203
|
+
context: endpointErrorContext || {controller: this.constructor.name},
|
|
3204
|
+
error: normalizedError,
|
|
3205
|
+
request: this.getRequest()
|
|
3206
|
+
})
|
|
3207
|
+
|
|
3182
3208
|
return {
|
|
3209
|
+
...reporterPayload,
|
|
3183
3210
|
...this.frontendModelErrorPayload(frontendModelClientMessageForError(error)),
|
|
3184
3211
|
...frontendModelDebugPayloadForError({
|
|
3185
3212
|
configuration: this.getConfiguration(),
|
|
@@ -3187,28 +3214,22 @@ export default class FrontendModelController extends Controller {
|
|
|
3187
3214
|
error
|
|
3188
3215
|
}),
|
|
3189
3216
|
...(velociousMetadata ? {velocious: velociousMetadata} : {}),
|
|
3217
|
+
...safeErrorPayload,
|
|
3190
3218
|
...validationErrorsPayload,
|
|
3191
|
-
...(
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
request: this.getRequest()
|
|
3195
|
-
}))
|
|
3219
|
+
...(!endpointErrorContext?.expectedError && endpointErrorContext?.correlationId
|
|
3220
|
+
? {correlationId: endpointErrorContext.correlationId, errorType: "internal_error"}
|
|
3221
|
+
: {})
|
|
3196
3222
|
}
|
|
3197
3223
|
}
|
|
3198
3224
|
|
|
3199
3225
|
/**
|
|
3200
3226
|
* Runs frontend model log endpoint error.
|
|
3201
3227
|
* @param {object} args - Error log args.
|
|
3202
|
-
* @param {
|
|
3203
|
-
* @param {
|
|
3204
|
-
* @param {"index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url" | "custom-command"} [args.commandType] - Frontend-model command type.
|
|
3205
|
-
* @param {string | undefined} [args.model] - Request model name when available.
|
|
3206
|
-
* @param {string | undefined} [args.requestId] - Batch request id when available.
|
|
3228
|
+
* @param {ReturnType<typeof JSON.parse>} args.error - Caught error.
|
|
3229
|
+
* @param {FrontendModelEndpointErrorContext} args.errorContext - Shared client/logging error context.
|
|
3207
3230
|
* @returns {Promise<void>} - Resolves after logging.
|
|
3208
3231
|
*/
|
|
3209
|
-
async frontendModelLogEndpointError({
|
|
3210
|
-
const errorContext = this.frontendModelEndpointErrorContext({action, commandType, error, model, requestId})
|
|
3211
|
-
|
|
3232
|
+
async frontendModelLogEndpointError({error, errorContext}) {
|
|
3212
3233
|
// Expected user-flow errors are surfaced to clients by
|
|
3213
3234
|
// frontendModelClientErrorPayloadForError, but skipped here so monitoring
|
|
3214
3235
|
// stays focused on real backend failures.
|
|
@@ -3219,11 +3240,12 @@ export default class FrontendModelController extends Controller {
|
|
|
3219
3240
|
: String(error)
|
|
3220
3241
|
|
|
3221
3242
|
await this.logger.error(() => ["Frontend model endpoint request failed", {
|
|
3222
|
-
action,
|
|
3223
|
-
commandType,
|
|
3243
|
+
action: errorContext.action,
|
|
3244
|
+
commandType: errorContext.commandType,
|
|
3245
|
+
correlationId: errorContext.correlationId,
|
|
3224
3246
|
error: errorMessage,
|
|
3225
3247
|
model: errorContext.model,
|
|
3226
|
-
requestId
|
|
3248
|
+
requestId: errorContext.requestId
|
|
3227
3249
|
}])
|
|
3228
3250
|
|
|
3229
3251
|
// Surface genuinely unexpected backend failures on the framework-error
|
|
@@ -3231,6 +3253,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3231
3253
|
// controller silently swallowing them behind the generic "Request
|
|
3232
3254
|
// failed." client message.
|
|
3233
3255
|
const errorPayload = {
|
|
3256
|
+
correlationId: errorContext.correlationId,
|
|
3234
3257
|
context: errorContext,
|
|
3235
3258
|
error: error instanceof Error ? error : new Error(String(error)),
|
|
3236
3259
|
request: this.getRequest(),
|
|
@@ -3252,15 +3275,15 @@ export default class FrontendModelController extends Controller {
|
|
|
3252
3275
|
if (!responsePayload) return
|
|
3253
3276
|
|
|
3254
3277
|
await this.render({
|
|
3255
|
-
json: /** @type {Record<string,
|
|
3278
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue(responsePayload, this.transportSerializationOptions()))
|
|
3256
3279
|
})
|
|
3257
3280
|
} catch (error) {
|
|
3258
3281
|
const errorContext = this.frontendModelEndpointErrorContext({action, commandType: action, error})
|
|
3259
3282
|
|
|
3260
|
-
await this.frontendModelLogEndpointError({
|
|
3283
|
+
await this.frontendModelLogEndpointError({error, errorContext})
|
|
3261
3284
|
|
|
3262
3285
|
await this.render({
|
|
3263
|
-
json: /** @type {Record<string,
|
|
3286
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue(await this.frontendModelClientErrorPayloadForError(error, errorContext), this.transportSerializationOptions()))
|
|
3264
3287
|
})
|
|
3265
3288
|
}
|
|
3266
3289
|
}
|
|
@@ -3268,7 +3291,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3268
3291
|
/**
|
|
3269
3292
|
* Runs frontend model command payload.
|
|
3270
3293
|
* @param {"index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url"} action - Frontend action.
|
|
3271
|
-
* @returns {Promise<Record<string,
|
|
3294
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>> | null>} - Response payload.
|
|
3272
3295
|
*/
|
|
3273
3296
|
async frontendModelCommandPayload(action) {
|
|
3274
3297
|
await this.ensureFrontendModelClassInitialized()
|
|
@@ -3334,7 +3357,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3334
3357
|
)
|
|
3335
3358
|
|
|
3336
3359
|
if (!model) {
|
|
3337
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3360
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3338
3361
|
}
|
|
3339
3362
|
|
|
3340
3363
|
const serializedModel = await resource.serialize(model, "create")
|
|
@@ -3343,7 +3366,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3343
3366
|
}
|
|
3344
3367
|
|
|
3345
3368
|
if ((typeof id !== "string" && typeof id !== "number") || `${id}`.length < 1) {
|
|
3346
|
-
return this.frontendModelErrorPayload("Expected model id.")
|
|
3369
|
+
return this.frontendModelErrorPayload("Expected model id.", {errorType: "validation_error"})
|
|
3347
3370
|
}
|
|
3348
3371
|
|
|
3349
3372
|
if (action === "attach") {
|
|
@@ -3361,7 +3384,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3361
3384
|
const model = await this.frontendModelFindRecord("attach", id)
|
|
3362
3385
|
|
|
3363
3386
|
if (!model) {
|
|
3364
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3387
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3365
3388
|
}
|
|
3366
3389
|
|
|
3367
3390
|
await model.getAttachmentByName(attachmentName).attach(attachmentInput)
|
|
@@ -3377,13 +3400,13 @@ export default class FrontendModelController extends Controller {
|
|
|
3377
3400
|
const model = await this.frontendModelFindRecord("download", id)
|
|
3378
3401
|
|
|
3379
3402
|
if (!model) {
|
|
3380
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3403
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3381
3404
|
}
|
|
3382
3405
|
|
|
3383
3406
|
const downloadedAttachment = await model.getAttachmentByName(attachmentParams.attachmentName).download(attachmentParams.attachmentId)
|
|
3384
3407
|
|
|
3385
3408
|
if (!downloadedAttachment) {
|
|
3386
|
-
return this.frontendModelErrorPayload("Attachment not found.")
|
|
3409
|
+
return this.frontendModelErrorPayload("Attachment not found.", {errorType: "record_not_found"})
|
|
3387
3410
|
}
|
|
3388
3411
|
|
|
3389
3412
|
return {
|
|
@@ -3406,7 +3429,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3406
3429
|
const model = await this.frontendModelFindRecord("url", id)
|
|
3407
3430
|
|
|
3408
3431
|
if (!model) {
|
|
3409
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3432
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3410
3433
|
}
|
|
3411
3434
|
|
|
3412
3435
|
const url = await model.getAttachmentByName(attachmentParams.attachmentName).url(attachmentParams.attachmentId)
|
|
@@ -3428,7 +3451,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3428
3451
|
const model = await this.frontendModelFindRecord("attachmentList", id)
|
|
3429
3452
|
|
|
3430
3453
|
if (!model) {
|
|
3431
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3454
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3432
3455
|
}
|
|
3433
3456
|
|
|
3434
3457
|
const attachments = await model.getAttachmentByName(attachmentParams.attachmentName).listMetadata()
|
|
@@ -3443,7 +3466,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3443
3466
|
const model = await this.frontendModelFindRecord("find", id)
|
|
3444
3467
|
|
|
3445
3468
|
if (!model) {
|
|
3446
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3469
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3447
3470
|
}
|
|
3448
3471
|
|
|
3449
3472
|
await this.frontendModelComputeAbilities([model])
|
|
@@ -3459,7 +3482,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3459
3482
|
const model = await this.frontendModelFindRecord("update", id)
|
|
3460
3483
|
|
|
3461
3484
|
if (!model) {
|
|
3462
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3485
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3463
3486
|
}
|
|
3464
3487
|
|
|
3465
3488
|
const updatedModel = await resource.update(model, mutationAttributes.attributes, {
|
|
@@ -3475,7 +3498,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3475
3498
|
const model = await this.frontendModelFindRecord("destroy", id)
|
|
3476
3499
|
|
|
3477
3500
|
if (!model) {
|
|
3478
|
-
return this.frontendModelErrorPayload(`${modelClass.name} not found
|
|
3501
|
+
return this.frontendModelErrorPayload(`${modelClass.name} not found.`, {errorType: "record_not_found"})
|
|
3479
3502
|
}
|
|
3480
3503
|
|
|
3481
3504
|
await resource.destroy(model)
|
|
@@ -3508,7 +3531,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3508
3531
|
})
|
|
3509
3532
|
|
|
3510
3533
|
await this.render({
|
|
3511
|
-
json: /** @type {Record<string,
|
|
3534
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue({
|
|
3512
3535
|
offlineGrant,
|
|
3513
3536
|
status: "success",
|
|
3514
3537
|
syncManifest
|
|
@@ -3593,7 +3616,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3593
3616
|
return
|
|
3594
3617
|
}
|
|
3595
3618
|
|
|
3596
|
-
const params = /** @type {Record<string,
|
|
3619
|
+
const params = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (deserializeFrontendModelTransportValue(this.params()))
|
|
3597
3620
|
const signedMutations = this.frontendSyncReplaySignedMutations(params)
|
|
3598
3621
|
const results = []
|
|
3599
3622
|
|
|
@@ -3616,20 +3639,15 @@ export default class FrontendModelController extends Controller {
|
|
|
3616
3639
|
const errorContext = this.frontendModelEndpointErrorContext({
|
|
3617
3640
|
action: "frontendSyncReplay",
|
|
3618
3641
|
commandType: signedMutation && typeof signedMutation === "object" && "mutation" in signedMutation
|
|
3619
|
-
? /** @type {{mutation?: {operation?:
|
|
3642
|
+
? /** @type {{mutation?: {operation?: ReturnType<typeof JSON.parse>}}} */ (signedMutation).mutation?.operation
|
|
3620
3643
|
: undefined,
|
|
3621
3644
|
error,
|
|
3622
3645
|
model: signedMutation && typeof signedMutation === "object" && "mutation" in signedMutation
|
|
3623
|
-
? /** @type {{mutation?: {model?:
|
|
3646
|
+
? /** @type {{mutation?: {model?: ReturnType<typeof JSON.parse>}}} */ (signedMutation).mutation?.model
|
|
3624
3647
|
: undefined
|
|
3625
3648
|
})
|
|
3626
3649
|
|
|
3627
|
-
await this.frontendModelLogEndpointError({
|
|
3628
|
-
action: errorContext.action,
|
|
3629
|
-
commandType: errorContext.commandType,
|
|
3630
|
-
error,
|
|
3631
|
-
model: errorContext.model
|
|
3632
|
-
})
|
|
3650
|
+
await this.frontendModelLogEndpointError({error, errorContext})
|
|
3633
3651
|
|
|
3634
3652
|
results.push({
|
|
3635
3653
|
idempotencyKey,
|
|
@@ -3640,7 +3658,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3640
3658
|
}
|
|
3641
3659
|
|
|
3642
3660
|
await this.render({
|
|
3643
|
-
json: /** @type {Record<string,
|
|
3661
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue({
|
|
3644
3662
|
results,
|
|
3645
3663
|
status: "success"
|
|
3646
3664
|
}, this.transportSerializationOptions()))
|
|
@@ -3649,8 +3667,8 @@ export default class FrontendModelController extends Controller {
|
|
|
3649
3667
|
|
|
3650
3668
|
/**
|
|
3651
3669
|
* Resolves signed replay mutations from request params.
|
|
3652
|
-
* @param {Record<string,
|
|
3653
|
-
* @returns {Array
|
|
3670
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Request params.
|
|
3671
|
+
* @returns {Array<ReturnType<typeof JSON.parse>>} - Signed mutation envelopes.
|
|
3654
3672
|
*/
|
|
3655
3673
|
frontendSyncReplaySignedMutations(params) {
|
|
3656
3674
|
if (Array.isArray(params.mutations)) return params.mutations
|
|
@@ -3661,8 +3679,8 @@ export default class FrontendModelController extends Controller {
|
|
|
3661
3679
|
|
|
3662
3680
|
/**
|
|
3663
3681
|
* Verifies and replays one signed sync mutation.
|
|
3664
|
-
* @param {
|
|
3665
|
-
* @returns {Promise<{response: Record<string,
|
|
3682
|
+
* @param {ReturnType<typeof JSON.parse>} signedMutation - Signed mutation envelope.
|
|
3683
|
+
* @returns {Promise<{response: Record<string, ReturnType<typeof JSON.parse>>, serverChangeFeedError?: Record<string, ReturnType<typeof JSON.parse>>, serverChangeFeedStatus?: "error", serverSequence: number | null}>} - Frontend-model command response and appended server sequence.
|
|
3666
3684
|
*/
|
|
3667
3685
|
async frontendSyncReplaySignedMutation(signedMutation) {
|
|
3668
3686
|
const configuration = this.getConfiguration()
|
|
@@ -3719,17 +3737,12 @@ export default class FrontendModelController extends Controller {
|
|
|
3719
3737
|
} catch (error) {
|
|
3720
3738
|
const errorContext = this.frontendModelEndpointErrorContext({
|
|
3721
3739
|
action: "frontendSyncReplay",
|
|
3722
|
-
commandType: /** @type {
|
|
3740
|
+
commandType: /** @type {ReturnType<typeof JSON.parse>} */ (replayCommand.commandType),
|
|
3723
3741
|
error,
|
|
3724
3742
|
model: mutation.model
|
|
3725
3743
|
})
|
|
3726
3744
|
|
|
3727
|
-
await this.frontendModelLogEndpointError({
|
|
3728
|
-
action: errorContext.action,
|
|
3729
|
-
commandType: errorContext.commandType,
|
|
3730
|
-
error,
|
|
3731
|
-
model: errorContext.model
|
|
3732
|
-
})
|
|
3745
|
+
await this.frontendModelLogEndpointError({error, errorContext})
|
|
3733
3746
|
|
|
3734
3747
|
return {
|
|
3735
3748
|
response: await this.frontendModelClientErrorPayloadForError(error, errorContext),
|
|
@@ -3749,17 +3762,12 @@ export default class FrontendModelController extends Controller {
|
|
|
3749
3762
|
} catch (error) {
|
|
3750
3763
|
const errorContext = this.frontendModelEndpointErrorContext({
|
|
3751
3764
|
action: "frontendSyncReplay",
|
|
3752
|
-
commandType: /** @type {
|
|
3765
|
+
commandType: /** @type {ReturnType<typeof JSON.parse>} */ (replayCommand.commandType),
|
|
3753
3766
|
error,
|
|
3754
3767
|
model: mutation.model
|
|
3755
3768
|
})
|
|
3756
3769
|
|
|
3757
|
-
await this.frontendModelLogEndpointError({
|
|
3758
|
-
action: errorContext.action,
|
|
3759
|
-
commandType: errorContext.commandType,
|
|
3760
|
-
error,
|
|
3761
|
-
model: errorContext.model
|
|
3762
|
-
})
|
|
3770
|
+
await this.frontendModelLogEndpointError({error, errorContext})
|
|
3763
3771
|
|
|
3764
3772
|
return {
|
|
3765
3773
|
response,
|
|
@@ -3772,15 +3780,15 @@ export default class FrontendModelController extends Controller {
|
|
|
3772
3780
|
|
|
3773
3781
|
/**
|
|
3774
3782
|
* Resolves the signed offline grant carried by a replay request.
|
|
3775
|
-
* @param {
|
|
3776
|
-
* @returns {
|
|
3783
|
+
* @param {ReturnType<typeof JSON.parse>} signedMutation - Signed mutation envelope.
|
|
3784
|
+
* @returns {ReturnType<typeof JSON.parse>} - Signed offline grant envelope.
|
|
3777
3785
|
*/
|
|
3778
3786
|
frontendSyncReplaySignedOfflineGrant(signedMutation) {
|
|
3779
3787
|
if (!signedMutation || typeof signedMutation !== "object" || Array.isArray(signedMutation)) {
|
|
3780
3788
|
throw frontendSyncReplaySafeError("Expected sync replay signed offline grant")
|
|
3781
3789
|
}
|
|
3782
3790
|
|
|
3783
|
-
const signedMutationRecord = /** @type {Record<string,
|
|
3791
|
+
const signedMutationRecord = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (signedMutation)
|
|
3784
3792
|
const signedOfflineGrant = signedMutationRecord.signedOfflineGrant || signedMutationRecord.offlineGrant || signedMutationRecord.signedGrant
|
|
3785
3793
|
|
|
3786
3794
|
if (!signedOfflineGrant) throw frontendSyncReplaySafeError("Expected sync replay signed offline grant")
|
|
@@ -3791,7 +3799,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3791
3799
|
/**
|
|
3792
3800
|
* Verifies a sync replay signed offline grant.
|
|
3793
3801
|
* @param {object} args - Arguments.
|
|
3794
|
-
* @param {
|
|
3802
|
+
* @param {ReturnType<typeof JSON.parse>} args.signedOfflineGrant - Signed offline grant envelope.
|
|
3795
3803
|
* @param {import("./sync/offline-grant.js").OfflineGrantSigningKey[]} args.signingKeys - Available signing keys.
|
|
3796
3804
|
* @returns {Promise<import("./sync/offline-grant.js").OfflineGrant>} - Verified offline grant.
|
|
3797
3805
|
*/
|
|
@@ -3812,7 +3820,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3812
3820
|
* @param {object} args - Arguments.
|
|
3813
3821
|
* @param {import("./sync/device-identity.js").SyncMutation} args.mutation - Verified mutation.
|
|
3814
3822
|
* @param {import("./sync/offline-grant.js").OfflineGrant} args.offlineGrant - Verified grant.
|
|
3815
|
-
* @param {Record<string,
|
|
3823
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} args.syncResource - Current sync resource entry.
|
|
3816
3824
|
* @returns {void} - Throws when unauthorized.
|
|
3817
3825
|
*/
|
|
3818
3826
|
frontendSyncReplayValidateOfflineGrant({mutation, offlineGrant, syncResource}) {
|
|
@@ -3826,7 +3834,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3826
3834
|
throw frontendSyncReplaySafeError("Sync replay offline grant user does not match mutation")
|
|
3827
3835
|
}
|
|
3828
3836
|
|
|
3829
|
-
const grantResource = /** @type {Record<string,
|
|
3837
|
+
const grantResource = /** @type {Record<string, ReturnType<typeof JSON.parse>> | undefined} */ (offlineGrant.resources[mutation.model])
|
|
3830
3838
|
const grantOperations = Array.isArray(grantResource?.operations) ? grantResource.operations : []
|
|
3831
3839
|
const grantPolicyHash = grantResource?.policyHash
|
|
3832
3840
|
|
|
@@ -3847,7 +3855,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3847
3855
|
* @param {object} args - Arguments.
|
|
3848
3856
|
* @param {import("./sync/device-identity.js").SyncMutation} args.mutation - Verified mutation.
|
|
3849
3857
|
* @param {{commandType: string, methodName?: string, scope?: "collection" | "member"}} args.replayCommand - Resolved replay command metadata.
|
|
3850
|
-
* @returns {Promise<Record<string,
|
|
3858
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} - Command response payload.
|
|
3851
3859
|
*/
|
|
3852
3860
|
async frontendSyncReplayCustomCommandPayload({mutation, replayCommand}) {
|
|
3853
3861
|
if (typeof replayCommand.methodName !== "string" || replayCommand.methodName.length < 1) {
|
|
@@ -3880,17 +3888,17 @@ export default class FrontendModelController extends Controller {
|
|
|
3880
3888
|
return this.frontendModelErrorPayload(`Missing frontend-model custom command '${replayCommand.methodName}'.`)
|
|
3881
3889
|
}
|
|
3882
3890
|
|
|
3883
|
-
const commandArguments = /** @type {Record<string,
|
|
3891
|
+
const commandArguments = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (mutation.payload && typeof mutation.payload === "object" && !Array.isArray(mutation.payload) ? mutation.payload : {})
|
|
3884
3892
|
const responsePayload = await command.method.call(command.resource, commandArguments)
|
|
3885
3893
|
|
|
3886
3894
|
if (!responsePayload || typeof responsePayload !== "object") {
|
|
3887
3895
|
return {status: "success"}
|
|
3888
3896
|
}
|
|
3889
3897
|
|
|
3890
|
-
return /** @type {Record<string,
|
|
3898
|
+
return /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (
|
|
3891
3899
|
await this.autoSerializeFrontendModelsInPayload(
|
|
3892
3900
|
responsePayload,
|
|
3893
|
-
/** @type {{serialize: (model:
|
|
3901
|
+
/** @type {{serialize: (model: ReturnType<typeof JSON.parse>, action: string) => Promise<Record<string, ReturnType<typeof JSON.parse>>>}} */ (command.resource),
|
|
3894
3902
|
replayCommand.methodName
|
|
3895
3903
|
)
|
|
3896
3904
|
)
|
|
@@ -3899,12 +3907,12 @@ export default class FrontendModelController extends Controller {
|
|
|
3899
3907
|
/**
|
|
3900
3908
|
* Builds frontend-model command params for a verified replay mutation.
|
|
3901
3909
|
* @param {import("./sync/device-identity.js").SyncMutation} mutation - Verified mutation.
|
|
3902
|
-
* @returns {Promise<Record<string,
|
|
3910
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} - Frontend-model command params.
|
|
3903
3911
|
*/
|
|
3904
3912
|
async frontendSyncReplayCommandParams(mutation) {
|
|
3905
3913
|
const payload = mutation.payload && typeof mutation.payload === "object" && !Array.isArray(mutation.payload) ? mutation.payload : {}
|
|
3906
3914
|
const {attributes, primaryKeyValue} = await this.frontendSyncReplayCommandAttributes(mutation)
|
|
3907
|
-
const commandParams = /** @type {Record<string,
|
|
3915
|
+
const commandParams = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ ({
|
|
3908
3916
|
...payload,
|
|
3909
3917
|
attributes,
|
|
3910
3918
|
model: mutation.model
|
|
@@ -3971,10 +3979,10 @@ export default class FrontendModelController extends Controller {
|
|
|
3971
3979
|
/**
|
|
3972
3980
|
* Resolves command attributes and primary key from a replay mutation.
|
|
3973
3981
|
* @param {import("./sync/device-identity.js").SyncMutation} mutation - Verified mutation.
|
|
3974
|
-
* @returns {Promise<{attributes: Record<string,
|
|
3982
|
+
* @returns {Promise<{attributes: Record<string, ReturnType<typeof JSON.parse>>, primaryKeyValue: string | number | undefined}>} - Command attributes and primary key value.
|
|
3975
3983
|
*/
|
|
3976
3984
|
async frontendSyncReplayCommandAttributes(mutation) {
|
|
3977
|
-
const attributes = /** @type {Record<string,
|
|
3985
|
+
const attributes = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ ({...(mutation.attributes || {})})
|
|
3978
3986
|
const frontendModelResource = this.getConfiguration().getBackendProjects()
|
|
3979
3987
|
.map((backendProject) => this.frontendModelResourceConfigurationForBackendProjectModelName({backendProject, modelName: mutation.model}))
|
|
3980
3988
|
.find((resourceConfiguration) => resourceConfiguration)
|
|
@@ -3996,7 +4004,7 @@ export default class FrontendModelController extends Controller {
|
|
|
3996
4004
|
* @param {string | null} args.idempotencyKey - Mutation idempotency key.
|
|
3997
4005
|
* @param {import("./sync/device-identity.js").SyncMutation} args.mutation - Verified mutation.
|
|
3998
4006
|
* @param {import("./sync/offline-grant.js").OfflineGrant} args.offlineGrant - Verified offline grant.
|
|
3999
|
-
* @param {Record<string,
|
|
4007
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} args.response - Replay command response.
|
|
4000
4008
|
* @returns {Promise<number | null>} - Assigned server sequence, or null when no change was appended.
|
|
4001
4009
|
*/
|
|
4002
4010
|
async frontendSyncAppendServerChange({idempotencyKey, mutation, offlineGrant, response}) {
|
|
@@ -4015,9 +4023,9 @@ export default class FrontendModelController extends Controller {
|
|
|
4015
4023
|
for (const syncChange of syncChanges) {
|
|
4016
4024
|
if (!syncChange || typeof syncChange !== "object" || Array.isArray(syncChange)) continue
|
|
4017
4025
|
|
|
4018
|
-
const change = /** @type {Record<string,
|
|
4019
|
-
const payload = /** @type {Record<string,
|
|
4020
|
-
const attributes = /** @type {Record<string,
|
|
4026
|
+
const change = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (syncChange)
|
|
4027
|
+
const payload = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (change.payload && typeof change.payload === "object" && !Array.isArray(change.payload) ? change.payload : {})
|
|
4028
|
+
const attributes = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (change.attributes && typeof change.attributes === "object" && !Array.isArray(change.attributes) ? change.attributes : {})
|
|
4021
4029
|
const model = typeof change.model === "string" && change.model.length > 0 ? change.model : mutation.model
|
|
4022
4030
|
const operation = typeof change.operation === "string" && change.operation.length > 0 ? change.operation : mutation.operation
|
|
4023
4031
|
const rawRecordId = change.recordId ?? payload.id ?? payload.recordId ?? attributes.id ?? null
|
|
@@ -4043,7 +4051,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4043
4051
|
|
|
4044
4052
|
/**
|
|
4045
4053
|
* Verifies the signed offline grant used to scope sync read endpoints.
|
|
4046
|
-
* @param {Record<string,
|
|
4054
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Request params.
|
|
4047
4055
|
* @returns {Promise<import("./sync/offline-grant.js").OfflineGrant>} - Verified offline grant.
|
|
4048
4056
|
*/
|
|
4049
4057
|
async frontendSyncRequestVerifiedOfflineGrant(params) {
|
|
@@ -4065,7 +4073,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4065
4073
|
return
|
|
4066
4074
|
}
|
|
4067
4075
|
|
|
4068
|
-
const params = /** @type {Record<string,
|
|
4076
|
+
const params = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (deserializeFrontendModelTransportValue(this.params()))
|
|
4069
4077
|
const offlineGrant = await this.frontendSyncRequestVerifiedOfflineGrant(params)
|
|
4070
4078
|
const afterSequence = this.frontendSyncChangeFeedAfterSequence(params)
|
|
4071
4079
|
const store = serverChangeFeedStoreForConfiguration(this.getConfiguration())
|
|
@@ -4076,7 +4084,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4076
4084
|
|
|
4077
4085
|
if (page.snapshotRequired) {
|
|
4078
4086
|
await this.render({
|
|
4079
|
-
json: /** @type {Record<string,
|
|
4087
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue({
|
|
4080
4088
|
changes: [],
|
|
4081
4089
|
oldestSequence: page.oldestSequence,
|
|
4082
4090
|
requestedAfterSequence: afterSequence,
|
|
@@ -4092,7 +4100,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4092
4100
|
const includeSnapshot = params.snapshot === true || params.includeSnapshot === true || afterSequence === 0
|
|
4093
4101
|
const snapshot = includeSnapshot ? await this.frontendSyncSnapshotPayload({scope: offlineGrant.scopes, serverSequence}) : undefined
|
|
4094
4102
|
|
|
4095
|
-
const payload = /** @type {Record<string,
|
|
4103
|
+
const payload = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ ({
|
|
4096
4104
|
changes,
|
|
4097
4105
|
hasMore: page.hasMore,
|
|
4098
4106
|
nextSequence: page.nextSequence,
|
|
@@ -4104,13 +4112,13 @@ export default class FrontendModelController extends Controller {
|
|
|
4104
4112
|
if (snapshot) payload.snapshot = snapshot
|
|
4105
4113
|
|
|
4106
4114
|
await this.render({
|
|
4107
|
-
json: /** @type {Record<string,
|
|
4115
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue(payload, this.transportSerializationOptions()))
|
|
4108
4116
|
})
|
|
4109
4117
|
}
|
|
4110
4118
|
|
|
4111
4119
|
/**
|
|
4112
4120
|
* Resolves sync change-feed cursor.
|
|
4113
|
-
* @param {Record<string,
|
|
4121
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Request params.
|
|
4114
4122
|
* @returns {number} - Exclusive lower-bound sequence.
|
|
4115
4123
|
*/
|
|
4116
4124
|
frontendSyncChangeFeedAfterSequence(params) {
|
|
@@ -4124,7 +4132,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4124
4132
|
|
|
4125
4133
|
/**
|
|
4126
4134
|
* Resolves sync change-feed page limit.
|
|
4127
|
-
* @param {Record<string,
|
|
4135
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Request params.
|
|
4128
4136
|
* @returns {number} - Page limit.
|
|
4129
4137
|
*/
|
|
4130
4138
|
frontendSyncChangeFeedLimit(params) {
|
|
@@ -4138,7 +4146,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4138
4146
|
|
|
4139
4147
|
/**
|
|
4140
4148
|
* Resolves sync change-feed stable high-water mark.
|
|
4141
|
-
* @param {Record<string,
|
|
4149
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Request params.
|
|
4142
4150
|
* @param {number} currentServerSequence - Current latest server sequence.
|
|
4143
4151
|
* @returns {number} - Inclusive upper-bound sequence.
|
|
4144
4152
|
*/
|
|
@@ -4161,14 +4169,14 @@ export default class FrontendModelController extends Controller {
|
|
|
4161
4169
|
return
|
|
4162
4170
|
}
|
|
4163
4171
|
|
|
4164
|
-
const params = /** @type {Record<string,
|
|
4172
|
+
const params = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (deserializeFrontendModelTransportValue(this.params()))
|
|
4165
4173
|
const offlineGrant = await this.frontendSyncRequestVerifiedOfflineGrant(params)
|
|
4166
4174
|
const store = serverChangeFeedStoreForConfiguration(this.getConfiguration())
|
|
4167
4175
|
const serverSequence = await store.latestSequence()
|
|
4168
4176
|
const snapshot = await this.frontendSyncSnapshotPayload({scope: offlineGrant.scopes, serverSequence})
|
|
4169
4177
|
|
|
4170
4178
|
await this.render({
|
|
4171
|
-
json: /** @type {Record<string,
|
|
4179
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue({
|
|
4172
4180
|
snapshot,
|
|
4173
4181
|
status: "success"
|
|
4174
4182
|
}, this.transportSerializationOptions()))
|
|
@@ -4179,12 +4187,12 @@ export default class FrontendModelController extends Controller {
|
|
|
4179
4187
|
* Builds a snapshot of sync-enabled frontend model resources at a stable server sequence.
|
|
4180
4188
|
* @param {object} args - Arguments.
|
|
4181
4189
|
* @param {number} args.serverSequence - Snapshot sequence.
|
|
4182
|
-
* @param {Record<string,
|
|
4183
|
-
* @returns {Promise<{resources: Record<string,
|
|
4190
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} [args.scope] - Caller sync scope.
|
|
4191
|
+
* @returns {Promise<{resources: Record<string, ReturnType<typeof JSON.parse>>, serverSequence: number}>} - Snapshot payload.
|
|
4184
4192
|
*/
|
|
4185
4193
|
async frontendSyncSnapshotPayload({scope, serverSequence}) {
|
|
4186
4194
|
const syncManifest = frontendModelSyncManifestForBackendProjects(this.getConfiguration().getBackendProjects())
|
|
4187
|
-
const resources = /** @type {Record<string,
|
|
4195
|
+
const resources = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ ({})
|
|
4188
4196
|
|
|
4189
4197
|
for (const modelName of Object.keys(syncManifest).sort()) {
|
|
4190
4198
|
const commandParams = {...(scope || {}), model: modelName}
|
|
@@ -4209,11 +4217,11 @@ export default class FrontendModelController extends Controller {
|
|
|
4209
4217
|
return
|
|
4210
4218
|
}
|
|
4211
4219
|
|
|
4212
|
-
const params = /** @type {Record<string,
|
|
4220
|
+
const params = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (deserializeFrontendModelTransportValue(this.params()))
|
|
4213
4221
|
const requests = Array.isArray(params.requests) ? params.requests : [params]
|
|
4214
4222
|
/**
|
|
4215
4223
|
* Responses.
|
|
4216
|
-
* @type {Array<Record<string,
|
|
4224
|
+
* @type {Array<Record<string, ReturnType<typeof JSON.parse>>>} */
|
|
4217
4225
|
const responses = []
|
|
4218
4226
|
|
|
4219
4227
|
for (const requestEntry of requests) {
|
|
@@ -4275,13 +4283,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4275
4283
|
requestId
|
|
4276
4284
|
})
|
|
4277
4285
|
|
|
4278
|
-
await this.frontendModelLogEndpointError({
|
|
4279
|
-
action: errorContext.action,
|
|
4280
|
-
commandType: errorContext.commandType,
|
|
4281
|
-
error,
|
|
4282
|
-
model: errorContext.model,
|
|
4283
|
-
requestId: errorContext.requestId
|
|
4284
|
-
})
|
|
4286
|
+
await this.frontendModelLogEndpointError({error, errorContext})
|
|
4285
4287
|
|
|
4286
4288
|
responses.push({
|
|
4287
4289
|
requestId,
|
|
@@ -4291,7 +4293,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4291
4293
|
}
|
|
4292
4294
|
|
|
4293
4295
|
await this.render({
|
|
4294
|
-
json: /** @type {Record<string,
|
|
4296
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue({
|
|
4295
4297
|
responses,
|
|
4296
4298
|
status: "success"
|
|
4297
4299
|
}, this.transportSerializationOptions()))
|
|
@@ -4302,8 +4304,8 @@ export default class FrontendModelController extends Controller {
|
|
|
4302
4304
|
* Dispatches a custom frontend-model command through the shared frontend-model API endpoint.
|
|
4303
4305
|
* @param {object} args - Arguments.
|
|
4304
4306
|
* @param {string} args.customPath - Custom backend route path.
|
|
4305
|
-
* @param {
|
|
4306
|
-
* @returns {Promise<Record<string,
|
|
4307
|
+
* @param {ReturnType<typeof JSON.parse>} args.payload - Request payload.
|
|
4308
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} - Parsed JSON response payload.
|
|
4307
4309
|
*/
|
|
4308
4310
|
async frontendApiCustomCommandPayload({customPath, payload}) {
|
|
4309
4311
|
const configuration = this.getConfiguration()
|
|
@@ -4357,11 +4359,11 @@ export default class FrontendModelController extends Controller {
|
|
|
4357
4359
|
const customCommandController = /** @type {FrontendModelController} */ (/** @type {unknown} */ (controllerInstance))
|
|
4358
4360
|
|
|
4359
4361
|
customCommandController._frontendModelCustomCommandClientArguments =
|
|
4360
|
-
(payload && typeof payload === "object" && !Array.isArray(payload)) ? /** @type {Record<string,
|
|
4362
|
+
(payload && typeof payload === "object" && !Array.isArray(payload)) ? /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (payload) : {}
|
|
4361
4363
|
|
|
4362
4364
|
await this.withFrontendModelRequestContext(controllerParams, response, async () => {
|
|
4363
4365
|
await controllerInstance._runBeforeCallbacks()
|
|
4364
|
-
const controllerMethods = /** @type {Record<string, () => Promise<void> | void>} */ (/** @type {
|
|
4366
|
+
const controllerMethods = /** @type {Record<string, () => Promise<void> | void>} */ (/** @type {ReturnType<typeof JSON.parse>} */ (controllerInstance))
|
|
4365
4367
|
|
|
4366
4368
|
await controllerMethods[action]()
|
|
4367
4369
|
})
|
|
@@ -4380,7 +4382,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4380
4382
|
|
|
4381
4383
|
// Preserve nested transport markers so the outer shared frontend-model API
|
|
4382
4384
|
// can return them unchanged and let the client hydrate once at the edge.
|
|
4383
|
-
return /** @type {Record<string,
|
|
4385
|
+
return /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (JSON.parse(responseBody))
|
|
4384
4386
|
}
|
|
4385
4387
|
|
|
4386
4388
|
/**
|
|
@@ -4501,22 +4503,22 @@ export default class FrontendModelController extends Controller {
|
|
|
4501
4503
|
const responsePayload = await this.frontendModelCustomCommandPayload()
|
|
4502
4504
|
|
|
4503
4505
|
await this.render({
|
|
4504
|
-
json: /** @type {Record<string,
|
|
4506
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue(responsePayload, this.transportSerializationOptions()))
|
|
4505
4507
|
})
|
|
4506
4508
|
} catch (error) {
|
|
4507
4509
|
const errorContext = this.frontendModelEndpointErrorContext({action: "frontendCustomCommand", commandType: "custom-command", error})
|
|
4508
4510
|
|
|
4509
|
-
await this.frontendModelLogEndpointError({
|
|
4511
|
+
await this.frontendModelLogEndpointError({error, errorContext})
|
|
4510
4512
|
|
|
4511
4513
|
await this.render({
|
|
4512
|
-
json: /** @type {Record<string,
|
|
4514
|
+
json: /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (serializeFrontendModelTransportValue(await this.frontendModelClientErrorPayloadForError(error, errorContext), this.transportSerializationOptions()))
|
|
4513
4515
|
})
|
|
4514
4516
|
}
|
|
4515
4517
|
}
|
|
4516
4518
|
|
|
4517
4519
|
/**
|
|
4518
4520
|
* Runs frontend model custom command payload.
|
|
4519
|
-
* @returns {Promise<Record<string,
|
|
4521
|
+
* @returns {Promise<Record<string, ReturnType<typeof JSON.parse>>>} - Response payload.
|
|
4520
4522
|
*/
|
|
4521
4523
|
async frontendModelCustomCommandPayload() {
|
|
4522
4524
|
const params = this.frontendModelParams()
|
|
@@ -4550,10 +4552,10 @@ export default class FrontendModelController extends Controller {
|
|
|
4550
4552
|
return {status: "success"}
|
|
4551
4553
|
}
|
|
4552
4554
|
|
|
4553
|
-
return /** @type {Record<string,
|
|
4555
|
+
return /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (
|
|
4554
4556
|
await this.autoSerializeFrontendModelsInPayload(
|
|
4555
4557
|
responsePayload,
|
|
4556
|
-
/** @type {{serialize: (model:
|
|
4558
|
+
/** @type {{serialize: (model: ReturnType<typeof JSON.parse>, action: string) => Promise<Record<string, ReturnType<typeof JSON.parse>>>}} */ (command.resource),
|
|
4557
4559
|
methodName
|
|
4558
4560
|
)
|
|
4559
4561
|
)
|
|
@@ -4565,8 +4567,8 @@ export default class FrontendModelController extends Controller {
|
|
|
4565
4567
|
* framework params were merged, so it is returned verbatim (a client `id` survives
|
|
4566
4568
|
* a member route). On the direct path it falls back to the request params with the
|
|
4567
4569
|
* framework keys the command route hook injected stripped out.
|
|
4568
|
-
* @param {Record<string,
|
|
4569
|
-
* @returns {Record<string,
|
|
4570
|
+
* @param {Record<string, ReturnType<typeof JSON.parse>>} params - Deserialized frontend-model params.
|
|
4571
|
+
* @returns {Record<string, ReturnType<typeof JSON.parse>>} - Client command arguments.
|
|
4570
4572
|
*/
|
|
4571
4573
|
frontendModelCustomCommandArguments(params) {
|
|
4572
4574
|
if (this._frontendModelCustomCommandClientArguments) {
|
|
@@ -4592,11 +4594,11 @@ export default class FrontendModelController extends Controller {
|
|
|
4592
4594
|
* `await this.serialize(record, action)`. Plain objects, arrays, and
|
|
4593
4595
|
* primitive values pass through and are later encoded by
|
|
4594
4596
|
* `serializeFrontendModelTransportValue`.
|
|
4595
|
-
* @param {
|
|
4596
|
-
* @param {{serialize: (model:
|
|
4597
|
+
* @param {ReturnType<typeof JSON.parse>} value - Payload value.
|
|
4598
|
+
* @param {{serialize: (model: ReturnType<typeof JSON.parse>, action: string) => Promise<Record<string, ReturnType<typeof JSON.parse>>>}} resource - Resource instance providing `serialize`.
|
|
4597
4599
|
* @param {string} action - Custom command method name passed to `resource.serialize` for per-action authorization filtering.
|
|
4598
4600
|
* @param {WeakSet<object>} [seen] - Recursion stack of plain-object containers currently being walked. Membership is added on entry and removed on exit so a container shared between siblings (i.e. referenced twice but not cyclically) is walked on each reference instead of being short-circuited the second time, which would let backend `Record` instances inside it bypass `resource.serialize`.
|
|
4599
|
-
* @returns {Promise
|
|
4601
|
+
* @returns {Promise<ReturnType<typeof JSON.parse>>} - Payload with backend `Record` instances replaced by serialized markers.
|
|
4600
4602
|
*/
|
|
4601
4603
|
async autoSerializeFrontendModelsInPayload(value, resource, action, seen = new WeakSet()) {
|
|
4602
4604
|
if (value === null || value === undefined) {
|
|
@@ -4622,7 +4624,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4622
4624
|
if (Array.isArray(value)) {
|
|
4623
4625
|
/**
|
|
4624
4626
|
* Result.
|
|
4625
|
-
* @type {Array
|
|
4627
|
+
* @type {Array<ReturnType<typeof JSON.parse>>} */
|
|
4626
4628
|
const result = []
|
|
4627
4629
|
|
|
4628
4630
|
for (const entry of value) {
|
|
@@ -4633,7 +4635,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4633
4635
|
}
|
|
4634
4636
|
|
|
4635
4637
|
if (typeof value === "object" && Object.getPrototypeOf(value) === Object.prototype) {
|
|
4636
|
-
const container = /** @type {Record<string,
|
|
4638
|
+
const container = /** @type {Record<string, ReturnType<typeof JSON.parse>>} */ (value)
|
|
4637
4639
|
|
|
4638
4640
|
if (seen.has(container)) {
|
|
4639
4641
|
// Cyclic back-reference along the current recursion path; the
|
|
@@ -4650,7 +4652,7 @@ export default class FrontendModelController extends Controller {
|
|
|
4650
4652
|
try {
|
|
4651
4653
|
/**
|
|
4652
4654
|
* Result.
|
|
4653
|
-
* @type {Record<string,
|
|
4655
|
+
* @type {Record<string, ReturnType<typeof JSON.parse>>} */
|
|
4654
4656
|
const result = {}
|
|
4655
4657
|
|
|
4656
4658
|
for (const [key, nested] of Object.entries(container)) {
|