velocious 1.0.449 → 1.0.451
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- 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-types.js +3 -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 +836 -60
- 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-types.d.ts +12 -2
- package/build/src/configuration-types.d.ts.map +1 -1
- package/build/src/configuration-types.js +4 -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 +285 -12
- 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 +712 -61
- 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 +67 -59
- 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-types.js +3 -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 +836 -60
- 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,11 +20,11 @@
|
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Defines this typedef.
|
|
23
|
-
|
|
23
|
+
* @typedef {{_receiveBroadcast: (message: import("./types.js").BeaconBroadcastMessage) => void}} InProcessPeer */
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* Peers.
|
|
27
|
-
|
|
27
|
+
* @type {Set<InProcessPeer>} */
|
|
28
28
|
const peers = new Set()
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -37,7 +37,7 @@ export default class InProcessBeaconClient extends EventEmitter {
|
|
|
37
37
|
this._connected = false
|
|
38
38
|
/**
|
|
39
39
|
* Narrows the runtime value to the documented type.
|
|
40
|
-
|
|
40
|
+
* @type {(() => void) | undefined} */
|
|
41
41
|
this._unregister = undefined
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -94,7 +94,7 @@ export default class InProcessBeaconClient extends EventEmitter {
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Message.
|
|
97
|
-
|
|
97
|
+
* @type {import("./types.js").BeaconBroadcastMessage} */
|
|
98
98
|
const message = {
|
|
99
99
|
type: "broadcast",
|
|
100
100
|
channel,
|
package/build/beacon/server.js
CHANGED
|
@@ -31,11 +31,11 @@ export default class BeaconServer {
|
|
|
31
31
|
this.logger = new Logger(this)
|
|
32
32
|
/**
|
|
33
33
|
* Narrows the runtime value to the documented type.
|
|
34
|
-
|
|
34
|
+
* @type {Set<JsonSocket>} */
|
|
35
35
|
this.peers = new Set()
|
|
36
36
|
/**
|
|
37
37
|
* Narrows the runtime value to the documented type.
|
|
38
|
-
|
|
38
|
+
* @type {net.Server | undefined} */
|
|
39
39
|
this.server = undefined
|
|
40
40
|
/**
|
|
41
41
|
* Accepted sockets, including connections that have not completed the hello handshake yet.
|
|
@@ -110,7 +110,7 @@ export default class BeaconServer {
|
|
|
110
110
|
const jsonSocket = new JsonSocket(socket)
|
|
111
111
|
/**
|
|
112
112
|
* Defines peerId.
|
|
113
|
-
|
|
113
|
+
* @type {string | undefined} */
|
|
114
114
|
let peerId
|
|
115
115
|
|
|
116
116
|
const cleanup = () => {
|
package/build/cli/browser-cli.js
CHANGED
|
@@ -21,7 +21,7 @@ export default class VelociousBrowserCli {
|
|
|
21
21
|
enable() {
|
|
22
22
|
/**
|
|
23
23
|
* Global scope.
|
|
24
|
-
|
|
24
|
+
* @type {typeof globalThis & {velociousCLI?: VelociousBrowserCli}} */
|
|
25
25
|
const globalScope = globalThis
|
|
26
26
|
|
|
27
27
|
globalScope.velociousCLI = this
|
|
@@ -4,12 +4,12 @@ import {digg} from "diggerize"
|
|
|
4
4
|
export default class DbBaseCommand extends BaseCommand {
|
|
5
5
|
/**
|
|
6
6
|
* Narrows the runtime value to the documented type.
|
|
7
|
-
|
|
7
|
+
* @type {import("../../../database/drivers/base.js").default | undefined} */
|
|
8
8
|
databaseConnection
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Narrows the runtime value to the documented type.
|
|
12
|
-
|
|
12
|
+
* @type {Array<object> | undefined} */
|
|
13
13
|
result
|
|
14
14
|
|
|
15
15
|
/**
|
package/build/cli/index.js
CHANGED
|
@@ -88,11 +88,11 @@ export default class VelociousCli {
|
|
|
88
88
|
const commandNames = new Set(commands.map((command) => command.name))
|
|
89
89
|
/**
|
|
90
90
|
* Groups.
|
|
91
|
-
|
|
91
|
+
* @type {string[][]} */
|
|
92
92
|
const groups = []
|
|
93
93
|
/**
|
|
94
94
|
* Current group.
|
|
95
|
-
|
|
95
|
+
* @type {string[]} */
|
|
96
96
|
let currentGroup = []
|
|
97
97
|
|
|
98
98
|
for (const processArg of processArgs) {
|
|
@@ -18,7 +18,7 @@ export default class TenantDatabaseCommandHelper {
|
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Runs validate tenant database identifier.
|
|
21
|
-
|
|
21
|
+
* @returns {void} */
|
|
22
22
|
validateTenantDatabaseIdentifier() {
|
|
23
23
|
const databaseConfiguration = this.configuration.getDatabaseConfiguration()[this.identifier]
|
|
24
24
|
|
|
@@ -88,7 +88,7 @@ export default class TenantDatabaseCommandHelper {
|
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Failures.
|
|
91
|
-
|
|
91
|
+
* @type {Array<{error: Error, tenant: ?}>} */
|
|
92
92
|
const failures = []
|
|
93
93
|
const workers = []
|
|
94
94
|
let tenantIndex = 0
|
|
@@ -186,7 +186,7 @@ export default class TenantDatabaseCommandHelper {
|
|
|
186
186
|
if (tenant && typeof tenant === "object") {
|
|
187
187
|
const tenantObject = /**
|
|
188
188
|
* Narrows the runtime value to the documented type.
|
|
189
|
-
|
|
189
|
+
* @type {{id?: ?, name?: ?, slug?: ?}} */ (tenant)
|
|
190
190
|
|
|
191
191
|
if (tenantObject.slug) return String(tenantObject.slug)
|
|
192
192
|
if (tenantObject.name) return String(tenantObject.name)
|
|
@@ -263,6 +263,8 @@
|
|
|
263
263
|
* @property {string} [columnType] - Alias for column type name.
|
|
264
264
|
* @property {string} [sqlType] - Alias for column type name.
|
|
265
265
|
* @property {string} [dataType] - Alias for column type name.
|
|
266
|
+
* @property {string} [jsDocType] - Exact generated JSDoc type for non-column attributes.
|
|
267
|
+
* @property {string} [name] - Attribute name when configured as an array entry.
|
|
266
268
|
* @property {boolean} [null] - Whether value can be null.
|
|
267
269
|
* @property {boolean} [selectedByDefault] - Whether included in default serialization. Defaults to true.
|
|
268
270
|
*/
|
|
@@ -274,7 +276,7 @@
|
|
|
274
276
|
|
|
275
277
|
/**
|
|
276
278
|
* @typedef {object} FrontendModelResourceConfiguration
|
|
277
|
-
* @property {string
|
|
279
|
+
* @property {Array<string | FrontendModelAttributeConfiguration> | Record<string, FrontendModelAttributeConfiguration | import("./database/drivers/base-column.js").default | boolean>} attributes - Attributes to expose on the frontend model.
|
|
278
280
|
* @property {string[]} [abilities] - Ability action list (camelCase action names). Defaults to `["read"]` for `find` and `index` when omitted.
|
|
279
281
|
* @property {Record<string, FrontendModelAttachmentConfiguration>} [attachments] - Attachment helpers keyed by attachment name.
|
|
280
282
|
* @property {string[]} [commands] - Legacy built-in command names (`index`, `find`, `create`, `update`, `destroy`, `attach`, `download`, `url`).
|
package/build/configuration.js
CHANGED
|
@@ -32,7 +32,7 @@ export {CurrentConfigurationNotSetError}
|
|
|
32
32
|
function currentWorkingDirectory() {
|
|
33
33
|
const processObject = /**
|
|
34
34
|
* Types the following value.
|
|
35
|
-
|
|
35
|
+
* @type {{cwd?: ?} | undefined} */ (globalThis.process)
|
|
36
36
|
|
|
37
37
|
if (typeof processObject?.cwd !== "function") return undefined
|
|
38
38
|
|
|
@@ -51,11 +51,11 @@ function canonicalDebugSnapshotValue(value) {
|
|
|
51
51
|
return Object.keys(value).sort().reduce((result, key) => {
|
|
52
52
|
result[key] = canonicalDebugSnapshotValue(/**
|
|
53
53
|
* Types the following value.
|
|
54
|
-
|
|
54
|
+
* @type {Record<string, ?>} */ (value)[key])
|
|
55
55
|
return result
|
|
56
56
|
}, /**
|
|
57
57
|
* Types the following value.
|
|
58
|
-
|
|
58
|
+
* @type {Record<string, ?>} */ ({}))
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -95,7 +95,7 @@ function resolveBeaconUnreachableReportMs(value) {
|
|
|
95
95
|
export default class VelociousConfiguration {
|
|
96
96
|
/**
|
|
97
97
|
* Close database connections promise.
|
|
98
|
-
|
|
98
|
+
* @type {Promise<void> | null} */
|
|
99
99
|
_closeDatabaseConnectionsPromise = null
|
|
100
100
|
/**
|
|
101
101
|
* Runs current.
|
|
@@ -119,11 +119,11 @@ export default class VelociousConfiguration {
|
|
|
119
119
|
this._beacon = beacon
|
|
120
120
|
/**
|
|
121
121
|
* Stores the beacon client value.
|
|
122
|
-
|
|
122
|
+
* @type {import("./beacon/client.js").default | import("./beacon/in-process-client.js").default | undefined} */
|
|
123
123
|
this._beaconClient = undefined
|
|
124
124
|
/**
|
|
125
125
|
* Stores the beacon connect promise value.
|
|
126
|
-
|
|
126
|
+
* @type {Promise<import("./beacon/client.js").default | import("./beacon/in-process-client.js").default | undefined> | undefined} */
|
|
127
127
|
this._beaconConnectPromise = undefined
|
|
128
128
|
/**
|
|
129
129
|
* Stores the beacon report timer value.
|
|
@@ -160,7 +160,7 @@ export default class VelociousConfiguration {
|
|
|
160
160
|
this.httpServer = httpServer || {}
|
|
161
161
|
/**
|
|
162
162
|
* Stores the http server instance value.
|
|
163
|
-
|
|
163
|
+
* @type {{getDebugSnapshot: () => Promise<Record<string, ?>>} | undefined} */
|
|
164
164
|
this._httpServerInstance = undefined
|
|
165
165
|
this.locale = locale
|
|
166
166
|
this.localeFallbacks = localeFallbacks
|
|
@@ -177,18 +177,18 @@ export default class VelociousConfiguration {
|
|
|
177
177
|
this._websocketEvents = undefined
|
|
178
178
|
/**
|
|
179
179
|
* Stores the websocket channel subscribers value.
|
|
180
|
-
|
|
180
|
+
* @type {VelociousWebsocketChannelSubscribers | undefined} */
|
|
181
181
|
this._websocketChannelSubscribers = undefined
|
|
182
182
|
this._websocketChannelResolver = websocketChannelResolver
|
|
183
183
|
this._websocketMessageHandlerResolver = websocketMessageHandlerResolver
|
|
184
184
|
/**
|
|
185
185
|
* Stores the websocket connection classes value.
|
|
186
|
-
|
|
186
|
+
* @type {Map<string, typeof import("./http-server/websocket-connection.js").default>} */
|
|
187
187
|
this._websocketConnectionClasses = new Map()
|
|
188
188
|
|
|
189
189
|
/**
|
|
190
190
|
* Stores the websocket channel classes value.
|
|
191
|
-
|
|
191
|
+
* @type {Map<string, typeof import("./http-server/websocket-channel.js").default>} */
|
|
192
192
|
this._websocketChannelClasses = new Map()
|
|
193
193
|
|
|
194
194
|
/**
|
|
@@ -223,12 +223,12 @@ export default class VelociousConfiguration {
|
|
|
223
223
|
|
|
224
224
|
/**
|
|
225
225
|
* Stores the around action value.
|
|
226
|
-
|
|
226
|
+
* @type {((context: {request: import("./http-server/client/request.js").default | import("./http-server/client/websocket-request.js").default, response: import("./http-server/client/response.js").default, next: () => Promise<void>}) => Promise<void>) | null} */
|
|
227
227
|
this._aroundAction = null
|
|
228
228
|
|
|
229
229
|
/**
|
|
230
230
|
* Stores the websocket session identity resolver value.
|
|
231
|
-
|
|
231
|
+
* @type {((session: import("./http-server/client/websocket-session.js").default) => ? | Promise<?>) | null} */
|
|
232
232
|
this._websocketSessionIdentityResolver = null
|
|
233
233
|
this._logging = logging
|
|
234
234
|
this._mailerBackend = mailerBackend
|
|
@@ -237,18 +237,18 @@ export default class VelociousConfiguration {
|
|
|
237
237
|
|
|
238
238
|
/**
|
|
239
239
|
* Stores the applied route mounts value.
|
|
240
|
-
|
|
240
|
+
* @type {WeakSet<object>} */
|
|
241
241
|
this._appliedRouteMounts = new WeakSet()
|
|
242
242
|
this._errorEvents = new EventEmitter()
|
|
243
243
|
|
|
244
244
|
/**
|
|
245
245
|
* Stores the database pools value.
|
|
246
|
-
|
|
246
|
+
* @type {{[key: string]: import("./database/pool/base.js").default}} */
|
|
247
247
|
this.databasePools = {}
|
|
248
248
|
|
|
249
249
|
/**
|
|
250
250
|
* Stores the model classes value.
|
|
251
|
-
|
|
251
|
+
* @type {{[key: string]: typeof import("./database/record/index.js").default}} */
|
|
252
252
|
this.modelClasses = {}
|
|
253
253
|
|
|
254
254
|
this.getEnvironmentHandler().setConfiguration(this)
|
|
@@ -498,7 +498,7 @@ export default class VelociousConfiguration {
|
|
|
498
498
|
async _debugHttpServerSnapshot() {
|
|
499
499
|
const httpServer = /**
|
|
500
500
|
* Types the following value.
|
|
501
|
-
|
|
501
|
+
* @type {{getDebugSnapshot?: () => Promise<Record<string, ?>>} | undefined} */ (this._httpServerInstance)
|
|
502
502
|
|
|
503
503
|
if (!httpServer?.getDebugSnapshot) {
|
|
504
504
|
return {configured: Boolean(this.httpServer), active: false}
|
|
@@ -561,7 +561,7 @@ export default class VelociousConfiguration {
|
|
|
561
561
|
_debugDatabaseSnapshot() {
|
|
562
562
|
/**
|
|
563
563
|
* Database pools.
|
|
564
|
-
|
|
564
|
+
* @type {Record<string, import("./database/pool/base.js").DatabasePoolDebugSnapshot>} */
|
|
565
565
|
const databasePools = {}
|
|
566
566
|
const activeIdentifiers = this.getDatabaseIdentifiers()
|
|
567
567
|
|
|
@@ -584,22 +584,22 @@ export default class VelociousConfiguration {
|
|
|
584
584
|
_debugWebsocketSnapshot() {
|
|
585
585
|
/**
|
|
586
586
|
* Session buckets.
|
|
587
|
-
|
|
587
|
+
* @type {Map<string, {count: number, details: {channelSubscriptionCount: number, channelSubscriptions: {channelType: string, count: number, model: string | null}[], connectionCount: number, paused: boolean, subscriptionCount: number}}>} */
|
|
588
588
|
const sessionBuckets = new Map()
|
|
589
589
|
/**
|
|
590
590
|
* Session details.
|
|
591
|
-
|
|
591
|
+
* @type {{channelSubscriptionCount: number, channelSubscriptions: {channelType: string, count: number, model: string | null}[], connectionCount: number, paused: boolean, queuedMessageCount: number, subscriptionCount: number}[]} */
|
|
592
592
|
const sessionDetails = []
|
|
593
593
|
const subscriptions = Array.from(this._websocketChannelSubscriptions.entries()).map(([channel, channelSubscriptions]) => {
|
|
594
594
|
/**
|
|
595
595
|
* Details buckets.
|
|
596
|
-
|
|
596
|
+
* @type {Map<string, {count: number, details: Record<string, ?>}>} */
|
|
597
597
|
const detailsBuckets = new Map()
|
|
598
598
|
|
|
599
599
|
for (const subscription of channelSubscriptions) {
|
|
600
600
|
const details = /**
|
|
601
601
|
* Types the following value.
|
|
602
|
-
|
|
602
|
+
* @type {Record<string, ?>} */ (canonicalDebugSnapshotValue(subscription.debugSnapshot()))
|
|
603
603
|
const key = JSON.stringify(details)
|
|
604
604
|
const existingBucket = detailsBuckets.get(key)
|
|
605
605
|
|
|
@@ -620,13 +620,13 @@ export default class VelociousConfiguration {
|
|
|
620
620
|
for (const session of this._websocketSessions) {
|
|
621
621
|
/**
|
|
622
622
|
* Channel subscription buckets.
|
|
623
|
-
|
|
623
|
+
* @type {Map<string, {channelType: string, count: number, model: string | null}>} */
|
|
624
624
|
const channelSubscriptionBuckets = new Map()
|
|
625
625
|
|
|
626
626
|
for (const {channelType, subscription} of session._channelSubscriptions.values()) {
|
|
627
627
|
const details = /**
|
|
628
628
|
* Types the following value.
|
|
629
|
-
|
|
629
|
+
* @type {Record<string, ?>} */ (subscription.debugSnapshot())
|
|
630
630
|
const model = typeof details.model === "string" ? details.model : null
|
|
631
631
|
const key = JSON.stringify({channelType, model})
|
|
632
632
|
const existingBucket = channelSubscriptionBuckets.get(key)
|
|
@@ -973,7 +973,7 @@ export default class VelociousConfiguration {
|
|
|
973
973
|
|
|
974
974
|
/**
|
|
975
975
|
* Default levels.
|
|
976
|
-
|
|
976
|
+
* @type {Array<"debug-low-level" | "debug" | "info" | "warn" | "error">} */
|
|
977
977
|
const defaultLevels = ["info", "warn", "error"]
|
|
978
978
|
|
|
979
979
|
if (includeLowLevelDebug) defaultLevels.unshift("debug-low-level")
|
|
@@ -1363,7 +1363,7 @@ export default class VelociousConfiguration {
|
|
|
1363
1363
|
_deliverBroadcastFromBeacon(message) {
|
|
1364
1364
|
/**
|
|
1365
1365
|
* Websocket events.
|
|
1366
|
-
|
|
1366
|
+
* @type {?} */
|
|
1367
1367
|
const websocketEvents = this._websocketEvents
|
|
1368
1368
|
|
|
1369
1369
|
if (websocketEvents && typeof websocketEvents.broadcastV2 === "function") {
|
|
@@ -1675,7 +1675,7 @@ export default class VelociousConfiguration {
|
|
|
1675
1675
|
|
|
1676
1676
|
const modelClass = /**
|
|
1677
1677
|
* Types the following value.
|
|
1678
|
-
|
|
1678
|
+
* @type {typeof import("./database/record/index.js").default | undefined} */ (this.modelClasses[modelName])
|
|
1679
1679
|
|
|
1680
1680
|
if (!modelClass) continue
|
|
1681
1681
|
|
|
@@ -1794,7 +1794,7 @@ export default class VelociousConfiguration {
|
|
|
1794
1794
|
|
|
1795
1795
|
/**
|
|
1796
1796
|
* Runs get translator.
|
|
1797
|
-
|
|
1797
|
+
* @returns {(msgID: string, args?: Record<string, ?>) => string} */
|
|
1798
1798
|
getTranslator() {
|
|
1799
1799
|
if (this._translator) return this._translator
|
|
1800
1800
|
|
|
@@ -2037,7 +2037,7 @@ export default class VelociousConfiguration {
|
|
|
2037
2037
|
|
|
2038
2038
|
/**
|
|
2039
2039
|
* Runs get websocket session identity resolver.
|
|
2040
|
-
|
|
2040
|
+
* @returns {((session: import("./http-server/client/websocket-session.js").default) => ? | Promise<?>) | null} */
|
|
2041
2041
|
getWebsocketSessionIdentityResolver() {
|
|
2042
2042
|
return this._websocketSessionIdentityResolver
|
|
2043
2043
|
}
|
|
@@ -2155,7 +2155,7 @@ export default class VelociousConfiguration {
|
|
|
2155
2155
|
// so fall through to the local dispatch.
|
|
2156
2156
|
/**
|
|
2157
2157
|
* Websocket events.
|
|
2158
|
-
|
|
2158
|
+
* @type {?} */
|
|
2159
2159
|
const websocketEvents = this._websocketEvents
|
|
2160
2160
|
|
|
2161
2161
|
if (websocketEvents && typeof websocketEvents.broadcastV2 === "function") {
|
|
@@ -2181,7 +2181,7 @@ export default class VelociousConfiguration {
|
|
|
2181
2181
|
async awaitPendingBroadcasts() {
|
|
2182
2182
|
/**
|
|
2183
2183
|
* Websocket events.
|
|
2184
|
-
|
|
2184
|
+
* @type {?} */
|
|
2185
2185
|
const websocketEvents = this._websocketEvents
|
|
2186
2186
|
|
|
2187
2187
|
if (websocketEvents && typeof websocketEvents.awaitPendingBroadcasts === "function") {
|
|
@@ -2424,16 +2424,16 @@ export default class VelociousConfiguration {
|
|
|
2424
2424
|
const name = typeof optionsOrCallback == "function" ? "Configuration.withConnections" : (optionsOrCallback.name || "Configuration.withConnections")
|
|
2425
2425
|
/**
|
|
2426
2426
|
* Actual with connections callback.
|
|
2427
|
-
|
|
2427
|
+
* @type {WithConnectionsCallbackType<T> | undefined} */
|
|
2428
2428
|
const actualWithConnectionsCallback = typeof optionsOrCallback == "function" ? /**
|
|
2429
2429
|
* Types the following value.
|
|
2430
|
-
|
|
2430
|
+
* @type {WithConnectionsCallbackType<T>} */ (optionsOrCallback) : callback
|
|
2431
2431
|
|
|
2432
2432
|
if (!actualWithConnectionsCallback) throw new Error("withConnections requires a callback")
|
|
2433
2433
|
|
|
2434
2434
|
/**
|
|
2435
2435
|
* Dbs.
|
|
2436
|
-
|
|
2436
|
+
* @type {{[key: string]: import("./database/drivers/base.js").default}} */
|
|
2437
2437
|
const dbs = {}
|
|
2438
2438
|
|
|
2439
2439
|
const stack = Error().stack
|
|
@@ -2445,7 +2445,7 @@ export default class VelociousConfiguration {
|
|
|
2445
2445
|
|
|
2446
2446
|
/**
|
|
2447
2447
|
* Run request.
|
|
2448
|
-
|
|
2448
|
+
* @type {() => Promise<T>} */
|
|
2449
2449
|
let runRequest = actualCallback
|
|
2450
2450
|
|
|
2451
2451
|
for (const identifier of this.getDatabaseIdentifiers()) {
|
|
@@ -2472,7 +2472,7 @@ export default class VelociousConfiguration {
|
|
|
2472
2472
|
getCurrentConnections() {
|
|
2473
2473
|
/**
|
|
2474
2474
|
* Dbs.
|
|
2475
|
-
|
|
2475
|
+
* @type {{[key: string]: import("./database/drivers/base.js").default}} */
|
|
2476
2476
|
const dbs = {}
|
|
2477
2477
|
|
|
2478
2478
|
for (const identifier of this.getDatabaseIdentifiers()) {
|
|
@@ -2539,10 +2539,10 @@ export default class VelociousConfiguration {
|
|
|
2539
2539
|
const name = typeof optionsOrCallback == "function" ? "Configuration.ensureConnections" : (optionsOrCallback.name || "Configuration.ensureConnections")
|
|
2540
2540
|
/**
|
|
2541
2541
|
* Actual with connections callback.
|
|
2542
|
-
|
|
2542
|
+
* @type {WithConnectionsCallbackType<T> | undefined} */
|
|
2543
2543
|
const actualWithConnectionsCallback = typeof optionsOrCallback == "function" ? /**
|
|
2544
2544
|
* Types the following value.
|
|
2545
|
-
|
|
2545
|
+
* @type {WithConnectionsCallbackType<T>} */ (optionsOrCallback) : callback
|
|
2546
2546
|
|
|
2547
2547
|
if (!actualWithConnectionsCallback) throw new Error("ensureConnections requires a callback")
|
|
2548
2548
|
|
|
@@ -2579,7 +2579,7 @@ export default class VelociousConfiguration {
|
|
|
2579
2579
|
|
|
2580
2580
|
const poolConstructor = /**
|
|
2581
2581
|
* Types the following value.
|
|
2582
|
-
|
|
2582
|
+
* @type {{clearGlobalConnections?: (configuration: VelociousConfiguration) => void}} */ (pool.constructor)
|
|
2583
2583
|
|
|
2584
2584
|
if (typeof poolConstructor?.clearGlobalConnections === "function") {
|
|
2585
2585
|
constructors.add(poolConstructor)
|
package/build/controller.js
CHANGED
|
@@ -21,7 +21,7 @@ export default class VelociousController {
|
|
|
21
21
|
if (!this._beforeActions) {
|
|
22
22
|
/**
|
|
23
23
|
* Stores the before actions value.
|
|
24
|
-
|
|
24
|
+
* @type {Array<string>} */
|
|
25
25
|
this._beforeActions = []
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -102,7 +102,7 @@ export default class VelociousController {
|
|
|
102
102
|
const {encrypted = false, ...options} = args
|
|
103
103
|
/**
|
|
104
104
|
* Types the following value.
|
|
105
|
-
|
|
105
|
+
* @type {string} */
|
|
106
106
|
let cookieValue
|
|
107
107
|
|
|
108
108
|
if (encrypted) {
|
|
@@ -143,7 +143,7 @@ export default class VelociousController {
|
|
|
143
143
|
_getControllerClass() {
|
|
144
144
|
const controllerClass = /**
|
|
145
145
|
* Types the following value.
|
|
146
|
-
|
|
146
|
+
* @type {typeof VelociousController} */ (this.constructor)
|
|
147
147
|
|
|
148
148
|
return controllerClass
|
|
149
149
|
}
|
|
@@ -161,9 +161,9 @@ export default class VelociousController {
|
|
|
161
161
|
if (beforeActions) {
|
|
162
162
|
const controllerPrototype = /**
|
|
163
163
|
* Types the following value.
|
|
164
|
-
|
|
164
|
+
* @type {Record<string, Function | undefined>} */ (/**
|
|
165
165
|
* Types the following value.
|
|
166
|
-
|
|
166
|
+
* @type {?} */ (currentControllerClass.prototype))
|
|
167
167
|
|
|
168
168
|
for (const beforeActionName of beforeActions) {
|
|
169
169
|
const beforeAction = controllerPrototype[beforeActionName]
|
|
@@ -209,7 +209,7 @@ export default class VelociousController {
|
|
|
209
209
|
try {
|
|
210
210
|
/**
|
|
211
211
|
* Unparsed params.
|
|
212
|
-
|
|
212
|
+
* @type {Record<string, ?>} */
|
|
213
213
|
const unparsedParams = querystring.parse(query)
|
|
214
214
|
const paramsToObject = new ParamsToObject(unparsedParams)
|
|
215
215
|
|
|
@@ -217,7 +217,7 @@ export default class VelociousController {
|
|
|
217
217
|
} catch (error) {
|
|
218
218
|
const ensuredError = /**
|
|
219
219
|
* Types the following value.
|
|
220
|
-
|
|
220
|
+
* @type {Error & {velociousContext?: Record<string, ?>}} */ (error)
|
|
221
221
|
|
|
222
222
|
ensuredError.velociousContext = {
|
|
223
223
|
...(ensuredError.velociousContext || {}),
|
|
@@ -297,7 +297,7 @@ export default class VelociousController {
|
|
|
297
297
|
if (err) {
|
|
298
298
|
const renderError = /**
|
|
299
299
|
* Types the following value.
|
|
300
|
-
|
|
300
|
+
* @type {Error & {code?: string}} */ (err)
|
|
301
301
|
|
|
302
302
|
if (renderError.code === "ENOENT") {
|
|
303
303
|
this.logger.warn(`Missing view file: ${viewPath}`)
|
|
@@ -4,12 +4,12 @@ import {AsyncLocalStorage} from "node:async_hooks"
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Defines asyncLocalStorage.
|
|
7
|
-
|
|
7
|
+
* @type {import("node:async_hooks").AsyncLocalStorage<string[]> | undefined} */
|
|
8
8
|
let asyncLocalStorage
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Database annotations global.
|
|
12
|
-
|
|
12
|
+
* @type {typeof globalThis & {velociousDatabaseAnnotations?: {getDatabaseAnnotations: () => string[], withDatabaseAnnotation: (annotation: string, callback: () => Promise<?>) => Promise<?>}}} */
|
|
13
13
|
const databaseAnnotationsGlobal = globalThis
|
|
14
14
|
|
|
15
15
|
if (AsyncLocalStorage) {
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Defines this typedef.
|
|
5
|
-
|
|
5
|
+
* @typedef {{getDatabaseAnnotations?: () => string[], withDatabaseAnnotation?: (annotation: string, callback: () => Promise<?>) => Promise<?>}} DatabaseAnnotationsRuntime */
|
|
6
6
|
/**
|
|
7
7
|
* Database annotations global.
|
|
8
|
-
|
|
8
|
+
* @type {typeof globalThis & {velociousDatabaseAnnotations?: DatabaseAnnotationsRuntime}} */
|
|
9
9
|
const databaseAnnotationsGlobal = globalThis
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -31,7 +31,7 @@ async function withDatabaseAnnotation(annotation, callback) {
|
|
|
31
31
|
const runtime = databaseAnnotationsGlobal.velociousDatabaseAnnotations
|
|
32
32
|
|
|
33
33
|
if (runtime && runtime.withDatabaseAnnotation) {
|
|
34
|
-
return /**
|
|
34
|
+
return /** @type {T} */ (await runtime.withDatabaseAnnotation(annotation, callback))
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
return await callback()
|
|
@@ -6,7 +6,7 @@ import TableData from "../table-data/index.js"
|
|
|
6
6
|
export default class VelociousDatabaseDriversBaseColumn {
|
|
7
7
|
/**
|
|
8
8
|
* Table.
|
|
9
|
-
|
|
9
|
+
* @type {import("./base-table.js").default | undefined} */
|
|
10
10
|
table = undefined
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -5,7 +5,7 @@ import TableForeignKey from "../table-data/table-foreign-key.js"
|
|
|
5
5
|
export default class VelociousDatabaseDriversBaseForeignKey {
|
|
6
6
|
/**
|
|
7
7
|
* Table.
|
|
8
|
-
|
|
8
|
+
* @type {import("./base-table.js").default | undefined} */
|
|
9
9
|
table = undefined
|
|
10
10
|
|
|
11
11
|
/**
|