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,648 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
* @module types
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* @typedef {function({request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default, response: import("./http-server/client/response.js").default}): Promise<void>} CorsType
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* @typedef {function({request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, subscription?: {channel: string, params?: Record<string, ?>}, client: import("./http-server/client/index.js").default, websocketSession: import("./http-server/client/websocket-session.js").default, configuration: import("./configuration.js").default}): typeof import("./http-server/websocket-channel.js").default | import("./http-server/websocket-channel.js").default | void | Promise<typeof import("./http-server/websocket-channel.js").default | import("./http-server/websocket-channel.js").default | void>} WebsocketChannelResolverType
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* @typedef {object} WebsocketMessageHandler
|
|
12
|
-
* @property {function({message: ?, session: import("./http-server/client/websocket-session.js").default}) : Promise<void> | void} [onMessage] - Handler for incoming websocket messages.
|
|
13
|
-
* @property {function({session: import("./http-server/client/websocket-session.js").default}) : Promise<void> | void} [onOpen] - Handler when the websocket session opens.
|
|
14
|
-
* @property {function({session: import("./http-server/client/websocket-session.js").default}) : Promise<void> | void} [onClose] - Handler when the websocket session closes.
|
|
15
|
-
* @property {function({error: Error, session: import("./http-server/client/websocket-session.js").default}) : Promise<void> | void} [onError] - Handler when a websocket message errors.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* @typedef {function({request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, client: import("./http-server/client/index.js").default, configuration: import("./configuration.js").default}): WebsocketMessageHandler | void | Promise<WebsocketMessageHandler | void>} WebsocketMessageHandlerResolverType
|
|
19
|
-
*/
|
|
20
|
-
/**
|
|
21
|
-
* @typedef {(id: string) => {default: typeof import("./initializer.js").default}} InitializersRequireContextType
|
|
22
|
-
* @typedef {InitializersRequireContextType & {
|
|
23
|
-
* keys: () => string[],
|
|
24
|
-
* id: string
|
|
25
|
-
* }} WebpackRequireContext
|
|
26
|
-
* @typedef {{requireContext: WebpackRequireContext}} InitializersExportType
|
|
27
|
-
* @typedef {function({configuration: import("./configuration.js").default}) : Promise<InitializersExportType>} InitializersType
|
|
28
|
-
*/
|
|
29
|
-
/**
|
|
30
|
-
* @typedef {object} SqlConfig
|
|
31
|
-
* @property {string} [database] - Database name for the SQL driver.
|
|
32
|
-
* @property {object} [options] - Driver-specific connection options.
|
|
33
|
-
* @property {boolean} [options.encrypt] - Whether to encrypt the connection (MSSQL).
|
|
34
|
-
* @property {string} [options.schema] - Default schema for unqualified table lookups (MSSQL).
|
|
35
|
-
* @property {string} [options.serverName] - TLS SNI server name override for MSSQL (empty string disables SNI).
|
|
36
|
-
* @property {boolean} [options.trustServerCertificate] - Whether to trust the server certificate (MSSQL).
|
|
37
|
-
* @property {string} [password] - Password for the SQL user.
|
|
38
|
-
* @property {object} [pool] - Connection pool configuration.
|
|
39
|
-
* @property {number | null} [pool.max] - Maximum number of connections. Set null to disable the cap.
|
|
40
|
-
* @property {number} [pool.min] - Minimum number of connections.
|
|
41
|
-
* @property {number} [pool.idleTimeoutMillis] - Idle timeout before releasing a connection.
|
|
42
|
-
* @property {number | null} [pool.checkoutTimeoutMillis] - Timeout while waiting for an available connection after the max connection cap is reached. Set null to wait indefinitely.
|
|
43
|
-
* @property {string} [server] - SQL server hostname.
|
|
44
|
-
* @property {string} [user] - SQL username.
|
|
45
|
-
*/
|
|
46
|
-
/**
|
|
47
|
-
* @typedef {object} DatabasePoolConfiguration
|
|
48
|
-
* @property {number | null} [checkoutTimeoutMillis] - Timeout while a checkout waits for an available async-tracked connection after the max live connection cap is reached. Set null to wait indefinitely. Default: 10000.
|
|
49
|
-
* @property {number | null} [idleTimeoutMillis] - Idle timeout before closing a checked-in async-tracked connection. Set null to disable idle reaping. Default: 5000.
|
|
50
|
-
* @property {number | null} [max] - Maximum live async-tracked connections for this pool. Defaults to 10. Extra checkouts wait until a matching connection is checked in or capacity is freed. Set null to disable the cap.
|
|
51
|
-
*/
|
|
52
|
-
/**
|
|
53
|
-
* @typedef {object} DatabaseConfigurationType
|
|
54
|
-
* @property {string} [databaseCharset] - Default character set applied by `db:create` via mysql/mariadb `CREATE DATABASE ... CHARACTER SET`. Distinct from `charset`, which is the client connection charset forwarded to the mysql2 driver.
|
|
55
|
-
* @property {string} [databaseCollation] - Default collation applied by `db:create` via mysql/mariadb `CREATE DATABASE ... COLLATE`.
|
|
56
|
-
* @property {string} [database] - Database name for this connection.
|
|
57
|
-
* @property {number} [deadlockMaxRetries] - Maximum attempts for the outermost transaction when it keeps hitting deadlocks. Defaults to 8.
|
|
58
|
-
* @property {number} [deadlockBaseWaitMs] - Base delay (ms) for the deadlock retry backoff; the per-attempt ceiling doubles from here. Defaults to 50.
|
|
59
|
-
* @property {number} [deadlockMaxWaitMs] - Cap (ms) on the deadlock retry backoff ceiling so the jittered wait stays bounded. Defaults to 1000.
|
|
60
|
-
* @property {typeof import("./database/drivers/base.js").default} [driver] - Driver class to use for this database.
|
|
61
|
-
* @property {typeof import("./database/pool/base.js").default} [poolType] - Pool class to use for this database.
|
|
62
|
-
* @property {function() : ?} [getConnection] - Custom connection factory override.
|
|
63
|
-
* @property {string} [host] - Database host.
|
|
64
|
-
* @property {boolean} [migrations] - Whether migrations are enabled for this database.
|
|
65
|
-
* @property {boolean} [multipleStatements] - (MySQL) Opt in to multi-statement queries so a whole structure SQL dump loads in one round-trip via `StructureSqlLoader`. Off by default; ordinary queries otherwise reject stacked statements.
|
|
66
|
-
* @property {string} [password] - Password for the database user.
|
|
67
|
-
* @property {number} [port] - Database port.
|
|
68
|
-
* @property {string} [primaryKeyType] - Default type for implicit migration primary keys and references. Defaults to `uuid`.
|
|
69
|
-
* @property {DatabasePoolConfiguration} [pool] - Velocious database pool lifecycle configuration.
|
|
70
|
-
* @property {string} [name] - Friendly name for the configuration.
|
|
71
|
-
* @property {(file: string) => string} [locateFile] - Optional sqlite-web sql.js wasm resolver (`initSqlJs({locateFile})`).
|
|
72
|
-
* @property {boolean} [readOnly] - Whether writes should be blocked for this database.
|
|
73
|
-
* @property {string} [schema] - Default schema for unqualified table lookups (MSSQL).
|
|
74
|
-
* @property {boolean} [schemaCache] - Whether schema metadata should be cached on the driver. Defaults to true.
|
|
75
|
-
* @property {object} [record] - Record-level configuration.
|
|
76
|
-
* @property {boolean} [record.transactions] - Whether record operations should use transactions.
|
|
77
|
-
* @property {boolean} [reset] - Whether to reset the database on startup.
|
|
78
|
-
* @property {SqlConfig} [sqlConfig] - Driver-specific SQL config.
|
|
79
|
-
* @property {boolean} [tenantOnly] - Whether this database identifier is only active inside a resolved tenant context.
|
|
80
|
-
* @property {"mssql" | "mysql" | "pgsql" | "sqlite"} [type] - Database type identifier.
|
|
81
|
-
* @property {string} [useDatabase] - Database to switch to after connecting.
|
|
82
|
-
* @property {string} [username] - Username for database authentication.
|
|
83
|
-
*/
|
|
84
|
-
/**
|
|
85
|
-
* @typedef {"debug-low-level" | "debug" | "info" | "warn" | "error"} LogLevel
|
|
86
|
-
*/
|
|
87
|
-
/**
|
|
88
|
-
* @typedef {object} LoggingOutputPayload
|
|
89
|
-
* @property {LogLevel} level - Log level.
|
|
90
|
-
* @property {string} message - Formatted message.
|
|
91
|
-
* @property {string} subject - Log subject.
|
|
92
|
-
* @property {Date} timestamp - Timestamp.
|
|
93
|
-
*/
|
|
94
|
-
/**
|
|
95
|
-
* @typedef {object} LoggingOutput
|
|
96
|
-
* @property {function(LoggingOutputPayload): Promise<void> | void} write - Write a log entry.
|
|
97
|
-
* @property {LogLevel[]} [levels] - Default levels for this output.
|
|
98
|
-
*/
|
|
99
|
-
/**
|
|
100
|
-
* @typedef {object} LoggingOutputConfig
|
|
101
|
-
* @property {LoggingOutput} output - Output instance.
|
|
102
|
-
* @property {Array<LogLevel>} [levels] - Levels enabled for this output.
|
|
103
|
-
*/
|
|
104
|
-
/**
|
|
105
|
-
* @typedef {LoggingOutputConfig | LoggingOutput | import("./logger/base-logger.js").default} LoggerConfig
|
|
106
|
-
*/
|
|
107
|
-
/**
|
|
108
|
-
* @typedef {object} LoggingConfiguration
|
|
109
|
-
* @property {boolean} [console] - Enable/disable console logging for request logging. Defaults to true outside of "test" and for HTTP server logs.
|
|
110
|
-
* @property {boolean} [file] - Enable/disable writing logs to a file. Defaults to true.
|
|
111
|
-
* @property {string} [directory] - Directory where log files are stored. Defaults to "<project>/log".
|
|
112
|
-
* @property {string} [filePath] - Explicit path for the log file. Defaults to "<directory>/<environment>.log".
|
|
113
|
-
* @property {Array<"debug-low-level" | "debug" | "info" | "warn" | "error">} [levels] - Override which log levels are emitted.
|
|
114
|
-
* @property {boolean} [debugLowLevel] - Convenience flag to include very low-level debug logs.
|
|
115
|
-
* @property {boolean} [queryLogging] - Enable/disable database query logging. Defaults to true outside test and false in test.
|
|
116
|
-
* @property {LoggerConfig[]} [loggers] - Logger instances (converted to outputs when configured).
|
|
117
|
-
* @property {LoggingOutputConfig[]} [outputs] - Explicit logger outputs (overrides console/file defaults when provided).
|
|
118
|
-
*/
|
|
119
|
-
/**
|
|
120
|
-
* @typedef {object} StructureSqlConfiguration
|
|
121
|
-
* @property {string[]} [enabledEnvironments] - Environments allowed to write structure sql files during automatic migration dumps.
|
|
122
|
-
* @property {string[]} [disabledEnvironments] - Environments that should skip writing structure sql files.
|
|
123
|
-
*/
|
|
124
|
-
/**
|
|
125
|
-
* @typedef {"beacon" | "polling"} BackgroundJobsDispatchStrategy
|
|
126
|
-
*
|
|
127
|
-
* - `"beacon"` (default): event-driven dispatch. The
|
|
128
|
-
* `background-jobs-main` process drains the queue on enqueue, on
|
|
129
|
-
* worker readiness, on Beacon broadcasts (so cross-process enqueues
|
|
130
|
-
* wake it), and arms a `setTimeout` for the soonest future-scheduled
|
|
131
|
-
* job. Falls back gracefully to direct in-process triggering when
|
|
132
|
-
* Beacon is not configured.
|
|
133
|
-
* - `"polling"`: legacy mode, runs a fixed-interval poll over the
|
|
134
|
-
* `background_jobs` table (see `pollIntervalMs`).
|
|
135
|
-
*/
|
|
136
|
-
/**
|
|
137
|
-
* @typedef {object} BackgroundJobsConfiguration
|
|
138
|
-
* @property {string} [host] - Hostname for the background jobs main process.
|
|
139
|
-
* @property {number} [port] - Port for the background jobs main process.
|
|
140
|
-
* @property {string} [databaseIdentifier] - Database identifier used to store background jobs.
|
|
141
|
-
* @property {number} [maxConcurrentInlineJobs] - How many `forked: false` jobs a single
|
|
142
|
-
* `background-jobs-worker` process is allowed to run in parallel. Concurrency
|
|
143
|
-
* is at the JS event-loop level: every concurrent job shares the worker's
|
|
144
|
-
* process and DB connection pool, so this should fit the pool size, not the
|
|
145
|
-
* CPU count. Forking remains the right tool for memory isolation across
|
|
146
|
-
* long-running jobs and for using more cores. Default: `4`.
|
|
147
|
-
* @property {number} [maxConcurrentForkedJobs] - How many out-of-process
|
|
148
|
-
* `"forked"` or `"spawned"` jobs a single `background-jobs-worker` is
|
|
149
|
-
* allowed to keep in flight. Default: `4`. This is a per-worker safety cap;
|
|
150
|
-
* for workload-shaped limits use per-queue caps (`queues`) instead, which are
|
|
151
|
-
* enforced cluster-wide and are immune to duplicate worker processes.
|
|
152
|
-
* @property {number} [pooledRunnerCount] - Number of warm, reusable child runners owned by each worker. Pooled capacity is separate from inline and forked/spawned capacity. Default: `4`.
|
|
153
|
-
* @property {number} [pooledRunnerConcurrency] - Number of jobs each pooled child runs concurrently on its own event loop. Total per-worker pooled capacity is `pooledRunnerCount × pooledRunnerConcurrency`. `1` (default) keeps each child serial; raise it for I/O-bound jobs so a bounded set of isolated processes handles high concurrency (like the inline lane) without one process per concurrent job. Default: `1`.
|
|
154
|
-
* @property {number} [pooledRunnerMaxJobs] - Number of sequential jobs a pooled child runs before it is replaced, bounding process-level resource accumulation. Default: `100`.
|
|
155
|
-
* @property {number} [pooledRunnerMaxRssBytes] - RSS bytes after an acknowledged job at which a pooled child is replaced. Default: `536870912` (512 MiB).
|
|
156
|
-
* @property {number} [pooledRunnerMaxLifetimeMs] - Age after an acknowledged job at which a pooled child is replaced. Default: `3600000` (one hour).
|
|
157
|
-
* @property {Record<string, {maxConcurrent?: number, priority?: number}>} [queues] - Per-queue
|
|
158
|
-
* concurrency caps and dispatch priorities, Sidekiq-style. A job declares its queue (static
|
|
159
|
-
* `queue` on the job class, or the `queue` enqueue option; defaults to `"default"`), and
|
|
160
|
-
* `queues[name].maxConcurrent` bounds how many jobs from that queue may be
|
|
161
|
-
* in flight across the whole cluster (enforced via durable per-key
|
|
162
|
-
* concurrency, so it holds regardless of how many worker processes run).
|
|
163
|
-
* Size each queue to its workload: I/O-bound queues (e.g. build runners
|
|
164
|
-
* waiting on remote Docker servers) can run far above the core count, while
|
|
165
|
-
* CPU-bound queues should stay near it. `queues[name].priority` (default `0`)
|
|
166
|
-
* makes the main process dispatch higher-priority queues before lower-priority
|
|
167
|
-
* ones regardless of enqueue order, so a small time-critical queue can never be
|
|
168
|
-
* starved by a flood of low-priority work sharing a worker pool. Unlike
|
|
169
|
-
* Sidekiq's strict queue ordering, priority composes with the per-queue caps:
|
|
170
|
-
* a higher-priority queue that is already at its `maxConcurrent` is skipped and
|
|
171
|
-
* dispatch falls through to the next eligible lower-priority job, so a busy
|
|
172
|
-
* high-priority queue does not block everything else. This fallthrough is a
|
|
173
|
-
* property of the queue-derived cap; a job that supplies its own explicit
|
|
174
|
-
* `concurrencyKey`/`maxConcurrency` bypasses the queue cap entirely (an
|
|
175
|
-
* explicit key always wins — see above) and is bounded only by that key, so it
|
|
176
|
-
* is not held back by the queue's cap and priority simply orders it normally.
|
|
177
|
-
* Priorities may be any number, including negative to sink a queue below the
|
|
178
|
-
* default. Jobs within the same priority keep FIFO (`scheduled_at`, then
|
|
179
|
-
* `created_at`) order. Default: `{}` (no queue caps, all queues priority `0`).
|
|
180
|
-
* @property {BackgroundJobsDispatchStrategy} [dispatchStrategy] - How the main process
|
|
181
|
-
* detects new work. Defaults to `"beacon"` (event-driven). Set to `"polling"`
|
|
182
|
-
* to restore the legacy fixed-interval poll.
|
|
183
|
-
* @property {number} [pollIntervalMs] - Poll interval in milliseconds. Only used
|
|
184
|
-
* when `dispatchStrategy === "polling"`. Default: `1000`.
|
|
185
|
-
* @property {number | null} [jobTimeoutMs] - Wall-clock backstop, in ms, for a
|
|
186
|
-
* `"forked"` job runner. A forked job still running after this is terminated
|
|
187
|
-
* (SIGTERM, then SIGKILL after the reaping grace) and reported failed, so a
|
|
188
|
-
* single genuinely-hung runner can't pin a draining worker — and its full-app
|
|
189
|
-
* boot and DB connections — indefinitely (e.g. across a deploy where a retired
|
|
190
|
-
* worker drains in-flight jobs). This is a coarse safety net, not per-job
|
|
191
|
-
* tuning: set it well above the longest legitimate forked job (build runners,
|
|
192
|
-
* long imports) so only genuinely-stuck runners are killed. Omit, `null`, or
|
|
193
|
-
* `<= 0` to disable (default), which preserves the prior unbounded behavior.
|
|
194
|
-
* @property {BackgroundJobsRetentionConfiguration} [retention] - Retention/pruning
|
|
195
|
-
* of terminal job rows. Without pruning the jobs table grows unbounded
|
|
196
|
-
* (completed rows accumulate forever), which bloats storage and indexes and
|
|
197
|
-
* eventually slows dispatch. The main process sweeps terminal rows past their
|
|
198
|
-
* window on an interval.
|
|
199
|
-
*/
|
|
200
|
-
/**
|
|
201
|
-
* @typedef {object} BackgroundJobsRetentionConfiguration
|
|
202
|
-
* @property {number | null} [completedTtlMs] - Delete `completed` jobs whose
|
|
203
|
-
* `completed_at_ms` is older than this many ms. `null` or `<= 0` disables
|
|
204
|
-
* completed pruning. Default: `604800000` (7 days).
|
|
205
|
-
* @property {number | null} [failedTtlMs] - Delete terminal `failed`/`orphaned`
|
|
206
|
-
* jobs older than this many ms. `null` or `<= 0` disables (keeps them for
|
|
207
|
-
* debugging). Default: `2592000000` (30 days).
|
|
208
|
-
* @property {number} [batchSize] - Rows deleted per batch. Default: `1000`.
|
|
209
|
-
* @property {number} [sweepIntervalMs] - How often the retention sweep runs.
|
|
210
|
-
* Default: `3600000` (1 hour).
|
|
211
|
-
*/
|
|
212
|
-
/**
|
|
213
|
-
* Fully-resolved retention config as returned by `getBackgroundJobsConfig()`
|
|
214
|
-
* (every field defaulted), as opposed to the partial user-provided input.
|
|
215
|
-
* @typedef {object} ResolvedBackgroundJobsRetentionConfiguration
|
|
216
|
-
* @property {number | null} completedTtlMs - Resolved completed-job TTL in ms (`null` disables).
|
|
217
|
-
* @property {number | null} failedTtlMs - Resolved failed/orphaned TTL in ms (`null` disables).
|
|
218
|
-
* @property {number} batchSize - Resolved delete batch size.
|
|
219
|
-
* @property {number} sweepIntervalMs - Resolved sweep interval in ms.
|
|
220
|
-
*/
|
|
221
|
-
/**
|
|
222
|
-
* @typedef {object} BeaconConfiguration
|
|
223
|
-
* @property {boolean} [enabled] - Whether to connect to a Beacon broker. Defaults to false unless `host`/`port` or `inProcess: true` are set, or env vars are present. Explicit `false` disables Beacon even when env vars are set.
|
|
224
|
-
* @property {boolean} [inProcess] - When true, use a module-level in-process broker singleton instead of connecting over TCP. Mutually exclusive with `host`/`port`. Useful for tests and single-process deployments.
|
|
225
|
-
* @property {string} [host] - Hostname of the Beacon broker daemon.
|
|
226
|
-
* @property {number} [port] - Port of the Beacon broker daemon.
|
|
227
|
-
* @property {string} [peerType] - Optional human-readable label for this peer (e.g. "server", "background-jobs-worker").
|
|
228
|
-
* @property {number} [unreachableReportMs] - Grace window (ms) a beacon connect/disconnect blip must persist before it is reported as a framework-error. Transient outages that recover within this window (e.g. a deploy restarting the broker) are not reported. Defaults to 30000.
|
|
229
|
-
*/
|
|
230
|
-
/**
|
|
231
|
-
* @typedef {object} HttpCompressionConfiguration
|
|
232
|
-
* @property {boolean} [enabled] - Whether buffered response compression is enabled. Defaults to true; set false to disable globally.
|
|
233
|
-
* @property {number} [threshold] - Minimum buffered body size in bytes before compression is applied. Defaults to 1024.
|
|
234
|
-
* @property {number} [brotliQuality] - Brotli encoder quality (0-11). Defaults to 4.
|
|
235
|
-
* @property {number} [gzipLevel] - Gzip compression level (0-9). Defaults to 6.
|
|
236
|
-
*/
|
|
237
|
-
/**
|
|
238
|
-
* @typedef {object} NormalizedHttpCompressionConfiguration
|
|
239
|
-
* @property {boolean} enabled - Whether buffered HTTP response compression is enabled.
|
|
240
|
-
* @property {number} threshold - Minimum buffered body size in bytes before compression is applied.
|
|
241
|
-
* @property {number} brotliQuality - Brotli encoder quality (0-11).
|
|
242
|
-
* @property {number} gzipLevel - Gzip compression level (0-9).
|
|
243
|
-
*/
|
|
244
|
-
/**
|
|
245
|
-
* @typedef {object} HttpServerConfiguration
|
|
246
|
-
* @property {boolean | HttpCompressionConfiguration} [compression] - Buffered response compression. Enabled with documented defaults when absent; false or {enabled: false} disables it globally.
|
|
247
|
-
* @property {string} [host] - Hostname to bind the HTTP server to.
|
|
248
|
-
* @property {boolean} [inProcess] - Run HTTP handlers in the main thread instead of worker threads.
|
|
249
|
-
* @property {number} [maxWorkers] - Backward-compatible alias for workers.
|
|
250
|
-
* @property {number} [port] - Port to bind the HTTP server to.
|
|
251
|
-
* @property {{maxPendingBytes?: number, maxPendingMessages?: number}} [websocketInboundQueue] - Per-session retained inbound WebSocket message limits.
|
|
252
|
-
* @property {{maxPendingBytes?: number, maxPendingFrames?: number}} [websocketOutboundQueue] - Per-client retained outbound WebSocket frame limits.
|
|
253
|
-
* @property {number} [workers] - Worker handlers to start for the HTTP server.
|
|
254
|
-
*/
|
|
255
|
-
/**
|
|
256
|
-
* @typedef {object} ScheduledBackgroundJobEveryOptions
|
|
257
|
-
* @property {number | string} [firstIn] - Delay before the first enqueue.
|
|
258
|
-
*/
|
|
259
|
-
/**
|
|
260
|
-
* @typedef {object} ScheduledBackgroundJobConfiguration
|
|
261
|
-
* @property {Array<?>} [args] - Arguments passed to the job when enqueued.
|
|
262
|
-
* @property {typeof import("./background-jobs/job.js").default} class - Job class to enqueue.
|
|
263
|
-
* @property {string} [cron] - Crontab expression (5-field POSIX, plus `@hourly`/`@daily`/`@weekly`/`@monthly`/`@yearly`/`@midnight`). Mutually exclusive with `every`.
|
|
264
|
-
* @property {boolean} [enabled] - Whether the schedule is enabled.
|
|
265
|
-
* @property {number | string | [number | string, ScheduledBackgroundJobEveryOptions]} [every] - Repeat interval. Either `every` or `cron` must be set.
|
|
266
|
-
* @property {import("./background-jobs/types.js").BackgroundJobOptions} [options] - Job options.
|
|
267
|
-
*/
|
|
268
|
-
/**
|
|
269
|
-
* @typedef {Record<string, string>} VelociousParams
|
|
270
|
-
*/
|
|
271
|
-
/**
|
|
272
|
-
* @typedef {Record<string, import("./frontend-models/query.js").FrontendModelTransportValue>} ClientErrorPayloadReporterPayload
|
|
273
|
-
*/
|
|
274
|
-
/**
|
|
275
|
-
* @typedef {object} ErrorRequestDetails
|
|
276
|
-
* @property {?} [body] - Sanitized parsed request body, when available.
|
|
277
|
-
* @property {string} httpMethod - Request HTTP method.
|
|
278
|
-
* @property {string} path - Request path.
|
|
279
|
-
*/
|
|
280
|
-
/**
|
|
281
|
-
* @typedef {object} ClientErrorPayloadContext
|
|
282
|
-
* @property {string} controller - Controller class name.
|
|
283
|
-
* @property {string} [action] - Controller action or endpoint label.
|
|
284
|
-
* @property {"index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url" | "custom-command"} [commandType] - Frontend-model command type.
|
|
285
|
-
* @property {boolean} [expectedError] - Whether the error is an expected user-flow failure.
|
|
286
|
-
* @property {boolean} [frontendModelEndpoint] - Whether the error came from the frontend-model endpoint.
|
|
287
|
-
* @property {string} [model] - Frontend-model name from the failed request.
|
|
288
|
-
* @property {string} [requestId] - Shared frontend-model request id.
|
|
289
|
-
*/
|
|
290
|
-
/**
|
|
291
|
-
* @typedef {function({
|
|
292
|
-
* context: ClientErrorPayloadContext,
|
|
293
|
-
* error: Error,
|
|
294
|
-
* request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined,
|
|
295
|
-
* requestDetails: ErrorRequestDetails | null
|
|
296
|
-
* }): Promise<ClientErrorPayloadReporterPayload | void> | ClientErrorPayloadReporterPayload | void} ClientErrorPayloadReporterType
|
|
297
|
-
*/
|
|
298
|
-
/**
|
|
299
|
-
* @typedef {Record<string, unknown> & {configuration?: import("./configuration.js").default, currentDevice?: unknown, currentUser?: unknown, modelRegistry?: Record<string, unknown> | {model: (name: string) => unknown}, now?: Date | (() => Date), offlineGrant?: unknown, params?: VelociousParams, request?: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default, resourceRuntime?: "backend" | "frontend" | "offline"}} VelociousLooseObject
|
|
300
|
-
*/
|
|
301
|
-
/**
|
|
302
|
-
* @typedef {new (args: {attachmentName?: string, configuration: import("./configuration.js").default, modelClass?: typeof import("./database/record/index.js").default, name?: string, options?: Record<string, ?>}) => object} AttachmentDriverConstructor
|
|
303
|
-
*/
|
|
304
|
-
/**
|
|
305
|
-
* @typedef {object} ScheduledBackgroundJobsConfiguration
|
|
306
|
-
* @property {Record<string, ScheduledBackgroundJobConfiguration>} jobs - Scheduled jobs keyed by name.
|
|
307
|
-
*/
|
|
308
|
-
/**
|
|
309
|
-
* @typedef {function({configuration: import("./configuration.js").default}) : ScheduledBackgroundJobsConfiguration | Promise<ScheduledBackgroundJobsConfiguration>} ScheduledBackgroundJobsLoaderType
|
|
310
|
-
*/
|
|
311
|
-
/**
|
|
312
|
-
* @typedef {object} AttachmentDriverConfiguration
|
|
313
|
-
* @property {function({configuration: import("./configuration.js").default, name: string, options: Record<string, ?>}) : Record<string, ?>} [create] - Optional factory for a custom attachment driver instance.
|
|
314
|
-
* @property {AttachmentDriverConstructor} [driverClass] - Optional custom attachment driver class.
|
|
315
|
-
* @property {Record<string, ?>} [instance] - Optional custom attachment driver instance.
|
|
316
|
-
*/
|
|
317
|
-
/**
|
|
318
|
-
* @typedef {object} AttachmentsConfiguration
|
|
319
|
-
* @property {string} [defaultDriver] - Default attachment storage driver name.
|
|
320
|
-
* @property {Record<string, AttachmentDriverConfiguration & Record<string, ?>>} [drivers] - Named attachment driver configurations.
|
|
321
|
-
* @property {boolean} [allowPathInput] - Whether `{path: ...}` attachment input is allowed.
|
|
322
|
-
* @property {string[]} [allowedPathPrefixes] - Optional allowlist of directories for `{path: ...}` input.
|
|
323
|
-
*/
|
|
324
|
-
/**
|
|
325
|
-
* @typedef {object} MailerBackend
|
|
326
|
-
* @property {function({payload: import("./mailer.js").MailerDeliveryPayload, configuration: import("./configuration.js").default}) : Promise<?> | ?} deliver - Deliver a mailer payload.
|
|
327
|
-
*/
|
|
328
|
-
/**
|
|
329
|
-
* @typedef {Record<string, string[]>} LocaleFallbacksType
|
|
330
|
-
*/
|
|
331
|
-
/**
|
|
332
|
-
* @typedef {object} FrontendModelRelationshipConfiguration
|
|
333
|
-
* @property {"belongsTo" | "hasOne" | "hasMany"} type - Relationship type.
|
|
334
|
-
* @property {string} [model] - Target model class name.
|
|
335
|
-
* @property {string} [className] - Alias of target model class name.
|
|
336
|
-
* @property {string} [modelClassName] - Explicit target model class name.
|
|
337
|
-
*/
|
|
338
|
-
/**
|
|
339
|
-
* @typedef {object} FrontendModelAttributeConfiguration
|
|
340
|
-
* @property {string} [type] - Column type name.
|
|
341
|
-
* @property {string} [columnType] - Alias for column type name.
|
|
342
|
-
* @property {string} [sqlType] - Alias for column type name.
|
|
343
|
-
* @property {string} [dataType] - Alias for column type name.
|
|
344
|
-
* @property {string} [jsDocType] - Exact generated JSDoc type for non-column attributes.
|
|
345
|
-
* @property {string} [name] - Attribute name when configured as an array entry.
|
|
346
|
-
* @property {boolean} [null] - Whether value can be null.
|
|
347
|
-
* @property {boolean} [selectedByDefault] - Whether included in default serialization. Defaults to true.
|
|
348
|
-
*/
|
|
349
|
-
/**
|
|
350
|
-
* @typedef {object} FrontendModelAttachmentConfiguration
|
|
351
|
-
* @property {"hasOne" | "hasMany"} type - Attachment cardinality.
|
|
352
|
-
*/
|
|
353
|
-
/**
|
|
354
|
-
* @typedef {object} FrontendModelResourceConfiguration
|
|
355
|
-
* @property {Array<string | FrontendModelAttributeConfiguration> | Record<string, FrontendModelAttributeConfiguration | import("./database/drivers/base-column.js").default | boolean>} attributes - Attributes to expose on the frontend model.
|
|
356
|
-
* @property {string[]} [abilities] - Additional camelCase ability action names to expose for per-record `record.can(action)` reads. Base CRUD actions (`read`, `create`, `update`, `destroy`) are always included and must not be listed here.
|
|
357
|
-
* @property {Record<string, FrontendModelAttachmentConfiguration>} [attachments] - Attachment helpers keyed by attachment name.
|
|
358
|
-
* @property {string[]} [commands] - Legacy built-in command names (`index`, `find`, `create`, `update`, `destroy`, `attach`, `download`, `url`).
|
|
359
|
-
* @property {Array<FrontendModelResourceCustomCommand>} [collectionCommands] - Custom collection commands. Each entry is a camelCase method name, or a `{name, args?, returnType?}` object declaring typed arguments and/or a response type. The runtime derives the kebab-case command slug from the name.
|
|
360
|
-
* @property {Array<FrontendModelResourceCustomCommand>} [memberCommands] - Custom member commands. Each entry is a camelCase method name, or a `{name, args?, returnType?}` object declaring typed arguments and/or a response type. The runtime derives the kebab-case command slug from the name.
|
|
361
|
-
* @property {string[]} [builtInCollectionCommands] - Built-in collection command names (`index`, `create`).
|
|
362
|
-
* @property {string[]} [builtInMemberCommands] - Built-in member command names (`find`, `update`, `destroy`, `attach`, `download`, `url`).
|
|
363
|
-
* @property {string} [modelName] - Frontend model name override.
|
|
364
|
-
* @property {string[]} [relationships] - Relationship names to expose in frontend models. Type and target model are inferred from the backend model's registered relationships.
|
|
365
|
-
* @property {string} [primaryKey] - Primary key attribute name.
|
|
366
|
-
* @property {FrontendModelResourceServerConfiguration} [server] - Optional legacy backend behavior overrides for built-in frontend actions.
|
|
367
|
-
* @property {FrontendModelResourceSyncConfiguration | boolean} [sync] - Optional safe local/offline sync policy metadata. `policy` participates in the hash but is not exposed to generated frontend config/manifest.
|
|
368
|
-
*/
|
|
369
|
-
/**
|
|
370
|
-
* Object form of a custom command entry, declaring its typed arguments and/or
|
|
371
|
-
* response type alongside the command name.
|
|
372
|
-
* @typedef {object} FrontendModelResourceCustomCommandObject
|
|
373
|
-
* @property {string} name - camelCase command method name.
|
|
374
|
-
* @property {Array<{name: string, type: string}>} [args] - Typed command arguments; each generates a named, typed method parameter mapped positionally into the command payload. `type` is a JSDoc type string.
|
|
375
|
-
* @property {string} [returnType] - JSDoc type for the command response. When set, the generated method is typed `Promise<returnType>` instead of `Promise<Record<string, ?>>`. Emitted verbatim into the generated frontend model, so it must resolve there.
|
|
376
|
-
*/
|
|
377
|
-
/**
|
|
378
|
-
* A custom command entry: a plain camelCase method name, or an object declaring
|
|
379
|
-
* typed args and/or a response type.
|
|
380
|
-
* @typedef {string | FrontendModelResourceCustomCommandObject} FrontendModelResourceCustomCommand
|
|
381
|
-
*/
|
|
382
|
-
/**
|
|
383
|
-
* JSON value accepted by sync policy metadata/hash inputs.
|
|
384
|
-
* @typedef {null | string | number | boolean | unknown[] | Record<string, unknown>} FrontendModelSyncJsonValue
|
|
385
|
-
*/
|
|
386
|
-
/**
|
|
387
|
-
* Frontend-model local/offline sync policy config. `metadata` is exposed to
|
|
388
|
-
* frontends and peers; `policy` is hashed but intentionally omitted from
|
|
389
|
-
* frontend-safe manifests.
|
|
390
|
-
* @typedef {object} FrontendModelResourceSyncConfiguration
|
|
391
|
-
* @property {"optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly"} [conflictStrategy] - Strategy used when replay detects server/client divergence. Defaults to `optimisticVersion`.
|
|
392
|
-
* @property {boolean} [enabled] - Whether the resource is sync-enabled. Defaults to true when `sync` is configured.
|
|
393
|
-
* @property {string[]} [operations] - Sync operation names such as `index`, `find`, `create`, `update`, custom domain commands, etc.
|
|
394
|
-
* @property {string | number} [policyVersion] - App-controlled policy version used as a stable change signal.
|
|
395
|
-
* @property {Record<string, FrontendModelSyncJsonValue>} [metadata] - Safe frontend-visible metadata.
|
|
396
|
-
* @property {Record<string, FrontendModelSyncJsonValue>} [policy] - Deterministic non-secret policy inputs included in the policy hash only.
|
|
397
|
-
*/
|
|
398
|
-
/**
|
|
399
|
-
* Velocious sync API endpoint configuration.
|
|
400
|
-
* @typedef {object} VelociousSyncApiConfiguration
|
|
401
|
-
* @property {string} [mountPath] - Mount path for the sync endpoints. Defaults to "/velocious/sync".
|
|
402
|
-
* @property {FrontendModelResourceClassType} resourceClass - App sync resource class served by the auto-mounted sync endpoints.
|
|
403
|
-
*/
|
|
404
|
-
/**
|
|
405
|
-
* Client-side sync transport owning HTTP POSTs to the framework sync endpoints,
|
|
406
|
-
* matching the frontend-model websocket client post contract.
|
|
407
|
-
* @typedef {object} VelociousSyncClientTransport
|
|
408
|
-
* @property {(path: string, body?: ?, options?: {headers?: Record<string, string>}) => Promise<{json: () => ?}>} post - Posts one request and resolves a response with a json accessor.
|
|
409
|
-
*/
|
|
410
|
-
/**
|
|
411
|
-
* Websocket client contract required from `sync.client.realtime.createClient`,
|
|
412
|
-
* matching `VelociousWebsocketClient` / snapreq's websocket client.
|
|
413
|
-
* @typedef {object} VelociousSyncRealtimeWebsocketClient
|
|
414
|
-
* @property {() => Promise<?>} connect - Connects the websocket.
|
|
415
|
-
* @property {(channelType: string, options?: {params?: Record<string, ?>, onMessage?: (body: ?) => void, onResume?: () => void, onClose?: (reason: string) => void}) => VelociousSyncRealtimeSubscription} subscribeChannel - Opens one channel subscription.
|
|
416
|
-
* @property {() => Promise<void>} disconnectAndStopReconnect - Closes the socket and stops auto-reconnect.
|
|
417
|
-
*/
|
|
418
|
-
/**
|
|
419
|
-
* Channel subscription handle returned by `subscribeChannel`.
|
|
420
|
-
* @typedef {object} VelociousSyncRealtimeSubscription
|
|
421
|
-
* @property {() => void} close - Closes the subscription.
|
|
422
|
-
* @property {() => boolean} isReady - Whether the subscription is acknowledged and ready.
|
|
423
|
-
* @property {(params?: {timeoutMs?: number}) => Promise<void>} waitForReady - Resolves once the server acknowledges the subscription.
|
|
424
|
-
*/
|
|
425
|
-
/**
|
|
426
|
-
* One realtime channel subscription descriptor.
|
|
427
|
-
* @typedef {object} VelociousSyncRealtimeChannelDescriptor
|
|
428
|
-
* @property {string} channel - Server channel name to subscribe.
|
|
429
|
-
* @property {Record<string, ?>} [params] - Subscribe params (runtime scope values). The framework injects `authenticationToken` automatically.
|
|
430
|
-
* @property {string} [resourceType] - Default resource/model name for pushed changes that do not carry their own resourceType.
|
|
431
|
-
*/
|
|
432
|
-
/**
|
|
433
|
-
* Realtime push configuration for the sync client. Only the genuinely
|
|
434
|
-
* app-owned callback lives here: how to build the websocket client.
|
|
435
|
-
* Everything else - deriving the framework sync channel subscriptions from
|
|
436
|
-
* the declared pull scopes, subscribing, applying pushes through the derived
|
|
437
|
-
* resource applier, echo suppression, and pull-on-reconnect - is derived.
|
|
438
|
-
* @typedef {object} VelociousSyncClientRealtimeConfiguration
|
|
439
|
-
* @property {() => VelociousSyncRealtimeWebsocketClient | Promise<VelociousSyncRealtimeWebsocketClient>} createClient - Builds the (unconnected) websocket client; the framework owns connect/disconnect.
|
|
440
|
-
* @property {(context: ?) => Array<VelociousSyncRealtimeChannelDescriptor> | Promise<Array<VelociousSyncRealtimeChannelDescriptor>>} [channels] - Deprecated legacy escape hatch: resolves extra app-channel descriptors from the `subscribeRealtime(context)` context. Declared pull scopes subscribe the framework sync channel automatically.
|
|
441
|
-
* @property {() => string | Promise<string>} [localOrigin] - Resolves this device's echo origin; pushed messages with a matching `echoOrigin` are dropped.
|
|
442
|
-
* @property {boolean} [pullOnReconnect] - Fire a coalesced `pull()` when subscriptions become ready or resume after a drop, closing offline gaps. Defaults to true.
|
|
443
|
-
*/
|
|
444
|
-
/**
|
|
445
|
-
* Client-side sync configuration consumed by `SyncClient.fromConfiguration(...)`.
|
|
446
|
-
* The framework owns the `${mountPath}/changes` and `${mountPath}/replay`
|
|
447
|
-
* POSTers over the given transport.
|
|
448
|
-
* @typedef {object} VelociousSyncClientConfiguration
|
|
449
|
-
* @property {() => string | Promise<string>} authenticationToken - Resolves the auth token sent with sync requests.
|
|
450
|
-
* @property {number} [batchSize] - Max syncs per request.
|
|
451
|
-
* @property {() => boolean | Promise<boolean>} [isOnline] - Connectivity gate for pulls and replays. Defaults to always online.
|
|
452
|
-
* @property {string} [mountPath] - Mount path the server serves the sync endpoints under (match the server's `sync.api.mountPath`). Defaults to "/velocious/sync"; normalization strips trailing slashes and always fills in the default.
|
|
453
|
-
* @property {(error: Error) => void} [onError] - Reports background replay/pull failures. Defaults to rethrowing.
|
|
454
|
-
* @property {VelociousSyncClientRealtimeConfiguration} [realtime] - Realtime push configuration consumed by `subscribeRealtime(...)`.
|
|
455
|
-
* @property {VelociousSyncClientTransport} transport - Transport posting to the framework sync endpoints (e.g. the frontend-model websocket client).
|
|
456
|
-
* @property {VelociousSyncRealtimeWebsocketClient} [websocketClient] - Shared app-lifetime websocket client (the low-level form) that all sync traffic rides. Provide the same instance the frontend-model transport uses so one connection carries everything. When set, the realtime bridge subscribes channels on it and never owns its lifecycle: unsubscribing closes only channel subscriptions, leaving the socket connected.
|
|
457
|
-
* @property {string | (() => string | null | undefined)} [websocketUrl] - Shared app-lifetime websocket URL. When set (and no `websocketClient` is given), the framework builds and owns one reconnecting `VelociousWebsocketClient` for all sync traffic, connected on first use.
|
|
458
|
-
*/
|
|
459
|
-
/**
|
|
460
|
-
* Velocious sync configuration.
|
|
461
|
-
* @typedef {object} VelociousSyncConfiguration
|
|
462
|
-
* @property {VelociousSyncApiConfiguration} [api] - Auto-mounts the Velocious sync changes/replay endpoints for this resource class.
|
|
463
|
-
* @property {VelociousSyncClientConfiguration} [client] - Client-side sync configuration consumed by `SyncClient.fromConfiguration(...)`.
|
|
464
|
-
* @property {import("./sync/device-identity.js").SyncJsonWebKey | null} [deviceCertificateBackendPublicKey] - Public backend key used to verify offline device certificates for sync replay.
|
|
465
|
-
* @property {number} [changeFeedRetentionSize] - Number of accepted server changes retained before clients must refresh from snapshot.
|
|
466
|
-
* @property {Array<import("./sync/offline-grant.js").OfflineGrantSigningKey>} offlineGrantSigningKeys - Signing keys used to issue and verify offline grants. Secrets must never be exposed to clients.
|
|
467
|
-
* @property {number} [offlineGrantTtlMs] - Default offline grant TTL in milliseconds. Defaults to 24 hours.
|
|
468
|
-
*/
|
|
469
|
-
/**
|
|
470
|
-
* Frontend-safe normalized sync metadata.
|
|
471
|
-
* @typedef {object} NormalizedFrontendModelResourceSyncConfiguration
|
|
472
|
-
* @property {"optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly"} conflictStrategy - Normalized replay conflict strategy.
|
|
473
|
-
* @property {boolean} enabled - Whether the resource is sync-enabled.
|
|
474
|
-
* @property {string[]} operations - Sorted, duplicate-free sync operation names.
|
|
475
|
-
* @property {string | null} policyVersion - App-controlled policy version, or null.
|
|
476
|
-
* @property {string} policyHash - Deterministic sha256 hash of safe policy inputs.
|
|
477
|
-
* @property {Record<string, FrontendModelSyncJsonValue>} [metadata] - Safe frontend-visible metadata.
|
|
478
|
-
*/
|
|
479
|
-
/**
|
|
480
|
-
* @typedef {Omit<FrontendModelResourceConfiguration, "abilities" | "builtInCollectionCommands" | "builtInMemberCommands" | "collectionCommands" | "commands" | "memberCommands" | "sync"> & {
|
|
481
|
-
* abilities: FrontendModelResourceAbilitiesConfiguration
|
|
482
|
-
* builtInCollectionCommands: Record<string, string>
|
|
483
|
-
* builtInMemberCommands: Record<string, string>
|
|
484
|
-
* collectionCommands: Record<string, string>
|
|
485
|
-
* commandMetadata: Record<string, {args: Array<{name: string, type: string}>, returnType: string | null}>
|
|
486
|
-
* memberCommands: Record<string, string>
|
|
487
|
-
* sync?: NormalizedFrontendModelResourceSyncConfiguration
|
|
488
|
-
* }} NormalizedFrontendModelResourceConfiguration
|
|
489
|
-
*/
|
|
490
|
-
/**
|
|
491
|
-
* @typedef {Omit<typeof import("./frontend-model-resource/base-resource.js").default, never> & {new (args: import("./frontend-model-resource/base-resource.js").FrontendModelResourceAbilityArgs | import("./frontend-model-resource/base-resource.js").FrontendModelResourceControllerArgs): import("./frontend-model-resource/base-resource.js").default<typeof import("./database/record/index.js").default>}} FrontendModelResourceClassType
|
|
492
|
-
*/
|
|
493
|
-
/**
|
|
494
|
-
* @typedef {FrontendModelResourceClassType} FrontendModelResourceDefinition
|
|
495
|
-
*/
|
|
496
|
-
/**
|
|
497
|
-
* @typedef {object} FrontendModelResourceAbilitiesConfiguration
|
|
498
|
-
* @property {string} [index] - Ability action for frontend index.
|
|
499
|
-
* @property {string} [find] - Ability action for frontend find.
|
|
500
|
-
* @property {string} [create] - Ability action for frontend create.
|
|
501
|
-
* @property {string} [update] - Ability action for frontend update.
|
|
502
|
-
* @property {string} [destroy] - Ability action for frontend destroy.
|
|
503
|
-
*/
|
|
504
|
-
/**
|
|
505
|
-
* @typedef {object} FrontendModelResourceServerConfiguration
|
|
506
|
-
* @property {function({action: "index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url", controller: import("./controller.js").default, params: Record<string, ?>, modelClass: typeof import("./database/record/index.js").default}) : (boolean | void | Promise<boolean | void>)} [beforeAction] - Optional callback run before built-in frontend actions.
|
|
507
|
-
* @property {function({action: "index", controller: import("./controller.js").default, params: Record<string, ?>, modelClass: typeof import("./database/record/index.js").default}) : Promise<import("./database/record/index.js").default[]>} [records] - Records loader for frontendIndex.
|
|
508
|
-
* @property {function({action: "index" | "find" | "create" | "update", controller: import("./controller.js").default, params: Record<string, ?>, modelClass: typeof import("./database/record/index.js").default, model: import("./database/record/index.js").default}) : Record<string, ?> | Promise<Record<string, ?>>} [serialize] - Record serializer for response payloads.
|
|
509
|
-
* @property {function({action: "find" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url", controller: import("./controller.js").default, params: Record<string, ?>, modelClass: typeof import("./database/record/index.js").default, id: string | number}) : Promise<import("./database/record/index.js").default | null>} [find] - Record loader for find/update/destroy/attach/download/url actions.
|
|
510
|
-
* @property {function({action: "create", controller: import("./controller.js").default, params: Record<string, ?>, modelClass: typeof import("./database/record/index.js").default, attributes: Record<string, ?>}) : Promise<import("./database/record/index.js").default>} [create] - Custom create callback.
|
|
511
|
-
* @property {function({action: "update", controller: import("./controller.js").default, params: Record<string, ?>, modelClass: typeof import("./database/record/index.js").default, model: import("./database/record/index.js").default, attributes: Record<string, ?>}) : Promise<import("./database/record/index.js").default | void>} [update] - Custom update callback.
|
|
512
|
-
* @property {function({action: "destroy", controller: import("./controller.js").default, params: Record<string, ?>, modelClass: typeof import("./database/record/index.js").default, model: import("./database/record/index.js").default}) : Promise<void>} [destroy] - Custom destroy callback.
|
|
513
|
-
*/
|
|
514
|
-
/**
|
|
515
|
-
* @typedef {object} BackendProjectConfiguration
|
|
516
|
-
* @property {string} path - Path to the backend project. May be an app root or a contributing package root (package entries are appended internally from `packages`).
|
|
517
|
-
* @property {string} [frontendModelsOutputPath] - Optional output project path where `src/frontend-models` should be generated.
|
|
518
|
-
* @property {string} [resourcesPath] - Optional override for the resources directory to auto-discover; defaults to `<path>/src/resources`. Set internally for package entries.
|
|
519
|
-
* @property {Record<string, FrontendModelResourceDefinition>} [frontendModels] - Auto-discovered frontend model definitions keyed by model class name. Set internally by the environment handler — do not set manually.
|
|
520
|
-
* @property {AbilityResourceClassType[]} [abilityResources] - Auto-discovered ability resource classes (frontend-model and authorization) from this project's resources directory. Set internally by the environment handler — do not set manually.
|
|
521
|
-
*/
|
|
522
|
-
/**
|
|
523
|
-
* A descriptor for an external Velocious package (engine) that contributes models,
|
|
524
|
-
* resources and migrations. A package usually exports `new VelociousPackage({name, url: import.meta.url})`.
|
|
525
|
-
* @typedef {object} VelociousPackageDescriptor
|
|
526
|
-
* @property {string} name - The package name.
|
|
527
|
-
* @property {string} [url] - The descriptor module's `import.meta.url`; the package root is derived from it when `path` is omitted.
|
|
528
|
-
* @property {string} [path] - The package root directory (the one containing `src`). Derived from `url` when omitted.
|
|
529
|
-
* @property {string} [modelsPath] - Override for the package's models directory (default `<path>/src/models`).
|
|
530
|
-
* @property {string} [resourcesPath] - Override for the package's frontend-model resources directory (default `<path>/src/resources`).
|
|
531
|
-
* @property {string} [migrationsPath] - Override for the package's migrations directory (default `<path>/src/database/migrations`).
|
|
532
|
-
*/
|
|
533
|
-
/**
|
|
534
|
-
* @typedef {import("./packages/velocious-package.js").default | VelociousPackageDescriptor} VelociousPackageConfiguration
|
|
535
|
-
*/
|
|
536
|
-
/**
|
|
537
|
-
* @typedef {object} RouteResolverHookArgs
|
|
538
|
-
* @property {import("./configuration.js").default} configuration - Configuration instance.
|
|
539
|
-
* @property {Record<string, ?>} params - Mutable request params object.
|
|
540
|
-
* @property {string} currentPath - Request path without query.
|
|
541
|
-
* @property {boolean} [hasMatchingCustomRoute] - True when matching a configured custom route.
|
|
542
|
-
* @property {import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default} request - Request object.
|
|
543
|
-
* @property {import("./http-server/client/response.js").default} response - Response object.
|
|
544
|
-
* @property {import("./routes/resolver.js").default} resolver - Resolver instance.
|
|
545
|
-
*/
|
|
546
|
-
/**
|
|
547
|
-
* @typedef {object} RouteResolverHookResult
|
|
548
|
-
* @property {string} action - Dasherized action name (for example `frontend-index`).
|
|
549
|
-
* @property {string} controller - Controller path (for example `accounts`).
|
|
550
|
-
* @property {typeof import("./controller.js").default} [controllerClass] - Optional controller class override.
|
|
551
|
-
* @property {string} [controllerPath] - Optional absolute/relative controller file path override.
|
|
552
|
-
* @property {Record<string, ?>} [params] - Extra params to merge for controller/action.
|
|
553
|
-
* @property {boolean} [skipAbilityResolution] - Whether to run the controller action without resolving request ability.
|
|
554
|
-
* @property {boolean} [skipControllerConnections] - Whether to run the controller action without the automatic database checkout wrapper.
|
|
555
|
-
* @property {boolean} [skipTenantResolution] - Whether to run the controller action without resolving request tenant.
|
|
556
|
-
* @property {string} [viewPath] - Optional view path override used by controller render lookups.
|
|
557
|
-
*/
|
|
558
|
-
/**
|
|
559
|
-
* @typedef {function(RouteResolverHookArgs) : RouteResolverHookResult | null | Promise<RouteResolverHookResult | null>} RouteResolverHookType
|
|
560
|
-
*/
|
|
561
|
-
/**
|
|
562
|
-
* @typedef {typeof import("./authorization/base-resource.js").default} AbilityResourceClassType
|
|
563
|
-
*/
|
|
564
|
-
/**
|
|
565
|
-
* @typedef {function({configuration: import("./configuration.js").default, params: Record<string, ?>, request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, response: import("./http-server/client/response.js").default | undefined}) : import("./authorization/ability.js").default | void | Promise<import("./authorization/ability.js").default | void>} AbilityResolverType
|
|
566
|
-
*/
|
|
567
|
-
/**
|
|
568
|
-
* @typedef {function({configuration: import("./configuration.js").default, params: Record<string, ?>, request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, response: import("./http-server/client/response.js").default | undefined, subscription?: {channel: string, params?: Record<string, ?>}}) : ? | void | Promise<? | void>} TenantResolverType
|
|
569
|
-
*/
|
|
570
|
-
/**
|
|
571
|
-
* @typedef {function({configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ?}) : DatabaseConfigurationType | Partial<DatabaseConfigurationType> | void} TenantDatabaseResolverType
|
|
572
|
-
*/
|
|
573
|
-
/**
|
|
574
|
-
* @typedef {object} ApiManifestConfiguration
|
|
575
|
-
* @property {string} [path] - HTTP path for the built-in API manifest endpoint. Defaults to `/api/manifest`.
|
|
576
|
-
* @property {string} [token] - Bearer token required in the `Authorization: Bearer <token>` header. When set, requests without a matching token are not routed (404), so the endpoint stays hidden.
|
|
577
|
-
*/
|
|
578
|
-
/**
|
|
579
|
-
* @typedef {object} DebugEndpointConfiguration
|
|
580
|
-
* @property {string} [path] - HTTP path for the built-in debug endpoint. Defaults to `/velocious/debug`.
|
|
581
|
-
* @property {string} [token] - Bearer token required in the `Authorization: Bearer <token>` header. When set, requests without a matching token are not routed (404), so the endpoint stays hidden.
|
|
582
|
-
*/
|
|
583
|
-
/**
|
|
584
|
-
* @typedef {object} TenantDatabaseProviderType
|
|
585
|
-
* @property {function({configuration: import("./configuration.js").default, identifier: string}) : Array<?> | Promise<Array<?>>} listTenants - Lists tenants that should be created, checked, or migrated for this database identifier.
|
|
586
|
-
* @property {function({configuration: import("./configuration.js").default, identifier: string}) : Array<?> | Promise<Array<?>>} [listRestrictTenants] - Lists existing tenants that should be checked for dependent restrict destroys. Defaults to listTenants.
|
|
587
|
-
* @property {function({configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ?}) : void | Promise<void>} [createDatabase] - Creates the tenant database/schema for one tenant.
|
|
588
|
-
* @property {function({configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ?}) : void | Promise<void>} [dropDatabase] - Drops the tenant database/schema for one tenant.
|
|
589
|
-
* @property {function({configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ?}) : void | Promise<void>} [checkTenant] - Checks one tenant database before generic connection validation.
|
|
590
|
-
* @property {function({configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, migrationsApplied: number, tenant: ?}) : void | Promise<void>} [afterMigrateTenant] - Runs app-owned tenant work after generic migrations for one tenant. `migrationsApplied` is how many migrations actually ran (0 when the tenant was already up to date), so the app can skip expensive per-tenant work on no-op deploys.
|
|
591
|
-
*/
|
|
592
|
-
/**
|
|
593
|
-
* @typedef {object} ConfigurationArgsType
|
|
594
|
-
* @property {boolean} [autoload] - Globally enable auto-batch-preload of relationships on lazy access. Default true.
|
|
595
|
-
* @property {CorsType} [cors] - CORS configuration for the HTTP server.
|
|
596
|
-
* @property {string} [cookieSecret] - Secret for encrypting cookies.
|
|
597
|
-
* @property {AbilityResourceClassType[]} [abilityResources] - Resource classes used to define abilities per model.
|
|
598
|
-
* @property {AbilityResolverType} [abilityResolver] - Resolver for creating request-scoped ability instances.
|
|
599
|
-
* @property {AttachmentsConfiguration} [attachments] - Attachment storage configuration.
|
|
600
|
-
* @property {BackendProjectConfiguration[]} [backendProjects] - Backend project definitions used for frontend model generation.
|
|
601
|
-
* @property {VelociousPackageConfiguration[]} [packages] - External Velocious packages that contribute models, frontend-model resources and migrations.
|
|
602
|
-
* @property {{[key: string]: {[key: string]: DatabaseConfigurationType}}} database - Database configurations keyed by environment and identifier.
|
|
603
|
-
* @property {boolean} [debug] - Enable debug logging.
|
|
604
|
-
* @property {boolean | DebugEndpointConfiguration} [debugEndpoint] - Enable the built-in debug endpoint. Defaults to false.
|
|
605
|
-
* @property {boolean | ApiManifestConfiguration} [apiManifest] - Enable the built-in API manifest endpoint. Defaults to false.
|
|
606
|
-
* @property {string} [directory] - Base directory for the project.
|
|
607
|
-
* @property {boolean} [enforceTenantDatabaseScopes] - Require tenant-switched model queries to resolve a tenant database identifier. Defaults to true.
|
|
608
|
-
* @property {string} [environment] - Current environment name.
|
|
609
|
-
* @property {import("./environment-handlers/base.js").default} environmentHandler - Environment handler instance.
|
|
610
|
-
* @property {boolean} [exposeInternalErrorsToClients] - Return unexpected internal error details in client API payloads outside production. Defaults to false.
|
|
611
|
-
* @property {HttpServerConfiguration} [httpServer] - Default HTTP server configuration for applications started from this configuration.
|
|
612
|
-
* @property {LoggingConfiguration} [logging] - Logging configuration.
|
|
613
|
-
* @property {BackgroundJobsConfiguration} [backgroundJobs] - Background jobs configuration.
|
|
614
|
-
* @property {BeaconConfiguration} [beacon] - Beacon broadcast bus configuration.
|
|
615
|
-
* @property {ScheduledBackgroundJobsConfiguration | ScheduledBackgroundJobsLoaderType} [scheduledBackgroundJobs] - Scheduled background jobs configuration.
|
|
616
|
-
* @property {MailerBackend} [mailerBackend] - Mail delivery backend.
|
|
617
|
-
* @property {function({configuration: import("./configuration.js").default, type: string}) : void} initializeModels - Hook to register models for a given initialization type.
|
|
618
|
-
* @property {InitializersType} [initializers] - Initializer loader for environment bootstrapping.
|
|
619
|
-
* @property {string | function() : string} locale - Default locale or locale resolver.
|
|
620
|
-
* @property {string[]} locales - Supported locales.
|
|
621
|
-
* @property {LocaleFallbacksType} localeFallbacks - Locale fallback map.
|
|
622
|
-
* @property {StructureSqlConfiguration} [structureSql] - Structure SQL generation configuration.
|
|
623
|
-
* @property {VelociousSyncConfiguration} [sync] - Local/offline sync framework configuration.
|
|
624
|
-
* @property {TenantResolverType} [tenantResolver] - Resolver for creating request-scoped tenant context objects.
|
|
625
|
-
* @property {TenantDatabaseResolverType} [tenantDatabaseResolver] - Resolver for deriving tenant-specific database config overrides.
|
|
626
|
-
* @property {Record<string, TenantDatabaseProviderType>} [tenantDatabaseProviders] - Tenant database lifecycle providers keyed by database identifier.
|
|
627
|
-
* @property {string} [testing] - Path to the testing configuration file.
|
|
628
|
-
* @property {string | (() => string | undefined)} [timeZone] - Default timezone for timezone-less datetime strings.
|
|
629
|
-
* @property {number | (() => number)} [timezoneOffsetMinutes] - Default timezone offset in minutes.
|
|
630
|
-
* @property {string | string[]} [trustedProxies] - Trusted reverse proxy address ranges used to resolve request remote addresses from forwarding headers.
|
|
631
|
-
* @property {number | (() => number)} [requestTimeoutMs] - Timeout in seconds for completing a HTTP request.
|
|
632
|
-
* @property {RouteResolverHookType[]} [routeResolverHooks] - Hook callbacks that can hijack unresolved routes.
|
|
633
|
-
* @property {WebsocketChannelResolverType} [websocketChannelResolver] - Resolve a websocket channel class/instance for each connection.
|
|
634
|
-
* @property {WebsocketMessageHandlerResolverType} [websocketMessageHandlerResolver] - Resolve a raw websocket message handler for each connection.
|
|
635
|
-
*/
|
|
636
|
-
export const nothing: {};
|
|
637
|
-
export type CorsType = (arg0: {
|
|
1
|
+
export type CorsType = (args: {
|
|
638
2
|
request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default;
|
|
639
3
|
response: import("./http-server/client/response.js").default;
|
|
640
4
|
}) => Promise<void>;
|
|
641
|
-
export type WebsocketChannelResolverType = (
|
|
5
|
+
export type WebsocketChannelResolverType = (args: {
|
|
642
6
|
request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined;
|
|
643
7
|
subscription?: {
|
|
644
8
|
channel: string;
|
|
645
|
-
params?: Record<string,
|
|
9
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
646
10
|
};
|
|
647
11
|
client: import("./http-server/client/index.js").default;
|
|
648
12
|
websocketSession: import("./http-server/client/websocket-session.js").default;
|
|
@@ -652,31 +16,31 @@ export type WebsocketMessageHandler = {
|
|
|
652
16
|
/**
|
|
653
17
|
* - Handler for incoming websocket messages.
|
|
654
18
|
*/
|
|
655
|
-
onMessage?: (
|
|
656
|
-
message:
|
|
19
|
+
onMessage?: (args: {
|
|
20
|
+
message: ReturnType<typeof JSON.parse>;
|
|
657
21
|
session: import("./http-server/client/websocket-session.js").default;
|
|
658
|
-
}) => Promise<void> | void
|
|
22
|
+
}) => Promise<void> | void;
|
|
659
23
|
/**
|
|
660
24
|
* - Handler when the websocket session opens.
|
|
661
25
|
*/
|
|
662
|
-
onOpen?: (
|
|
26
|
+
onOpen?: (args: {
|
|
663
27
|
session: import("./http-server/client/websocket-session.js").default;
|
|
664
|
-
}) => Promise<void> | void
|
|
28
|
+
}) => Promise<void> | void;
|
|
665
29
|
/**
|
|
666
30
|
* - Handler when the websocket session closes.
|
|
667
31
|
*/
|
|
668
|
-
onClose?: (
|
|
32
|
+
onClose?: (args: {
|
|
669
33
|
session: import("./http-server/client/websocket-session.js").default;
|
|
670
|
-
}) => Promise<void> | void
|
|
34
|
+
}) => Promise<void> | void;
|
|
671
35
|
/**
|
|
672
36
|
* - Handler when a websocket message errors.
|
|
673
37
|
*/
|
|
674
|
-
onError?: (
|
|
38
|
+
onError?: (args: {
|
|
675
39
|
error: Error;
|
|
676
40
|
session: import("./http-server/client/websocket-session.js").default;
|
|
677
|
-
}) => Promise<void> | void
|
|
41
|
+
}) => Promise<void> | void;
|
|
678
42
|
};
|
|
679
|
-
export type WebsocketMessageHandlerResolverType = (
|
|
43
|
+
export type WebsocketMessageHandlerResolverType = (args: {
|
|
680
44
|
request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined;
|
|
681
45
|
client: import("./http-server/client/index.js").default;
|
|
682
46
|
configuration: import("./configuration.js").default;
|
|
@@ -691,201 +55,174 @@ export type WebpackRequireContext = InitializersRequireContextType & {
|
|
|
691
55
|
export type InitializersExportType = {
|
|
692
56
|
requireContext: WebpackRequireContext;
|
|
693
57
|
};
|
|
694
|
-
export type InitializersType = (
|
|
58
|
+
export type InitializersType = (args: {
|
|
695
59
|
configuration: import("./configuration.js").default;
|
|
696
60
|
}) => Promise<InitializersExportType>;
|
|
697
61
|
export type SqlConfig = {
|
|
698
62
|
/**
|
|
699
63
|
* - Database name for the SQL driver.
|
|
700
64
|
*/
|
|
701
|
-
database?: string
|
|
65
|
+
database?: string;
|
|
702
66
|
/**
|
|
703
67
|
* - Driver-specific connection options.
|
|
704
68
|
*/
|
|
705
69
|
options?: {
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
* - Default schema for unqualified table lookups (MSSQL).
|
|
712
|
-
*/
|
|
713
|
-
schema?: string | undefined;
|
|
714
|
-
/**
|
|
715
|
-
* - TLS SNI server name override for MSSQL (empty string disables SNI).
|
|
716
|
-
*/
|
|
717
|
-
serverName?: string | undefined;
|
|
718
|
-
/**
|
|
719
|
-
* - Whether to trust the server certificate (MSSQL).
|
|
720
|
-
*/
|
|
721
|
-
trustServerCertificate?: boolean | undefined;
|
|
722
|
-
} | undefined;
|
|
70
|
+
encrypt?: boolean;
|
|
71
|
+
schema?: string;
|
|
72
|
+
serverName?: string;
|
|
73
|
+
trustServerCertificate?: boolean;
|
|
74
|
+
};
|
|
723
75
|
/**
|
|
724
76
|
* - Password for the SQL user.
|
|
725
77
|
*/
|
|
726
|
-
password?: string
|
|
78
|
+
password?: string;
|
|
727
79
|
/**
|
|
728
80
|
* - Connection pool configuration.
|
|
729
81
|
*/
|
|
730
82
|
pool?: {
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
* - Minimum number of connections.
|
|
737
|
-
*/
|
|
738
|
-
min?: number | undefined;
|
|
739
|
-
/**
|
|
740
|
-
* - Idle timeout before releasing a connection.
|
|
741
|
-
*/
|
|
742
|
-
idleTimeoutMillis?: number | undefined;
|
|
743
|
-
/**
|
|
744
|
-
* - Timeout while waiting for an available connection after the max connection cap is reached. Set null to wait indefinitely.
|
|
745
|
-
*/
|
|
746
|
-
checkoutTimeoutMillis?: number | null | undefined;
|
|
747
|
-
} | undefined;
|
|
83
|
+
max?: number | null;
|
|
84
|
+
min?: number;
|
|
85
|
+
idleTimeoutMillis?: number;
|
|
86
|
+
checkoutTimeoutMillis?: number | null;
|
|
87
|
+
};
|
|
748
88
|
/**
|
|
749
89
|
* - SQL server hostname.
|
|
750
90
|
*/
|
|
751
|
-
server?: string
|
|
91
|
+
server?: string;
|
|
752
92
|
/**
|
|
753
93
|
* - SQL username.
|
|
754
94
|
*/
|
|
755
|
-
user?: string
|
|
95
|
+
user?: string;
|
|
756
96
|
};
|
|
757
97
|
export type DatabasePoolConfiguration = {
|
|
758
98
|
/**
|
|
759
99
|
* - Timeout while a checkout waits for an available async-tracked connection after the max live connection cap is reached. Set null to wait indefinitely. Default: 10000.
|
|
760
100
|
*/
|
|
761
|
-
checkoutTimeoutMillis?: number | null
|
|
101
|
+
checkoutTimeoutMillis?: number | null;
|
|
762
102
|
/**
|
|
763
103
|
* - Idle timeout before closing a checked-in async-tracked connection. Set null to disable idle reaping. Default: 5000.
|
|
764
104
|
*/
|
|
765
|
-
idleTimeoutMillis?: number | null
|
|
105
|
+
idleTimeoutMillis?: number | null;
|
|
766
106
|
/**
|
|
767
107
|
* - Maximum live async-tracked connections for this pool. Defaults to 10. Extra checkouts wait until a matching connection is checked in or capacity is freed. Set null to disable the cap.
|
|
768
108
|
*/
|
|
769
|
-
max?: number | null
|
|
109
|
+
max?: number | null;
|
|
770
110
|
};
|
|
771
111
|
export type DatabaseConfigurationType = {
|
|
772
112
|
/**
|
|
773
113
|
* - Default character set applied by `db:create` via mysql/mariadb `CREATE DATABASE ... CHARACTER SET`. Distinct from `charset`, which is the client connection charset forwarded to the mysql2 driver.
|
|
774
114
|
*/
|
|
775
|
-
databaseCharset?: string
|
|
115
|
+
databaseCharset?: string;
|
|
776
116
|
/**
|
|
777
117
|
* - Default collation applied by `db:create` via mysql/mariadb `CREATE DATABASE ... COLLATE`.
|
|
778
118
|
*/
|
|
779
|
-
databaseCollation?: string
|
|
119
|
+
databaseCollation?: string;
|
|
780
120
|
/**
|
|
781
121
|
* - Database name for this connection.
|
|
782
122
|
*/
|
|
783
|
-
database?: string
|
|
123
|
+
database?: string;
|
|
784
124
|
/**
|
|
785
125
|
* - Maximum attempts for the outermost transaction when it keeps hitting deadlocks. Defaults to 8.
|
|
786
126
|
*/
|
|
787
|
-
deadlockMaxRetries?: number
|
|
127
|
+
deadlockMaxRetries?: number;
|
|
788
128
|
/**
|
|
789
129
|
* - Base delay (ms) for the deadlock retry backoff; the per-attempt ceiling doubles from here. Defaults to 50.
|
|
790
130
|
*/
|
|
791
|
-
deadlockBaseWaitMs?: number
|
|
131
|
+
deadlockBaseWaitMs?: number;
|
|
792
132
|
/**
|
|
793
133
|
* - Cap (ms) on the deadlock retry backoff ceiling so the jittered wait stays bounded. Defaults to 1000.
|
|
794
134
|
*/
|
|
795
|
-
deadlockMaxWaitMs?: number
|
|
135
|
+
deadlockMaxWaitMs?: number;
|
|
796
136
|
/**
|
|
797
137
|
* - Driver class to use for this database.
|
|
798
138
|
*/
|
|
799
|
-
driver?: typeof import("./database/drivers/base.js").default
|
|
139
|
+
driver?: typeof import("./database/drivers/base.js").default;
|
|
800
140
|
/**
|
|
801
141
|
* - Pool class to use for this database.
|
|
802
142
|
*/
|
|
803
|
-
poolType?: typeof import("./database/pool/base.js").default
|
|
143
|
+
poolType?: typeof import("./database/pool/base.js").default;
|
|
804
144
|
/**
|
|
805
145
|
* - Custom connection factory override.
|
|
806
146
|
*/
|
|
807
|
-
getConnection?: (
|
|
147
|
+
getConnection?: () => ReturnType<typeof JSON.parse>;
|
|
808
148
|
/**
|
|
809
149
|
* - Database host.
|
|
810
150
|
*/
|
|
811
|
-
host?: string
|
|
151
|
+
host?: string;
|
|
812
152
|
/**
|
|
813
153
|
* - Whether migrations are enabled for this database.
|
|
814
154
|
*/
|
|
815
|
-
migrations?: boolean
|
|
155
|
+
migrations?: boolean;
|
|
816
156
|
/**
|
|
817
157
|
* - (MySQL) Opt in to multi-statement queries so a whole structure SQL dump loads in one round-trip via `StructureSqlLoader`. Off by default; ordinary queries otherwise reject stacked statements.
|
|
818
158
|
*/
|
|
819
|
-
multipleStatements?: boolean
|
|
159
|
+
multipleStatements?: boolean;
|
|
820
160
|
/**
|
|
821
161
|
* - Password for the database user.
|
|
822
162
|
*/
|
|
823
|
-
password?: string
|
|
163
|
+
password?: string;
|
|
824
164
|
/**
|
|
825
165
|
* - Database port.
|
|
826
166
|
*/
|
|
827
|
-
port?: number
|
|
167
|
+
port?: number;
|
|
828
168
|
/**
|
|
829
169
|
* - Default type for implicit migration primary keys and references. Defaults to `uuid`.
|
|
830
170
|
*/
|
|
831
|
-
primaryKeyType?: string
|
|
171
|
+
primaryKeyType?: string;
|
|
832
172
|
/**
|
|
833
173
|
* - Velocious database pool lifecycle configuration.
|
|
834
174
|
*/
|
|
835
|
-
pool?: DatabasePoolConfiguration
|
|
175
|
+
pool?: DatabasePoolConfiguration;
|
|
836
176
|
/**
|
|
837
177
|
* - Friendly name for the configuration.
|
|
838
178
|
*/
|
|
839
|
-
name?: string
|
|
179
|
+
name?: string;
|
|
840
180
|
/**
|
|
841
181
|
* - Optional sqlite-web sql.js wasm resolver (`initSqlJs({locateFile})`).
|
|
842
182
|
*/
|
|
843
|
-
locateFile?: (
|
|
183
|
+
locateFile?: (file: string) => string;
|
|
844
184
|
/**
|
|
845
185
|
* - Whether writes should be blocked for this database.
|
|
846
186
|
*/
|
|
847
|
-
readOnly?: boolean
|
|
187
|
+
readOnly?: boolean;
|
|
848
188
|
/**
|
|
849
189
|
* - Default schema for unqualified table lookups (MSSQL).
|
|
850
190
|
*/
|
|
851
|
-
schema?: string
|
|
191
|
+
schema?: string;
|
|
852
192
|
/**
|
|
853
193
|
* - Whether schema metadata should be cached on the driver. Defaults to true.
|
|
854
194
|
*/
|
|
855
|
-
schemaCache?: boolean
|
|
195
|
+
schemaCache?: boolean;
|
|
856
196
|
/**
|
|
857
197
|
* - Record-level configuration.
|
|
858
198
|
*/
|
|
859
199
|
record?: {
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
*/
|
|
863
|
-
transactions?: boolean | undefined;
|
|
864
|
-
} | undefined;
|
|
200
|
+
transactions?: boolean;
|
|
201
|
+
};
|
|
865
202
|
/**
|
|
866
203
|
* - Whether to reset the database on startup.
|
|
867
204
|
*/
|
|
868
|
-
reset?: boolean
|
|
205
|
+
reset?: boolean;
|
|
869
206
|
/**
|
|
870
207
|
* - Driver-specific SQL config.
|
|
871
208
|
*/
|
|
872
|
-
sqlConfig?: SqlConfig
|
|
209
|
+
sqlConfig?: SqlConfig;
|
|
873
210
|
/**
|
|
874
211
|
* - Whether this database identifier is only active inside a resolved tenant context.
|
|
875
212
|
*/
|
|
876
|
-
tenantOnly?: boolean
|
|
213
|
+
tenantOnly?: boolean;
|
|
877
214
|
/**
|
|
878
215
|
* - Database type identifier.
|
|
879
216
|
*/
|
|
880
|
-
type?: "
|
|
217
|
+
type?: "mssql" | "mysql" | "pgsql" | "sqlite";
|
|
881
218
|
/**
|
|
882
219
|
* - Database to switch to after connecting.
|
|
883
220
|
*/
|
|
884
|
-
useDatabase?: string
|
|
221
|
+
useDatabase?: string;
|
|
885
222
|
/**
|
|
886
223
|
* - Username for database authentication.
|
|
887
224
|
*/
|
|
888
|
-
username?: string
|
|
225
|
+
username?: string;
|
|
889
226
|
};
|
|
890
227
|
export type LogLevel = "debug-low-level" | "debug" | "info" | "warn" | "error";
|
|
891
228
|
export type LoggingOutputPayload = {
|
|
@@ -910,11 +247,11 @@ export type LoggingOutput = {
|
|
|
910
247
|
/**
|
|
911
248
|
* - Write a log entry.
|
|
912
249
|
*/
|
|
913
|
-
write: (
|
|
250
|
+
write: (arg: LoggingOutputPayload) => Promise<void> | void;
|
|
914
251
|
/**
|
|
915
252
|
* - Default levels for this output.
|
|
916
253
|
*/
|
|
917
|
-
levels?: LogLevel[]
|
|
254
|
+
levels?: LogLevel[];
|
|
918
255
|
};
|
|
919
256
|
export type LoggingOutputConfig = {
|
|
920
257
|
/**
|
|
@@ -924,81 +261,71 @@ export type LoggingOutputConfig = {
|
|
|
924
261
|
/**
|
|
925
262
|
* - Levels enabled for this output.
|
|
926
263
|
*/
|
|
927
|
-
levels?: LogLevel
|
|
264
|
+
levels?: Array<LogLevel>;
|
|
928
265
|
};
|
|
929
266
|
export type LoggerConfig = LoggingOutputConfig | LoggingOutput | import("./logger/base-logger.js").default;
|
|
930
267
|
export type LoggingConfiguration = {
|
|
931
268
|
/**
|
|
932
269
|
* - Enable/disable console logging for request logging. Defaults to true outside of "test" and for HTTP server logs.
|
|
933
270
|
*/
|
|
934
|
-
console?: boolean
|
|
271
|
+
console?: boolean;
|
|
935
272
|
/**
|
|
936
273
|
* - Enable/disable writing logs to a file. Defaults to true.
|
|
937
274
|
*/
|
|
938
|
-
file?: boolean
|
|
275
|
+
file?: boolean;
|
|
939
276
|
/**
|
|
940
277
|
* - Directory where log files are stored. Defaults to "<project>/log".
|
|
941
278
|
*/
|
|
942
|
-
directory?: string
|
|
279
|
+
directory?: string;
|
|
943
280
|
/**
|
|
944
281
|
* - Explicit path for the log file. Defaults to "<directory>/<environment>.log".
|
|
945
282
|
*/
|
|
946
|
-
filePath?: string
|
|
283
|
+
filePath?: string;
|
|
947
284
|
/**
|
|
948
285
|
* - Override which log levels are emitted.
|
|
949
286
|
*/
|
|
950
|
-
levels?:
|
|
287
|
+
levels?: Array<"debug-low-level" | "debug" | "info" | "warn" | "error">;
|
|
951
288
|
/**
|
|
952
289
|
* - Convenience flag to include very low-level debug logs.
|
|
953
290
|
*/
|
|
954
|
-
debugLowLevel?: boolean
|
|
291
|
+
debugLowLevel?: boolean;
|
|
955
292
|
/**
|
|
956
293
|
* - Enable/disable database query logging. Defaults to true outside test and false in test.
|
|
957
294
|
*/
|
|
958
|
-
queryLogging?: boolean
|
|
295
|
+
queryLogging?: boolean;
|
|
959
296
|
/**
|
|
960
297
|
* - Logger instances (converted to outputs when configured).
|
|
961
298
|
*/
|
|
962
|
-
loggers?: LoggerConfig[]
|
|
299
|
+
loggers?: LoggerConfig[];
|
|
963
300
|
/**
|
|
964
301
|
* - Explicit logger outputs (overrides console/file defaults when provided).
|
|
965
302
|
*/
|
|
966
|
-
outputs?: LoggingOutputConfig[]
|
|
303
|
+
outputs?: LoggingOutputConfig[];
|
|
967
304
|
};
|
|
968
305
|
export type StructureSqlConfiguration = {
|
|
969
306
|
/**
|
|
970
307
|
* - Environments allowed to write structure sql files during automatic migration dumps.
|
|
971
308
|
*/
|
|
972
|
-
enabledEnvironments?: string[]
|
|
309
|
+
enabledEnvironments?: string[];
|
|
973
310
|
/**
|
|
974
311
|
* - Environments that should skip writing structure sql files.
|
|
975
312
|
*/
|
|
976
|
-
disabledEnvironments?: string[]
|
|
313
|
+
disabledEnvironments?: string[];
|
|
977
314
|
};
|
|
978
|
-
/**
|
|
979
|
-
* - `"beacon"` (default): event-driven dispatch. The
|
|
980
|
-
* `background-jobs-main` process drains the queue on enqueue, on
|
|
981
|
-
* worker readiness, on Beacon broadcasts (so cross-process enqueues
|
|
982
|
-
* wake it), and arms a `setTimeout` for the soonest future-scheduled
|
|
983
|
-
* job. Falls back gracefully to direct in-process triggering when
|
|
984
|
-
* Beacon is not configured.
|
|
985
|
-
* - `"polling"`: legacy mode, runs a fixed-interval poll over the
|
|
986
|
-
* `background_jobs` table (see `pollIntervalMs`).
|
|
987
|
-
*/
|
|
988
315
|
export type BackgroundJobsDispatchStrategy = "beacon" | "polling";
|
|
989
316
|
export type BackgroundJobsConfiguration = {
|
|
990
317
|
/**
|
|
991
318
|
* - Hostname for the background jobs main process.
|
|
992
319
|
*/
|
|
993
|
-
host?: string
|
|
320
|
+
host?: string;
|
|
994
321
|
/**
|
|
995
322
|
* - Port for the background jobs main process.
|
|
996
323
|
*/
|
|
997
|
-
port?: number
|
|
324
|
+
port?: number;
|
|
998
325
|
/**
|
|
999
326
|
* - Database identifier used to store background jobs.
|
|
1000
327
|
*/
|
|
1001
|
-
databaseIdentifier?: string
|
|
328
|
+
databaseIdentifier?: string;
|
|
1002
329
|
/**
|
|
1003
330
|
* - How many `forked: false` jobs a single
|
|
1004
331
|
* `background-jobs-worker` process is allowed to run in parallel. Concurrency
|
|
@@ -1007,7 +334,7 @@ export type BackgroundJobsConfiguration = {
|
|
|
1007
334
|
* CPU count. Forking remains the right tool for memory isolation across
|
|
1008
335
|
* long-running jobs and for using more cores. Default: `4`.
|
|
1009
336
|
*/
|
|
1010
|
-
maxConcurrentInlineJobs?: number
|
|
337
|
+
maxConcurrentInlineJobs?: number;
|
|
1011
338
|
/**
|
|
1012
339
|
* - How many out-of-process
|
|
1013
340
|
* `"forked"` or `"spawned"` jobs a single `background-jobs-worker` is
|
|
@@ -1015,27 +342,27 @@ export type BackgroundJobsConfiguration = {
|
|
|
1015
342
|
* for workload-shaped limits use per-queue caps (`queues`) instead, which are
|
|
1016
343
|
* enforced cluster-wide and are immune to duplicate worker processes.
|
|
1017
344
|
*/
|
|
1018
|
-
maxConcurrentForkedJobs?: number
|
|
345
|
+
maxConcurrentForkedJobs?: number;
|
|
1019
346
|
/**
|
|
1020
347
|
* - Number of warm, reusable child runners owned by each worker. Pooled capacity is separate from inline and forked/spawned capacity. Default: `4`.
|
|
1021
348
|
*/
|
|
1022
|
-
pooledRunnerCount?: number
|
|
349
|
+
pooledRunnerCount?: number;
|
|
1023
350
|
/**
|
|
1024
351
|
* - Number of jobs each pooled child runs concurrently on its own event loop. Total per-worker pooled capacity is `pooledRunnerCount × pooledRunnerConcurrency`. `1` (default) keeps each child serial; raise it for I/O-bound jobs so a bounded set of isolated processes handles high concurrency (like the inline lane) without one process per concurrent job. Default: `1`.
|
|
1025
352
|
*/
|
|
1026
|
-
pooledRunnerConcurrency?: number
|
|
353
|
+
pooledRunnerConcurrency?: number;
|
|
1027
354
|
/**
|
|
1028
355
|
* - Number of sequential jobs a pooled child runs before it is replaced, bounding process-level resource accumulation. Default: `100`.
|
|
1029
356
|
*/
|
|
1030
|
-
pooledRunnerMaxJobs?: number
|
|
357
|
+
pooledRunnerMaxJobs?: number;
|
|
1031
358
|
/**
|
|
1032
359
|
* - RSS bytes after an acknowledged job at which a pooled child is replaced. Default: `536870912` (512 MiB).
|
|
1033
360
|
*/
|
|
1034
|
-
pooledRunnerMaxRssBytes?: number
|
|
361
|
+
pooledRunnerMaxRssBytes?: number;
|
|
1035
362
|
/**
|
|
1036
363
|
* - Age after an acknowledged job at which a pooled child is replaced. Default: `3600000` (one hour).
|
|
1037
364
|
*/
|
|
1038
|
-
pooledRunnerMaxLifetimeMs?: number
|
|
365
|
+
pooledRunnerMaxLifetimeMs?: number;
|
|
1039
366
|
/**
|
|
1040
367
|
* - Per-queue
|
|
1041
368
|
* concurrency caps and dispatch priorities, Sidekiq-style. A job declares its queue (static
|
|
@@ -1064,18 +391,18 @@ export type BackgroundJobsConfiguration = {
|
|
|
1064
391
|
queues?: Record<string, {
|
|
1065
392
|
maxConcurrent?: number;
|
|
1066
393
|
priority?: number;
|
|
1067
|
-
}
|
|
394
|
+
}>;
|
|
1068
395
|
/**
|
|
1069
396
|
* - How the main process
|
|
1070
397
|
* detects new work. Defaults to `"beacon"` (event-driven). Set to `"polling"`
|
|
1071
398
|
* to restore the legacy fixed-interval poll.
|
|
1072
399
|
*/
|
|
1073
|
-
dispatchStrategy?: BackgroundJobsDispatchStrategy
|
|
400
|
+
dispatchStrategy?: BackgroundJobsDispatchStrategy;
|
|
1074
401
|
/**
|
|
1075
402
|
* - Poll interval in milliseconds. Only used
|
|
1076
403
|
* when `dispatchStrategy === "polling"`. Default: `1000`.
|
|
1077
404
|
*/
|
|
1078
|
-
pollIntervalMs?: number
|
|
405
|
+
pollIntervalMs?: number;
|
|
1079
406
|
/**
|
|
1080
407
|
* - Wall-clock backstop, in ms, for a
|
|
1081
408
|
* `"forked"` job runner. A forked job still running after this is terminated
|
|
@@ -1087,7 +414,7 @@ export type BackgroundJobsConfiguration = {
|
|
|
1087
414
|
* long imports) so only genuinely-stuck runners are killed. Omit, `null`, or
|
|
1088
415
|
* `<= 0` to disable (default), which preserves the prior unbounded behavior.
|
|
1089
416
|
*/
|
|
1090
|
-
jobTimeoutMs?: number | null
|
|
417
|
+
jobTimeoutMs?: number | null;
|
|
1091
418
|
/**
|
|
1092
419
|
* - Retention/pruning
|
|
1093
420
|
* of terminal job rows. Without pruning the jobs table grows unbounded
|
|
@@ -1095,7 +422,7 @@ export type BackgroundJobsConfiguration = {
|
|
|
1095
422
|
* eventually slows dispatch. The main process sweeps terminal rows past their
|
|
1096
423
|
* window on an interval.
|
|
1097
424
|
*/
|
|
1098
|
-
retention?: BackgroundJobsRetentionConfiguration
|
|
425
|
+
retention?: BackgroundJobsRetentionConfiguration;
|
|
1099
426
|
};
|
|
1100
427
|
export type BackgroundJobsRetentionConfiguration = {
|
|
1101
428
|
/**
|
|
@@ -1103,27 +430,23 @@ export type BackgroundJobsRetentionConfiguration = {
|
|
|
1103
430
|
* `completed_at_ms` is older than this many ms. `null` or `<= 0` disables
|
|
1104
431
|
* completed pruning. Default: `604800000` (7 days).
|
|
1105
432
|
*/
|
|
1106
|
-
completedTtlMs?: number | null
|
|
433
|
+
completedTtlMs?: number | null;
|
|
1107
434
|
/**
|
|
1108
435
|
* - Delete terminal `failed`/`orphaned`
|
|
1109
436
|
* jobs older than this many ms. `null` or `<= 0` disables (keeps them for
|
|
1110
437
|
* debugging). Default: `2592000000` (30 days).
|
|
1111
438
|
*/
|
|
1112
|
-
failedTtlMs?: number | null
|
|
439
|
+
failedTtlMs?: number | null;
|
|
1113
440
|
/**
|
|
1114
441
|
* - Rows deleted per batch. Default: `1000`.
|
|
1115
442
|
*/
|
|
1116
|
-
batchSize?: number
|
|
443
|
+
batchSize?: number;
|
|
1117
444
|
/**
|
|
1118
445
|
* - How often the retention sweep runs.
|
|
1119
446
|
* Default: `3600000` (1 hour).
|
|
1120
447
|
*/
|
|
1121
|
-
sweepIntervalMs?: number
|
|
448
|
+
sweepIntervalMs?: number;
|
|
1122
449
|
};
|
|
1123
|
-
/**
|
|
1124
|
-
* Fully-resolved retention config as returned by `getBackgroundJobsConfig()`
|
|
1125
|
-
* (every field defaulted), as opposed to the partial user-provided input.
|
|
1126
|
-
*/
|
|
1127
450
|
export type ResolvedBackgroundJobsRetentionConfiguration = {
|
|
1128
451
|
/**
|
|
1129
452
|
* - Resolved completed-job TTL in ms (`null` disables).
|
|
@@ -1146,45 +469,45 @@ export type BeaconConfiguration = {
|
|
|
1146
469
|
/**
|
|
1147
470
|
* - Whether to connect to a Beacon broker. Defaults to false unless `host`/`port` or `inProcess: true` are set, or env vars are present. Explicit `false` disables Beacon even when env vars are set.
|
|
1148
471
|
*/
|
|
1149
|
-
enabled?: boolean
|
|
472
|
+
enabled?: boolean;
|
|
1150
473
|
/**
|
|
1151
474
|
* - When true, use a module-level in-process broker singleton instead of connecting over TCP. Mutually exclusive with `host`/`port`. Useful for tests and single-process deployments.
|
|
1152
475
|
*/
|
|
1153
|
-
inProcess?: boolean
|
|
476
|
+
inProcess?: boolean;
|
|
1154
477
|
/**
|
|
1155
478
|
* - Hostname of the Beacon broker daemon.
|
|
1156
479
|
*/
|
|
1157
|
-
host?: string
|
|
480
|
+
host?: string;
|
|
1158
481
|
/**
|
|
1159
482
|
* - Port of the Beacon broker daemon.
|
|
1160
483
|
*/
|
|
1161
|
-
port?: number
|
|
484
|
+
port?: number;
|
|
1162
485
|
/**
|
|
1163
486
|
* - Optional human-readable label for this peer (e.g. "server", "background-jobs-worker").
|
|
1164
487
|
*/
|
|
1165
|
-
peerType?: string
|
|
488
|
+
peerType?: string;
|
|
1166
489
|
/**
|
|
1167
490
|
* - Grace window (ms) a beacon connect/disconnect blip must persist before it is reported as a framework-error. Transient outages that recover within this window (e.g. a deploy restarting the broker) are not reported. Defaults to 30000.
|
|
1168
491
|
*/
|
|
1169
|
-
unreachableReportMs?: number
|
|
492
|
+
unreachableReportMs?: number;
|
|
1170
493
|
};
|
|
1171
494
|
export type HttpCompressionConfiguration = {
|
|
1172
495
|
/**
|
|
1173
496
|
* - Whether buffered response compression is enabled. Defaults to true; set false to disable globally.
|
|
1174
497
|
*/
|
|
1175
|
-
enabled?: boolean
|
|
498
|
+
enabled?: boolean;
|
|
1176
499
|
/**
|
|
1177
500
|
* - Minimum buffered body size in bytes before compression is applied. Defaults to 1024.
|
|
1178
501
|
*/
|
|
1179
|
-
threshold?: number
|
|
502
|
+
threshold?: number;
|
|
1180
503
|
/**
|
|
1181
504
|
* - Brotli encoder quality (0-11). Defaults to 4.
|
|
1182
505
|
*/
|
|
1183
|
-
brotliQuality?: number
|
|
506
|
+
brotliQuality?: number;
|
|
1184
507
|
/**
|
|
1185
508
|
* - Gzip compression level (0-9). Defaults to 6.
|
|
1186
509
|
*/
|
|
1187
|
-
gzipLevel?: number
|
|
510
|
+
gzipLevel?: number;
|
|
1188
511
|
};
|
|
1189
512
|
export type NormalizedHttpCompressionConfiguration = {
|
|
1190
513
|
/**
|
|
@@ -1208,53 +531,53 @@ export type HttpServerConfiguration = {
|
|
|
1208
531
|
/**
|
|
1209
532
|
* - Buffered response compression. Enabled with documented defaults when absent; false or {enabled: false} disables it globally.
|
|
1210
533
|
*/
|
|
1211
|
-
compression?: boolean | HttpCompressionConfiguration
|
|
534
|
+
compression?: boolean | HttpCompressionConfiguration;
|
|
1212
535
|
/**
|
|
1213
536
|
* - Hostname to bind the HTTP server to.
|
|
1214
537
|
*/
|
|
1215
|
-
host?: string
|
|
538
|
+
host?: string;
|
|
1216
539
|
/**
|
|
1217
540
|
* - Run HTTP handlers in the main thread instead of worker threads.
|
|
1218
541
|
*/
|
|
1219
|
-
inProcess?: boolean
|
|
542
|
+
inProcess?: boolean;
|
|
1220
543
|
/**
|
|
1221
544
|
* - Backward-compatible alias for workers.
|
|
1222
545
|
*/
|
|
1223
|
-
maxWorkers?: number
|
|
546
|
+
maxWorkers?: number;
|
|
1224
547
|
/**
|
|
1225
548
|
* - Port to bind the HTTP server to.
|
|
1226
549
|
*/
|
|
1227
|
-
port?: number
|
|
550
|
+
port?: number;
|
|
1228
551
|
/**
|
|
1229
552
|
* - Per-session retained inbound WebSocket message limits.
|
|
1230
553
|
*/
|
|
1231
554
|
websocketInboundQueue?: {
|
|
1232
555
|
maxPendingBytes?: number;
|
|
1233
556
|
maxPendingMessages?: number;
|
|
1234
|
-
}
|
|
557
|
+
};
|
|
1235
558
|
/**
|
|
1236
559
|
* - Per-client retained outbound WebSocket frame limits.
|
|
1237
560
|
*/
|
|
1238
561
|
websocketOutboundQueue?: {
|
|
1239
562
|
maxPendingBytes?: number;
|
|
1240
563
|
maxPendingFrames?: number;
|
|
1241
|
-
}
|
|
564
|
+
};
|
|
1242
565
|
/**
|
|
1243
566
|
* - Worker handlers to start for the HTTP server.
|
|
1244
567
|
*/
|
|
1245
|
-
workers?: number
|
|
568
|
+
workers?: number;
|
|
1246
569
|
};
|
|
1247
570
|
export type ScheduledBackgroundJobEveryOptions = {
|
|
1248
571
|
/**
|
|
1249
572
|
* - Delay before the first enqueue.
|
|
1250
573
|
*/
|
|
1251
|
-
firstIn?:
|
|
574
|
+
firstIn?: number | string;
|
|
1252
575
|
};
|
|
1253
576
|
export type ScheduledBackgroundJobConfiguration = {
|
|
1254
577
|
/**
|
|
1255
578
|
* - Arguments passed to the job when enqueued.
|
|
1256
579
|
*/
|
|
1257
|
-
args?:
|
|
580
|
+
args?: Array<ReturnType<typeof JSON.parse>>;
|
|
1258
581
|
/**
|
|
1259
582
|
* - Job class to enqueue.
|
|
1260
583
|
*/
|
|
@@ -1262,19 +585,19 @@ export type ScheduledBackgroundJobConfiguration = {
|
|
|
1262
585
|
/**
|
|
1263
586
|
* - Crontab expression (5-field POSIX, plus `@hourly`/`@daily`/`@weekly`/`@monthly`/`@yearly`/`@midnight`). Mutually exclusive with `every`.
|
|
1264
587
|
*/
|
|
1265
|
-
cron?: string
|
|
588
|
+
cron?: string;
|
|
1266
589
|
/**
|
|
1267
590
|
* - Whether the schedule is enabled.
|
|
1268
591
|
*/
|
|
1269
|
-
enabled?: boolean
|
|
592
|
+
enabled?: boolean;
|
|
1270
593
|
/**
|
|
1271
594
|
* - Repeat interval. Either `every` or `cron` must be set.
|
|
1272
595
|
*/
|
|
1273
|
-
every?:
|
|
596
|
+
every?: number | string | [number | string, ScheduledBackgroundJobEveryOptions];
|
|
1274
597
|
/**
|
|
1275
598
|
* - Job options.
|
|
1276
599
|
*/
|
|
1277
|
-
options?: import("./background-jobs/types.js").BackgroundJobOptions
|
|
600
|
+
options?: import("./background-jobs/types.js").BackgroundJobOptions;
|
|
1278
601
|
};
|
|
1279
602
|
export type VelociousParams = Record<string, string>;
|
|
1280
603
|
export type ClientErrorPayloadReporterPayload = Record<string, import("./frontend-models/query.js").FrontendModelTransportValue>;
|
|
@@ -1282,7 +605,7 @@ export type ErrorRequestDetails = {
|
|
|
1282
605
|
/**
|
|
1283
606
|
* - Sanitized parsed request body, when available.
|
|
1284
607
|
*/
|
|
1285
|
-
body?:
|
|
608
|
+
body?: ReturnType<typeof JSON.parse>;
|
|
1286
609
|
/**
|
|
1287
610
|
* - Request HTTP method.
|
|
1288
611
|
*/
|
|
@@ -1300,29 +623,33 @@ export type ClientErrorPayloadContext = {
|
|
|
1300
623
|
/**
|
|
1301
624
|
* - Controller action or endpoint label.
|
|
1302
625
|
*/
|
|
1303
|
-
action?: string
|
|
626
|
+
action?: string;
|
|
1304
627
|
/**
|
|
1305
628
|
* - Frontend-model command type.
|
|
1306
629
|
*/
|
|
1307
|
-
commandType?: "
|
|
630
|
+
commandType?: "index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url" | "custom-command";
|
|
631
|
+
/**
|
|
632
|
+
* - Server-generated identifier shared by an unexpected client error and framework reports.
|
|
633
|
+
*/
|
|
634
|
+
correlationId?: string;
|
|
1308
635
|
/**
|
|
1309
636
|
* - Whether the error is an expected user-flow failure.
|
|
1310
637
|
*/
|
|
1311
|
-
expectedError?: boolean
|
|
638
|
+
expectedError?: boolean;
|
|
1312
639
|
/**
|
|
1313
640
|
* - Whether the error came from the frontend-model endpoint.
|
|
1314
641
|
*/
|
|
1315
|
-
frontendModelEndpoint?: boolean
|
|
642
|
+
frontendModelEndpoint?: boolean;
|
|
1316
643
|
/**
|
|
1317
644
|
* - Frontend-model name from the failed request.
|
|
1318
645
|
*/
|
|
1319
|
-
model?: string
|
|
646
|
+
model?: string;
|
|
1320
647
|
/**
|
|
1321
648
|
* - Shared frontend-model request id.
|
|
1322
649
|
*/
|
|
1323
|
-
requestId?: string
|
|
650
|
+
requestId?: string;
|
|
1324
651
|
};
|
|
1325
|
-
export type ClientErrorPayloadReporterType = (
|
|
652
|
+
export type ClientErrorPayloadReporterType = (args: {
|
|
1326
653
|
context: ClientErrorPayloadContext;
|
|
1327
654
|
error: Error;
|
|
1328
655
|
request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined;
|
|
@@ -1346,7 +673,7 @@ export type AttachmentDriverConstructor = new (args: {
|
|
|
1346
673
|
configuration: import("./configuration.js").default;
|
|
1347
674
|
modelClass?: typeof import("./database/record/index.js").default;
|
|
1348
675
|
name?: string;
|
|
1349
|
-
options?: Record<string,
|
|
676
|
+
options?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1350
677
|
}) => object;
|
|
1351
678
|
export type ScheduledBackgroundJobsConfiguration = {
|
|
1352
679
|
/**
|
|
@@ -1354,53 +681,53 @@ export type ScheduledBackgroundJobsConfiguration = {
|
|
|
1354
681
|
*/
|
|
1355
682
|
jobs: Record<string, ScheduledBackgroundJobConfiguration>;
|
|
1356
683
|
};
|
|
1357
|
-
export type ScheduledBackgroundJobsLoaderType = (
|
|
684
|
+
export type ScheduledBackgroundJobsLoaderType = (args: {
|
|
1358
685
|
configuration: import("./configuration.js").default;
|
|
1359
686
|
}) => ScheduledBackgroundJobsConfiguration | Promise<ScheduledBackgroundJobsConfiguration>;
|
|
1360
687
|
export type AttachmentDriverConfiguration = {
|
|
1361
688
|
/**
|
|
1362
689
|
* - Optional factory for a custom attachment driver instance.
|
|
1363
690
|
*/
|
|
1364
|
-
create?: (
|
|
691
|
+
create?: (args: {
|
|
1365
692
|
configuration: import("./configuration.js").default;
|
|
1366
693
|
name: string;
|
|
1367
|
-
options: Record<string,
|
|
1368
|
-
}) => Record<string,
|
|
694
|
+
options: Record<string, ReturnType<typeof JSON.parse>>;
|
|
695
|
+
}) => Record<string, ReturnType<typeof JSON.parse>>;
|
|
1369
696
|
/**
|
|
1370
697
|
* - Optional custom attachment driver class.
|
|
1371
698
|
*/
|
|
1372
|
-
driverClass?: AttachmentDriverConstructor
|
|
699
|
+
driverClass?: AttachmentDriverConstructor;
|
|
1373
700
|
/**
|
|
1374
701
|
* - Optional custom attachment driver instance.
|
|
1375
702
|
*/
|
|
1376
|
-
instance?: Record<string,
|
|
703
|
+
instance?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1377
704
|
};
|
|
1378
705
|
export type AttachmentsConfiguration = {
|
|
1379
706
|
/**
|
|
1380
707
|
* - Default attachment storage driver name.
|
|
1381
708
|
*/
|
|
1382
|
-
defaultDriver?: string
|
|
709
|
+
defaultDriver?: string;
|
|
1383
710
|
/**
|
|
1384
711
|
* - Named attachment driver configurations.
|
|
1385
712
|
*/
|
|
1386
|
-
drivers?: Record<string, AttachmentDriverConfiguration & Record<string,
|
|
713
|
+
drivers?: Record<string, AttachmentDriverConfiguration & Record<string, ReturnType<typeof JSON.parse>>>;
|
|
1387
714
|
/**
|
|
1388
715
|
* - Whether `{path: ...}` attachment input is allowed.
|
|
1389
716
|
*/
|
|
1390
|
-
allowPathInput?: boolean
|
|
717
|
+
allowPathInput?: boolean;
|
|
1391
718
|
/**
|
|
1392
719
|
* - Optional allowlist of directories for `{path: ...}` input.
|
|
1393
720
|
*/
|
|
1394
|
-
allowedPathPrefixes?: string[]
|
|
721
|
+
allowedPathPrefixes?: string[];
|
|
1395
722
|
};
|
|
1396
723
|
export type MailerBackend = {
|
|
1397
724
|
/**
|
|
1398
725
|
* - Deliver a mailer payload.
|
|
1399
726
|
*/
|
|
1400
|
-
deliver: (
|
|
727
|
+
deliver: (args: {
|
|
1401
728
|
payload: import("./mailer.js").MailerDeliveryPayload;
|
|
1402
729
|
configuration: import("./configuration.js").default;
|
|
1403
|
-
}) => Promise<
|
|
730
|
+
}) => Promise<ReturnType<typeof JSON.parse>> | ReturnType<typeof JSON.parse>;
|
|
1404
731
|
};
|
|
1405
732
|
export type LocaleFallbacksType = Record<string, string[]>;
|
|
1406
733
|
export type FrontendModelRelationshipConfiguration = {
|
|
@@ -1411,49 +738,49 @@ export type FrontendModelRelationshipConfiguration = {
|
|
|
1411
738
|
/**
|
|
1412
739
|
* - Target model class name.
|
|
1413
740
|
*/
|
|
1414
|
-
model?: string
|
|
741
|
+
model?: string;
|
|
1415
742
|
/**
|
|
1416
743
|
* - Alias of target model class name.
|
|
1417
744
|
*/
|
|
1418
|
-
className?: string
|
|
745
|
+
className?: string;
|
|
1419
746
|
/**
|
|
1420
747
|
* - Explicit target model class name.
|
|
1421
748
|
*/
|
|
1422
|
-
modelClassName?: string
|
|
749
|
+
modelClassName?: string;
|
|
1423
750
|
};
|
|
1424
751
|
export type FrontendModelAttributeConfiguration = {
|
|
1425
752
|
/**
|
|
1426
753
|
* - Column type name.
|
|
1427
754
|
*/
|
|
1428
|
-
type?: string
|
|
755
|
+
type?: string;
|
|
1429
756
|
/**
|
|
1430
757
|
* - Alias for column type name.
|
|
1431
758
|
*/
|
|
1432
|
-
columnType?: string
|
|
759
|
+
columnType?: string;
|
|
1433
760
|
/**
|
|
1434
761
|
* - Alias for column type name.
|
|
1435
762
|
*/
|
|
1436
|
-
sqlType?: string
|
|
763
|
+
sqlType?: string;
|
|
1437
764
|
/**
|
|
1438
765
|
* - Alias for column type name.
|
|
1439
766
|
*/
|
|
1440
|
-
dataType?: string
|
|
767
|
+
dataType?: string;
|
|
1441
768
|
/**
|
|
1442
769
|
* - Exact generated JSDoc type for non-column attributes.
|
|
1443
770
|
*/
|
|
1444
|
-
jsDocType?: string
|
|
771
|
+
jsDocType?: string;
|
|
1445
772
|
/**
|
|
1446
773
|
* - Attribute name when configured as an array entry.
|
|
1447
774
|
*/
|
|
1448
|
-
name?: string
|
|
775
|
+
name?: string;
|
|
1449
776
|
/**
|
|
1450
777
|
* - Whether value can be null.
|
|
1451
778
|
*/
|
|
1452
|
-
null?: boolean
|
|
779
|
+
null?: boolean;
|
|
1453
780
|
/**
|
|
1454
781
|
* - Whether included in default serialization. Defaults to true.
|
|
1455
782
|
*/
|
|
1456
|
-
selectedByDefault?: boolean
|
|
783
|
+
selectedByDefault?: boolean;
|
|
1457
784
|
};
|
|
1458
785
|
export type FrontendModelAttachmentConfiguration = {
|
|
1459
786
|
/**
|
|
@@ -1469,56 +796,52 @@ export type FrontendModelResourceConfiguration = {
|
|
|
1469
796
|
/**
|
|
1470
797
|
* - Additional camelCase ability action names to expose for per-record `record.can(action)` reads. Base CRUD actions (`read`, `create`, `update`, `destroy`) are always included and must not be listed here.
|
|
1471
798
|
*/
|
|
1472
|
-
abilities?: string[]
|
|
799
|
+
abilities?: string[];
|
|
1473
800
|
/**
|
|
1474
801
|
* - Attachment helpers keyed by attachment name.
|
|
1475
802
|
*/
|
|
1476
|
-
attachments?: Record<string, FrontendModelAttachmentConfiguration
|
|
803
|
+
attachments?: Record<string, FrontendModelAttachmentConfiguration>;
|
|
1477
804
|
/**
|
|
1478
805
|
* - Legacy built-in command names (`index`, `find`, `create`, `update`, `destroy`, `attach`, `download`, `url`).
|
|
1479
806
|
*/
|
|
1480
|
-
commands?: string[]
|
|
807
|
+
commands?: string[];
|
|
1481
808
|
/**
|
|
1482
809
|
* - Custom collection commands. Each entry is a camelCase method name, or a `{name, args?, returnType?}` object declaring typed arguments and/or a response type. The runtime derives the kebab-case command slug from the name.
|
|
1483
810
|
*/
|
|
1484
|
-
collectionCommands?: FrontendModelResourceCustomCommand
|
|
811
|
+
collectionCommands?: Array<FrontendModelResourceCustomCommand>;
|
|
1485
812
|
/**
|
|
1486
813
|
* - Custom member commands. Each entry is a camelCase method name, or a `{name, args?, returnType?}` object declaring typed arguments and/or a response type. The runtime derives the kebab-case command slug from the name.
|
|
1487
814
|
*/
|
|
1488
|
-
memberCommands?: FrontendModelResourceCustomCommand
|
|
815
|
+
memberCommands?: Array<FrontendModelResourceCustomCommand>;
|
|
1489
816
|
/**
|
|
1490
817
|
* - Built-in collection command names (`index`, `create`).
|
|
1491
818
|
*/
|
|
1492
|
-
builtInCollectionCommands?: string[]
|
|
819
|
+
builtInCollectionCommands?: string[];
|
|
1493
820
|
/**
|
|
1494
821
|
* - Built-in member command names (`find`, `update`, `destroy`, `attach`, `download`, `url`).
|
|
1495
822
|
*/
|
|
1496
|
-
builtInMemberCommands?: string[]
|
|
823
|
+
builtInMemberCommands?: string[];
|
|
1497
824
|
/**
|
|
1498
825
|
* - Frontend model name override.
|
|
1499
826
|
*/
|
|
1500
|
-
modelName?: string
|
|
827
|
+
modelName?: string;
|
|
1501
828
|
/**
|
|
1502
829
|
* - Relationship names to expose in frontend models. Type and target model are inferred from the backend model's registered relationships.
|
|
1503
830
|
*/
|
|
1504
|
-
relationships?: string[]
|
|
831
|
+
relationships?: string[];
|
|
1505
832
|
/**
|
|
1506
833
|
* - Primary key attribute name.
|
|
1507
834
|
*/
|
|
1508
|
-
primaryKey?: string
|
|
835
|
+
primaryKey?: string;
|
|
1509
836
|
/**
|
|
1510
837
|
* - Optional legacy backend behavior overrides for built-in frontend actions.
|
|
1511
838
|
*/
|
|
1512
|
-
server?: FrontendModelResourceServerConfiguration
|
|
839
|
+
server?: FrontendModelResourceServerConfiguration;
|
|
1513
840
|
/**
|
|
1514
841
|
* - Optional safe local/offline sync policy metadata. `policy` participates in the hash but is not exposed to generated frontend config/manifest.
|
|
1515
842
|
*/
|
|
1516
|
-
sync?:
|
|
843
|
+
sync?: FrontendModelResourceSyncConfiguration | boolean;
|
|
1517
844
|
};
|
|
1518
|
-
/**
|
|
1519
|
-
* Object form of a custom command entry, declaring its typed arguments and/or
|
|
1520
|
-
* response type alongside the command name.
|
|
1521
|
-
*/
|
|
1522
845
|
export type FrontendModelResourceCustomCommandObject = {
|
|
1523
846
|
/**
|
|
1524
847
|
* - camelCase command method name.
|
|
@@ -1527,97 +850,74 @@ export type FrontendModelResourceCustomCommandObject = {
|
|
|
1527
850
|
/**
|
|
1528
851
|
* - Typed command arguments; each generates a named, typed method parameter mapped positionally into the command payload. `type` is a JSDoc type string.
|
|
1529
852
|
*/
|
|
1530
|
-
args?: {
|
|
853
|
+
args?: Array<{
|
|
1531
854
|
name: string;
|
|
1532
855
|
type: string;
|
|
1533
|
-
}
|
|
856
|
+
}>;
|
|
1534
857
|
/**
|
|
1535
|
-
* - JSDoc type for the command response. When set, the generated method is typed `Promise<returnType>` instead of `Promise<Record<string,
|
|
858
|
+
* - JSDoc type for the command response. When set, the generated method is typed `Promise<returnType>` instead of `Promise<Record<string, ReturnType<typeof JSON.parse>>>`. Emitted verbatim into the generated frontend model, so it must resolve there.
|
|
1536
859
|
*/
|
|
1537
|
-
returnType?: string
|
|
860
|
+
returnType?: string;
|
|
1538
861
|
};
|
|
1539
|
-
/**
|
|
1540
|
-
* A custom command entry: a plain camelCase method name, or an object declaring
|
|
1541
|
-
* typed args and/or a response type.
|
|
1542
|
-
*/
|
|
1543
862
|
export type FrontendModelResourceCustomCommand = string | FrontendModelResourceCustomCommandObject;
|
|
1544
|
-
/**
|
|
1545
|
-
* JSON value accepted by sync policy metadata/hash inputs.
|
|
1546
|
-
*/
|
|
1547
863
|
export type FrontendModelSyncJsonValue = null | string | number | boolean | unknown[] | Record<string, unknown>;
|
|
1548
|
-
/**
|
|
1549
|
-
* Frontend-model local/offline sync policy config. `metadata` is exposed to
|
|
1550
|
-
* frontends and peers; `policy` is hashed but intentionally omitted from
|
|
1551
|
-
* frontend-safe manifests.
|
|
1552
|
-
*/
|
|
1553
864
|
export type FrontendModelResourceSyncConfiguration = {
|
|
1554
865
|
/**
|
|
1555
866
|
* - Strategy used when replay detects server/client divergence. Defaults to `optimisticVersion`.
|
|
1556
867
|
*/
|
|
1557
|
-
conflictStrategy?: "optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly"
|
|
868
|
+
conflictStrategy?: "optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly";
|
|
1558
869
|
/**
|
|
1559
870
|
* - Whether the resource is sync-enabled. Defaults to true when `sync` is configured.
|
|
1560
871
|
*/
|
|
1561
|
-
enabled?: boolean
|
|
872
|
+
enabled?: boolean;
|
|
1562
873
|
/**
|
|
1563
874
|
* - Sync operation names such as `index`, `find`, `create`, `update`, custom domain commands, etc.
|
|
1564
875
|
*/
|
|
1565
|
-
operations?: string[]
|
|
876
|
+
operations?: string[];
|
|
1566
877
|
/**
|
|
1567
878
|
* - App-controlled policy version used as a stable change signal.
|
|
1568
879
|
*/
|
|
1569
|
-
policyVersion?: string | number
|
|
880
|
+
policyVersion?: string | number;
|
|
1570
881
|
/**
|
|
1571
882
|
* - Safe frontend-visible metadata.
|
|
1572
883
|
*/
|
|
1573
|
-
metadata?: Record<string, FrontendModelSyncJsonValue
|
|
884
|
+
metadata?: Record<string, FrontendModelSyncJsonValue>;
|
|
1574
885
|
/**
|
|
1575
886
|
* - Deterministic non-secret policy inputs included in the policy hash only.
|
|
1576
887
|
*/
|
|
1577
|
-
policy?: Record<string, FrontendModelSyncJsonValue
|
|
888
|
+
policy?: Record<string, FrontendModelSyncJsonValue>;
|
|
1578
889
|
};
|
|
1579
|
-
/**
|
|
1580
|
-
* Velocious sync API endpoint configuration.
|
|
1581
|
-
*/
|
|
1582
890
|
export type VelociousSyncApiConfiguration = {
|
|
1583
891
|
/**
|
|
1584
892
|
* - Mount path for the sync endpoints. Defaults to "/velocious/sync".
|
|
1585
893
|
*/
|
|
1586
|
-
mountPath?: string
|
|
894
|
+
mountPath?: string;
|
|
1587
895
|
/**
|
|
1588
896
|
* - App sync resource class served by the auto-mounted sync endpoints.
|
|
1589
897
|
*/
|
|
1590
898
|
resourceClass: FrontendModelResourceClassType;
|
|
1591
899
|
};
|
|
1592
|
-
/**
|
|
1593
|
-
* Client-side sync transport owning HTTP POSTs to the framework sync endpoints,
|
|
1594
|
-
* matching the frontend-model websocket client post contract.
|
|
1595
|
-
*/
|
|
1596
900
|
export type VelociousSyncClientTransport = {
|
|
1597
901
|
/**
|
|
1598
902
|
* - Posts one request and resolves a response with a json accessor.
|
|
1599
903
|
*/
|
|
1600
|
-
post: (path: string, body?:
|
|
904
|
+
post: (path: string, body?: ReturnType<typeof JSON.parse>, options?: {
|
|
1601
905
|
headers?: Record<string, string>;
|
|
1602
906
|
}) => Promise<{
|
|
1603
|
-
json: () =>
|
|
907
|
+
json: () => ReturnType<typeof JSON.parse>;
|
|
1604
908
|
}>;
|
|
1605
909
|
};
|
|
1606
|
-
/**
|
|
1607
|
-
* Websocket client contract required from `sync.client.realtime.createClient`,
|
|
1608
|
-
* matching `VelociousWebsocketClient` / snapreq's websocket client.
|
|
1609
|
-
*/
|
|
1610
910
|
export type VelociousSyncRealtimeWebsocketClient = {
|
|
1611
911
|
/**
|
|
1612
912
|
* - Connects the websocket.
|
|
1613
913
|
*/
|
|
1614
|
-
connect: () => Promise<
|
|
914
|
+
connect: () => Promise<ReturnType<typeof JSON.parse>>;
|
|
1615
915
|
/**
|
|
1616
916
|
* - Opens one channel subscription.
|
|
1617
917
|
*/
|
|
1618
918
|
subscribeChannel: (channelType: string, options?: {
|
|
1619
|
-
params?: Record<string,
|
|
1620
|
-
onMessage?: (body:
|
|
919
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
920
|
+
onMessage?: (body: ReturnType<typeof JSON.parse>) => void;
|
|
1621
921
|
onResume?: () => void;
|
|
1622
922
|
onClose?: (reason: string) => void;
|
|
1623
923
|
}) => VelociousSyncRealtimeSubscription;
|
|
@@ -1626,9 +926,6 @@ export type VelociousSyncRealtimeWebsocketClient = {
|
|
|
1626
926
|
*/
|
|
1627
927
|
disconnectAndStopReconnect: () => Promise<void>;
|
|
1628
928
|
};
|
|
1629
|
-
/**
|
|
1630
|
-
* Channel subscription handle returned by `subscribeChannel`.
|
|
1631
|
-
*/
|
|
1632
929
|
export type VelociousSyncRealtimeSubscription = {
|
|
1633
930
|
/**
|
|
1634
931
|
* - Closes the subscription.
|
|
@@ -1645,9 +942,6 @@ export type VelociousSyncRealtimeSubscription = {
|
|
|
1645
942
|
timeoutMs?: number;
|
|
1646
943
|
}) => Promise<void>;
|
|
1647
944
|
};
|
|
1648
|
-
/**
|
|
1649
|
-
* One realtime channel subscription descriptor.
|
|
1650
|
-
*/
|
|
1651
945
|
export type VelociousSyncRealtimeChannelDescriptor = {
|
|
1652
946
|
/**
|
|
1653
947
|
* - Server channel name to subscribe.
|
|
@@ -1656,19 +950,12 @@ export type VelociousSyncRealtimeChannelDescriptor = {
|
|
|
1656
950
|
/**
|
|
1657
951
|
* - Subscribe params (runtime scope values). The framework injects `authenticationToken` automatically.
|
|
1658
952
|
*/
|
|
1659
|
-
params?: Record<string,
|
|
953
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1660
954
|
/**
|
|
1661
955
|
* - Default resource/model name for pushed changes that do not carry their own resourceType.
|
|
1662
956
|
*/
|
|
1663
|
-
resourceType?: string
|
|
957
|
+
resourceType?: string;
|
|
1664
958
|
};
|
|
1665
|
-
/**
|
|
1666
|
-
* Realtime push configuration for the sync client. Only the genuinely
|
|
1667
|
-
* app-owned callback lives here: how to build the websocket client.
|
|
1668
|
-
* Everything else - deriving the framework sync channel subscriptions from
|
|
1669
|
-
* the declared pull scopes, subscribing, applying pushes through the derived
|
|
1670
|
-
* resource applier, echo suppression, and pull-on-reconnect - is derived.
|
|
1671
|
-
*/
|
|
1672
959
|
export type VelociousSyncClientRealtimeConfiguration = {
|
|
1673
960
|
/**
|
|
1674
961
|
* - Builds the (unconnected) websocket client; the framework owns connect/disconnect.
|
|
@@ -1677,21 +964,16 @@ export type VelociousSyncClientRealtimeConfiguration = {
|
|
|
1677
964
|
/**
|
|
1678
965
|
* - Deprecated legacy escape hatch: resolves extra app-channel descriptors from the `subscribeRealtime(context)` context. Declared pull scopes subscribe the framework sync channel automatically.
|
|
1679
966
|
*/
|
|
1680
|
-
channels?: (
|
|
967
|
+
channels?: (context: ReturnType<typeof JSON.parse>) => Array<VelociousSyncRealtimeChannelDescriptor> | Promise<Array<VelociousSyncRealtimeChannelDescriptor>>;
|
|
1681
968
|
/**
|
|
1682
969
|
* - Resolves this device's echo origin; pushed messages with a matching `echoOrigin` are dropped.
|
|
1683
970
|
*/
|
|
1684
|
-
localOrigin?: (
|
|
971
|
+
localOrigin?: () => string | Promise<string>;
|
|
1685
972
|
/**
|
|
1686
973
|
* - Fire a coalesced `pull()` when subscriptions become ready or resume after a drop, closing offline gaps. Defaults to true.
|
|
1687
974
|
*/
|
|
1688
|
-
pullOnReconnect?: boolean
|
|
975
|
+
pullOnReconnect?: boolean;
|
|
1689
976
|
};
|
|
1690
|
-
/**
|
|
1691
|
-
* Client-side sync configuration consumed by `SyncClient.fromConfiguration(...)`.
|
|
1692
|
-
* The framework owns the `${mountPath}/changes` and `${mountPath}/replay`
|
|
1693
|
-
* POSTers over the given transport.
|
|
1694
|
-
*/
|
|
1695
977
|
export type VelociousSyncClientConfiguration = {
|
|
1696
978
|
/**
|
|
1697
979
|
* - Resolves the auth token sent with sync requests.
|
|
@@ -1700,23 +982,23 @@ export type VelociousSyncClientConfiguration = {
|
|
|
1700
982
|
/**
|
|
1701
983
|
* - Max syncs per request.
|
|
1702
984
|
*/
|
|
1703
|
-
batchSize?: number
|
|
985
|
+
batchSize?: number;
|
|
1704
986
|
/**
|
|
1705
987
|
* - Connectivity gate for pulls and replays. Defaults to always online.
|
|
1706
988
|
*/
|
|
1707
|
-
isOnline?: (
|
|
989
|
+
isOnline?: () => boolean | Promise<boolean>;
|
|
1708
990
|
/**
|
|
1709
991
|
* - Mount path the server serves the sync endpoints under (match the server's `sync.api.mountPath`). Defaults to "/velocious/sync"; normalization strips trailing slashes and always fills in the default.
|
|
1710
992
|
*/
|
|
1711
|
-
mountPath?: string
|
|
993
|
+
mountPath?: string;
|
|
1712
994
|
/**
|
|
1713
995
|
* - Reports background replay/pull failures. Defaults to rethrowing.
|
|
1714
996
|
*/
|
|
1715
|
-
onError?: (
|
|
997
|
+
onError?: (error: Error) => void;
|
|
1716
998
|
/**
|
|
1717
999
|
* - Realtime push configuration consumed by `subscribeRealtime(...)`.
|
|
1718
1000
|
*/
|
|
1719
|
-
realtime?: VelociousSyncClientRealtimeConfiguration
|
|
1001
|
+
realtime?: VelociousSyncClientRealtimeConfiguration;
|
|
1720
1002
|
/**
|
|
1721
1003
|
* - Transport posting to the framework sync endpoints (e.g. the frontend-model websocket client).
|
|
1722
1004
|
*/
|
|
@@ -1724,32 +1006,29 @@ export type VelociousSyncClientConfiguration = {
|
|
|
1724
1006
|
/**
|
|
1725
1007
|
* - Shared app-lifetime websocket client (the low-level form) that all sync traffic rides. Provide the same instance the frontend-model transport uses so one connection carries everything. When set, the realtime bridge subscribes channels on it and never owns its lifecycle: unsubscribing closes only channel subscriptions, leaving the socket connected.
|
|
1726
1008
|
*/
|
|
1727
|
-
websocketClient?: VelociousSyncRealtimeWebsocketClient
|
|
1009
|
+
websocketClient?: VelociousSyncRealtimeWebsocketClient;
|
|
1728
1010
|
/**
|
|
1729
1011
|
* - Shared app-lifetime websocket URL. When set (and no `websocketClient` is given), the framework builds and owns one reconnecting `VelociousWebsocketClient` for all sync traffic, connected on first use.
|
|
1730
1012
|
*/
|
|
1731
|
-
websocketUrl?: string | (() => string | null | undefined)
|
|
1013
|
+
websocketUrl?: string | (() => string | null | undefined);
|
|
1732
1014
|
};
|
|
1733
|
-
/**
|
|
1734
|
-
* Velocious sync configuration.
|
|
1735
|
-
*/
|
|
1736
1015
|
export type VelociousSyncConfiguration = {
|
|
1737
1016
|
/**
|
|
1738
1017
|
* - Auto-mounts the Velocious sync changes/replay endpoints for this resource class.
|
|
1739
1018
|
*/
|
|
1740
|
-
api?: VelociousSyncApiConfiguration
|
|
1019
|
+
api?: VelociousSyncApiConfiguration;
|
|
1741
1020
|
/**
|
|
1742
1021
|
* - Client-side sync configuration consumed by `SyncClient.fromConfiguration(...)`.
|
|
1743
1022
|
*/
|
|
1744
|
-
client?: VelociousSyncClientConfiguration
|
|
1023
|
+
client?: VelociousSyncClientConfiguration;
|
|
1745
1024
|
/**
|
|
1746
1025
|
* - Public backend key used to verify offline device certificates for sync replay.
|
|
1747
1026
|
*/
|
|
1748
|
-
deviceCertificateBackendPublicKey?: import("
|
|
1027
|
+
deviceCertificateBackendPublicKey?: import("./sync/device-identity.js").SyncJsonWebKey | null;
|
|
1749
1028
|
/**
|
|
1750
1029
|
* - Number of accepted server changes retained before clients must refresh from snapshot.
|
|
1751
1030
|
*/
|
|
1752
|
-
changeFeedRetentionSize?: number
|
|
1031
|
+
changeFeedRetentionSize?: number;
|
|
1753
1032
|
/**
|
|
1754
1033
|
* - Signing keys used to issue and verify offline grants. Secrets must never be exposed to clients.
|
|
1755
1034
|
*/
|
|
@@ -1757,11 +1036,8 @@ export type VelociousSyncConfiguration = {
|
|
|
1757
1036
|
/**
|
|
1758
1037
|
* - Default offline grant TTL in milliseconds. Defaults to 24 hours.
|
|
1759
1038
|
*/
|
|
1760
|
-
offlineGrantTtlMs?: number
|
|
1039
|
+
offlineGrantTtlMs?: number;
|
|
1761
1040
|
};
|
|
1762
|
-
/**
|
|
1763
|
-
* Frontend-safe normalized sync metadata.
|
|
1764
|
-
*/
|
|
1765
1041
|
export type NormalizedFrontendModelResourceSyncConfiguration = {
|
|
1766
1042
|
/**
|
|
1767
1043
|
* - Normalized replay conflict strategy.
|
|
@@ -1786,7 +1062,7 @@ export type NormalizedFrontendModelResourceSyncConfiguration = {
|
|
|
1786
1062
|
/**
|
|
1787
1063
|
* - Safe frontend-visible metadata.
|
|
1788
1064
|
*/
|
|
1789
|
-
metadata?: Record<string, FrontendModelSyncJsonValue
|
|
1065
|
+
metadata?: Record<string, FrontendModelSyncJsonValue>;
|
|
1790
1066
|
};
|
|
1791
1067
|
export type NormalizedFrontendModelResourceConfiguration = Omit<FrontendModelResourceConfiguration, "abilities" | "builtInCollectionCommands" | "builtInMemberCommands" | "collectionCommands" | "commands" | "memberCommands" | "sync"> & {
|
|
1792
1068
|
abilities: FrontendModelResourceAbilitiesConfiguration;
|
|
@@ -1811,94 +1087,94 @@ export type FrontendModelResourceAbilitiesConfiguration = {
|
|
|
1811
1087
|
/**
|
|
1812
1088
|
* - Ability action for frontend index.
|
|
1813
1089
|
*/
|
|
1814
|
-
index?: string
|
|
1090
|
+
index?: string;
|
|
1815
1091
|
/**
|
|
1816
1092
|
* - Ability action for frontend find.
|
|
1817
1093
|
*/
|
|
1818
|
-
find?: string
|
|
1094
|
+
find?: string;
|
|
1819
1095
|
/**
|
|
1820
1096
|
* - Ability action for frontend create.
|
|
1821
1097
|
*/
|
|
1822
|
-
create?: string
|
|
1098
|
+
create?: string;
|
|
1823
1099
|
/**
|
|
1824
1100
|
* - Ability action for frontend update.
|
|
1825
1101
|
*/
|
|
1826
|
-
update?: string
|
|
1102
|
+
update?: string;
|
|
1827
1103
|
/**
|
|
1828
1104
|
* - Ability action for frontend destroy.
|
|
1829
1105
|
*/
|
|
1830
|
-
destroy?: string
|
|
1106
|
+
destroy?: string;
|
|
1831
1107
|
};
|
|
1832
1108
|
export type FrontendModelResourceServerConfiguration = {
|
|
1833
1109
|
/**
|
|
1834
1110
|
* - Optional callback run before built-in frontend actions.
|
|
1835
1111
|
*/
|
|
1836
|
-
beforeAction?: (
|
|
1112
|
+
beforeAction?: (args: {
|
|
1837
1113
|
action: "index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url";
|
|
1838
1114
|
controller: import("./controller.js").default;
|
|
1839
|
-
params: Record<string,
|
|
1115
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1840
1116
|
modelClass: typeof import("./database/record/index.js").default;
|
|
1841
|
-
}) => (boolean | void | Promise<boolean | void>)
|
|
1117
|
+
}) => (boolean | void | Promise<boolean | void>);
|
|
1842
1118
|
/**
|
|
1843
1119
|
* - Records loader for frontendIndex.
|
|
1844
1120
|
*/
|
|
1845
|
-
records?: (
|
|
1121
|
+
records?: (args: {
|
|
1846
1122
|
action: "index";
|
|
1847
1123
|
controller: import("./controller.js").default;
|
|
1848
|
-
params: Record<string,
|
|
1124
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1849
1125
|
modelClass: typeof import("./database/record/index.js").default;
|
|
1850
|
-
}) => Promise<import("./database/record/index.js").default[]
|
|
1126
|
+
}) => Promise<import("./database/record/index.js").default[]>;
|
|
1851
1127
|
/**
|
|
1852
1128
|
* - Record serializer for response payloads.
|
|
1853
1129
|
*/
|
|
1854
|
-
serialize?: (
|
|
1130
|
+
serialize?: (args: {
|
|
1855
1131
|
action: "index" | "find" | "create" | "update";
|
|
1856
1132
|
controller: import("./controller.js").default;
|
|
1857
|
-
params: Record<string,
|
|
1133
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1858
1134
|
modelClass: typeof import("./database/record/index.js").default;
|
|
1859
1135
|
model: import("./database/record/index.js").default;
|
|
1860
|
-
}) => Record<string,
|
|
1136
|
+
}) => Record<string, ReturnType<typeof JSON.parse>> | Promise<Record<string, ReturnType<typeof JSON.parse>>>;
|
|
1861
1137
|
/**
|
|
1862
1138
|
* - Record loader for find/update/destroy/attach/download/url actions.
|
|
1863
1139
|
*/
|
|
1864
|
-
find?: (
|
|
1140
|
+
find?: (args: {
|
|
1865
1141
|
action: "find" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url";
|
|
1866
1142
|
controller: import("./controller.js").default;
|
|
1867
|
-
params: Record<string,
|
|
1143
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1868
1144
|
modelClass: typeof import("./database/record/index.js").default;
|
|
1869
1145
|
id: string | number;
|
|
1870
|
-
}) => Promise<import("./database/record/index.js").default | null
|
|
1146
|
+
}) => Promise<import("./database/record/index.js").default | null>;
|
|
1871
1147
|
/**
|
|
1872
1148
|
* - Custom create callback.
|
|
1873
1149
|
*/
|
|
1874
|
-
create?: (
|
|
1150
|
+
create?: (args: {
|
|
1875
1151
|
action: "create";
|
|
1876
1152
|
controller: import("./controller.js").default;
|
|
1877
|
-
params: Record<string,
|
|
1153
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1878
1154
|
modelClass: typeof import("./database/record/index.js").default;
|
|
1879
|
-
attributes: Record<string,
|
|
1880
|
-
}) => Promise<import("./database/record/index.js").default
|
|
1155
|
+
attributes: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1156
|
+
}) => Promise<import("./database/record/index.js").default>;
|
|
1881
1157
|
/**
|
|
1882
1158
|
* - Custom update callback.
|
|
1883
1159
|
*/
|
|
1884
|
-
update?: (
|
|
1160
|
+
update?: (args: {
|
|
1885
1161
|
action: "update";
|
|
1886
1162
|
controller: import("./controller.js").default;
|
|
1887
|
-
params: Record<string,
|
|
1163
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1888
1164
|
modelClass: typeof import("./database/record/index.js").default;
|
|
1889
1165
|
model: import("./database/record/index.js").default;
|
|
1890
|
-
attributes: Record<string,
|
|
1891
|
-
}) => Promise<import("./database/record/index.js").default | void
|
|
1166
|
+
attributes: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1167
|
+
}) => Promise<import("./database/record/index.js").default | void>;
|
|
1892
1168
|
/**
|
|
1893
1169
|
* - Custom destroy callback.
|
|
1894
1170
|
*/
|
|
1895
|
-
destroy?: (
|
|
1171
|
+
destroy?: (args: {
|
|
1896
1172
|
action: "destroy";
|
|
1897
1173
|
controller: import("./controller.js").default;
|
|
1898
|
-
params: Record<string,
|
|
1174
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1899
1175
|
modelClass: typeof import("./database/record/index.js").default;
|
|
1900
1176
|
model: import("./database/record/index.js").default;
|
|
1901
|
-
}) => Promise<void
|
|
1177
|
+
}) => Promise<void>;
|
|
1902
1178
|
};
|
|
1903
1179
|
export type BackendProjectConfiguration = {
|
|
1904
1180
|
/**
|
|
@@ -1908,24 +1184,20 @@ export type BackendProjectConfiguration = {
|
|
|
1908
1184
|
/**
|
|
1909
1185
|
* - Optional output project path where `src/frontend-models` should be generated.
|
|
1910
1186
|
*/
|
|
1911
|
-
frontendModelsOutputPath?: string
|
|
1187
|
+
frontendModelsOutputPath?: string;
|
|
1912
1188
|
/**
|
|
1913
1189
|
* - Optional override for the resources directory to auto-discover; defaults to `<path>/src/resources`. Set internally for package entries.
|
|
1914
1190
|
*/
|
|
1915
|
-
resourcesPath?: string
|
|
1191
|
+
resourcesPath?: string;
|
|
1916
1192
|
/**
|
|
1917
1193
|
* - Auto-discovered frontend model definitions keyed by model class name. Set internally by the environment handler — do not set manually.
|
|
1918
1194
|
*/
|
|
1919
|
-
frontendModels?: Record<string,
|
|
1195
|
+
frontendModels?: Record<string, FrontendModelResourceDefinition>;
|
|
1920
1196
|
/**
|
|
1921
1197
|
* - Auto-discovered ability resource classes (frontend-model and authorization) from this project's resources directory. Set internally by the environment handler — do not set manually.
|
|
1922
1198
|
*/
|
|
1923
|
-
abilityResources?:
|
|
1199
|
+
abilityResources?: AbilityResourceClassType[];
|
|
1924
1200
|
};
|
|
1925
|
-
/**
|
|
1926
|
-
* A descriptor for an external Velocious package (engine) that contributes models,
|
|
1927
|
-
* resources and migrations. A package usually exports `new VelociousPackage({name, url: import.meta.url})`.
|
|
1928
|
-
*/
|
|
1929
1201
|
export type VelociousPackageDescriptor = {
|
|
1930
1202
|
/**
|
|
1931
1203
|
* - The package name.
|
|
@@ -1934,23 +1206,23 @@ export type VelociousPackageDescriptor = {
|
|
|
1934
1206
|
/**
|
|
1935
1207
|
* - The descriptor module's `import.meta.url`; the package root is derived from it when `path` is omitted.
|
|
1936
1208
|
*/
|
|
1937
|
-
url?: string
|
|
1209
|
+
url?: string;
|
|
1938
1210
|
/**
|
|
1939
1211
|
* - The package root directory (the one containing `src`). Derived from `url` when omitted.
|
|
1940
1212
|
*/
|
|
1941
|
-
path?: string
|
|
1213
|
+
path?: string;
|
|
1942
1214
|
/**
|
|
1943
1215
|
* - Override for the package's models directory (default `<path>/src/models`).
|
|
1944
1216
|
*/
|
|
1945
|
-
modelsPath?: string
|
|
1217
|
+
modelsPath?: string;
|
|
1946
1218
|
/**
|
|
1947
1219
|
* - Override for the package's frontend-model resources directory (default `<path>/src/resources`).
|
|
1948
1220
|
*/
|
|
1949
|
-
resourcesPath?: string
|
|
1221
|
+
resourcesPath?: string;
|
|
1950
1222
|
/**
|
|
1951
1223
|
* - Override for the package's migrations directory (default `<path>/src/database/migrations`).
|
|
1952
1224
|
*/
|
|
1953
|
-
migrationsPath?: string
|
|
1225
|
+
migrationsPath?: string;
|
|
1954
1226
|
};
|
|
1955
1227
|
export type VelociousPackageConfiguration = import("./packages/velocious-package.js").default | VelociousPackageDescriptor;
|
|
1956
1228
|
export type RouteResolverHookArgs = {
|
|
@@ -1961,7 +1233,7 @@ export type RouteResolverHookArgs = {
|
|
|
1961
1233
|
/**
|
|
1962
1234
|
* - Mutable request params object.
|
|
1963
1235
|
*/
|
|
1964
|
-
params: Record<string,
|
|
1236
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
1965
1237
|
/**
|
|
1966
1238
|
* - Request path without query.
|
|
1967
1239
|
*/
|
|
@@ -1969,7 +1241,7 @@ export type RouteResolverHookArgs = {
|
|
|
1969
1241
|
/**
|
|
1970
1242
|
* - True when matching a configured custom route.
|
|
1971
1243
|
*/
|
|
1972
|
-
hasMatchingCustomRoute?: boolean
|
|
1244
|
+
hasMatchingCustomRoute?: boolean;
|
|
1973
1245
|
/**
|
|
1974
1246
|
* - Request object.
|
|
1975
1247
|
*/
|
|
@@ -1995,162 +1267,162 @@ export type RouteResolverHookResult = {
|
|
|
1995
1267
|
/**
|
|
1996
1268
|
* - Optional controller class override.
|
|
1997
1269
|
*/
|
|
1998
|
-
controllerClass?: typeof import("./controller.js").default
|
|
1270
|
+
controllerClass?: typeof import("./controller.js").default;
|
|
1999
1271
|
/**
|
|
2000
1272
|
* - Optional absolute/relative controller file path override.
|
|
2001
1273
|
*/
|
|
2002
|
-
controllerPath?: string
|
|
1274
|
+
controllerPath?: string;
|
|
2003
1275
|
/**
|
|
2004
1276
|
* - Extra params to merge for controller/action.
|
|
2005
1277
|
*/
|
|
2006
|
-
params?: Record<string,
|
|
1278
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
2007
1279
|
/**
|
|
2008
1280
|
* - Whether to run the controller action without resolving request ability.
|
|
2009
1281
|
*/
|
|
2010
|
-
skipAbilityResolution?: boolean
|
|
1282
|
+
skipAbilityResolution?: boolean;
|
|
2011
1283
|
/**
|
|
2012
1284
|
* - Whether to run the controller action without the automatic database checkout wrapper.
|
|
2013
1285
|
*/
|
|
2014
|
-
skipControllerConnections?: boolean
|
|
1286
|
+
skipControllerConnections?: boolean;
|
|
2015
1287
|
/**
|
|
2016
1288
|
* - Whether to run the controller action without resolving request tenant.
|
|
2017
1289
|
*/
|
|
2018
|
-
skipTenantResolution?: boolean
|
|
1290
|
+
skipTenantResolution?: boolean;
|
|
2019
1291
|
/**
|
|
2020
1292
|
* - Optional view path override used by controller render lookups.
|
|
2021
1293
|
*/
|
|
2022
|
-
viewPath?: string
|
|
1294
|
+
viewPath?: string;
|
|
2023
1295
|
};
|
|
2024
|
-
export type RouteResolverHookType = (
|
|
1296
|
+
export type RouteResolverHookType = (arg: RouteResolverHookArgs) => RouteResolverHookResult | null | Promise<RouteResolverHookResult | null>;
|
|
2025
1297
|
export type AbilityResourceClassType = typeof import("./authorization/base-resource.js").default;
|
|
2026
|
-
export type AbilityResolverType = (
|
|
1298
|
+
export type AbilityResolverType = (args: {
|
|
2027
1299
|
configuration: import("./configuration.js").default;
|
|
2028
|
-
params: Record<string,
|
|
1300
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
2029
1301
|
request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined;
|
|
2030
1302
|
response: import("./http-server/client/response.js").default | undefined;
|
|
2031
1303
|
}) => import("./authorization/ability.js").default | void | Promise<import("./authorization/ability.js").default | void>;
|
|
2032
|
-
export type TenantResolverType = (
|
|
1304
|
+
export type TenantResolverType = (args: {
|
|
2033
1305
|
configuration: import("./configuration.js").default;
|
|
2034
|
-
params: Record<string,
|
|
1306
|
+
params: Record<string, ReturnType<typeof JSON.parse>>;
|
|
2035
1307
|
request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined;
|
|
2036
1308
|
response: import("./http-server/client/response.js").default | undefined;
|
|
2037
1309
|
subscription?: {
|
|
2038
1310
|
channel: string;
|
|
2039
|
-
params?: Record<string,
|
|
1311
|
+
params?: Record<string, ReturnType<typeof JSON.parse>>;
|
|
2040
1312
|
};
|
|
2041
|
-
}) =>
|
|
2042
|
-
export type TenantDatabaseResolverType = (
|
|
1313
|
+
}) => ReturnType<typeof JSON.parse> | void | Promise<ReturnType<typeof JSON.parse> | void>;
|
|
1314
|
+
export type TenantDatabaseResolverType = (args: {
|
|
2043
1315
|
configuration: import("./configuration.js").default;
|
|
2044
1316
|
databaseConfiguration: DatabaseConfigurationType;
|
|
2045
1317
|
identifier: string;
|
|
2046
|
-
tenant:
|
|
1318
|
+
tenant: ReturnType<typeof JSON.parse>;
|
|
2047
1319
|
}) => DatabaseConfigurationType | Partial<DatabaseConfigurationType> | void;
|
|
2048
1320
|
export type ApiManifestConfiguration = {
|
|
2049
1321
|
/**
|
|
2050
1322
|
* - HTTP path for the built-in API manifest endpoint. Defaults to `/api/manifest`.
|
|
2051
1323
|
*/
|
|
2052
|
-
path?: string
|
|
1324
|
+
path?: string;
|
|
2053
1325
|
/**
|
|
2054
1326
|
* - Bearer token required in the `Authorization: Bearer <token>` header. When set, requests without a matching token are not routed (404), so the endpoint stays hidden.
|
|
2055
1327
|
*/
|
|
2056
|
-
token?: string
|
|
1328
|
+
token?: string;
|
|
2057
1329
|
};
|
|
2058
1330
|
export type DebugEndpointConfiguration = {
|
|
2059
1331
|
/**
|
|
2060
1332
|
* - HTTP path for the built-in debug endpoint. Defaults to `/velocious/debug`.
|
|
2061
1333
|
*/
|
|
2062
|
-
path?: string
|
|
1334
|
+
path?: string;
|
|
2063
1335
|
/**
|
|
2064
1336
|
* - Bearer token required in the `Authorization: Bearer <token>` header. When set, requests without a matching token are not routed (404), so the endpoint stays hidden.
|
|
2065
1337
|
*/
|
|
2066
|
-
token?: string
|
|
1338
|
+
token?: string;
|
|
2067
1339
|
};
|
|
2068
1340
|
export type TenantDatabaseProviderType = {
|
|
2069
1341
|
/**
|
|
2070
1342
|
* - Lists tenants that should be created, checked, or migrated for this database identifier.
|
|
2071
1343
|
*/
|
|
2072
|
-
listTenants: (
|
|
1344
|
+
listTenants: (args: {
|
|
2073
1345
|
configuration: import("./configuration.js").default;
|
|
2074
1346
|
identifier: string;
|
|
2075
|
-
}) => Array<
|
|
1347
|
+
}) => Array<ReturnType<typeof JSON.parse>> | Promise<Array<ReturnType<typeof JSON.parse>>>;
|
|
2076
1348
|
/**
|
|
2077
1349
|
* - Lists existing tenants that should be checked for dependent restrict destroys. Defaults to listTenants.
|
|
2078
1350
|
*/
|
|
2079
|
-
listRestrictTenants?: (
|
|
1351
|
+
listRestrictTenants?: (args: {
|
|
2080
1352
|
configuration: import("./configuration.js").default;
|
|
2081
1353
|
identifier: string;
|
|
2082
|
-
}) => Array<
|
|
1354
|
+
}) => Array<ReturnType<typeof JSON.parse>> | Promise<Array<ReturnType<typeof JSON.parse>>>;
|
|
2083
1355
|
/**
|
|
2084
1356
|
* - Creates the tenant database/schema for one tenant.
|
|
2085
1357
|
*/
|
|
2086
|
-
createDatabase?: (
|
|
1358
|
+
createDatabase?: (args: {
|
|
2087
1359
|
configuration: import("./configuration.js").default;
|
|
2088
1360
|
databaseConfiguration: DatabaseConfigurationType;
|
|
2089
1361
|
identifier: string;
|
|
2090
|
-
tenant:
|
|
2091
|
-
}) => void | Promise<void
|
|
1362
|
+
tenant: ReturnType<typeof JSON.parse>;
|
|
1363
|
+
}) => void | Promise<void>;
|
|
2092
1364
|
/**
|
|
2093
1365
|
* - Drops the tenant database/schema for one tenant.
|
|
2094
1366
|
*/
|
|
2095
|
-
dropDatabase?: (
|
|
1367
|
+
dropDatabase?: (args: {
|
|
2096
1368
|
configuration: import("./configuration.js").default;
|
|
2097
1369
|
databaseConfiguration: DatabaseConfigurationType;
|
|
2098
1370
|
identifier: string;
|
|
2099
|
-
tenant:
|
|
2100
|
-
}) => void | Promise<void
|
|
1371
|
+
tenant: ReturnType<typeof JSON.parse>;
|
|
1372
|
+
}) => void | Promise<void>;
|
|
2101
1373
|
/**
|
|
2102
1374
|
* - Checks one tenant database before generic connection validation.
|
|
2103
1375
|
*/
|
|
2104
|
-
checkTenant?: (
|
|
1376
|
+
checkTenant?: (args: {
|
|
2105
1377
|
configuration: import("./configuration.js").default;
|
|
2106
1378
|
databaseConfiguration: DatabaseConfigurationType;
|
|
2107
1379
|
identifier: string;
|
|
2108
|
-
tenant:
|
|
2109
|
-
}) => void | Promise<void
|
|
1380
|
+
tenant: ReturnType<typeof JSON.parse>;
|
|
1381
|
+
}) => void | Promise<void>;
|
|
2110
1382
|
/**
|
|
2111
1383
|
* - Runs app-owned tenant work after generic migrations for one tenant. `migrationsApplied` is how many migrations actually ran (0 when the tenant was already up to date), so the app can skip expensive per-tenant work on no-op deploys.
|
|
2112
1384
|
*/
|
|
2113
|
-
afterMigrateTenant?: (
|
|
1385
|
+
afterMigrateTenant?: (args: {
|
|
2114
1386
|
configuration: import("./configuration.js").default;
|
|
2115
1387
|
databaseConfiguration: DatabaseConfigurationType;
|
|
2116
1388
|
identifier: string;
|
|
2117
1389
|
migrationsApplied: number;
|
|
2118
|
-
tenant:
|
|
2119
|
-
}) => void | Promise<void
|
|
1390
|
+
tenant: ReturnType<typeof JSON.parse>;
|
|
1391
|
+
}) => void | Promise<void>;
|
|
2120
1392
|
};
|
|
2121
1393
|
export type ConfigurationArgsType = {
|
|
2122
1394
|
/**
|
|
2123
1395
|
* - Globally enable auto-batch-preload of relationships on lazy access. Default true.
|
|
2124
1396
|
*/
|
|
2125
|
-
autoload?: boolean
|
|
1397
|
+
autoload?: boolean;
|
|
2126
1398
|
/**
|
|
2127
1399
|
* - CORS configuration for the HTTP server.
|
|
2128
1400
|
*/
|
|
2129
|
-
cors?: CorsType
|
|
1401
|
+
cors?: CorsType;
|
|
2130
1402
|
/**
|
|
2131
1403
|
* - Secret for encrypting cookies.
|
|
2132
1404
|
*/
|
|
2133
|
-
cookieSecret?: string
|
|
1405
|
+
cookieSecret?: string;
|
|
2134
1406
|
/**
|
|
2135
1407
|
* - Resource classes used to define abilities per model.
|
|
2136
1408
|
*/
|
|
2137
|
-
abilityResources?:
|
|
1409
|
+
abilityResources?: AbilityResourceClassType[];
|
|
2138
1410
|
/**
|
|
2139
1411
|
* - Resolver for creating request-scoped ability instances.
|
|
2140
1412
|
*/
|
|
2141
|
-
abilityResolver?: AbilityResolverType
|
|
1413
|
+
abilityResolver?: AbilityResolverType;
|
|
2142
1414
|
/**
|
|
2143
1415
|
* - Attachment storage configuration.
|
|
2144
1416
|
*/
|
|
2145
|
-
attachments?: AttachmentsConfiguration
|
|
1417
|
+
attachments?: AttachmentsConfiguration;
|
|
2146
1418
|
/**
|
|
2147
1419
|
* - Backend project definitions used for frontend model generation.
|
|
2148
1420
|
*/
|
|
2149
|
-
backendProjects?: BackendProjectConfiguration[]
|
|
1421
|
+
backendProjects?: BackendProjectConfiguration[];
|
|
2150
1422
|
/**
|
|
2151
1423
|
* - External Velocious packages that contribute models, frontend-model resources and migrations.
|
|
2152
1424
|
*/
|
|
2153
|
-
packages?: VelociousPackageConfiguration[]
|
|
1425
|
+
packages?: VelociousPackageConfiguration[];
|
|
2154
1426
|
/**
|
|
2155
1427
|
* - Database configurations keyed by environment and identifier.
|
|
2156
1428
|
*/
|
|
@@ -2162,27 +1434,27 @@ export type ConfigurationArgsType = {
|
|
|
2162
1434
|
/**
|
|
2163
1435
|
* - Enable debug logging.
|
|
2164
1436
|
*/
|
|
2165
|
-
debug?: boolean
|
|
1437
|
+
debug?: boolean;
|
|
2166
1438
|
/**
|
|
2167
1439
|
* - Enable the built-in debug endpoint. Defaults to false.
|
|
2168
1440
|
*/
|
|
2169
|
-
debugEndpoint?: boolean | DebugEndpointConfiguration
|
|
1441
|
+
debugEndpoint?: boolean | DebugEndpointConfiguration;
|
|
2170
1442
|
/**
|
|
2171
1443
|
* - Enable the built-in API manifest endpoint. Defaults to false.
|
|
2172
1444
|
*/
|
|
2173
|
-
apiManifest?: boolean | ApiManifestConfiguration
|
|
1445
|
+
apiManifest?: boolean | ApiManifestConfiguration;
|
|
2174
1446
|
/**
|
|
2175
1447
|
* - Base directory for the project.
|
|
2176
1448
|
*/
|
|
2177
|
-
directory?: string
|
|
1449
|
+
directory?: string;
|
|
2178
1450
|
/**
|
|
2179
1451
|
* - Require tenant-switched model queries to resolve a tenant database identifier. Defaults to true.
|
|
2180
1452
|
*/
|
|
2181
|
-
enforceTenantDatabaseScopes?: boolean
|
|
1453
|
+
enforceTenantDatabaseScopes?: boolean;
|
|
2182
1454
|
/**
|
|
2183
1455
|
* - Current environment name.
|
|
2184
1456
|
*/
|
|
2185
|
-
environment?: string
|
|
1457
|
+
environment?: string;
|
|
2186
1458
|
/**
|
|
2187
1459
|
* - Environment handler instance.
|
|
2188
1460
|
*/
|
|
@@ -2190,42 +1462,42 @@ export type ConfigurationArgsType = {
|
|
|
2190
1462
|
/**
|
|
2191
1463
|
* - Return unexpected internal error details in client API payloads outside production. Defaults to false.
|
|
2192
1464
|
*/
|
|
2193
|
-
exposeInternalErrorsToClients?: boolean
|
|
1465
|
+
exposeInternalErrorsToClients?: boolean;
|
|
2194
1466
|
/**
|
|
2195
1467
|
* - Default HTTP server configuration for applications started from this configuration.
|
|
2196
1468
|
*/
|
|
2197
|
-
httpServer?: HttpServerConfiguration
|
|
1469
|
+
httpServer?: HttpServerConfiguration;
|
|
2198
1470
|
/**
|
|
2199
1471
|
* - Logging configuration.
|
|
2200
1472
|
*/
|
|
2201
|
-
logging?: LoggingConfiguration
|
|
1473
|
+
logging?: LoggingConfiguration;
|
|
2202
1474
|
/**
|
|
2203
1475
|
* - Background jobs configuration.
|
|
2204
1476
|
*/
|
|
2205
|
-
backgroundJobs?: BackgroundJobsConfiguration
|
|
1477
|
+
backgroundJobs?: BackgroundJobsConfiguration;
|
|
2206
1478
|
/**
|
|
2207
1479
|
* - Beacon broadcast bus configuration.
|
|
2208
1480
|
*/
|
|
2209
|
-
beacon?: BeaconConfiguration
|
|
1481
|
+
beacon?: BeaconConfiguration;
|
|
2210
1482
|
/**
|
|
2211
1483
|
* - Scheduled background jobs configuration.
|
|
2212
1484
|
*/
|
|
2213
|
-
scheduledBackgroundJobs?: ScheduledBackgroundJobsConfiguration | ScheduledBackgroundJobsLoaderType
|
|
1485
|
+
scheduledBackgroundJobs?: ScheduledBackgroundJobsConfiguration | ScheduledBackgroundJobsLoaderType;
|
|
2214
1486
|
/**
|
|
2215
1487
|
* - Mail delivery backend.
|
|
2216
1488
|
*/
|
|
2217
|
-
mailerBackend?: MailerBackend
|
|
1489
|
+
mailerBackend?: MailerBackend;
|
|
2218
1490
|
/**
|
|
2219
1491
|
* - Hook to register models for a given initialization type.
|
|
2220
1492
|
*/
|
|
2221
|
-
initializeModels: (
|
|
1493
|
+
initializeModels: (args: {
|
|
2222
1494
|
configuration: import("./configuration.js").default;
|
|
2223
1495
|
type: string;
|
|
2224
1496
|
}) => void;
|
|
2225
1497
|
/**
|
|
2226
1498
|
* - Initializer loader for environment bootstrapping.
|
|
2227
1499
|
*/
|
|
2228
|
-
initializers?: InitializersType
|
|
1500
|
+
initializers?: InitializersType;
|
|
2229
1501
|
/**
|
|
2230
1502
|
* - Default locale or locale resolver.
|
|
2231
1503
|
*/
|
|
@@ -2241,54 +1513,691 @@ export type ConfigurationArgsType = {
|
|
|
2241
1513
|
/**
|
|
2242
1514
|
* - Structure SQL generation configuration.
|
|
2243
1515
|
*/
|
|
2244
|
-
structureSql?: StructureSqlConfiguration
|
|
1516
|
+
structureSql?: StructureSqlConfiguration;
|
|
2245
1517
|
/**
|
|
2246
1518
|
* - Local/offline sync framework configuration.
|
|
2247
1519
|
*/
|
|
2248
|
-
sync?: VelociousSyncConfiguration
|
|
1520
|
+
sync?: VelociousSyncConfiguration;
|
|
2249
1521
|
/**
|
|
2250
1522
|
* - Resolver for creating request-scoped tenant context objects.
|
|
2251
1523
|
*/
|
|
2252
|
-
tenantResolver?: TenantResolverType
|
|
1524
|
+
tenantResolver?: TenantResolverType;
|
|
2253
1525
|
/**
|
|
2254
1526
|
* - Resolver for deriving tenant-specific database config overrides.
|
|
2255
1527
|
*/
|
|
2256
|
-
tenantDatabaseResolver?: TenantDatabaseResolverType
|
|
1528
|
+
tenantDatabaseResolver?: TenantDatabaseResolverType;
|
|
2257
1529
|
/**
|
|
2258
1530
|
* - Tenant database lifecycle providers keyed by database identifier.
|
|
2259
1531
|
*/
|
|
2260
|
-
tenantDatabaseProviders?: Record<string, TenantDatabaseProviderType
|
|
1532
|
+
tenantDatabaseProviders?: Record<string, TenantDatabaseProviderType>;
|
|
2261
1533
|
/**
|
|
2262
1534
|
* - Path to the testing configuration file.
|
|
2263
1535
|
*/
|
|
2264
|
-
testing?: string
|
|
1536
|
+
testing?: string;
|
|
2265
1537
|
/**
|
|
2266
1538
|
* - Default timezone for timezone-less datetime strings.
|
|
2267
1539
|
*/
|
|
2268
|
-
timeZone?: string | (() => string | undefined)
|
|
1540
|
+
timeZone?: string | (() => string | undefined);
|
|
2269
1541
|
/**
|
|
2270
1542
|
* - Default timezone offset in minutes.
|
|
2271
1543
|
*/
|
|
2272
|
-
timezoneOffsetMinutes?: number | (() => number)
|
|
1544
|
+
timezoneOffsetMinutes?: number | (() => number);
|
|
2273
1545
|
/**
|
|
2274
1546
|
* - Trusted reverse proxy address ranges used to resolve request remote addresses from forwarding headers.
|
|
2275
1547
|
*/
|
|
2276
|
-
trustedProxies?: string | string[]
|
|
1548
|
+
trustedProxies?: string | string[];
|
|
2277
1549
|
/**
|
|
2278
1550
|
* - Timeout in seconds for completing a HTTP request.
|
|
2279
1551
|
*/
|
|
2280
|
-
requestTimeoutMs?: number | (() => number)
|
|
1552
|
+
requestTimeoutMs?: number | (() => number);
|
|
2281
1553
|
/**
|
|
2282
1554
|
* - Hook callbacks that can hijack unresolved routes.
|
|
2283
1555
|
*/
|
|
2284
|
-
routeResolverHooks?: RouteResolverHookType[]
|
|
1556
|
+
routeResolverHooks?: RouteResolverHookType[];
|
|
2285
1557
|
/**
|
|
2286
1558
|
* - Resolve a websocket channel class/instance for each connection.
|
|
2287
1559
|
*/
|
|
2288
|
-
websocketChannelResolver?: WebsocketChannelResolverType
|
|
1560
|
+
websocketChannelResolver?: WebsocketChannelResolverType;
|
|
2289
1561
|
/**
|
|
2290
1562
|
* - Resolve a raw websocket message handler for each connection.
|
|
2291
1563
|
*/
|
|
2292
|
-
websocketMessageHandlerResolver?: WebsocketMessageHandlerResolverType
|
|
1564
|
+
websocketMessageHandlerResolver?: WebsocketMessageHandlerResolverType;
|
|
2293
1565
|
};
|
|
1566
|
+
/**
|
|
1567
|
+
* @module types
|
|
1568
|
+
*/
|
|
1569
|
+
/**
|
|
1570
|
+
* @typedef {(args: {request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default, response: import("./http-server/client/response.js").default}) => Promise<void>} CorsType
|
|
1571
|
+
*/
|
|
1572
|
+
/**
|
|
1573
|
+
* @typedef {(args: {request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, subscription?: {channel: string, params?: Record<string, ReturnType<typeof JSON.parse>>}, client: import("./http-server/client/index.js").default, websocketSession: import("./http-server/client/websocket-session.js").default, configuration: import("./configuration.js").default}) => typeof import("./http-server/websocket-channel.js").default | import("./http-server/websocket-channel.js").default | void | Promise<typeof import("./http-server/websocket-channel.js").default | import("./http-server/websocket-channel.js").default | void>} WebsocketChannelResolverType
|
|
1574
|
+
*/
|
|
1575
|
+
/**
|
|
1576
|
+
* @typedef {object} WebsocketMessageHandler
|
|
1577
|
+
* @property {(args: {message: ReturnType<typeof JSON.parse>, session: import("./http-server/client/websocket-session.js").default}) => Promise<void> | void} [onMessage] - Handler for incoming websocket messages.
|
|
1578
|
+
* @property {(args: {session: import("./http-server/client/websocket-session.js").default}) => Promise<void> | void} [onOpen] - Handler when the websocket session opens.
|
|
1579
|
+
* @property {(args: {session: import("./http-server/client/websocket-session.js").default}) => Promise<void> | void} [onClose] - Handler when the websocket session closes.
|
|
1580
|
+
* @property {(args: {error: Error, session: import("./http-server/client/websocket-session.js").default}) => Promise<void> | void} [onError] - Handler when a websocket message errors.
|
|
1581
|
+
*/
|
|
1582
|
+
/**
|
|
1583
|
+
* @typedef {(args: {request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, client: import("./http-server/client/index.js").default, configuration: import("./configuration.js").default}) => WebsocketMessageHandler | void | Promise<WebsocketMessageHandler | void>} WebsocketMessageHandlerResolverType
|
|
1584
|
+
*/
|
|
1585
|
+
/**
|
|
1586
|
+
* @typedef {(id: string) => {default: typeof import("./initializer.js").default}} InitializersRequireContextType
|
|
1587
|
+
* @typedef {InitializersRequireContextType & {
|
|
1588
|
+
* keys: () => string[],
|
|
1589
|
+
* id: string
|
|
1590
|
+
* }} WebpackRequireContext
|
|
1591
|
+
* @typedef {{requireContext: WebpackRequireContext}} InitializersExportType
|
|
1592
|
+
* @typedef {(args: {configuration: import("./configuration.js").default}) => Promise<InitializersExportType>} InitializersType
|
|
1593
|
+
*/
|
|
1594
|
+
/**
|
|
1595
|
+
* @typedef {object} SqlConfig
|
|
1596
|
+
* @property {string} [database] - Database name for the SQL driver.
|
|
1597
|
+
* @property {object} [options] - Driver-specific connection options.
|
|
1598
|
+
* @property {boolean} [options.encrypt] - Whether to encrypt the connection (MSSQL).
|
|
1599
|
+
* @property {string} [options.schema] - Default schema for unqualified table lookups (MSSQL).
|
|
1600
|
+
* @property {string} [options.serverName] - TLS SNI server name override for MSSQL (empty string disables SNI).
|
|
1601
|
+
* @property {boolean} [options.trustServerCertificate] - Whether to trust the server certificate (MSSQL).
|
|
1602
|
+
* @property {string} [password] - Password for the SQL user.
|
|
1603
|
+
* @property {object} [pool] - Connection pool configuration.
|
|
1604
|
+
* @property {number | null} [pool.max] - Maximum number of connections. Set null to disable the cap.
|
|
1605
|
+
* @property {number} [pool.min] - Minimum number of connections.
|
|
1606
|
+
* @property {number} [pool.idleTimeoutMillis] - Idle timeout before releasing a connection.
|
|
1607
|
+
* @property {number | null} [pool.checkoutTimeoutMillis] - Timeout while waiting for an available connection after the max connection cap is reached. Set null to wait indefinitely.
|
|
1608
|
+
* @property {string} [server] - SQL server hostname.
|
|
1609
|
+
* @property {string} [user] - SQL username.
|
|
1610
|
+
*/
|
|
1611
|
+
/**
|
|
1612
|
+
* @typedef {object} DatabasePoolConfiguration
|
|
1613
|
+
* @property {number | null} [checkoutTimeoutMillis] - Timeout while a checkout waits for an available async-tracked connection after the max live connection cap is reached. Set null to wait indefinitely. Default: 10000.
|
|
1614
|
+
* @property {number | null} [idleTimeoutMillis] - Idle timeout before closing a checked-in async-tracked connection. Set null to disable idle reaping. Default: 5000.
|
|
1615
|
+
* @property {number | null} [max] - Maximum live async-tracked connections for this pool. Defaults to 10. Extra checkouts wait until a matching connection is checked in or capacity is freed. Set null to disable the cap.
|
|
1616
|
+
*/
|
|
1617
|
+
/**
|
|
1618
|
+
* @typedef {object} DatabaseConfigurationType
|
|
1619
|
+
* @property {string} [databaseCharset] - Default character set applied by `db:create` via mysql/mariadb `CREATE DATABASE ... CHARACTER SET`. Distinct from `charset`, which is the client connection charset forwarded to the mysql2 driver.
|
|
1620
|
+
* @property {string} [databaseCollation] - Default collation applied by `db:create` via mysql/mariadb `CREATE DATABASE ... COLLATE`.
|
|
1621
|
+
* @property {string} [database] - Database name for this connection.
|
|
1622
|
+
* @property {number} [deadlockMaxRetries] - Maximum attempts for the outermost transaction when it keeps hitting deadlocks. Defaults to 8.
|
|
1623
|
+
* @property {number} [deadlockBaseWaitMs] - Base delay (ms) for the deadlock retry backoff; the per-attempt ceiling doubles from here. Defaults to 50.
|
|
1624
|
+
* @property {number} [deadlockMaxWaitMs] - Cap (ms) on the deadlock retry backoff ceiling so the jittered wait stays bounded. Defaults to 1000.
|
|
1625
|
+
* @property {typeof import("./database/drivers/base.js").default} [driver] - Driver class to use for this database.
|
|
1626
|
+
* @property {typeof import("./database/pool/base.js").default} [poolType] - Pool class to use for this database.
|
|
1627
|
+
* @property {() => ReturnType<typeof JSON.parse>} [getConnection] - Custom connection factory override.
|
|
1628
|
+
* @property {string} [host] - Database host.
|
|
1629
|
+
* @property {boolean} [migrations] - Whether migrations are enabled for this database.
|
|
1630
|
+
* @property {boolean} [multipleStatements] - (MySQL) Opt in to multi-statement queries so a whole structure SQL dump loads in one round-trip via `StructureSqlLoader`. Off by default; ordinary queries otherwise reject stacked statements.
|
|
1631
|
+
* @property {string} [password] - Password for the database user.
|
|
1632
|
+
* @property {number} [port] - Database port.
|
|
1633
|
+
* @property {string} [primaryKeyType] - Default type for implicit migration primary keys and references. Defaults to `uuid`.
|
|
1634
|
+
* @property {DatabasePoolConfiguration} [pool] - Velocious database pool lifecycle configuration.
|
|
1635
|
+
* @property {string} [name] - Friendly name for the configuration.
|
|
1636
|
+
* @property {(file: string) => string} [locateFile] - Optional sqlite-web sql.js wasm resolver (`initSqlJs({locateFile})`).
|
|
1637
|
+
* @property {boolean} [readOnly] - Whether writes should be blocked for this database.
|
|
1638
|
+
* @property {string} [schema] - Default schema for unqualified table lookups (MSSQL).
|
|
1639
|
+
* @property {boolean} [schemaCache] - Whether schema metadata should be cached on the driver. Defaults to true.
|
|
1640
|
+
* @property {object} [record] - Record-level configuration.
|
|
1641
|
+
* @property {boolean} [record.transactions] - Whether record operations should use transactions.
|
|
1642
|
+
* @property {boolean} [reset] - Whether to reset the database on startup.
|
|
1643
|
+
* @property {SqlConfig} [sqlConfig] - Driver-specific SQL config.
|
|
1644
|
+
* @property {boolean} [tenantOnly] - Whether this database identifier is only active inside a resolved tenant context.
|
|
1645
|
+
* @property {"mssql" | "mysql" | "pgsql" | "sqlite"} [type] - Database type identifier.
|
|
1646
|
+
* @property {string} [useDatabase] - Database to switch to after connecting.
|
|
1647
|
+
* @property {string} [username] - Username for database authentication.
|
|
1648
|
+
*/
|
|
1649
|
+
/**
|
|
1650
|
+
* @typedef {"debug-low-level" | "debug" | "info" | "warn" | "error"} LogLevel
|
|
1651
|
+
*/
|
|
1652
|
+
/**
|
|
1653
|
+
* @typedef {object} LoggingOutputPayload
|
|
1654
|
+
* @property {LogLevel} level - Log level.
|
|
1655
|
+
* @property {string} message - Formatted message.
|
|
1656
|
+
* @property {string} subject - Log subject.
|
|
1657
|
+
* @property {Date} timestamp - Timestamp.
|
|
1658
|
+
*/
|
|
1659
|
+
/**
|
|
1660
|
+
* @typedef {object} LoggingOutput
|
|
1661
|
+
* @property {(arg: LoggingOutputPayload) => Promise<void> | void} write - Write a log entry.
|
|
1662
|
+
* @property {LogLevel[]} [levels] - Default levels for this output.
|
|
1663
|
+
*/
|
|
1664
|
+
/**
|
|
1665
|
+
* @typedef {object} LoggingOutputConfig
|
|
1666
|
+
* @property {LoggingOutput} output - Output instance.
|
|
1667
|
+
* @property {Array<LogLevel>} [levels] - Levels enabled for this output.
|
|
1668
|
+
*/
|
|
1669
|
+
/**
|
|
1670
|
+
* @typedef {LoggingOutputConfig | LoggingOutput | import("./logger/base-logger.js").default} LoggerConfig
|
|
1671
|
+
*/
|
|
1672
|
+
/**
|
|
1673
|
+
* @typedef {object} LoggingConfiguration
|
|
1674
|
+
* @property {boolean} [console] - Enable/disable console logging for request logging. Defaults to true outside of "test" and for HTTP server logs.
|
|
1675
|
+
* @property {boolean} [file] - Enable/disable writing logs to a file. Defaults to true.
|
|
1676
|
+
* @property {string} [directory] - Directory where log files are stored. Defaults to "<project>/log".
|
|
1677
|
+
* @property {string} [filePath] - Explicit path for the log file. Defaults to "<directory>/<environment>.log".
|
|
1678
|
+
* @property {Array<"debug-low-level" | "debug" | "info" | "warn" | "error">} [levels] - Override which log levels are emitted.
|
|
1679
|
+
* @property {boolean} [debugLowLevel] - Convenience flag to include very low-level debug logs.
|
|
1680
|
+
* @property {boolean} [queryLogging] - Enable/disable database query logging. Defaults to true outside test and false in test.
|
|
1681
|
+
* @property {LoggerConfig[]} [loggers] - Logger instances (converted to outputs when configured).
|
|
1682
|
+
* @property {LoggingOutputConfig[]} [outputs] - Explicit logger outputs (overrides console/file defaults when provided).
|
|
1683
|
+
*/
|
|
1684
|
+
/**
|
|
1685
|
+
* @typedef {object} StructureSqlConfiguration
|
|
1686
|
+
* @property {string[]} [enabledEnvironments] - Environments allowed to write structure sql files during automatic migration dumps.
|
|
1687
|
+
* @property {string[]} [disabledEnvironments] - Environments that should skip writing structure sql files.
|
|
1688
|
+
*/
|
|
1689
|
+
/**
|
|
1690
|
+
* @typedef {"beacon" | "polling"} BackgroundJobsDispatchStrategy
|
|
1691
|
+
*
|
|
1692
|
+
* - `"beacon"` (default): event-driven dispatch. The
|
|
1693
|
+
* `background-jobs-main` process drains the queue on enqueue, on
|
|
1694
|
+
* worker readiness, on Beacon broadcasts (so cross-process enqueues
|
|
1695
|
+
* wake it), and arms a `setTimeout` for the soonest future-scheduled
|
|
1696
|
+
* job. Falls back gracefully to direct in-process triggering when
|
|
1697
|
+
* Beacon is not configured.
|
|
1698
|
+
* - `"polling"`: legacy mode, runs a fixed-interval poll over the
|
|
1699
|
+
* `background_jobs` table (see `pollIntervalMs`).
|
|
1700
|
+
*/
|
|
1701
|
+
/**
|
|
1702
|
+
* @typedef {object} BackgroundJobsConfiguration
|
|
1703
|
+
* @property {string} [host] - Hostname for the background jobs main process.
|
|
1704
|
+
* @property {number} [port] - Port for the background jobs main process.
|
|
1705
|
+
* @property {string} [databaseIdentifier] - Database identifier used to store background jobs.
|
|
1706
|
+
* @property {number} [maxConcurrentInlineJobs] - How many `forked: false` jobs a single
|
|
1707
|
+
* `background-jobs-worker` process is allowed to run in parallel. Concurrency
|
|
1708
|
+
* is at the JS event-loop level: every concurrent job shares the worker's
|
|
1709
|
+
* process and DB connection pool, so this should fit the pool size, not the
|
|
1710
|
+
* CPU count. Forking remains the right tool for memory isolation across
|
|
1711
|
+
* long-running jobs and for using more cores. Default: `4`.
|
|
1712
|
+
* @property {number} [maxConcurrentForkedJobs] - How many out-of-process
|
|
1713
|
+
* `"forked"` or `"spawned"` jobs a single `background-jobs-worker` is
|
|
1714
|
+
* allowed to keep in flight. Default: `4`. This is a per-worker safety cap;
|
|
1715
|
+
* for workload-shaped limits use per-queue caps (`queues`) instead, which are
|
|
1716
|
+
* enforced cluster-wide and are immune to duplicate worker processes.
|
|
1717
|
+
* @property {number} [pooledRunnerCount] - Number of warm, reusable child runners owned by each worker. Pooled capacity is separate from inline and forked/spawned capacity. Default: `4`.
|
|
1718
|
+
* @property {number} [pooledRunnerConcurrency] - Number of jobs each pooled child runs concurrently on its own event loop. Total per-worker pooled capacity is `pooledRunnerCount × pooledRunnerConcurrency`. `1` (default) keeps each child serial; raise it for I/O-bound jobs so a bounded set of isolated processes handles high concurrency (like the inline lane) without one process per concurrent job. Default: `1`.
|
|
1719
|
+
* @property {number} [pooledRunnerMaxJobs] - Number of sequential jobs a pooled child runs before it is replaced, bounding process-level resource accumulation. Default: `100`.
|
|
1720
|
+
* @property {number} [pooledRunnerMaxRssBytes] - RSS bytes after an acknowledged job at which a pooled child is replaced. Default: `536870912` (512 MiB).
|
|
1721
|
+
* @property {number} [pooledRunnerMaxLifetimeMs] - Age after an acknowledged job at which a pooled child is replaced. Default: `3600000` (one hour).
|
|
1722
|
+
* @property {Record<string, {maxConcurrent?: number, priority?: number}>} [queues] - Per-queue
|
|
1723
|
+
* concurrency caps and dispatch priorities, Sidekiq-style. A job declares its queue (static
|
|
1724
|
+
* `queue` on the job class, or the `queue` enqueue option; defaults to `"default"`), and
|
|
1725
|
+
* `queues[name].maxConcurrent` bounds how many jobs from that queue may be
|
|
1726
|
+
* in flight across the whole cluster (enforced via durable per-key
|
|
1727
|
+
* concurrency, so it holds regardless of how many worker processes run).
|
|
1728
|
+
* Size each queue to its workload: I/O-bound queues (e.g. build runners
|
|
1729
|
+
* waiting on remote Docker servers) can run far above the core count, while
|
|
1730
|
+
* CPU-bound queues should stay near it. `queues[name].priority` (default `0`)
|
|
1731
|
+
* makes the main process dispatch higher-priority queues before lower-priority
|
|
1732
|
+
* ones regardless of enqueue order, so a small time-critical queue can never be
|
|
1733
|
+
* starved by a flood of low-priority work sharing a worker pool. Unlike
|
|
1734
|
+
* Sidekiq's strict queue ordering, priority composes with the per-queue caps:
|
|
1735
|
+
* a higher-priority queue that is already at its `maxConcurrent` is skipped and
|
|
1736
|
+
* dispatch falls through to the next eligible lower-priority job, so a busy
|
|
1737
|
+
* high-priority queue does not block everything else. This fallthrough is a
|
|
1738
|
+
* property of the queue-derived cap; a job that supplies its own explicit
|
|
1739
|
+
* `concurrencyKey`/`maxConcurrency` bypasses the queue cap entirely (an
|
|
1740
|
+
* explicit key always wins — see above) and is bounded only by that key, so it
|
|
1741
|
+
* is not held back by the queue's cap and priority simply orders it normally.
|
|
1742
|
+
* Priorities may be any number, including negative to sink a queue below the
|
|
1743
|
+
* default. Jobs within the same priority keep FIFO (`scheduled_at`, then
|
|
1744
|
+
* `created_at`) order. Default: `{}` (no queue caps, all queues priority `0`).
|
|
1745
|
+
* @property {BackgroundJobsDispatchStrategy} [dispatchStrategy] - How the main process
|
|
1746
|
+
* detects new work. Defaults to `"beacon"` (event-driven). Set to `"polling"`
|
|
1747
|
+
* to restore the legacy fixed-interval poll.
|
|
1748
|
+
* @property {number} [pollIntervalMs] - Poll interval in milliseconds. Only used
|
|
1749
|
+
* when `dispatchStrategy === "polling"`. Default: `1000`.
|
|
1750
|
+
* @property {number | null} [jobTimeoutMs] - Wall-clock backstop, in ms, for a
|
|
1751
|
+
* `"forked"` job runner. A forked job still running after this is terminated
|
|
1752
|
+
* (SIGTERM, then SIGKILL after the reaping grace) and reported failed, so a
|
|
1753
|
+
* single genuinely-hung runner can't pin a draining worker — and its full-app
|
|
1754
|
+
* boot and DB connections — indefinitely (e.g. across a deploy where a retired
|
|
1755
|
+
* worker drains in-flight jobs). This is a coarse safety net, not per-job
|
|
1756
|
+
* tuning: set it well above the longest legitimate forked job (build runners,
|
|
1757
|
+
* long imports) so only genuinely-stuck runners are killed. Omit, `null`, or
|
|
1758
|
+
* `<= 0` to disable (default), which preserves the prior unbounded behavior.
|
|
1759
|
+
* @property {BackgroundJobsRetentionConfiguration} [retention] - Retention/pruning
|
|
1760
|
+
* of terminal job rows. Without pruning the jobs table grows unbounded
|
|
1761
|
+
* (completed rows accumulate forever), which bloats storage and indexes and
|
|
1762
|
+
* eventually slows dispatch. The main process sweeps terminal rows past their
|
|
1763
|
+
* window on an interval.
|
|
1764
|
+
*/
|
|
1765
|
+
/**
|
|
1766
|
+
* @typedef {object} BackgroundJobsRetentionConfiguration
|
|
1767
|
+
* @property {number | null} [completedTtlMs] - Delete `completed` jobs whose
|
|
1768
|
+
* `completed_at_ms` is older than this many ms. `null` or `<= 0` disables
|
|
1769
|
+
* completed pruning. Default: `604800000` (7 days).
|
|
1770
|
+
* @property {number | null} [failedTtlMs] - Delete terminal `failed`/`orphaned`
|
|
1771
|
+
* jobs older than this many ms. `null` or `<= 0` disables (keeps them for
|
|
1772
|
+
* debugging). Default: `2592000000` (30 days).
|
|
1773
|
+
* @property {number} [batchSize] - Rows deleted per batch. Default: `1000`.
|
|
1774
|
+
* @property {number} [sweepIntervalMs] - How often the retention sweep runs.
|
|
1775
|
+
* Default: `3600000` (1 hour).
|
|
1776
|
+
*/
|
|
1777
|
+
/**
|
|
1778
|
+
* Fully-resolved retention config as returned by `getBackgroundJobsConfig()`
|
|
1779
|
+
* (every field defaulted), as opposed to the partial user-provided input.
|
|
1780
|
+
* @typedef {object} ResolvedBackgroundJobsRetentionConfiguration
|
|
1781
|
+
* @property {number | null} completedTtlMs - Resolved completed-job TTL in ms (`null` disables).
|
|
1782
|
+
* @property {number | null} failedTtlMs - Resolved failed/orphaned TTL in ms (`null` disables).
|
|
1783
|
+
* @property {number} batchSize - Resolved delete batch size.
|
|
1784
|
+
* @property {number} sweepIntervalMs - Resolved sweep interval in ms.
|
|
1785
|
+
*/
|
|
1786
|
+
/**
|
|
1787
|
+
* @typedef {object} BeaconConfiguration
|
|
1788
|
+
* @property {boolean} [enabled] - Whether to connect to a Beacon broker. Defaults to false unless `host`/`port` or `inProcess: true` are set, or env vars are present. Explicit `false` disables Beacon even when env vars are set.
|
|
1789
|
+
* @property {boolean} [inProcess] - When true, use a module-level in-process broker singleton instead of connecting over TCP. Mutually exclusive with `host`/`port`. Useful for tests and single-process deployments.
|
|
1790
|
+
* @property {string} [host] - Hostname of the Beacon broker daemon.
|
|
1791
|
+
* @property {number} [port] - Port of the Beacon broker daemon.
|
|
1792
|
+
* @property {string} [peerType] - Optional human-readable label for this peer (e.g. "server", "background-jobs-worker").
|
|
1793
|
+
* @property {number} [unreachableReportMs] - Grace window (ms) a beacon connect/disconnect blip must persist before it is reported as a framework-error. Transient outages that recover within this window (e.g. a deploy restarting the broker) are not reported. Defaults to 30000.
|
|
1794
|
+
*/
|
|
1795
|
+
/**
|
|
1796
|
+
* @typedef {object} HttpCompressionConfiguration
|
|
1797
|
+
* @property {boolean} [enabled] - Whether buffered response compression is enabled. Defaults to true; set false to disable globally.
|
|
1798
|
+
* @property {number} [threshold] - Minimum buffered body size in bytes before compression is applied. Defaults to 1024.
|
|
1799
|
+
* @property {number} [brotliQuality] - Brotli encoder quality (0-11). Defaults to 4.
|
|
1800
|
+
* @property {number} [gzipLevel] - Gzip compression level (0-9). Defaults to 6.
|
|
1801
|
+
*/
|
|
1802
|
+
/**
|
|
1803
|
+
* @typedef {object} NormalizedHttpCompressionConfiguration
|
|
1804
|
+
* @property {boolean} enabled - Whether buffered HTTP response compression is enabled.
|
|
1805
|
+
* @property {number} threshold - Minimum buffered body size in bytes before compression is applied.
|
|
1806
|
+
* @property {number} brotliQuality - Brotli encoder quality (0-11).
|
|
1807
|
+
* @property {number} gzipLevel - Gzip compression level (0-9).
|
|
1808
|
+
*/
|
|
1809
|
+
/**
|
|
1810
|
+
* @typedef {object} HttpServerConfiguration
|
|
1811
|
+
* @property {boolean | HttpCompressionConfiguration} [compression] - Buffered response compression. Enabled with documented defaults when absent; false or {enabled: false} disables it globally.
|
|
1812
|
+
* @property {string} [host] - Hostname to bind the HTTP server to.
|
|
1813
|
+
* @property {boolean} [inProcess] - Run HTTP handlers in the main thread instead of worker threads.
|
|
1814
|
+
* @property {number} [maxWorkers] - Backward-compatible alias for workers.
|
|
1815
|
+
* @property {number} [port] - Port to bind the HTTP server to.
|
|
1816
|
+
* @property {{maxPendingBytes?: number, maxPendingMessages?: number}} [websocketInboundQueue] - Per-session retained inbound WebSocket message limits.
|
|
1817
|
+
* @property {{maxPendingBytes?: number, maxPendingFrames?: number}} [websocketOutboundQueue] - Per-client retained outbound WebSocket frame limits.
|
|
1818
|
+
* @property {number} [workers] - Worker handlers to start for the HTTP server.
|
|
1819
|
+
*/
|
|
1820
|
+
/**
|
|
1821
|
+
* @typedef {object} ScheduledBackgroundJobEveryOptions
|
|
1822
|
+
* @property {number | string} [firstIn] - Delay before the first enqueue.
|
|
1823
|
+
*/
|
|
1824
|
+
/**
|
|
1825
|
+
* @typedef {object} ScheduledBackgroundJobConfiguration
|
|
1826
|
+
* @property {Array<ReturnType<typeof JSON.parse>>} [args] - Arguments passed to the job when enqueued.
|
|
1827
|
+
* @property {typeof import("./background-jobs/job.js").default} class - Job class to enqueue.
|
|
1828
|
+
* @property {string} [cron] - Crontab expression (5-field POSIX, plus `@hourly`/`@daily`/`@weekly`/`@monthly`/`@yearly`/`@midnight`). Mutually exclusive with `every`.
|
|
1829
|
+
* @property {boolean} [enabled] - Whether the schedule is enabled.
|
|
1830
|
+
* @property {number | string | [number | string, ScheduledBackgroundJobEveryOptions]} [every] - Repeat interval. Either `every` or `cron` must be set.
|
|
1831
|
+
* @property {import("./background-jobs/types.js").BackgroundJobOptions} [options] - Job options.
|
|
1832
|
+
*/
|
|
1833
|
+
/**
|
|
1834
|
+
* @typedef {Record<string, string>} VelociousParams
|
|
1835
|
+
*/
|
|
1836
|
+
/**
|
|
1837
|
+
* @typedef {Record<string, import("./frontend-models/query.js").FrontendModelTransportValue>} ClientErrorPayloadReporterPayload
|
|
1838
|
+
*/
|
|
1839
|
+
/**
|
|
1840
|
+
* @typedef {object} ErrorRequestDetails
|
|
1841
|
+
* @property {ReturnType<typeof JSON.parse>} [body] - Sanitized parsed request body, when available.
|
|
1842
|
+
* @property {string} httpMethod - Request HTTP method.
|
|
1843
|
+
* @property {string} path - Request path.
|
|
1844
|
+
*/
|
|
1845
|
+
/**
|
|
1846
|
+
* @typedef {object} ClientErrorPayloadContext
|
|
1847
|
+
* @property {string} controller - Controller class name.
|
|
1848
|
+
* @property {string} [action] - Controller action or endpoint label.
|
|
1849
|
+
* @property {"index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url" | "custom-command"} [commandType] - Frontend-model command type.
|
|
1850
|
+
* @property {string} [correlationId] - Server-generated identifier shared by an unexpected client error and framework reports.
|
|
1851
|
+
* @property {boolean} [expectedError] - Whether the error is an expected user-flow failure.
|
|
1852
|
+
* @property {boolean} [frontendModelEndpoint] - Whether the error came from the frontend-model endpoint.
|
|
1853
|
+
* @property {string} [model] - Frontend-model name from the failed request.
|
|
1854
|
+
* @property {string} [requestId] - Shared frontend-model request id.
|
|
1855
|
+
*/
|
|
1856
|
+
/**
|
|
1857
|
+
* @typedef {(args: {
|
|
1858
|
+
* context: ClientErrorPayloadContext,
|
|
1859
|
+
* error: Error,
|
|
1860
|
+
* request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined,
|
|
1861
|
+
* requestDetails: ErrorRequestDetails | null
|
|
1862
|
+
* }) => Promise<ClientErrorPayloadReporterPayload | void> | ClientErrorPayloadReporterPayload | void} ClientErrorPayloadReporterType
|
|
1863
|
+
*/
|
|
1864
|
+
/**
|
|
1865
|
+
* @typedef {Record<string, unknown> & {configuration?: import("./configuration.js").default, currentDevice?: unknown, currentUser?: unknown, modelRegistry?: Record<string, unknown> | {model: (name: string) => unknown}, now?: Date | (() => Date), offlineGrant?: unknown, params?: VelociousParams, request?: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default, resourceRuntime?: "backend" | "frontend" | "offline"}} VelociousLooseObject
|
|
1866
|
+
*/
|
|
1867
|
+
/**
|
|
1868
|
+
* @typedef {new (args: {attachmentName?: string, configuration: import("./configuration.js").default, modelClass?: typeof import("./database/record/index.js").default, name?: string, options?: Record<string, ReturnType<typeof JSON.parse>>}) => object} AttachmentDriverConstructor
|
|
1869
|
+
*/
|
|
1870
|
+
/**
|
|
1871
|
+
* @typedef {object} ScheduledBackgroundJobsConfiguration
|
|
1872
|
+
* @property {Record<string, ScheduledBackgroundJobConfiguration>} jobs - Scheduled jobs keyed by name.
|
|
1873
|
+
*/
|
|
1874
|
+
/**
|
|
1875
|
+
* @typedef {(args: {configuration: import("./configuration.js").default}) => ScheduledBackgroundJobsConfiguration | Promise<ScheduledBackgroundJobsConfiguration>} ScheduledBackgroundJobsLoaderType
|
|
1876
|
+
*/
|
|
1877
|
+
/**
|
|
1878
|
+
* @typedef {object} AttachmentDriverConfiguration
|
|
1879
|
+
* @property {(args: {configuration: import("./configuration.js").default, name: string, options: Record<string, ReturnType<typeof JSON.parse>>}) => Record<string, ReturnType<typeof JSON.parse>>} [create] - Optional factory for a custom attachment driver instance.
|
|
1880
|
+
* @property {AttachmentDriverConstructor} [driverClass] - Optional custom attachment driver class.
|
|
1881
|
+
* @property {Record<string, ReturnType<typeof JSON.parse>>} [instance] - Optional custom attachment driver instance.
|
|
1882
|
+
*/
|
|
1883
|
+
/**
|
|
1884
|
+
* @typedef {object} AttachmentsConfiguration
|
|
1885
|
+
* @property {string} [defaultDriver] - Default attachment storage driver name.
|
|
1886
|
+
* @property {Record<string, AttachmentDriverConfiguration & Record<string, ReturnType<typeof JSON.parse>>>} [drivers] - Named attachment driver configurations.
|
|
1887
|
+
* @property {boolean} [allowPathInput] - Whether `{path: ...}` attachment input is allowed.
|
|
1888
|
+
* @property {string[]} [allowedPathPrefixes] - Optional allowlist of directories for `{path: ...}` input.
|
|
1889
|
+
*/
|
|
1890
|
+
/**
|
|
1891
|
+
* @typedef {object} MailerBackend
|
|
1892
|
+
* @property {(args: {payload: import("./mailer.js").MailerDeliveryPayload, configuration: import("./configuration.js").default}) => Promise<ReturnType<typeof JSON.parse>> | ReturnType<typeof JSON.parse>} deliver - Deliver a mailer payload.
|
|
1893
|
+
*/
|
|
1894
|
+
/**
|
|
1895
|
+
* @typedef {Record<string, string[]>} LocaleFallbacksType
|
|
1896
|
+
*/
|
|
1897
|
+
/**
|
|
1898
|
+
* @typedef {object} FrontendModelRelationshipConfiguration
|
|
1899
|
+
* @property {"belongsTo" | "hasOne" | "hasMany"} type - Relationship type.
|
|
1900
|
+
* @property {string} [model] - Target model class name.
|
|
1901
|
+
* @property {string} [className] - Alias of target model class name.
|
|
1902
|
+
* @property {string} [modelClassName] - Explicit target model class name.
|
|
1903
|
+
*/
|
|
1904
|
+
/**
|
|
1905
|
+
* @typedef {object} FrontendModelAttributeConfiguration
|
|
1906
|
+
* @property {string} [type] - Column type name.
|
|
1907
|
+
* @property {string} [columnType] - Alias for column type name.
|
|
1908
|
+
* @property {string} [sqlType] - Alias for column type name.
|
|
1909
|
+
* @property {string} [dataType] - Alias for column type name.
|
|
1910
|
+
* @property {string} [jsDocType] - Exact generated JSDoc type for non-column attributes.
|
|
1911
|
+
* @property {string} [name] - Attribute name when configured as an array entry.
|
|
1912
|
+
* @property {boolean} [null] - Whether value can be null.
|
|
1913
|
+
* @property {boolean} [selectedByDefault] - Whether included in default serialization. Defaults to true.
|
|
1914
|
+
*/
|
|
1915
|
+
/**
|
|
1916
|
+
* @typedef {object} FrontendModelAttachmentConfiguration
|
|
1917
|
+
* @property {"hasOne" | "hasMany"} type - Attachment cardinality.
|
|
1918
|
+
*/
|
|
1919
|
+
/**
|
|
1920
|
+
* @typedef {object} FrontendModelResourceConfiguration
|
|
1921
|
+
* @property {Array<string | FrontendModelAttributeConfiguration> | Record<string, FrontendModelAttributeConfiguration | import("./database/drivers/base-column.js").default | boolean>} attributes - Attributes to expose on the frontend model.
|
|
1922
|
+
* @property {string[]} [abilities] - Additional camelCase ability action names to expose for per-record `record.can(action)` reads. Base CRUD actions (`read`, `create`, `update`, `destroy`) are always included and must not be listed here.
|
|
1923
|
+
* @property {Record<string, FrontendModelAttachmentConfiguration>} [attachments] - Attachment helpers keyed by attachment name.
|
|
1924
|
+
* @property {string[]} [commands] - Legacy built-in command names (`index`, `find`, `create`, `update`, `destroy`, `attach`, `download`, `url`).
|
|
1925
|
+
* @property {Array<FrontendModelResourceCustomCommand>} [collectionCommands] - Custom collection commands. Each entry is a camelCase method name, or a `{name, args?, returnType?}` object declaring typed arguments and/or a response type. The runtime derives the kebab-case command slug from the name.
|
|
1926
|
+
* @property {Array<FrontendModelResourceCustomCommand>} [memberCommands] - Custom member commands. Each entry is a camelCase method name, or a `{name, args?, returnType?}` object declaring typed arguments and/or a response type. The runtime derives the kebab-case command slug from the name.
|
|
1927
|
+
* @property {string[]} [builtInCollectionCommands] - Built-in collection command names (`index`, `create`).
|
|
1928
|
+
* @property {string[]} [builtInMemberCommands] - Built-in member command names (`find`, `update`, `destroy`, `attach`, `download`, `url`).
|
|
1929
|
+
* @property {string} [modelName] - Frontend model name override.
|
|
1930
|
+
* @property {string[]} [relationships] - Relationship names to expose in frontend models. Type and target model are inferred from the backend model's registered relationships.
|
|
1931
|
+
* @property {string} [primaryKey] - Primary key attribute name.
|
|
1932
|
+
* @property {FrontendModelResourceServerConfiguration} [server] - Optional legacy backend behavior overrides for built-in frontend actions.
|
|
1933
|
+
* @property {FrontendModelResourceSyncConfiguration | boolean} [sync] - Optional safe local/offline sync policy metadata. `policy` participates in the hash but is not exposed to generated frontend config/manifest.
|
|
1934
|
+
*/
|
|
1935
|
+
/**
|
|
1936
|
+
* Object form of a custom command entry, declaring its typed arguments and/or
|
|
1937
|
+
* response type alongside the command name.
|
|
1938
|
+
* @typedef {object} FrontendModelResourceCustomCommandObject
|
|
1939
|
+
* @property {string} name - camelCase command method name.
|
|
1940
|
+
* @property {Array<{name: string, type: string}>} [args] - Typed command arguments; each generates a named, typed method parameter mapped positionally into the command payload. `type` is a JSDoc type string.
|
|
1941
|
+
* @property {string} [returnType] - JSDoc type for the command response. When set, the generated method is typed `Promise<returnType>` instead of `Promise<Record<string, ReturnType<typeof JSON.parse>>>`. Emitted verbatim into the generated frontend model, so it must resolve there.
|
|
1942
|
+
*/
|
|
1943
|
+
/**
|
|
1944
|
+
* A custom command entry: a plain camelCase method name, or an object declaring
|
|
1945
|
+
* typed args and/or a response type.
|
|
1946
|
+
* @typedef {string | FrontendModelResourceCustomCommandObject} FrontendModelResourceCustomCommand
|
|
1947
|
+
*/
|
|
1948
|
+
/**
|
|
1949
|
+
* JSON value accepted by sync policy metadata/hash inputs.
|
|
1950
|
+
* @typedef {null | string | number | boolean | unknown[] | Record<string, unknown>} FrontendModelSyncJsonValue
|
|
1951
|
+
*/
|
|
1952
|
+
/**
|
|
1953
|
+
* Frontend-model local/offline sync policy config. `metadata` is exposed to
|
|
1954
|
+
* frontends and peers; `policy` is hashed but intentionally omitted from
|
|
1955
|
+
* frontend-safe manifests.
|
|
1956
|
+
* @typedef {object} FrontendModelResourceSyncConfiguration
|
|
1957
|
+
* @property {"optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly"} [conflictStrategy] - Strategy used when replay detects server/client divergence. Defaults to `optimisticVersion`.
|
|
1958
|
+
* @property {boolean} [enabled] - Whether the resource is sync-enabled. Defaults to true when `sync` is configured.
|
|
1959
|
+
* @property {string[]} [operations] - Sync operation names such as `index`, `find`, `create`, `update`, custom domain commands, etc.
|
|
1960
|
+
* @property {string | number} [policyVersion] - App-controlled policy version used as a stable change signal.
|
|
1961
|
+
* @property {Record<string, FrontendModelSyncJsonValue>} [metadata] - Safe frontend-visible metadata.
|
|
1962
|
+
* @property {Record<string, FrontendModelSyncJsonValue>} [policy] - Deterministic non-secret policy inputs included in the policy hash only.
|
|
1963
|
+
*/
|
|
1964
|
+
/**
|
|
1965
|
+
* Velocious sync API endpoint configuration.
|
|
1966
|
+
* @typedef {object} VelociousSyncApiConfiguration
|
|
1967
|
+
* @property {string} [mountPath] - Mount path for the sync endpoints. Defaults to "/velocious/sync".
|
|
1968
|
+
* @property {FrontendModelResourceClassType} resourceClass - App sync resource class served by the auto-mounted sync endpoints.
|
|
1969
|
+
*/
|
|
1970
|
+
/**
|
|
1971
|
+
* Client-side sync transport owning HTTP POSTs to the framework sync endpoints,
|
|
1972
|
+
* matching the frontend-model websocket client post contract.
|
|
1973
|
+
* @typedef {object} VelociousSyncClientTransport
|
|
1974
|
+
* @property {(path: string, body?: ReturnType<typeof JSON.parse>, options?: {headers?: Record<string, string>}) => Promise<{json: () => ReturnType<typeof JSON.parse>}>} post - Posts one request and resolves a response with a json accessor.
|
|
1975
|
+
*/
|
|
1976
|
+
/**
|
|
1977
|
+
* Websocket client contract required from `sync.client.realtime.createClient`,
|
|
1978
|
+
* matching `VelociousWebsocketClient` / snapreq's websocket client.
|
|
1979
|
+
* @typedef {object} VelociousSyncRealtimeWebsocketClient
|
|
1980
|
+
* @property {() => Promise<ReturnType<typeof JSON.parse>>} connect - Connects the websocket.
|
|
1981
|
+
* @property {(channelType: string, options?: {params?: Record<string, ReturnType<typeof JSON.parse>>, onMessage?: (body: ReturnType<typeof JSON.parse>) => void, onResume?: () => void, onClose?: (reason: string) => void}) => VelociousSyncRealtimeSubscription} subscribeChannel - Opens one channel subscription.
|
|
1982
|
+
* @property {() => Promise<void>} disconnectAndStopReconnect - Closes the socket and stops auto-reconnect.
|
|
1983
|
+
*/
|
|
1984
|
+
/**
|
|
1985
|
+
* Channel subscription handle returned by `subscribeChannel`.
|
|
1986
|
+
* @typedef {object} VelociousSyncRealtimeSubscription
|
|
1987
|
+
* @property {() => void} close - Closes the subscription.
|
|
1988
|
+
* @property {() => boolean} isReady - Whether the subscription is acknowledged and ready.
|
|
1989
|
+
* @property {(params?: {timeoutMs?: number}) => Promise<void>} waitForReady - Resolves once the server acknowledges the subscription.
|
|
1990
|
+
*/
|
|
1991
|
+
/**
|
|
1992
|
+
* One realtime channel subscription descriptor.
|
|
1993
|
+
* @typedef {object} VelociousSyncRealtimeChannelDescriptor
|
|
1994
|
+
* @property {string} channel - Server channel name to subscribe.
|
|
1995
|
+
* @property {Record<string, ReturnType<typeof JSON.parse>>} [params] - Subscribe params (runtime scope values). The framework injects `authenticationToken` automatically.
|
|
1996
|
+
* @property {string} [resourceType] - Default resource/model name for pushed changes that do not carry their own resourceType.
|
|
1997
|
+
*/
|
|
1998
|
+
/**
|
|
1999
|
+
* Realtime push configuration for the sync client. Only the genuinely
|
|
2000
|
+
* app-owned callback lives here: how to build the websocket client.
|
|
2001
|
+
* Everything else - deriving the framework sync channel subscriptions from
|
|
2002
|
+
* the declared pull scopes, subscribing, applying pushes through the derived
|
|
2003
|
+
* resource applier, echo suppression, and pull-on-reconnect - is derived.
|
|
2004
|
+
* @typedef {object} VelociousSyncClientRealtimeConfiguration
|
|
2005
|
+
* @property {() => VelociousSyncRealtimeWebsocketClient | Promise<VelociousSyncRealtimeWebsocketClient>} createClient - Builds the (unconnected) websocket client; the framework owns connect/disconnect.
|
|
2006
|
+
* @property {(context: ReturnType<typeof JSON.parse>) => Array<VelociousSyncRealtimeChannelDescriptor> | Promise<Array<VelociousSyncRealtimeChannelDescriptor>>} [channels] - Deprecated legacy escape hatch: resolves extra app-channel descriptors from the `subscribeRealtime(context)` context. Declared pull scopes subscribe the framework sync channel automatically.
|
|
2007
|
+
* @property {() => string | Promise<string>} [localOrigin] - Resolves this device's echo origin; pushed messages with a matching `echoOrigin` are dropped.
|
|
2008
|
+
* @property {boolean} [pullOnReconnect] - Fire a coalesced `pull()` when subscriptions become ready or resume after a drop, closing offline gaps. Defaults to true.
|
|
2009
|
+
*/
|
|
2010
|
+
/**
|
|
2011
|
+
* Client-side sync configuration consumed by `SyncClient.fromConfiguration(...)`.
|
|
2012
|
+
* The framework owns the `${mountPath}/changes` and `${mountPath}/replay`
|
|
2013
|
+
* POSTers over the given transport.
|
|
2014
|
+
* @typedef {object} VelociousSyncClientConfiguration
|
|
2015
|
+
* @property {() => string | Promise<string>} authenticationToken - Resolves the auth token sent with sync requests.
|
|
2016
|
+
* @property {number} [batchSize] - Max syncs per request.
|
|
2017
|
+
* @property {() => boolean | Promise<boolean>} [isOnline] - Connectivity gate for pulls and replays. Defaults to always online.
|
|
2018
|
+
* @property {string} [mountPath] - Mount path the server serves the sync endpoints under (match the server's `sync.api.mountPath`). Defaults to "/velocious/sync"; normalization strips trailing slashes and always fills in the default.
|
|
2019
|
+
* @property {(error: Error) => void} [onError] - Reports background replay/pull failures. Defaults to rethrowing.
|
|
2020
|
+
* @property {VelociousSyncClientRealtimeConfiguration} [realtime] - Realtime push configuration consumed by `subscribeRealtime(...)`.
|
|
2021
|
+
* @property {VelociousSyncClientTransport} transport - Transport posting to the framework sync endpoints (e.g. the frontend-model websocket client).
|
|
2022
|
+
* @property {VelociousSyncRealtimeWebsocketClient} [websocketClient] - Shared app-lifetime websocket client (the low-level form) that all sync traffic rides. Provide the same instance the frontend-model transport uses so one connection carries everything. When set, the realtime bridge subscribes channels on it and never owns its lifecycle: unsubscribing closes only channel subscriptions, leaving the socket connected.
|
|
2023
|
+
* @property {string | (() => string | null | undefined)} [websocketUrl] - Shared app-lifetime websocket URL. When set (and no `websocketClient` is given), the framework builds and owns one reconnecting `VelociousWebsocketClient` for all sync traffic, connected on first use.
|
|
2024
|
+
*/
|
|
2025
|
+
/**
|
|
2026
|
+
* Velocious sync configuration.
|
|
2027
|
+
* @typedef {object} VelociousSyncConfiguration
|
|
2028
|
+
* @property {VelociousSyncApiConfiguration} [api] - Auto-mounts the Velocious sync changes/replay endpoints for this resource class.
|
|
2029
|
+
* @property {VelociousSyncClientConfiguration} [client] - Client-side sync configuration consumed by `SyncClient.fromConfiguration(...)`.
|
|
2030
|
+
* @property {import("./sync/device-identity.js").SyncJsonWebKey | null} [deviceCertificateBackendPublicKey] - Public backend key used to verify offline device certificates for sync replay.
|
|
2031
|
+
* @property {number} [changeFeedRetentionSize] - Number of accepted server changes retained before clients must refresh from snapshot.
|
|
2032
|
+
* @property {Array<import("./sync/offline-grant.js").OfflineGrantSigningKey>} offlineGrantSigningKeys - Signing keys used to issue and verify offline grants. Secrets must never be exposed to clients.
|
|
2033
|
+
* @property {number} [offlineGrantTtlMs] - Default offline grant TTL in milliseconds. Defaults to 24 hours.
|
|
2034
|
+
*/
|
|
2035
|
+
/**
|
|
2036
|
+
* Frontend-safe normalized sync metadata.
|
|
2037
|
+
* @typedef {object} NormalizedFrontendModelResourceSyncConfiguration
|
|
2038
|
+
* @property {"optimisticVersion" | "serverWins" | "lastWriterWins" | "fieldThreeWay" | "appendOnly"} conflictStrategy - Normalized replay conflict strategy.
|
|
2039
|
+
* @property {boolean} enabled - Whether the resource is sync-enabled.
|
|
2040
|
+
* @property {string[]} operations - Sorted, duplicate-free sync operation names.
|
|
2041
|
+
* @property {string | null} policyVersion - App-controlled policy version, or null.
|
|
2042
|
+
* @property {string} policyHash - Deterministic sha256 hash of safe policy inputs.
|
|
2043
|
+
* @property {Record<string, FrontendModelSyncJsonValue>} [metadata] - Safe frontend-visible metadata.
|
|
2044
|
+
*/
|
|
2045
|
+
/**
|
|
2046
|
+
* @typedef {Omit<FrontendModelResourceConfiguration, "abilities" | "builtInCollectionCommands" | "builtInMemberCommands" | "collectionCommands" | "commands" | "memberCommands" | "sync"> & {
|
|
2047
|
+
* abilities: FrontendModelResourceAbilitiesConfiguration
|
|
2048
|
+
* builtInCollectionCommands: Record<string, string>
|
|
2049
|
+
* builtInMemberCommands: Record<string, string>
|
|
2050
|
+
* collectionCommands: Record<string, string>
|
|
2051
|
+
* commandMetadata: Record<string, {args: Array<{name: string, type: string}>, returnType: string | null}>
|
|
2052
|
+
* memberCommands: Record<string, string>
|
|
2053
|
+
* sync?: NormalizedFrontendModelResourceSyncConfiguration
|
|
2054
|
+
* }} NormalizedFrontendModelResourceConfiguration
|
|
2055
|
+
*/
|
|
2056
|
+
/**
|
|
2057
|
+
* @typedef {Omit<typeof import("./frontend-model-resource/base-resource.js").default, never> & {new (args: import("./frontend-model-resource/base-resource.js").FrontendModelResourceAbilityArgs | import("./frontend-model-resource/base-resource.js").FrontendModelResourceControllerArgs): import("./frontend-model-resource/base-resource.js").default<typeof import("./database/record/index.js").default>}} FrontendModelResourceClassType
|
|
2058
|
+
*/
|
|
2059
|
+
/**
|
|
2060
|
+
* @typedef {FrontendModelResourceClassType} FrontendModelResourceDefinition
|
|
2061
|
+
*/
|
|
2062
|
+
/**
|
|
2063
|
+
* @typedef {object} FrontendModelResourceAbilitiesConfiguration
|
|
2064
|
+
* @property {string} [index] - Ability action for frontend index.
|
|
2065
|
+
* @property {string} [find] - Ability action for frontend find.
|
|
2066
|
+
* @property {string} [create] - Ability action for frontend create.
|
|
2067
|
+
* @property {string} [update] - Ability action for frontend update.
|
|
2068
|
+
* @property {string} [destroy] - Ability action for frontend destroy.
|
|
2069
|
+
*/
|
|
2070
|
+
/**
|
|
2071
|
+
* @typedef {object} FrontendModelResourceServerConfiguration
|
|
2072
|
+
* @property {(args: {action: "index" | "find" | "create" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url", controller: import("./controller.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, modelClass: typeof import("./database/record/index.js").default}) => (boolean | void | Promise<boolean | void>)} [beforeAction] - Optional callback run before built-in frontend actions.
|
|
2073
|
+
* @property {(args: {action: "index", controller: import("./controller.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, modelClass: typeof import("./database/record/index.js").default}) => Promise<import("./database/record/index.js").default[]>} [records] - Records loader for frontendIndex.
|
|
2074
|
+
* @property {(args: {action: "index" | "find" | "create" | "update", controller: import("./controller.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, modelClass: typeof import("./database/record/index.js").default, model: import("./database/record/index.js").default}) => Record<string, ReturnType<typeof JSON.parse>> | Promise<Record<string, ReturnType<typeof JSON.parse>>>} [serialize] - Record serializer for response payloads.
|
|
2075
|
+
* @property {(args: {action: "find" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url", controller: import("./controller.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, modelClass: typeof import("./database/record/index.js").default, id: string | number}) => Promise<import("./database/record/index.js").default | null>} [find] - Record loader for find/update/destroy/attach/download/url actions.
|
|
2076
|
+
* @property {(args: {action: "create", controller: import("./controller.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, modelClass: typeof import("./database/record/index.js").default, attributes: Record<string, ReturnType<typeof JSON.parse>>}) => Promise<import("./database/record/index.js").default>} [create] - Custom create callback.
|
|
2077
|
+
* @property {(args: {action: "update", controller: import("./controller.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, modelClass: typeof import("./database/record/index.js").default, model: import("./database/record/index.js").default, attributes: Record<string, ReturnType<typeof JSON.parse>>}) => Promise<import("./database/record/index.js").default | void>} [update] - Custom update callback.
|
|
2078
|
+
* @property {(args: {action: "destroy", controller: import("./controller.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, modelClass: typeof import("./database/record/index.js").default, model: import("./database/record/index.js").default}) => Promise<void>} [destroy] - Custom destroy callback.
|
|
2079
|
+
*/
|
|
2080
|
+
/**
|
|
2081
|
+
* @typedef {object} BackendProjectConfiguration
|
|
2082
|
+
* @property {string} path - Path to the backend project. May be an app root or a contributing package root (package entries are appended internally from `packages`).
|
|
2083
|
+
* @property {string} [frontendModelsOutputPath] - Optional output project path where `src/frontend-models` should be generated.
|
|
2084
|
+
* @property {string} [resourcesPath] - Optional override for the resources directory to auto-discover; defaults to `<path>/src/resources`. Set internally for package entries.
|
|
2085
|
+
* @property {Record<string, FrontendModelResourceDefinition>} [frontendModels] - Auto-discovered frontend model definitions keyed by model class name. Set internally by the environment handler — do not set manually.
|
|
2086
|
+
* @property {AbilityResourceClassType[]} [abilityResources] - Auto-discovered ability resource classes (frontend-model and authorization) from this project's resources directory. Set internally by the environment handler — do not set manually.
|
|
2087
|
+
*/
|
|
2088
|
+
/**
|
|
2089
|
+
* A descriptor for an external Velocious package (engine) that contributes models,
|
|
2090
|
+
* resources and migrations. A package usually exports `new VelociousPackage({name, url: import.meta.url})`.
|
|
2091
|
+
* @typedef {object} VelociousPackageDescriptor
|
|
2092
|
+
* @property {string} name - The package name.
|
|
2093
|
+
* @property {string} [url] - The descriptor module's `import.meta.url`; the package root is derived from it when `path` is omitted.
|
|
2094
|
+
* @property {string} [path] - The package root directory (the one containing `src`). Derived from `url` when omitted.
|
|
2095
|
+
* @property {string} [modelsPath] - Override for the package's models directory (default `<path>/src/models`).
|
|
2096
|
+
* @property {string} [resourcesPath] - Override for the package's frontend-model resources directory (default `<path>/src/resources`).
|
|
2097
|
+
* @property {string} [migrationsPath] - Override for the package's migrations directory (default `<path>/src/database/migrations`).
|
|
2098
|
+
*/
|
|
2099
|
+
/**
|
|
2100
|
+
* @typedef {import("./packages/velocious-package.js").default | VelociousPackageDescriptor} VelociousPackageConfiguration
|
|
2101
|
+
*/
|
|
2102
|
+
/**
|
|
2103
|
+
* @typedef {object} RouteResolverHookArgs
|
|
2104
|
+
* @property {import("./configuration.js").default} configuration - Configuration instance.
|
|
2105
|
+
* @property {Record<string, ReturnType<typeof JSON.parse>>} params - Mutable request params object.
|
|
2106
|
+
* @property {string} currentPath - Request path without query.
|
|
2107
|
+
* @property {boolean} [hasMatchingCustomRoute] - True when matching a configured custom route.
|
|
2108
|
+
* @property {import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default} request - Request object.
|
|
2109
|
+
* @property {import("./http-server/client/response.js").default} response - Response object.
|
|
2110
|
+
* @property {import("./routes/resolver.js").default} resolver - Resolver instance.
|
|
2111
|
+
*/
|
|
2112
|
+
/**
|
|
2113
|
+
* @typedef {object} RouteResolverHookResult
|
|
2114
|
+
* @property {string} action - Dasherized action name (for example `frontend-index`).
|
|
2115
|
+
* @property {string} controller - Controller path (for example `accounts`).
|
|
2116
|
+
* @property {typeof import("./controller.js").default} [controllerClass] - Optional controller class override.
|
|
2117
|
+
* @property {string} [controllerPath] - Optional absolute/relative controller file path override.
|
|
2118
|
+
* @property {Record<string, ReturnType<typeof JSON.parse>>} [params] - Extra params to merge for controller/action.
|
|
2119
|
+
* @property {boolean} [skipAbilityResolution] - Whether to run the controller action without resolving request ability.
|
|
2120
|
+
* @property {boolean} [skipControllerConnections] - Whether to run the controller action without the automatic database checkout wrapper.
|
|
2121
|
+
* @property {boolean} [skipTenantResolution] - Whether to run the controller action without resolving request tenant.
|
|
2122
|
+
* @property {string} [viewPath] - Optional view path override used by controller render lookups.
|
|
2123
|
+
*/
|
|
2124
|
+
/**
|
|
2125
|
+
* @typedef {(arg: RouteResolverHookArgs) => RouteResolverHookResult | null | Promise<RouteResolverHookResult | null>} RouteResolverHookType
|
|
2126
|
+
*/
|
|
2127
|
+
/**
|
|
2128
|
+
* @typedef {typeof import("./authorization/base-resource.js").default} AbilityResourceClassType
|
|
2129
|
+
*/
|
|
2130
|
+
/**
|
|
2131
|
+
* @typedef {(args: {configuration: import("./configuration.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, response: import("./http-server/client/response.js").default | undefined}) => import("./authorization/ability.js").default | void | Promise<import("./authorization/ability.js").default | void>} AbilityResolverType
|
|
2132
|
+
*/
|
|
2133
|
+
/**
|
|
2134
|
+
* @typedef {(args: {configuration: import("./configuration.js").default, params: Record<string, ReturnType<typeof JSON.parse>>, request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default | undefined, response: import("./http-server/client/response.js").default | undefined, subscription?: {channel: string, params?: Record<string, ReturnType<typeof JSON.parse>>}}) => ReturnType<typeof JSON.parse> | void | Promise<ReturnType<typeof JSON.parse> | void>} TenantResolverType
|
|
2135
|
+
*/
|
|
2136
|
+
/**
|
|
2137
|
+
* @typedef {(args: {configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ReturnType<typeof JSON.parse>}) => DatabaseConfigurationType | Partial<DatabaseConfigurationType> | void} TenantDatabaseResolverType
|
|
2138
|
+
*/
|
|
2139
|
+
/**
|
|
2140
|
+
* @typedef {object} ApiManifestConfiguration
|
|
2141
|
+
* @property {string} [path] - HTTP path for the built-in API manifest endpoint. Defaults to `/api/manifest`.
|
|
2142
|
+
* @property {string} [token] - Bearer token required in the `Authorization: Bearer <token>` header. When set, requests without a matching token are not routed (404), so the endpoint stays hidden.
|
|
2143
|
+
*/
|
|
2144
|
+
/**
|
|
2145
|
+
* @typedef {object} DebugEndpointConfiguration
|
|
2146
|
+
* @property {string} [path] - HTTP path for the built-in debug endpoint. Defaults to `/velocious/debug`.
|
|
2147
|
+
* @property {string} [token] - Bearer token required in the `Authorization: Bearer <token>` header. When set, requests without a matching token are not routed (404), so the endpoint stays hidden.
|
|
2148
|
+
*/
|
|
2149
|
+
/**
|
|
2150
|
+
* @typedef {object} TenantDatabaseProviderType
|
|
2151
|
+
* @property {(args: {configuration: import("./configuration.js").default, identifier: string}) => Array<ReturnType<typeof JSON.parse>> | Promise<Array<ReturnType<typeof JSON.parse>>>} listTenants - Lists tenants that should be created, checked, or migrated for this database identifier.
|
|
2152
|
+
* @property {(args: {configuration: import("./configuration.js").default, identifier: string}) => Array<ReturnType<typeof JSON.parse>> | Promise<Array<ReturnType<typeof JSON.parse>>>} [listRestrictTenants] - Lists existing tenants that should be checked for dependent restrict destroys. Defaults to listTenants.
|
|
2153
|
+
* @property {(args: {configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ReturnType<typeof JSON.parse>}) => void | Promise<void>} [createDatabase] - Creates the tenant database/schema for one tenant.
|
|
2154
|
+
* @property {(args: {configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ReturnType<typeof JSON.parse>}) => void | Promise<void>} [dropDatabase] - Drops the tenant database/schema for one tenant.
|
|
2155
|
+
* @property {(args: {configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, tenant: ReturnType<typeof JSON.parse>}) => void | Promise<void>} [checkTenant] - Checks one tenant database before generic connection validation.
|
|
2156
|
+
* @property {(args: {configuration: import("./configuration.js").default, databaseConfiguration: DatabaseConfigurationType, identifier: string, migrationsApplied: number, tenant: ReturnType<typeof JSON.parse>}) => void | Promise<void>} [afterMigrateTenant] - Runs app-owned tenant work after generic migrations for one tenant. `migrationsApplied` is how many migrations actually ran (0 when the tenant was already up to date), so the app can skip expensive per-tenant work on no-op deploys.
|
|
2157
|
+
*/
|
|
2158
|
+
/**
|
|
2159
|
+
* @typedef {object} ConfigurationArgsType
|
|
2160
|
+
* @property {boolean} [autoload] - Globally enable auto-batch-preload of relationships on lazy access. Default true.
|
|
2161
|
+
* @property {CorsType} [cors] - CORS configuration for the HTTP server.
|
|
2162
|
+
* @property {string} [cookieSecret] - Secret for encrypting cookies.
|
|
2163
|
+
* @property {AbilityResourceClassType[]} [abilityResources] - Resource classes used to define abilities per model.
|
|
2164
|
+
* @property {AbilityResolverType} [abilityResolver] - Resolver for creating request-scoped ability instances.
|
|
2165
|
+
* @property {AttachmentsConfiguration} [attachments] - Attachment storage configuration.
|
|
2166
|
+
* @property {BackendProjectConfiguration[]} [backendProjects] - Backend project definitions used for frontend model generation.
|
|
2167
|
+
* @property {VelociousPackageConfiguration[]} [packages] - External Velocious packages that contribute models, frontend-model resources and migrations.
|
|
2168
|
+
* @property {{[key: string]: {[key: string]: DatabaseConfigurationType}}} database - Database configurations keyed by environment and identifier.
|
|
2169
|
+
* @property {boolean} [debug] - Enable debug logging.
|
|
2170
|
+
* @property {boolean | DebugEndpointConfiguration} [debugEndpoint] - Enable the built-in debug endpoint. Defaults to false.
|
|
2171
|
+
* @property {boolean | ApiManifestConfiguration} [apiManifest] - Enable the built-in API manifest endpoint. Defaults to false.
|
|
2172
|
+
* @property {string} [directory] - Base directory for the project.
|
|
2173
|
+
* @property {boolean} [enforceTenantDatabaseScopes] - Require tenant-switched model queries to resolve a tenant database identifier. Defaults to true.
|
|
2174
|
+
* @property {string} [environment] - Current environment name.
|
|
2175
|
+
* @property {import("./environment-handlers/base.js").default} environmentHandler - Environment handler instance.
|
|
2176
|
+
* @property {boolean} [exposeInternalErrorsToClients] - Return unexpected internal error details in client API payloads outside production. Defaults to false.
|
|
2177
|
+
* @property {HttpServerConfiguration} [httpServer] - Default HTTP server configuration for applications started from this configuration.
|
|
2178
|
+
* @property {LoggingConfiguration} [logging] - Logging configuration.
|
|
2179
|
+
* @property {BackgroundJobsConfiguration} [backgroundJobs] - Background jobs configuration.
|
|
2180
|
+
* @property {BeaconConfiguration} [beacon] - Beacon broadcast bus configuration.
|
|
2181
|
+
* @property {ScheduledBackgroundJobsConfiguration | ScheduledBackgroundJobsLoaderType} [scheduledBackgroundJobs] - Scheduled background jobs configuration.
|
|
2182
|
+
* @property {MailerBackend} [mailerBackend] - Mail delivery backend.
|
|
2183
|
+
* @property {(args: {configuration: import("./configuration.js").default, type: string}) => void} initializeModels - Hook to register models for a given initialization type.
|
|
2184
|
+
* @property {InitializersType} [initializers] - Initializer loader for environment bootstrapping.
|
|
2185
|
+
* @property {string | (() => string)} locale - Default locale or locale resolver.
|
|
2186
|
+
* @property {string[]} locales - Supported locales.
|
|
2187
|
+
* @property {LocaleFallbacksType} localeFallbacks - Locale fallback map.
|
|
2188
|
+
* @property {StructureSqlConfiguration} [structureSql] - Structure SQL generation configuration.
|
|
2189
|
+
* @property {VelociousSyncConfiguration} [sync] - Local/offline sync framework configuration.
|
|
2190
|
+
* @property {TenantResolverType} [tenantResolver] - Resolver for creating request-scoped tenant context objects.
|
|
2191
|
+
* @property {TenantDatabaseResolverType} [tenantDatabaseResolver] - Resolver for deriving tenant-specific database config overrides.
|
|
2192
|
+
* @property {Record<string, TenantDatabaseProviderType>} [tenantDatabaseProviders] - Tenant database lifecycle providers keyed by database identifier.
|
|
2193
|
+
* @property {string} [testing] - Path to the testing configuration file.
|
|
2194
|
+
* @property {string | (() => string | undefined)} [timeZone] - Default timezone for timezone-less datetime strings.
|
|
2195
|
+
* @property {number | (() => number)} [timezoneOffsetMinutes] - Default timezone offset in minutes.
|
|
2196
|
+
* @property {string | string[]} [trustedProxies] - Trusted reverse proxy address ranges used to resolve request remote addresses from forwarding headers.
|
|
2197
|
+
* @property {number | (() => number)} [requestTimeoutMs] - Timeout in seconds for completing a HTTP request.
|
|
2198
|
+
* @property {RouteResolverHookType[]} [routeResolverHooks] - Hook callbacks that can hijack unresolved routes.
|
|
2199
|
+
* @property {WebsocketChannelResolverType} [websocketChannelResolver] - Resolve a websocket channel class/instance for each connection.
|
|
2200
|
+
* @property {WebsocketMessageHandlerResolverType} [websocketMessageHandlerResolver] - Resolve a raw websocket message handler for each connection.
|
|
2201
|
+
*/
|
|
2202
|
+
export declare const nothing: {};
|
|
2294
2203
|
//# sourceMappingURL=configuration-types.d.ts.map
|