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
|
@@ -20,15 +20,15 @@ import Update from "./sql/update.js"
|
|
|
20
20
|
export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
21
21
|
/**
|
|
22
22
|
* Version major.
|
|
23
|
-
|
|
23
|
+
* @type {number | undefined} */
|
|
24
24
|
versionMajor = undefined
|
|
25
25
|
/**
|
|
26
26
|
* Version minor.
|
|
27
|
-
|
|
27
|
+
* @type {number | undefined} */
|
|
28
28
|
versionMinor = undefined
|
|
29
29
|
/**
|
|
30
30
|
* Version patch.
|
|
31
|
-
|
|
31
|
+
* @type {number | undefined} */
|
|
32
32
|
versionPatch = undefined
|
|
33
33
|
|
|
34
34
|
/**
|
|
@@ -89,7 +89,7 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
89
89
|
async dropTableSQLs(tableName, args = {}) {
|
|
90
90
|
const driver = /**
|
|
91
91
|
* Narrows the runtime value to the documented type.
|
|
92
|
-
|
|
92
|
+
* @type {import("../base.js").default} */ (this)
|
|
93
93
|
const dropArgs = Object.assign({tableName, driver}, args)
|
|
94
94
|
const dropTable = new DropTable(dropArgs)
|
|
95
95
|
|
|
@@ -128,7 +128,7 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
128
128
|
for (const row of result) {
|
|
129
129
|
const table = new Table({driver: this, row: /**
|
|
130
130
|
* Narrows the runtime value to the documented type.
|
|
131
|
-
|
|
131
|
+
* @type {Record<string, string | number | null>} */ (row)})
|
|
132
132
|
|
|
133
133
|
tables.push(table)
|
|
134
134
|
}
|
|
@@ -162,15 +162,15 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
162
162
|
supportsMultipleInsertValues() {
|
|
163
163
|
/**
|
|
164
164
|
* Version major.
|
|
165
|
-
|
|
165
|
+
* @type {number} */
|
|
166
166
|
const versionMajor = this.versionMajor || 0
|
|
167
167
|
/**
|
|
168
168
|
* Version minor.
|
|
169
|
-
|
|
169
|
+
* @type {number} */
|
|
170
170
|
const versionMinor = this.versionMinor || 0
|
|
171
171
|
/**
|
|
172
172
|
* Version patch.
|
|
173
|
-
|
|
173
|
+
* @type {number} */
|
|
174
174
|
const versionPatch = this.versionPatch || 0
|
|
175
175
|
|
|
176
176
|
if (versionMajor >= 4) return true
|
|
@@ -187,11 +187,11 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
187
187
|
supportsInsertIntoReturning() {
|
|
188
188
|
/**
|
|
189
189
|
* Version major.
|
|
190
|
-
|
|
190
|
+
* @type {number} */
|
|
191
191
|
const versionMajor = this.versionMajor || 0
|
|
192
192
|
/**
|
|
193
193
|
* Version minor.
|
|
194
|
-
|
|
194
|
+
* @type {number} */
|
|
195
195
|
const versionMinor = this.versionMinor || 0
|
|
196
196
|
|
|
197
197
|
if (versionMajor >= 4) return true
|
|
@@ -225,13 +225,13 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
225
225
|
this._assertNotReadOnly()
|
|
226
226
|
/**
|
|
227
227
|
* Sqls.
|
|
228
|
-
|
|
228
|
+
* @type {string[]} */
|
|
229
229
|
const sqls = []
|
|
230
230
|
|
|
231
231
|
for (const row of rows) {
|
|
232
232
|
/**
|
|
233
233
|
* Data.
|
|
234
|
-
|
|
234
|
+
* @type {Record<string, ?>} */
|
|
235
235
|
const data = {}
|
|
236
236
|
|
|
237
237
|
for (const columnIndex in columns) {
|
|
@@ -340,7 +340,7 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
340
340
|
|
|
341
341
|
const type = typeof value
|
|
342
342
|
|
|
343
|
-
if (type == "number") return /**
|
|
343
|
+
if (type == "number") return /** @type {number} */ (value)
|
|
344
344
|
if (type != "string") value = String(value)
|
|
345
345
|
|
|
346
346
|
return escapeString(value, null)
|
|
@@ -398,11 +398,11 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
398
398
|
const waiters = state.waitersByName.get(name) || []
|
|
399
399
|
/**
|
|
400
400
|
* Timeout handle.
|
|
401
|
-
|
|
401
|
+
* @type {NodeJS.Timeout | null} */
|
|
402
402
|
let timeoutHandle = null
|
|
403
403
|
/**
|
|
404
404
|
* Remove and resolve.
|
|
405
|
-
|
|
405
|
+
* @type {(() => void) | null} */
|
|
406
406
|
let removeAndResolve = null
|
|
407
407
|
|
|
408
408
|
removeAndResolve = () => {
|
|
@@ -411,7 +411,7 @@ export default class VelociousDatabaseDriversSqliteBase extends Base {
|
|
|
411
411
|
const current = state.waitersByName.get(name) || []
|
|
412
412
|
const index = current.indexOf(/**
|
|
413
413
|
* Narrows the runtime value to the documented type.
|
|
414
|
-
|
|
414
|
+
* @type {() => void} */ (removeAndResolve))
|
|
415
415
|
|
|
416
416
|
if (index >= 0) current.splice(index, 1)
|
|
417
417
|
if (current.length === 0) state.waitersByName.delete(name)
|
|
@@ -15,12 +15,12 @@ import fileExists from "../../../utils/file-exists.js"
|
|
|
15
15
|
export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
16
16
|
/**
|
|
17
17
|
* Connection.
|
|
18
|
-
|
|
18
|
+
* @type {import("sqlite3").Database | undefined} */
|
|
19
19
|
connection = undefined
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Advisory lock directory.
|
|
23
|
-
|
|
23
|
+
* @type {string | undefined} */
|
|
24
24
|
_advisoryLockDirectory = undefined
|
|
25
25
|
|
|
26
26
|
async connect() {
|
|
@@ -40,7 +40,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
40
40
|
|
|
41
41
|
try {
|
|
42
42
|
// @ts-expect-error
|
|
43
|
-
this.connection = /**
|
|
43
|
+
this.connection = /** @type {import("sqlite3").Database} */ (await open({
|
|
44
44
|
filename: databasePath,
|
|
45
45
|
driver: sqlite3.Database
|
|
46
46
|
}))
|
|
@@ -176,7 +176,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
176
176
|
|
|
177
177
|
/**
|
|
178
178
|
* Runs resolve advisory lock directory.
|
|
179
|
-
|
|
179
|
+
* @returns {string} */
|
|
180
180
|
_resolveAdvisoryLockDirectory() {
|
|
181
181
|
if (!this._advisoryLockDirectory) {
|
|
182
182
|
// Fall back to deriving the directory for callers that invoked
|
|
@@ -203,7 +203,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
203
203
|
|
|
204
204
|
/**
|
|
205
205
|
* Runs ensure advisory lock directory.
|
|
206
|
-
|
|
206
|
+
* @returns {Promise<void>} */
|
|
207
207
|
async _ensureAdvisoryLockDirectory() {
|
|
208
208
|
await fs.mkdir(this._resolveAdvisoryLockDirectory(), {recursive: true})
|
|
209
209
|
}
|
|
@@ -249,7 +249,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
249
249
|
} catch (error) {
|
|
250
250
|
if (/**
|
|
251
251
|
* Narrows the runtime value to the documented type.
|
|
252
|
-
|
|
252
|
+
* @type {NodeJS.ErrnoException} */ (error)?.code !== "EEXIST") throw error
|
|
253
253
|
|
|
254
254
|
if (await this._isAdvisoryLockStale(lockPath)) {
|
|
255
255
|
await fs.rm(lockPath, {recursive: true, force: true})
|
|
@@ -287,7 +287,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
287
287
|
} catch (error) {
|
|
288
288
|
if (/**
|
|
289
289
|
* Narrows the runtime value to the documented type.
|
|
290
|
-
|
|
290
|
+
* @type {NodeJS.ErrnoException} */ (error)?.code !== "EEXIST") throw error
|
|
291
291
|
|
|
292
292
|
if (await this._isAdvisoryLockStale(lockPath)) {
|
|
293
293
|
await fs.rm(lockPath, {recursive: true, force: true})
|
|
@@ -300,7 +300,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
300
300
|
} catch (retryError) {
|
|
301
301
|
if (/**
|
|
302
302
|
* Narrows the runtime value to the documented type.
|
|
303
|
-
|
|
303
|
+
* @type {NodeJS.ErrnoException} */ (retryError)?.code === "EEXIST") return false
|
|
304
304
|
|
|
305
305
|
throw retryError
|
|
306
306
|
}
|
|
@@ -356,7 +356,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
356
356
|
async _isAdvisoryLockStale(lockPath) {
|
|
357
357
|
/**
|
|
358
358
|
* Defines rawOwner.
|
|
359
|
-
|
|
359
|
+
* @type {string} */
|
|
360
360
|
let rawOwner
|
|
361
361
|
|
|
362
362
|
try {
|
|
@@ -368,7 +368,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
368
368
|
|
|
369
369
|
/**
|
|
370
370
|
* Defines owner.
|
|
371
|
-
|
|
371
|
+
* @type {{pid?: number, hostname?: string}} */
|
|
372
372
|
let owner
|
|
373
373
|
|
|
374
374
|
try {
|
|
@@ -388,7 +388,7 @@ export default class VelociousDatabaseDriversSqliteNode extends Base {
|
|
|
388
388
|
|
|
389
389
|
return false
|
|
390
390
|
} catch (error) {
|
|
391
|
-
return /**
|
|
391
|
+
return /** @type {NodeJS.ErrnoException} */ (error)?.code === "ESRCH"
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
394
|
}
|
|
@@ -41,7 +41,7 @@ export default class VelociousDatabaseDriversSqliteNative extends Base {
|
|
|
41
41
|
const args = this.getArgs()
|
|
42
42
|
/**
|
|
43
43
|
* Connect args.
|
|
44
|
-
|
|
44
|
+
* @type {Record<string, ?>} */
|
|
45
45
|
const connectArgs = {}
|
|
46
46
|
const forward = ["database", "host", "password"]
|
|
47
47
|
|
|
@@ -14,11 +14,11 @@ import Base from "./base.js"
|
|
|
14
14
|
export default class VelociousDatabaseDriversSqliteWeb extends Base {
|
|
15
15
|
/**
|
|
16
16
|
* Better local storage.
|
|
17
|
-
|
|
17
|
+
* @type {BetterLocalStorage | undefined} */
|
|
18
18
|
betterLocalStorage = undefined
|
|
19
19
|
/**
|
|
20
20
|
* Connection.
|
|
21
|
-
|
|
21
|
+
* @type {ConnectionSqlJs | undefined} */
|
|
22
22
|
_connection = undefined
|
|
23
23
|
|
|
24
24
|
/**
|
|
@@ -64,7 +64,7 @@ export default class VelociousDatabaseDriversSqliteWeb extends Base {
|
|
|
64
64
|
*/
|
|
65
65
|
getConnection() {
|
|
66
66
|
if (this.args?.getConnection) {
|
|
67
|
-
return /**
|
|
67
|
+
return /** @type {SqliteWebConnection} */ (this.args.getConnection())
|
|
68
68
|
} else {
|
|
69
69
|
if (!this._connection) throw new Error("SQLite web connection has not been initialized")
|
|
70
70
|
return this._connection
|
|
@@ -79,13 +79,13 @@ export default class VelociousDatabaseConnectionDriversSqliteSqlAlterTable exten
|
|
|
79
79
|
const targetTableData = new TableData(currentTableData.getName())
|
|
80
80
|
/**
|
|
81
81
|
* Column pairs.
|
|
82
|
-
|
|
82
|
+
* @type {Array<[string, string]>} */
|
|
83
83
|
const columnPairs = []
|
|
84
84
|
const alterColumns = alterTableData.getColumns()
|
|
85
85
|
const existingNames = new Set(currentTableData.getColumns().map((column) => column.getName()))
|
|
86
86
|
/**
|
|
87
87
|
* Column renames.
|
|
88
|
-
|
|
88
|
+
* @type {Map<string, string>} */
|
|
89
89
|
const columnRenames = new Map()
|
|
90
90
|
|
|
91
91
|
for (const alterColumn of alterColumns) {
|
|
@@ -73,7 +73,7 @@ export default class VelociousDatabaseDriversSqliteTable extends BaseTable {
|
|
|
73
73
|
|
|
74
74
|
const indexData = /**
|
|
75
75
|
* Narrows the runtime value to the documented type.
|
|
76
|
-
|
|
76
|
+
* @type {typeof columnsIndex.data & {columnNames?: string[]}} */ (columnsIndex.data)
|
|
77
77
|
|
|
78
78
|
indexData.columnNames = this._parseColumnsFromSQL(String(sql))
|
|
79
79
|
|
package/src/database/migrator.js
CHANGED
|
@@ -10,7 +10,7 @@ import TableData from "./table-data/index.js"
|
|
|
10
10
|
export default class VelociousDatabaseMigrator {
|
|
11
11
|
/**
|
|
12
12
|
* Migrations versions.
|
|
13
|
-
|
|
13
|
+
* @type {Record<string, Record<string, boolean>>} */
|
|
14
14
|
migrationsVersions = {}
|
|
15
15
|
|
|
16
16
|
/**
|
|
@@ -158,7 +158,7 @@ export default class VelociousDatabaseMigrator {
|
|
|
158
158
|
async migrateFilesFromRequireContext(requireContext) {
|
|
159
159
|
/**
|
|
160
160
|
* Files.
|
|
161
|
-
|
|
161
|
+
* @type {import("./migrator/types.js").MigrationObjectType[]} */
|
|
162
162
|
let files = []
|
|
163
163
|
|
|
164
164
|
for (const file of requireContext.keys()) {
|
|
@@ -289,7 +289,7 @@ export default class VelociousDatabaseMigrator {
|
|
|
289
289
|
|
|
290
290
|
/**
|
|
291
291
|
* Files.
|
|
292
|
-
|
|
292
|
+
* @type {import("./migrator/types.js").MigrationObjectType[]} */
|
|
293
293
|
let files = []
|
|
294
294
|
|
|
295
295
|
for (const file of migrationFiles) {
|
|
@@ -303,7 +303,7 @@ export default class VelociousDatabaseMigrator {
|
|
|
303
303
|
|
|
304
304
|
const migrationObject = /**
|
|
305
305
|
* Narrows the runtime value to the documented type.
|
|
306
|
-
|
|
306
|
+
* @type {import("./migrator/types.js").MigrationObjectType} */ ({
|
|
307
307
|
file,
|
|
308
308
|
date,
|
|
309
309
|
migrationClassName
|
|
@@ -404,7 +404,7 @@ export default class VelociousDatabaseMigrator {
|
|
|
404
404
|
|
|
405
405
|
/**
|
|
406
406
|
* Defines highestVersion.
|
|
407
|
-
|
|
407
|
+
* @type {string | undefined} */
|
|
408
408
|
let highestVersion
|
|
409
409
|
|
|
410
410
|
for (const dbIdentifier in this.migrationsVersions) {
|
|
@@ -436,7 +436,7 @@ export default class VelociousDatabaseMigrator {
|
|
|
436
436
|
|
|
437
437
|
/**
|
|
438
438
|
* Db identifiers needing migration versions.
|
|
439
|
-
|
|
439
|
+
* @type {string[]} */
|
|
440
440
|
const dbIdentifiersNeedingMigrationVersions = []
|
|
441
441
|
|
|
442
442
|
// migrateFiles() wraps execution in ensureConnections(), so the current
|
|
@@ -43,32 +43,32 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Connections.
|
|
46
|
-
|
|
46
|
+
* @type {import("../drivers/base.js").default[]} */
|
|
47
47
|
connections = []
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Connections in use.
|
|
51
|
-
|
|
51
|
+
* @type {Record<number, import("../drivers/base.js").default>} */
|
|
52
52
|
connectionsInUse = {}
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Pending checkouts.
|
|
56
|
-
|
|
56
|
+
* @type {PendingCheckout[]} */
|
|
57
57
|
pendingCheckouts = []
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
60
|
* Connections being spawned.
|
|
61
|
-
|
|
61
|
+
* @type {number} */
|
|
62
62
|
connectionsBeingSpawned = 0
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Pending checkout drain promise.
|
|
66
|
-
|
|
66
|
+
* @type {Promise<void> | undefined} */
|
|
67
67
|
pendingCheckoutDrainPromise = undefined
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* Idle connection reaper timer.
|
|
71
|
-
|
|
71
|
+
* @type {ReturnType<typeof setTimeout> | undefined} */
|
|
72
72
|
idleConnectionReaperTimer = undefined
|
|
73
73
|
|
|
74
74
|
/**
|
|
@@ -101,7 +101,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
101
101
|
super({configuration, identifier})
|
|
102
102
|
this._withoutCurrentConnectionContext = /**
|
|
103
103
|
* Narrows the runtime value to the documented type.
|
|
104
|
-
|
|
104
|
+
* @type {(callback: () => ?) => ?} */ ((callback) => this.asyncLocalStorage.run(undefined, callback))
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|
|
@@ -113,7 +113,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
113
113
|
const id = connection.getIdSeq()
|
|
114
114
|
const trackedConnection = /**
|
|
115
115
|
* Narrows the runtime value to the documented type.
|
|
116
|
-
|
|
116
|
+
* @type {import("../drivers/base.js").default & {[CLOSED_CONNECTION]?: boolean, [CONNECTION_CHECKED_OUT_AT]?: number, [IDLE_CONNECTION_CHECKED_IN_AT]?: number}} */ (connection)
|
|
117
117
|
|
|
118
118
|
if (trackedConnection[CLOSED_CONNECTION]) {
|
|
119
119
|
this.untrackConnectionInUse(connection, id)
|
|
@@ -245,7 +245,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
245
245
|
connectionMatchesReuseKey(connection, reuseKey) {
|
|
246
246
|
const connectionWithPoolKey = /**
|
|
247
247
|
* Narrows the runtime value to the documented type.
|
|
248
|
-
|
|
248
|
+
* @type {import("../drivers/base.js").default & {[POOL_CONFIGURATION_KEY]?: string}} */ (connection)
|
|
249
249
|
|
|
250
250
|
return connectionWithPoolKey[POOL_CONFIGURATION_KEY] === reuseKey
|
|
251
251
|
}
|
|
@@ -263,7 +263,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
263
263
|
|
|
264
264
|
const trackedConnection = /**
|
|
265
265
|
* Narrows the runtime value to the documented type.
|
|
266
|
-
|
|
266
|
+
* @type {import("../drivers/base.js").default & {[CONNECTION_CHECKED_OUT_AT]?: number, [IDLE_CONNECTION_CHECKED_IN_AT]?: number}} */ (connection)
|
|
267
267
|
delete trackedConnection[IDLE_CONNECTION_CHECKED_IN_AT]
|
|
268
268
|
trackedConnection[CONNECTION_CHECKED_OUT_AT] = Date.now()
|
|
269
269
|
|
|
@@ -364,7 +364,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
364
364
|
const connection = await this.spawnConnectionWithConfiguration(databaseConfig)
|
|
365
365
|
const connectionWithPoolKey = /**
|
|
366
366
|
* Narrows the runtime value to the documented type.
|
|
367
|
-
|
|
367
|
+
* @type {import("../drivers/base.js").default & {[POOL_CONFIGURATION_KEY]?: string}} */ (connection)
|
|
368
368
|
|
|
369
369
|
connectionWithPoolKey[POOL_CONFIGURATION_KEY] = reuseKey
|
|
370
370
|
connection.setSchemaCacheInvalidator(() => {
|
|
@@ -711,7 +711,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
711
711
|
setGlobalConnection(connection) {
|
|
712
712
|
const klass = /**
|
|
713
713
|
* Narrows the runtime value to the documented type.
|
|
714
|
-
|
|
714
|
+
* @type {typeof VelociousDatabasePoolAsyncTrackedMultiConnection} */ (this.constructor)
|
|
715
715
|
let mapForConfiguration = klass.globalConnections.get(this.configuration)
|
|
716
716
|
|
|
717
717
|
if (!mapForConfiguration) {
|
|
@@ -752,7 +752,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
752
752
|
|
|
753
753
|
/**
|
|
754
754
|
* Runs clear test shared connection.
|
|
755
|
-
|
|
755
|
+
* @returns {void} */
|
|
756
756
|
clearTestSharedConnection() {
|
|
757
757
|
this._testSharedConnection = undefined
|
|
758
758
|
}
|
|
@@ -798,7 +798,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
798
798
|
debugConnectionSnapshots(now) {
|
|
799
799
|
/**
|
|
800
800
|
* Connections.
|
|
801
|
-
|
|
801
|
+
* @type {Array<Record<string, ?>>} */
|
|
802
802
|
const connections = []
|
|
803
803
|
const seenConnections = new Set()
|
|
804
804
|
|
|
@@ -818,7 +818,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
818
818
|
for (const [id, connection] of Object.entries(this.connectionsInUse)) {
|
|
819
819
|
const trackedConnection = /**
|
|
820
820
|
* Narrows the runtime value to the documented type.
|
|
821
|
-
|
|
821
|
+
* @type {import("../drivers/base.js").default & {[CONNECTION_CHECKED_OUT_AT]?: number}} */ (connection)
|
|
822
822
|
const checkedOutAt = trackedConnection[CONNECTION_CHECKED_OUT_AT]
|
|
823
823
|
const checkedOutForMs = typeof checkedOutAt === "number" ? Math.max(0, now - checkedOutAt) : undefined
|
|
824
824
|
|
|
@@ -840,7 +840,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
840
840
|
|
|
841
841
|
const trackedConnection = /**
|
|
842
842
|
* Narrows the runtime value to the documented type.
|
|
843
|
-
|
|
843
|
+
* @type {import("../drivers/base.js").default & {[IDLE_CONNECTION_CHECKED_IN_AT]?: number}} */ (connection)
|
|
844
844
|
const checkedInAt = trackedConnection[IDLE_CONNECTION_CHECKED_IN_AT]
|
|
845
845
|
const idleForMs = typeof checkedInAt === "number" ? Math.max(0, now - checkedInAt) : undefined
|
|
846
846
|
|
|
@@ -908,7 +908,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
908
908
|
getGlobalConnectionForIdentifier() {
|
|
909
909
|
const klass = /**
|
|
910
910
|
* Narrows the runtime value to the documented type.
|
|
911
|
-
|
|
911
|
+
* @type {typeof VelociousDatabasePoolAsyncTrackedMultiConnection} */ (this.constructor)
|
|
912
912
|
const mapForConfiguration = klass.globalConnections.get(this.configuration)
|
|
913
913
|
|
|
914
914
|
return mapForConfiguration?.[this.identifier]
|
|
@@ -921,7 +921,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
921
921
|
clearGlobalConnectionForIdentifier() {
|
|
922
922
|
const klass = /**
|
|
923
923
|
* Narrows the runtime value to the documented type.
|
|
924
|
-
|
|
924
|
+
* @type {typeof VelociousDatabasePoolAsyncTrackedMultiConnection} */ (this.constructor)
|
|
925
925
|
const mapForConfiguration = klass.globalConnections.get(this.configuration)
|
|
926
926
|
|
|
927
927
|
if (!mapForConfiguration) return
|
|
@@ -970,14 +970,14 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
970
970
|
|
|
971
971
|
/**
|
|
972
972
|
* Runs schedule idle connection reaper.
|
|
973
|
-
|
|
973
|
+
* @returns {void} */
|
|
974
974
|
scheduleIdleConnectionReaper() {
|
|
975
975
|
if (this.idleConnectionReaperTimer) return
|
|
976
976
|
if (!this.hasIdleConnectionsToReap()) return
|
|
977
977
|
|
|
978
978
|
const delay = this.nextIdleConnectionReapDelay(/**
|
|
979
979
|
* Narrows the runtime value to the documented type.
|
|
980
|
-
|
|
980
|
+
* @type {number} */ (this.idleTimeoutMillis()))
|
|
981
981
|
|
|
982
982
|
this.idleConnectionReaperTimer = setTimeout(() => {
|
|
983
983
|
this.idleConnectionReaperTimer = undefined
|
|
@@ -1013,7 +1013,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
1013
1013
|
|
|
1014
1014
|
const trackedConnection = /**
|
|
1015
1015
|
* Narrows the runtime value to the documented type.
|
|
1016
|
-
|
|
1016
|
+
* @type {import("../drivers/base.js").default & {[IDLE_CONNECTION_CHECKED_IN_AT]?: number}} */ (connection)
|
|
1017
1017
|
const checkedInAt = trackedConnection[IDLE_CONNECTION_CHECKED_IN_AT]
|
|
1018
1018
|
|
|
1019
1019
|
if (typeof checkedInAt !== "number") continue
|
|
@@ -1072,11 +1072,11 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
1072
1072
|
classifyIdleConnectionsForReaping({idleTimeoutMillis, now}) {
|
|
1073
1073
|
/**
|
|
1074
1074
|
* Kept connections.
|
|
1075
|
-
|
|
1075
|
+
* @type {import("../drivers/base.js").default[]} */
|
|
1076
1076
|
const keptConnections = []
|
|
1077
1077
|
/**
|
|
1078
1078
|
* Expired connections.
|
|
1079
|
-
|
|
1079
|
+
* @type {import("../drivers/base.js").default[]} */
|
|
1080
1080
|
const expiredConnections = []
|
|
1081
1081
|
|
|
1082
1082
|
for (const connection of this.connections) {
|
|
@@ -1111,7 +1111,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
1111
1111
|
connectionIsClosed(connection) {
|
|
1112
1112
|
const trackedConnection = /**
|
|
1113
1113
|
* Narrows the runtime value to the documented type.
|
|
1114
|
-
|
|
1114
|
+
* @type {import("../drivers/base.js").default & {[CLOSED_CONNECTION]?: boolean}} */ (connection)
|
|
1115
1115
|
|
|
1116
1116
|
return Boolean(trackedConnection[CLOSED_CONNECTION])
|
|
1117
1117
|
}
|
|
@@ -1124,7 +1124,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
1124
1124
|
idleConnectionExpired({connection, idleTimeoutMillis, now}) {
|
|
1125
1125
|
const trackedConnection = /**
|
|
1126
1126
|
* Narrows the runtime value to the documented type.
|
|
1127
|
-
|
|
1127
|
+
* @type {import("../drivers/base.js").default & {[IDLE_CONNECTION_CHECKED_IN_AT]?: number}} */ (connection)
|
|
1128
1128
|
const checkedInAt = trackedConnection[IDLE_CONNECTION_CHECKED_IN_AT]
|
|
1129
1129
|
|
|
1130
1130
|
return typeof checkedInAt === "number" && now - checkedInAt >= idleTimeoutMillis
|
|
@@ -1176,7 +1176,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
1176
1176
|
|
|
1177
1177
|
const trackedConnection = /**
|
|
1178
1178
|
* Narrows the runtime value to the documented type.
|
|
1179
|
-
|
|
1179
|
+
* @type {import("../drivers/base.js").default & {[CLOSED_CONNECTION]?: boolean, [CONNECTION_CHECKED_OUT_AT]?: number, [IDLE_CONNECTION_CHECKED_IN_AT]?: number}} */ (connection)
|
|
1180
1180
|
|
|
1181
1181
|
trackedConnection[CLOSED_CONNECTION] = true
|
|
1182
1182
|
delete trackedConnection[CONNECTION_CHECKED_OUT_AT]
|
|
@@ -1198,7 +1198,7 @@ export default class VelociousDatabasePoolAsyncTrackedMultiConnection extends Ba
|
|
|
1198
1198
|
|
|
1199
1199
|
/**
|
|
1200
1200
|
* Runs clear idle connection reaper timer.
|
|
1201
|
-
|
|
1201
|
+
* @returns {void} */
|
|
1202
1202
|
clearIdleConnectionReaperTimer() {
|
|
1203
1203
|
if (!this.idleConnectionReaperTimer) return
|
|
1204
1204
|
|
|
@@ -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`)
|