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
|
@@ -39,42 +39,42 @@ export default class TestFilesFinder {
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* Narrows the runtime value to the documented type.
|
|
42
|
-
|
|
42
|
+
* @type {string[]} */
|
|
43
43
|
this.foundFiles = []
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
46
|
* Narrows the runtime value to the documented type.
|
|
47
|
-
|
|
47
|
+
* @type {Record<number, Promise<void>>} */
|
|
48
48
|
this.findingPromises = {}
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* Narrows the runtime value to the documented type.
|
|
52
|
-
|
|
52
|
+
* @type {string[]} */
|
|
53
53
|
this.testArgs = this.processArgs.filter((processArg, index) => index != 0)
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* Narrows the runtime value to the documented type.
|
|
57
|
-
|
|
57
|
+
* @type {string[]} */
|
|
58
58
|
this.directoryArgs = []
|
|
59
59
|
|
|
60
60
|
/**
|
|
61
61
|
* Narrows the runtime value to the documented type.
|
|
62
|
-
|
|
62
|
+
* @type {string[]} */
|
|
63
63
|
this.directoryFullPaths = []
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* Narrows the runtime value to the documented type.
|
|
67
|
-
|
|
67
|
+
* @type {string[]} */
|
|
68
68
|
this.fileArgs = []
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Narrows the runtime value to the documented type.
|
|
72
|
-
|
|
72
|
+
* @type {string[]} */
|
|
73
73
|
this.explicitFiles = []
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Narrows the runtime value to the documented type.
|
|
77
|
-
|
|
77
|
+
* @type {Record<string, number[]>} */
|
|
78
78
|
this.lineFiltersByFile = {}
|
|
79
79
|
|
|
80
80
|
this._argsPrepared = false
|
|
@@ -74,11 +74,11 @@ export function parseFilters(processArgs) {
|
|
|
74
74
|
|
|
75
75
|
/**
|
|
76
76
|
* Defines groups.
|
|
77
|
-
|
|
77
|
+
* @type {number | undefined} */
|
|
78
78
|
let groups
|
|
79
79
|
/**
|
|
80
80
|
* Defines groupNumber.
|
|
81
|
-
|
|
81
|
+
* @type {number | undefined} */
|
|
82
82
|
let groupNumber
|
|
83
83
|
|
|
84
84
|
let inRestArgs = false
|
|
@@ -39,11 +39,11 @@ function runWithTimeout(promise, timeoutMs, testDescription) {
|
|
|
39
39
|
|
|
40
40
|
/**
|
|
41
41
|
* ConsoleMethodName type.
|
|
42
|
-
|
|
42
|
+
* @typedef {"log" | "info" | "warn" | "error" | "debug"} ConsoleMethodName */
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Captured console methods.
|
|
46
|
-
|
|
46
|
+
* @type {ConsoleMethodName[]} */
|
|
47
47
|
const CAPTURED_CONSOLE_METHODS = ["log", "info", "warn", "error", "debug"]
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -149,12 +149,12 @@ function toFileSlug(value) {
|
|
|
149
149
|
export default class TestRunner {
|
|
150
150
|
/**
|
|
151
151
|
* Narrows the runtime value to the documented type.
|
|
152
|
-
|
|
152
|
+
* @type {ActiveAfterAllScopeEntry[]} */
|
|
153
153
|
_activeAfterAllScopes
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
156
|
* Narrows the runtime value to the documented type.
|
|
157
|
-
|
|
157
|
+
* @type {FailedTestDetail[]} */
|
|
158
158
|
_failedTestDetails
|
|
159
159
|
|
|
160
160
|
/**
|
|
@@ -343,7 +343,7 @@ export default class TestRunner {
|
|
|
343
343
|
getExcludeTagSet() {
|
|
344
344
|
/**
|
|
345
345
|
* Config tags.
|
|
346
|
-
|
|
346
|
+
* @type {string[]} */
|
|
347
347
|
const configTags = Array.isArray(testConfig.excludeTags) ? testConfig.excludeTags : []
|
|
348
348
|
|
|
349
349
|
return new Set([...this._excludeTags, ...configTags])
|
|
@@ -379,7 +379,7 @@ export default class TestRunner {
|
|
|
379
379
|
const testData = tests.tests[testDescription]
|
|
380
380
|
const testArgs = /**
|
|
381
381
|
* Narrows the runtime value to the documented type.
|
|
382
|
-
|
|
382
|
+
* @type {TestArgs} */ (Object.assign({}, testData.args))
|
|
383
383
|
const includeByLine = lineMatchedInScope || this.matchesLineFilter(testData)
|
|
384
384
|
|
|
385
385
|
if (this._onlyFocussed && !testArgs.focus) continue
|
|
@@ -719,7 +719,7 @@ export default class TestRunner {
|
|
|
719
719
|
|
|
720
720
|
if (!shouldRunAnyTests) return
|
|
721
721
|
|
|
722
|
-
/**
|
|
722
|
+
/** @type {ActiveAfterAllScopeEntry} */
|
|
723
723
|
const scopeEntry = {tests, afterAllsRun: false}
|
|
724
724
|
this._activeAfterAllScopes.push(scopeEntry)
|
|
725
725
|
|
|
@@ -732,7 +732,7 @@ export default class TestRunner {
|
|
|
732
732
|
const testData = tests.tests[testDescription]
|
|
733
733
|
const testArgs = /**
|
|
734
734
|
* Narrows the runtime value to the documented type.
|
|
735
|
-
|
|
735
|
+
* @type {TestArgs} */ (Object.assign({}, testData.args))
|
|
736
736
|
const includeByLine = scopeLineMatch || this.matchesLineFilter(testData)
|
|
737
737
|
|
|
738
738
|
if (this._onlyFocussed && !testArgs.focus) continue
|
|
@@ -757,7 +757,7 @@ export default class TestRunner {
|
|
|
757
757
|
let attemptNumber = 1
|
|
758
758
|
/**
|
|
759
759
|
* Attempt console outputs.
|
|
760
|
-
|
|
760
|
+
* @type {AttemptConsoleOutput[]} */
|
|
761
761
|
const attemptConsoleOutputs = []
|
|
762
762
|
|
|
763
763
|
console.log(`${leftPadding}it ${testDescription}`)
|
|
@@ -766,15 +766,15 @@ export default class TestRunner {
|
|
|
766
766
|
let shouldRetry = false
|
|
767
767
|
/**
|
|
768
768
|
* Defines caughtError.
|
|
769
|
-
|
|
769
|
+
* @type {?} */
|
|
770
770
|
let caughtError
|
|
771
771
|
/**
|
|
772
772
|
* Defines failedError.
|
|
773
|
-
|
|
773
|
+
* @type {?} */
|
|
774
774
|
let failedError
|
|
775
775
|
/**
|
|
776
776
|
* Defines lastError.
|
|
777
|
-
|
|
777
|
+
* @type {?} */
|
|
778
778
|
let lastError
|
|
779
779
|
let willRetry = false
|
|
780
780
|
const stopConsoleCapture = this.startConsoleCapture({
|
|
@@ -1120,17 +1120,17 @@ export default class TestRunner {
|
|
|
1120
1120
|
startConsoleCapture({passthrough = false} = {}) {
|
|
1121
1121
|
/**
|
|
1122
1122
|
* Lines.
|
|
1123
|
-
|
|
1123
|
+
* @type {string[]} */
|
|
1124
1124
|
const lines = []
|
|
1125
1125
|
/**
|
|
1126
1126
|
* Console object.
|
|
1127
|
-
|
|
1127
|
+
* @type {Record<ConsoleMethodName, (...args: Array<?>) => void>} */
|
|
1128
1128
|
const consoleObject = /**
|
|
1129
1129
|
* Narrows the runtime value to the documented type.
|
|
1130
|
-
|
|
1130
|
+
* @type {Record<ConsoleMethodName, (...args: Array<?>) => void>} */ (console)
|
|
1131
1131
|
/**
|
|
1132
1132
|
* Original console methods.
|
|
1133
|
-
|
|
1133
|
+
* @type {Record<ConsoleMethodName, (...args: Array<?>) => void>} */
|
|
1134
1134
|
const originalConsoleMethods = {
|
|
1135
1135
|
debug: consoleObject.debug.bind(console),
|
|
1136
1136
|
error: consoleObject.error.bind(console),
|
package/src/testing/test.js
CHANGED
|
@@ -8,25 +8,25 @@ import {arrayContaining, objectContaining} from "./expect-utils.js"
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Tests.
|
|
11
|
-
|
|
11
|
+
* @type {import("./test-runner.js").TestsArgument} */
|
|
12
12
|
const tests = {
|
|
13
13
|
/**
|
|
14
14
|
* Narrows the runtime value to the documented type.
|
|
15
|
-
|
|
15
|
+
* @type {import("./test-runner.js").AfterBeforeEachCallbackObjectType[]} */
|
|
16
16
|
afterEaches: [],
|
|
17
17
|
/**
|
|
18
18
|
* Narrows the runtime value to the documented type.
|
|
19
|
-
|
|
19
|
+
* @type {import("./test-runner.js").BeforeAfterAllCallbackObjectType[]} */
|
|
20
20
|
afterAlls: [],
|
|
21
21
|
args: {},
|
|
22
22
|
|
|
23
23
|
/**
|
|
24
24
|
* Narrows the runtime value to the documented type.
|
|
25
|
-
|
|
25
|
+
* @type {import("./test-runner.js").BeforeAfterAllCallbackObjectType[]} */
|
|
26
26
|
beforeAlls: [],
|
|
27
27
|
/**
|
|
28
28
|
* Narrows the runtime value to the documented type.
|
|
29
|
-
|
|
29
|
+
* @type {import("./test-runner.js").AfterBeforeEachCallbackObjectType[]} */
|
|
30
30
|
beforeEaches: [],
|
|
31
31
|
filePath: undefined,
|
|
32
32
|
line: undefined,
|
|
@@ -99,7 +99,7 @@ function normalizeTags(tags) {
|
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* Test config.
|
|
102
|
-
|
|
102
|
+
* @type {VelociousTestConfig} */
|
|
103
103
|
const testConfig = {
|
|
104
104
|
consoleOutput: "failure",
|
|
105
105
|
failedConsoleOutputMaxLines: 200,
|
|
@@ -212,7 +212,7 @@ function afterAll(callback) {
|
|
|
212
212
|
async function describe(description, arg1, arg2) {
|
|
213
213
|
/**
|
|
214
214
|
* Defines testArgs.
|
|
215
|
-
|
|
215
|
+
* @type {Record<string, ?>} */
|
|
216
216
|
let testArgs, testFunction
|
|
217
217
|
|
|
218
218
|
if (typeof arg2 == "function") {
|
|
@@ -278,23 +278,23 @@ function it(description, arg1, arg2) {
|
|
|
278
278
|
const currentTest = currentPath[currentPath.length - 1]
|
|
279
279
|
/**
|
|
280
280
|
* Defines testArgs.
|
|
281
|
-
|
|
281
|
+
* @type {Record<string, ?>} */
|
|
282
282
|
let testArgs
|
|
283
283
|
|
|
284
284
|
/**
|
|
285
285
|
* Defines testFunction.
|
|
286
|
-
|
|
286
|
+
* @type {() => (void|Promise<void>)} */
|
|
287
287
|
let testFunction
|
|
288
288
|
|
|
289
289
|
if (typeof arg1 == "function") {
|
|
290
290
|
testFunction = /**
|
|
291
291
|
* Narrows the runtime value to the documented type.
|
|
292
|
-
|
|
292
|
+
* @type {() => (void|Promise<void>)} */ (arg1)
|
|
293
293
|
testArgs = {}
|
|
294
294
|
} else if (typeof arg2 == "function") {
|
|
295
295
|
testFunction = /**
|
|
296
296
|
* Narrows the runtime value to the documented type.
|
|
297
|
-
|
|
297
|
+
* @type {() => (void|Promise<void>)} */ (arg2)
|
|
298
298
|
testArgs = arg1
|
|
299
299
|
} else {
|
|
300
300
|
throw new Error(`Invalid arguments for it: ${description}, ${arg1}`)
|
|
@@ -322,23 +322,23 @@ function it(description, arg1, arg2) {
|
|
|
322
322
|
function fit(description, arg1, arg2) {
|
|
323
323
|
/**
|
|
324
324
|
* Defines testArgs.
|
|
325
|
-
|
|
325
|
+
* @type {Record<string, ?>} */
|
|
326
326
|
let testArgs
|
|
327
327
|
|
|
328
328
|
/**
|
|
329
329
|
* Defines testFunction.
|
|
330
|
-
|
|
330
|
+
* @type {() => (void|Promise<void>)} */
|
|
331
331
|
let testFunction
|
|
332
332
|
|
|
333
333
|
if (typeof arg1 == "function") {
|
|
334
334
|
testFunction = /**
|
|
335
335
|
* Narrows the runtime value to the documented type.
|
|
336
|
-
|
|
336
|
+
* @type {() => (void|Promise<void>)} */ (arg1)
|
|
337
337
|
testArgs = {focus: true}
|
|
338
338
|
} else if (typeof arg2 == "function") {
|
|
339
339
|
testFunction = /**
|
|
340
340
|
* Narrows the runtime value to the documented type.
|
|
341
|
-
|
|
341
|
+
* @type {() => (void|Promise<void>)} */ (arg2)
|
|
342
342
|
testArgs = Object.assign({focus: true}, arg1)
|
|
343
343
|
} else {
|
|
344
344
|
throw new Error(`Invalid arguments for it: ${description}, ${arg1}`)
|
|
@@ -107,7 +107,7 @@ function relativeApplicationPath(sourcePath, applicationDirectory) {
|
|
|
107
107
|
export default class BacktraceCleaner {
|
|
108
108
|
/**
|
|
109
109
|
* Framework source directory.
|
|
110
|
-
|
|
110
|
+
* @type {string | undefined} */
|
|
111
111
|
frameworkSourceDirectory = undefined
|
|
112
112
|
|
|
113
113
|
/**
|
package/src/utils/model-scope.js
CHANGED
|
@@ -52,5 +52,5 @@ export function defineModelScope({callback, modelClass, startQuery}) {
|
|
|
52
52
|
export function isModelScopeDescriptor(value) {
|
|
53
53
|
return Boolean(value && typeof value === "object" && /**
|
|
54
54
|
* Narrows the runtime value to the documented type.
|
|
55
|
-
|
|
55
|
+
* @type {Record<string, ?>} */ (value)[MODEL_SCOPE_DESCRIPTOR_MARKER] === true)
|
|
56
56
|
}
|
package/src/utils/ransack.js
CHANGED
|
@@ -81,7 +81,7 @@ export function normalizeRansackGroup(modelClass, params) {
|
|
|
81
81
|
|
|
82
82
|
/**
|
|
83
83
|
* Normalized.
|
|
84
|
-
|
|
84
|
+
* @type {RansackGroup} */
|
|
85
85
|
const normalized = {
|
|
86
86
|
combinator: normalizeRansackCombinator(params.m, "and"),
|
|
87
87
|
conditions: [],
|
|
@@ -154,7 +154,7 @@ function normalizeSimpleRansackCondition({key, modelClass, rawValue}) {
|
|
|
154
154
|
function normalizeAdvancedRansackConditions({modelClass, value}) {
|
|
155
155
|
/**
|
|
156
156
|
* Conditions.
|
|
157
|
-
|
|
157
|
+
* @type {RansackCondition[]} */
|
|
158
158
|
const conditions = []
|
|
159
159
|
|
|
160
160
|
for (const entry of normalizeRansackCollection(value, "conditions")) {
|
|
@@ -174,7 +174,7 @@ function normalizeAdvancedRansackConditions({modelClass, value}) {
|
|
|
174
174
|
|
|
175
175
|
const predicate = /**
|
|
176
176
|
* Narrows the runtime value to the documented type.
|
|
177
|
-
|
|
177
|
+
* @type {RansackPredicate} */ (predicateValue)
|
|
178
178
|
const rawValue = advancedRansackConditionValue({predicate, value: entry.v})
|
|
179
179
|
const normalizedValue = normalizeRansackValue({predicate, value: rawValue})
|
|
180
180
|
|
|
@@ -203,7 +203,7 @@ function normalizeAdvancedRansackConditions({modelClass, value}) {
|
|
|
203
203
|
function normalizeAdvancedRansackGroups({modelClass, value}) {
|
|
204
204
|
/**
|
|
205
205
|
* Groupings.
|
|
206
|
-
|
|
206
|
+
* @type {RansackGroup[]} */
|
|
207
207
|
const groupings = []
|
|
208
208
|
|
|
209
209
|
for (const entry of normalizeRansackCollection(value, "groupings")) {
|
|
@@ -286,7 +286,7 @@ function resolveRansackAttributesFromAdvancedValue({modelClass, value}) {
|
|
|
286
286
|
const values = normalizeAdvancedAttributeValues(value)
|
|
287
287
|
/**
|
|
288
288
|
* Attributes.
|
|
289
|
-
|
|
289
|
+
* @type {RansackAttribute[]} */
|
|
290
290
|
const attributes = []
|
|
291
291
|
|
|
292
292
|
for (const attributeValue of values) {
|
|
@@ -391,7 +391,7 @@ function modelClassAtPath({modelClass, path}) {
|
|
|
391
391
|
function resolveRansackPath({modelClass, value}) {
|
|
392
392
|
/**
|
|
393
393
|
* Path.
|
|
394
|
-
|
|
394
|
+
* @type {string[]} */
|
|
395
395
|
const path = []
|
|
396
396
|
let currentModelClass = modelClass
|
|
397
397
|
let remainingValue = value
|
|
@@ -525,16 +525,16 @@ function resolveAttributeName({modelClass, value}) {
|
|
|
525
525
|
function relationshipEntries(modelClass) {
|
|
526
526
|
if (typeof /**
|
|
527
527
|
* Narrows the runtime value to the documented type.
|
|
528
|
-
|
|
528
|
+
* @type {?} */ (modelClass).getRelationshipsMap === "function") {
|
|
529
529
|
return backendRelationshipEntries(modelClass)
|
|
530
530
|
}
|
|
531
531
|
|
|
532
532
|
if (typeof /**
|
|
533
533
|
* Narrows the runtime value to the documented type.
|
|
534
|
-
|
|
534
|
+
* @type {?} */ (modelClass).relationshipDefinitions === "function" &&
|
|
535
535
|
typeof /**
|
|
536
536
|
* Narrows the runtime value to the documented type.
|
|
537
|
-
|
|
537
|
+
* @type {?} */ (modelClass).relationshipModelClasses === "function") {
|
|
538
538
|
return frontendRelationshipEntries(modelClass)
|
|
539
539
|
}
|
|
540
540
|
|
|
@@ -549,11 +549,11 @@ function relationshipEntries(modelClass) {
|
|
|
549
549
|
function backendRelationshipEntries(modelClass) {
|
|
550
550
|
/**
|
|
551
551
|
* Entries.
|
|
552
|
-
|
|
552
|
+
* @type {Record<string, {targetModelClass: RansackModelClass}>} */
|
|
553
553
|
const entries = {}
|
|
554
554
|
const relationshipsMap = /**
|
|
555
555
|
* Narrows the runtime value to the documented type.
|
|
556
|
-
|
|
556
|
+
* @type {?} */ (modelClass).getRelationshipsMap()
|
|
557
557
|
|
|
558
558
|
for (const relationshipName of Object.keys(relationshipsMap)) {
|
|
559
559
|
const relationship = relationshipsMap[relationshipName]
|
|
@@ -578,14 +578,14 @@ function backendRelationshipEntries(modelClass) {
|
|
|
578
578
|
function frontendRelationshipEntries(modelClass) {
|
|
579
579
|
/**
|
|
580
580
|
* Entries.
|
|
581
|
-
|
|
581
|
+
* @type {Record<string, {targetModelClass: RansackModelClass}>} */
|
|
582
582
|
const entries = {}
|
|
583
583
|
const definitions = /**
|
|
584
584
|
* Narrows the runtime value to the documented type.
|
|
585
|
-
|
|
585
|
+
* @type {?} */ (modelClass).relationshipDefinitions()
|
|
586
586
|
const relationshipModelClasses = /**
|
|
587
587
|
* Narrows the runtime value to the documented type.
|
|
588
|
-
|
|
588
|
+
* @type {?} */ (modelClass).relationshipModelClasses()
|
|
589
589
|
|
|
590
590
|
for (const relationshipName of Object.keys(definitions)) {
|
|
591
591
|
const targetModelClass = resolveFrontendModelClass(relationshipModelClasses[relationshipName])
|
|
@@ -606,23 +606,23 @@ function frontendRelationshipEntries(modelClass) {
|
|
|
606
606
|
function attributeEntries(modelClass) {
|
|
607
607
|
if (typeof /**
|
|
608
608
|
* Narrows the runtime value to the documented type.
|
|
609
|
-
|
|
610
|
-
return /**
|
|
611
|
-
|
|
612
|
-
|
|
609
|
+
* @type {?} */ (modelClass).getAttributeNameToColumnNameMap === "function") {
|
|
610
|
+
return /** @type {Record<string, string>} */ ((/**
|
|
611
|
+
* Narrows the runtime value to the documented type.
|
|
612
|
+
* @type {?} */ (modelClass).getAttributeNameToColumnNameMap()))
|
|
613
613
|
}
|
|
614
614
|
|
|
615
615
|
const resourceConfig = typeof /**
|
|
616
616
|
* Narrows the runtime value to the documented type.
|
|
617
|
-
|
|
617
|
+
* @type {?} */ (modelClass).resourceConfig === "function"
|
|
618
618
|
? /**
|
|
619
619
|
* Narrows the runtime value to the documented type.
|
|
620
|
-
|
|
620
|
+
* @type {?} */ (modelClass).resourceConfig()
|
|
621
621
|
: {}
|
|
622
622
|
const attributes = resourceConfig.attributes
|
|
623
623
|
/**
|
|
624
624
|
* Entries.
|
|
625
|
-
|
|
625
|
+
* @type {Record<string, string>} */
|
|
626
626
|
const entries = {}
|
|
627
627
|
|
|
628
628
|
if (Array.isArray(attributes)) {
|
|
@@ -677,7 +677,7 @@ function parseRansackKey(key) {
|
|
|
677
677
|
pathValue,
|
|
678
678
|
predicate: /**
|
|
679
679
|
* Narrows the runtime value to the documented type.
|
|
680
|
-
|
|
680
|
+
* @type {RansackPredicate} */ (predicate)
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
|
|
@@ -696,7 +696,7 @@ function parseRansackKey(key) {
|
|
|
696
696
|
pathValue,
|
|
697
697
|
predicate: /**
|
|
698
698
|
* Narrows the runtime value to the documented type.
|
|
699
|
-
|
|
699
|
+
* @type {RansackPredicate} */ (predicate)
|
|
700
700
|
}
|
|
701
701
|
}
|
|
702
702
|
|
|
@@ -759,11 +759,11 @@ function normalizeRansackListValue(value) {
|
|
|
759
759
|
|
|
760
760
|
/**
|
|
761
761
|
* Ransack true values.
|
|
762
|
-
|
|
762
|
+
* @type {Set<?>} */
|
|
763
763
|
const ransackTrueValues = new Set([true, 1, "1", "true"])
|
|
764
764
|
/**
|
|
765
765
|
* Ransack false values.
|
|
766
|
-
|
|
766
|
+
* @type {Set<?>} */
|
|
767
767
|
const ransackFalseValues = new Set([false, 0, "0", "false"])
|
|
768
768
|
|
|
769
769
|
/**
|
|
@@ -825,7 +825,7 @@ export function parseRansackSort(modelClass, sortString) {
|
|
|
825
825
|
|
|
826
826
|
/**
|
|
827
827
|
* Sorts.
|
|
828
|
-
|
|
828
|
+
* @type {RansackSort[]} */
|
|
829
829
|
const sorts = []
|
|
830
830
|
|
|
831
831
|
for (const segment of segments) {
|
|
@@ -4,15 +4,15 @@ import {AsyncLocalStorage} from "node:async_hooks"
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Defines asyncLocalStorage.
|
|
7
|
-
|
|
7
|
+
* @type {import("node:async_hooks").AsyncLocalStorage<Array<string[]>> | undefined} */
|
|
8
8
|
let asyncLocalStorage
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Tracked stack global.
|
|
12
|
-
|
|
12
|
+
* @type {{withTrackedStack?: {addTrackedStackToError: (error: Error) => void, withTrackedStack: (arg1: string | (() => Promise<?>), arg2?: (() => Promise<?>) | Error) => Promise<?>}}} */
|
|
13
13
|
const trackedStackGlobal = /**
|
|
14
14
|
* Narrows the runtime value to the documented type.
|
|
15
|
-
|
|
15
|
+
* @type {?} */ (globalThis)
|
|
16
16
|
|
|
17
17
|
if (AsyncLocalStorage) {
|
|
18
18
|
asyncLocalStorage = new AsyncLocalStorage()
|
|
@@ -48,23 +48,23 @@ function addTrackedStackToError(error) {
|
|
|
48
48
|
async function withTrackedStack(arg1, arg2) {
|
|
49
49
|
/**
|
|
50
50
|
* Defines callback.
|
|
51
|
-
|
|
51
|
+
* @type {() => Promise<?>} */
|
|
52
52
|
let callback
|
|
53
53
|
|
|
54
54
|
/**
|
|
55
55
|
* Defines stack.
|
|
56
|
-
|
|
56
|
+
* @type {string} */
|
|
57
57
|
let stack
|
|
58
58
|
|
|
59
59
|
if (typeof arg2 == "function" && typeof arg1 == "string") {
|
|
60
60
|
callback = /**
|
|
61
61
|
* Narrows the runtime value to the documented type.
|
|
62
|
-
|
|
62
|
+
* @type {() => Promise<?>} */ (arg2)
|
|
63
63
|
stack = arg1
|
|
64
64
|
} else {
|
|
65
65
|
callback = /**
|
|
66
66
|
* Narrows the runtime value to the documented type.
|
|
67
|
-
|
|
67
|
+
* @type {() => Promise<?>} */ (arg1)
|
|
68
68
|
stack = Error().stack || ""
|
|
69
69
|
}
|
|
70
70
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Tracked stack global.
|
|
5
|
-
|
|
5
|
+
* @type {{withTrackedStack?: {withTrackedStack?: (stack: string | undefined, fn: () => Promise<?>) => Promise<?>, addTrackedStackToError?: (error: Error) => void}}} */
|
|
6
6
|
const trackedStackGlobal = /**
|
|
7
7
|
* Narrows the runtime value to the documented type.
|
|
8
|
-
|
|
8
|
+
* @type {?} */ (globalThis)
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Runs add tracked stack to error.
|
|
@@ -25,7 +25,7 @@ async function withTrackedStack(stackOrCallback, callback) {
|
|
|
25
25
|
const tracked = trackedStackGlobal.withTrackedStack?.withTrackedStack
|
|
26
26
|
const resolvedCallback = callback ?? /**
|
|
27
27
|
* Narrows the runtime value to the documented type.
|
|
28
|
-
|
|
28
|
+
* @type {() => Promise<?>} */ (stackOrCallback)
|
|
29
29
|
const stack = typeof stackOrCallback == "string" ? stackOrCallback : undefined
|
|
30
30
|
|
|
31
31
|
if (tracked) {
|