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
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
export default function clearPendingDebouncedCallback(callback) {
|
|
9
9
|
const callbackWithClear = /**
|
|
10
10
|
* Narrows the runtime value to the documented type.
|
|
11
|
-
|
|
11
|
+
* @type {{clear?: ?}} */ (callback)
|
|
12
12
|
|
|
13
13
|
if (typeof callbackWithClear.clear === "function") {
|
|
14
14
|
callbackWithClear.clear()
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* FrontendModelInstance type.
|
|
5
|
-
|
|
5
|
+
* @typedef {import("./base.js").default} FrontendModelInstance */
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Model dependency ids.
|
|
9
|
-
|
|
9
|
+
* @type {WeakMap<FrontendModelInstance, number>} */
|
|
10
10
|
const modelDependencyIds = new WeakMap()
|
|
11
11
|
let nextModelDependencyId = 1
|
|
12
12
|
|
|
@@ -11,7 +11,7 @@ const MAX_BUFFERED_OUTGOING_EVENTS = 50
|
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Buffer.
|
|
14
|
-
|
|
14
|
+
* @type {BufferedOutgoingEvent[]} */
|
|
15
15
|
let buffer = []
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -37,7 +37,7 @@ export function drainBufferedOutgoingEvents() {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Runs the clearBufferedOutgoingEvents helper.
|
|
40
|
-
|
|
40
|
+
* @returns {void} */
|
|
41
41
|
export function clearBufferedOutgoingEvents() {
|
|
42
42
|
buffer = []
|
|
43
43
|
}
|
|
@@ -24,15 +24,15 @@ export default class FrontendModelPreloader {
|
|
|
24
24
|
|
|
25
25
|
const modelClass = /**
|
|
26
26
|
* Narrows the runtime value to the documented type.
|
|
27
|
-
|
|
27
|
+
* @type {import("./base.js").FrontendModelClass} */ (models[0].constructor)
|
|
28
28
|
const isQuery = Boolean(queryOrSpec) && typeof queryOrSpec === "object" && "_preload" in queryOrSpec
|
|
29
29
|
const query = isQuery
|
|
30
30
|
? /**
|
|
31
31
|
* Narrows the runtime value to the documented type.
|
|
32
|
-
|
|
32
|
+
* @type {import("./query.js").default<import("./base.js").FrontendModelClass>} */ (queryOrSpec)
|
|
33
33
|
: modelClass.preload(/**
|
|
34
34
|
* Narrows the runtime value to the documented type.
|
|
35
|
-
|
|
35
|
+
* @type {?} */ (queryOrSpec))
|
|
36
36
|
|
|
37
37
|
const topLevelRelationships = Object.keys(query._preload)
|
|
38
38
|
|
|
@@ -60,7 +60,7 @@ export default class FrontendModelPreloader {
|
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
62
|
* Reloaded by id.
|
|
63
|
-
|
|
63
|
+
* @type {Map<string, import("./base.js").default>} */
|
|
64
64
|
const reloadedById = new Map()
|
|
65
65
|
|
|
66
66
|
for (const reloadedModel of reloaded) {
|
|
@@ -165,6 +165,6 @@ export default class FrontendModelPreloader {
|
|
|
165
165
|
if (!subPreload || typeof subPreload !== "object") return null
|
|
166
166
|
if (Object.keys(subPreload).length === 0) return null
|
|
167
167
|
|
|
168
|
-
return /**
|
|
168
|
+
return /** @type {import("../database/query/index.js").NestedPreloadRecord} */ (subPreload)
|
|
169
169
|
}
|
|
170
170
|
}
|
|
@@ -17,6 +17,10 @@ import isPlainObject from "../utils/plain-object.js"
|
|
|
17
17
|
* FrontendModelTransportValue type.
|
|
18
18
|
* @typedef {null | boolean | number | string | object} FrontendModelTransportValue
|
|
19
19
|
*/
|
|
20
|
+
/**
|
|
21
|
+
* FrontendModelAttributeValue type.
|
|
22
|
+
* @typedef {import("./base.js").FrontendModelAttributeValue} FrontendModelAttributeValue
|
|
23
|
+
*/
|
|
20
24
|
/**
|
|
21
25
|
* Defines this typedef.
|
|
22
26
|
* @typedef {{attributeName: string, relationshipName: string, where?: Record<string, FrontendModelTransportValue>}} FrontendModelWithCountPayloadEntry
|
|
@@ -89,7 +93,7 @@ export function normalizePreload(preload) {
|
|
|
89
93
|
if (Array.isArray(preload)) {
|
|
90
94
|
/**
|
|
91
95
|
* Normalized.
|
|
92
|
-
|
|
96
|
+
* @type {import("../database/query/index.js").NestedPreloadRecord} */
|
|
93
97
|
const normalized = {}
|
|
94
98
|
|
|
95
99
|
for (const entry of preload) {
|
|
@@ -115,7 +119,7 @@ export function normalizePreload(preload) {
|
|
|
115
119
|
|
|
116
120
|
/**
|
|
117
121
|
* Normalized.
|
|
118
|
-
|
|
122
|
+
* @type {import("../database/query/index.js").NestedPreloadRecord} */
|
|
119
123
|
const normalized = {}
|
|
120
124
|
|
|
121
125
|
for (const [relationshipName, relationshipPreload] of Object.entries(preload)) {
|
|
@@ -177,7 +181,7 @@ function normalizeWithCountFrontend(spec) {
|
|
|
177
181
|
if (isPlainObject(value)) {
|
|
178
182
|
const options = /**
|
|
179
183
|
* Narrows the runtime value to the documented type.
|
|
180
|
-
|
|
184
|
+
* @type {{relationship?: string, where?: Record<string, ?>}} */ (value)
|
|
181
185
|
entries.push({
|
|
182
186
|
attributeName: key,
|
|
183
187
|
relationshipName: options.relationship || key,
|
|
@@ -228,7 +232,7 @@ function normalizeAbilitiesSpec(spec, rootModelClass) {
|
|
|
228
232
|
|
|
229
233
|
/**
|
|
230
234
|
* Entries.
|
|
231
|
-
|
|
235
|
+
* @type {Array<{modelName: string, actions: string[]}>} */
|
|
232
236
|
const entries = []
|
|
233
237
|
|
|
234
238
|
for (const [modelName, actions] of Object.entries(spec)) {
|
|
@@ -280,10 +284,10 @@ function mergePreloadRecord(targetPreload, incomingPreload) {
|
|
|
280
284
|
mergePreloadRecord(
|
|
281
285
|
/**
|
|
282
286
|
* Narrows the runtime value to the documented type.
|
|
283
|
-
|
|
287
|
+
* @type {import("../database/query/index.js").NestedPreloadRecord} */ (existingValue),
|
|
284
288
|
/**
|
|
285
289
|
* Narrows the runtime value to the documented type.
|
|
286
|
-
|
|
290
|
+
* @type {import("../database/query/index.js").NestedPreloadRecord} */ (incomingValue)
|
|
287
291
|
)
|
|
288
292
|
continue
|
|
289
293
|
}
|
|
@@ -325,7 +329,7 @@ function normalizeSelect(select, rootModelName = null) {
|
|
|
325
329
|
|
|
326
330
|
/**
|
|
327
331
|
* Normalized.
|
|
328
|
-
|
|
332
|
+
* @type {Record<string, string[]>} */
|
|
329
333
|
const normalized = {}
|
|
330
334
|
|
|
331
335
|
for (const [modelName, selection] of Object.entries(select)) {
|
|
@@ -378,14 +382,14 @@ export function normalizeSearchOperator(operator) {
|
|
|
378
382
|
}
|
|
379
383
|
const normalizedOperator = operatorAliases[/**
|
|
380
384
|
* Narrows the runtime value to the documented type.
|
|
381
|
-
|
|
385
|
+
* @type {"<" | "<=" | ">" | ">="} */ (operator)] || operator
|
|
382
386
|
const supportedOperators = new Set(["eq", "like", "notEq", "gt", "gteq", "lt", "lteq"])
|
|
383
387
|
|
|
384
388
|
if (!supportedOperators.has(normalizedOperator)) {
|
|
385
389
|
throw new Error(`search operator must be one of: eq, like, notEq, gt, gteq, lt, lteq, >, >=, <, <= (got: ${operator})`)
|
|
386
390
|
}
|
|
387
391
|
|
|
388
|
-
return /**
|
|
392
|
+
return /** @type {"eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq"} */ (normalizedOperator)
|
|
389
393
|
}
|
|
390
394
|
|
|
391
395
|
/**
|
|
@@ -434,7 +438,7 @@ export function normalizeJoins(joins) {
|
|
|
434
438
|
if (Array.isArray(joins)) {
|
|
435
439
|
/**
|
|
436
440
|
* Normalized.
|
|
437
|
-
|
|
441
|
+
* @type {Record<string, ?>} */
|
|
438
442
|
const normalized = {}
|
|
439
443
|
|
|
440
444
|
for (const joinEntry of joins) {
|
|
@@ -454,7 +458,7 @@ export function normalizeJoins(joins) {
|
|
|
454
458
|
|
|
455
459
|
/**
|
|
456
460
|
* Normalized.
|
|
457
|
-
|
|
461
|
+
* @type {Record<string, ?>} */
|
|
458
462
|
const normalized = {}
|
|
459
463
|
|
|
460
464
|
for (const [relationshipName, relationshipJoin] of Object.entries(joins)) {
|
|
@@ -627,7 +631,7 @@ function parseSortTuple(sortValue, path = []) {
|
|
|
627
631
|
function normalizeSortObject(sortValue, path) {
|
|
628
632
|
/**
|
|
629
633
|
* Normalized sorts.
|
|
630
|
-
|
|
634
|
+
* @type {FrontendModelSort[]} */
|
|
631
635
|
const normalizedSorts = []
|
|
632
636
|
|
|
633
637
|
for (const [sortKey, sortEntry] of Object.entries(sortValue)) {
|
|
@@ -702,7 +706,7 @@ export function normalizeSort(sort) {
|
|
|
702
706
|
if (Array.isArray(sort)) {
|
|
703
707
|
/**
|
|
704
708
|
* Normalized.
|
|
705
|
-
|
|
709
|
+
* @type {FrontendModelSort[]} */
|
|
706
710
|
const normalized = []
|
|
707
711
|
|
|
708
712
|
for (const sortEntry of sort) {
|
|
@@ -784,7 +788,7 @@ function columnPathDescriptor(value) {
|
|
|
784
788
|
function normalizeColumnProjectionObject(value, path, parseString, label) {
|
|
785
789
|
/**
|
|
786
790
|
* Normalized.
|
|
787
|
-
|
|
791
|
+
* @type {T[]} */
|
|
788
792
|
const normalized = []
|
|
789
793
|
|
|
790
794
|
for (const [projectionKey, projectionEntry] of Object.entries(value)) {
|
|
@@ -846,7 +850,7 @@ export function normalizeGroup(group) {
|
|
|
846
850
|
if (Array.isArray(group)) {
|
|
847
851
|
/**
|
|
848
852
|
* Normalized.
|
|
849
|
-
|
|
853
|
+
* @type {FrontendModelGroup[]} */
|
|
850
854
|
const normalized = []
|
|
851
855
|
|
|
852
856
|
for (const groupEntry of group) {
|
|
@@ -922,7 +926,7 @@ export function normalizePluck(pluck) {
|
|
|
922
926
|
if (Array.isArray(pluck)) {
|
|
923
927
|
/**
|
|
924
928
|
* Normalized.
|
|
925
|
-
|
|
929
|
+
* @type {FrontendModelPluck[]} */
|
|
926
930
|
const normalized = []
|
|
927
931
|
|
|
928
932
|
for (const pluckEntry of pluck) {
|
|
@@ -961,7 +965,7 @@ export function normalizePluck(pluck) {
|
|
|
961
965
|
function frontendModelResourceAttributes(modelClass) {
|
|
962
966
|
const resourceConfig = /**
|
|
963
967
|
* Narrows the runtime value to the documented type.
|
|
964
|
-
|
|
968
|
+
* @type {Record<string, ?>} */ (modelClass.resourceConfig())
|
|
965
969
|
const attributes = resourceConfig.attributes
|
|
966
970
|
|
|
967
971
|
if (Array.isArray(attributes)) {
|
|
@@ -1080,19 +1084,19 @@ function reverseSortDirection(direction) {
|
|
|
1080
1084
|
export default class FrontendModelQuery {
|
|
1081
1085
|
/**
|
|
1082
1086
|
* Ransack.
|
|
1083
|
-
|
|
1087
|
+
* @type {Record<string, ?>[]} */
|
|
1084
1088
|
_ransack = []
|
|
1085
1089
|
/**
|
|
1086
1090
|
* Searches.
|
|
1087
|
-
|
|
1091
|
+
* @type {FrontendModelSearch[]} */
|
|
1088
1092
|
_searches = []
|
|
1089
1093
|
/**
|
|
1090
1094
|
* Sort.
|
|
1091
|
-
|
|
1095
|
+
* @type {FrontendModelSort[]} */
|
|
1092
1096
|
_sort = []
|
|
1093
1097
|
/**
|
|
1094
1098
|
* Group.
|
|
1095
|
-
|
|
1099
|
+
* @type {FrontendModelGroup[]} */
|
|
1096
1100
|
_group = []
|
|
1097
1101
|
|
|
1098
1102
|
/**
|
|
@@ -1109,11 +1113,11 @@ export default class FrontendModelQuery {
|
|
|
1109
1113
|
this._searches = []
|
|
1110
1114
|
/**
|
|
1111
1115
|
* Narrows the runtime value to the documented type.
|
|
1112
|
-
|
|
1116
|
+
* @type {Record<string, string[]>} */
|
|
1113
1117
|
this._select = {}
|
|
1114
1118
|
/**
|
|
1115
1119
|
* Narrows the runtime value to the documented type.
|
|
1116
|
-
|
|
1120
|
+
* @type {Record<string, string[]>} */
|
|
1117
1121
|
this._selectsExtra = {}
|
|
1118
1122
|
this._sort = []
|
|
1119
1123
|
this._group = []
|
|
@@ -1124,11 +1128,11 @@ export default class FrontendModelQuery {
|
|
|
1124
1128
|
this._perPage = null
|
|
1125
1129
|
/**
|
|
1126
1130
|
* Narrows the runtime value to the documented type.
|
|
1127
|
-
|
|
1131
|
+
* @type {Array<{attributeName: string, relationshipName: string, where?: Record<string, ?>}>} */
|
|
1128
1132
|
this._withCount = []
|
|
1129
1133
|
/**
|
|
1130
1134
|
* Narrows the runtime value to the documented type.
|
|
1131
|
-
|
|
1135
|
+
* @type {Array<string | Record<string, ?>>} */
|
|
1132
1136
|
this._queryData = []
|
|
1133
1137
|
/**
|
|
1134
1138
|
* Per-record ability spec. Normalized to a list of
|
|
@@ -1231,7 +1235,7 @@ export default class FrontendModelQuery {
|
|
|
1231
1235
|
|
|
1232
1236
|
this._queryData.push(/**
|
|
1233
1237
|
* Narrows the runtime value to the documented type.
|
|
1234
|
-
|
|
1238
|
+
* @type {?} */ (spec))
|
|
1235
1239
|
|
|
1236
1240
|
return this
|
|
1237
1241
|
}
|
|
@@ -1268,7 +1272,7 @@ export default class FrontendModelQuery {
|
|
|
1268
1272
|
|
|
1269
1273
|
const scopedQuery = /**
|
|
1270
1274
|
* Narrows the runtime value to the documented type.
|
|
1271
|
-
|
|
1275
|
+
* @type {this | void} */ (scopeDescriptor.callback({
|
|
1272
1276
|
driver: null,
|
|
1273
1277
|
modelClass: this.modelClass,
|
|
1274
1278
|
query: this,
|
|
@@ -1312,7 +1316,7 @@ export default class FrontendModelQuery {
|
|
|
1312
1316
|
const rootModelName = this.modelClass.getModelName()
|
|
1313
1317
|
const selectMap = /**
|
|
1314
1318
|
* Narrows the runtime value to the documented type.
|
|
1315
|
-
|
|
1319
|
+
* @type {Record<string, string[]>} */ (this._select)
|
|
1316
1320
|
const existingRootAttributes = selectMap[rootModelName]
|
|
1317
1321
|
|
|
1318
1322
|
if (!existingRootAttributes) {
|
|
@@ -1520,7 +1524,7 @@ export default class FrontendModelQuery {
|
|
|
1520
1524
|
clone() {
|
|
1521
1525
|
const newQuery = /**
|
|
1522
1526
|
* Narrows the runtime value to the documented type.
|
|
1523
|
-
|
|
1527
|
+
* @type {FrontendModelQuery<T>} */ (new FrontendModelQuery({
|
|
1524
1528
|
modelClass: this.modelClass,
|
|
1525
1529
|
preload: normalizePreload(this._preload)
|
|
1526
1530
|
}))
|
|
@@ -1763,7 +1767,7 @@ export default class FrontendModelQuery {
|
|
|
1763
1767
|
paginationPayload() {
|
|
1764
1768
|
/**
|
|
1765
1769
|
* Payload.
|
|
1766
|
-
|
|
1770
|
+
* @type {Record<string, ?>} */
|
|
1767
1771
|
const payload = {}
|
|
1768
1772
|
|
|
1769
1773
|
if (this._limit !== null) payload.limit = this._limit
|
|
@@ -1782,7 +1786,7 @@ export default class FrontendModelQuery {
|
|
|
1782
1786
|
assertEventQuerySupported() {
|
|
1783
1787
|
/**
|
|
1784
1788
|
* Unsupported options.
|
|
1785
|
-
|
|
1789
|
+
* @type {string[]} */
|
|
1786
1790
|
const unsupportedOptions = []
|
|
1787
1791
|
|
|
1788
1792
|
if (this._sort.length > 0) unsupportedOptions.push("sort")
|
|
@@ -1872,7 +1876,7 @@ export default class FrontendModelQuery {
|
|
|
1872
1876
|
const modelsData = Array.isArray(response.models) ? response.models : []
|
|
1873
1877
|
/**
|
|
1874
1878
|
* Models.
|
|
1875
|
-
|
|
1879
|
+
* @type {InstanceType<T>[]} */
|
|
1876
1880
|
const models = modelsData.map((model) => this.modelClass.instantiateFromResponse(model))
|
|
1877
1881
|
|
|
1878
1882
|
// Share a single cohort reference across every sibling so auto-batch-preload
|
|
@@ -1881,7 +1885,7 @@ export default class FrontendModelQuery {
|
|
|
1881
1885
|
for (const model of models) {
|
|
1882
1886
|
/**
|
|
1883
1887
|
* Narrows the runtime value to the documented type.
|
|
1884
|
-
|
|
1888
|
+
* @type {?} */ (model)._loadCohort = models
|
|
1885
1889
|
}
|
|
1886
1890
|
|
|
1887
1891
|
return models
|
|
@@ -2094,7 +2098,9 @@ export default class FrontendModelQuery {
|
|
|
2094
2098
|
|
|
2095
2099
|
if (model) return model
|
|
2096
2100
|
|
|
2097
|
-
|
|
2101
|
+
const ModelClass = /** @type {new (attributes?: Record<string, FrontendModelAttributeValue>) => InstanceType<T>} */ (/** @type {unknown} */ (this.modelClass))
|
|
2102
|
+
|
|
2103
|
+
return new ModelClass(/** @type {Record<string, FrontendModelAttributeValue>} */ (normalizedConditions))
|
|
2098
2104
|
}
|
|
2099
2105
|
|
|
2100
2106
|
/**
|
|
@@ -2109,9 +2115,8 @@ export default class FrontendModelQuery {
|
|
|
2109
2115
|
|
|
2110
2116
|
if (model) return model
|
|
2111
2117
|
|
|
2112
|
-
const
|
|
2113
|
-
|
|
2114
|
-
@type {InstanceType<T>} */ (new this.modelClass(normalizedConditions))
|
|
2118
|
+
const ModelClass = /** @type {new (attributes?: Record<string, FrontendModelAttributeValue>) => InstanceType<T>} */ (/** @type {unknown} */ (this.modelClass))
|
|
2119
|
+
const newModel = new ModelClass(/** @type {Record<string, FrontendModelAttributeValue>} */ (normalizedConditions))
|
|
2115
2120
|
|
|
2116
2121
|
if (callback) {
|
|
2117
2122
|
await callback(newModel)
|
|
@@ -2226,7 +2231,7 @@ function frontendModelEventQuery(modelClass, options = {}) {
|
|
|
2226
2231
|
|
|
2227
2232
|
const optionsObject = /**
|
|
2228
2233
|
* Narrows the runtime value to the documented type.
|
|
2229
|
-
|
|
2234
|
+
* @type {FrontendModelEventOptionsObject} */ (options)
|
|
2230
2235
|
const query = frontendModelEventQueryFromOptionsObject(modelClass, optionsObject)
|
|
2231
2236
|
|
|
2232
2237
|
applyFrontendModelProjectionOptions(query, optionsObject)
|
|
@@ -61,7 +61,7 @@ export function frontendModelResourceConfigurationFromDefinition(resourceDefinit
|
|
|
61
61
|
function normalizeFrontendModelResourceConfiguration(resourceConfiguration) {
|
|
62
62
|
const restArgs = /**
|
|
63
63
|
* Narrows the runtime value to the documented type.
|
|
64
|
-
|
|
64
|
+
* @type {Record<string, ?>} */ ({...resourceConfiguration})
|
|
65
65
|
|
|
66
66
|
for (const key of [
|
|
67
67
|
"abilities",
|
|
@@ -120,7 +120,7 @@ function normalizeFrontendModelResourceAbilities(abilities) {
|
|
|
120
120
|
|
|
121
121
|
/**
|
|
122
122
|
* Normalized.
|
|
123
|
-
|
|
123
|
+
* @type {Record<string, string>} */
|
|
124
124
|
const normalized = {}
|
|
125
125
|
|
|
126
126
|
if (abilities.includes("create")) normalized.create = "create"
|
|
@@ -206,7 +206,7 @@ function normalizeFrontendModelBuiltInCommands({commandDefaults, commandsConfig,
|
|
|
206
206
|
|
|
207
207
|
/**
|
|
208
208
|
* Normalized commands.
|
|
209
|
-
|
|
209
|
+
* @type {Record<string, string>} */
|
|
210
210
|
const normalizedCommands = {}
|
|
211
211
|
|
|
212
212
|
for (const commandType of commandsConfig) {
|
|
@@ -244,7 +244,7 @@ function normalizeFrontendModelCustomCommands({commandsConfig, modelName}) {
|
|
|
244
244
|
|
|
245
245
|
/**
|
|
246
246
|
* Normalized commands.
|
|
247
|
-
|
|
247
|
+
* @type {Record<string, string>} */
|
|
248
248
|
const normalizedCommands = {}
|
|
249
249
|
|
|
250
250
|
for (const methodName of commandsConfig) {
|
|
@@ -302,12 +302,12 @@ export function frontendModelActionForCommand({commandName, modelName, resourceD
|
|
|
302
302
|
commandName: configuredCommandName,
|
|
303
303
|
commandType: /**
|
|
304
304
|
* Narrows the runtime value to the documented type.
|
|
305
|
-
|
|
305
|
+
* @type {"attach" | "create" | "destroy" | "download" | "find" | "index" | "update" | "url"} */ (action),
|
|
306
306
|
modelName
|
|
307
307
|
})
|
|
308
308
|
|
|
309
309
|
if (commandName === validatedCommandName) {
|
|
310
|
-
return /**
|
|
310
|
+
return /** @type {"attach" | "create" | "destroy" | "download" | "find" | "index" | "update" | "url"} */ (action)
|
|
311
311
|
}
|
|
312
312
|
}
|
|
313
313
|
|
|
@@ -139,7 +139,7 @@ export function isBackendModelInstance(value) {
|
|
|
139
139
|
|
|
140
140
|
const candidate = /**
|
|
141
141
|
* Narrows the runtime value to the documented type.
|
|
142
|
-
|
|
142
|
+
* @type {Record<string, ?>} */ (value)
|
|
143
143
|
|
|
144
144
|
return (
|
|
145
145
|
typeof candidate.attributes === "function"
|
|
@@ -195,12 +195,12 @@ function serializeFrontendModelTransportValueInternal(value, seenModels) {
|
|
|
195
195
|
|
|
196
196
|
/**
|
|
197
197
|
* Serialized model.
|
|
198
|
-
|
|
198
|
+
* @type {Record<string, ?>} */
|
|
199
199
|
const serializedModel = {
|
|
200
200
|
[TYPE_KEY]: TYPE_FRONTEND_MODEL,
|
|
201
201
|
attributes: /**
|
|
202
202
|
* Narrows the runtime value to the documented type.
|
|
203
|
-
|
|
203
|
+
* @type {Record<string, ?>} */ (serializeFrontendModelTransportValueInternal(modelAttributes, seenModels)),
|
|
204
204
|
modelName
|
|
205
205
|
}
|
|
206
206
|
|
|
@@ -212,7 +212,7 @@ function serializeFrontendModelTransportValueInternal(value, seenModels) {
|
|
|
212
212
|
|
|
213
213
|
/**
|
|
214
214
|
* Preloaded relationships.
|
|
215
|
-
|
|
215
|
+
* @type {Record<string, ?>} */
|
|
216
216
|
const preloadedRelationships = {}
|
|
217
217
|
const relationshipsMap = value.getModelClass().getRelationshipsMap()
|
|
218
218
|
|
|
@@ -241,7 +241,7 @@ function serializeFrontendModelTransportValueInternal(value, seenModels) {
|
|
|
241
241
|
if (isPlainObject(value)) {
|
|
242
242
|
/**
|
|
243
243
|
* Serialized.
|
|
244
|
-
|
|
244
|
+
* @type {Record<string, ?>} */
|
|
245
245
|
const serialized = {}
|
|
246
246
|
|
|
247
247
|
for (const [key, nestedValue] of Object.entries(value)) {
|
|
@@ -262,11 +262,11 @@ function serializeFrontendModelTransportValueInternal(value, seenModels) {
|
|
|
262
262
|
function deserializeFrontendModelMarker(marker) {
|
|
263
263
|
const attributes = /**
|
|
264
264
|
* Narrows the runtime value to the documented type.
|
|
265
|
-
|
|
265
|
+
* @type {Record<string, ?>} */ (deserializeFrontendModelTransportValue(marker.attributes))
|
|
266
266
|
const preloadedRelationships = isPlainObject(marker.preloadedRelationships)
|
|
267
267
|
? /**
|
|
268
268
|
* Narrows the runtime value to the documented type.
|
|
269
|
-
|
|
269
|
+
* @type {Record<string, ?>} */ (deserializeFrontendModelTransportValue(marker.preloadedRelationships))
|
|
270
270
|
: {}
|
|
271
271
|
const modelClass = resolveFrontendModelClass(marker.modelName)
|
|
272
272
|
|
|
@@ -320,7 +320,7 @@ export function deserializeFrontendModelTransportValue(value) {
|
|
|
320
320
|
if (isDateMarker(value)) {
|
|
321
321
|
const dateValue = /**
|
|
322
322
|
* Narrows the runtime value to the documented type.
|
|
323
|
-
|
|
323
|
+
* @type {{value: string}} */ (value).value
|
|
324
324
|
|
|
325
325
|
return new Date(dateValue)
|
|
326
326
|
}
|
|
@@ -328,7 +328,7 @@ export function deserializeFrontendModelTransportValue(value) {
|
|
|
328
328
|
if (isBigIntMarker(value)) {
|
|
329
329
|
const bigintValue = /**
|
|
330
330
|
* Narrows the runtime value to the documented type.
|
|
331
|
-
|
|
331
|
+
* @type {{value: string}} */ (value).value
|
|
332
332
|
|
|
333
333
|
return BigInt(bigintValue)
|
|
334
334
|
}
|
|
@@ -336,7 +336,7 @@ export function deserializeFrontendModelTransportValue(value) {
|
|
|
336
336
|
if (isNonFiniteNumberMarker(value)) {
|
|
337
337
|
const numberValue = /**
|
|
338
338
|
* Narrows the runtime value to the documented type.
|
|
339
|
-
|
|
339
|
+
* @type {{value: string}} */ (value).value
|
|
340
340
|
|
|
341
341
|
if (numberValue === NUMBER_NAN) return Number.NaN
|
|
342
342
|
if (numberValue === NUMBER_POSITIVE_INFINITY) return Number.POSITIVE_INFINITY
|
|
@@ -355,7 +355,7 @@ export function deserializeFrontendModelTransportValue(value) {
|
|
|
355
355
|
if (isPlainObject(value)) {
|
|
356
356
|
/**
|
|
357
357
|
* Deserialized.
|
|
358
|
-
|
|
358
|
+
* @type {Record<string, ?>} */
|
|
359
359
|
const deserialized = {}
|
|
360
360
|
|
|
361
361
|
for (const [key, nestedValue] of Object.entries(value)) {
|
|
@@ -9,25 +9,25 @@ import useModelClassEvent from "./use-model-class-event.js"
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* FrontendModelClass type.
|
|
12
|
-
|
|
12
|
+
* @typedef {import("./base.js").FrontendModelClass} FrontendModelClass */
|
|
13
13
|
/**
|
|
14
14
|
* FrontendModelInstance type.
|
|
15
|
-
|
|
15
|
+
* @typedef {import("./base.js").default} FrontendModelInstance */
|
|
16
16
|
/**
|
|
17
17
|
* FrontendModelClassDestroyEventPayload type.
|
|
18
|
-
|
|
18
|
+
* @typedef {import("./use-model-class-event.js").FrontendModelDestroyEventPayload} FrontendModelClassDestroyEventPayload */
|
|
19
19
|
/**
|
|
20
20
|
* Defines this typedef.
|
|
21
|
-
|
|
21
|
+
* @typedef {{id: string}} FrontendModelInstanceDestroyEventPayload */
|
|
22
22
|
/**
|
|
23
23
|
* FrontendModelDestroyEventPayload type.
|
|
24
|
-
|
|
24
|
+
* @typedef {FrontendModelClassDestroyEventPayload | FrontendModelInstanceDestroyEventPayload} FrontendModelDestroyEventPayload */
|
|
25
25
|
/**
|
|
26
26
|
* UseDestroyedEventOptions type.
|
|
27
|
-
|
|
27
|
+
* @typedef {import("./use-model-class-event.js").UseModelClassEventOptions} UseDestroyedEventOptions */
|
|
28
28
|
/**
|
|
29
29
|
* FrontendModelDestroyEventCallback type.
|
|
30
|
-
|
|
30
|
+
* @typedef {(payload: FrontendModelDestroyEventPayload) => void} FrontendModelDestroyEventCallback */
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* Runs assert no unknown options.
|
|
@@ -94,7 +94,7 @@ function useInstanceDestroyedEvent(modelOrModels, callback, options) {
|
|
|
94
94
|
const eventCallback = useMemo(() => {
|
|
95
95
|
const wrappedCallback = (/**
|
|
96
96
|
* Narrows the runtime value to the documented type.
|
|
97
|
-
|
|
97
|
+
* @type {FrontendModelInstanceDestroyEventPayload} */ payload) => {
|
|
98
98
|
if (activeRef.current) callbackRef.current(payload)
|
|
99
99
|
}
|
|
100
100
|
|
|
@@ -113,11 +113,11 @@ function useInstanceDestroyedEvent(modelOrModels, callback, options) {
|
|
|
113
113
|
let closed = false
|
|
114
114
|
/**
|
|
115
115
|
* Unsubscribe callbacks.
|
|
116
|
-
|
|
116
|
+
* @type {Array<() => void>} */
|
|
117
117
|
const unsubscribeCallbacks = []
|
|
118
118
|
const subscriptionCallback = (/**
|
|
119
119
|
* Narrows the runtime value to the documented type.
|
|
120
|
-
|
|
120
|
+
* @type {FrontendModelInstanceDestroyEventPayload} */ payload) => {
|
|
121
121
|
if (!closed) eventCallback(payload)
|
|
122
122
|
}
|
|
123
123
|
|
|
@@ -7,28 +7,28 @@ import clearPendingDebouncedCallback from "./clear-pending-debounced-callback.js
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* FrontendModelClass type.
|
|
10
|
-
|
|
10
|
+
* @typedef {import("./base.js").FrontendModelClass} FrontendModelClass */
|
|
11
11
|
/**
|
|
12
12
|
* FrontendModelInstance type.
|
|
13
|
-
|
|
13
|
+
* @typedef {InstanceType<FrontendModelClass>} FrontendModelInstance */
|
|
14
14
|
/**
|
|
15
15
|
* FrontendModelClassEventName type.
|
|
16
|
-
|
|
16
|
+
* @typedef {"create" | "update" | "destroy"} FrontendModelClassEventName */
|
|
17
17
|
/**
|
|
18
18
|
* Defines this typedef.
|
|
19
|
-
|
|
19
|
+
* @typedef {{id: string, model: FrontendModelInstance}} FrontendModelCreateUpdateEventPayload */
|
|
20
20
|
/**
|
|
21
21
|
* Defines this typedef.
|
|
22
|
-
|
|
22
|
+
* @typedef {{id: string}} FrontendModelDestroyEventPayload */
|
|
23
23
|
/**
|
|
24
24
|
* FrontendModelClassEventPayload type.
|
|
25
|
-
|
|
25
|
+
* @typedef {FrontendModelCreateUpdateEventPayload | FrontendModelDestroyEventPayload} FrontendModelClassEventPayload */
|
|
26
26
|
/**
|
|
27
27
|
* FrontendModelClassEventCallback type.
|
|
28
|
-
|
|
28
|
+
* @typedef {(payload: FrontendModelClassEventPayload) => void} FrontendModelClassEventCallback */
|
|
29
29
|
/**
|
|
30
30
|
* Defines this typedef.
|
|
31
|
-
|
|
31
|
+
* @typedef {{active?: boolean, debounce?: boolean | number, onConnected?: () => void} & import("./query.js").FrontendModelEventOptionsObject} UseModelClassEventOptions */
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Runs assert no unknown options.
|
|
@@ -113,7 +113,7 @@ export default function useModelClassEvent(modelClass, eventOrEvents, callback,
|
|
|
113
113
|
const eventCallback = useMemo(() => {
|
|
114
114
|
const wrappedCallback = (/**
|
|
115
115
|
* Narrows the runtime value to the documented type.
|
|
116
|
-
|
|
116
|
+
* @type {FrontendModelClassEventPayload} */ payload) => {
|
|
117
117
|
if (activeRef.current) callbackRef.current(payload)
|
|
118
118
|
}
|
|
119
119
|
|
|
@@ -129,11 +129,11 @@ export default function useModelClassEvent(modelClass, eventOrEvents, callback,
|
|
|
129
129
|
let closed = false
|
|
130
130
|
/**
|
|
131
131
|
* Unsubscribe callbacks.
|
|
132
|
-
|
|
132
|
+
* @type {Array<() => void>} */
|
|
133
133
|
const unsubscribeCallbacks = []
|
|
134
134
|
const subscriptionCallback = (/**
|
|
135
135
|
* Narrows the runtime value to the documented type.
|
|
136
|
-
|
|
136
|
+
* @type {FrontendModelClassEventPayload} */ payload) => {
|
|
137
137
|
if (!closed) eventCallback(payload)
|
|
138
138
|
}
|
|
139
139
|
|