velocious 1.0.449 → 1.0.450
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/build/application.js +4 -4
- package/build/authorization/ability.js +8 -8
- package/build/authorization/base-resource.js +4 -4
- package/build/background-jobs/cron-expression.js +1 -1
- package/build/background-jobs/forked-runner-child.js +1 -1
- package/build/background-jobs/job-registry.js +1 -1
- package/build/background-jobs/job-runner.js +1 -1
- package/build/background-jobs/job.js +1 -1
- package/build/background-jobs/json-socket.js +4 -4
- package/build/background-jobs/main.js +21 -21
- package/build/background-jobs/scheduler.js +7 -7
- package/build/background-jobs/store.js +7 -7
- package/build/background-jobs/web/controller.js +2 -2
- package/build/background-jobs/worker.js +12 -12
- package/build/beacon/client.js +11 -8
- package/build/beacon/in-process-broker.js +2 -2
- package/build/beacon/in-process-client.js +2 -2
- package/build/beacon/server.js +3 -3
- package/build/cli/browser-cli.js +1 -1
- package/build/cli/commands/db/base-command.js +2 -2
- package/build/cli/index.js +2 -2
- package/build/cli/tenant-database-command-helper.js +3 -3
- package/build/cli/use-browser-cli.js +1 -1
- package/build/configuration.js +38 -38
- package/build/controller.js +8 -8
- package/build/current-configuration.js +1 -1
- package/build/database/annotations-async-hooks.js +2 -2
- package/build/database/annotations.js +3 -3
- package/build/database/drivers/base-column.js +1 -1
- package/build/database/drivers/base-foreign-key.js +1 -1
- package/build/database/drivers/base-table.js +1 -1
- package/build/database/drivers/base.js +10 -10
- package/build/database/drivers/mssql/index.js +1 -1
- package/build/database/drivers/mssql/table.js +1 -1
- package/build/database/drivers/mysql/index.js +3 -3
- package/build/database/drivers/mysql/query.js +1 -1
- package/build/database/drivers/mysql/table.js +1 -1
- package/build/database/drivers/pgsql/index.js +2 -2
- package/build/database/drivers/sqlite/base.js +16 -16
- package/build/database/drivers/sqlite/index.js +11 -11
- package/build/database/drivers/sqlite/index.native.js +1 -1
- package/build/database/drivers/sqlite/index.web.js +3 -3
- package/build/database/drivers/sqlite/query.js +1 -1
- package/build/database/drivers/sqlite/query.web.js +1 -1
- package/build/database/drivers/sqlite/sql/alter-table.js +2 -2
- package/build/database/drivers/sqlite/table.js +1 -1
- package/build/database/migrator/files-finder.js +1 -1
- package/build/database/migrator.js +6 -6
- package/build/database/pool/async-tracked-multi-connection.js +27 -27
- package/build/database/pool/base-methods-forward.js +4 -4
- package/build/database/pool/base.js +8 -8
- package/build/database/query/from-base.js +1 -1
- package/build/database/query/index.js +10 -10
- package/build/database/query/join-object.js +3 -3
- package/build/database/query/model-class-query.js +39 -39
- package/build/database/query/preloader/belongs-to.js +22 -22
- package/build/database/query/preloader/has-many.js +20 -20
- package/build/database/query/preloader/has-one.js +8 -8
- package/build/database/query/preloader/selection.js +3 -3
- package/build/database/query/preloader.js +8 -8
- package/build/database/query/query-data.js +9 -9
- package/build/database/query/where-model-class-hash.js +7 -7
- package/build/database/query/with-count.js +9 -9
- package/build/database/record/acts-as-list.js +15 -15
- package/build/database/record/attachments/handle.js +2 -2
- package/build/database/record/attachments/normalize-input.js +12 -12
- package/build/database/record/attachments/storage-drivers/s3.js +6 -6
- package/build/database/record/attachments/store.js +13 -13
- package/build/database/record/index.js +115 -121
- package/build/database/record/instance-relationships/base.js +11 -11
- package/build/database/record/instance-relationships/belongs-to.js +3 -3
- package/build/database/record/instance-relationships/has-many.js +8 -8
- package/build/database/record/instance-relationships/has-one.js +7 -7
- package/build/database/record/relationships/base.js +2 -2
- package/build/database/record/state-machine.js +7 -7
- package/build/database/record/validators/presence.js +1 -1
- package/build/database/record/validators/uniqueness.js +5 -5
- package/build/database/table-data/index.js +4 -4
- package/build/environment-handlers/base.js +2 -2
- package/build/environment-handlers/browser.js +7 -7
- package/build/environment-handlers/node/cli/commands/cli-command-context.js +1 -1
- package/build/environment-handlers/node/cli/commands/console.js +4 -4
- package/build/environment-handlers/node/cli/commands/db/schema/dump.js +1 -1
- package/build/environment-handlers/node/cli/commands/db/schema/load.js +3 -3
- package/build/environment-handlers/node/cli/commands/generate/frontend-models.js +55 -17
- package/build/environment-handlers/node.js +6 -6
- package/build/frontend-model-controller.js +81 -82
- package/build/frontend-model-resource/base-resource.js +78 -115
- package/build/frontend-models/base.js +162 -149
- package/build/frontend-models/clear-pending-debounced-callback.js +1 -1
- package/build/frontend-models/event-hook-models.js +2 -2
- package/build/frontend-models/outgoing-event-buffer.js +2 -2
- package/build/frontend-models/preloader.js +5 -5
- package/build/frontend-models/query.js +43 -38
- package/build/frontend-models/resource-definition.js +6 -6
- package/build/frontend-models/transport-serialization.js +11 -11
- package/build/frontend-models/use-destroyed-event.js +10 -10
- package/build/frontend-models/use-model-class-event.js +11 -11
- package/build/frontend-models/use-updated-event.js +11 -11
- package/build/frontend-models/websocket-channel.js +26 -17
- package/build/frontend-models/websocket-publishers.js +9 -9
- package/build/http-client/response.js +2 -2
- package/build/http-server/client/index.js +8 -8
- package/build/http-server/client/params-to-object.js +10 -10
- package/build/http-server/client/request-buffer/form-data-part.js +2 -2
- package/build/http-server/client/request-buffer/index.js +8 -8
- package/build/http-server/client/request-parser.js +3 -3
- package/build/http-server/client/request-runner.js +6 -6
- package/build/http-server/client/request-timing.js +5 -5
- package/build/http-server/client/request.js +1 -1
- package/build/http-server/client/response.js +5 -5
- package/build/http-server/client/websocket-request.js +4 -4
- package/build/http-server/client/websocket-session.js +18 -18
- package/build/http-server/development-reloader.js +5 -5
- package/build/http-server/index.js +12 -12
- package/build/http-server/remote-address.js +4 -4
- package/build/http-server/server-client.js +3 -3
- package/build/http-server/server-lock.js +4 -4
- package/build/http-server/websocket-channel-subscribers.js +3 -3
- package/build/http-server/websocket-channel.js +1 -1
- package/build/http-server/websocket-connection.js +1 -1
- package/build/http-server/websocket-event-log-store.js +6 -6
- package/build/http-server/websocket-events-host.js +2 -2
- package/build/http-server/worker-handler/in-process.js +7 -7
- package/build/http-server/worker-handler/index.js +4 -4
- package/build/http-server/worker-handler/worker-thread.js +3 -3
- package/build/logger/outputs/array-output.js +3 -3
- package/build/logger/outputs/console-output.js +1 -1
- package/build/logger/outputs/file-output.js +4 -4
- package/build/logger/outputs/stdout-output.js +1 -1
- package/build/logger.js +10 -10
- package/build/mailer/backends/smtp.js +3 -3
- package/build/mailer/base.js +8 -8
- package/build/mailer/delivery.js +4 -4
- package/build/plugins/sqljs-wasm-route-controller.js +1 -1
- package/build/routes/base-route.js +6 -6
- package/build/routes/basic-route.js +1 -1
- package/build/routes/hooks/frontend-model-command-route-hook.js +1 -1
- package/build/routes/index.js +1 -1
- package/build/routes/plugin-routes.js +1 -1
- package/build/routes/resolver.js +11 -11
- package/build/routes/resource-route.js +1 -1
- package/build/src/application.d.ts +3 -3
- package/build/src/application.d.ts.map +1 -1
- package/build/src/application.js +5 -5
- package/build/src/authorization/ability.d.ts +7 -7
- package/build/src/authorization/ability.d.ts.map +1 -1
- package/build/src/authorization/ability.js +9 -9
- package/build/src/authorization/base-resource.d.ts +1 -1
- package/build/src/authorization/base-resource.d.ts.map +1 -1
- package/build/src/authorization/base-resource.js +5 -5
- package/build/src/background-jobs/cron-expression.js +2 -2
- package/build/src/background-jobs/forked-runner-child.js +2 -2
- package/build/src/background-jobs/job-registry.d.ts +1 -1
- package/build/src/background-jobs/job-registry.d.ts.map +1 -1
- package/build/src/background-jobs/job-registry.js +2 -2
- package/build/src/background-jobs/job-runner.js +2 -2
- package/build/src/background-jobs/job.js +2 -2
- package/build/src/background-jobs/json-socket.d.ts +4 -4
- package/build/src/background-jobs/json-socket.d.ts.map +1 -1
- package/build/src/background-jobs/json-socket.js +5 -5
- package/build/src/background-jobs/main.d.ts +18 -18
- package/build/src/background-jobs/main.d.ts.map +1 -1
- package/build/src/background-jobs/main.js +22 -22
- package/build/src/background-jobs/scheduler.d.ts +5 -5
- package/build/src/background-jobs/scheduler.d.ts.map +1 -1
- package/build/src/background-jobs/scheduler.js +8 -8
- package/build/src/background-jobs/store.js +8 -8
- package/build/src/background-jobs/web/controller.js +3 -3
- package/build/src/background-jobs/worker.d.ts +6 -6
- package/build/src/background-jobs/worker.d.ts.map +1 -1
- package/build/src/background-jobs/worker.js +13 -13
- package/build/src/beacon/client.d.ts +4 -4
- package/build/src/beacon/client.d.ts.map +1 -1
- package/build/src/beacon/client.js +12 -9
- package/build/src/beacon/in-process-broker.d.ts.map +1 -1
- package/build/src/beacon/in-process-broker.js +3 -3
- package/build/src/beacon/in-process-client.d.ts +1 -1
- package/build/src/beacon/in-process-client.d.ts.map +1 -1
- package/build/src/beacon/in-process-client.js +3 -3
- package/build/src/beacon/server.d.ts +2 -2
- package/build/src/beacon/server.d.ts.map +1 -1
- package/build/src/beacon/server.js +4 -4
- package/build/src/cli/browser-cli.js +2 -2
- package/build/src/cli/commands/db/base-command.d.ts +2 -2
- package/build/src/cli/commands/db/base-command.d.ts.map +1 -1
- package/build/src/cli/commands/db/base-command.js +3 -3
- package/build/src/cli/index.js +3 -3
- package/build/src/cli/tenant-database-command-helper.d.ts +1 -1
- package/build/src/cli/tenant-database-command-helper.d.ts.map +1 -1
- package/build/src/cli/tenant-database-command-helper.js +4 -4
- package/build/src/cli/use-browser-cli.js +2 -2
- package/build/src/configuration.d.ts +14 -14
- package/build/src/configuration.d.ts.map +1 -1
- package/build/src/configuration.js +39 -39
- package/build/src/controller.js +10 -10
- package/build/src/current-configuration.js +2 -2
- package/build/src/database/annotations-async-hooks.js +3 -3
- package/build/src/database/annotations.d.ts.map +1 -1
- package/build/src/database/annotations.js +4 -4
- package/build/src/database/drivers/base-column.d.ts +1 -1
- package/build/src/database/drivers/base-column.d.ts.map +1 -1
- package/build/src/database/drivers/base-column.js +2 -2
- package/build/src/database/drivers/base-foreign-key.d.ts +1 -1
- package/build/src/database/drivers/base-foreign-key.d.ts.map +1 -1
- package/build/src/database/drivers/base-foreign-key.js +2 -2
- package/build/src/database/drivers/base-table.d.ts +1 -1
- package/build/src/database/drivers/base-table.d.ts.map +1 -1
- package/build/src/database/drivers/base-table.js +2 -2
- package/build/src/database/drivers/base.d.ts +6 -6
- package/build/src/database/drivers/base.d.ts.map +1 -1
- package/build/src/database/drivers/base.js +11 -11
- package/build/src/database/drivers/mssql/index.js +2 -2
- package/build/src/database/drivers/mssql/table.js +2 -2
- package/build/src/database/drivers/mysql/index.js +4 -4
- package/build/src/database/drivers/mysql/query.js +2 -2
- package/build/src/database/drivers/mysql/table.js +2 -2
- package/build/src/database/drivers/pgsql/index.js +3 -3
- package/build/src/database/drivers/sqlite/base.d.ts +3 -3
- package/build/src/database/drivers/sqlite/base.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/base.js +17 -17
- package/build/src/database/drivers/sqlite/index.d.ts +4 -4
- package/build/src/database/drivers/sqlite/index.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.js +12 -12
- package/build/src/database/drivers/sqlite/index.native.js +2 -2
- package/build/src/database/drivers/sqlite/index.web.d.ts +2 -2
- package/build/src/database/drivers/sqlite/index.web.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/index.web.js +4 -4
- package/build/src/database/drivers/sqlite/query.js +2 -2
- package/build/src/database/drivers/sqlite/query.web.js +2 -2
- package/build/src/database/drivers/sqlite/sql/alter-table.js +3 -3
- package/build/src/database/drivers/sqlite/table.js +2 -2
- package/build/src/database/migrator/files-finder.js +2 -2
- package/build/src/database/migrator.d.ts +1 -1
- package/build/src/database/migrator.d.ts.map +1 -1
- package/build/src/database/migrator.js +7 -7
- package/build/src/database/pool/async-tracked-multi-connection.d.ts +9 -9
- package/build/src/database/pool/async-tracked-multi-connection.d.ts.map +1 -1
- package/build/src/database/pool/async-tracked-multi-connection.js +28 -28
- package/build/src/database/pool/base-methods-forward.js +7 -7
- package/build/src/database/pool/base.d.ts +1 -1
- package/build/src/database/pool/base.d.ts.map +1 -1
- package/build/src/database/pool/base.js +9 -9
- package/build/src/database/query/from-base.d.ts +1 -1
- package/build/src/database/query/from-base.d.ts.map +1 -1
- package/build/src/database/query/from-base.js +2 -2
- package/build/src/database/query/index.d.ts +4 -4
- package/build/src/database/query/index.d.ts.map +1 -1
- package/build/src/database/query/index.js +11 -11
- package/build/src/database/query/join-object.js +4 -4
- package/build/src/database/query/model-class-query.d.ts +4 -4
- package/build/src/database/query/model-class-query.d.ts.map +1 -1
- package/build/src/database/query/model-class-query.js +40 -40
- package/build/src/database/query/preloader/belongs-to.js +23 -23
- package/build/src/database/query/preloader/has-many.js +21 -21
- package/build/src/database/query/preloader/has-one.js +9 -9
- package/build/src/database/query/preloader/selection.js +4 -4
- package/build/src/database/query/preloader.js +9 -9
- package/build/src/database/query/query-data.js +10 -10
- package/build/src/database/query/where-model-class-hash.js +8 -8
- package/build/src/database/query/with-count.js +10 -10
- package/build/src/database/record/acts-as-list.js +20 -20
- package/build/src/database/record/attachments/handle.d.ts +1 -1
- package/build/src/database/record/attachments/handle.d.ts.map +1 -1
- package/build/src/database/record/attachments/handle.js +3 -3
- package/build/src/database/record/attachments/normalize-input.js +15 -15
- package/build/src/database/record/attachments/storage-drivers/s3.js +7 -7
- package/build/src/database/record/attachments/store.d.ts +2 -2
- package/build/src/database/record/attachments/store.d.ts.map +1 -1
- package/build/src/database/record/attachments/store.js +14 -14
- package/build/src/database/record/index.d.ts +18 -25
- package/build/src/database/record/index.d.ts.map +1 -1
- package/build/src/database/record/index.js +135 -141
- package/build/src/database/record/instance-relationships/base.d.ts +3 -3
- package/build/src/database/record/instance-relationships/base.d.ts.map +1 -1
- package/build/src/database/record/instance-relationships/base.js +13 -13
- package/build/src/database/record/instance-relationships/belongs-to.js +4 -4
- package/build/src/database/record/instance-relationships/has-many.js +9 -9
- package/build/src/database/record/instance-relationships/has-one.d.ts +1 -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 +8 -8
- package/build/src/database/record/relationships/base.js +4 -4
- package/build/src/database/record/state-machine.js +8 -8
- package/build/src/database/record/validators/presence.js +2 -2
- package/build/src/database/record/validators/uniqueness.js +6 -6
- package/build/src/database/table-data/index.d.ts +4 -4
- package/build/src/database/table-data/index.d.ts.map +1 -1
- package/build/src/database/table-data/index.js +5 -5
- package/build/src/environment-handlers/base.js +3 -3
- package/build/src/environment-handlers/browser.d.ts +3 -3
- package/build/src/environment-handlers/browser.d.ts.map +1 -1
- package/build/src/environment-handlers/browser.js +8 -8
- package/build/src/environment-handlers/node/cli/commands/cli-command-context.js +2 -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 +5 -5
- package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/schema/dump.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/schema/dump.js +2 -2
- package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/schema/load.d.ts.map +1 -1
- package/build/src/environment-handlers/node/cli/commands/db/schema/load.js +4 -4
- package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts +16 -1
- 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 +51 -17
- package/build/src/environment-handlers/node.d.ts +2 -2
- package/build/src/environment-handlers/node.d.ts.map +1 -1
- package/build/src/environment-handlers/node.js +7 -7
- package/build/src/frontend-model-controller.d.ts +5 -6
- package/build/src/frontend-model-controller.d.ts.map +1 -1
- package/build/src/frontend-model-controller.js +88 -89
- package/build/src/frontend-model-resource/base-resource.d.ts +36 -27
- package/build/src/frontend-model-resource/base-resource.d.ts.map +1 -1
- package/build/src/frontend-model-resource/base-resource.js +67 -120
- package/build/src/frontend-models/base.d.ts +66 -58
- package/build/src/frontend-models/base.d.ts.map +1 -1
- package/build/src/frontend-models/base.js +171 -158
- package/build/src/frontend-models/clear-pending-debounced-callback.js +2 -2
- package/build/src/frontend-models/event-hook-models.d.ts.map +1 -1
- package/build/src/frontend-models/event-hook-models.js +3 -3
- package/build/src/frontend-models/outgoing-event-buffer.d.ts +1 -1
- package/build/src/frontend-models/outgoing-event-buffer.d.ts.map +1 -1
- package/build/src/frontend-models/outgoing-event-buffer.js +3 -3
- package/build/src/frontend-models/preloader.js +6 -6
- package/build/src/frontend-models/query.d.ts +16 -8
- package/build/src/frontend-models/query.d.ts.map +1 -1
- package/build/src/frontend-models/query.js +43 -39
- package/build/src/frontend-models/resource-definition.js +7 -7
- package/build/src/frontend-models/transport-serialization.js +12 -12
- package/build/src/frontend-models/use-destroyed-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-destroyed-event.js +11 -11
- package/build/src/frontend-models/use-model-class-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-model-class-event.js +12 -12
- package/build/src/frontend-models/use-updated-event.d.ts.map +1 -1
- package/build/src/frontend-models/use-updated-event.js +12 -12
- package/build/src/frontend-models/websocket-channel.d.ts +6 -1
- package/build/src/frontend-models/websocket-channel.d.ts.map +1 -1
- package/build/src/frontend-models/websocket-channel.js +26 -18
- package/build/src/frontend-models/websocket-publishers.js +11 -11
- package/build/src/http-client/response.d.ts +2 -2
- package/build/src/http-client/response.d.ts.map +1 -1
- package/build/src/http-client/response.js +3 -3
- package/build/src/http-server/client/index.d.ts +1 -1
- package/build/src/http-server/client/index.d.ts.map +1 -1
- package/build/src/http-server/client/index.js +9 -9
- package/build/src/http-server/client/params-to-object.js +11 -11
- package/build/src/http-server/client/request-buffer/form-data-part.d.ts +2 -2
- 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 +3 -3
- package/build/src/http-server/client/request-buffer/index.d.ts +4 -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 +9 -9
- package/build/src/http-server/client/request-parser.d.ts +1 -1
- package/build/src/http-server/client/request-parser.d.ts.map +1 -1
- package/build/src/http-server/client/request-parser.js +4 -4
- package/build/src/http-server/client/request-runner.js +7 -7
- package/build/src/http-server/client/request-timing.d.ts +5 -5
- package/build/src/http-server/client/request-timing.d.ts.map +1 -1
- package/build/src/http-server/client/request-timing.js +6 -6
- package/build/src/http-server/client/request.js +2 -2
- package/build/src/http-server/client/response.d.ts +3 -3
- package/build/src/http-server/client/response.d.ts.map +1 -1
- package/build/src/http-server/client/response.js +6 -6
- package/build/src/http-server/client/websocket-request.d.ts +3 -3
- package/build/src/http-server/client/websocket-request.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-request.js +5 -5
- package/build/src/http-server/client/websocket-session.d.ts +6 -6
- package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-session.js +19 -19
- package/build/src/http-server/development-reloader.d.ts +3 -3
- package/build/src/http-server/development-reloader.d.ts.map +1 -1
- package/build/src/http-server/development-reloader.js +6 -6
- package/build/src/http-server/index.d.ts +7 -7
- package/build/src/http-server/index.d.ts.map +1 -1
- package/build/src/http-server/index.js +13 -13
- package/build/src/http-server/remote-address.js +6 -6
- package/build/src/http-server/server-client.js +4 -4
- package/build/src/http-server/server-lock.js +5 -5
- package/build/src/http-server/websocket-channel-subscribers.d.ts +1 -1
- package/build/src/http-server/websocket-channel-subscribers.d.ts.map +1 -1
- package/build/src/http-server/websocket-channel-subscribers.js +4 -4
- package/build/src/http-server/websocket-channel.d.ts +1 -1
- package/build/src/http-server/websocket-channel.d.ts.map +1 -1
- package/build/src/http-server/websocket-channel.js +2 -2
- package/build/src/http-server/websocket-connection.d.ts +1 -1
- package/build/src/http-server/websocket-connection.d.ts.map +1 -1
- package/build/src/http-server/websocket-connection.js +2 -2
- package/build/src/http-server/websocket-event-log-store.d.ts +1 -1
- package/build/src/http-server/websocket-event-log-store.d.ts.map +1 -1
- package/build/src/http-server/websocket-event-log-store.js +7 -7
- package/build/src/http-server/websocket-events-host.d.ts +1 -1
- package/build/src/http-server/websocket-events-host.d.ts.map +1 -1
- package/build/src/http-server/websocket-events-host.js +3 -3
- package/build/src/http-server/worker-handler/in-process.d.ts +3 -3
- package/build/src/http-server/worker-handler/in-process.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/in-process.js +9 -9
- package/build/src/http-server/worker-handler/index.d.ts +4 -4
- package/build/src/http-server/worker-handler/index.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/index.js +5 -5
- package/build/src/http-server/worker-handler/worker-thread.d.ts +2 -2
- package/build/src/http-server/worker-handler/worker-thread.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/worker-thread.js +4 -4
- package/build/src/logger/outputs/array-output.d.ts +3 -3
- package/build/src/logger/outputs/array-output.d.ts.map +1 -1
- package/build/src/logger/outputs/array-output.js +4 -4
- package/build/src/logger/outputs/console-output.d.ts +1 -1
- package/build/src/logger/outputs/console-output.d.ts.map +1 -1
- package/build/src/logger/outputs/console-output.js +2 -2
- package/build/src/logger/outputs/file-output.d.ts +4 -4
- package/build/src/logger/outputs/file-output.d.ts.map +1 -1
- package/build/src/logger/outputs/file-output.js +5 -5
- package/build/src/logger/outputs/stdout-output.d.ts.map +1 -1
- package/build/src/logger/outputs/stdout-output.js +2 -2
- package/build/src/logger.d.ts.map +1 -1
- package/build/src/logger.js +11 -11
- package/build/src/mailer/backends/smtp.d.ts.map +1 -1
- package/build/src/mailer/backends/smtp.js +5 -5
- package/build/src/mailer/base.js +11 -11
- package/build/src/mailer/delivery.d.ts +3 -3
- package/build/src/mailer/delivery.d.ts.map +1 -1
- package/build/src/mailer/delivery.js +5 -5
- package/build/src/plugins/sqljs-wasm-route-controller.js +2 -2
- package/build/src/routes/base-route.d.ts +6 -6
- package/build/src/routes/base-route.d.ts.map +1 -1
- package/build/src/routes/base-route.js +7 -7
- package/build/src/routes/basic-route.js +2 -2
- package/build/src/routes/hooks/frontend-model-command-route-hook.js +2 -2
- package/build/src/routes/index.js +2 -2
- package/build/src/routes/plugin-routes.js +2 -2
- package/build/src/routes/resolver.d.ts +1 -1
- package/build/src/routes/resolver.d.ts.map +1 -1
- package/build/src/routes/resolver.js +13 -13
- package/build/src/routes/resource-route.d.ts +1 -1
- package/build/src/routes/resource-route.d.ts.map +1 -1
- package/build/src/routes/resource-route.js +2 -2
- 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 +8 -8
- package/build/src/testing/expect-utils.js +13 -13
- package/build/src/testing/expect.d.ts +1 -1
- package/build/src/testing/expect.d.ts.map +1 -1
- package/build/src/testing/expect.js +9 -9
- package/build/src/testing/test-files-finder.d.ts +8 -8
- package/build/src/testing/test-files-finder.d.ts.map +1 -1
- package/build/src/testing/test-files-finder.js +9 -9
- package/build/src/testing/test-filter-parser.js +3 -3
- package/build/src/testing/test-runner.d.ts +2 -2
- package/build/src/testing/test-runner.d.ts.map +1 -1
- package/build/src/testing/test-runner.js +17 -17
- package/build/src/testing/test-suite-splitter.js +2 -2
- package/build/src/testing/test.d.ts +2 -2
- package/build/src/testing/test.d.ts.map +1 -1
- package/build/src/testing/test.js +16 -16
- package/build/src/utils/backtrace-cleaner.d.ts +1 -1
- package/build/src/utils/backtrace-cleaner.d.ts.map +1 -1
- package/build/src/utils/backtrace-cleaner.js +2 -2
- package/build/src/utils/format-value.js +2 -2
- package/build/src/utils/model-scope.js +2 -2
- package/build/src/utils/ransack.js +27 -27
- package/build/src/utils/with-tracked-stack-async-hooks.js +8 -8
- package/build/src/utils/with-tracked-stack.js +4 -4
- package/build/testing/browser-frontend-model-event-hook-scenarios.js +7 -7
- package/build/testing/expect-utils.js +11 -11
- package/build/testing/expect.js +7 -7
- package/build/testing/test-files-finder.js +8 -8
- package/build/testing/test-filter-parser.js +2 -2
- package/build/testing/test-runner.js +16 -16
- package/build/testing/test-suite-splitter.js +1 -1
- package/build/testing/test.js +15 -15
- package/build/utils/backtrace-cleaner.js +1 -1
- package/build/utils/format-value.js +1 -1
- package/build/utils/model-scope.js +1 -1
- package/build/utils/ransack.js +26 -26
- package/build/utils/with-tracked-stack-async-hooks.js +7 -7
- package/build/utils/with-tracked-stack.js +3 -3
- package/package.json +2 -1
- package/src/application.js +4 -4
- package/src/authorization/ability.js +8 -8
- package/src/authorization/base-resource.js +4 -4
- package/src/background-jobs/cron-expression.js +1 -1
- package/src/background-jobs/forked-runner-child.js +1 -1
- package/src/background-jobs/job-registry.js +1 -1
- package/src/background-jobs/job-runner.js +1 -1
- package/src/background-jobs/job.js +1 -1
- package/src/background-jobs/json-socket.js +4 -4
- package/src/background-jobs/main.js +21 -21
- package/src/background-jobs/scheduler.js +7 -7
- package/src/background-jobs/store.js +7 -7
- package/src/background-jobs/web/controller.js +2 -2
- package/src/background-jobs/worker.js +12 -12
- package/src/beacon/client.js +11 -8
- package/src/beacon/in-process-broker.js +2 -2
- package/src/beacon/in-process-client.js +2 -2
- package/src/beacon/server.js +3 -3
- package/src/cli/browser-cli.js +1 -1
- package/src/cli/commands/db/base-command.js +2 -2
- package/src/cli/index.js +2 -2
- package/src/cli/tenant-database-command-helper.js +3 -3
- package/src/cli/use-browser-cli.js +1 -1
- package/src/configuration.js +38 -38
- package/src/controller.js +8 -8
- package/src/current-configuration.js +1 -1
- package/src/database/annotations-async-hooks.js +2 -2
- package/src/database/annotations.js +3 -3
- package/src/database/drivers/base-column.js +1 -1
- package/src/database/drivers/base-foreign-key.js +1 -1
- package/src/database/drivers/base-table.js +1 -1
- package/src/database/drivers/base.js +10 -10
- package/src/database/drivers/mssql/index.js +1 -1
- package/src/database/drivers/mssql/table.js +1 -1
- package/src/database/drivers/mysql/index.js +3 -3
- package/src/database/drivers/mysql/query.js +1 -1
- package/src/database/drivers/mysql/table.js +1 -1
- package/src/database/drivers/pgsql/index.js +2 -2
- package/src/database/drivers/sqlite/base.js +16 -16
- package/src/database/drivers/sqlite/index.js +11 -11
- package/src/database/drivers/sqlite/index.native.js +1 -1
- package/src/database/drivers/sqlite/index.web.js +3 -3
- package/src/database/drivers/sqlite/query.js +1 -1
- package/src/database/drivers/sqlite/query.web.js +1 -1
- package/src/database/drivers/sqlite/sql/alter-table.js +2 -2
- package/src/database/drivers/sqlite/table.js +1 -1
- package/src/database/migrator/files-finder.js +1 -1
- package/src/database/migrator.js +6 -6
- package/src/database/pool/async-tracked-multi-connection.js +27 -27
- package/src/database/pool/base-methods-forward.js +4 -4
- package/src/database/pool/base.js +8 -8
- package/src/database/query/from-base.js +1 -1
- package/src/database/query/index.js +10 -10
- package/src/database/query/join-object.js +3 -3
- package/src/database/query/model-class-query.js +39 -39
- package/src/database/query/preloader/belongs-to.js +22 -22
- package/src/database/query/preloader/has-many.js +20 -20
- package/src/database/query/preloader/has-one.js +8 -8
- package/src/database/query/preloader/selection.js +3 -3
- package/src/database/query/preloader.js +8 -8
- package/src/database/query/query-data.js +9 -9
- package/src/database/query/where-model-class-hash.js +7 -7
- package/src/database/query/with-count.js +9 -9
- package/src/database/record/acts-as-list.js +15 -15
- package/src/database/record/attachments/handle.js +2 -2
- package/src/database/record/attachments/normalize-input.js +12 -12
- package/src/database/record/attachments/storage-drivers/s3.js +6 -6
- package/src/database/record/attachments/store.js +13 -13
- package/src/database/record/index.js +115 -121
- package/src/database/record/instance-relationships/base.js +11 -11
- package/src/database/record/instance-relationships/belongs-to.js +3 -3
- package/src/database/record/instance-relationships/has-many.js +8 -8
- package/src/database/record/instance-relationships/has-one.js +7 -7
- package/src/database/record/relationships/base.js +2 -2
- package/src/database/record/state-machine.js +7 -7
- package/src/database/record/validators/presence.js +1 -1
- package/src/database/record/validators/uniqueness.js +5 -5
- package/src/database/table-data/index.js +4 -4
- package/src/environment-handlers/base.js +2 -2
- package/src/environment-handlers/browser.js +7 -7
- package/src/environment-handlers/node/cli/commands/cli-command-context.js +1 -1
- package/src/environment-handlers/node/cli/commands/console.js +4 -4
- package/src/environment-handlers/node/cli/commands/db/schema/dump.js +1 -1
- package/src/environment-handlers/node/cli/commands/db/schema/load.js +3 -3
- package/src/environment-handlers/node/cli/commands/generate/frontend-models.js +55 -17
- package/src/environment-handlers/node.js +6 -6
- package/src/frontend-model-controller.js +81 -82
- package/src/frontend-model-resource/base-resource.js +78 -115
- package/src/frontend-models/base.js +162 -149
- package/src/frontend-models/clear-pending-debounced-callback.js +1 -1
- package/src/frontend-models/event-hook-models.js +2 -2
- package/src/frontend-models/outgoing-event-buffer.js +2 -2
- package/src/frontend-models/preloader.js +5 -5
- package/src/frontend-models/query.js +43 -38
- package/src/frontend-models/resource-definition.js +6 -6
- package/src/frontend-models/transport-serialization.js +11 -11
- package/src/frontend-models/use-destroyed-event.js +10 -10
- package/src/frontend-models/use-model-class-event.js +11 -11
- package/src/frontend-models/use-updated-event.js +11 -11
- package/src/frontend-models/websocket-channel.js +26 -17
- package/src/frontend-models/websocket-publishers.js +9 -9
- package/src/http-client/response.js +2 -2
- package/src/http-server/client/index.js +8 -8
- package/src/http-server/client/params-to-object.js +10 -10
- package/src/http-server/client/request-buffer/form-data-part.js +2 -2
- package/src/http-server/client/request-buffer/index.js +8 -8
- package/src/http-server/client/request-parser.js +3 -3
- package/src/http-server/client/request-runner.js +6 -6
- package/src/http-server/client/request-timing.js +5 -5
- package/src/http-server/client/request.js +1 -1
- package/src/http-server/client/response.js +5 -5
- package/src/http-server/client/websocket-request.js +4 -4
- package/src/http-server/client/websocket-session.js +18 -18
- package/src/http-server/development-reloader.js +5 -5
- package/src/http-server/index.js +12 -12
- package/src/http-server/remote-address.js +4 -4
- package/src/http-server/server-client.js +3 -3
- package/src/http-server/server-lock.js +4 -4
- package/src/http-server/websocket-channel-subscribers.js +3 -3
- package/src/http-server/websocket-channel.js +1 -1
- package/src/http-server/websocket-connection.js +1 -1
- package/src/http-server/websocket-event-log-store.js +6 -6
- package/src/http-server/websocket-events-host.js +2 -2
- package/src/http-server/worker-handler/in-process.js +7 -7
- package/src/http-server/worker-handler/index.js +4 -4
- package/src/http-server/worker-handler/worker-thread.js +3 -3
- package/src/logger/outputs/array-output.js +3 -3
- package/src/logger/outputs/console-output.js +1 -1
- package/src/logger/outputs/file-output.js +4 -4
- package/src/logger/outputs/stdout-output.js +1 -1
- package/src/logger.js +10 -10
- package/src/mailer/backends/smtp.js +3 -3
- package/src/mailer/base.js +8 -8
- package/src/mailer/delivery.js +4 -4
- package/src/plugins/sqljs-wasm-route-controller.js +1 -1
- package/src/routes/base-route.js +6 -6
- package/src/routes/basic-route.js +1 -1
- package/src/routes/hooks/frontend-model-command-route-hook.js +1 -1
- package/src/routes/index.js +1 -1
- package/src/routes/plugin-routes.js +1 -1
- package/src/routes/resolver.js +11 -11
- package/src/routes/resource-route.js +1 -1
- package/src/testing/browser-frontend-model-event-hook-scenarios.js +7 -7
- package/src/testing/expect-utils.js +11 -11
- package/src/testing/expect.js +7 -7
- package/src/testing/test-files-finder.js +8 -8
- package/src/testing/test-filter-parser.js +2 -2
- package/src/testing/test-runner.js +16 -16
- package/src/testing/test-suite-splitter.js +1 -1
- package/src/testing/test.js +15 -15
- package/src/utils/backtrace-cleaner.js +1 -1
- package/src/utils/format-value.js +1 -1
- package/src/utils/model-scope.js +1 -1
- package/src/utils/ransack.js +26 -26
- package/src/utils/with-tracked-stack-async-hooks.js +7 -7
- package/src/utils/with-tracked-stack.js +3 -3
|
@@ -30,18 +30,18 @@ export default function baseMethodsForward(PoolBase) {
|
|
|
30
30
|
|
|
31
31
|
const prototype = /**
|
|
32
32
|
* Narrows the runtime value to the documented type.
|
|
33
|
-
|
|
33
|
+
* @type {Record<string, (...args: Array<?>) => ?>} */ (/**
|
|
34
34
|
* Narrows the runtime value to the documented type.
|
|
35
|
-
|
|
35
|
+
* @type {?} */ (PoolBase.prototype))
|
|
36
36
|
|
|
37
37
|
for (const forwardMethod of forwardMethods) {
|
|
38
38
|
prototype[forwardMethod] = function(...args) {
|
|
39
39
|
const connection = this.getCurrentConnection()
|
|
40
40
|
const connectionRecord = /**
|
|
41
41
|
* Narrows the runtime value to the documented type.
|
|
42
|
-
|
|
42
|
+
* @type {Record<string, (...args: Array<?>) => ?>} */ (/**
|
|
43
43
|
* Narrows the runtime value to the documented type.
|
|
44
|
-
|
|
44
|
+
* @type {?} */ (connection))
|
|
45
45
|
const connectionMethod = connectionRecord[forwardMethod]
|
|
46
46
|
|
|
47
47
|
if (!connectionMethod) throw new Error(`${forwardMethod} isn't defined on driver`)
|
|
@@ -41,7 +41,7 @@ export const POOL_CONFIGURATION_KEY = Symbol("velociousPoolConfigurationKey")
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Shared.
|
|
44
|
-
|
|
44
|
+
* @type {{currentPool: VelociousDatabasePoolBase | null}} */
|
|
45
45
|
const shared = {
|
|
46
46
|
currentPool: null
|
|
47
47
|
}
|
|
@@ -60,11 +60,11 @@ function stableStringify(value) {
|
|
|
60
60
|
const entries = Object
|
|
61
61
|
.keys(/**
|
|
62
62
|
* Narrows the runtime value to the documented type.
|
|
63
|
-
|
|
63
|
+
* @type {Record<string, ?>} */ (value))
|
|
64
64
|
.sort()
|
|
65
65
|
.map((key) => `${JSON.stringify(key)}:${stableStringify(/**
|
|
66
66
|
* Narrows the runtime value to the documented type.
|
|
67
|
-
|
|
67
|
+
* @type {Record<string, ?>} */ (value)[key])}`)
|
|
68
68
|
|
|
69
69
|
return `{${entries.join(",")}}`
|
|
70
70
|
}
|
|
@@ -75,7 +75,7 @@ function stableStringify(value) {
|
|
|
75
75
|
class VelociousDatabasePoolBase {
|
|
76
76
|
/**
|
|
77
77
|
* Without current connection context.
|
|
78
|
-
|
|
78
|
+
* @type {undefined | ((callback: () => ?) => ?)} */
|
|
79
79
|
_withoutCurrentConnectionContext = undefined
|
|
80
80
|
|
|
81
81
|
/**
|
|
@@ -154,7 +154,7 @@ class VelociousDatabasePoolBase {
|
|
|
154
154
|
* @returns {T} - Callback result.
|
|
155
155
|
*/
|
|
156
156
|
withoutCurrentConnectionContext(callback) {
|
|
157
|
-
if (this._withoutCurrentConnectionContext) return /**
|
|
157
|
+
if (this._withoutCurrentConnectionContext) return /** @type {T} */ (this._withoutCurrentConnectionContext(callback))
|
|
158
158
|
|
|
159
159
|
return callback()
|
|
160
160
|
}
|
|
@@ -196,7 +196,7 @@ class VelociousDatabasePoolBase {
|
|
|
196
196
|
connectionMatchesCurrentConfiguration(connection) {
|
|
197
197
|
const connectionWithPoolKey = /**
|
|
198
198
|
* Narrows the runtime value to the documented type.
|
|
199
|
-
|
|
199
|
+
* @type {import("../drivers/base.js").default & {[POOL_CONFIGURATION_KEY]?: string}} */ (connection)
|
|
200
200
|
|
|
201
201
|
return connectionWithPoolKey[POOL_CONFIGURATION_KEY] === this.getConfigurationReuseKey()
|
|
202
202
|
}
|
|
@@ -257,7 +257,7 @@ class VelociousDatabasePoolBase {
|
|
|
257
257
|
|
|
258
258
|
const connectionWithPoolKey = /**
|
|
259
259
|
* Narrows the runtime value to the documented type.
|
|
260
|
-
|
|
260
|
+
* @type {import("../drivers/base.js").default & {[POOL_CONFIGURATION_KEY]?: string}} */ (connection)
|
|
261
261
|
connectionWithPoolKey[POOL_CONFIGURATION_KEY] = this.getConfigurationReuseKey()
|
|
262
262
|
connection.setSchemaCacheInvalidator(() => {
|
|
263
263
|
this.clearSchemaCache()
|
|
@@ -372,7 +372,7 @@ class VelociousDatabasePoolBase {
|
|
|
372
372
|
debugConnectionSnapshot(connection, details = {}) {
|
|
373
373
|
const connectionWithPoolKey = /**
|
|
374
374
|
* Narrows the runtime value to the documented type.
|
|
375
|
-
|
|
375
|
+
* @type {import("../drivers/base.js").default & {[POOL_CONFIGURATION_KEY]?: string}} */ (connection)
|
|
376
376
|
|
|
377
377
|
return {
|
|
378
378
|
...connection.getDebugSnapshot(),
|
|
@@ -37,7 +37,7 @@ function normalizeJoinObject(join) {
|
|
|
37
37
|
if (Array.isArray(join)) {
|
|
38
38
|
/**
|
|
39
39
|
* Result.
|
|
40
|
-
|
|
40
|
+
* @type {import("./join-object.js").JoinObject} */
|
|
41
41
|
const result = {}
|
|
42
42
|
|
|
43
43
|
for (const entry of join) {
|
|
@@ -69,7 +69,7 @@ function normalizeJoinObject(join) {
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Result.
|
|
72
|
-
|
|
72
|
+
* @type {import("./join-object.js").JoinObject} */
|
|
73
73
|
const result = {}
|
|
74
74
|
|
|
75
75
|
for (const [key, value] of Object.entries(join)) {
|
|
@@ -157,7 +157,7 @@ export default class VelociousDatabaseQuery {
|
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
159
|
* Narrows the runtime value to the documented type.
|
|
160
|
-
|
|
160
|
+
* @type {() => import("../drivers/base.js").default} */
|
|
161
161
|
this._driverFn = typeof driver === "function" ? driver : () => driver
|
|
162
162
|
this.handler = handler
|
|
163
163
|
this.logger = new Logger(this)
|
|
@@ -173,24 +173,24 @@ export default class VelociousDatabaseQuery {
|
|
|
173
173
|
|
|
174
174
|
/**
|
|
175
175
|
* Narrows the runtime value to the documented type.
|
|
176
|
-
|
|
176
|
+
* @type {Record<string, string[]>} */
|
|
177
177
|
this._preloadSelects = preloadSelects
|
|
178
178
|
|
|
179
179
|
/**
|
|
180
180
|
* Narrows the runtime value to the documented type.
|
|
181
|
-
|
|
181
|
+
* @type {Record<string, string[]>} */
|
|
182
182
|
this._preloadSelectsExtra = preloadSelectsExtra
|
|
183
183
|
this._distinct = distinct
|
|
184
184
|
this._selects = selects
|
|
185
185
|
|
|
186
186
|
/**
|
|
187
187
|
* Narrows the runtime value to the documented type.
|
|
188
|
-
|
|
188
|
+
* @type {import("./where-base.js").default[]} */
|
|
189
189
|
this._wheres = wheres
|
|
190
190
|
|
|
191
191
|
const boundWhere = /**
|
|
192
192
|
* Narrows the runtime value to the documented type.
|
|
193
|
-
|
|
193
|
+
* @type {?} */ (this.where.bind(this))
|
|
194
194
|
boundWhere.not = this.whereNot.bind(this)
|
|
195
195
|
this.where = boundWhere
|
|
196
196
|
}
|
|
@@ -202,7 +202,7 @@ export default class VelociousDatabaseQuery {
|
|
|
202
202
|
clone() {
|
|
203
203
|
const QueryClass = /**
|
|
204
204
|
* Narrows the runtime value to the documented type.
|
|
205
|
-
|
|
205
|
+
* @type {new (args: QueryArgsType) => this} */ (this.constructor)
|
|
206
206
|
const newQuery = new QueryClass({
|
|
207
207
|
driver: this._driverFn,
|
|
208
208
|
froms: [...this._froms],
|
|
@@ -496,7 +496,7 @@ export default class VelociousDatabaseQuery {
|
|
|
496
496
|
} else if (typeof where == "object" && (where.constructor.name == "object" || where.constructor.name == "Object")) {
|
|
497
497
|
this._wheres.push(new WhereHash(this, /**
|
|
498
498
|
* Narrows the runtime value to the documented type.
|
|
499
|
-
|
|
499
|
+
* @type {import("./where-hash.js").WhereHash} */ (where)))
|
|
500
500
|
} else {
|
|
501
501
|
throw new Error(`Invalid type of where: ${typeof where} (${where.constructor.name})`)
|
|
502
502
|
}
|
|
@@ -515,7 +515,7 @@ export default class VelociousDatabaseQuery {
|
|
|
515
515
|
} else if (typeof where == "object" && (where.constructor.name == "object" || where.constructor.name == "Object")) {
|
|
516
516
|
this._wheres.push(new WhereNot(new WhereHash(this, /**
|
|
517
517
|
* Narrows the runtime value to the documented type.
|
|
518
|
-
|
|
518
|
+
* @type {import("./where-hash.js").WhereHash} */ (where))))
|
|
519
519
|
} else {
|
|
520
520
|
throw new Error(`Invalid type of where: ${typeof where} (${where.constructor.name})`)
|
|
521
521
|
}
|
|
@@ -31,10 +31,10 @@ export default class VelociousDatabaseQueryJoinObject extends JoinBase {
|
|
|
31
31
|
|
|
32
32
|
const modelQuery = /**
|
|
33
33
|
* Narrows the runtime value to the documented type.
|
|
34
|
-
|
|
34
|
+
* @type {import("./model-class-query.js").default} */ (query)
|
|
35
35
|
const ModelClass = /**
|
|
36
36
|
* Narrows the runtime value to the documented type.
|
|
37
|
-
|
|
37
|
+
* @type {typeof import("../record/index.js").default} */ (
|
|
38
38
|
this.basePath.length > 0 ? modelQuery._resolveModelClassForJoinPath(this.basePath) : modelQuery.modelClass
|
|
39
39
|
)
|
|
40
40
|
|
|
@@ -55,7 +55,7 @@ export default class VelociousDatabaseQueryJoinObject extends JoinBase {
|
|
|
55
55
|
const conn = this.getQuery().driver
|
|
56
56
|
const query = /**
|
|
57
57
|
* Narrows the runtime value to the documented type.
|
|
58
|
-
|
|
58
|
+
* @type {import("./model-class-query.js").default} */ (this.getQuery())
|
|
59
59
|
|
|
60
60
|
for (const joinKey in join) {
|
|
61
61
|
const joinValue = join[joinKey]
|
|
@@ -90,7 +90,7 @@ function normalizeScopePath(path) {
|
|
|
90
90
|
function clonePreloadSelectMap(map) {
|
|
91
91
|
/**
|
|
92
92
|
* Result.
|
|
93
|
-
|
|
93
|
+
* @type {Record<string, string[]>} */
|
|
94
94
|
const result = {}
|
|
95
95
|
|
|
96
96
|
for (const [modelName, attributes] of Object.entries(map)) {
|
|
@@ -115,7 +115,7 @@ function normalizePreloadRecord(preload) {
|
|
|
115
115
|
if (Array.isArray(preload)) {
|
|
116
116
|
/**
|
|
117
117
|
* Result.
|
|
118
|
-
|
|
118
|
+
* @type {import("./index.js").NestedPreloadRecord} */
|
|
119
119
|
const result = {}
|
|
120
120
|
|
|
121
121
|
for (const entry of preload) {
|
|
@@ -141,7 +141,7 @@ function normalizePreloadRecord(preload) {
|
|
|
141
141
|
|
|
142
142
|
/**
|
|
143
143
|
* Result.
|
|
144
|
-
|
|
144
|
+
* @type {import("./index.js").NestedPreloadRecord} */
|
|
145
145
|
const result = {}
|
|
146
146
|
|
|
147
147
|
for (const [key, value] of Object.entries(preload)) {
|
|
@@ -190,24 +190,24 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
190
190
|
|
|
191
191
|
/**
|
|
192
192
|
* Narrows the runtime value to the documented type.
|
|
193
|
-
|
|
193
|
+
* @type {MC} */
|
|
194
194
|
this.modelClass = modelClass
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Narrows the runtime value to the documented type.
|
|
198
|
-
|
|
198
|
+
* @type {string[]} */
|
|
199
199
|
this._joinBasePath = args.joinBasePath || []
|
|
200
200
|
this._joinTracker = args.joinTracker || new JoinTracker({modelClass: this.modelClass})
|
|
201
201
|
this._forceQualifyBaseTable = Boolean(args.forceQualifyBaseTable)
|
|
202
202
|
|
|
203
203
|
/**
|
|
204
204
|
* Narrows the runtime value to the documented type.
|
|
205
|
-
|
|
205
|
+
* @type {import("./with-count.js").WithCountEntry[]} */
|
|
206
206
|
this._withCount = args.withCount ? [...args.withCount] : []
|
|
207
207
|
|
|
208
208
|
/**
|
|
209
209
|
* Narrows the runtime value to the documented type.
|
|
210
|
-
|
|
210
|
+
* @type {import("./query-data.js").QueryDataEntry[]} */
|
|
211
211
|
this._queryData = args.queryData ? [...args.queryData] : []
|
|
212
212
|
}
|
|
213
213
|
|
|
@@ -218,7 +218,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
218
218
|
clone() {
|
|
219
219
|
const newQuery = /**
|
|
220
220
|
* Narrows the runtime value to the documented type.
|
|
221
|
-
|
|
221
|
+
* @type {VelociousDatabaseQueryModelClassQuery<MC>} */ (new VelociousDatabaseQueryModelClassQuery({
|
|
222
222
|
driver: this._driverFn,
|
|
223
223
|
froms: [...this._froms],
|
|
224
224
|
handler: this.handler.clone(),
|
|
@@ -340,7 +340,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
340
340
|
|
|
341
341
|
const results = /**
|
|
342
342
|
* Narrows the runtime value to the documented type.
|
|
343
|
-
|
|
343
|
+
* @type {{count: number}[]} */ (await countQuery._executeQuery({
|
|
344
344
|
logName: countQuery.queryLogName("Count")
|
|
345
345
|
}))
|
|
346
346
|
|
|
@@ -376,7 +376,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
376
376
|
].join(" ")
|
|
377
377
|
const results = /**
|
|
378
378
|
* Narrows the runtime value to the documented type.
|
|
379
|
-
|
|
379
|
+
* @type {{count: number}[]} */ (await this.driver.query(
|
|
380
380
|
sql,
|
|
381
381
|
{logName: this.queryLogName("Count")}
|
|
382
382
|
))
|
|
@@ -472,16 +472,16 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
472
472
|
|
|
473
473
|
if (lastFrom && typeof /**
|
|
474
474
|
* Narrows the runtime value to the documented type.
|
|
475
|
-
|
|
476
|
-
return /**
|
|
475
|
+
* @type {?} */ (lastFrom).tableName === "string") {
|
|
476
|
+
return /** @type {?} */ (lastFrom).tableName
|
|
477
477
|
}
|
|
478
478
|
|
|
479
479
|
if (lastFrom && typeof /**
|
|
480
480
|
* Narrows the runtime value to the documented type.
|
|
481
|
-
|
|
481
|
+
* @type {?} */ (lastFrom).plain === "string") {
|
|
482
482
|
const parsedReference = parseFromPlainTableReference(/**
|
|
483
483
|
* Narrows the runtime value to the documented type.
|
|
484
|
-
|
|
484
|
+
* @type {?} */ (lastFrom).plain)
|
|
485
485
|
|
|
486
486
|
if (parsedReference) return parsedReference
|
|
487
487
|
}
|
|
@@ -541,7 +541,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
541
541
|
withJoinPath(joinBasePath) {
|
|
542
542
|
const scopedQuery = /**
|
|
543
543
|
* Narrows the runtime value to the documented type.
|
|
544
|
-
|
|
544
|
+
* @type {VelociousDatabaseQueryModelClassQuery<MC>} */ (this.clone())
|
|
545
545
|
|
|
546
546
|
scopedQuery._joinBasePath = joinBasePath
|
|
547
547
|
scopedQuery._joinTracker = this._joinTracker
|
|
@@ -640,7 +640,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
640
640
|
return this._applyJoinPathScope({
|
|
641
641
|
joinPath: normalizeScopePath(/**
|
|
642
642
|
* Narrows the runtime value to the documented type.
|
|
643
|
-
|
|
643
|
+
* @type {string | string[]} */ (pathOrScopeDescriptor)),
|
|
644
644
|
scopeDescriptor: maybeScopeDescriptor
|
|
645
645
|
})
|
|
646
646
|
}
|
|
@@ -661,7 +661,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
661
661
|
|
|
662
662
|
const scopedQuery = /**
|
|
663
663
|
* Narrows the runtime value to the documented type.
|
|
664
|
-
|
|
664
|
+
* @type {this | void} */ (scopeDescriptor.callback({
|
|
665
665
|
driver: this.driver,
|
|
666
666
|
modelClass: this.getModelClass(),
|
|
667
667
|
query: this,
|
|
@@ -695,7 +695,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
695
695
|
const originalWhereCount = scopedQuery._wheres.length
|
|
696
696
|
const appliedQuery = /**
|
|
697
697
|
* Narrows the runtime value to the documented type.
|
|
698
|
-
|
|
698
|
+
* @type {typeof scopedQuery | void} */ (scopeDescriptor.callback({
|
|
699
699
|
driver: scopedQuery.driver,
|
|
700
700
|
modelClass: targetModelClass,
|
|
701
701
|
path: [...fullJoinPath],
|
|
@@ -744,7 +744,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
744
744
|
buildJoinScopeQuery(targetModelClass, joinPath) {
|
|
745
745
|
const scopedQuery = /**
|
|
746
746
|
* Narrows the runtime value to the documented type.
|
|
747
|
-
|
|
747
|
+
* @type {VelociousDatabaseQueryModelClassQuery<MC>} */ (targetModelClass._newQuery())
|
|
748
748
|
|
|
749
749
|
scopedQuery._joinTracker = this._joinTracker
|
|
750
750
|
scopedQuery._joinBasePath = joinPath
|
|
@@ -812,14 +812,14 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
812
812
|
async find(recordId) {
|
|
813
813
|
/**
|
|
814
814
|
* Conditions.
|
|
815
|
-
|
|
815
|
+
* @type {{[key: string]: number | string}} */
|
|
816
816
|
const conditions = {}
|
|
817
817
|
|
|
818
818
|
conditions[this.getModelClass().primaryKey()] = recordId
|
|
819
819
|
|
|
820
820
|
const newQuery = /**
|
|
821
821
|
* Narrows the runtime value to the documented type.
|
|
822
|
-
|
|
822
|
+
* @type {VelociousDatabaseQueryModelClassQuery<MC>} */ (this.clone())
|
|
823
823
|
|
|
824
824
|
newQuery.where(conditions)
|
|
825
825
|
|
|
@@ -840,7 +840,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
840
840
|
async findBy(conditions) {
|
|
841
841
|
const newQuery = /**
|
|
842
842
|
* Narrows the runtime value to the documented type.
|
|
843
|
-
|
|
843
|
+
* @type {VelociousDatabaseQueryModelClassQuery<MC>} */ (this.clone())
|
|
844
844
|
|
|
845
845
|
newQuery.where(conditions)
|
|
846
846
|
|
|
@@ -892,7 +892,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
892
892
|
const ModelClass = this.getModelClass()
|
|
893
893
|
const newRecord = /**
|
|
894
894
|
* Narrows the runtime value to the documented type.
|
|
895
|
-
|
|
895
|
+
* @type {InstanceType<MC>} */ (new ModelClass(conditions))
|
|
896
896
|
|
|
897
897
|
if (callback) {
|
|
898
898
|
callback(newRecord)
|
|
@@ -947,7 +947,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
947
947
|
const ModelClass = this.getModelClass()
|
|
948
948
|
const model = /**
|
|
949
949
|
* Narrows the runtime value to the documented type.
|
|
950
|
-
|
|
950
|
+
* @type {InstanceType<MC>} */ (new ModelClass())
|
|
951
951
|
|
|
952
952
|
model.loadExistingRecord(result)
|
|
953
953
|
models.push(model)
|
|
@@ -1015,7 +1015,7 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
1015
1015
|
|
|
1016
1016
|
const query = /**
|
|
1017
1017
|
* Narrows the runtime value to the documented type.
|
|
1018
|
-
|
|
1018
|
+
* @type {VelociousDatabaseQueryModelClassQuery<MC>} */ (this.clone())
|
|
1019
1019
|
|
|
1020
1020
|
query._preload = {}
|
|
1021
1021
|
query._selects = []
|
|
@@ -1032,13 +1032,13 @@ export default class VelociousDatabaseQueryModelClassQuery extends DatabaseQuery
|
|
|
1032
1032
|
const [columnName] = columnNames
|
|
1033
1033
|
return rows.map((row) => /**
|
|
1034
1034
|
* Narrows the runtime value to the documented type.
|
|
1035
|
-
|
|
1035
|
+
* @type {Record<string, ?>} */ (row)[columnName])
|
|
1036
1036
|
}
|
|
1037
1037
|
|
|
1038
1038
|
return rows.map((row) => {
|
|
1039
1039
|
const rowHash = /**
|
|
1040
1040
|
* Narrows the runtime value to the documented type.
|
|
1041
|
-
|
|
1041
|
+
* @type {Record<string, ?>} */ (row)
|
|
1042
1042
|
|
|
1043
1043
|
return columnNames.map((columnName) => rowHash[columnName])
|
|
1044
1044
|
})
|
|
@@ -1177,7 +1177,7 @@ function applyRansackGroup({group, query}) {
|
|
|
1177
1177
|
function buildRansackGroupWhere({group, query}) {
|
|
1178
1178
|
/**
|
|
1179
1179
|
* Wheres.
|
|
1180
|
-
|
|
1180
|
+
* @type {import("./where-base.js").default[]} */
|
|
1181
1181
|
const wheres = []
|
|
1182
1182
|
|
|
1183
1183
|
for (const condition of group.conditions) {
|
|
@@ -1212,7 +1212,7 @@ function buildRansackGroupWhere({group, query}) {
|
|
|
1212
1212
|
function buildRansackConditionWhere({condition, query}) {
|
|
1213
1213
|
/**
|
|
1214
1214
|
* Wheres.
|
|
1215
|
-
|
|
1215
|
+
* @type {import("./where-base.js").default[]} */
|
|
1216
1216
|
const wheres = []
|
|
1217
1217
|
|
|
1218
1218
|
for (const attribute of condition.attributes) {
|
|
@@ -1296,7 +1296,7 @@ function buildRansackAttributeHash({attribute, condition}) {
|
|
|
1296
1296
|
function buildNestedRansackHash({attribute, value}) {
|
|
1297
1297
|
/**
|
|
1298
1298
|
* Hash.
|
|
1299
|
-
|
|
1299
|
+
* @type {Record<string, ?>} */
|
|
1300
1300
|
let hash = {[attribute.attributeName]: value}
|
|
1301
1301
|
|
|
1302
1302
|
for (let index = attribute.path.length - 1; index >= 0; index -= 1) {
|
|
@@ -1317,7 +1317,7 @@ function buildNestedRansackHash({attribute, value}) {
|
|
|
1317
1317
|
function buildNestedRansackTupleHash({attribute, operator, value}) {
|
|
1318
1318
|
/**
|
|
1319
1319
|
* Hash.
|
|
1320
|
-
|
|
1320
|
+
* @type {Record<string, ?>} */
|
|
1321
1321
|
let hash = {
|
|
1322
1322
|
[attribute.attributeName]: [[attribute.attributeName, operator, value]]
|
|
1323
1323
|
}
|
|
@@ -1392,11 +1392,11 @@ function resolveColumnName(modelClass, key) {
|
|
|
1392
1392
|
function splitWhereHash({hash, modelClass}) {
|
|
1393
1393
|
/**
|
|
1394
1394
|
* Resolved hash.
|
|
1395
|
-
|
|
1395
|
+
* @type {Record<string, ?>} */
|
|
1396
1396
|
const resolvedHash = {}
|
|
1397
1397
|
/**
|
|
1398
1398
|
* Fallback hash.
|
|
1399
|
-
|
|
1399
|
+
* @type {Record<string, ?>} */
|
|
1400
1400
|
const fallbackHash = {}
|
|
1401
1401
|
|
|
1402
1402
|
for (const key in hash) {
|
|
@@ -1454,7 +1454,7 @@ function splitWhereHash({hash, modelClass}) {
|
|
|
1454
1454
|
function buildJoinObjectFromWhereHash({hash, modelClass}) {
|
|
1455
1455
|
/**
|
|
1456
1456
|
* Join object.
|
|
1457
|
-
|
|
1457
|
+
* @type {Record<string, ?>} */
|
|
1458
1458
|
const joinObject = {}
|
|
1459
1459
|
|
|
1460
1460
|
for (const key in hash) {
|
|
@@ -1495,10 +1495,10 @@ function normalizeRelationshipWhereOperator(operator) {
|
|
|
1495
1495
|
">=": "gteq"
|
|
1496
1496
|
}
|
|
1497
1497
|
|
|
1498
|
-
return /**
|
|
1498
|
+
return /** @type {"eq" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | "like"} */ (
|
|
1499
1499
|
operatorAliases[/**
|
|
1500
1500
|
* Narrows the runtime value to the documented type.
|
|
1501
|
-
|
|
1501
|
+
* @type {"<" | "<=" | ">" | ">="} */ (operator)] || operator
|
|
1502
1502
|
)
|
|
1503
1503
|
}
|
|
1504
1504
|
|
|
@@ -1529,7 +1529,7 @@ function normalizeRelationshipWhereOperatorTuples(value) {
|
|
|
1529
1529
|
|
|
1530
1530
|
/**
|
|
1531
1531
|
* Normalized.
|
|
1532
|
-
|
|
1532
|
+
* @type {Array<[string, "eq" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | "like", unknown]>} */
|
|
1533
1533
|
const normalized = []
|
|
1534
1534
|
/**
|
|
1535
1535
|
* Add condition.
|
|
@@ -1539,7 +1539,7 @@ function normalizeRelationshipWhereOperatorTuples(value) {
|
|
|
1539
1539
|
if (isRelationshipWhereOperatorTuple(conditionValue)) {
|
|
1540
1540
|
const tuple = /**
|
|
1541
1541
|
* Narrows the runtime value to the documented type.
|
|
1542
|
-
|
|
1542
|
+
* @type {[string, "eq" | "notEq" | "gt" | "gteq" | "lt" | "lteq" | "like" | ">" | ">=" | "<" | "<=", unknown, ...Array<unknown>]} */ (conditionValue)
|
|
1543
1543
|
const normalizedOperator = normalizeRelationshipWhereOperator(tuple[1])
|
|
1544
1544
|
|
|
1545
1545
|
normalized.push([
|
|
@@ -1563,7 +1563,7 @@ function normalizeRelationshipWhereOperatorTuples(value) {
|
|
|
1563
1563
|
|
|
1564
1564
|
/**
|
|
1565
1565
|
* Narrows the runtime value to the documented type.
|
|
1566
|
-
|
|
1566
|
+
* @type {Array<?>} */ (conditionValue).forEach((nestedConditionValue) => {
|
|
1567
1567
|
addCondition(nestedConditionValue)
|
|
1568
1568
|
})
|
|
1569
1569
|
}
|