velocious 1.0.562 → 1.0.564
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 +5 -1
- package/build/background-jobs/cron-expression.js +12 -13
- package/build/background-jobs/main.js +6 -6
- package/build/background-jobs/runner-graceful-shutdown.js +2 -3
- package/build/background-jobs/scheduler.js +3 -3
- package/build/background-jobs/worker.js +8 -9
- package/build/beacon/client.js +3 -4
- package/build/configuration-types.js +1 -0
- package/build/configuration.js +44 -3
- package/build/database/drivers/sqlite/web-persistence.js +2 -5
- package/build/database/pool/async-tracked-multi-connection.js +65 -15
- package/build/database/pool/base.js +23 -7
- package/build/database/query/index.js +21 -22
- package/build/database/query/model-class-query.js +5 -6
- package/build/database/record/attachments/normalize-input.js +9 -10
- package/build/database/record/attachments/store.js +2 -2
- package/build/database/record/auditing.js +7 -8
- package/build/database/record/index.js +4 -5
- package/build/environment-handlers/node/cli/commands/generate/frontend-models.js +1 -2
- package/build/frontend-model-controller.js +49 -56
- package/build/frontend-models/base.js +17 -19
- package/build/frontend-models/outgoing-event-buffer.js +3 -4
- package/build/frontend-models/query.js +40 -44
- package/build/frontend-models/resource-definition.js +7 -8
- package/build/frontend-models/transport-serialization.js +10 -12
- package/build/frontend-models/websocket-channel.js +12 -13
- package/build/http-server/client/websocket-session.js +7 -8
- package/build/http-server/client-delivery-queue.js +167 -0
- package/build/http-server/server-client.js +9 -0
- package/build/http-server/websocket-event-log-store.js +4 -6
- package/build/http-server/websocket-events-host.js +42 -12
- package/build/http-server/worker-handler/in-process.js +53 -14
- package/build/http-server/worker-handler/index.js +88 -18
- package/build/http-server/worker-handler/worker-thread.js +2 -2
- package/build/plugins/sqljs-wasm-route.js +3 -5
- package/build/src/background-jobs/cron-expression.d.ts +0 -12
- package/build/src/background-jobs/cron-expression.d.ts.map +1 -1
- package/build/src/background-jobs/cron-expression.js +13 -13
- package/build/src/background-jobs/main.d.ts.map +1 -1
- package/build/src/background-jobs/main.js +7 -7
- package/build/src/background-jobs/runner-graceful-shutdown.d.ts +0 -6
- package/build/src/background-jobs/runner-graceful-shutdown.d.ts.map +1 -1
- package/build/src/background-jobs/runner-graceful-shutdown.js +3 -3
- package/build/src/background-jobs/scheduler.d.ts +0 -3
- package/build/src/background-jobs/scheduler.d.ts.map +1 -1
- package/build/src/background-jobs/scheduler.js +4 -4
- package/build/src/background-jobs/worker.d.ts +0 -8
- package/build/src/background-jobs/worker.d.ts.map +1 -1
- package/build/src/background-jobs/worker.js +9 -9
- package/build/src/beacon/client.d.ts +0 -4
- package/build/src/beacon/client.d.ts.map +1 -1
- package/build/src/beacon/client.js +4 -4
- package/build/src/configuration-types.d.ts +8 -0
- package/build/src/configuration-types.d.ts.map +1 -1
- package/build/src/configuration-types.js +2 -1
- package/build/src/configuration.d.ts +34 -1
- package/build/src/configuration.d.ts.map +1 -1
- package/build/src/configuration.js +40 -4
- package/build/src/database/drivers/sqlite/web-persistence.d.ts +0 -14
- package/build/src/database/drivers/sqlite/web-persistence.d.ts.map +1 -1
- package/build/src/database/drivers/sqlite/web-persistence.js +3 -3
- package/build/src/database/pool/async-tracked-multi-connection.d.ts +29 -1
- package/build/src/database/pool/async-tracked-multi-connection.d.ts.map +1 -1
- package/build/src/database/pool/async-tracked-multi-connection.js +57 -15
- package/build/src/database/pool/base.d.ts +53 -4
- package/build/src/database/pool/base.d.ts.map +1 -1
- package/build/src/database/pool/base.js +23 -6
- package/build/src/database/query/index.d.ts +18 -39
- package/build/src/database/query/index.d.ts.map +1 -1
- package/build/src/database/query/index.js +22 -22
- package/build/src/database/query/model-class-query.d.ts +0 -5
- package/build/src/database/query/model-class-query.d.ts.map +1 -1
- package/build/src/database/query/model-class-query.js +6 -6
- package/build/src/database/record/attachments/normalize-input.d.ts +0 -9
- package/build/src/database/record/attachments/normalize-input.d.ts.map +1 -1
- package/build/src/database/record/attachments/normalize-input.js +10 -10
- package/build/src/database/record/attachments/store.d.ts.map +1 -1
- package/build/src/database/record/attachments/store.js +2 -2
- package/build/src/database/record/auditing.d.ts +17 -24
- package/build/src/database/record/auditing.d.ts.map +1 -1
- package/build/src/database/record/auditing.js +8 -8
- package/build/src/database/record/index.d.ts +4 -4
- package/build/src/database/record/index.d.ts.map +1 -1
- package/build/src/database/record/index.js +5 -5
- package/build/src/environment-handlers/node/cli/commands/generate/frontend-models.d.ts +0 -39
- 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 +2 -2
- package/build/src/frontend-model-controller.d.ts +1 -1
- package/build/src/frontend-model-controller.d.ts.map +1 -1
- package/build/src/frontend-model-controller.js +50 -50
- package/build/src/frontend-models/base.d.ts.map +1 -1
- package/build/src/frontend-models/base.js +18 -18
- 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/query.d.ts +56 -37
- package/build/src/frontend-models/query.d.ts.map +1 -1
- package/build/src/frontend-models/query.js +39 -39
- package/build/src/frontend-models/resource-definition.d.ts +0 -7
- package/build/src/frontend-models/resource-definition.d.ts.map +1 -1
- package/build/src/frontend-models/resource-definition.js +8 -8
- package/build/src/frontend-models/transport-serialization.d.ts +0 -10
- package/build/src/frontend-models/transport-serialization.d.ts.map +1 -1
- package/build/src/frontend-models/transport-serialization.js +11 -11
- package/build/src/frontend-models/websocket-channel.d.ts +0 -12
- package/build/src/frontend-models/websocket-channel.d.ts.map +1 -1
- package/build/src/frontend-models/websocket-channel.js +13 -13
- package/build/src/http-server/client/websocket-session.d.ts.map +1 -1
- package/build/src/http-server/client/websocket-session.js +8 -8
- package/build/src/http-server/client-delivery-queue.d.ts +121 -0
- package/build/src/http-server/client-delivery-queue.d.ts.map +1 -0
- package/build/src/http-server/client-delivery-queue.js +152 -0
- package/build/src/http-server/server-client.d.ts +6 -0
- package/build/src/http-server/server-client.d.ts.map +1 -1
- package/build/src/http-server/server-client.js +10 -1
- package/build/src/http-server/websocket-event-log-store.d.ts +0 -14
- package/build/src/http-server/websocket-event-log-store.d.ts.map +1 -1
- package/build/src/http-server/websocket-event-log-store.js +5 -5
- package/build/src/http-server/websocket-events-host.d.ts +15 -4
- package/build/src/http-server/websocket-events-host.d.ts.map +1 -1
- package/build/src/http-server/websocket-events-host.js +39 -13
- package/build/src/http-server/worker-handler/in-process.d.ts +19 -1
- package/build/src/http-server/worker-handler/in-process.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/in-process.js +50 -14
- package/build/src/http-server/worker-handler/index.d.ts +36 -4
- package/build/src/http-server/worker-handler/index.d.ts.map +1 -1
- package/build/src/http-server/worker-handler/index.js +82 -18
- package/build/src/http-server/worker-handler/worker-thread.js +3 -3
- package/build/src/plugins/sqljs-wasm-route.d.ts.map +1 -1
- package/build/src/plugins/sqljs-wasm-route.js +4 -4
- package/build/src/sync/conflict-strategy.d.ts +0 -15
- package/build/src/sync/conflict-strategy.d.ts.map +1 -1
- package/build/src/sync/conflict-strategy.js +3 -3
- package/build/src/sync/device-identity.d.ts +0 -45
- package/build/src/sync/device-identity.d.ts.map +1 -1
- package/build/src/sync/device-identity.js +4 -4
- package/build/src/sync/local-mutation-log.d.ts +0 -41
- package/build/src/sync/local-mutation-log.d.ts.map +1 -1
- package/build/src/sync/local-mutation-log.js +9 -9
- package/build/src/sync/offline-grant.d.ts +0 -26
- package/build/src/sync/offline-grant.d.ts.map +1 -1
- package/build/src/sync/offline-grant.js +4 -4
- package/build/src/sync/peer-mutation-bundle.d.ts +0 -14
- package/build/src/sync/peer-mutation-bundle.d.ts.map +1 -1
- package/build/src/sync/peer-mutation-bundle.js +3 -3
- package/build/src/sync/server-change-feed.d.ts.map +1 -1
- package/build/src/sync/server-change-feed.js +33 -33
- package/build/src/sync/sync-api-client.d.ts +0 -9
- package/build/src/sync/sync-api-client.d.ts.map +1 -1
- package/build/src/sync/sync-api-client.js +2 -2
- package/build/src/sync/sync-envelope-replay-service.d.ts +38 -21
- package/build/src/sync/sync-envelope-replay-service.d.ts.map +1 -1
- package/build/src/sync/sync-envelope-replay-service.js +18 -18
- package/build/src/sync/sync-resource-base.d.ts +0 -7
- package/build/src/sync/sync-resource-base.d.ts.map +1 -1
- package/build/src/sync/sync-resource-base.js +2 -2
- package/build/src/sync/sync-scope-store.d.ts +0 -9
- package/build/src/sync/sync-scope-store.d.ts.map +1 -1
- package/build/src/sync/sync-scope-store.js +10 -10
- package/build/src/testing/test-filter-parser.d.ts +0 -10
- package/build/src/testing/test-filter-parser.d.ts.map +1 -1
- package/build/src/testing/test-filter-parser.js +11 -11
- package/build/src/testing/test-runner.d.ts +25 -91
- package/build/src/testing/test-runner.d.ts.map +1 -1
- package/build/src/testing/test-runner.js +113 -98
- package/build/src/testing/test.d.ts +8 -0
- package/build/src/testing/test.d.ts.map +1 -1
- package/build/src/testing/test.js +9 -9
- package/build/src/utils/backtrace-cleaner.d.ts.map +1 -1
- package/build/src/utils/backtrace-cleaner.js +9 -9
- package/build/src/utils/model-scope.d.ts +0 -8
- package/build/src/utils/model-scope.d.ts.map +1 -1
- package/build/src/utils/model-scope.js +3 -3
- package/build/src/utils/ransack.d.ts +52 -19
- package/build/src/utils/ransack.d.ts.map +1 -1
- package/build/src/utils/ransack.js +26 -26
- package/build/sync/conflict-strategy.js +3 -6
- package/build/sync/device-identity.js +4 -9
- package/build/sync/local-mutation-log.js +9 -14
- package/build/sync/offline-grant.js +4 -7
- package/build/sync/peer-mutation-bundle.js +2 -4
- package/build/sync/server-change-feed.js +32 -34
- package/build/sync/sync-api-client.js +1 -2
- package/build/sync/sync-envelope-replay-service.js +17 -19
- package/build/sync/sync-resource-base.js +1 -2
- package/build/sync/sync-scope-store.js +9 -10
- package/build/testing/test-filter-parser.js +10 -11
- package/build/testing/test-runner.js +116 -108
- package/build/testing/test.js +8 -9
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/utils/backtrace-cleaner.js +8 -9
- package/build/utils/model-scope.js +3 -4
- package/build/utils/ransack.js +27 -34
- package/package.json +3 -1
- package/scripts/eslint-rules/typedefs-first.js +67 -0
- package/scripts/prewarm-chromedriver.js +26 -0
- package/src/background-jobs/cron-expression.js +12 -13
- package/src/background-jobs/main.js +6 -6
- package/src/background-jobs/runner-graceful-shutdown.js +2 -3
- package/src/background-jobs/scheduler.js +3 -3
- package/src/background-jobs/worker.js +8 -9
- package/src/beacon/client.js +3 -4
- package/src/configuration-types.js +1 -0
- package/src/configuration.js +44 -3
- package/src/database/drivers/sqlite/web-persistence.js +2 -5
- package/src/database/pool/async-tracked-multi-connection.js +65 -15
- package/src/database/pool/base.js +23 -7
- package/src/database/query/index.js +21 -22
- package/src/database/query/model-class-query.js +5 -6
- package/src/database/record/attachments/normalize-input.js +9 -10
- package/src/database/record/attachments/store.js +2 -2
- package/src/database/record/auditing.js +7 -8
- package/src/database/record/index.js +4 -5
- package/src/environment-handlers/node/cli/commands/generate/frontend-models.js +1 -2
- package/src/frontend-model-controller.js +49 -56
- package/src/frontend-models/base.js +17 -19
- package/src/frontend-models/outgoing-event-buffer.js +3 -4
- package/src/frontend-models/query.js +40 -44
- package/src/frontend-models/resource-definition.js +7 -8
- package/src/frontend-models/transport-serialization.js +10 -12
- package/src/frontend-models/websocket-channel.js +12 -13
- package/src/http-server/client/websocket-session.js +7 -8
- package/src/http-server/client-delivery-queue.js +167 -0
- package/src/http-server/server-client.js +9 -0
- package/src/http-server/websocket-event-log-store.js +4 -6
- package/src/http-server/websocket-events-host.js +42 -12
- package/src/http-server/worker-handler/in-process.js +53 -14
- package/src/http-server/worker-handler/index.js +88 -18
- package/src/http-server/worker-handler/worker-thread.js +2 -2
- package/src/plugins/sqljs-wasm-route.js +3 -5
- package/src/sync/conflict-strategy.js +3 -6
- package/src/sync/device-identity.js +4 -9
- package/src/sync/local-mutation-log.js +9 -14
- package/src/sync/offline-grant.js +4 -7
- package/src/sync/peer-mutation-bundle.js +2 -4
- package/src/sync/server-change-feed.js +32 -34
- package/src/sync/sync-api-client.js +1 -2
- package/src/sync/sync-envelope-replay-service.js +17 -19
- package/src/sync/sync-resource-base.js +1 -2
- package/src/sync/sync-scope-store.js +9 -10
- package/src/testing/test-filter-parser.js +10 -11
- package/src/testing/test-runner.js +116 -108
- package/src/testing/test.js +8 -9
- package/src/utils/backtrace-cleaner.js +8 -9
- package/src/utils/model-scope.js +3 -4
- package/src/utils/ransack.js +27 -34
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
import UUID from "pure-uuid"
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Global audit event bus matching ActiveRecordAuditable::Events.
|
|
7
|
+
* @typedef {object} AuditEventsType
|
|
8
|
+
* @property {(type: string, action: string, args: AuditEventPayload) => void} call - Fire all callbacks for a model type + action.
|
|
9
|
+
* @property {(type: string, action: string, callback: (args: AuditEventPayload) => void) => () => void} connect - Register a callback for a model type + action. Returns an unsubscribe function.
|
|
10
|
+
* @property {() => void} reset - Clear all registered callbacks.
|
|
11
|
+
*/
|
|
5
12
|
/**
|
|
6
13
|
* AuditChanges type.
|
|
7
14
|
* @typedef {Record<string, ?>} AuditChanges
|
|
@@ -64,14 +71,6 @@ const generatedAuditRelationships = new WeakSet()
|
|
|
64
71
|
/** @type {Record<string, Record<string, Array<(args: AuditEventPayload) => void>>>} */
|
|
65
72
|
let globalEventConnections = {}
|
|
66
73
|
|
|
67
|
-
/**
|
|
68
|
-
* Global audit event bus matching ActiveRecordAuditable::Events.
|
|
69
|
-
* @typedef {object} AuditEventsType
|
|
70
|
-
* @property {(type: string, action: string, args: AuditEventPayload) => void} call - Fire all callbacks for a model type + action.
|
|
71
|
-
* @property {(type: string, action: string, callback: (args: AuditEventPayload) => void) => () => void} connect - Register a callback for a model type + action. Returns an unsubscribe function.
|
|
72
|
-
* @property {() => void} reset - Clear all registered callbacks.
|
|
73
|
-
*/
|
|
74
|
-
|
|
75
74
|
/** @type {AuditEventsType} */
|
|
76
75
|
const AuditEvents = {
|
|
77
76
|
/**
|
|
@@ -57,6 +57,10 @@ import ValidatorsUniqueness from "./validators/uniqueness.js"
|
|
|
57
57
|
import registerActsAsListCallbacks from "./acts-as-list.js"
|
|
58
58
|
import UUID from "pure-uuid"
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Translation record shape used by translated attributes.
|
|
62
|
+
* @typedef {VelociousDatabaseRecord & {locale: function(): string}} TranslationBase
|
|
63
|
+
*/
|
|
60
64
|
/**
|
|
61
65
|
* AttachmentDriverConstructor type.
|
|
62
66
|
* @typedef {import("../../configuration-types.js").AttachmentDriverConstructor} AttachmentDriverConstructor
|
|
@@ -4452,11 +4456,6 @@ class VelociousDatabaseRecord {
|
|
|
4452
4456
|
}
|
|
4453
4457
|
}
|
|
4454
4458
|
|
|
4455
|
-
/**
|
|
4456
|
-
* Translation record shape used by translated attributes.
|
|
4457
|
-
* @typedef {VelociousDatabaseRecord & {locale: function(): string}} TranslationBase
|
|
4458
|
-
*/
|
|
4459
|
-
|
|
4460
4459
|
VelociousDatabaseRecord.registerValidatorType("format", ValidatorsFormat)
|
|
4461
4460
|
VelociousDatabaseRecord.registerValidatorType("length", ValidatorsLength)
|
|
4462
4461
|
VelociousDatabaseRecord.registerValidatorType("presence", ValidatorsPresence)
|
|
@@ -6,8 +6,6 @@ import * as inflection from "inflection"
|
|
|
6
6
|
import {frontendModelResourceIsBuiltIn, frontendModelResourcesWithBuiltInsForBackendProject} from "../../../../../frontend-models/built-in-resources.js"
|
|
7
7
|
import {frontendModelResourceClassFromDefinition, frontendModelResourceConfigurationFromDefinition} from "../../../../../frontend-models/resource-definition.js"
|
|
8
8
|
|
|
9
|
-
const FRONTEND_MODELS_REGENERATE_COMMAND = "velocious generate:frontend-models"
|
|
10
|
-
|
|
11
9
|
/**
|
|
12
10
|
* Attribute metadata used for generated frontend-model JSDoc.
|
|
13
11
|
* @typedef {object} FrontendAttributeConfig
|
|
@@ -47,6 +45,7 @@ const FRONTEND_MODELS_REGENERATE_COMMAND = "velocious generate:frontend-models"
|
|
|
47
45
|
* @property {string | null} sourceFile - Source file that declared the method.
|
|
48
46
|
* @property {string} type - JSDoc parameter type.
|
|
49
47
|
*/
|
|
48
|
+
const FRONTEND_MODELS_REGENERATE_COMMAND = "velocious generate:frontend-models"
|
|
50
49
|
|
|
51
50
|
/** Node CLI command that generates frontend model classes from backend project resource config. */
|
|
52
51
|
export default class DbGenerateFrontendModels extends BaseCommand {
|
|
@@ -20,6 +20,55 @@ import isDate from "./utils/is-date.js"
|
|
|
20
20
|
import isPlainObject from "./utils/plain-object.js"
|
|
21
21
|
import {RansackQueryError, normalizeRansackGroup, parseRansackSort} from "./utils/ransack.js"
|
|
22
22
|
|
|
23
|
+
/**
|
|
24
|
+
* FrontendModelSearch type.
|
|
25
|
+
* @typedef {object} FrontendModelSearch
|
|
26
|
+
* @property {string[]} path - Relationship path.
|
|
27
|
+
* @property {string} column - Column or attribute name.
|
|
28
|
+
* @property {"eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq"} operator - Search operator.
|
|
29
|
+
* @property {?} value - Search value.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* FrontendModelSort type.
|
|
33
|
+
* @typedef {object} FrontendModelSort
|
|
34
|
+
* @property {string} column - Attribute name to sort by.
|
|
35
|
+
* @property {"asc" | "desc"} direction - Sort direction.
|
|
36
|
+
* @property {string[]} path - Relationship path from root model.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* FrontendModelGroup type.
|
|
40
|
+
* @typedef {object} FrontendModelGroup
|
|
41
|
+
* @property {string} column - Attribute name to group by.
|
|
42
|
+
* @property {string[]} path - Relationship path from root model.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* FrontendModelPluck type.
|
|
46
|
+
* @typedef {object} FrontendModelPluck
|
|
47
|
+
* @property {string} column - Attribute name to pluck.
|
|
48
|
+
* @property {string[]} path - Relationship path from root model.
|
|
49
|
+
*/
|
|
50
|
+
/**
|
|
51
|
+
* FrontendModelPagination type.
|
|
52
|
+
* @typedef {object} FrontendModelPagination
|
|
53
|
+
* @property {number | null} limit - Maximum number of records.
|
|
54
|
+
* @property {number | null} offset - Number of records to skip.
|
|
55
|
+
* @property {number | null} page - 1-based page number.
|
|
56
|
+
* @property {number | null} perPage - Page size.
|
|
57
|
+
*/
|
|
58
|
+
/**
|
|
59
|
+
* @typedef {import("./configuration-types.js").ClientErrorPayloadContext & {
|
|
60
|
+
* action: string,
|
|
61
|
+
* expectedError: boolean,
|
|
62
|
+
* frontendModelEndpoint: true
|
|
63
|
+
* }} FrontendModelEndpointErrorContext
|
|
64
|
+
*/
|
|
65
|
+
/**
|
|
66
|
+
* FrontendModelIndexQueryOptions type.
|
|
67
|
+
* @typedef {object} FrontendModelIndexQueryOptions
|
|
68
|
+
* @property {boolean} [includePagination] - Whether frontend-model pagination params should be applied.
|
|
69
|
+
* @property {boolean} [includeSort] - Whether frontend-model sort params should be applied.
|
|
70
|
+
* @property {import("./frontend-model-resource/base-resource.js").default} [resource] - Resource providing query hooks.
|
|
71
|
+
*/
|
|
23
72
|
/** @typedef {import("./database/query/model-class-query.js").default & Record<symbol, Set<string> | undefined>} FrontendModelQueryMetadata */
|
|
24
73
|
|
|
25
74
|
/**
|
|
@@ -114,62 +163,6 @@ function normalizeFrontendModelSelect(select, rootModelName = null) {
|
|
|
114
163
|
return normalized
|
|
115
164
|
}
|
|
116
165
|
|
|
117
|
-
/**
|
|
118
|
-
* FrontendModelSearch type.
|
|
119
|
-
* @typedef {object} FrontendModelSearch
|
|
120
|
-
* @property {string[]} path - Relationship path.
|
|
121
|
-
* @property {string} column - Column or attribute name.
|
|
122
|
-
* @property {"eq" | "like" | "notEq" | "gt" | "gteq" | "lt" | "lteq"} operator - Search operator.
|
|
123
|
-
* @property {?} value - Search value.
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
/**
|
|
127
|
-
* FrontendModelSort type.
|
|
128
|
-
* @typedef {object} FrontendModelSort
|
|
129
|
-
* @property {string} column - Attribute name to sort by.
|
|
130
|
-
* @property {"asc" | "desc"} direction - Sort direction.
|
|
131
|
-
* @property {string[]} path - Relationship path from root model.
|
|
132
|
-
*/
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
* FrontendModelGroup type.
|
|
136
|
-
* @typedef {object} FrontendModelGroup
|
|
137
|
-
* @property {string} column - Attribute name to group by.
|
|
138
|
-
* @property {string[]} path - Relationship path from root model.
|
|
139
|
-
*/
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* FrontendModelPluck type.
|
|
143
|
-
* @typedef {object} FrontendModelPluck
|
|
144
|
-
* @property {string} column - Attribute name to pluck.
|
|
145
|
-
* @property {string[]} path - Relationship path from root model.
|
|
146
|
-
*/
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* FrontendModelPagination type.
|
|
150
|
-
* @typedef {object} FrontendModelPagination
|
|
151
|
-
* @property {number | null} limit - Maximum number of records.
|
|
152
|
-
* @property {number | null} offset - Number of records to skip.
|
|
153
|
-
* @property {number | null} page - 1-based page number.
|
|
154
|
-
* @property {number | null} perPage - Page size.
|
|
155
|
-
*/
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* @typedef {import("./configuration-types.js").ClientErrorPayloadContext & {
|
|
159
|
-
* action: string,
|
|
160
|
-
* expectedError: boolean,
|
|
161
|
-
* frontendModelEndpoint: true
|
|
162
|
-
* }} FrontendModelEndpointErrorContext
|
|
163
|
-
*/
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* FrontendModelIndexQueryOptions type.
|
|
167
|
-
* @typedef {object} FrontendModelIndexQueryOptions
|
|
168
|
-
* @property {boolean} [includePagination] - Whether frontend-model pagination params should be applied.
|
|
169
|
-
* @property {boolean} [includeSort] - Whether frontend-model sort params should be applied.
|
|
170
|
-
* @property {import("./frontend-model-resource/base-resource.js").default} [resource] - Resource providing query hooks.
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
166
|
const frontendModelJoinedPathsSymbol = Symbol("frontendModelJoinedPaths")
|
|
174
167
|
const frontendModelGroupedColumnsSymbol = Symbol("frontendModelGroupedColumns")
|
|
175
168
|
const frontendModelWhereNoMatchSymbol = Symbol("frontendModelWhereNoMatch")
|
|
@@ -17,6 +17,23 @@ import {defineModelScope} from "../utils/model-scope.js"
|
|
|
17
17
|
import isPlainObject from "../utils/plain-object.js"
|
|
18
18
|
import {readPayloadAssociationCount, readPayloadComputedAbility, readPayloadQueryData, setPayloadAssociationCount, setPayloadComputedAbility, setPayloadQueryData} from "../record-payload-values.js"
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Frontend model relationship helper type. Returned by `getRelationshipByName`,
|
|
22
|
+
* which generated models immediately cast to their concrete relationship type
|
|
23
|
+
* (e.g. `FrontendModelSingularRelationship<Owner, Target, TargetCreateAttributes>`).
|
|
24
|
+
* The members use `any` type args so that cast is allowed regardless of the
|
|
25
|
+
* target model's typed-attribute generics — a concrete `FrontendModelBase` member
|
|
26
|
+
* here makes the cast a non-overlapping (TS2352) error for every typed model.
|
|
27
|
+
* @typedef {FrontendModelHasManyRelationship<any, any, any> | FrontendModelSingularRelationship<any, any, any>} FrontendModelRelationship
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* Defines this typedef.
|
|
31
|
+
* @typedef {{callback: (payload: {id: string, model: FrontendModelBase}) => void, eventFilterKey: string | null, eventFilterPayload: import("./query.js").FrontendModelEventFilterPayload | null, projectionPayload: import("./query.js").FrontendModelProjectionPayload}} FrontendModelModelEventCallbackEntry
|
|
32
|
+
*/
|
|
33
|
+
/**
|
|
34
|
+
* Defines this typedef.
|
|
35
|
+
* @typedef {{callback: (payload: {id: string}) => void}} FrontendModelDestroyEventCallbackEntry
|
|
36
|
+
*/
|
|
20
37
|
/**
|
|
21
38
|
* FrontendModelCommandType type.
|
|
22
39
|
* @typedef {"create" | "find" | "index" | "update" | "destroy" | "attach" | "attachmentList" | "download" | "url"} FrontendModelCommandType */
|
|
@@ -658,16 +675,6 @@ export class FrontendModelHasManyRelationship {
|
|
|
658
675
|
}
|
|
659
676
|
}
|
|
660
677
|
|
|
661
|
-
/**
|
|
662
|
-
* Frontend model relationship helper type. Returned by `getRelationshipByName`,
|
|
663
|
-
* which generated models immediately cast to their concrete relationship type
|
|
664
|
-
* (e.g. `FrontendModelSingularRelationship<Owner, Target, TargetCreateAttributes>`).
|
|
665
|
-
* The members use `any` type args so that cast is allowed regardless of the
|
|
666
|
-
* target model's typed-attribute generics — a concrete `FrontendModelBase` member
|
|
667
|
-
* here makes the cast a non-overlapping (TS2352) error for every typed model.
|
|
668
|
-
* @typedef {FrontendModelHasManyRelationship<any, any, any> | FrontendModelSingularRelationship<any, any, any>} FrontendModelRelationship
|
|
669
|
-
*/
|
|
670
|
-
|
|
671
678
|
/**
|
|
672
679
|
* Copies loaded relationship state between helpers of the same relationship shape.
|
|
673
680
|
* @param {object} args - Arguments.
|
|
@@ -1279,15 +1286,6 @@ function cloneFrontendModelAttributes(value) {
|
|
|
1279
1286
|
*/
|
|
1280
1287
|
const FRONTEND_MODELS_CHANNEL_NAME = "frontend-models"
|
|
1281
1288
|
|
|
1282
|
-
/**
|
|
1283
|
-
* Defines this typedef.
|
|
1284
|
-
* @typedef {{callback: (payload: {id: string, model: FrontendModelBase}) => void, eventFilterKey: string | null, eventFilterPayload: import("./query.js").FrontendModelEventFilterPayload | null, projectionPayload: import("./query.js").FrontendModelProjectionPayload}} FrontendModelModelEventCallbackEntry
|
|
1285
|
-
*/
|
|
1286
|
-
/**
|
|
1287
|
-
* Defines this typedef.
|
|
1288
|
-
* @typedef {{callback: (payload: {id: string}) => void}} FrontendModelDestroyEventCallbackEntry
|
|
1289
|
-
*/
|
|
1290
|
-
|
|
1291
1289
|
/**
|
|
1292
1290
|
* Runs merge frontend model event preload.
|
|
1293
1291
|
* @param {Record<string, import("./query.js").FrontendModelTransportValue>} target - Target preload payload.
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
// @ts-check
|
|
2
|
-
|
|
3
|
-
const MAX_BUFFERED_OUTGOING_EVENTS = 50
|
|
4
|
-
|
|
5
1
|
/**
|
|
6
2
|
* BufferedOutgoingEvent type.
|
|
7
3
|
* @typedef {object} BufferedOutgoingEvent
|
|
8
4
|
* @property {string} customPath - Request path.
|
|
9
5
|
* @property {Record<string, ?>} payload - Command payload.
|
|
10
6
|
*/
|
|
7
|
+
// @ts-check
|
|
8
|
+
|
|
9
|
+
const MAX_BUFFERED_OUTGOING_EVENTS = 50
|
|
11
10
|
|
|
12
11
|
/**
|
|
13
12
|
* Buffer.
|
|
@@ -5,28 +5,6 @@ import {normalizeRansackGroup, parseRansackSort} from "../utils/ransack.js"
|
|
|
5
5
|
import {isModelScopeDescriptor} from "../utils/model-scope.js"
|
|
6
6
|
import isPlainObject from "../utils/plain-object.js"
|
|
7
7
|
|
|
8
|
-
/** Error raised when a frontend-model query descriptor is malformed. */
|
|
9
|
-
export class FrontendModelQueryError extends Error {
|
|
10
|
-
/**
|
|
11
|
-
* Creates a frontend-model query error.
|
|
12
|
-
* @param {string} message - Error message.
|
|
13
|
-
*/
|
|
14
|
-
constructor(message) {
|
|
15
|
-
super(message)
|
|
16
|
-
|
|
17
|
-
this.name = "FrontendModelQueryError"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Builds a query descriptor error.
|
|
23
|
-
* @param {string} message - Error message.
|
|
24
|
-
* @returns {FrontendModelQueryError} - Query descriptor error.
|
|
25
|
-
*/
|
|
26
|
-
function frontendModelQueryError(message) {
|
|
27
|
-
return new FrontendModelQueryError(message)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
8
|
/**
|
|
31
9
|
* FrontendModelSearch type.
|
|
32
10
|
* @typedef {object} FrontendModelSearch
|
|
@@ -97,6 +75,46 @@ function frontendModelQueryError(message) {
|
|
|
97
75
|
* @property {FrontendModelEventFilterPayload | null} eventFilterPayload - Normalized event filter payload, or null when unfiltered.
|
|
98
76
|
* @property {FrontendModelProjectionPayload} projectionPayload - Normalized event serialization projection payload.
|
|
99
77
|
*/
|
|
78
|
+
/**
|
|
79
|
+
* FrontendModelSort type.
|
|
80
|
+
* @typedef {object} FrontendModelSort
|
|
81
|
+
* @property {string} column - Attribute name to sort by.
|
|
82
|
+
* @property {"asc" | "desc"} direction - Sort direction.
|
|
83
|
+
* @property {string[]} path - Relationship path from root model.
|
|
84
|
+
*/
|
|
85
|
+
/**
|
|
86
|
+
* FrontendModelGroup type.
|
|
87
|
+
* @typedef {object} FrontendModelGroup
|
|
88
|
+
* @property {string} column - Attribute name to group by.
|
|
89
|
+
* @property {string[]} path - Relationship path from root model.
|
|
90
|
+
*/
|
|
91
|
+
/**
|
|
92
|
+
* FrontendModelPluck type.
|
|
93
|
+
* @typedef {object} FrontendModelPluck
|
|
94
|
+
* @property {string} column - Attribute name to pluck.
|
|
95
|
+
* @property {string[]} path - Relationship path from root model.
|
|
96
|
+
*/
|
|
97
|
+
/** Error raised when a frontend-model query descriptor is malformed. */
|
|
98
|
+
export class FrontendModelQueryError extends Error {
|
|
99
|
+
/**
|
|
100
|
+
* Creates a frontend-model query error.
|
|
101
|
+
* @param {string} message - Error message.
|
|
102
|
+
*/
|
|
103
|
+
constructor(message) {
|
|
104
|
+
super(message)
|
|
105
|
+
|
|
106
|
+
this.name = "FrontendModelQueryError"
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Builds a query descriptor error.
|
|
112
|
+
* @param {string} message - Error message.
|
|
113
|
+
* @returns {FrontendModelQueryError} - Query descriptor error.
|
|
114
|
+
*/
|
|
115
|
+
function frontendModelQueryError(message) {
|
|
116
|
+
return new FrontendModelQueryError(message)
|
|
117
|
+
}
|
|
100
118
|
|
|
101
119
|
/**
|
|
102
120
|
* Runs the normalizePreload helper.
|
|
@@ -490,28 +508,6 @@ export function normalizeJoins(joins) {
|
|
|
490
508
|
return normalized
|
|
491
509
|
}
|
|
492
510
|
|
|
493
|
-
/**
|
|
494
|
-
* FrontendModelSort type.
|
|
495
|
-
* @typedef {object} FrontendModelSort
|
|
496
|
-
* @property {string} column - Attribute name to sort by.
|
|
497
|
-
* @property {"asc" | "desc"} direction - Sort direction.
|
|
498
|
-
* @property {string[]} path - Relationship path from root model.
|
|
499
|
-
*/
|
|
500
|
-
|
|
501
|
-
/**
|
|
502
|
-
* FrontendModelGroup type.
|
|
503
|
-
* @typedef {object} FrontendModelGroup
|
|
504
|
-
* @property {string} column - Attribute name to group by.
|
|
505
|
-
* @property {string[]} path - Relationship path from root model.
|
|
506
|
-
*/
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* FrontendModelPluck type.
|
|
510
|
-
* @typedef {object} FrontendModelPluck
|
|
511
|
-
* @property {string} column - Attribute name to pluck.
|
|
512
|
-
* @property {string[]} path - Relationship path from root model.
|
|
513
|
-
*/
|
|
514
|
-
|
|
515
511
|
/**
|
|
516
512
|
* Runs normalize sort direction.
|
|
517
513
|
* @param {?} direction - Direction value.
|
|
@@ -5,6 +5,13 @@ import FrontendModelBaseResource from "../frontend-model-resource/base-resource.
|
|
|
5
5
|
import restArgsError from "../utils/rest-args-error.js"
|
|
6
6
|
import {validateFrontendModelResourceCommandName} from "./resource-config-validation.js"
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Resolved frontend-model resource registration for a replay resource type.
|
|
10
|
+
* @typedef {object} FrontendModelResolvedResourceRegistration
|
|
11
|
+
* @property {string} modelName - Effective frontend model name (modelName override or registry key).
|
|
12
|
+
* @property {import("../configuration-types.js").FrontendModelResourceClassType} resourceClass - Registered resource class.
|
|
13
|
+
* @property {import("../configuration-types.js").NormalizedFrontendModelResourceConfiguration} resourceConfiguration - Normalized resource configuration.
|
|
14
|
+
*/
|
|
8
15
|
const BASE_FRONTEND_MODEL_ABILITY_ACTIONS = ["create", "destroy", "read", "update"]
|
|
9
16
|
const SHA256_INITIAL_HASH = [
|
|
10
17
|
0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
|
|
@@ -1027,14 +1034,6 @@ function normalizeFrontendModelResourcePathForMatch(path) {
|
|
|
1027
1034
|
return withLeadingSlash
|
|
1028
1035
|
}
|
|
1029
1036
|
|
|
1030
|
-
/**
|
|
1031
|
-
* Resolved frontend-model resource registration for a replay resource type.
|
|
1032
|
-
* @typedef {object} FrontendModelResolvedResourceRegistration
|
|
1033
|
-
* @property {string} modelName - Effective frontend model name (modelName override or registry key).
|
|
1034
|
-
* @property {import("../configuration-types.js").FrontendModelResourceClassType} resourceClass - Registered resource class.
|
|
1035
|
-
* @property {import("../configuration-types.js").NormalizedFrontendModelResourceConfiguration} resourceConfiguration - Normalized resource configuration.
|
|
1036
|
-
*/
|
|
1037
|
-
|
|
1038
1037
|
/**
|
|
1039
1038
|
* Resolves the registered frontend-model resource class for a resource type
|
|
1040
1039
|
* across all backend projects. A resource's effective name is its
|
|
@@ -4,28 +4,26 @@ import {resolveFrontendModelClass} from "./model-registry.js"
|
|
|
4
4
|
import isPlainObject from "../utils/plain-object.js"
|
|
5
5
|
import {formatDateInTimeZone, validateTimeZone} from "../time-zone.js"
|
|
6
6
|
|
|
7
|
-
const TYPE_KEY = "__velocious_type"
|
|
8
|
-
const TYPE_DATE = "date"
|
|
9
|
-
const TYPE_UNDEFINED = "undefined"
|
|
10
|
-
const TYPE_BIGINT = "bigint"
|
|
11
|
-
const TYPE_NUMBER = "number"
|
|
12
|
-
const TYPE_FRONTEND_MODEL = "frontend_model"
|
|
13
|
-
const NUMBER_NAN = "NaN"
|
|
14
|
-
const NUMBER_POSITIVE_INFINITY = "Infinity"
|
|
15
|
-
const NUMBER_NEGATIVE_INFINITY = "-Infinity"
|
|
16
|
-
const PRELOADED_RELATIONSHIPS_KEY = "__preloadedRelationships"
|
|
17
|
-
|
|
18
7
|
/**
|
|
19
8
|
* Frontend model transport serialization options.
|
|
20
9
|
* @typedef {object} FrontendModelTransportSerializationOptions
|
|
21
10
|
* @property {string | undefined} [timeZone] - IANA timezone used when serializing Date instants.
|
|
22
11
|
*/
|
|
23
|
-
|
|
24
12
|
/**
|
|
25
13
|
* Normalized frontend model transport serialization options.
|
|
26
14
|
* @typedef {object} NormalizedFrontendModelTransportSerializationOptions
|
|
27
15
|
* @property {string | undefined} timeZone - Validated IANA timezone used when serializing Date instants.
|
|
28
16
|
*/
|
|
17
|
+
const TYPE_KEY = "__velocious_type"
|
|
18
|
+
const TYPE_DATE = "date"
|
|
19
|
+
const TYPE_UNDEFINED = "undefined"
|
|
20
|
+
const TYPE_BIGINT = "bigint"
|
|
21
|
+
const TYPE_NUMBER = "number"
|
|
22
|
+
const TYPE_FRONTEND_MODEL = "frontend_model"
|
|
23
|
+
const NUMBER_NAN = "NaN"
|
|
24
|
+
const NUMBER_POSITIVE_INFINITY = "Infinity"
|
|
25
|
+
const NUMBER_NEGATIVE_INFINITY = "-Infinity"
|
|
26
|
+
const PRELOADED_RELATIONSHIPS_KEY = "__preloadedRelationships"
|
|
29
27
|
|
|
30
28
|
/**
|
|
31
29
|
* Assign a key to a plain object without triggering the `__proto__` setter.
|
|
@@ -4,6 +4,18 @@ import VelociousWebsocketChannel from "../http-server/websocket-channel.js"
|
|
|
4
4
|
import Response from "../http-server/client/response.js"
|
|
5
5
|
import {serializeFrontendModelTransportValue} from "./transport-serialization.js"
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* Defines this typedef.
|
|
9
|
+
* @typedef {{action?: string, id?: string | number, matchedEventFilterKeys?: string[], record?: import("./query.js").FrontendModelTransportValue, [key: string]: import("./query.js").FrontendModelTransportValue | string[] | undefined}} FrontendModelLifecycleBroadcastBody
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* Defines this typedef.
|
|
13
|
+
* @typedef {{headers?: () => Record<string, string | string[] | undefined>, remoteAddress?: () => string | undefined}} FrontendModelWebsocketUpgradeRequest
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Defines this typedef.
|
|
17
|
+
* @typedef {{headers: () => Record<string, string | string[] | undefined>, header: (name: string) => string | string[] | undefined, metadata: (key?: string) => Record<string, import("./query.js").FrontendModelTransportValue> | import("./query.js").FrontendModelTransportValue | undefined, path: () => string, httpMethod: () => string, remoteAddress: () => string | undefined, origin: () => string | string[] | undefined}} FrontendModelWebsocketSyntheticRequest
|
|
18
|
+
*/
|
|
7
19
|
const EVENT_FILTER_KEYS = new Set(["joins", "key", "searches", "where"])
|
|
8
20
|
|
|
9
21
|
// Mirrors FRONTEND_MODELS_CHANNEL_NAME in ./websocket-publishers.js, duplicated here
|
|
@@ -21,19 +33,6 @@ function transportSerializationOptionsForConfiguration(configuration) {
|
|
|
21
33
|
}
|
|
22
34
|
}
|
|
23
35
|
|
|
24
|
-
/**
|
|
25
|
-
* Defines this typedef.
|
|
26
|
-
* @typedef {{action?: string, id?: string | number, matchedEventFilterKeys?: string[], record?: import("./query.js").FrontendModelTransportValue, [key: string]: import("./query.js").FrontendModelTransportValue | string[] | undefined}} FrontendModelLifecycleBroadcastBody
|
|
27
|
-
*/
|
|
28
|
-
/**
|
|
29
|
-
* Defines this typedef.
|
|
30
|
-
* @typedef {{headers?: () => Record<string, string | string[] | undefined>, remoteAddress?: () => string | undefined}} FrontendModelWebsocketUpgradeRequest
|
|
31
|
-
*/
|
|
32
|
-
/**
|
|
33
|
-
* Defines this typedef.
|
|
34
|
-
* @typedef {{headers: () => Record<string, string | string[] | undefined>, header: (name: string) => string | string[] | undefined, metadata: (key?: string) => Record<string, import("./query.js").FrontendModelTransportValue> | import("./query.js").FrontendModelTransportValue | undefined, path: () => string, httpMethod: () => string, remoteAddress: () => string | undefined, origin: () => string | string[] | undefined}} FrontendModelWebsocketSyntheticRequest
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
36
|
/**
|
|
38
37
|
* Per-session channel subscription for frontend-model lifecycle events.
|
|
39
38
|
* Replaces the legacy `FrontendModelWebsocketChannel` (Phase 3).
|
|
@@ -9,6 +9,10 @@ import WebsocketRequest from "./websocket-request.js"
|
|
|
9
9
|
import WebsocketChannel from "../websocket-channel.js"
|
|
10
10
|
import {websocketEventLogStoreForConfiguration} from "../websocket-event-log-store.js"
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Defines this typedef.
|
|
14
|
+
* @typedef {{type: "subscribe", channel: string, lastEventId?: string, params?: Record<string, ?>} | {type: "metadata", data?: Record<string, ?>} | {type?: "request", body?: ?, headers?: Record<string, ?>, id?: string | number | null, method: string, path: string} | Record<string, ?>} WebsocketSessionMessage
|
|
15
|
+
*/
|
|
12
16
|
const WEBSOCKET_FINAL_FRAME = 0x80
|
|
13
17
|
const WEBSOCKET_OPCODE_CONTINUATION = 0x0
|
|
14
18
|
const WEBSOCKET_OPCODE_TEXT = 0x1
|
|
@@ -31,11 +35,6 @@ const WEBSOCKET_MAX_INBOUND_FRAME_BYTES_BIGINT = BigInt(WEBSOCKET_MAX_FINAL_FRAM
|
|
|
31
35
|
/** Cap on fragment count for a single fragmented message. */
|
|
32
36
|
const WEBSOCKET_MAX_FRAGMENTED_MESSAGE_FRAGMENTS = 1024
|
|
33
37
|
|
|
34
|
-
/**
|
|
35
|
-
* Defines this typedef.
|
|
36
|
-
* @typedef {{type: "subscribe", channel: string, lastEventId?: string, params?: Record<string, ?>} | {type: "metadata", data?: Record<string, ?>} | {type?: "request", body?: ?, headers?: Record<string, ?>, id?: string | number | null, method: string, path: string} | Record<string, ?>} WebsocketSessionMessage
|
|
37
|
-
*/
|
|
38
|
-
|
|
39
38
|
/**
|
|
40
39
|
* Runs subscribe message.
|
|
41
40
|
* @param {WebsocketSessionMessage} message - Raw websocket message.
|
|
@@ -423,7 +422,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
423
422
|
sendGoodbye(client) {
|
|
424
423
|
const frame = Buffer.from([WEBSOCKET_FINAL_FRAME | WEBSOCKET_OPCODE_CLOSE, 0x00])
|
|
425
424
|
|
|
426
|
-
client.events.emit("output", frame)
|
|
425
|
+
client.events.emit("output", frame, {websocketFrame: true})
|
|
427
426
|
}
|
|
428
427
|
|
|
429
428
|
/**
|
|
@@ -967,7 +966,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
967
966
|
header[0] = WEBSOCKET_FINAL_FRAME | opcode
|
|
968
967
|
header[1] = payload.length
|
|
969
968
|
|
|
970
|
-
this.client.events.emit("output", Buffer.concat([header, payload]))
|
|
969
|
+
this.client.events.emit("output", Buffer.concat([header, payload]), {websocketFrame: true})
|
|
971
970
|
}
|
|
972
971
|
|
|
973
972
|
/**
|
|
@@ -1012,7 +1011,7 @@ export default class VelociousHttpServerClientWebsocketSession {
|
|
|
1012
1011
|
|
|
1013
1012
|
header[0] = WEBSOCKET_FINAL_FRAME | WEBSOCKET_OPCODE_TEXT
|
|
1014
1013
|
|
|
1015
|
-
this.client.events.emit("output", Buffer.concat([header, payload]))
|
|
1014
|
+
this.client.events.emit("output", Buffer.concat([header, payload]), {websocketFrame: true})
|
|
1016
1015
|
}
|
|
1017
1016
|
|
|
1018
1017
|
/**
|