velocious 1.0.428 → 1.0.429
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 +2 -0
- package/build/src/application.d.ts +96 -9
- package/build/src/application.d.ts.map +1 -1
- package/build/src/application.js +127 -28
- package/build/src/authorization/ability.d.ts +72 -31
- package/build/src/authorization/ability.d.ts.map +1 -1
- package/build/src/authorization/ability.js +59 -22
- package/build/src/authorization/base-resource.d.ts +47 -20
- package/build/src/authorization/base-resource.d.ts.map +1 -1
- package/build/src/authorization/base-resource.js +43 -14
- package/build/src/background-jobs/client.d.ts +4 -2
- package/build/src/background-jobs/client.d.ts.map +1 -1
- package/build/src/background-jobs/client.js +4 -2
- package/build/src/background-jobs/cron-expression.d.ts +9 -5
- package/build/src/background-jobs/cron-expression.d.ts.map +1 -1
- package/build/src/background-jobs/cron-expression.js +16 -6
- package/build/src/background-jobs/forked-runner-child.js +12 -5
- package/build/src/background-jobs/job-registry.d.ts +7 -1
- package/build/src/background-jobs/job-registry.d.ts.map +1 -1
- package/build/src/background-jobs/job-registry.js +8 -2
- package/build/src/background-jobs/job-runner.d.ts +1 -0
- package/build/src/background-jobs/job-runner.d.ts.map +1 -1
- package/build/src/background-jobs/job-runner.js +8 -3
- package/build/src/background-jobs/job.d.ts +12 -8
- package/build/src/background-jobs/job.d.ts.map +1 -1
- package/build/src/background-jobs/job.js +12 -6
- package/build/src/background-jobs/json-socket.d.ts +17 -5
- package/build/src/background-jobs/json-socket.d.ts.map +1 -1
- package/build/src/background-jobs/json-socket.js +18 -6
- package/build/src/background-jobs/main.d.ts +118 -32
- package/build/src/background-jobs/main.d.ts.map +1 -1
- package/build/src/background-jobs/main.js +123 -35
- package/build/src/background-jobs/normalize-error.d.ts +2 -1
- package/build/src/background-jobs/normalize-error.d.ts.map +1 -1
- package/build/src/background-jobs/normalize-error.js +5 -3
- package/build/src/background-jobs/scheduler.d.ts +31 -10
- package/build/src/background-jobs/scheduler.d.ts.map +1 -1
- package/build/src/background-jobs/scheduler.js +33 -11
- package/build/src/background-jobs/socket-request.d.ts +2 -0
- package/build/src/background-jobs/socket-request.d.ts.map +1 -1
- package/build/src/background-jobs/socket-request.js +11 -3
- package/build/src/background-jobs/status-reporter.d.ts +5 -2
- package/build/src/background-jobs/status-reporter.d.ts.map +1 -1
- package/build/src/background-jobs/status-reporter.js +6 -3
- package/build/src/background-jobs/store.d.ts +57 -19
- package/build/src/background-jobs/store.d.ts.map +1 -1
- package/build/src/background-jobs/store.js +70 -20
- package/build/src/background-jobs/types.d.ts +7 -7
- package/build/src/background-jobs/types.d.ts.map +1 -1
- package/build/src/background-jobs/types.js +6 -6
- package/build/src/background-jobs/web/authorization.d.ts.map +1 -1
- package/build/src/background-jobs/web/authorization.js +3 -1
- package/build/src/background-jobs/web/controller.d.ts +40 -14
- package/build/src/background-jobs/web/controller.d.ts.map +1 -1
- package/build/src/background-jobs/web/controller.js +46 -15
- package/build/src/background-jobs/web/registry.d.ts +5 -0
- package/build/src/background-jobs/web/registry.d.ts.map +1 -1
- package/build/src/background-jobs/web/registry.js +4 -1
- package/build/src/background-jobs/worker.d.ts +41 -8
- package/build/src/background-jobs/worker.d.ts.map +1 -1
- package/build/src/background-jobs/worker.js +64 -16
- package/build/src/beacon/client.d.ts +39 -12
- package/build/src/beacon/client.d.ts.map +1 -1
- package/build/src/beacon/client.js +45 -15
- package/build/src/beacon/in-process-broker.d.ts +4 -0
- package/build/src/beacon/in-process-broker.d.ts.map +1 -1
- package/build/src/beacon/in-process-broker.js +8 -3
- package/build/src/beacon/in-process-client.d.ts +28 -9
- package/build/src/beacon/in-process-client.d.ts.map +1 -1
- package/build/src/beacon/in-process-client.js +27 -9
- package/build/src/beacon/server.d.ts +13 -2
- package/build/src/beacon/server.d.ts.map +1 -1
- package/build/src/beacon/server.js +21 -5
- package/build/src/beacon/types.d.ts +3 -3
- 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 +18 -4
- package/build/src/cli/base-command.d.ts.map +1 -1
- package/build/src/cli/base-command.js +15 -4
- package/build/src/cli/browser-cli.d.ts +3 -0
- package/build/src/cli/browser-cli.d.ts.map +1 -1
- package/build/src/cli/browser-cli.js +7 -2
- package/build/src/cli/commands/background-jobs-main.d.ts +0 -1
- package/build/src/cli/commands/background-jobs-main.d.ts.map +1 -1
- package/build/src/cli/commands/background-jobs-runner.d.ts +0 -1
- package/build/src/cli/commands/background-jobs-runner.d.ts.map +1 -1
- package/build/src/cli/commands/background-jobs-worker.d.ts +0 -1
- package/build/src/cli/commands/background-jobs-worker.d.ts.map +1 -1
- package/build/src/cli/commands/beacon.d.ts +0 -1
- package/build/src/cli/commands/beacon.d.ts.map +1 -1
- package/build/src/cli/commands/console.d.ts +0 -2
- package/build/src/cli/commands/console.d.ts.map +1 -1
- package/build/src/cli/commands/console.js +5 -2
- package/build/src/cli/commands/db/base-command.d.ts +11 -2
- package/build/src/cli/commands/db/base-command.d.ts.map +1 -1
- package/build/src/cli/commands/db/base-command.js +12 -3
- package/build/src/cli/commands/db/create.d.ts +3 -0
- package/build/src/cli/commands/db/create.d.ts.map +1 -1
- package/build/src/cli/commands/db/create.js +4 -1
- package/build/src/cli/commands/db/drop.d.ts +3 -0
- package/build/src/cli/commands/db/drop.d.ts.map +1 -1
- package/build/src/cli/commands/db/drop.js +4 -1
- package/build/src/cli/commands/db/schema/dump.d.ts +0 -2
- package/build/src/cli/commands/db/schema/dump.d.ts.map +1 -1
- package/build/src/cli/commands/db/schema/dump.js +5 -2
- package/build/src/cli/commands/db/schema/load.d.ts +0 -2
- package/build/src/cli/commands/db/schema/load.d.ts.map +1 -1
- package/build/src/cli/commands/db/schema/load.js +5 -2
- package/build/src/cli/commands/db/seed.d.ts +0 -2
- package/build/src/cli/commands/db/seed.d.ts.map +1 -1
- package/build/src/cli/commands/db/seed.js +5 -2
- package/build/src/cli/commands/db/tenants/check.d.ts +4 -1
- package/build/src/cli/commands/db/tenants/check.d.ts.map +1 -1
- package/build/src/cli/commands/db/tenants/check.js +5 -2
- package/build/src/cli/commands/db/tenants/create.d.ts +4 -1
- package/build/src/cli/commands/db/tenants/create.d.ts.map +1 -1
- package/build/src/cli/commands/db/tenants/create.js +5 -2
- package/build/src/cli/commands/db/tenants/migrate.d.ts +4 -1
- package/build/src/cli/commands/db/tenants/migrate.d.ts.map +1 -1
- package/build/src/cli/commands/db/tenants/migrate.js +5 -2
- package/build/src/cli/commands/destroy/migration.d.ts +0 -1
- package/build/src/cli/commands/destroy/migration.d.ts.map +1 -1
- package/build/src/cli/commands/generate/base-models.d.ts +0 -1
- package/build/src/cli/commands/generate/base-models.d.ts.map +1 -1
- package/build/src/cli/commands/generate/frontend-models.d.ts +0 -2
- package/build/src/cli/commands/generate/frontend-models.d.ts.map +1 -1
- package/build/src/cli/commands/generate/frontend-models.js +5 -2
- package/build/src/cli/commands/generate/migration.d.ts +0 -1
- package/build/src/cli/commands/generate/migration.d.ts.map +1 -1
- package/build/src/cli/commands/generate/model.d.ts +0 -1
- package/build/src/cli/commands/generate/model.d.ts.map +1 -1
- package/build/src/cli/commands/init.d.ts +0 -1
- package/build/src/cli/commands/init.d.ts.map +1 -1
- package/build/src/cli/commands/routes.d.ts +0 -1
- package/build/src/cli/commands/routes.d.ts.map +1 -1
- package/build/src/cli/commands/run-script.d.ts +0 -2
- package/build/src/cli/commands/run-script.d.ts.map +1 -1
- package/build/src/cli/commands/run-script.js +5 -2
- package/build/src/cli/commands/runner.d.ts +0 -2
- package/build/src/cli/commands/runner.d.ts.map +1 -1
- package/build/src/cli/commands/runner.js +5 -2
- package/build/src/cli/commands/server.d.ts +0 -1
- package/build/src/cli/commands/server.d.ts.map +1 -1
- package/build/src/cli/commands/test.d.ts +0 -1
- package/build/src/cli/commands/test.d.ts.map +1 -1
- package/build/src/cli/index.d.ts +18 -5
- package/build/src/cli/index.d.ts.map +1 -1
- package/build/src/cli/index.js +25 -8
- package/build/src/cli/tenant-database-command-helper.d.ts +24 -9
- package/build/src/cli/tenant-database-command-helper.d.ts.map +1 -1
- package/build/src/cli/tenant-database-command-helper.js +30 -11
- package/build/src/cli/use-browser-cli.d.ts +1 -0
- package/build/src/cli/use-browser-cli.d.ts.map +1 -1
- package/build/src/cli/use-browser-cli.js +5 -2
- package/build/src/configuration-resolver.d.ts +1 -0
- package/build/src/configuration-resolver.d.ts.map +1 -1
- package/build/src/configuration-resolver.js +2 -1
- package/build/src/configuration-types.d.ts +44 -44
- package/build/src/configuration-types.d.ts.map +1 -1
- package/build/src/configuration-types.js +27 -27
- package/build/src/configuration.d.ts +350 -114
- package/build/src/configuration.d.ts.map +1 -1
- package/build/src/configuration.js +416 -128
- package/build/src/controller.d.ts +67 -18
- package/build/src/controller.d.ts.map +1 -1
- package/build/src/controller.js +88 -23
- package/build/src/current-configuration.d.ts +2 -0
- package/build/src/current-configuration.d.ts.map +1 -1
- package/build/src/current-configuration.js +6 -2
- package/build/src/current.d.ts +16 -9
- package/build/src/current.d.ts.map +1 -1
- package/build/src/current.js +15 -8
- package/build/src/database/annotations-async-hooks.js +13 -6
- package/build/src/database/annotations.d.ts +7 -1
- package/build/src/database/annotations.d.ts.map +1 -1
- package/build/src/database/annotations.js +12 -5
- package/build/src/database/drivers/base-column.d.ts +21 -3
- package/build/src/database/drivers/base-column.d.ts.map +1 -1
- package/build/src/database/drivers/base-column.js +21 -3
- package/build/src/database/drivers/base-columns-index.d.ts +9 -0
- package/build/src/database/drivers/base-columns-index.d.ts.map +1 -1
- package/build/src/database/drivers/base-columns-index.js +10 -1
- package/build/src/database/drivers/base-foreign-key.d.ts +15 -3
- package/build/src/database/drivers/base-foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/base-foreign-key.js +15 -3
- package/build/src/database/drivers/base-table.d.ts +16 -3
- package/build/src/database/drivers/base-table.d.ts.map +1 -1
- package/build/src/database/drivers/base-table.js +16 -3
- package/build/src/database/drivers/base.d.ts +174 -37
- package/build/src/database/drivers/base.d.ts.map +1 -1
- package/build/src/database/drivers/base.js +156 -40
- package/build/src/database/drivers/mssql/column.d.ts +3 -2
- package/build/src/database/drivers/mssql/column.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/column.js +3 -2
- package/build/src/database/drivers/mssql/index.d.ts +5 -6
- package/build/src/database/drivers/mssql/index.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/index.js +38 -7
- package/build/src/database/drivers/mssql/options.d.ts +1 -0
- package/build/src/database/drivers/mssql/options.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/options.js +8 -2
- package/build/src/database/drivers/mssql/sql/create-database.d.ts +1 -0
- package/build/src/database/drivers/mssql/sql/create-database.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/create-database.js +2 -1
- package/build/src/database/drivers/mssql/sql/drop-database.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/sql/drop-database.js +2 -1
- package/build/src/database/drivers/mssql/structure-sql.d.ts +5 -2
- package/build/src/database/drivers/mssql/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/structure-sql.js +5 -2
- package/build/src/database/drivers/mssql/table.d.ts +1 -0
- package/build/src/database/drivers/mssql/table.d.ts.map +1 -1
- package/build/src/database/drivers/mssql/table.js +9 -4
- package/build/src/database/drivers/mysql/column.d.ts +3 -2
- package/build/src/database/drivers/mysql/column.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/column.js +4 -3
- package/build/src/database/drivers/mysql/index.d.ts +11 -3
- package/build/src/database/drivers/mysql/index.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/index.js +54 -10
- package/build/src/database/drivers/mysql/options.d.ts +1 -0
- package/build/src/database/drivers/mysql/options.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/options.js +4 -2
- package/build/src/database/drivers/mysql/query.d.ts +3 -2
- package/build/src/database/drivers/mysql/query.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/query.js +6 -3
- package/build/src/database/drivers/mysql/sql/create-database.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/sql/create-database.js +3 -1
- package/build/src/database/drivers/mysql/structure-sql.d.ts +7 -2
- package/build/src/database/drivers/mysql/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/structure-sql.js +7 -2
- package/build/src/database/drivers/mysql/table.d.ts +1 -0
- package/build/src/database/drivers/mysql/table.d.ts.map +1 -1
- package/build/src/database/drivers/mysql/table.js +7 -3
- package/build/src/database/drivers/pgsql/column.d.ts +3 -2
- package/build/src/database/drivers/pgsql/column.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/column.js +3 -2
- package/build/src/database/drivers/pgsql/index.d.ts +1 -1
- package/build/src/database/drivers/pgsql/index.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/index.js +36 -11
- package/build/src/database/drivers/pgsql/options.d.ts +2 -0
- package/build/src/database/drivers/pgsql/options.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/options.js +3 -1
- package/build/src/database/drivers/pgsql/structure-sql.d.ts +5 -2
- package/build/src/database/drivers/pgsql/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/structure-sql.js +5 -2
- package/build/src/database/drivers/pgsql/table.d.ts +1 -0
- package/build/src/database/drivers/pgsql/table.d.ts.map +1 -1
- package/build/src/database/drivers/pgsql/table.js +6 -2
- package/build/src/database/drivers/sqlite/base.d.ts +15 -5
- package/build/src/database/drivers/sqlite/base.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/base.js +79 -27
- package/build/src/database/drivers/sqlite/column.d.ts +3 -2
- package/build/src/database/drivers/sqlite/column.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/column.js +3 -2
- package/build/src/database/drivers/sqlite/connection-sql-js.d.ts +4 -2
- package/build/src/database/drivers/sqlite/connection-sql-js.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/connection-sql-js.js +4 -2
- package/build/src/database/drivers/sqlite/foreign-key.d.ts +3 -2
- package/build/src/database/drivers/sqlite/foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/foreign-key.js +3 -2
- package/build/src/database/drivers/sqlite/index.d.ts +18 -5
- package/build/src/database/drivers/sqlite/index.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.js +40 -16
- package/build/src/database/drivers/sqlite/index.native.d.ts +1 -1
- package/build/src/database/drivers/sqlite/index.native.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.native.js +6 -3
- package/build/src/database/drivers/sqlite/index.web.d.ts +16 -4
- package/build/src/database/drivers/sqlite/index.web.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.web.js +17 -7
- package/build/src/database/drivers/sqlite/options.d.ts +2 -0
- package/build/src/database/drivers/sqlite/options.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/options.js +3 -1
- package/build/src/database/drivers/sqlite/query.d.ts +3 -2
- package/build/src/database/drivers/sqlite/query.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/query.js +6 -3
- package/build/src/database/drivers/sqlite/query.native.d.ts +2 -2
- 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 +3 -2
- package/build/src/database/drivers/sqlite/query.web.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/query.web.js +6 -3
- package/build/src/database/drivers/sqlite/sql/alter-table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/sql/alter-table.js +9 -3
- package/build/src/database/drivers/sqlite/structure-sql.d.ts +2 -0
- package/build/src/database/drivers/sqlite/structure-sql.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/structure-sql.js +3 -1
- package/build/src/database/drivers/sqlite/table-rebuilder.d.ts +2 -0
- package/build/src/database/drivers/sqlite/table-rebuilder.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/table-rebuilder.js +3 -1
- package/build/src/database/drivers/sqlite/table.d.ts +2 -0
- package/build/src/database/drivers/sqlite/table.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/table.js +14 -4
- package/build/src/database/drivers/structure-sql/utils.d.ts +2 -0
- package/build/src/database/drivers/structure-sql/utils.d.ts.map +1 -1
- package/build/src/database/drivers/structure-sql/utils.js +3 -1
- package/build/src/database/handler.d.ts +1 -0
- package/build/src/database/handler.d.ts.map +1 -1
- package/build/src/database/handler.js +2 -1
- package/build/src/database/initializer-from-require-context.d.ts +8 -0
- package/build/src/database/initializer-from-require-context.d.ts.map +1 -1
- package/build/src/database/initializer-from-require-context.js +4 -1
- package/build/src/database/migration/index.d.ts +40 -5
- package/build/src/database/migration/index.d.ts.map +1 -1
- package/build/src/database/migration/index.js +34 -6
- package/build/src/database/migrator/files-finder.d.ts +2 -0
- package/build/src/database/migrator/files-finder.d.ts.map +1 -1
- package/build/src/database/migrator/files-finder.js +6 -2
- package/build/src/database/migrator.d.ts +29 -4
- package/build/src/database/migrator.d.ts.map +1 -1
- package/build/src/database/migrator.js +45 -10
- package/build/src/database/pool/async-tracked-multi-connection.d.ts +125 -31
- package/build/src/database/pool/async-tracked-multi-connection.d.ts.map +1 -1
- package/build/src/database/pool/async-tracked-multi-connection.js +189 -52
- package/build/src/database/pool/base-methods-forward.d.ts +1 -0
- package/build/src/database/pool/base-methods-forward.d.ts.map +1 -1
- package/build/src/database/pool/base-methods-forward.js +12 -3
- package/build/src/database/pool/base.d.ts +39 -7
- package/build/src/database/pool/base.d.ts.map +1 -1
- package/build/src/database/pool/base.js +59 -18
- package/build/src/database/pool/single-multi-use.d.ts +1 -0
- package/build/src/database/pool/single-multi-use.d.ts.map +1 -1
- package/build/src/database/pool/single-multi-use.js +16 -4
- package/build/src/database/query/alter-table-base.d.ts +1 -0
- package/build/src/database/query/alter-table-base.d.ts.map +1 -1
- package/build/src/database/query/alter-table-base.js +3 -1
- package/build/src/database/query/base.d.ts +3 -0
- package/build/src/database/query/base.d.ts.map +1 -1
- package/build/src/database/query/base.js +4 -1
- package/build/src/database/query/create-database-base.d.ts +5 -0
- package/build/src/database/query/create-database-base.d.ts.map +1 -1
- package/build/src/database/query/create-database-base.js +4 -1
- package/build/src/database/query/create-index-base.d.ts +5 -0
- package/build/src/database/query/create-index-base.d.ts.map +1 -1
- package/build/src/database/query/create-index-base.js +4 -1
- package/build/src/database/query/create-table-base.d.ts +2 -0
- package/build/src/database/query/create-table-base.d.ts.map +1 -1
- package/build/src/database/query/create-table-base.js +3 -1
- package/build/src/database/query/delete-base.d.ts +3 -2
- package/build/src/database/query/delete-base.d.ts.map +1 -1
- package/build/src/database/query/delete-base.js +3 -2
- package/build/src/database/query/drop-database-base.d.ts +5 -0
- package/build/src/database/query/drop-database-base.d.ts.map +1 -1
- package/build/src/database/query/drop-database-base.js +4 -1
- package/build/src/database/query/drop-table-base.d.ts +1 -0
- package/build/src/database/query/drop-table-base.d.ts.map +1 -1
- package/build/src/database/query/drop-table-base.js +3 -1
- package/build/src/database/query/from-base.d.ts +6 -1
- package/build/src/database/query/from-base.d.ts.map +1 -1
- package/build/src/database/query/from-base.js +7 -2
- package/build/src/database/query/from-plain.d.ts +1 -0
- package/build/src/database/query/from-plain.d.ts.map +1 -1
- package/build/src/database/query/from-plain.js +2 -1
- package/build/src/database/query/from-table.d.ts +1 -0
- package/build/src/database/query/from-table.d.ts.map +1 -1
- package/build/src/database/query/from-table.js +2 -1
- package/build/src/database/query/index.d.ts +72 -12
- package/build/src/database/query/index.d.ts.map +1 -1
- package/build/src/database/query/index.js +79 -19
- package/build/src/database/query/insert-base.d.ts +13 -8
- package/build/src/database/query/insert-base.d.ts.map +1 -1
- package/build/src/database/query/insert-base.js +10 -5
- package/build/src/database/query/join-base.d.ts +4 -0
- package/build/src/database/query/join-base.d.ts.map +1 -1
- package/build/src/database/query/join-base.js +5 -1
- package/build/src/database/query/join-object.d.ts +11 -0
- package/build/src/database/query/join-object.d.ts.map +1 -1
- package/build/src/database/query/join-object.js +15 -4
- package/build/src/database/query/join-plain.d.ts +1 -0
- package/build/src/database/query/join-plain.d.ts.map +1 -1
- package/build/src/database/query/join-plain.js +2 -1
- package/build/src/database/query/join-tracker.d.ts +7 -0
- package/build/src/database/query/join-tracker.d.ts.map +1 -1
- package/build/src/database/query/join-tracker.js +8 -1
- package/build/src/database/query/model-class-query.d.ts +92 -26
- package/build/src/database/query/model-class-query.d.ts.map +1 -1
- package/build/src/database/query/model-class-query.js +230 -76
- package/build/src/database/query/order-base.d.ts +3 -0
- package/build/src/database/query/order-base.d.ts.map +1 -1
- package/build/src/database/query/order-base.js +4 -1
- package/build/src/database/query/order-column.d.ts +9 -1
- package/build/src/database/query/order-column.d.ts.map +1 -1
- package/build/src/database/query/order-column.js +10 -2
- package/build/src/database/query/order-plain.d.ts +1 -0
- package/build/src/database/query/order-plain.d.ts.map +1 -1
- package/build/src/database/query/order-plain.js +2 -1
- package/build/src/database/query/preloader/belongs-to.d.ts +1 -0
- package/build/src/database/query/preloader/belongs-to.d.ts.map +1 -1
- package/build/src/database/query/preloader/belongs-to.js +68 -23
- package/build/src/database/query/preloader/ensure-model-class-initialized.d.ts +1 -0
- 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 +2 -1
- package/build/src/database/query/preloader/has-many.d.ts +5 -3
- package/build/src/database/query/preloader/has-many.d.ts.map +1 -1
- package/build/src/database/query/preloader/has-many.js +66 -24
- package/build/src/database/query/preloader/has-one.d.ts +1 -0
- package/build/src/database/query/preloader/has-one.d.ts.map +1 -1
- package/build/src/database/query/preloader/has-one.js +26 -9
- package/build/src/database/query/preloader/selection.d.ts +7 -1
- package/build/src/database/query/preloader/selection.d.ts.map +1 -1
- package/build/src/database/query/preloader/selection.js +13 -5
- package/build/src/database/query/preloader.d.ts +1 -0
- package/build/src/database/query/preloader.d.ts.map +1 -1
- package/build/src/database/query/preloader.js +28 -9
- package/build/src/database/query/query-data.d.ts +21 -7
- package/build/src/database/query/query-data.d.ts.map +1 -1
- package/build/src/database/query/query-data.js +37 -18
- package/build/src/database/query/select-base.d.ts +3 -0
- package/build/src/database/query/select-base.d.ts.map +1 -1
- package/build/src/database/query/select-base.js +4 -1
- package/build/src/database/query/select-plain.d.ts +1 -0
- package/build/src/database/query/select-plain.d.ts.map +1 -1
- package/build/src/database/query/select-plain.js +2 -1
- package/build/src/database/query/select-table-and-column.d.ts +1 -0
- package/build/src/database/query/select-table-and-column.d.ts.map +1 -1
- package/build/src/database/query/select-table-and-column.js +2 -1
- package/build/src/database/query/update-base.d.ts +9 -6
- package/build/src/database/query/update-base.d.ts.map +1 -1
- package/build/src/database/query/update-base.js +7 -4
- package/build/src/database/query/upsert-base.d.ts +13 -4
- package/build/src/database/query/upsert-base.d.ts.map +1 -1
- package/build/src/database/query/upsert-base.js +12 -3
- package/build/src/database/query/where-base.d.ts +4 -0
- package/build/src/database/query/where-base.d.ts.map +1 -1
- package/build/src/database/query/where-base.js +5 -1
- package/build/src/database/query/where-combinator.d.ts +1 -0
- package/build/src/database/query/where-combinator.d.ts.map +1 -1
- package/build/src/database/query/where-combinator.js +6 -2
- package/build/src/database/query/where-hash.d.ts +6 -0
- package/build/src/database/query/where-hash.d.ts.map +1 -1
- package/build/src/database/query/where-hash.js +5 -1
- package/build/src/database/query/where-model-class-hash.d.ts +30 -16
- package/build/src/database/query/where-model-class-hash.d.ts.map +1 -1
- package/build/src/database/query/where-model-class-hash.js +55 -20
- package/build/src/database/query/where-not.d.ts +1 -0
- package/build/src/database/query/where-not.d.ts.map +1 -1
- package/build/src/database/query/where-not.js +3 -1
- package/build/src/database/query/where-plain.d.ts +1 -0
- package/build/src/database/query/where-plain.d.ts.map +1 -1
- package/build/src/database/query/where-plain.js +2 -1
- package/build/src/database/query/with-count.d.ts +11 -5
- package/build/src/database/query/with-count.d.ts.map +1 -1
- package/build/src/database/query/with-count.js +36 -15
- package/build/src/database/query-parser/base-query-parser.d.ts +1 -0
- package/build/src/database/query-parser/base-query-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/base-query-parser.js +2 -1
- package/build/src/database/query-parser/from-parser.d.ts +5 -1
- package/build/src/database/query-parser/from-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/from-parser.js +6 -2
- package/build/src/database/query-parser/group-parser.d.ts +2 -0
- package/build/src/database/query-parser/group-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/group-parser.js +3 -1
- package/build/src/database/query-parser/joins-parser.d.ts +1 -0
- package/build/src/database/query-parser/joins-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/joins-parser.js +2 -1
- package/build/src/database/query-parser/limit-parser.d.ts +1 -0
- package/build/src/database/query-parser/limit-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/limit-parser.js +2 -1
- package/build/src/database/query-parser/options.d.ts +15 -4
- package/build/src/database/query-parser/options.d.ts.map +1 -1
- package/build/src/database/query-parser/options.js +11 -3
- package/build/src/database/query-parser/order-parser.d.ts +1 -0
- package/build/src/database/query-parser/order-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/order-parser.js +2 -1
- package/build/src/database/query-parser/select-parser.d.ts +1 -0
- package/build/src/database/query-parser/select-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/select-parser.js +2 -1
- package/build/src/database/query-parser/where-parser.d.ts +1 -0
- package/build/src/database/query-parser/where-parser.d.ts.map +1 -1
- package/build/src/database/query-parser/where-parser.js +2 -1
- package/build/src/database/record/acts-as-list.d.ts +0 -1
- package/build/src/database/record/acts-as-list.d.ts.map +1 -1
- package/build/src/database/record/acts-as-list.js +61 -23
- package/build/src/database/record/attachments/download.d.ts +34 -15
- package/build/src/database/record/attachments/download.d.ts.map +1 -1
- package/build/src/database/record/attachments/download.js +34 -22
- package/build/src/database/record/attachments/handle.d.ts +17 -5
- package/build/src/database/record/attachments/handle.d.ts.map +1 -1
- package/build/src/database/record/attachments/handle.js +25 -9
- package/build/src/database/record/attachments/normalize-input.d.ts +6 -1
- package/build/src/database/record/attachments/normalize-input.d.ts.map +1 -1
- package/build/src/database/record/attachments/normalize-input.js +54 -17
- package/build/src/database/record/attachments/storage-drivers/filesystem.d.ts +7 -1
- package/build/src/database/record/attachments/storage-drivers/filesystem.d.ts.map +1 -1
- package/build/src/database/record/attachments/storage-drivers/filesystem.js +10 -2
- package/build/src/database/record/attachments/storage-drivers/native.d.ts +12 -7
- package/build/src/database/record/attachments/storage-drivers/native.d.ts.map +1 -1
- package/build/src/database/record/attachments/storage-drivers/native.js +13 -6
- package/build/src/database/record/attachments/storage-drivers/s3.d.ts +18 -9
- package/build/src/database/record/attachments/storage-drivers/s3.d.ts.map +1 -1
- package/build/src/database/record/attachments/storage-drivers/s3.js +38 -13
- package/build/src/database/record/attachments/store.d.ts +48 -25
- package/build/src/database/record/attachments/store.d.ts.map +1 -1
- package/build/src/database/record/attachments/store.js +63 -25
- package/build/src/database/record/index.d.ts +388 -146
- package/build/src/database/record/index.d.ts.map +1 -1
- package/build/src/database/record/index.js +686 -248
- package/build/src/database/record/instance-relationships/base.d.ts +78 -19
- package/build/src/database/record/instance-relationships/base.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/base.js +98 -26
- package/build/src/database/record/instance-relationships/belongs-to.d.ts +1 -0
- package/build/src/database/record/instance-relationships/belongs-to.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/belongs-to.js +13 -5
- package/build/src/database/record/instance-relationships/has-many.d.ts +27 -7
- package/build/src/database/record/instance-relationships/has-many.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/has-many.js +50 -16
- package/build/src/database/record/instance-relationships/has-one.d.ts +4 -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 +28 -10
- package/build/src/database/record/relationships/base.d.ts +61 -14
- package/build/src/database/record/relationships/base.d.ts.map +1 -1
- package/build/src/database/record/relationships/base.js +60 -15
- package/build/src/database/record/relationships/belongs-to.d.ts.map +1 -1
- package/build/src/database/record/relationships/belongs-to.js +9 -3
- package/build/src/database/record/relationships/has-many.d.ts.map +1 -1
- package/build/src/database/record/relationships/has-many.js +9 -3
- package/build/src/database/record/relationships/has-one.d.ts.map +1 -1
- package/build/src/database/record/relationships/has-one.js +9 -3
- package/build/src/database/record/state-machine.d.ts +9 -1
- package/build/src/database/record/state-machine.d.ts.map +1 -1
- package/build/src/database/record/state-machine.js +35 -14
- package/build/src/database/record/user-module.d.ts +2 -0
- package/build/src/database/record/user-module.d.ts.map +1 -1
- package/build/src/database/record/user-module.js +3 -1
- package/build/src/database/record/validators/base.d.ts +4 -2
- package/build/src/database/record/validators/base.d.ts.map +1 -1
- package/build/src/database/record/validators/base.js +4 -2
- package/build/src/database/record/validators/format.d.ts.map +1 -1
- package/build/src/database/record/validators/format.js +2 -1
- package/build/src/database/record/validators/presence.d.ts.map +1 -1
- package/build/src/database/record/validators/presence.js +5 -2
- package/build/src/database/record/validators/uniqueness.d.ts +0 -2
- package/build/src/database/record/validators/uniqueness.d.ts.map +1 -1
- package/build/src/database/record/validators/uniqueness.js +18 -8
- package/build/src/database/table-data/index.d.ts +40 -4
- package/build/src/database/table-data/index.d.ts.map +1 -1
- package/build/src/database/table-data/index.js +38 -5
- package/build/src/database/table-data/table-column.d.ts +43 -5
- package/build/src/database/table-data/table-column.d.ts.map +1 -1
- package/build/src/database/table-data/table-column.js +37 -4
- package/build/src/database/table-data/table-foreign-key.d.ts +8 -0
- package/build/src/database/table-data/table-foreign-key.d.ts.map +1 -1
- package/build/src/database/table-data/table-foreign-key.js +9 -1
- package/build/src/database/table-data/table-index.d.ts +8 -0
- package/build/src/database/table-data/table-index.d.ts.map +1 -1
- package/build/src/database/table-data/table-index.js +6 -1
- package/build/src/database/table-data/table-reference.d.ts +1 -0
- package/build/src/database/table-data/table-reference.d.ts.map +1 -1
- package/build/src/database/table-data/table-reference.js +2 -1
- package/build/src/database/use-database.d.ts +1 -0
- package/build/src/database/use-database.d.ts.map +1 -1
- package/build/src/database/use-database.js +2 -1
- package/build/src/environment-handlers/base.d.ts +94 -36
- package/build/src/environment-handlers/base.d.ts.map +1 -1
- package/build/src/environment-handlers/base.js +90 -36
- package/build/src/environment-handlers/browser.d.ts +33 -3
- package/build/src/environment-handlers/browser.d.ts.map +1 -1
- package/build/src/environment-handlers/browser.js +36 -9
- package/build/src/environment-handlers/node/cli/commands/cli-command-context.d.ts +5 -0
- package/build/src/environment-handlers/node/cli/commands/cli-command-context.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/cli-command-context.js +6 -2
- package/build/src/environment-handlers/node/cli/commands/console.d.ts +3 -2
- package/build/src/environment-handlers/node/cli/commands/console.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/console.js +23 -9
- package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts +4 -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/dump.js +5 -2
- package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts +6 -2
- 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/schema/load.js +11 -5
- package/build/src/environment-handlers/node/cli/commands/db/seed.d.ts +15 -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 +20 -6
- package/build/src/environment-handlers/node/cli/commands/destroy/migration.d.ts +5 -0
- package/build/src/environment-handlers/node/cli/commands/destroy/migration.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/destroy/migration.js +3 -1
- package/build/src/environment-handlers/node/cli/commands/generate/base-models.d.ts +2 -0
- 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 +6 -4
- package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts +43 -29
- 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/frontend-models.js +99 -40
- package/build/src/environment-handlers/node/cli/commands/generate/migration.d.ts +5 -0
- package/build/src/environment-handlers/node/cli/commands/generate/migration.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/migration.js +3 -1
- package/build/src/environment-handlers/node/cli/commands/generate/model.d.ts +5 -0
- package/build/src/environment-handlers/node/cli/commands/generate/model.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/generate/model.js +3 -1
- package/build/src/environment-handlers/node/cli/commands/init.d.ts +5 -0
- package/build/src/environment-handlers/node/cli/commands/init.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/init.js +3 -1
- package/build/src/environment-handlers/node/cli/commands/routes.d.ts +3 -0
- package/build/src/environment-handlers/node/cli/commands/routes.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/routes.js +4 -1
- package/build/src/environment-handlers/node/cli/commands/run-script.d.ts +15 -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 +20 -6
- package/build/src/environment-handlers/node/cli/commands/runner.d.ts +18 -6
- package/build/src/environment-handlers/node/cli/commands/runner.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/runner.js +20 -6
- package/build/src/environment-handlers/node/cli/commands/server.d.ts +13 -1
- package/build/src/environment-handlers/node/cli/commands/server.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/server.js +23 -6
- package/build/src/environment-handlers/node.d.ts +14 -2
- package/build/src/environment-handlers/node.d.ts.map +1 -1
- package/build/src/environment-handlers/node.js +107 -39
- package/build/src/error-logger.d.ts +4 -3
- package/build/src/error-logger.d.ts.map +1 -1
- package/build/src/error-logger.js +4 -3
- package/build/src/frontend-model-controller.d.ts +239 -90
- package/build/src/frontend-model-controller.d.ts.map +1 -1
- package/build/src/frontend-model-controller.js +577 -787
- package/build/src/frontend-model-resource/base-resource.d.ts +118 -66
- package/build/src/frontend-model-resource/base-resource.d.ts.map +1 -1
- package/build/src/frontend-model-resource/base-resource.js +205 -82
- package/build/src/frontend-models/base.d.ts +319 -163
- package/build/src/frontend-models/base.d.ts.map +1 -1
- package/build/src/frontend-models/base.js +717 -366
- package/build/src/frontend-models/clear-pending-debounced-callback.d.ts +2 -1
- package/build/src/frontend-models/clear-pending-debounced-callback.d.ts.map +1 -1
- package/build/src/frontend-models/clear-pending-debounced-callback.js +6 -3
- package/build/src/frontend-models/event-hook-models.d.ts +5 -0
- package/build/src/frontend-models/event-hook-models.d.ts.map +1 -1
- package/build/src/frontend-models/event-hook-models.js +10 -3
- 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 +11 -3
- package/build/src/frontend-models/outgoing-event-buffer.d.ts.map +1 -1
- package/build/src/frontend-models/outgoing-event-buffer.js +13 -5
- package/build/src/frontend-models/preloader.d.ts +9 -6
- package/build/src/frontend-models/preloader.d.ts.map +1 -1
- package/build/src/frontend-models/preloader.js +21 -9
- package/build/src/frontend-models/query.d.ts +283 -73
- package/build/src/frontend-models/query.d.ts.map +1 -1
- package/build/src/frontend-models/query.js +331 -203
- package/build/src/frontend-models/resource-config-validation.d.ts +2 -0
- package/build/src/frontend-models/resource-config-validation.d.ts.map +1 -1
- package/build/src/frontend-models/resource-config-validation.js +3 -1
- package/build/src/frontend-models/resource-definition.d.ts +12 -5
- package/build/src/frontend-models/resource-definition.d.ts.map +1 -1
- package/build/src/frontend-models/resource-definition.js +39 -13
- package/build/src/frontend-models/transport-serialization.d.ts +14 -11
- package/build/src/frontend-models/transport-serialization.d.ts.map +1 -1
- package/build/src/frontend-models/transport-serialization.js +80 -53
- package/build/src/frontend-models/use-destroyed-event.d.ts +21 -0
- package/build/src/frontend-models/use-destroyed-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-destroyed-event.js +34 -11
- package/build/src/frontend-models/use-model-class-event.d.ts +24 -0
- package/build/src/frontend-models/use-model-class-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-model-class-event.js +39 -12
- package/build/src/frontend-models/use-updated-event.d.ts +21 -0
- package/build/src/frontend-models/use-updated-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-updated-event.js +37 -12
- package/build/src/frontend-models/websocket-channel.d.ts +51 -9
- package/build/src/frontend-models/websocket-channel.d.ts.map +1 -1
- package/build/src/frontend-models/websocket-channel.js +96 -26
- package/build/src/frontend-models/websocket-publishers.d.ts +2 -0
- package/build/src/frontend-models/websocket-publishers.d.ts.map +1 -1
- package/build/src/frontend-models/websocket-publishers.js +33 -11
- package/build/src/http-client/header.d.ts +1 -0
- package/build/src/http-client/header.d.ts.map +1 -1
- package/build/src/http-client/header.js +2 -1
- package/build/src/http-client/index.d.ts +4 -0
- package/build/src/http-client/index.d.ts.map +1 -1
- package/build/src/http-client/index.js +5 -1
- package/build/src/http-client/request.d.ts +5 -0
- package/build/src/http-client/request.d.ts.map +1 -1
- package/build/src/http-client/request.js +6 -1
- package/build/src/http-client/response.d.ts +14 -4
- package/build/src/http-client/response.d.ts.map +1 -1
- package/build/src/http-client/response.js +14 -4
- package/build/src/http-client/websocket-client.d.ts +1 -0
- package/build/src/http-client/websocket-client.d.ts.map +1 -1
- package/build/src/http-client/websocket-client.js +2 -1
- package/build/src/http-server/client/index.d.ts +16 -2
- package/build/src/http-server/client/index.d.ts.map +1 -1
- package/build/src/http-server/client/index.js +44 -13
- package/build/src/http-server/client/params-to-object.d.ts +16 -10
- package/build/src/http-server/client/params-to-object.d.ts.map +1 -1
- package/build/src/http-server/client/params-to-object.js +46 -17
- package/build/src/http-server/client/request-buffer/form-data-part.d.ts +10 -6
- package/build/src/http-server/client/request-buffer/form-data-part.d.ts.map +1 -1
- package/build/src/http-server/client/request-buffer/form-data-part.js +11 -7
- package/build/src/http-server/client/request-buffer/header.d.ts +1 -0
- package/build/src/http-server/client/request-buffer/header.d.ts.map +1 -1
- package/build/src/http-server/client/request-buffer/header.js +2 -1
- package/build/src/http-server/client/request-buffer/index.d.ts +29 -4
- package/build/src/http-server/client/request-buffer/index.d.ts.map +1 -1
- package/build/src/http-server/client/request-buffer/index.js +43 -9
- package/build/src/http-server/client/request-parser.d.ts +52 -13
- package/build/src/http-server/client/request-parser.d.ts.map +1 -1
- package/build/src/http-server/client/request-parser.js +58 -15
- package/build/src/http-server/client/request-runner.d.ts +5 -1
- package/build/src/http-server/client/request-runner.d.ts.map +1 -1
- package/build/src/http-server/client/request-runner.js +32 -8
- package/build/src/http-server/client/request-timing.d.ts +37 -7
- package/build/src/http-server/client/request-timing.d.ts.map +1 -1
- package/build/src/http-server/client/request-timing.js +32 -8
- package/build/src/http-server/client/request.d.ts +15 -5
- package/build/src/http-server/client/request.d.ts.map +1 -1
- package/build/src/http-server/client/request.js +17 -5
- package/build/src/http-server/client/response.d.ts +22 -4
- package/build/src/http-server/client/response.d.ts.map +1 -1
- package/build/src/http-server/client/response.js +29 -7
- package/build/src/http-server/client/uploaded-file/memory-uploaded-file.d.ts +1 -0
- package/build/src/http-server/client/uploaded-file/memory-uploaded-file.d.ts.map +1 -1
- package/build/src/http-server/client/uploaded-file/memory-uploaded-file.js +3 -1
- package/build/src/http-server/client/uploaded-file/temporary-uploaded-file.d.ts +1 -0
- package/build/src/http-server/client/uploaded-file/temporary-uploaded-file.d.ts.map +1 -1
- package/build/src/http-server/client/uploaded-file/temporary-uploaded-file.js +3 -1
- package/build/src/http-server/client/uploaded-file/uploaded-file.d.ts +2 -0
- package/build/src/http-server/client/uploaded-file/uploaded-file.d.ts.map +1 -1
- package/build/src/http-server/client/uploaded-file/uploaded-file.js +3 -1
- package/build/src/http-server/client/websocket-request.d.ts +24 -12
- package/build/src/http-server/client/websocket-request.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-request.js +24 -10
- package/build/src/http-server/client/websocket-session.d.ts +101 -62
- package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-session.js +118 -61
- package/build/src/http-server/cookie.d.ts +36 -8
- package/build/src/http-server/cookie.d.ts.map +1 -1
- package/build/src/http-server/cookie.js +37 -9
- package/build/src/http-server/development-reloader.d.ts +32 -7
- package/build/src/http-server/development-reloader.d.ts.map +1 -1
- package/build/src/http-server/development-reloader.js +39 -10
- package/build/src/http-server/index.d.ts +102 -25
- package/build/src/http-server/index.d.ts.map +1 -1
- package/build/src/http-server/index.js +117 -32
- package/build/src/http-server/remote-address.d.ts +1 -0
- package/build/src/http-server/remote-address.d.ts.map +1 -1
- package/build/src/http-server/remote-address.js +15 -4
- package/build/src/http-server/server-client.d.ts +37 -8
- package/build/src/http-server/server-client.d.ts.map +1 -1
- package/build/src/http-server/server-client.js +48 -12
- package/build/src/http-server/server-lock.d.ts +76 -0
- package/build/src/http-server/server-lock.d.ts.map +1 -0
- package/build/src/http-server/server-lock.js +164 -0
- package/build/src/http-server/websocket-channel-subscribers.d.ts +13 -8
- package/build/src/http-server/websocket-channel-subscribers.d.ts.map +1 -1
- package/build/src/http-server/websocket-channel-subscribers.js +16 -7
- package/build/src/http-server/websocket-channel.d.ts +13 -11
- package/build/src/http-server/websocket-channel.d.ts.map +1 -1
- package/build/src/http-server/websocket-channel.js +8 -12
- package/build/src/http-server/websocket-connection.d.ts +10 -14
- package/build/src/http-server/websocket-connection.d.ts.map +1 -1
- package/build/src/http-server/websocket-connection.js +8 -12
- package/build/src/http-server/websocket-event-log-store.d.ts +48 -10
- package/build/src/http-server/websocket-event-log-store.d.ts.map +1 -1
- package/build/src/http-server/websocket-event-log-store.js +76 -34
- package/build/src/http-server/websocket-events-host.d.ts +21 -15
- package/build/src/http-server/websocket-events-host.d.ts.map +1 -1
- package/build/src/http-server/websocket-events-host.js +20 -11
- package/build/src/http-server/websocket-events.d.ts +8 -7
- package/build/src/http-server/websocket-events.d.ts.map +1 -1
- package/build/src/http-server/websocket-events.js +6 -5
- package/build/src/http-server/worker-handler/channel-subscriber-dispatch.d.ts +3 -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 +3 -2
- package/build/src/http-server/worker-handler/in-process.d.ts +18 -18
- package/build/src/http-server/worker-handler/in-process.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/in-process.js +28 -20
- package/build/src/http-server/worker-handler/index.d.ts +39 -20
- package/build/src/http-server/worker-handler/index.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/index.js +34 -14
- package/build/src/http-server/worker-handler/worker-thread.d.ts +31 -15
- package/build/src/http-server/worker-handler/worker-thread.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/worker-thread.js +31 -12
- package/build/src/initializer.d.ts +4 -0
- package/build/src/initializer.d.ts.map +1 -1
- package/build/src/initializer.js +5 -1
- package/build/src/jobs/mail-delivery.d.ts +1 -0
- package/build/src/jobs/mail-delivery.d.ts.map +1 -1
- package/build/src/jobs/mail-delivery.js +2 -1
- package/build/src/logger/base-logger.js +2 -2
- package/build/src/logger/console-logger.d.ts +2 -0
- package/build/src/logger/console-logger.d.ts.map +1 -1
- package/build/src/logger/console-logger.js +3 -1
- package/build/src/logger/file-logger.d.ts +2 -0
- package/build/src/logger/file-logger.d.ts.map +1 -1
- package/build/src/logger/file-logger.js +3 -1
- package/build/src/logger/outputs/array-output.d.ts +21 -5
- package/build/src/logger/outputs/array-output.d.ts.map +1 -1
- package/build/src/logger/outputs/array-output.js +19 -6
- package/build/src/logger/outputs/console-output.d.ts +10 -2
- package/build/src/logger/outputs/console-output.d.ts.map +1 -1
- package/build/src/logger/outputs/console-output.js +8 -3
- package/build/src/logger/outputs/file-output.d.ts +20 -5
- package/build/src/logger/outputs/file-output.d.ts.map +1 -1
- package/build/src/logger/outputs/file-output.js +18 -6
- package/build/src/logger/outputs/stdout-output.d.ts +7 -1
- package/build/src/logger/outputs/stdout-output.d.ts.map +1 -1
- package/build/src/logger/outputs/stdout-output.js +9 -3
- package/build/src/logger.d.ts +28 -13
- package/build/src/logger.d.ts.map +1 -1
- package/build/src/logger.js +60 -23
- package/build/src/mailer/backends/smtp.d.ts +5 -0
- package/build/src/mailer/backends/smtp.d.ts.map +1 -1
- package/build/src/mailer/backends/smtp.js +17 -4
- package/build/src/mailer/base.d.ts +33 -17
- package/build/src/mailer/base.d.ts.map +1 -1
- package/build/src/mailer/base.js +54 -18
- package/build/src/mailer/delivery.d.ts +16 -5
- package/build/src/mailer/delivery.d.ts.map +1 -1
- package/build/src/mailer/delivery.js +18 -7
- package/build/src/mailer/index.d.ts +5 -5
- package/build/src/mailer/index.d.ts.map +1 -1
- package/build/src/mailer/index.js +2 -2
- package/build/src/mailer.d.ts +5 -5
- package/build/src/mailer.d.ts.map +1 -1
- package/build/src/mailer.js +2 -2
- package/build/src/plugins/sqljs-wasm-route-controller.d.ts +4 -1
- package/build/src/plugins/sqljs-wasm-route-controller.d.ts.map +1 -1
- package/build/src/plugins/sqljs-wasm-route-controller.js +11 -4
- package/build/src/plugins/sqljs-wasm-route.d.ts +6 -0
- package/build/src/plugins/sqljs-wasm-route.d.ts.map +1 -1
- package/build/src/plugins/sqljs-wasm-route.js +4 -1
- package/build/src/record-payload-values.d.ts +54 -0
- package/build/src/record-payload-values.d.ts.map +1 -0
- package/build/src/record-payload-values.js +80 -0
- package/build/src/routes/app-routes.d.ts +1 -0
- package/build/src/routes/app-routes.d.ts.map +1 -1
- package/build/src/routes/app-routes.js +2 -1
- package/build/src/routes/base-route.d.ts +52 -16
- package/build/src/routes/base-route.d.ts.map +1 -1
- package/build/src/routes/base-route.js +50 -14
- package/build/src/routes/basic-route.d.ts +1 -0
- package/build/src/routes/basic-route.d.ts.map +1 -1
- package/build/src/routes/basic-route.js +13 -4
- package/build/src/routes/built-in/debug/controller.d.ts +4 -1
- package/build/src/routes/built-in/debug/controller.d.ts.map +1 -1
- package/build/src/routes/built-in/debug/controller.js +5 -2
- package/build/src/routes/get-route.d.ts +1 -0
- package/build/src/routes/get-route.d.ts.map +1 -1
- package/build/src/routes/get-route.js +7 -4
- package/build/src/routes/hooks/frontend-model-command-route-hook.d.ts +1 -0
- 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 +6 -2
- package/build/src/routes/index.d.ts +3 -2
- package/build/src/routes/index.d.ts.map +1 -1
- package/build/src/routes/index.js +10 -4
- package/build/src/routes/namespace-route.d.ts +1 -0
- package/build/src/routes/namespace-route.d.ts.map +1 -1
- package/build/src/routes/namespace-route.js +5 -3
- package/build/src/routes/plugin-routes.d.ts +10 -1
- package/build/src/routes/plugin-routes.d.ts.map +1 -1
- package/build/src/routes/plugin-routes.js +11 -3
- package/build/src/routes/post-route.d.ts +1 -0
- package/build/src/routes/post-route.d.ts.map +1 -1
- package/build/src/routes/post-route.js +7 -4
- package/build/src/routes/resolver.d.ts +20 -5
- package/build/src/routes/resolver.d.ts.map +1 -1
- package/build/src/routes/resolver.js +47 -14
- package/build/src/routes/resource-route.d.ts +6 -1
- package/build/src/routes/resource-route.d.ts.map +1 -1
- package/build/src/routes/resource-route.js +10 -4
- package/build/src/testing/base-expect.d.ts +2 -0
- package/build/src/testing/base-expect.d.ts.map +1 -1
- package/build/src/testing/base-expect.js +3 -1
- package/build/src/testing/browser-frontend-model-event-hook-scenarios.d.ts +33 -5
- package/build/src/testing/browser-frontend-model-event-hook-scenarios.d.ts.map +1 -1
- package/build/src/testing/browser-frontend-model-event-hook-scenarios.js +95 -23
- package/build/src/testing/expect-to-change.d.ts +3 -0
- package/build/src/testing/expect-to-change.d.ts.map +1 -1
- package/build/src/testing/expect-to-change.js +4 -1
- package/build/src/testing/expect-utils.d.ts +22 -16
- package/build/src/testing/expect-utils.d.ts.map +1 -1
- package/build/src/testing/expect-utils.js +62 -30
- package/build/src/testing/expect.d.ts +50 -21
- package/build/src/testing/expect.d.ts.map +1 -1
- package/build/src/testing/expect.js +58 -17
- package/build/src/testing/request-client.d.ts +16 -3
- package/build/src/testing/request-client.d.ts.map +1 -1
- package/build/src/testing/request-client.js +17 -4
- package/build/src/testing/test-files-finder.d.ts +41 -9
- package/build/src/testing/test-files-finder.d.ts.map +1 -1
- package/build/src/testing/test-files-finder.js +42 -10
- package/build/src/testing/test-filter-parser.d.ts +6 -0
- package/build/src/testing/test-filter-parser.d.ts.map +1 -1
- package/build/src/testing/test-filter-parser.js +12 -3
- package/build/src/testing/test-runner.d.ts +102 -6
- package/build/src/testing/test-runner.d.ts.map +1 -1
- package/build/src/testing/test-runner.js +115 -23
- package/build/src/testing/test-suite-splitter.d.ts +7 -0
- package/build/src/testing/test-suite-splitter.d.ts.map +1 -1
- package/build/src/testing/test-suite-splitter.js +7 -2
- package/build/src/testing/test.d.ts +20 -4
- package/build/src/testing/test.d.ts.map +1 -1
- package/build/src/testing/test.js +67 -20
- package/build/src/utils/backtrace-cleaner-node.d.ts.map +1 -1
- package/build/src/utils/backtrace-cleaner-node.js +6 -1
- package/build/src/utils/backtrace-cleaner.d.ts +16 -1
- package/build/src/utils/backtrace-cleaner.d.ts.map +1 -1
- package/build/src/utils/backtrace-cleaner.js +20 -2
- package/build/src/utils/ensure-error.d.ts +3 -2
- package/build/src/utils/ensure-error.d.ts.map +1 -1
- package/build/src/utils/ensure-error.js +3 -2
- 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 +1 -0
- package/build/src/utils/file-exists.d.ts.map +1 -1
- package/build/src/utils/file-exists.js +2 -1
- package/build/src/utils/format-value.d.ts +5 -4
- package/build/src/utils/format-value.d.ts.map +1 -1
- package/build/src/utils/format-value.js +12 -7
- package/build/src/utils/model-scope.d.ts +18 -12
- package/build/src/utils/model-scope.d.ts.map +1 -1
- package/build/src/utils/model-scope.js +19 -11
- package/build/src/utils/nest-callbacks.d.ts +1 -0
- package/build/src/utils/nest-callbacks.d.ts.map +1 -1
- package/build/src/utils/nest-callbacks.js +2 -1
- package/build/src/utils/plain-object.d.ts +7 -0
- package/build/src/utils/plain-object.d.ts.map +1 -0
- package/build/src/utils/plain-object.js +13 -0
- package/build/src/utils/ransack.d.ts +29 -5
- package/build/src/utils/ransack.d.ts.map +1 -1
- package/build/src/utils/ransack.js +136 -49
- package/build/src/utils/rest-args-error.d.ts +1 -0
- package/build/src/utils/rest-args-error.d.ts.map +1 -1
- package/build/src/utils/rest-args-error.js +2 -1
- package/build/src/utils/singularize-model-name.d.ts +1 -0
- package/build/src/utils/singularize-model-name.d.ts.map +1 -1
- package/build/src/utils/singularize-model-name.js +2 -1
- package/build/src/utils/to-import-specifier.d.ts.map +1 -1
- package/build/src/utils/to-import-specifier.js +3 -1
- package/build/src/utils/with-tracked-stack-async-hooks.d.ts +8 -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 +32 -13
- package/build/src/utils/with-tracked-stack.d.ts +9 -5
- package/build/src/utils/with-tracked-stack.d.ts.map +1 -1
- package/build/src/utils/with-tracked-stack.js +19 -8
- package/build/src/velocious-error.d.ts +4 -2
- package/build/src/velocious-error.d.ts.map +1 -1
- package/build/src/velocious-error.js +5 -3
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/** Error raised when reading an attribute that was not selected in query payloads. */
|
|
2
2
|
export class AttributeNotSelectedError extends Error {
|
|
3
3
|
/**
|
|
4
|
+
* Runs constructor.
|
|
4
5
|
* @param {string} modelName - Model class name.
|
|
5
6
|
* @param {string} attributeName - Attribute that was requested.
|
|
6
7
|
*/
|
|
@@ -13,6 +14,7 @@ export class AttributeNotSelectedError extends Error {
|
|
|
13
14
|
*/
|
|
14
15
|
export class FrontendModelSingularRelationship<S extends typeof FrontendModelBase, T extends typeof FrontendModelBase> {
|
|
15
16
|
/**
|
|
17
|
+
* Runs constructor.
|
|
16
18
|
* @param {InstanceType<S>} model - Parent model.
|
|
17
19
|
* @param {string} relationshipName - Relationship name.
|
|
18
20
|
* @param {T | null} targetModelClass - Target model class.
|
|
@@ -24,23 +26,27 @@ export class FrontendModelSingularRelationship<S extends typeof FrontendModelBas
|
|
|
24
26
|
_preloaded: boolean;
|
|
25
27
|
_loadedValue: any;
|
|
26
28
|
/**
|
|
27
|
-
*
|
|
29
|
+
* Runs set loaded.
|
|
30
|
+
* @param {?} loadedValue - Loaded relationship value.
|
|
28
31
|
* @returns {void}
|
|
29
32
|
*/
|
|
30
|
-
setLoaded(loadedValue:
|
|
33
|
+
setLoaded(loadedValue: unknown): void;
|
|
31
34
|
/**
|
|
35
|
+
* Runs get preloaded.
|
|
32
36
|
* @returns {boolean} - Whether relationship is preloaded.
|
|
33
37
|
*/
|
|
34
38
|
getPreloaded(): boolean;
|
|
35
39
|
/**
|
|
36
|
-
*
|
|
40
|
+
* Runs loaded.
|
|
41
|
+
* @returns {?} - Loaded relationship value.
|
|
37
42
|
*/
|
|
38
|
-
loaded():
|
|
43
|
+
loaded(): unknown;
|
|
39
44
|
/**
|
|
40
|
-
*
|
|
45
|
+
* Runs build.
|
|
46
|
+
* @param {Record<string, ?>} [attributes] - New model attributes.
|
|
41
47
|
* @returns {InstanceType<T>} - Built model.
|
|
42
48
|
*/
|
|
43
|
-
build(attributes?: Record<string,
|
|
49
|
+
build(attributes?: Record<string, unknown>): InstanceType<T>;
|
|
44
50
|
}
|
|
45
51
|
/**
|
|
46
52
|
* Lightweight has-many relationship state holder for frontend model instances.
|
|
@@ -49,40 +55,48 @@ export class FrontendModelSingularRelationship<S extends typeof FrontendModelBas
|
|
|
49
55
|
*/
|
|
50
56
|
export class FrontendModelHasManyRelationship<S extends typeof FrontendModelBase, T extends typeof FrontendModelBase> {
|
|
51
57
|
/**
|
|
58
|
+
* Runs constructor.
|
|
52
59
|
* @param {InstanceType<S>} model - Parent model.
|
|
53
60
|
* @param {string} relationshipName - Relationship name.
|
|
54
61
|
* @param {T | null} targetModelClass - Target model class.
|
|
55
62
|
*/
|
|
56
63
|
constructor(model: InstanceType<S>, relationshipName: string, targetModelClass: T | null);
|
|
57
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Narrows the runtime value to the documented type.
|
|
66
|
+
@type {Array<InstanceType<T>>} */
|
|
58
67
|
_loadedValue: Array<InstanceType<T>>;
|
|
59
68
|
model: InstanceType<S>;
|
|
60
69
|
relationshipName: string;
|
|
61
70
|
targetModelClass: T | null;
|
|
62
71
|
_preloaded: boolean;
|
|
63
72
|
/**
|
|
73
|
+
* Runs set loaded.
|
|
64
74
|
* @param {Array<InstanceType<T>>} loadedValue - Loaded relationship value.
|
|
65
75
|
* @returns {void}
|
|
66
76
|
*/
|
|
67
77
|
setLoaded(loadedValue: Array<InstanceType<T>>): void;
|
|
68
78
|
/**
|
|
79
|
+
* Runs get preloaded.
|
|
69
80
|
* @returns {boolean} - Whether relationship is preloaded.
|
|
70
81
|
*/
|
|
71
82
|
getPreloaded(): boolean;
|
|
72
83
|
/**
|
|
84
|
+
* Runs loaded.
|
|
73
85
|
* @returns {Array<InstanceType<T>>} - Loaded relationship values.
|
|
74
86
|
*/
|
|
75
87
|
loaded(): Array<InstanceType<T>>;
|
|
76
88
|
/**
|
|
89
|
+
* Runs add to loaded.
|
|
77
90
|
* @param {Array<InstanceType<T>>} models - Models to append.
|
|
78
91
|
* @returns {void}
|
|
79
92
|
*/
|
|
80
93
|
addToLoaded(models: Array<InstanceType<T>>): void;
|
|
81
94
|
/**
|
|
82
|
-
*
|
|
95
|
+
* Runs build.
|
|
96
|
+
* @param {Record<string, ?>} [attributes] - New model attributes.
|
|
83
97
|
* @returns {InstanceType<T>} - Built model.
|
|
84
98
|
*/
|
|
85
|
-
build(attributes?: Record<string,
|
|
99
|
+
build(attributes?: Record<string, unknown>): InstanceType<T>;
|
|
86
100
|
/**
|
|
87
101
|
* Force-reload the relationship. When the parent record was loaded as part
|
|
88
102
|
* of a batch, siblings that have not preloaded this relationship get
|
|
@@ -93,6 +107,7 @@ export class FrontendModelHasManyRelationship<S extends typeof FrontendModelBase
|
|
|
93
107
|
*/
|
|
94
108
|
load(): Promise<Array<InstanceType<T>>>;
|
|
95
109
|
/**
|
|
110
|
+
* Runs to array.
|
|
96
111
|
* @returns {Promise<Array<InstanceType<T>>>} - Loaded relationship models.
|
|
97
112
|
*/
|
|
98
113
|
toArray(): Promise<Array<InstanceType<T>>>;
|
|
@@ -102,6 +117,7 @@ export class FrontendModelHasManyRelationship<S extends typeof FrontendModelBase
|
|
|
102
117
|
*/
|
|
103
118
|
export class FrontendModelAttachmentDownload {
|
|
104
119
|
/**
|
|
120
|
+
* Runs constructor.
|
|
105
121
|
* @param {object} args - Options.
|
|
106
122
|
* @param {string} args.id - Attachment id.
|
|
107
123
|
* @param {string} args.filename - Filename.
|
|
@@ -124,17 +140,35 @@ export class FrontendModelAttachmentDownload {
|
|
|
124
140
|
byteSizeValue: number;
|
|
125
141
|
contentValue: Uint8Array<ArrayBufferLike>;
|
|
126
142
|
urlValue: string | null;
|
|
127
|
-
/**
|
|
143
|
+
/**
|
|
144
|
+
* Runs byte size.
|
|
145
|
+
* @returns {number} - File size in bytes.
|
|
146
|
+
*/
|
|
128
147
|
byteSize(): number;
|
|
129
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* Runs content.
|
|
150
|
+
* @returns {Uint8Array} - File content bytes.
|
|
151
|
+
*/
|
|
130
152
|
content(): Uint8Array;
|
|
131
|
-
/**
|
|
153
|
+
/**
|
|
154
|
+
* Runs content type.
|
|
155
|
+
* @returns {string | null} - Content type.
|
|
156
|
+
*/
|
|
132
157
|
contentType(): string | null;
|
|
133
|
-
/**
|
|
158
|
+
/**
|
|
159
|
+
* Runs filename.
|
|
160
|
+
* @returns {string} - Filename.
|
|
161
|
+
*/
|
|
134
162
|
filename(): string;
|
|
135
|
-
/**
|
|
163
|
+
/**
|
|
164
|
+
* Runs id.
|
|
165
|
+
* @returns {string} - Attachment id.
|
|
166
|
+
*/
|
|
136
167
|
id(): string;
|
|
137
|
-
/**
|
|
168
|
+
/**
|
|
169
|
+
* Runs url.
|
|
170
|
+
* @returns {string | null} - Resolvable attachment URL.
|
|
171
|
+
*/
|
|
138
172
|
url(): string | null;
|
|
139
173
|
}
|
|
140
174
|
/**
|
|
@@ -142,6 +176,7 @@ export class FrontendModelAttachmentDownload {
|
|
|
142
176
|
*/
|
|
143
177
|
export class FrontendModelAttachmentHandle {
|
|
144
178
|
/**
|
|
179
|
+
* Runs constructor.
|
|
145
180
|
* @param {object} args - Options.
|
|
146
181
|
* @param {FrontendModelBase} args.model - Model instance.
|
|
147
182
|
* @param {string} args.attachmentName - Attachment name.
|
|
@@ -153,48 +188,64 @@ export class FrontendModelAttachmentHandle {
|
|
|
153
188
|
model: FrontendModelBase;
|
|
154
189
|
attachmentName: string;
|
|
155
190
|
/**
|
|
156
|
-
*
|
|
191
|
+
* Runs attach.
|
|
192
|
+
* @param {?} input - Attachment input.
|
|
157
193
|
* @returns {Promise<void>} - Resolves when attached.
|
|
158
194
|
*/
|
|
159
195
|
attach(input: unknown): Promise<void>;
|
|
160
196
|
/**
|
|
197
|
+
* Runs download.
|
|
161
198
|
* @param {string} [attachmentId] - Optional attachment id for has-many attachments.
|
|
162
199
|
* @returns {Promise<FrontendModelAttachmentDownload | null>} - Downloaded attachment payload.
|
|
163
200
|
*/
|
|
164
201
|
download(attachmentId?: string): Promise<FrontendModelAttachmentDownload | null>;
|
|
165
202
|
/**
|
|
203
|
+
* Runs url.
|
|
166
204
|
* @param {string} [attachmentId] - Optional attachment id for has-many attachments.
|
|
167
205
|
* @returns {Promise<string | null>} - Resolvable attachment URL.
|
|
168
206
|
*/
|
|
169
207
|
url(attachmentId?: string): Promise<string | null>;
|
|
170
208
|
/**
|
|
209
|
+
* Runs download url.
|
|
171
210
|
* @returns {string} - Download URL for this attachment on the configured backend.
|
|
172
211
|
*/
|
|
173
212
|
downloadUrl(): string;
|
|
174
213
|
}
|
|
175
214
|
/** Base class for generated frontend model classes. */
|
|
176
215
|
export default class FrontendModelBase {
|
|
177
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* Narrows the runtime value to the documented type.
|
|
218
|
+
@type {string | undefined} */
|
|
178
219
|
static modelName: string | undefined;
|
|
179
|
-
/**
|
|
220
|
+
/**
|
|
221
|
+
* Autoload.
|
|
222
|
+
* @type {boolean} - Global auto-batch-preload toggle. Apps can opt out via FrontendModelBase.setAutoload(false).
|
|
223
|
+
*/
|
|
180
224
|
static _autoload: boolean;
|
|
181
|
-
/**
|
|
225
|
+
/**
|
|
226
|
+
* Runs get autoload.
|
|
227
|
+
* @returns {boolean} Whether auto-batch-preload of relationships on lazy access is enabled globally.
|
|
228
|
+
*/
|
|
182
229
|
static getAutoload(): boolean;
|
|
183
230
|
/**
|
|
231
|
+
* Runs set autoload.
|
|
184
232
|
* @param {boolean} newValue - Whether auto-batch-preload of relationships is enabled.
|
|
185
233
|
* @returns {void}
|
|
186
234
|
*/
|
|
187
235
|
static setAutoload(newValue: boolean): void;
|
|
188
236
|
/**
|
|
237
|
+
* Runs ensure generated attachment methods.
|
|
189
238
|
* @this {typeof FrontendModelBase}
|
|
190
239
|
* @returns {void} - Ensures attachment helper methods exist on the prototype.
|
|
191
240
|
*/
|
|
192
241
|
static ensureGeneratedAttachmentMethods(this: typeof FrontendModelBase): void;
|
|
193
242
|
/**
|
|
243
|
+
* Runs resource config.
|
|
194
244
|
* @returns {FrontendModelResourceConfig} - Resource configuration.
|
|
195
245
|
*/
|
|
196
246
|
static resourceConfig(): FrontendModelResourceConfig;
|
|
197
247
|
/**
|
|
248
|
+
* Runs relationship model classes.
|
|
198
249
|
* @this {typeof FrontendModelBase}
|
|
199
250
|
* @returns {Record<string, typeof FrontendModelBase | string>} - Relationship model classes (or class name strings) keyed by relationship name.
|
|
200
251
|
*/
|
|
@@ -206,11 +257,12 @@ export default class FrontendModelBase {
|
|
|
206
257
|
*/
|
|
207
258
|
static registerModel(modelClass: typeof FrontendModelBase): void;
|
|
208
259
|
/**
|
|
209
|
-
*
|
|
210
|
-
* @
|
|
260
|
+
* Runs define scope.
|
|
261
|
+
* @param {(...args: Array<?>) => ?} callback - Scope callback.
|
|
262
|
+
* @returns {((...args: Array<?>) => import("./query.js").default<?>) & {scope: (...args: Array<?>) => import("../utils/model-scope.js").ModelScopeDescriptor}} - Scope helper.
|
|
211
263
|
*/
|
|
212
|
-
static defineScope(callback: (...args:
|
|
213
|
-
scope: (...args:
|
|
264
|
+
static defineScope(callback: (...args: Array<unknown>) => unknown): ((...args: Array<unknown>) => import("./query.js").default<unknown>) & {
|
|
265
|
+
scope: (...args: Array<unknown>) => import("../utils/model-scope.js").ModelScopeDescriptor;
|
|
214
266
|
};
|
|
215
267
|
/**
|
|
216
268
|
* Resolve a relationship model class value that may be a class reference or a string name.
|
|
@@ -219,6 +271,7 @@ export default class FrontendModelBase {
|
|
|
219
271
|
*/
|
|
220
272
|
static resolveModelClass(value: typeof FrontendModelBase | string | null | undefined): typeof FrontendModelBase | null;
|
|
221
273
|
/**
|
|
274
|
+
* Runs relationship definitions.
|
|
222
275
|
* @this {typeof FrontendModelBase}
|
|
223
276
|
* @returns {Record<string, {type: "belongsTo" | "hasOne" | "hasMany", autoload?: boolean}>} - Relationship definitions keyed by relationship name.
|
|
224
277
|
*/
|
|
@@ -227,17 +280,20 @@ export default class FrontendModelBase {
|
|
|
227
280
|
autoload?: boolean;
|
|
228
281
|
}>;
|
|
229
282
|
/**
|
|
283
|
+
* Runs attachment definitions.
|
|
230
284
|
* @this {typeof FrontendModelBase}
|
|
231
285
|
* @returns {Record<string, FrontendModelAttachmentDefinition>} - Attachment definitions keyed by attachment name.
|
|
232
286
|
*/
|
|
233
287
|
static attachmentDefinitions(this: typeof FrontendModelBase): Record<string, FrontendModelAttachmentDefinition>;
|
|
234
288
|
/**
|
|
289
|
+
* Runs attachment definition.
|
|
235
290
|
* @this {typeof FrontendModelBase}
|
|
236
291
|
* @param {string} attachmentName - Attachment name.
|
|
237
292
|
* @returns {FrontendModelAttachmentDefinition | null} - Attachment definition.
|
|
238
293
|
*/
|
|
239
294
|
static attachmentDefinition(this: typeof FrontendModelBase, attachmentName: string): FrontendModelAttachmentDefinition | null;
|
|
240
295
|
/**
|
|
296
|
+
* Runs relationship definition.
|
|
241
297
|
* @this {typeof FrontendModelBase}
|
|
242
298
|
* @param {string} relationshipName - Relationship name.
|
|
243
299
|
* @returns {{type: "belongsTo" | "hasOne" | "hasMany", autoload?: boolean} | null} - Relationship definition.
|
|
@@ -247,33 +303,38 @@ export default class FrontendModelBase {
|
|
|
247
303
|
autoload?: boolean;
|
|
248
304
|
} | null;
|
|
249
305
|
/**
|
|
306
|
+
* Runs relationship model class.
|
|
250
307
|
* @this {typeof FrontendModelBase}
|
|
251
308
|
* @param {string} relationshipName - Relationship name.
|
|
252
309
|
* @returns {typeof FrontendModelBase | null} - Target relationship model class.
|
|
253
310
|
*/
|
|
254
311
|
static relationshipModelClass(this: typeof FrontendModelBase, relationshipName: string): typeof FrontendModelBase | null;
|
|
255
312
|
/**
|
|
313
|
+
* Runs primary key.
|
|
256
314
|
* @this {typeof FrontendModelBase}
|
|
257
315
|
* @returns {string} - Primary key name.
|
|
258
316
|
*/
|
|
259
317
|
static primaryKey(this: typeof FrontendModelBase): string;
|
|
260
318
|
/**
|
|
319
|
+
* Runs resource path.
|
|
261
320
|
* @this {typeof FrontendModelBase}
|
|
262
321
|
* @returns {string} - Derived resource path.
|
|
263
322
|
*/
|
|
264
323
|
static resourcePath(this: typeof FrontendModelBase): string;
|
|
265
324
|
/**
|
|
325
|
+
* Runs command name.
|
|
266
326
|
* @this {typeof FrontendModelBase}
|
|
267
327
|
* @param {FrontendModelCommandType} commandType - Command type.
|
|
268
328
|
* @returns {string} - Resolved command name.
|
|
269
329
|
*/
|
|
270
330
|
static commandName(this: typeof FrontendModelBase, commandType: FrontendModelCommandType): string;
|
|
271
331
|
/**
|
|
332
|
+
* Runs normalize custom command payload arguments.
|
|
272
333
|
* @this {typeof FrontendModelBase}
|
|
273
|
-
* @param {
|
|
274
|
-
* @returns {Record<string,
|
|
334
|
+
* @param {Array<?>} args - Command arguments.
|
|
335
|
+
* @returns {Record<string, ?>} - Command payload.
|
|
275
336
|
*/
|
|
276
|
-
static normalizeCustomCommandPayloadArguments(this: typeof FrontendModelBase, args:
|
|
337
|
+
static normalizeCustomCommandPayloadArguments(this: typeof FrontendModelBase, args: Array<unknown>): Record<string, unknown>;
|
|
277
338
|
/**
|
|
278
339
|
* Returns the model name, preferring an explicit `static modelName` declaration
|
|
279
340
|
* over the JavaScript class `.name` property. This allows minified builds to
|
|
@@ -283,6 +344,7 @@ export default class FrontendModelBase {
|
|
|
283
344
|
*/
|
|
284
345
|
static getModelName(this: typeof FrontendModelBase): string;
|
|
285
346
|
/**
|
|
347
|
+
* Runs configure transport.
|
|
286
348
|
* @param {FrontendModelTransportConfig} config - Frontend model transport configuration.
|
|
287
349
|
* @returns {void} - No return value.
|
|
288
350
|
*/
|
|
@@ -323,10 +385,10 @@ export default class FrontendModelBase {
|
|
|
323
385
|
* Sets global metadata on the WebSocket connection. Sent to the server immediately
|
|
324
386
|
* over WebSocket and exposed to WebSocket-borne requests as request metadata.
|
|
325
387
|
* @param {string} key - Metadata key.
|
|
326
|
-
* @param {
|
|
388
|
+
* @param {?} value - Metadata value (null to clear).
|
|
327
389
|
* @returns {void}
|
|
328
390
|
*/
|
|
329
|
-
static setWebsocketMetadata(key: string, value:
|
|
391
|
+
static setWebsocketMetadata(key: string, value: unknown): void;
|
|
330
392
|
/**
|
|
331
393
|
* Opens a managed connection that auto-opens, auto-closes, and
|
|
332
394
|
* auto-reconnects based on `shouldConnect()` and `params()`.
|
|
@@ -334,13 +396,13 @@ export default class FrontendModelBase {
|
|
|
334
396
|
* functions change (e.g. current-user sign-in/out). The handle
|
|
335
397
|
* retries when the WS client isn't ready and reopens on close.
|
|
336
398
|
* @param {string} connectionType - Connection class name registered on the server.
|
|
337
|
-
* @param {{shouldConnect: () => boolean, params: () => Record<string,
|
|
399
|
+
* @param {{shouldConnect: () => boolean, params: () => Record<string, ?>, onMessage?: (body: ?) => void}} options - Connection lifecycle and payload callbacks.
|
|
338
400
|
* @returns {{sync: () => void, close: () => void}} - Handle used to resync or close the managed connection.
|
|
339
401
|
*/
|
|
340
402
|
static openManagedConnection(connectionType: string, options: {
|
|
341
403
|
shouldConnect: () => boolean;
|
|
342
|
-
params: () => Record<string,
|
|
343
|
-
onMessage?: (body:
|
|
404
|
+
params: () => Record<string, unknown>;
|
|
405
|
+
onMessage?: (body: unknown) => void;
|
|
344
406
|
}): {
|
|
345
407
|
sync: () => void;
|
|
346
408
|
close: () => void;
|
|
@@ -351,31 +413,31 @@ export default class FrontendModelBase {
|
|
|
351
413
|
* `openConnection`. Apps use this for per-session state/messaging
|
|
352
414
|
* that doesn't fit the pub/sub Channel model (locale, presence).
|
|
353
415
|
* @param {string} connectionType - Name the server registered the class under.
|
|
354
|
-
* @param {{params?: Record<string,
|
|
355
|
-
* @returns {
|
|
416
|
+
* @param {{params?: Record<string, ?>, onConnect?: () => void, onMessage?: (body: ?) => void, onDisconnect?: () => void, onResume?: () => void, onClose?: (reason: string) => void}} [options] - Connection options and event handlers.
|
|
417
|
+
* @returns {?} - VelociousWebsocketClientConnection handle (typed loosely to avoid a cross-module import cycle).
|
|
356
418
|
*/
|
|
357
419
|
static openWebsocketConnection(connectionType: string, options?: {
|
|
358
|
-
params?: Record<string,
|
|
420
|
+
params?: Record<string, unknown>;
|
|
359
421
|
onConnect?: () => void;
|
|
360
|
-
onMessage?: (body:
|
|
422
|
+
onMessage?: (body: unknown) => void;
|
|
361
423
|
onDisconnect?: () => void;
|
|
362
424
|
onResume?: () => void;
|
|
363
425
|
onClose?: (reason: string) => void;
|
|
364
|
-
}):
|
|
426
|
+
}): unknown;
|
|
365
427
|
/**
|
|
366
428
|
* Subscribes to a pub/sub `WebsocketChannel`. Thin wrapper around
|
|
367
429
|
* the internal client's `subscribeChannel`.
|
|
368
430
|
* @param {string} channelType - Channel class name registered on the server.
|
|
369
|
-
* @param {{params?: Record<string,
|
|
370
|
-
* @returns {
|
|
431
|
+
* @param {{params?: Record<string, ?>, onMessage?: (body: ?) => void, onDisconnect?: () => void, onResume?: () => void, onClose?: (reason: string) => void}} [options] - Channel subscription options and event handlers.
|
|
432
|
+
* @returns {?} - Websocket channel handle from the configured client.
|
|
371
433
|
*/
|
|
372
434
|
static subscribeWebsocketChannel(channelType: string, options?: {
|
|
373
|
-
params?: Record<string,
|
|
374
|
-
onMessage?: (body:
|
|
435
|
+
params?: Record<string, unknown>;
|
|
436
|
+
onMessage?: (body: unknown) => void;
|
|
375
437
|
onDisconnect?: () => void;
|
|
376
438
|
onResume?: () => void;
|
|
377
439
|
onClose?: (reason: string) => void;
|
|
378
|
-
}):
|
|
440
|
+
}): unknown;
|
|
379
441
|
/**
|
|
380
442
|
* Installs WebSocket lifecycle hooks on globalThis for system test access.
|
|
381
443
|
* Tests can call `globalThis.__velocious_websocket_hooks.connect()` etc.
|
|
@@ -383,46 +445,52 @@ export default class FrontendModelBase {
|
|
|
383
445
|
*/
|
|
384
446
|
static installWebsocketTestHooks(): void;
|
|
385
447
|
/**
|
|
448
|
+
* Runs attributes from response.
|
|
386
449
|
* @this {typeof FrontendModelBase}
|
|
387
450
|
* @param {object} response - Response payload.
|
|
388
|
-
* @returns {Record<string,
|
|
451
|
+
* @returns {Record<string, ?>} - Attributes from payload.
|
|
389
452
|
*/
|
|
390
|
-
static attributesFromResponse(this: typeof FrontendModelBase, response: object): Record<string,
|
|
453
|
+
static attributesFromResponse(this: typeof FrontendModelBase, response: object): Record<string, unknown>;
|
|
391
454
|
/**
|
|
455
|
+
* Runs model data from response.
|
|
392
456
|
* @this {typeof FrontendModelBase}
|
|
393
457
|
* @param {object} response - Response payload.
|
|
394
|
-
* @returns {{abilities: Record<string, boolean>, attributes: Record<string,
|
|
458
|
+
* @returns {{abilities: Record<string, boolean>, attributes: Record<string, ?>, associationCounts: Record<string, number>, queryData: Record<string, ?>, preloadedRelationships: Record<string, ?>, selectedAttributes: Set<string>}} - Attributes, preloaded relationships, association counts, queryData, abilities, and the selected-attributes set.
|
|
395
459
|
*/
|
|
396
460
|
static modelDataFromResponse(this: typeof FrontendModelBase, response: object): {
|
|
397
461
|
abilities: Record<string, boolean>;
|
|
398
|
-
attributes: Record<string,
|
|
462
|
+
attributes: Record<string, unknown>;
|
|
399
463
|
associationCounts: Record<string, number>;
|
|
400
464
|
queryData: Record<string, unknown>;
|
|
401
|
-
preloadedRelationships: Record<string,
|
|
465
|
+
preloadedRelationships: Record<string, unknown>;
|
|
402
466
|
selectedAttributes: Set<string>;
|
|
403
467
|
};
|
|
404
468
|
/**
|
|
469
|
+
* Runs apply preloaded relationships.
|
|
405
470
|
* @this {typeof FrontendModelBase}
|
|
406
471
|
* @param {FrontendModelBase} model - Model instance.
|
|
407
|
-
* @param {Record<string,
|
|
472
|
+
* @param {Record<string, ?>} preloadedRelationships - Preloaded relationship payload.
|
|
408
473
|
* @returns {void}
|
|
409
474
|
*/
|
|
410
|
-
static applyPreloadedRelationships(this: typeof FrontendModelBase, model: FrontendModelBase, preloadedRelationships: Record<string,
|
|
475
|
+
static applyPreloadedRelationships(this: typeof FrontendModelBase, model: FrontendModelBase, preloadedRelationships: Record<string, unknown>): void;
|
|
411
476
|
/**
|
|
477
|
+
* Runs instantiate relationship value.
|
|
412
478
|
* @this {typeof FrontendModelBase}
|
|
413
|
-
* @param {
|
|
479
|
+
* @param {?} relationshipPayload - Relationship payload value.
|
|
414
480
|
* @param {typeof FrontendModelBase | null} targetModelClass - Target model class.
|
|
415
|
-
* @returns {
|
|
481
|
+
* @returns {?} - Instantiated relationship value.
|
|
416
482
|
*/
|
|
417
|
-
static instantiateRelationshipValue(this: typeof FrontendModelBase, relationshipPayload:
|
|
483
|
+
static instantiateRelationshipValue(this: typeof FrontendModelBase, relationshipPayload: unknown, targetModelClass: typeof FrontendModelBase | null): unknown;
|
|
418
484
|
/**
|
|
485
|
+
* Runs instantiate from response.
|
|
419
486
|
* @template {typeof FrontendModelBase} T
|
|
420
487
|
* @this {T}
|
|
421
|
-
* @param {Record<string,
|
|
488
|
+
* @param {Record<string, ?> | InstanceType<T>} response - Response payload, or an already-hydrated instance of this class.
|
|
422
489
|
* @returns {InstanceType<T>} - New model instance, or the same instance unchanged if it was already hydrated.
|
|
423
490
|
*/
|
|
424
|
-
static instantiateFromResponse<T extends typeof FrontendModelBase>(this: T, response: Record<string,
|
|
491
|
+
static instantiateFromResponse<T extends typeof FrontendModelBase>(this: T, response: Record<string, unknown> | InstanceType<T>): InstanceType<T>;
|
|
425
492
|
/**
|
|
493
|
+
* Runs find.
|
|
426
494
|
* @template {typeof FrontendModelBase} T
|
|
427
495
|
* @this {T}
|
|
428
496
|
* @param {number | string} id - Record identifier.
|
|
@@ -430,52 +498,60 @@ export default class FrontendModelBase {
|
|
|
430
498
|
*/
|
|
431
499
|
static find<T extends typeof FrontendModelBase>(this: T, id: number | string): Promise<InstanceType<T>>;
|
|
432
500
|
/**
|
|
501
|
+
* Runs find by.
|
|
433
502
|
* @template {typeof FrontendModelBase} T
|
|
434
503
|
* @this {T}
|
|
435
|
-
* @param {Record<string,
|
|
504
|
+
* @param {Record<string, ?>} conditions - Attribute match conditions.
|
|
436
505
|
* @returns {Promise<InstanceType<T> | null>} - Found model or null.
|
|
437
506
|
*/
|
|
438
|
-
static findBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string,
|
|
507
|
+
static findBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): Promise<InstanceType<T> | null>;
|
|
439
508
|
/**
|
|
509
|
+
* Runs find by or fail.
|
|
440
510
|
* @template {typeof FrontendModelBase} T
|
|
441
511
|
* @this {T}
|
|
442
|
-
* @param {Record<string,
|
|
512
|
+
* @param {Record<string, ?>} conditions - Attribute match conditions.
|
|
443
513
|
* @returns {Promise<InstanceType<T>>} - Found model.
|
|
444
514
|
*/
|
|
445
|
-
static findByOrFail<T extends typeof FrontendModelBase>(this: T, conditions: Record<string,
|
|
515
|
+
static findByOrFail<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): Promise<InstanceType<T>>;
|
|
446
516
|
/**
|
|
517
|
+
* Runs to array.
|
|
447
518
|
* @template {typeof FrontendModelBase} T
|
|
448
519
|
* @this {T}
|
|
449
520
|
* @returns {Promise<InstanceType<T>[]>} - Loaded model instances.
|
|
450
521
|
*/
|
|
451
522
|
static toArray<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T>[]>;
|
|
452
523
|
/**
|
|
524
|
+
* Runs load.
|
|
453
525
|
* @template {typeof FrontendModelBase} T
|
|
454
526
|
* @this {T}
|
|
455
527
|
* @returns {Promise<InstanceType<T>[]>} - Loaded model instances.
|
|
456
528
|
*/
|
|
457
529
|
static load<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T>[]>;
|
|
458
530
|
/**
|
|
531
|
+
* Runs all.
|
|
459
532
|
* @template {typeof FrontendModelBase} T
|
|
460
533
|
* @this {T}
|
|
461
534
|
* @returns {FrontendModelQuery<T>} - Query builder.
|
|
462
535
|
*/
|
|
463
536
|
static all<T extends typeof FrontendModelBase>(this: T): FrontendModelQuery<T>;
|
|
464
537
|
/**
|
|
538
|
+
* Runs where.
|
|
465
539
|
* @template {typeof FrontendModelBase} T
|
|
466
540
|
* @this {T}
|
|
467
|
-
* @param {Record<string,
|
|
541
|
+
* @param {Record<string, ?>} conditions - Root-model where conditions.
|
|
468
542
|
* @returns {import("./query.js").default<T>} - Query with where conditions.
|
|
469
543
|
*/
|
|
470
|
-
static where<T extends typeof FrontendModelBase>(this: T, conditions: Record<string,
|
|
544
|
+
static where<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): import("./query.js").default<T>;
|
|
471
545
|
/**
|
|
546
|
+
* Runs joins.
|
|
472
547
|
* @template {typeof FrontendModelBase} T
|
|
473
548
|
* @this {T}
|
|
474
|
-
* @param {Record<string,
|
|
549
|
+
* @param {Record<string, ?> | Array<Record<string, ?>>} joins - Relationship descriptor joins.
|
|
475
550
|
* @returns {import("./query.js").default<T>} - Query with joins.
|
|
476
551
|
*/
|
|
477
|
-
static joins<T extends typeof FrontendModelBase>(this: T, joins: Record<string,
|
|
552
|
+
static joins<T extends typeof FrontendModelBase>(this: T, joins: Record<string, unknown> | Array<Record<string, unknown>>): import("./query.js").default<T>;
|
|
478
553
|
/**
|
|
554
|
+
* Runs limit.
|
|
479
555
|
* @template {typeof FrontendModelBase} T
|
|
480
556
|
* @this {T}
|
|
481
557
|
* @param {number} value - Maximum number of records.
|
|
@@ -483,6 +559,7 @@ export default class FrontendModelBase {
|
|
|
483
559
|
*/
|
|
484
560
|
static limit<T extends typeof FrontendModelBase>(this: T, value: number): import("./query.js").default<T>;
|
|
485
561
|
/**
|
|
562
|
+
* Runs offset.
|
|
486
563
|
* @template {typeof FrontendModelBase} T
|
|
487
564
|
* @this {T}
|
|
488
565
|
* @param {number} value - Number of records to skip.
|
|
@@ -490,6 +567,7 @@ export default class FrontendModelBase {
|
|
|
490
567
|
*/
|
|
491
568
|
static offset<T extends typeof FrontendModelBase>(this: T, value: number): import("./query.js").default<T>;
|
|
492
569
|
/**
|
|
570
|
+
* Runs page.
|
|
493
571
|
* @template {typeof FrontendModelBase} T
|
|
494
572
|
* @this {T}
|
|
495
573
|
* @param {number} pageNumber - 1-based page number.
|
|
@@ -497,6 +575,7 @@ export default class FrontendModelBase {
|
|
|
497
575
|
*/
|
|
498
576
|
static page<T extends typeof FrontendModelBase>(this: T, pageNumber: number): import("./query.js").default<T>;
|
|
499
577
|
/**
|
|
578
|
+
* Runs per page.
|
|
500
579
|
* @template {typeof FrontendModelBase} T
|
|
501
580
|
* @this {T}
|
|
502
581
|
* @param {number} value - Number of records per page.
|
|
@@ -504,6 +583,7 @@ export default class FrontendModelBase {
|
|
|
504
583
|
*/
|
|
505
584
|
static perPage<T extends typeof FrontendModelBase>(this: T, value: number): import("./query.js").default<T>;
|
|
506
585
|
/**
|
|
586
|
+
* Runs count.
|
|
507
587
|
* @template {typeof FrontendModelBase} T
|
|
508
588
|
* @this {T}
|
|
509
589
|
* @returns {Promise<number>} - Number of loaded model instances.
|
|
@@ -546,51 +626,58 @@ export default class FrontendModelBase {
|
|
|
546
626
|
id: string;
|
|
547
627
|
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
548
628
|
/**
|
|
629
|
+
* Runs pluck.
|
|
549
630
|
* @template {typeof FrontendModelBase} T
|
|
550
631
|
* @this {T}
|
|
551
|
-
* @param {...(string | string[] | Record<string,
|
|
552
|
-
* @returns {Promise<
|
|
632
|
+
* @param {...(string | string[] | Record<string, ?> | Array<Record<string, ?>>)} columns - Pluck definition(s).
|
|
633
|
+
* @returns {Promise<Array<?>>} - Plucked values.
|
|
553
634
|
*/
|
|
554
|
-
static pluck<T extends typeof FrontendModelBase>(this: T, ...columns: (string | string[] | Record<string,
|
|
635
|
+
static pluck<T extends typeof FrontendModelBase>(this: T, ...columns: (string | string[] | Record<string, unknown> | Array<Record<string, unknown>>)[]): Promise<Array<unknown>>;
|
|
555
636
|
/**
|
|
637
|
+
* Runs search.
|
|
556
638
|
* @template {typeof FrontendModelBase} T
|
|
557
639
|
* @this {T}
|
|
558
640
|
* @param {string[]} path - Relationship path.
|
|
559
641
|
* @param {string} column - Column or attribute name.
|
|
560
642
|
* @param {"eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<="} operator - Search operator.
|
|
561
|
-
* @param {
|
|
643
|
+
* @param {?} value - Search value.
|
|
562
644
|
* @returns {FrontendModelQuery<T>} - Query builder with search filter.
|
|
563
645
|
*/
|
|
564
|
-
static search<T extends typeof FrontendModelBase>(this: T, path: string[], column: string, operator: "eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<=", value:
|
|
646
|
+
static search<T extends typeof FrontendModelBase>(this: T, path: string[], column: string, operator: "eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | ">" | ">=" | "<" | "<=", value: unknown): FrontendModelQuery<T>;
|
|
565
647
|
/**
|
|
648
|
+
* Runs ransack.
|
|
566
649
|
* @template {typeof FrontendModelBase} T
|
|
567
650
|
* @this {T}
|
|
568
|
-
* @param {Record<string,
|
|
651
|
+
* @param {Record<string, ?>} params - Ransack-style params hash.
|
|
569
652
|
* @returns {FrontendModelQuery<T>} - Query builder with Ransack filters applied.
|
|
570
653
|
*/
|
|
571
|
-
static ransack<T extends typeof FrontendModelBase>(this: T, params: Record<string,
|
|
654
|
+
static ransack<T extends typeof FrontendModelBase>(this: T, params: Record<string, unknown>): FrontendModelQuery<T>;
|
|
572
655
|
/**
|
|
656
|
+
* Runs sort.
|
|
573
657
|
* @template {typeof FrontendModelBase} T
|
|
574
658
|
* @this {T}
|
|
575
|
-
* @param {string | string[] | [string, string] | Array<[string, string]> | Record<string,
|
|
659
|
+
* @param {string | string[] | [string, string] | Array<[string, string]> | Record<string, ?> | Array<Record<string, ?>>} sort - Sort definition(s).
|
|
576
660
|
* @returns {FrontendModelQuery<T>} - Query builder with sort definitions.
|
|
577
661
|
*/
|
|
578
|
-
static sort<T extends typeof FrontendModelBase>(this: T, sort: string | string[] | [string, string] | Array<[string, string]> | Record<string,
|
|
662
|
+
static sort<T extends typeof FrontendModelBase>(this: T, sort: string | string[] | [string, string] | Array<[string, string]> | Record<string, unknown> | Array<Record<string, unknown>>): FrontendModelQuery<T>;
|
|
579
663
|
/**
|
|
664
|
+
* Runs order.
|
|
580
665
|
* @template {typeof FrontendModelBase} T
|
|
581
666
|
* @this {T}
|
|
582
|
-
* @param {string | string[] | [string, string] | Array<[string, string]> | Record<string,
|
|
667
|
+
* @param {string | string[] | [string, string] | Array<[string, string]> | Record<string, ?> | Array<Record<string, ?>>} sort - Sort definition(s).
|
|
583
668
|
* @returns {FrontendModelQuery<T>} - Query builder with sort definitions.
|
|
584
669
|
*/
|
|
585
|
-
static order<T extends typeof FrontendModelBase>(this: T, sort: string | string[] | [string, string] | Array<[string, string]> | Record<string,
|
|
670
|
+
static order<T extends typeof FrontendModelBase>(this: T, sort: string | string[] | [string, string] | Array<[string, string]> | Record<string, unknown> | Array<Record<string, unknown>>): FrontendModelQuery<T>;
|
|
586
671
|
/**
|
|
672
|
+
* Runs group.
|
|
587
673
|
* @template {typeof FrontendModelBase} T
|
|
588
674
|
* @this {T}
|
|
589
|
-
* @param {string | string[] | Record<string,
|
|
675
|
+
* @param {string | string[] | Record<string, ?> | Array<Record<string, ?>>} group - Group definition(s).
|
|
590
676
|
* @returns {FrontendModelQuery<T>} - Query builder with group definitions.
|
|
591
677
|
*/
|
|
592
|
-
static group<T extends typeof FrontendModelBase>(this: T, group: string | string[] | Record<string,
|
|
678
|
+
static group<T extends typeof FrontendModelBase>(this: T, group: string | string[] | Record<string, unknown> | Array<Record<string, unknown>>): FrontendModelQuery<T>;
|
|
593
679
|
/**
|
|
680
|
+
* Runs distinct.
|
|
594
681
|
* @template {typeof FrontendModelBase} T
|
|
595
682
|
* @this {T}
|
|
596
683
|
* @param {boolean} [value] - Whether to request distinct rows.
|
|
@@ -598,12 +685,14 @@ export default class FrontendModelBase {
|
|
|
598
685
|
*/
|
|
599
686
|
static distinct<T extends typeof FrontendModelBase>(this: T, value?: boolean): FrontendModelQuery<T>;
|
|
600
687
|
/**
|
|
688
|
+
* Runs query.
|
|
601
689
|
* @template {typeof FrontendModelBase} T
|
|
602
690
|
* @this {T}
|
|
603
691
|
* @returns {FrontendModelQuery<T>} - Query builder.
|
|
604
692
|
*/
|
|
605
693
|
static query<T extends typeof FrontendModelBase>(this: T): FrontendModelQuery<T>;
|
|
606
694
|
/**
|
|
695
|
+
* Runs preload.
|
|
607
696
|
* @template {typeof FrontendModelBase} T
|
|
608
697
|
* @this {T}
|
|
609
698
|
* @param {import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>} preload - Preload graph.
|
|
@@ -611,6 +700,7 @@ export default class FrontendModelBase {
|
|
|
611
700
|
*/
|
|
612
701
|
static preload<T extends typeof FrontendModelBase>(this: T, preload: import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>): FrontendModelQuery<T>;
|
|
613
702
|
/**
|
|
703
|
+
* Runs select.
|
|
614
704
|
* @template {typeof FrontendModelBase} T
|
|
615
705
|
* @this {T}
|
|
616
706
|
* @param {Record<string, string[] | string> | string | string[]} select - Model-aware attribute select map or root-model shorthand.
|
|
@@ -618,6 +708,7 @@ export default class FrontendModelBase {
|
|
|
618
708
|
*/
|
|
619
709
|
static select<T extends typeof FrontendModelBase>(this: T, select: Record<string, string[] | string> | string | string[]): FrontendModelQuery<T>;
|
|
620
710
|
/**
|
|
711
|
+
* Runs selects extra.
|
|
621
712
|
* @template {typeof FrontendModelBase} T
|
|
622
713
|
* @this {T}
|
|
623
714
|
* @param {Record<string, string[] | string> | string | string[]} select - Extra attributes to load in addition to the defaults, keyed by model name or root-model shorthand.
|
|
@@ -625,67 +716,77 @@ export default class FrontendModelBase {
|
|
|
625
716
|
*/
|
|
626
717
|
static selectsExtra<T extends typeof FrontendModelBase>(this: T, select: Record<string, string[] | string> | string | string[]): FrontendModelQuery<T>;
|
|
627
718
|
/**
|
|
719
|
+
* Runs first.
|
|
628
720
|
* @template {typeof FrontendModelBase} T
|
|
629
721
|
* @this {T}
|
|
630
722
|
* @returns {Promise<InstanceType<T> | null>} - First model or null.
|
|
631
723
|
*/
|
|
632
724
|
static first<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T> | null>;
|
|
633
725
|
/**
|
|
726
|
+
* Runs last.
|
|
634
727
|
* @template {typeof FrontendModelBase} T
|
|
635
728
|
* @this {T}
|
|
636
729
|
* @returns {Promise<InstanceType<T> | null>} - Last model or null.
|
|
637
730
|
*/
|
|
638
731
|
static last<T extends typeof FrontendModelBase>(this: T): Promise<InstanceType<T> | null>;
|
|
639
732
|
/**
|
|
733
|
+
* Runs find or initialize by.
|
|
640
734
|
* @template {typeof FrontendModelBase} T
|
|
641
735
|
* @this {T}
|
|
642
|
-
* @param {Record<string,
|
|
736
|
+
* @param {Record<string, ?>} conditions - Attribute match conditions.
|
|
643
737
|
* @returns {Promise<InstanceType<T>>} - Existing or initialized model.
|
|
644
738
|
*/
|
|
645
|
-
static findOrInitializeBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string,
|
|
739
|
+
static findOrInitializeBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>): Promise<InstanceType<T>>;
|
|
646
740
|
/**
|
|
741
|
+
* Runs find or create by.
|
|
647
742
|
* @template {typeof FrontendModelBase} T
|
|
648
743
|
* @this {T}
|
|
649
|
-
* @param {Record<string,
|
|
744
|
+
* @param {Record<string, ?>} conditions - Attribute match conditions.
|
|
650
745
|
* @param {(model: InstanceType<T>) => Promise<void> | void} [callback] - Optional callback before save when created.
|
|
651
746
|
* @returns {Promise<InstanceType<T>>} - Existing or newly created model.
|
|
652
747
|
*/
|
|
653
|
-
static findOrCreateBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string,
|
|
748
|
+
static findOrCreateBy<T extends typeof FrontendModelBase>(this: T, conditions: Record<string, unknown>, callback?: (model: InstanceType<T>) => Promise<void> | void): Promise<InstanceType<T>>;
|
|
654
749
|
/**
|
|
750
|
+
* Runs create.
|
|
655
751
|
* @template {typeof FrontendModelBase} T
|
|
656
752
|
* @this {T}
|
|
657
|
-
* @param {Record<string,
|
|
753
|
+
* @param {Record<string, ?>} [attributes] - Initial attributes.
|
|
658
754
|
* @returns {Promise<InstanceType<T>>} - Persisted model.
|
|
659
755
|
*/
|
|
660
|
-
static create<T extends typeof FrontendModelBase>(this: T, attributes?: Record<string,
|
|
756
|
+
static create<T extends typeof FrontendModelBase>(this: T, attributes?: Record<string, unknown>): Promise<InstanceType<T>>;
|
|
661
757
|
/**
|
|
758
|
+
* Runs assert find by conditions.
|
|
662
759
|
* @this {typeof FrontendModelBase}
|
|
663
|
-
* @param {Record<string,
|
|
760
|
+
* @param {Record<string, ?>} conditions - findBy conditions.
|
|
664
761
|
* @returns {void}
|
|
665
762
|
*/
|
|
666
|
-
static assertFindByConditions(this: typeof FrontendModelBase, conditions: Record<string,
|
|
763
|
+
static assertFindByConditions(this: typeof FrontendModelBase, conditions: Record<string, unknown>): void;
|
|
667
764
|
/**
|
|
765
|
+
* Runs matches find by conditions.
|
|
668
766
|
* @this {typeof FrontendModelBase}
|
|
669
767
|
* @param {FrontendModelBase} model - Candidate model.
|
|
670
|
-
* @param {Record<string,
|
|
768
|
+
* @param {Record<string, ?>} conditions - Match conditions.
|
|
671
769
|
* @returns {boolean} - Whether the model matches all conditions.
|
|
672
770
|
*/
|
|
673
|
-
static matchesFindByConditions(this: typeof FrontendModelBase, model: FrontendModelBase, conditions: Record<string,
|
|
771
|
+
static matchesFindByConditions(this: typeof FrontendModelBase, model: FrontendModelBase, conditions: Record<string, unknown>): boolean;
|
|
674
772
|
/**
|
|
773
|
+
* Runs find by condition value matches.
|
|
675
774
|
* @this {typeof FrontendModelBase}
|
|
676
|
-
* @param {
|
|
677
|
-
* @param {
|
|
775
|
+
* @param {?} actualValue - Actual model value.
|
|
776
|
+
* @param {?} expectedValue - Expected find condition value.
|
|
678
777
|
* @returns {boolean} - Whether values match.
|
|
679
778
|
*/
|
|
680
779
|
static findByConditionValueMatches(this: typeof FrontendModelBase, actualValue: unknown, expectedValue: unknown): boolean;
|
|
681
780
|
/**
|
|
781
|
+
* Runs find by primitive values match.
|
|
682
782
|
* @this {typeof FrontendModelBase}
|
|
683
|
-
* @param {
|
|
684
|
-
* @param {
|
|
783
|
+
* @param {?} actualValue - Actual model value.
|
|
784
|
+
* @param {?} expectedValue - Expected find condition value.
|
|
685
785
|
* @returns {boolean} - Whether primitive values match after safe coercion.
|
|
686
786
|
*/
|
|
687
787
|
static findByPrimitiveValuesMatch(this: typeof FrontendModelBase, actualValue: unknown, expectedValue: unknown): boolean;
|
|
688
788
|
/**
|
|
789
|
+
* Runs find by numeric string matches number.
|
|
689
790
|
* @this {typeof FrontendModelBase}
|
|
690
791
|
* @param {string} numericString - Numeric string value.
|
|
691
792
|
* @param {number} expectedNumber - Number value.
|
|
@@ -693,78 +794,104 @@ export default class FrontendModelBase {
|
|
|
693
794
|
*/
|
|
694
795
|
static findByNumericStringMatchesNumber(this: typeof FrontendModelBase, numericString: string, expectedNumber: number): boolean;
|
|
695
796
|
/**
|
|
797
|
+
* Runs execute command.
|
|
696
798
|
* @this {typeof FrontendModelBase}
|
|
697
799
|
* @param {FrontendModelCommandType} commandType - Command type.
|
|
698
|
-
* @param {Record<string,
|
|
699
|
-
* @returns {Promise<Record<string,
|
|
800
|
+
* @param {Record<string, ?>} payload - Command payload.
|
|
801
|
+
* @returns {Promise<Record<string, ?>>} - Parsed JSON response.
|
|
700
802
|
*/
|
|
701
|
-
static executeCommand(this: typeof FrontendModelBase, commandType: FrontendModelCommandType, payload: Record<string,
|
|
803
|
+
static executeCommand(this: typeof FrontendModelBase, commandType: FrontendModelCommandType, payload: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
702
804
|
/**
|
|
805
|
+
* Runs execute custom command.
|
|
703
806
|
* @this {typeof FrontendModelBase}
|
|
704
807
|
* @param {object} args - Command arguments.
|
|
705
808
|
* @param {string} args.commandName - Raw command path segment.
|
|
706
809
|
* @param {FrontendModelRequestCommandType} args.commandType - Logical command type for error handling.
|
|
707
810
|
* @param {string | number | null} [args.memberId] - Optional member id for member-scoped commands.
|
|
708
|
-
* @param {Record<string,
|
|
811
|
+
* @param {Record<string, ?>} args.payload - Request payload.
|
|
709
812
|
* @param {string} args.resourcePath - Direct resource path.
|
|
710
|
-
* @returns {Promise<Record<string,
|
|
813
|
+
* @returns {Promise<Record<string, ?>>} - Decoded response payload.
|
|
711
814
|
*/
|
|
712
815
|
static executeCustomCommand(this: typeof FrontendModelBase, { commandName, commandType, memberId, payload, resourcePath }: {
|
|
713
816
|
commandName: string;
|
|
714
817
|
commandType: FrontendModelRequestCommandType;
|
|
715
818
|
memberId?: string | number | null | undefined;
|
|
716
|
-
payload: Record<string,
|
|
819
|
+
payload: Record<string, unknown>;
|
|
717
820
|
resourcePath: string;
|
|
718
|
-
}): Promise<Record<string,
|
|
821
|
+
}): Promise<Record<string, unknown>>;
|
|
719
822
|
/**
|
|
823
|
+
* Runs throw on error frontend model response.
|
|
720
824
|
* @this {typeof FrontendModelBase}
|
|
721
825
|
* @param {object} args - Arguments.
|
|
722
826
|
* @param {FrontendModelRequestCommandType} args.commandType - Command type.
|
|
723
|
-
* @param {Record<string,
|
|
827
|
+
* @param {Record<string, ?>} args.response - Decoded response.
|
|
724
828
|
* @returns {void}
|
|
725
829
|
*/
|
|
726
830
|
static throwOnErrorFrontendModelResponse(this: typeof FrontendModelBase, { commandType, response }: {
|
|
727
831
|
commandType: FrontendModelRequestCommandType;
|
|
728
|
-
response: Record<string,
|
|
832
|
+
response: Record<string, unknown>;
|
|
729
833
|
}): void;
|
|
730
834
|
/**
|
|
835
|
+
* Runs configured frontend model attribute names.
|
|
731
836
|
* @this {typeof FrontendModelBase}
|
|
732
837
|
* @returns {Set<string>} - Configured frontend model attribute names.
|
|
733
838
|
*/
|
|
734
839
|
static configuredFrontendModelAttributeNames(this: typeof FrontendModelBase): Set<string>;
|
|
735
840
|
/**
|
|
736
|
-
*
|
|
841
|
+
* Runs constructor.
|
|
842
|
+
* @param {Record<string, ?>} [attributes] - Initial attributes.
|
|
737
843
|
*/
|
|
738
|
-
constructor(attributes?: Record<string,
|
|
739
|
-
/**
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
/**
|
|
844
|
+
constructor(attributes?: Record<string, unknown>);
|
|
845
|
+
/**
|
|
846
|
+
* Narrows the runtime value to the documented type.
|
|
847
|
+
@type {Record<string, ?>} */
|
|
848
|
+
_attributes: Record<string, unknown>;
|
|
849
|
+
/**
|
|
850
|
+
* Narrows the runtime value to the documented type.
|
|
851
|
+
@type {Record<string, FrontendModelHasManyRelationship<?, ?> | FrontendModelSingularRelationship<?, ?>>} */
|
|
852
|
+
_relationships: Record<string, FrontendModelHasManyRelationship<unknown, unknown> | FrontendModelSingularRelationship<unknown, unknown>>;
|
|
853
|
+
/**
|
|
854
|
+
* Narrows the runtime value to the documented type.
|
|
855
|
+
@type {Record<string, FrontendModelAttachmentHandle>} */
|
|
744
856
|
_attachments: Record<string, FrontendModelAttachmentHandle>;
|
|
745
|
-
/**
|
|
857
|
+
/**
|
|
858
|
+
* Narrows the runtime value to the documented type.
|
|
859
|
+
@type {Set<string> | null} */
|
|
746
860
|
_selectedAttributes: Set<string> | null;
|
|
747
|
-
/**
|
|
861
|
+
/**
|
|
862
|
+
* Narrows the runtime value to the documented type.
|
|
863
|
+
@type {boolean} */
|
|
748
864
|
_isNewRecord: boolean;
|
|
749
|
-
/**
|
|
865
|
+
/**
|
|
866
|
+
* Narrows the runtime value to the documented type.
|
|
867
|
+
@type {boolean} */
|
|
750
868
|
_markedForDestruction: boolean;
|
|
751
|
-
/**
|
|
752
|
-
|
|
753
|
-
|
|
869
|
+
/**
|
|
870
|
+
* Narrows the runtime value to the documented type.
|
|
871
|
+
@type {Record<string, ?>} */
|
|
872
|
+
_persistedAttributes: Record<string, unknown>;
|
|
873
|
+
/**
|
|
874
|
+
* Narrows the runtime value to the documented type.
|
|
875
|
+
* @type {Array<FrontendModelBase> | undefined} - Shared reference to sibling records loaded in the same batch. Used by auto-batch-preload.
|
|
876
|
+
*/
|
|
754
877
|
_loadCohort: Array<FrontendModelBase> | undefined;
|
|
755
878
|
/**
|
|
756
|
-
*
|
|
879
|
+
* Runs attributes.
|
|
880
|
+
* @returns {Record<string, ?>} - Attributes hash.
|
|
757
881
|
*/
|
|
758
|
-
attributes(): Record<string,
|
|
882
|
+
attributes(): Record<string, unknown>;
|
|
759
883
|
/**
|
|
884
|
+
* Runs is new record.
|
|
760
885
|
* @returns {boolean} - Whether this model has not yet been persisted.
|
|
761
886
|
*/
|
|
762
887
|
isNewRecord(): boolean;
|
|
763
888
|
/**
|
|
889
|
+
* Runs is persisted.
|
|
764
890
|
* @returns {boolean} - Whether this model has been persisted.
|
|
765
891
|
*/
|
|
766
892
|
isPersisted(): boolean;
|
|
767
893
|
/**
|
|
894
|
+
* Runs set is new record.
|
|
768
895
|
* @param {boolean} newIsNewRecord - New persisted-state flag.
|
|
769
896
|
* @returns {void}
|
|
770
897
|
*/
|
|
@@ -777,32 +904,38 @@ export default class FrontendModelBase {
|
|
|
777
904
|
*/
|
|
778
905
|
markForDestruction(): void;
|
|
779
906
|
/**
|
|
907
|
+
* Runs marked for destruction.
|
|
780
908
|
* @returns {boolean} - Whether this record is queued for nested destruction on next parent save.
|
|
781
909
|
*/
|
|
782
910
|
markedForDestruction(): boolean;
|
|
783
911
|
/**
|
|
784
|
-
*
|
|
912
|
+
* Runs changes.
|
|
913
|
+
* @returns {Record<string, Array<?>>} - Changed attributes as `[oldValue, newValue]`.
|
|
785
914
|
*/
|
|
786
|
-
changes(): Record<string,
|
|
915
|
+
changes(): Record<string, Array<unknown>>;
|
|
787
916
|
/**
|
|
917
|
+
* Runs is changed.
|
|
788
918
|
* @returns {boolean} - Whether any tracked attribute has changed.
|
|
789
919
|
*/
|
|
790
920
|
isChanged(): boolean;
|
|
791
921
|
/**
|
|
922
|
+
* Runs get relationship by name.
|
|
792
923
|
* @param {string} relationshipName - Relationship name.
|
|
793
|
-
* @returns {FrontendModelHasManyRelationship
|
|
924
|
+
* @returns {FrontendModelHasManyRelationship<?, ?> | FrontendModelSingularRelationship<?, ?>} - Relationship state object.
|
|
794
925
|
*/
|
|
795
|
-
getRelationshipByName(relationshipName: string): FrontendModelHasManyRelationship<
|
|
926
|
+
getRelationshipByName(relationshipName: string): FrontendModelHasManyRelationship<unknown, unknown> | FrontendModelSingularRelationship<unknown, unknown>;
|
|
796
927
|
/**
|
|
928
|
+
* Runs get attachment by name.
|
|
797
929
|
* @param {string} attachmentName - Attachment name.
|
|
798
930
|
* @returns {FrontendModelAttachmentHandle} - Attachment helper.
|
|
799
931
|
*/
|
|
800
932
|
getAttachmentByName(attachmentName: string): FrontendModelAttachmentHandle;
|
|
801
933
|
/**
|
|
934
|
+
* Runs load relationship.
|
|
802
935
|
* @param {string} relationshipName - Relationship name.
|
|
803
|
-
* @returns {Promise
|
|
936
|
+
* @returns {Promise<?>} - Loaded relationship value.
|
|
804
937
|
*/
|
|
805
|
-
loadRelationship(relationshipName: string): Promise<
|
|
938
|
+
loadRelationship(relationshipName: string): Promise<unknown>;
|
|
806
939
|
/**
|
|
807
940
|
* Preloads relationship(s) onto this already-loaded record. Accepts either a
|
|
808
941
|
* query built via `Model.preload(...).select(...)` or a raw preload spec
|
|
@@ -810,18 +943,19 @@ export default class FrontendModelBase {
|
|
|
810
943
|
* required columns present are left untouched unless `force` is set. Carries
|
|
811
944
|
* the query's preload graph, select, selectsExtra, withCount, abilities, and
|
|
812
945
|
* queryData when re-fetching.
|
|
813
|
-
* @param {import("./query.js").default
|
|
946
|
+
* @param {import("./query.js").default<?> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>} queryOrSpec - Preload source.
|
|
814
947
|
* @param {{force?: boolean}} [options] - Options.
|
|
815
948
|
* @returns {Promise<void>} - Resolves when preloading completes.
|
|
816
949
|
*/
|
|
817
|
-
preload(queryOrSpec: import("./query.js").default<
|
|
950
|
+
preload(queryOrSpec: import("./query.js").default<unknown> | import("../database/query/index.js").NestedPreloadRecord | string | Array<string | import("../database/query/index.js").NestedPreloadRecord>, options?: {
|
|
818
951
|
force?: boolean;
|
|
819
952
|
}): Promise<void>;
|
|
820
953
|
/**
|
|
954
|
+
* Runs relationship or load.
|
|
821
955
|
* @param {string} relationshipName - Relationship name.
|
|
822
|
-
* @returns {Promise
|
|
956
|
+
* @returns {Promise<?>} - Loaded relationship value.
|
|
823
957
|
*/
|
|
824
|
-
relationshipOrLoad(relationshipName: string): Promise<
|
|
958
|
+
relationshipOrLoad(relationshipName: string): Promise<unknown>;
|
|
825
959
|
/**
|
|
826
960
|
* Attempts to batch-load `relationshipName` across cohort siblings via a
|
|
827
961
|
* single `preload([name]).where({pk: [ids]}).toArray()` request, then copies
|
|
@@ -835,29 +969,34 @@ export default class FrontendModelBase {
|
|
|
835
969
|
*/
|
|
836
970
|
_tryCohortPreload(relationshipName: string): Promise<boolean>;
|
|
837
971
|
/**
|
|
972
|
+
* Runs set relationship.
|
|
838
973
|
* @param {string} relationshipName - Relationship name.
|
|
839
|
-
* @param {
|
|
840
|
-
* @returns {
|
|
974
|
+
* @param {?} relationshipValue - Relationship value.
|
|
975
|
+
* @returns {?} - Assigned relationship value.
|
|
841
976
|
*/
|
|
842
|
-
setRelationship(relationshipName: string, relationshipValue:
|
|
977
|
+
setRelationship(relationshipName: string, relationshipValue: unknown): unknown;
|
|
843
978
|
/**
|
|
844
|
-
*
|
|
979
|
+
* Runs assign attributes.
|
|
980
|
+
* @param {Record<string, ?>} attributes - Attributes to assign.
|
|
845
981
|
* @returns {void} - No return value.
|
|
846
982
|
*/
|
|
847
|
-
assignAttributes(attributes: Record<string,
|
|
983
|
+
assignAttributes(attributes: Record<string, unknown>): void;
|
|
848
984
|
/**
|
|
985
|
+
* Runs clear relationship cache.
|
|
849
986
|
* @returns {void} - Clears cached relationship state.
|
|
850
987
|
*/
|
|
851
988
|
clearRelationshipCache(): void;
|
|
852
989
|
/**
|
|
990
|
+
* Runs primary key value.
|
|
853
991
|
* @returns {number | string} - Primary key value.
|
|
854
992
|
*/
|
|
855
993
|
primaryKeyValue(): number | string;
|
|
856
994
|
/**
|
|
995
|
+
* Runs read attribute.
|
|
857
996
|
* @param {string} attributeName - Attribute name.
|
|
858
|
-
* @returns {
|
|
997
|
+
* @returns {?} - Attribute value.
|
|
859
998
|
*/
|
|
860
|
-
readAttribute(attributeName: string):
|
|
999
|
+
readAttribute(attributeName: string): unknown;
|
|
861
1000
|
/**
|
|
862
1001
|
* Whether an attribute value is currently loaded on this record. Used by the
|
|
863
1002
|
* preloader to decide whether a relationship can be skipped because the
|
|
@@ -872,7 +1011,6 @@ export default class FrontendModelBase {
|
|
|
872
1011
|
* a virtual count like `tasksCount` can't silently shadow a real
|
|
873
1012
|
* column of the same name. Returns the attached value, or 0 when
|
|
874
1013
|
* `.withCount(...)` wasn't requested for this attribute.
|
|
875
|
-
*
|
|
876
1014
|
* @param {string} attributeName - Attribute name, e.g. `"tasksCount"` or a custom name from `.withCount({customName: {...}})`.
|
|
877
1015
|
* @returns {number}
|
|
878
1016
|
*/
|
|
@@ -880,14 +1018,11 @@ export default class FrontendModelBase {
|
|
|
880
1018
|
/**
|
|
881
1019
|
* Internal setter called by `instantiateFromResponse` when hydrating
|
|
882
1020
|
* association counts that rode along with the record payload.
|
|
883
|
-
*
|
|
884
1021
|
* @param {string} attributeName - Attribute name.
|
|
885
1022
|
* @param {number} value - Count value.
|
|
886
1023
|
* @returns {void}
|
|
887
1024
|
*/
|
|
888
1025
|
_setAssociationCount(attributeName: string, value: number): void;
|
|
889
|
-
/** @type {Map<string, number>} */
|
|
890
|
-
_associationCounts: Map<string, number> | undefined;
|
|
891
1026
|
/**
|
|
892
1027
|
* Read a per-record ability result attached by `.abilities(...)`. The
|
|
893
1028
|
* backend evaluates each requested action against the current
|
|
@@ -896,7 +1031,6 @@ export default class FrontendModelBase {
|
|
|
896
1031
|
* requested (or the ability denied it), so UI code can safely branch
|
|
897
1032
|
* on `record.can("update")` without first checking whether the
|
|
898
1033
|
* ability was loaded.
|
|
899
|
-
*
|
|
900
1034
|
* @param {string} action - Ability action name, e.g. `"update"`.
|
|
901
1035
|
* @returns {boolean}
|
|
902
1036
|
*/
|
|
@@ -905,42 +1039,36 @@ export default class FrontendModelBase {
|
|
|
905
1039
|
* Internal setter called by `instantiateFromResponse` when hydrating
|
|
906
1040
|
* per-record ability results that rode along with the record
|
|
907
1041
|
* payload.
|
|
908
|
-
*
|
|
909
1042
|
* @param {string} action - Ability action name.
|
|
910
1043
|
* @param {boolean} value - Whether the current ability permits the action on this record.
|
|
911
1044
|
* @returns {void}
|
|
912
1045
|
*/
|
|
913
1046
|
_setComputedAbility(action: string, value: boolean): void;
|
|
914
|
-
/** @type {Map<string, boolean>} */
|
|
915
|
-
_computedAbilities: Map<string, boolean> | undefined;
|
|
916
1047
|
/**
|
|
917
1048
|
* Read a consumer-defined value attached by `.queryData(...)`. Stored
|
|
918
1049
|
* on a dedicated map rather than `_attributes`, so a virtual alias
|
|
919
1050
|
* like `tasksCount` cannot silently shadow a real column of the same
|
|
920
1051
|
* name. Returns `null` when no registered fn produced that alias for
|
|
921
1052
|
* this record (e.g. no child rows matched the aggregate).
|
|
922
|
-
*
|
|
923
1053
|
* @param {string} name - queryData alias name.
|
|
924
|
-
* @returns {
|
|
1054
|
+
* @returns {?}
|
|
925
1055
|
*/
|
|
926
1056
|
queryData(name: string): unknown;
|
|
927
1057
|
/**
|
|
928
1058
|
* Internal setter used by `instantiateFromResponse` when hydrating
|
|
929
1059
|
* queryData values that rode along with the record payload.
|
|
930
|
-
*
|
|
931
1060
|
* @param {string} name - queryData alias name.
|
|
932
|
-
* @param {
|
|
1061
|
+
* @param {?} value - Attached value.
|
|
933
1062
|
* @returns {void}
|
|
934
1063
|
*/
|
|
935
1064
|
_setQueryData(name: string, value: unknown): void;
|
|
936
|
-
/** @type {Map<string, unknown>} */
|
|
937
|
-
_queryDataValues: Map<string, unknown> | undefined;
|
|
938
1065
|
/**
|
|
1066
|
+
* Runs set attribute.
|
|
939
1067
|
* @param {string} attributeName - Attribute name.
|
|
940
|
-
* @param {
|
|
941
|
-
* @returns {
|
|
1068
|
+
* @param {?} newValue - New value.
|
|
1069
|
+
* @returns {?} - Assigned value.
|
|
942
1070
|
*/
|
|
943
|
-
setAttribute(attributeName: string, newValue:
|
|
1071
|
+
setAttribute(attributeName: string, newValue: unknown): unknown;
|
|
944
1072
|
/**
|
|
945
1073
|
* Invalidates any cached belongsTo relationship whose foreign key matches the
|
|
946
1074
|
* changed attribute. HasMany / hasOne relationships are left untouched because
|
|
@@ -978,16 +1106,19 @@ export default class FrontendModelBase {
|
|
|
978
1106
|
id: string;
|
|
979
1107
|
}) => void, options?: import("./query.js").FrontendModelEventOptions): Promise<() => void>;
|
|
980
1108
|
/**
|
|
981
|
-
*
|
|
1109
|
+
* Runs update.
|
|
1110
|
+
* @param {Record<string, ?>} [newAttributes] - New values to assign before update.
|
|
982
1111
|
* @returns {Promise<this>} - Updated model.
|
|
983
1112
|
*/
|
|
984
|
-
update(newAttributes?: Record<string,
|
|
1113
|
+
update(newAttributes?: Record<string, unknown>): Promise<this>;
|
|
985
1114
|
/**
|
|
986
|
-
*
|
|
1115
|
+
* Runs attach.
|
|
1116
|
+
* @param {?} attachmentInput - Attachment input or named attachment payload.
|
|
987
1117
|
* @returns {Promise<void>} - Resolves when attached.
|
|
988
1118
|
*/
|
|
989
1119
|
attach(attachmentInput: unknown): Promise<void>;
|
|
990
1120
|
/**
|
|
1121
|
+
* Runs save.
|
|
991
1122
|
* @returns {Promise<this>} - Saved model.
|
|
992
1123
|
*/
|
|
993
1124
|
save(): Promise<this>;
|
|
@@ -997,10 +1128,11 @@ export default class FrontendModelBase {
|
|
|
997
1128
|
* receives only the fields the caller actually changed — avoiding strict
|
|
998
1129
|
* permit rejections on framework-managed fields like `id`, `createdAt`,
|
|
999
1130
|
* `updatedAt` that the resource never lists in `permittedParams`.
|
|
1000
|
-
* @returns {Record<string,
|
|
1131
|
+
* @returns {Record<string, ?>} - Changed attributes hash.
|
|
1001
1132
|
*/
|
|
1002
|
-
_changedAttributesForSave(): Record<string,
|
|
1133
|
+
_changedAttributesForSave(): Record<string, unknown>;
|
|
1003
1134
|
/**
|
|
1135
|
+
* Runs destroy.
|
|
1004
1136
|
* @returns {Promise<void>} - Resolves when destroyed on backend.
|
|
1005
1137
|
*/
|
|
1006
1138
|
destroy(): Promise<void>;
|
|
@@ -1016,27 +1148,30 @@ export default class FrontendModelBase {
|
|
|
1016
1148
|
*
|
|
1017
1149
|
* Loaded but untouched records are omitted so nested save preserves Rails-style
|
|
1018
1150
|
* "children not referenced in payload are left alone" semantics.
|
|
1019
|
-
* @returns {Record<string, Array<Record<string,
|
|
1151
|
+
* @returns {Record<string, Array<Record<string, ?>>>} - Per-relationship list of nested-attribute entries.
|
|
1020
1152
|
*/
|
|
1021
|
-
_buildNestedAttributesPayload(): Record<string, Array<Record<string,
|
|
1153
|
+
_buildNestedAttributesPayload(): Record<string, Array<Record<string, unknown>>>;
|
|
1022
1154
|
/**
|
|
1023
1155
|
* Builds the payload entry for this child when walked by a parent's
|
|
1024
1156
|
* `_buildNestedAttributesPayload`. Returns `null` when the child has no
|
|
1025
1157
|
* dirty state and no dirty descendants, so the parent can omit it.
|
|
1026
|
-
* @returns {Record<string,
|
|
1158
|
+
* @returns {Record<string, ?> | null} - Nested-attribute entry or null if clean.
|
|
1027
1159
|
*/
|
|
1028
|
-
_nestedAttributesEntryForParentSave(): Record<string,
|
|
1160
|
+
_nestedAttributesEntryForParentSave(): Record<string, unknown> | null;
|
|
1029
1161
|
/**
|
|
1030
1162
|
* After a parent save with `nestedAttributes`, the server response includes
|
|
1031
1163
|
* preloaded versions of the affected relationships. This replaces the local
|
|
1032
1164
|
* `_loadedValue` for each nested-writable relationship with the server's
|
|
1033
1165
|
* authoritative set, so destroyed children are dropped and newly-created
|
|
1034
1166
|
* children get their server-assigned ids + persisted state.
|
|
1035
|
-
* @param {Record<string,
|
|
1167
|
+
* @param {Record<string, ?>} response - Command response payload.
|
|
1036
1168
|
* @returns {void}
|
|
1037
1169
|
*/
|
|
1038
|
-
_reconcileNestedAttributesFromResponse(response: Record<string,
|
|
1170
|
+
_reconcileNestedAttributesFromResponse(response: Record<string, unknown>): void;
|
|
1039
1171
|
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Defines this typedef.
|
|
1174
|
+
*/
|
|
1040
1175
|
export type FrontendModelModelEventCallbackEntry = {
|
|
1041
1176
|
callback: (payload: {
|
|
1042
1177
|
id: string;
|
|
@@ -1046,16 +1181,31 @@ export type FrontendModelModelEventCallbackEntry = {
|
|
|
1046
1181
|
eventFilterPayload: import("./query.js").FrontendModelEventFilterPayload | null;
|
|
1047
1182
|
projectionPayload: import("./query.js").FrontendModelProjectionPayload;
|
|
1048
1183
|
};
|
|
1184
|
+
/**
|
|
1185
|
+
* Defines this typedef.
|
|
1186
|
+
*/
|
|
1049
1187
|
export type FrontendModelDestroyEventCallbackEntry = {
|
|
1050
1188
|
callback: (payload: {
|
|
1051
1189
|
id: string;
|
|
1052
1190
|
}) => void;
|
|
1053
1191
|
};
|
|
1192
|
+
/**
|
|
1193
|
+
* FrontendModelCommandType type.
|
|
1194
|
+
*/
|
|
1054
1195
|
export type FrontendModelCommandType = "create" | "find" | "index" | "update" | "destroy" | "attach" | "download" | "url";
|
|
1196
|
+
/**
|
|
1197
|
+
* FrontendModelRequestCommandType type.
|
|
1198
|
+
*/
|
|
1055
1199
|
export type FrontendModelRequestCommandType = FrontendModelCommandType | string;
|
|
1200
|
+
/**
|
|
1201
|
+
* Defines this typedef.
|
|
1202
|
+
*/
|
|
1056
1203
|
export type FrontendModelAttachmentDefinition = {
|
|
1057
1204
|
type: "hasOne" | "hasMany";
|
|
1058
1205
|
};
|
|
1206
|
+
/**
|
|
1207
|
+
* Defines this typedef.
|
|
1208
|
+
*/
|
|
1059
1209
|
export type FrontendModelResourceConfig = {
|
|
1060
1210
|
attributes?: string[];
|
|
1061
1211
|
builtInCollectionCommands?: string[];
|
|
@@ -1072,6 +1222,9 @@ export type FrontendModelResourceConfig = {
|
|
|
1072
1222
|
primaryKey?: string;
|
|
1073
1223
|
relationships?: string[];
|
|
1074
1224
|
};
|
|
1225
|
+
/**
|
|
1226
|
+
* FrontendModelTransportConfig type.
|
|
1227
|
+
*/
|
|
1075
1228
|
export type FrontendModelTransportConfig = {
|
|
1076
1229
|
/**
|
|
1077
1230
|
* - Optional frontend-model URL. This should be the shared endpoint (for example `"/frontend-models"` or `"https://example.com/frontend-models"`).
|
|
@@ -1089,17 +1242,17 @@ export type FrontendModelTransportConfig = {
|
|
|
1089
1242
|
* - Optional websocket client for shared frontend-model API requests and subscriptions.
|
|
1090
1243
|
*/
|
|
1091
1244
|
websocketClient?: {
|
|
1092
|
-
post: (path: string, body?:
|
|
1245
|
+
post: (path: string, body?: unknown, options?: {
|
|
1093
1246
|
headers?: Record<string, string>;
|
|
1094
1247
|
}) => Promise<{
|
|
1095
|
-
json: () =>
|
|
1248
|
+
json: () => unknown;
|
|
1096
1249
|
}>;
|
|
1097
1250
|
subscribe: (channel: string, options: {
|
|
1098
|
-
params?: Record<string,
|
|
1099
|
-
}, callback: (payload:
|
|
1251
|
+
params?: Record<string, unknown>;
|
|
1252
|
+
}, callback: (payload: unknown) => void) => (() => void);
|
|
1100
1253
|
subscribeAndWait?: (channel: string, options: {
|
|
1101
|
-
params?: Record<string,
|
|
1102
|
-
}, callback: (payload:
|
|
1254
|
+
params?: Record<string, unknown>;
|
|
1255
|
+
}, callback: (payload: unknown) => void) => Promise<(() => void)>;
|
|
1103
1256
|
} | undefined;
|
|
1104
1257
|
/**
|
|
1105
1258
|
* - Extra HTTP/WS headers to attach to every frontend-model API request. Pass a function to compute them at request time (for example to include the current locale).
|
|
@@ -1114,6 +1267,9 @@ export type FrontendModelTransportConfig = {
|
|
|
1114
1267
|
clear: () => void | Promise<void>;
|
|
1115
1268
|
} | undefined;
|
|
1116
1269
|
};
|
|
1270
|
+
/**
|
|
1271
|
+
* FrontendModelIdleWaitArgs type.
|
|
1272
|
+
*/
|
|
1117
1273
|
export type FrontendModelIdleWaitArgs = {
|
|
1118
1274
|
/**
|
|
1119
1275
|
* - Milliseconds the transport must stay idle before resolving.
|