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
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Named status aliases.
|
|
5
|
-
|
|
5
|
+
* @type {Record<string, number>} */
|
|
6
6
|
const NAMED_STATUS_ALIASES = {
|
|
7
7
|
"success": 200,
|
|
8
8
|
"not-found": 404,
|
|
@@ -11,7 +11,7 @@ const NAMED_STATUS_ALIASES = {
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Standard status messages.
|
|
14
|
-
|
|
14
|
+
* @type {Record<number, string>} */
|
|
15
15
|
const STANDARD_STATUS_MESSAGES = {
|
|
16
16
|
100: "Continue",
|
|
17
17
|
101: "Switching Protocols",
|
|
@@ -80,17 +80,17 @@ const STANDARD_STATUS_MESSAGES = {
|
|
|
80
80
|
export default class VelociousHttpServerClientResponse {
|
|
81
81
|
/**
|
|
82
82
|
* Body.
|
|
83
|
-
|
|
83
|
+
* @type {string | Uint8Array | null} */
|
|
84
84
|
body = null
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
87
|
* File path.
|
|
88
|
-
|
|
88
|
+
* @type {string | null} */
|
|
89
89
|
filePath = null
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* Headers.
|
|
93
|
-
|
|
93
|
+
* @type {Record<string, string[]>} */
|
|
94
94
|
headers = {}
|
|
95
95
|
|
|
96
96
|
/**
|
|
@@ -21,16 +21,16 @@ export default class VelociousHttpServerClientWebsocketRequest {
|
|
|
21
21
|
this.body = body
|
|
22
22
|
/**
|
|
23
23
|
* Narrows the runtime value to the documented type.
|
|
24
|
-
|
|
24
|
+
* @type {Record<string, string>} */
|
|
25
25
|
this.headersMap = {}
|
|
26
26
|
/**
|
|
27
27
|
* Narrows the runtime value to the documented type.
|
|
28
|
-
|
|
28
|
+
* @type {Record<string, ?>} */
|
|
29
29
|
this.metadataObject = metadata ? {...metadata} : {}
|
|
30
30
|
this.method = method.toUpperCase()
|
|
31
31
|
/**
|
|
32
32
|
* Narrows the runtime value to the documented type.
|
|
33
|
-
|
|
33
|
+
* @type {Record<string, ?>} */
|
|
34
34
|
this.paramsObject = {}
|
|
35
35
|
this._path = path
|
|
36
36
|
this.remoteAddressValue = remoteAddress
|
|
@@ -131,7 +131,7 @@ export default class VelociousHttpServerClientWebsocketRequest {
|
|
|
131
131
|
const parsedQuery = querystring.parse(query)
|
|
132
132
|
/**
|
|
133
133
|
* Params.
|
|
134
|
-
|
|
134
|
+
* @type {Record<string, string | string[]>} */
|
|
135
135
|
const params = Object.create(null)
|
|
136
136
|
|
|
137
137
|
for (const key of Object.keys(parsedQuery)) {
|
|
@@ -40,7 +40,7 @@ function subscribeMessage(message) {
|
|
|
40
40
|
return message.type === "subscribe"
|
|
41
41
|
? /**
|
|
42
42
|
* Narrows the runtime value to the documented type.
|
|
43
|
-
|
|
43
|
+
* @type {{type: "subscribe", channel: string, lastEventId?: string, params?: Record<string, ?>}} */ (message)
|
|
44
44
|
: null
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -52,7 +52,7 @@ function subscribeMessage(message) {
|
|
|
52
52
|
function requestMessage(message) {
|
|
53
53
|
if (message.type && message.type !== "request") return null
|
|
54
54
|
|
|
55
|
-
return /**
|
|
55
|
+
return /** @type {{type?: "request", body?: ?, headers?: Record<string, ?>, id?: string | number | null, method: string, path: string}} */ (message)
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
/**
|
|
@@ -86,7 +86,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
86
86
|
channelReplayStates = new Map()
|
|
87
87
|
/**
|
|
88
88
|
* Message queue.
|
|
89
|
-
|
|
89
|
+
* @type {WebsocketSessionMessage[]} */
|
|
90
90
|
messageQueue = []
|
|
91
91
|
|
|
92
92
|
/**
|
|
@@ -110,7 +110,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* Narrows the runtime value to the documented type.
|
|
113
|
-
|
|
113
|
+
* @type {Record<string, ?>} */
|
|
114
114
|
this._metadata = {}
|
|
115
115
|
|
|
116
116
|
/**
|
|
@@ -123,12 +123,12 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
123
123
|
|
|
124
124
|
/**
|
|
125
125
|
* Narrows the runtime value to the documented type.
|
|
126
|
-
|
|
126
|
+
* @type {Map<string, import("../websocket-connection.js").default>} */
|
|
127
127
|
this._connections = new Map()
|
|
128
128
|
|
|
129
129
|
/**
|
|
130
130
|
* Narrows the runtime value to the documented type.
|
|
131
|
-
|
|
131
|
+
* @type {Map<string, {channelType: string, subscription: import("../websocket-channel.js").default}>} */
|
|
132
132
|
this._channelSubscriptions = new Map()
|
|
133
133
|
|
|
134
134
|
/**
|
|
@@ -154,7 +154,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Narrows the runtime value to the documented type.
|
|
157
|
-
|
|
157
|
+
* @type {import("./index.js").default | null} */
|
|
158
158
|
this.socket = null
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -464,7 +464,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
464
464
|
if (message.type === "metadata") {
|
|
465
465
|
const metadataPayload = /**
|
|
466
466
|
* Narrows the runtime value to the documented type.
|
|
467
|
-
|
|
467
|
+
* @type {{data?: Record<string, ?>}} */ (message)
|
|
468
468
|
|
|
469
469
|
this._metadata = metadataPayload.data && typeof metadataPayload.data === "object" ? {...metadataPayload.data} : {}
|
|
470
470
|
|
|
@@ -590,7 +590,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
590
590
|
|
|
591
591
|
if (this.buffer.length < offset + maskLength + payloadLength) return
|
|
592
592
|
|
|
593
|
-
/**
|
|
593
|
+
/** @type {Buffer} */
|
|
594
594
|
let payload = this.buffer.slice(offset + maskLength, offset + maskLength + payloadLength)
|
|
595
595
|
|
|
596
596
|
if (isMasked) {
|
|
@@ -658,11 +658,11 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
658
658
|
|
|
659
659
|
/**
|
|
660
660
|
* Defines finalPayload.
|
|
661
|
-
|
|
661
|
+
* @type {Buffer} */
|
|
662
662
|
let finalPayload
|
|
663
663
|
/**
|
|
664
664
|
* Defines finalOpcode.
|
|
665
|
-
|
|
665
|
+
* @type {number} */
|
|
666
666
|
let finalOpcode
|
|
667
667
|
|
|
668
668
|
if (this._fragmentedPayloads !== null) {
|
|
@@ -753,7 +753,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
753
753
|
|
|
754
754
|
/**
|
|
755
755
|
* Runs reset fragment buffer.
|
|
756
|
-
|
|
756
|
+
* @returns {void} */
|
|
757
757
|
_resetFragmentBuffer() {
|
|
758
758
|
this._fragmentedPayloads = null
|
|
759
759
|
this._fragmentedOpcode = null
|
|
@@ -1149,7 +1149,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
1149
1149
|
this.logger.error(() => [`Failed to open connection ${connectionType}:${connectionId}`, error])
|
|
1150
1150
|
this.sendJson({type: "connection-error", connectionId, message: /**
|
|
1151
1151
|
* Narrows the runtime value to the documented type.
|
|
1152
|
-
|
|
1152
|
+
* @type {Error} */ (error).message || "Failed to open connection"})
|
|
1153
1153
|
}
|
|
1154
1154
|
}
|
|
1155
1155
|
|
|
@@ -1175,7 +1175,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
1175
1175
|
this.logger.error(() => [`Failed to handle connection-message for ${connectionId}`, error])
|
|
1176
1176
|
this.sendJson({type: "connection-error", connectionId, message: /**
|
|
1177
1177
|
* Narrows the runtime value to the documented type.
|
|
1178
|
-
|
|
1178
|
+
* @type {Error} */ (error).message || "Failed to handle message"})
|
|
1179
1179
|
}
|
|
1180
1180
|
}
|
|
1181
1181
|
|
|
@@ -1288,7 +1288,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
1288
1288
|
this.logger.error(() => [`Failed to subscribe channel ${channelType}:${subscriptionId}`, error])
|
|
1289
1289
|
this.sendJson({type: "channel-error", subscriptionId, message: /**
|
|
1290
1290
|
* Narrows the runtime value to the documented type.
|
|
1291
|
-
|
|
1291
|
+
* @type {Error} */ (error).message || "Failed to subscribe"})
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
1294
1294
|
|
|
@@ -1333,7 +1333,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
1333
1333
|
|
|
1334
1334
|
subscription.sendMessage(/**
|
|
1335
1335
|
* Narrows the runtime value to the documented type.
|
|
1336
|
-
|
|
1336
|
+
* @type {import("../websocket-channel.js").WebsocketJsonValue} */ (event.payload))
|
|
1337
1337
|
}
|
|
1338
1338
|
}
|
|
1339
1339
|
|
|
@@ -1609,7 +1609,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
1609
1609
|
...(params && typeof params === "object" ? params : {})
|
|
1610
1610
|
}
|
|
1611
1611
|
|
|
1612
|
-
return /**
|
|
1612
|
+
return /** @type {Promise<string | null | undefined>} */ (this.configuration.resolveTenant({
|
|
1613
1613
|
params: mergedParams,
|
|
1614
1614
|
request: this.upgradeRequest,
|
|
1615
1615
|
response: undefined,
|
|
@@ -1626,7 +1626,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
1626
1626
|
_unmaskPayload(payload, mask) {
|
|
1627
1627
|
/**
|
|
1628
1628
|
* Result.
|
|
1629
|
-
|
|
1629
|
+
* @type {Buffer} */
|
|
1630
1630
|
const result = Buffer.alloc(payload.length)
|
|
1631
1631
|
|
|
1632
1632
|
for (let i = 0; i < payload.length; i++) {
|
|
@@ -39,17 +39,17 @@ export default class VelociousHttpServerDevelopmentReloader {
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Narrows the runtime value to the documented type.
|
|
42
|
-
|
|
42
|
+
* @type {ReturnType<typeof setTimeout> | undefined} */
|
|
43
43
|
this.reloadTimer = undefined
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Narrows the runtime value to the documented type.
|
|
47
|
-
|
|
47
|
+
* @type {string | undefined} */
|
|
48
48
|
this.pendingChangedPath = undefined
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Narrows the runtime value to the documented type.
|
|
52
|
-
|
|
52
|
+
* @type {Map<string, import("fs").FSWatcher>} */
|
|
53
53
|
this.watchers = new Map()
|
|
54
54
|
}
|
|
55
55
|
|
|
@@ -98,7 +98,7 @@ export default class VelociousHttpServerDevelopmentReloader {
|
|
|
98
98
|
} catch (error) {
|
|
99
99
|
if (/**
|
|
100
100
|
* Narrows the runtime value to the documented type.
|
|
101
|
-
|
|
101
|
+
* @type {{code?: string}} */ (error)?.code === "ENOENT") return
|
|
102
102
|
throw error
|
|
103
103
|
}
|
|
104
104
|
|
|
@@ -172,7 +172,7 @@ export default class VelociousHttpServerDevelopmentReloader {
|
|
|
172
172
|
} catch (error) {
|
|
173
173
|
if (/**
|
|
174
174
|
* Narrows the runtime value to the documented type.
|
|
175
|
-
|
|
175
|
+
* @type {{code?: string}} */ (error)?.code !== "ENOENT") {
|
|
176
176
|
throw error
|
|
177
177
|
}
|
|
178
178
|
}
|
package/src/http-server/index.js
CHANGED
|
@@ -11,10 +11,10 @@ import WorkerHandler from "./worker-handler/index.js"
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Defines this typedef.
|
|
14
|
-
|
|
14
|
+
* @typedef {{start: () => Promise<void>, stop: () => Promise<void>}} DevelopmentReloaderLike */
|
|
15
15
|
/**
|
|
16
16
|
* Defines this typedef.
|
|
17
|
-
|
|
17
|
+
* @typedef {function({configuration: import("../configuration.js").default, workerCount: number}) : (WorkerHandler | InProcessHandler)} WorkerHandlerFactory */
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
20
|
* Runs normalize worker count.
|
|
@@ -39,27 +39,27 @@ export default class VelociousHttpServer {
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Narrows the runtime value to the documented type.
|
|
42
|
-
|
|
42
|
+
* @type {DevelopmentReloader | DevelopmentReloaderLike | undefined} */
|
|
43
43
|
developmentReloader
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Narrows the runtime value to the documented type.
|
|
47
|
-
|
|
47
|
+
* @type {import("net").Server | undefined} */
|
|
48
48
|
netServer
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Narrows the runtime value to the documented type.
|
|
52
|
-
|
|
52
|
+
* @type {WorkerHandlerFactory | undefined} */
|
|
53
53
|
workerHandlerFactory
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Clients.
|
|
57
|
-
|
|
57
|
+
* @type {Record<string, ServerClient>} */
|
|
58
58
|
clients = {}
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Active sockets.
|
|
62
|
-
|
|
62
|
+
* @type {Set<import("net").Socket>} */
|
|
63
63
|
_activeSockets = new Set()
|
|
64
64
|
|
|
65
65
|
events = new EventEmitter()
|
|
@@ -67,12 +67,12 @@ export default class VelociousHttpServer {
|
|
|
67
67
|
|
|
68
68
|
/**
|
|
69
69
|
* Worker handlers.
|
|
70
|
-
|
|
70
|
+
* @type {Array<WorkerHandler | InProcessHandler>} */
|
|
71
71
|
workerHandlers = []
|
|
72
72
|
nextWorkerHandlerIndex = 0
|
|
73
73
|
/**
|
|
74
74
|
* Sticky worker handlers.
|
|
75
|
-
|
|
75
|
+
* @type {Map<string, WorkerHandler | InProcessHandler>} */
|
|
76
76
|
stickyWorkerHandlers = new Map()
|
|
77
77
|
|
|
78
78
|
/**
|
|
@@ -114,7 +114,7 @@ export default class VelociousHttpServer {
|
|
|
114
114
|
await this._startDevelopmentReloader()
|
|
115
115
|
/**
|
|
116
116
|
* Net server.
|
|
117
|
-
|
|
117
|
+
* @type {import("net").Server} */
|
|
118
118
|
const netServer = new Net.Server()
|
|
119
119
|
this.netServer = netServer
|
|
120
120
|
netServer.on("close", this.onClose)
|
|
@@ -149,7 +149,7 @@ export default class VelociousHttpServer {
|
|
|
149
149
|
async _stopStartupResources(startupState) {
|
|
150
150
|
/**
|
|
151
151
|
* Startup net server.
|
|
152
|
-
|
|
152
|
+
* @type {import("net").Server | undefined} */
|
|
153
153
|
const startupNetServer = this.netServer
|
|
154
154
|
|
|
155
155
|
if (this.developmentReloader && this.developmentReloader !== startupState.developmentReloader) {
|
|
@@ -422,7 +422,7 @@ export default class VelociousHttpServer {
|
|
|
422
422
|
async _buildWorkerHandlers() {
|
|
423
423
|
/**
|
|
424
424
|
* Worker handlers.
|
|
425
|
-
|
|
425
|
+
* @type {Array<WorkerHandler | InProcessHandler>} */
|
|
426
426
|
const workerHandlers = []
|
|
427
427
|
|
|
428
428
|
for (let index = 0; index < this.workers; index += 1) {
|
|
@@ -4,7 +4,7 @@ import proxyaddr from "proxy-addr"
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Trusted proxy cache.
|
|
7
|
-
|
|
7
|
+
* @type {WeakMap<import("../configuration.js").default, {source: string | string[] | undefined, trust: ((address: string, index: number) => boolean) | undefined}>} */
|
|
8
8
|
const trustedProxyCache = new WeakMap()
|
|
9
9
|
|
|
10
10
|
/**
|
|
@@ -38,7 +38,7 @@ function trustedProxyChecker(configuration) {
|
|
|
38
38
|
function nodeStyleHeaders(headers) {
|
|
39
39
|
/**
|
|
40
40
|
* Result.
|
|
41
|
-
|
|
41
|
+
* @type {Record<string, string | string[]>} */
|
|
42
42
|
const result = {}
|
|
43
43
|
|
|
44
44
|
for (const [key, value] of Object.entries(headers)) {
|
|
@@ -65,9 +65,9 @@ export default function resolveRemoteAddress({configuration, headers, socketRemo
|
|
|
65
65
|
|
|
66
66
|
const proxyRequest = /**
|
|
67
67
|
* Narrows the runtime value to the documented type.
|
|
68
|
-
|
|
68
|
+
* @type {Parameters<typeof proxyaddr>[0]} */ (/**
|
|
69
69
|
* Narrows the runtime value to the documented type.
|
|
70
|
-
|
|
70
|
+
* @type {?} */ ({
|
|
71
71
|
connection: {remoteAddress: socketRemoteAddress},
|
|
72
72
|
headers: nodeStyleHeaders(headers),
|
|
73
73
|
socket: {remoteAddress: socketRemoteAddress}
|
|
@@ -144,7 +144,7 @@ export default class ServerClient {
|
|
|
144
144
|
onSocketError = (error) => {
|
|
145
145
|
const errorCode = /**
|
|
146
146
|
* Narrows the runtime value to the documented type.
|
|
147
|
-
|
|
147
|
+
* @type {{code?: string}} */ (error).code
|
|
148
148
|
|
|
149
149
|
this.logger.error(() => [`Socket ${this.clientCount} error`, errorCode || error.message])
|
|
150
150
|
this.emitClose()
|
|
@@ -190,10 +190,10 @@ export default class ServerClient {
|
|
|
190
190
|
}
|
|
191
191
|
const onWriteError = (/**
|
|
192
192
|
* Narrows the runtime value to the documented type.
|
|
193
|
-
|
|
193
|
+
* @type {Error} */ error) => {
|
|
194
194
|
const errorCode = /**
|
|
195
195
|
* Narrows the runtime value to the documented type.
|
|
196
|
-
|
|
196
|
+
* @type {{code?: string}} */ (error).code
|
|
197
197
|
|
|
198
198
|
this.logger.error(() => [`Socket ${this.clientCount} write error`, errorCode || error.message])
|
|
199
199
|
finish()
|
|
@@ -56,7 +56,7 @@ export default class VelociousHttpServerLock {
|
|
|
56
56
|
} catch (error) {
|
|
57
57
|
if (/**
|
|
58
58
|
* Narrows the runtime value to the documented type.
|
|
59
|
-
|
|
59
|
+
* @type {{code?: string}} */ (error).code === "EEXIST") return false
|
|
60
60
|
throw error
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -107,7 +107,7 @@ export default class VelociousHttpServerLock {
|
|
|
107
107
|
|
|
108
108
|
return this.processIsDead(/**
|
|
109
109
|
* Narrows the runtime value to the documented type.
|
|
110
|
-
|
|
110
|
+
* @type {{pid: number}} */ (owner).pid)
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/**
|
|
@@ -145,7 +145,7 @@ export default class VelociousHttpServerLock {
|
|
|
145
145
|
|
|
146
146
|
return false
|
|
147
147
|
} catch (error) {
|
|
148
|
-
return /**
|
|
148
|
+
return /** @type {{code?: string}} */ (error).code === "ESRCH"
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
@@ -157,7 +157,7 @@ export default class VelociousHttpServerLock {
|
|
|
157
157
|
try {
|
|
158
158
|
const rawOwner = await fs.readFile(path.join(this.lockPath, "owner.json"), "utf8")
|
|
159
159
|
|
|
160
|
-
return /**
|
|
160
|
+
return /** @type {Record<string, ?>} */ (JSON.parse(rawOwner))
|
|
161
161
|
} catch {
|
|
162
162
|
return null
|
|
163
163
|
}
|
|
@@ -13,7 +13,7 @@ export default class VelociousWebsocketChannelSubscribers {
|
|
|
13
13
|
constructor() {
|
|
14
14
|
/**
|
|
15
15
|
* Narrows the runtime value to the documented type.
|
|
16
|
-
|
|
16
|
+
* @type {Map<string, Set<(payload: ?, meta: {channel: string, createdAt?: string, eventId?: string}) => void | Promise<void>>>} */
|
|
17
17
|
this._subscribers = new Map()
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -94,10 +94,10 @@ export default class VelociousWebsocketChannelSubscribers {
|
|
|
94
94
|
|
|
95
95
|
if (result && typeof (/**
|
|
96
96
|
* Narrows the runtime value to the documented type.
|
|
97
|
-
|
|
97
|
+
* @type {Promise<void>} */ (result)).then === "function") {
|
|
98
98
|
tasks.push(/**
|
|
99
99
|
* Narrows the runtime value to the documented type.
|
|
100
|
-
|
|
100
|
+
* @type {Promise<void>} */ (result))
|
|
101
101
|
}
|
|
102
102
|
} catch (error) {
|
|
103
103
|
// Don't let one subscriber's failure abort the others; surface via the returned promises instead.
|
|
@@ -58,7 +58,7 @@ export default class VelociousHttpServerWebsocketEventLogStore {
|
|
|
58
58
|
this._readyPromise = null
|
|
59
59
|
/**
|
|
60
60
|
* Narrows the runtime value to the documented type.
|
|
61
|
-
|
|
61
|
+
* @type {Map<string, number>} */
|
|
62
62
|
this._interestedChannels = new Map()
|
|
63
63
|
}
|
|
64
64
|
|
|
@@ -227,7 +227,7 @@ export default class VelociousHttpServerWebsocketEventLogStore {
|
|
|
227
227
|
.results()
|
|
228
228
|
const row = /**
|
|
229
229
|
* Narrows the runtime value to the documented type.
|
|
230
|
-
|
|
230
|
+
* @type {Record<string, ?> | undefined} */ (rows[0])
|
|
231
231
|
|
|
232
232
|
if (!row) return null
|
|
233
233
|
|
|
@@ -260,7 +260,7 @@ export default class VelociousHttpServerWebsocketEventLogStore {
|
|
|
260
260
|
|
|
261
261
|
const rows = /**
|
|
262
262
|
* Narrows the runtime value to the documented type.
|
|
263
|
-
|
|
263
|
+
* @type {WebsocketEventRow[]} */ (await query.results())
|
|
264
264
|
|
|
265
265
|
return rows.map((row) => this._normalizeEventRow(row))
|
|
266
266
|
})
|
|
@@ -280,14 +280,14 @@ export default class VelociousHttpServerWebsocketEventLogStore {
|
|
|
280
280
|
await this._withDb(async (db) => {
|
|
281
281
|
const expiredEventRows = /**
|
|
282
282
|
* Narrows the runtime value to the documented type.
|
|
283
|
-
|
|
283
|
+
* @type {Array<{id: string}>} */ (await db
|
|
284
284
|
.newQuery()
|
|
285
285
|
.from(EVENTS_TABLE)
|
|
286
286
|
.where(`created_at <= ${db.quote(cutoff)}`)
|
|
287
287
|
.results())
|
|
288
288
|
const expiredReplayChannelRows = /**
|
|
289
289
|
* Narrows the runtime value to the documented type.
|
|
290
|
-
|
|
290
|
+
* @type {WebsocketReplayChannelRow[]} */ (await db
|
|
291
291
|
.newQuery()
|
|
292
292
|
.from(REPLAY_CHANNELS_TABLE)
|
|
293
293
|
.where(`interested_until <= ${db.quote(now)}`)
|
|
@@ -367,7 +367,7 @@ export default class VelociousHttpServerWebsocketEventLogStore {
|
|
|
367
367
|
async _getEventById({channel, db, id}) {
|
|
368
368
|
const rows = /**
|
|
369
369
|
* Narrows the runtime value to the documented type.
|
|
370
|
-
|
|
370
|
+
* @type {WebsocketEventRow[]} */ (await db
|
|
371
371
|
.newQuery()
|
|
372
372
|
.from(EVENTS_TABLE)
|
|
373
373
|
.where({channel, id})
|
|
@@ -6,7 +6,7 @@ export class VelociousHttpServerWebsocketEventsHost {
|
|
|
6
6
|
constructor() {
|
|
7
7
|
/**
|
|
8
8
|
* Narrows the runtime value to the documented type.
|
|
9
|
-
|
|
9
|
+
* @type {Set<import("./worker-handler/index.js").default>} */
|
|
10
10
|
this.handlers = new Set()
|
|
11
11
|
this.publishQueue = Promise.resolve()
|
|
12
12
|
}
|
|
@@ -45,7 +45,7 @@ export class VelociousHttpServerWebsocketEventsHost {
|
|
|
45
45
|
? {channel: channelOrArgs, payload: payloadArg}
|
|
46
46
|
: /**
|
|
47
47
|
* Narrows the runtime value to the documented type.
|
|
48
|
-
|
|
48
|
+
* @type {{channel: string, payload: ?}} */ (channelOrArgs)
|
|
49
49
|
const channel = publishArgs.channel
|
|
50
50
|
const payload = publishArgs.payload
|
|
51
51
|
|
|
@@ -23,20 +23,20 @@ export default class VelociousHttpServerInProcessHandler {
|
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Narrows the runtime value to the documented type.
|
|
26
|
-
|
|
26
|
+
* @type {Record<number, {httpClient: Client, serverClient: import("../server-client.js").default}>} */
|
|
27
27
|
this.clients = {}
|
|
28
28
|
|
|
29
29
|
this.logger = new Logger(this)
|
|
30
30
|
this.workerCount = workerCount
|
|
31
31
|
this.unregisterFromEventsHost = websocketEventsHost.register(/**
|
|
32
32
|
* Narrows the runtime value to the documented type.
|
|
33
|
-
|
|
33
|
+
* @type {?} */ (this))
|
|
34
34
|
this._stopping = false
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Runs start.
|
|
39
|
-
|
|
39
|
+
* @returns {Promise<void>} */
|
|
40
40
|
async start() {
|
|
41
41
|
await this.logger.debug(() => `In-process handler ${this.workerCount} started`)
|
|
42
42
|
}
|
|
@@ -74,12 +74,12 @@ export default class VelociousHttpServerInProcessHandler {
|
|
|
74
74
|
// to the in-process HTTP Client without needing a real worker thread.
|
|
75
75
|
const messagePortShim = /**
|
|
76
76
|
* Narrows the runtime value to the documented type.
|
|
77
|
-
|
|
77
|
+
* @type {import("worker_threads").Worker} */ (/**
|
|
78
78
|
* Narrows the runtime value to the documented type.
|
|
79
|
-
|
|
79
|
+
* @type {?} */ ({
|
|
80
80
|
postMessage: (/**
|
|
81
81
|
* Narrows the runtime value to the documented type.
|
|
82
|
-
|
|
82
|
+
* @type {{command: string, chunk?: Buffer | Uint8Array | string, clientCount?: number}} */ data) => {
|
|
83
83
|
if (data.command === "clientWrite" && data.chunk) {
|
|
84
84
|
const chunk = typeof data.chunk === "string" ? Buffer.from(data.chunk) : Buffer.from(data.chunk)
|
|
85
85
|
|
|
@@ -94,7 +94,7 @@ export default class VelociousHttpServerInProcessHandler {
|
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Runs stop.
|
|
97
|
-
|
|
97
|
+
* @returns {Promise<void>} */
|
|
98
98
|
async stop() {
|
|
99
99
|
this._stopping = true
|
|
100
100
|
|
|
@@ -46,7 +46,7 @@ export default class VelociousHttpServerWorker {
|
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Narrows the runtime value to the documented type.
|
|
49
|
-
|
|
49
|
+
* @type {Record<number, import("../server-client.js").default>} */
|
|
50
50
|
this.clients = {}
|
|
51
51
|
|
|
52
52
|
this.logger = new Logger(this)
|
|
@@ -56,7 +56,7 @@ export default class VelociousHttpServerWorker {
|
|
|
56
56
|
this._debugRequestId = 0
|
|
57
57
|
/**
|
|
58
58
|
* Narrows the runtime value to the documented type.
|
|
59
|
-
|
|
59
|
+
* @type {Map<number, {resolve: (snapshot: Record<string, ?>) => void}>} */
|
|
60
60
|
this._debugSnapshotRequests = new Map()
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -351,7 +351,7 @@ export default class VelociousHttpServerWorker {
|
|
|
351
351
|
|
|
352
352
|
/**
|
|
353
353
|
* Runs register with events host.
|
|
354
|
-
|
|
354
|
+
* @returns {void} */
|
|
355
355
|
registerWithEventsHost() {
|
|
356
356
|
if (this.unregisterFromEventsHost) return
|
|
357
357
|
|
|
@@ -360,7 +360,7 @@ export default class VelociousHttpServerWorker {
|
|
|
360
360
|
|
|
361
361
|
/**
|
|
362
362
|
* Runs unregister from events host if needed.
|
|
363
|
-
|
|
363
|
+
* @returns {void} */
|
|
364
364
|
unregisterFromEventsHostIfNeeded() {
|
|
365
365
|
if (!this.unregisterFromEventsHost) return
|
|
366
366
|
|
|
@@ -35,7 +35,7 @@ export default class VelociousHttpServerWorkerHandlerWorkerThread {
|
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* Narrows the runtime value to the documented type.
|
|
38
|
-
|
|
38
|
+
* @type {Record<number, Client>} */
|
|
39
39
|
this.clients = {}
|
|
40
40
|
|
|
41
41
|
this.logger = new Logger(this)
|
|
@@ -66,7 +66,7 @@ export default class VelociousHttpServerWorkerHandlerWorkerThread {
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* Narrows the runtime value to the documented type.
|
|
69
|
-
|
|
69
|
+
* @type {import("../../configuration.js").default} */
|
|
70
70
|
this.configuration = configurationImport.default
|
|
71
71
|
|
|
72
72
|
if (!this.configuration) throw new Error(`Configuration couldn't be loaded from: ${configurationPath}`)
|
|
@@ -170,7 +170,7 @@ export default class VelociousHttpServerWorkerHandlerWorkerThread {
|
|
|
170
170
|
if (!chunk) throw new Error("No chunk given")
|
|
171
171
|
const client = /**
|
|
172
172
|
* Narrows the runtime value to the documented type.
|
|
173
|
-
|
|
173
|
+
* @type {Client | undefined} */ (digg(this.clients, clientCount))
|
|
174
174
|
|
|
175
175
|
if (!client) throw new Error(`Client not found for clientWrite: ${clientCount}`)
|
|
176
176
|
|