@qlever-llc/trellis 0.10.17 → 0.19.0-rc.1
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/esm/auth/mod.d.ts +1 -1
- package/esm/auth/mod.d.ts.map +1 -1
- package/esm/auth/mod.js +1 -1
- package/esm/auth/protocol.d.ts +416 -398
- package/esm/auth/protocol.d.ts.map +1 -1
- package/esm/auth/protocol.js +35 -33
- package/esm/codec.d.ts +1 -0
- package/esm/codec.d.ts.map +1 -1
- package/esm/codec.js +1 -0
- package/esm/contract_support/canonical.d.ts +3 -0
- package/esm/contract_support/canonical.d.ts.map +1 -1
- package/esm/contract_support/canonical.js +3 -0
- package/esm/contract_support/mod.d.ts +28 -4
- package/esm/contract_support/mod.d.ts.map +1 -1
- package/esm/contract_support/mod.js +85 -4
- package/esm/contract_support/protocol.d.ts +92 -7
- package/esm/contract_support/protocol.d.ts.map +1 -1
- package/esm/contract_support/protocol.js +40 -6
- package/esm/errors/index.d.ts +9 -9
- package/esm/generated-sdk/auth/api.d.ts +4 -1
- package/esm/generated-sdk/auth/api.d.ts.map +1 -1
- package/esm/generated-sdk/auth/api.js +6 -1
- package/esm/generated-sdk/auth/client.d.ts +47 -32
- package/esm/generated-sdk/auth/client.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.d.ts +1 -1
- package/esm/generated-sdk/auth/contract.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.js +1570 -1202
- package/esm/generated-sdk/auth/schemas.d.ts +1757 -1759
- package/esm/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/auth/schemas.js +963 -768
- package/esm/generated-sdk/auth/types.d.ts +292 -302
- package/esm/generated-sdk/auth/types.d.ts.map +1 -1
- package/esm/generated-sdk/auth/types.js +1 -1
- package/esm/generated-sdk/health/client.d.ts +4 -4
- package/esm/generated-sdk/health/client.d.ts.map +1 -1
- package/esm/generated-sdk/health/contract.d.ts +1 -1
- package/esm/generated-sdk/health/contract.d.ts.map +1 -1
- package/esm/generated-sdk/health/contract.js +2 -10
- package/esm/generated-sdk/health/schemas.d.ts +1 -14
- package/esm/generated-sdk/health/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/health/schemas.js +1 -9
- package/esm/generated-sdk/health/types.d.ts +3 -5
- package/esm/generated-sdk/health/types.d.ts.map +1 -1
- package/esm/generated-sdk/health/types.js +1 -2
- package/esm/generated-sdk/jobs/api.d.ts +13 -0
- package/esm/generated-sdk/jobs/api.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/client.d.ts +6 -4
- package/esm/generated-sdk/jobs/client.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/contract.d.ts +14 -1
- package/esm/generated-sdk/jobs/contract.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/contract.js +268 -1
- package/esm/generated-sdk/jobs/owned_api.d.ts +13 -0
- package/esm/generated-sdk/jobs/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/owned_api.js +20 -1
- package/esm/generated-sdk/jobs/schemas.d.ts +437 -0
- package/esm/generated-sdk/jobs/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/schemas.js +211 -0
- package/esm/generated-sdk/jobs/types.d.ts +123 -1
- package/esm/generated-sdk/jobs/types.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/types.js +1 -1
- package/esm/generated-sdk/state/client.d.ts +4 -4
- package/esm/generated-sdk/state/client.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/api.d.ts +4 -1
- package/esm/generated-sdk/trellis-core/api.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/api.js +6 -1
- package/esm/generated-sdk/trellis-core/client.d.ts +28 -3
- package/esm/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/contract.d.ts +1 -1
- package/esm/generated-sdk/trellis-core/contract.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/contract.js +91 -1
- package/esm/generated-sdk/trellis-core/schemas.d.ts +113 -0
- package/esm/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/schemas.js +81 -0
- package/esm/generated-sdk/trellis-core/types.d.ts +23 -1
- package/esm/generated-sdk/trellis-core/types.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/types.js +1 -1
- package/esm/health.d.ts +1 -1
- package/esm/health.d.ts.map +1 -1
- package/esm/health.js +1 -1
- package/esm/index.d.ts +2 -2
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -1
- package/esm/jobs.d.ts +69 -3
- package/esm/jobs.d.ts.map +1 -1
- package/esm/jobs.js +92 -3
- package/esm/server/health.d.ts +2 -6
- package/esm/server/health.d.ts.map +1 -1
- package/esm/server/health_schemas.d.ts +0 -8
- package/esm/server/health_schemas.d.ts.map +1 -1
- package/esm/server/health_schemas.js +0 -5
- package/esm/server/internal_jobs/bindings.d.ts +11 -0
- package/esm/server/internal_jobs/bindings.d.ts.map +1 -1
- package/esm/server/internal_jobs/job-manager.d.ts +44 -1
- package/esm/server/internal_jobs/job-manager.d.ts.map +1 -1
- package/esm/server/internal_jobs/job-manager.js +361 -51
- package/esm/server/internal_jobs/key-coordinator.d.ts +260 -0
- package/esm/server/internal_jobs/key-coordinator.d.ts.map +1 -0
- package/esm/server/internal_jobs/key-coordinator.js +580 -0
- package/esm/server/internal_jobs/projection.d.ts.map +1 -1
- package/esm/server/internal_jobs/projection.js +2 -0
- package/esm/server/internal_jobs/runtime-worker.d.ts +5 -1
- package/esm/server/internal_jobs/runtime-worker.d.ts.map +1 -1
- package/esm/server/internal_jobs/runtime-worker.js +14 -2
- package/esm/server/internal_jobs/types.d.ts +5 -5
- package/esm/server/internal_jobs/types.d.ts.map +1 -1
- package/esm/server/internal_jobs/types.js +6 -0
- package/esm/server/service.d.ts +8 -3
- package/esm/server/service.d.ts.map +1 -1
- package/esm/server/service.js +127 -6
- package/esm/service/drizzle.d.ts +27 -0
- package/esm/service/drizzle.d.ts.map +1 -0
- package/esm/service/drizzle.js +84 -0
- package/esm/service/mod.d.ts +1 -1
- package/esm/service/mod.d.ts.map +1 -1
- package/esm/service/mod.js +1 -1
- package/esm/service/outbox_inbox.d.ts.map +1 -1
- package/esm/service/outbox_inbox.js +13 -2
- package/esm/trellis.d.ts +24 -8
- package/esm/trellis.d.ts.map +1 -1
- package/esm/trellis.js +44 -22
- package/package.json +14 -2
- package/script/auth/mod.d.ts +1 -1
- package/script/auth/mod.d.ts.map +1 -1
- package/script/auth/mod.js +22 -6
- package/script/auth/protocol.d.ts +416 -398
- package/script/auth/protocol.d.ts.map +1 -1
- package/script/auth/protocol.js +40 -37
- package/script/codec.d.ts +1 -0
- package/script/codec.d.ts.map +1 -1
- package/script/codec.js +1 -0
- package/script/contract_support/canonical.d.ts +3 -0
- package/script/contract_support/canonical.d.ts.map +1 -1
- package/script/contract_support/canonical.js +3 -0
- package/script/contract_support/mod.d.ts +28 -4
- package/script/contract_support/mod.d.ts.map +1 -1
- package/script/contract_support/mod.js +90 -4
- package/script/contract_support/protocol.d.ts +92 -7
- package/script/contract_support/protocol.d.ts.map +1 -1
- package/script/contract_support/protocol.js +41 -7
- package/script/errors/index.d.ts +9 -9
- package/script/generated-sdk/auth/api.d.ts +4 -1
- package/script/generated-sdk/auth/api.d.ts.map +1 -1
- package/script/generated-sdk/auth/api.js +6 -1
- package/script/generated-sdk/auth/client.d.ts +47 -32
- package/script/generated-sdk/auth/client.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.d.ts +1 -1
- package/script/generated-sdk/auth/contract.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.js +1570 -1202
- package/script/generated-sdk/auth/schemas.d.ts +1757 -1759
- package/script/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/script/generated-sdk/auth/schemas.js +963 -768
- package/script/generated-sdk/auth/types.d.ts +292 -302
- package/script/generated-sdk/auth/types.d.ts.map +1 -1
- package/script/generated-sdk/auth/types.js +1 -1
- package/script/generated-sdk/health/client.d.ts +4 -4
- package/script/generated-sdk/health/client.d.ts.map +1 -1
- package/script/generated-sdk/health/contract.d.ts +1 -1
- package/script/generated-sdk/health/contract.d.ts.map +1 -1
- package/script/generated-sdk/health/contract.js +2 -10
- package/script/generated-sdk/health/schemas.d.ts +1 -14
- package/script/generated-sdk/health/schemas.d.ts.map +1 -1
- package/script/generated-sdk/health/schemas.js +1 -9
- package/script/generated-sdk/health/types.d.ts +3 -5
- package/script/generated-sdk/health/types.d.ts.map +1 -1
- package/script/generated-sdk/health/types.js +1 -2
- package/script/generated-sdk/jobs/api.d.ts +13 -0
- package/script/generated-sdk/jobs/api.d.ts.map +1 -1
- package/script/generated-sdk/jobs/client.d.ts +6 -4
- package/script/generated-sdk/jobs/client.d.ts.map +1 -1
- package/script/generated-sdk/jobs/contract.d.ts +14 -1
- package/script/generated-sdk/jobs/contract.d.ts.map +1 -1
- package/script/generated-sdk/jobs/contract.js +268 -1
- package/script/generated-sdk/jobs/owned_api.d.ts +13 -0
- package/script/generated-sdk/jobs/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/jobs/owned_api.js +19 -0
- package/script/generated-sdk/jobs/schemas.d.ts +437 -0
- package/script/generated-sdk/jobs/schemas.d.ts.map +1 -1
- package/script/generated-sdk/jobs/schemas.js +212 -1
- package/script/generated-sdk/jobs/types.d.ts +123 -1
- package/script/generated-sdk/jobs/types.d.ts.map +1 -1
- package/script/generated-sdk/jobs/types.js +1 -1
- package/script/generated-sdk/state/client.d.ts +4 -4
- package/script/generated-sdk/state/client.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/api.d.ts +4 -1
- package/script/generated-sdk/trellis-core/api.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/api.js +6 -1
- package/script/generated-sdk/trellis-core/client.d.ts +28 -3
- package/script/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/contract.d.ts +1 -1
- package/script/generated-sdk/trellis-core/contract.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/contract.js +91 -1
- package/script/generated-sdk/trellis-core/schemas.d.ts +113 -0
- package/script/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/schemas.js +81 -0
- package/script/generated-sdk/trellis-core/types.d.ts +23 -1
- package/script/generated-sdk/trellis-core/types.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/types.js +1 -1
- package/script/health.d.ts +1 -1
- package/script/health.d.ts.map +1 -1
- package/script/health.js +1 -2
- package/script/index.d.ts +2 -2
- package/script/index.d.ts.map +1 -1
- package/script/index.js +2 -3
- package/script/jobs.d.ts +69 -3
- package/script/jobs.d.ts.map +1 -1
- package/script/jobs.js +93 -3
- package/script/server/health.d.ts +2 -6
- package/script/server/health.d.ts.map +1 -1
- package/script/server/health_schemas.d.ts +0 -8
- package/script/server/health_schemas.d.ts.map +1 -1
- package/script/server/health_schemas.js +1 -6
- package/script/server/internal_jobs/bindings.d.ts +11 -0
- package/script/server/internal_jobs/bindings.d.ts.map +1 -1
- package/script/server/internal_jobs/job-manager.d.ts +44 -1
- package/script/server/internal_jobs/job-manager.d.ts.map +1 -1
- package/script/server/internal_jobs/job-manager.js +361 -51
- package/script/server/internal_jobs/key-coordinator.d.ts +260 -0
- package/script/server/internal_jobs/key-coordinator.d.ts.map +1 -0
- package/script/server/internal_jobs/key-coordinator.js +593 -0
- package/script/server/internal_jobs/projection.d.ts.map +1 -1
- package/script/server/internal_jobs/projection.js +2 -0
- package/script/server/internal_jobs/runtime-worker.d.ts +5 -1
- package/script/server/internal_jobs/runtime-worker.d.ts.map +1 -1
- package/script/server/internal_jobs/runtime-worker.js +14 -2
- package/script/server/internal_jobs/types.d.ts +5 -5
- package/script/server/internal_jobs/types.d.ts.map +1 -1
- package/script/server/internal_jobs/types.js +6 -0
- package/script/server/service.d.ts +8 -3
- package/script/server/service.d.ts.map +1 -1
- package/script/server/service.js +126 -5
- package/script/service/drizzle.d.ts +27 -0
- package/script/service/drizzle.d.ts.map +1 -0
- package/script/service/drizzle.js +88 -0
- package/script/service/mod.d.ts +1 -1
- package/script/service/mod.d.ts.map +1 -1
- package/script/service/mod.js +1 -2
- package/script/service/outbox_inbox.d.ts.map +1 -1
- package/script/service/outbox_inbox.js +13 -2
- package/script/trellis.d.ts +24 -8
- package/script/trellis.d.ts.map +1 -1
- package/script/trellis.js +44 -22
- package/src/auth/mod.ts +28 -2
- package/src/auth/protocol.ts +72 -37
- package/src/codec.ts +1 -0
- package/src/contract_support/canonical.ts +3 -0
- package/src/contract_support/mod.ts +158 -5
- package/src/contract_support/protocol.ts +56 -9
- package/src/health.ts +0 -1
- package/src/index.ts +2 -1
- package/src/jobs.ts +138 -1
- package/src/sdk/_generated/auth/api.ts +9 -2
- package/src/sdk/_generated/auth/client.ts +85 -78
- package/src/sdk/_generated/auth/contract.ts +1803 -1435
- package/src/sdk/_generated/auth/schemas.ts +1166 -971
- package/src/sdk/_generated/auth/types.ts +330 -314
- package/src/sdk/_generated/core/api.ts +9 -2
- package/src/sdk/_generated/core/client.ts +41 -2
- package/src/sdk/_generated/core/contract.ts +91 -1
- package/src/sdk/_generated/core/schemas.ts +81 -0
- package/src/sdk/_generated/core/types.ts +23 -1
- package/src/sdk/_generated/health/client.ts +6 -6
- package/src/sdk/_generated/health/contract.ts +2 -10
- package/src/sdk/_generated/health/schemas.ts +1 -9
- package/src/sdk/_generated/health/types.ts +6 -2
- package/src/sdk/_generated/jobs/client.ts +17 -6
- package/src/sdk/_generated/jobs/contract.ts +269 -1
- package/src/sdk/_generated/jobs/owned_api.ts +21 -0
- package/src/sdk/_generated/jobs/schemas.ts +213 -0
- package/src/sdk/_generated/jobs/types.ts +116 -1
- package/src/sdk/_generated/state/client.ts +6 -6
- package/src/server/health.ts +2 -6
- package/src/server/health_schemas.ts +0 -6
- package/src/server/internal_jobs/bindings.ts +11 -0
- package/src/server/internal_jobs/job-manager.ts +436 -16
- package/src/server/internal_jobs/key-coordinator.ts +955 -0
- package/src/server/internal_jobs/projection.ts +2 -0
- package/src/server/internal_jobs/runtime-worker.ts +17 -1
- package/src/server/internal_jobs/types.ts +6 -0
- package/src/server/service.ts +168 -9
- package/src/service/drizzle.ts +125 -0
- package/src/service/mod.ts +0 -1
- package/src/service/outbox_inbox.ts +16 -6
- package/src/trellis.ts +76 -27
|
@@ -5,7 +5,7 @@ import { canonicalizeJson, digestJson, isJsonValue, sha256Base64urlSync, } from
|
|
|
5
5
|
import { schema, unwrapSchema, } from "./runtime.js";
|
|
6
6
|
import { assertDataPointersExistAndAreTokenable, getSubschemaAtDataPointer, } from "./schema_pointers.js";
|
|
7
7
|
import { ContractEventConsumersSchema, ContractJobQueueSchema, ContractResourcesSchema, ContractSchemaRefSchema, ContractStateSchema, } from "./protocol.js";
|
|
8
|
-
export { buildCursorPage, buildPageResponse, ContractEventConsumerGroupSchema, ContractEventConsumerSelfSchema, ContractEventConsumersSchema, ContractEventConsumerUsesSchema, ContractJobQueueSchema, ContractJobsSchema, ContractKvResourceSchema, ContractResourceBindingsSchema, ContractResourcesSchema, ContractSchemaRefSchema, ContractStateSchema, ContractStateStoreSchema, ContractStoreResourceSchema, CursorPageInfoSchema, CursorPageSchema, CursorQuerySchema, EventConsumerResourceBindingSchema,
|
|
8
|
+
export { buildCursorPage, buildPageResponse, ContractEventConsumerGroupSchema, ContractEventConsumerSelfSchema, ContractEventConsumersSchema, ContractEventConsumerUsesSchema, ContractJobQueueSchema, ContractJobsSchema, ContractKvResourceSchema, ContractResourceBindingsSchema, ContractResourcesSchema, ContractSchemaRefSchema, ContractStateSchema, ContractStateStoreSchema, ContractStoreResourceSchema, CursorPageInfoSchema, CursorPageSchema, CursorQuerySchema, EventConsumerResourceBindingSchema, InstalledServiceContractSchema, IsoDateSchema, JobKeyConcurrencySchema, JobQueueDepthSchema, JobsQueueBindingSchema, JobsQueueDepthBindingSchema, JobsQueueKeyConcurrencyBindingSchema, JobsResourceBindingSchema, KvResourceBindingSchema, normalizeCursorQuery, normalizePageQuery, PageRequestSchema, PageResponseSchema, StoreResourceBindingSchema, } from "./protocol.js";
|
|
9
9
|
export { assertDataPointersExistAndAreTokenable, getSubschemaAtDataPointer, } from "./schema_pointers.js";
|
|
10
10
|
export const CONTRACT_FORMAT_V1 = "trellis.contract.v1";
|
|
11
11
|
export const CATALOG_FORMAT_V1 = "trellis.catalog.v1";
|
|
@@ -1009,7 +1009,71 @@ function errorDecl(error) {
|
|
|
1009
1009
|
...(error.schema ? { schema: schemaRef(error.schema) } : {}),
|
|
1010
1010
|
};
|
|
1011
1011
|
}
|
|
1012
|
-
function
|
|
1012
|
+
function assertValidJsonPointerSyntax(queueType, pointer) {
|
|
1013
|
+
if (!pointer.startsWith("/")) {
|
|
1014
|
+
throw new Error(`jobs queue '${queueType}' keyConcurrency.key pointer segment '${pointer}' must start with '/'`);
|
|
1015
|
+
}
|
|
1016
|
+
for (let index = 0; index < pointer.length; index += 1) {
|
|
1017
|
+
if (pointer[index] !== "~")
|
|
1018
|
+
continue;
|
|
1019
|
+
const escaped = pointer[index + 1];
|
|
1020
|
+
if (escaped !== "0" && escaped !== "1") {
|
|
1021
|
+
throw new Error(`jobs queue '${queueType}' keyConcurrency.key pointer segment '${pointer}' has invalid JSON Pointer escape at offset ${index}; use '~0' for '~' and '~1' for '/'`);
|
|
1022
|
+
}
|
|
1023
|
+
index += 1;
|
|
1024
|
+
}
|
|
1025
|
+
}
|
|
1026
|
+
function assertValidJobKeyConcurrency(queueType, keyConcurrency) {
|
|
1027
|
+
if (!keyConcurrency)
|
|
1028
|
+
return;
|
|
1029
|
+
if (keyConcurrency.key.length === 0) {
|
|
1030
|
+
throw new Error(`jobs queue '${queueType}' keyConcurrency.key must contain at least one segment`);
|
|
1031
|
+
}
|
|
1032
|
+
for (const segment of keyConcurrency.key) {
|
|
1033
|
+
if (segment.length === 0) {
|
|
1034
|
+
throw new Error(`jobs queue '${queueType}' keyConcurrency.key segments must be non-empty strings`);
|
|
1035
|
+
}
|
|
1036
|
+
if (segment.startsWith("/")) {
|
|
1037
|
+
assertValidJsonPointerSyntax(queueType, segment);
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
if (keyConcurrency.heartbeatIntervalMs !== undefined &&
|
|
1041
|
+
keyConcurrency.heartbeatTtlMs !== undefined &&
|
|
1042
|
+
keyConcurrency.heartbeatTtlMs <= keyConcurrency.heartbeatIntervalMs) {
|
|
1043
|
+
throw new Error(`jobs queue '${queueType}' keyConcurrency.heartbeatTtlMs must exceed heartbeatIntervalMs`);
|
|
1044
|
+
}
|
|
1045
|
+
}
|
|
1046
|
+
function jobKeyConcurrency(queueType, keyConcurrency) {
|
|
1047
|
+
assertValidJobKeyConcurrency(queueType, keyConcurrency);
|
|
1048
|
+
if (!keyConcurrency)
|
|
1049
|
+
return undefined;
|
|
1050
|
+
return {
|
|
1051
|
+
key: [...keyConcurrency.key],
|
|
1052
|
+
...(keyConcurrency.maxActive !== undefined
|
|
1053
|
+
? { maxActive: keyConcurrency.maxActive }
|
|
1054
|
+
: {}),
|
|
1055
|
+
...(keyConcurrency.heartbeatIntervalMs !== undefined
|
|
1056
|
+
? { heartbeatIntervalMs: keyConcurrency.heartbeatIntervalMs }
|
|
1057
|
+
: {}),
|
|
1058
|
+
...(keyConcurrency.heartbeatTtlMs !== undefined
|
|
1059
|
+
? { heartbeatTtlMs: keyConcurrency.heartbeatTtlMs }
|
|
1060
|
+
: {}),
|
|
1061
|
+
...(keyConcurrency.stalePolicy !== undefined
|
|
1062
|
+
? { stalePolicy: keyConcurrency.stalePolicy }
|
|
1063
|
+
: {}),
|
|
1064
|
+
};
|
|
1065
|
+
}
|
|
1066
|
+
function jobQueueDepth(queue) {
|
|
1067
|
+
if (!queue)
|
|
1068
|
+
return undefined;
|
|
1069
|
+
return {
|
|
1070
|
+
...(queue.maxQueuedPerKey !== undefined
|
|
1071
|
+
? { maxQueuedPerKey: queue.maxQueuedPerKey }
|
|
1072
|
+
: {}),
|
|
1073
|
+
...(queue.whenFull !== undefined ? { whenFull: queue.whenFull } : {}),
|
|
1074
|
+
};
|
|
1075
|
+
}
|
|
1076
|
+
function jobQueue(queueType, queue) {
|
|
1013
1077
|
return {
|
|
1014
1078
|
payload: schemaRef(queue.payload),
|
|
1015
1079
|
...(queue.result ? { result: schemaRef(queue.result) } : {}),
|
|
@@ -1025,6 +1089,10 @@ function jobQueue(queue) {
|
|
|
1025
1089
|
...(queue.concurrency !== undefined
|
|
1026
1090
|
? { concurrency: queue.concurrency }
|
|
1027
1091
|
: {}),
|
|
1092
|
+
...(queue.keyConcurrency
|
|
1093
|
+
? { keyConcurrency: jobKeyConcurrency(queueType, queue.keyConcurrency) }
|
|
1094
|
+
: {}),
|
|
1095
|
+
...(queue.queue ? { queue: jobQueueDepth(queue.queue) } : {}),
|
|
1028
1096
|
...(queue.docs ? { docs: contractDocs(queue.docs) } : {}),
|
|
1029
1097
|
};
|
|
1030
1098
|
}
|
|
@@ -1093,7 +1161,14 @@ export function normalizeContractManifest(contract) {
|
|
|
1093
1161
|
: {}),
|
|
1094
1162
|
...(contract.events ? { events: mapValues(contract.events, event) } : {}),
|
|
1095
1163
|
...(contract.feeds ? { feeds: mapValues(contract.feeds, feed) } : {}),
|
|
1096
|
-
...(contract.jobs
|
|
1164
|
+
...(contract.jobs
|
|
1165
|
+
? {
|
|
1166
|
+
jobs: Object.fromEntries(Object.entries(contract.jobs).map(([queueType, queue]) => [
|
|
1167
|
+
queueType,
|
|
1168
|
+
jobQueue(queueType, queue),
|
|
1169
|
+
])),
|
|
1170
|
+
}
|
|
1171
|
+
: {}),
|
|
1097
1172
|
...(contract.eventConsumers
|
|
1098
1173
|
? {
|
|
1099
1174
|
eventConsumers: mapValues(contract.eventConsumers, eventConsumerGroup),
|
|
@@ -1256,6 +1331,12 @@ function emitJobs(jobs) {
|
|
|
1256
1331
|
...(queue.concurrency !== undefined
|
|
1257
1332
|
? { concurrency: queue.concurrency }
|
|
1258
1333
|
: {}),
|
|
1334
|
+
...(queue.keyConcurrency
|
|
1335
|
+
? {
|
|
1336
|
+
keyConcurrency: jobKeyConcurrency(queueType, queue.keyConcurrency),
|
|
1337
|
+
}
|
|
1338
|
+
: {}),
|
|
1339
|
+
...(queue.queue ? { queue: jobQueueDepth(queue.queue) } : {}),
|
|
1259
1340
|
...(queue.docs ? { docs: contractDocs(queue.docs) } : {}),
|
|
1260
1341
|
},
|
|
1261
1342
|
]));
|
|
@@ -2190,4 +2271,4 @@ export function defineDeviceContract(...args) {
|
|
|
2190
2271
|
}
|
|
2191
2272
|
return defineClientContract("device", registryOrBuild, maybeBuild);
|
|
2192
2273
|
}
|
|
2193
|
-
export { canonicalizeJson, digestJson, isJsonValue, schema, unwrapSchema };
|
|
2274
|
+
export { canonicalizeJson, digestJson, isJsonValue, schema, sha256Base64urlSync, unwrapSchema, };
|
|
@@ -65,6 +65,19 @@ export declare const ContractStateSchema: Type.TRecord<"^.*$", Type.TObject<{
|
|
|
65
65
|
}>>;
|
|
66
66
|
}>>;
|
|
67
67
|
export type ContractState = Static<typeof ContractStateSchema>;
|
|
68
|
+
export declare const JobKeyConcurrencySchema: Type.TObject<{
|
|
69
|
+
key: Type.TArray<Type.TString>;
|
|
70
|
+
maxActive: Type.TOptional<Type.TInteger>;
|
|
71
|
+
heartbeatIntervalMs: Type.TOptional<Type.TInteger>;
|
|
72
|
+
heartbeatTtlMs: Type.TOptional<Type.TInteger>;
|
|
73
|
+
stalePolicy: Type.TOptional<Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>>;
|
|
74
|
+
}>;
|
|
75
|
+
export type JobKeyConcurrency = Static<typeof JobKeyConcurrencySchema>;
|
|
76
|
+
export declare const JobQueueDepthSchema: Type.TObject<{
|
|
77
|
+
maxQueuedPerKey: Type.TOptional<Type.TInteger>;
|
|
78
|
+
whenFull: Type.TOptional<Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>>;
|
|
79
|
+
}>;
|
|
80
|
+
export type JobQueueDepth = Static<typeof JobQueueDepthSchema>;
|
|
68
81
|
export declare const ContractJobQueueSchema: Type.TObject<{
|
|
69
82
|
payload: Type.TObject<{
|
|
70
83
|
schema: Type.TString;
|
|
@@ -80,6 +93,17 @@ export declare const ContractJobQueueSchema: Type.TObject<{
|
|
|
80
93
|
logs: Type.TOptional<Type.TBoolean>;
|
|
81
94
|
dlq: Type.TOptional<Type.TBoolean>;
|
|
82
95
|
concurrency: Type.TOptional<Type.TInteger>;
|
|
96
|
+
keyConcurrency: Type.TOptional<Type.TObject<{
|
|
97
|
+
key: Type.TArray<Type.TString>;
|
|
98
|
+
maxActive: Type.TOptional<Type.TInteger>;
|
|
99
|
+
heartbeatIntervalMs: Type.TOptional<Type.TInteger>;
|
|
100
|
+
heartbeatTtlMs: Type.TOptional<Type.TInteger>;
|
|
101
|
+
stalePolicy: Type.TOptional<Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>>;
|
|
102
|
+
}>>;
|
|
103
|
+
queue: Type.TOptional<Type.TObject<{
|
|
104
|
+
maxQueuedPerKey: Type.TOptional<Type.TInteger>;
|
|
105
|
+
whenFull: Type.TOptional<Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>>;
|
|
106
|
+
}>>;
|
|
83
107
|
docs: Type.TOptional<Type.TObject<{
|
|
84
108
|
summary: Type.TOptional<Type.TString>;
|
|
85
109
|
markdown: Type.TString;
|
|
@@ -101,6 +125,17 @@ export declare const ContractJobsSchema: Type.TRecord<"^.*$", Type.TObject<{
|
|
|
101
125
|
logs: Type.TOptional<Type.TBoolean>;
|
|
102
126
|
dlq: Type.TOptional<Type.TBoolean>;
|
|
103
127
|
concurrency: Type.TOptional<Type.TInteger>;
|
|
128
|
+
keyConcurrency: Type.TOptional<Type.TObject<{
|
|
129
|
+
key: Type.TArray<Type.TString>;
|
|
130
|
+
maxActive: Type.TOptional<Type.TInteger>;
|
|
131
|
+
heartbeatIntervalMs: Type.TOptional<Type.TInteger>;
|
|
132
|
+
heartbeatTtlMs: Type.TOptional<Type.TInteger>;
|
|
133
|
+
stalePolicy: Type.TOptional<Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>>;
|
|
134
|
+
}>>;
|
|
135
|
+
queue: Type.TOptional<Type.TObject<{
|
|
136
|
+
maxQueuedPerKey: Type.TOptional<Type.TInteger>;
|
|
137
|
+
whenFull: Type.TOptional<Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>>;
|
|
138
|
+
}>>;
|
|
104
139
|
docs: Type.TOptional<Type.TObject<{
|
|
105
140
|
summary: Type.TOptional<Type.TString>;
|
|
106
141
|
markdown: Type.TString;
|
|
@@ -183,6 +218,19 @@ export declare const StoreResourceBindingSchema: Type.TObject<{
|
|
|
183
218
|
maxTotalBytes: Type.TOptional<Type.TInteger>;
|
|
184
219
|
}>;
|
|
185
220
|
export type StoreResourceBinding = Static<typeof StoreResourceBindingSchema>;
|
|
221
|
+
export declare const JobsQueueKeyConcurrencyBindingSchema: Type.TObject<{
|
|
222
|
+
key: Type.TArray<Type.TString>;
|
|
223
|
+
maxActive: Type.TInteger;
|
|
224
|
+
heartbeatIntervalMs: Type.TInteger;
|
|
225
|
+
heartbeatTtlMs: Type.TInteger;
|
|
226
|
+
stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
|
|
227
|
+
}>;
|
|
228
|
+
export type JobsQueueKeyConcurrencyBinding = Static<typeof JobsQueueKeyConcurrencyBindingSchema>;
|
|
229
|
+
export declare const JobsQueueDepthBindingSchema: Type.TObject<{
|
|
230
|
+
maxQueuedPerKey: Type.TInteger;
|
|
231
|
+
whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
|
|
232
|
+
}>;
|
|
233
|
+
export type JobsQueueDepthBinding = Static<typeof JobsQueueDepthBindingSchema>;
|
|
186
234
|
export declare const JobsQueueBindingSchema: Type.TObject<{
|
|
187
235
|
queueType: Type.TString;
|
|
188
236
|
publishPrefix: Type.TString;
|
|
@@ -202,6 +250,17 @@ export declare const JobsQueueBindingSchema: Type.TObject<{
|
|
|
202
250
|
logs: Type.TBoolean;
|
|
203
251
|
dlq: Type.TBoolean;
|
|
204
252
|
concurrency: Type.TInteger;
|
|
253
|
+
keyConcurrency: Type.TOptional<Type.TObject<{
|
|
254
|
+
key: Type.TArray<Type.TString>;
|
|
255
|
+
maxActive: Type.TInteger;
|
|
256
|
+
heartbeatIntervalMs: Type.TInteger;
|
|
257
|
+
heartbeatTtlMs: Type.TInteger;
|
|
258
|
+
stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
|
|
259
|
+
}>>;
|
|
260
|
+
queue: Type.TOptional<Type.TObject<{
|
|
261
|
+
maxQueuedPerKey: Type.TInteger;
|
|
262
|
+
whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
|
|
263
|
+
}>>;
|
|
205
264
|
}>;
|
|
206
265
|
export type JobsQueueBinding = Static<typeof JobsQueueBindingSchema>;
|
|
207
266
|
export declare const JobsResourceBindingSchema: Type.TObject<{
|
|
@@ -226,6 +285,17 @@ export declare const JobsResourceBindingSchema: Type.TObject<{
|
|
|
226
285
|
logs: Type.TBoolean;
|
|
227
286
|
dlq: Type.TBoolean;
|
|
228
287
|
concurrency: Type.TInteger;
|
|
288
|
+
keyConcurrency: Type.TOptional<Type.TObject<{
|
|
289
|
+
key: Type.TArray<Type.TString>;
|
|
290
|
+
maxActive: Type.TInteger;
|
|
291
|
+
heartbeatIntervalMs: Type.TInteger;
|
|
292
|
+
heartbeatTtlMs: Type.TInteger;
|
|
293
|
+
stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
|
|
294
|
+
}>>;
|
|
295
|
+
queue: Type.TOptional<Type.TObject<{
|
|
296
|
+
maxQueuedPerKey: Type.TInteger;
|
|
297
|
+
whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
|
|
298
|
+
}>>;
|
|
229
299
|
}>>;
|
|
230
300
|
}>;
|
|
231
301
|
export type JobsResourceBinding = Static<typeof JobsResourceBindingSchema>;
|
|
@@ -276,6 +346,17 @@ export declare const ContractResourceBindingsSchema: Type.TObject<{
|
|
|
276
346
|
logs: Type.TBoolean;
|
|
277
347
|
dlq: Type.TBoolean;
|
|
278
348
|
concurrency: Type.TInteger;
|
|
349
|
+
keyConcurrency: Type.TOptional<Type.TObject<{
|
|
350
|
+
key: Type.TArray<Type.TString>;
|
|
351
|
+
maxActive: Type.TInteger;
|
|
352
|
+
heartbeatIntervalMs: Type.TInteger;
|
|
353
|
+
heartbeatTtlMs: Type.TInteger;
|
|
354
|
+
stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
|
|
355
|
+
}>>;
|
|
356
|
+
queue: Type.TOptional<Type.TObject<{
|
|
357
|
+
maxQueuedPerKey: Type.TInteger;
|
|
358
|
+
whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
|
|
359
|
+
}>>;
|
|
279
360
|
}>>;
|
|
280
361
|
}>>;
|
|
281
362
|
eventConsumers: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
|
|
@@ -329,6 +410,17 @@ export declare const InstalledServiceContractSchema: Type.TObject<{
|
|
|
329
410
|
logs: Type.TBoolean;
|
|
330
411
|
dlq: Type.TBoolean;
|
|
331
412
|
concurrency: Type.TInteger;
|
|
413
|
+
keyConcurrency: Type.TOptional<Type.TObject<{
|
|
414
|
+
key: Type.TArray<Type.TString>;
|
|
415
|
+
maxActive: Type.TInteger;
|
|
416
|
+
heartbeatIntervalMs: Type.TInteger;
|
|
417
|
+
heartbeatTtlMs: Type.TInteger;
|
|
418
|
+
stalePolicy: Type.TUnion<[Type.TLiteral<"fail-stale">, Type.TLiteral<"block">]>;
|
|
419
|
+
}>>;
|
|
420
|
+
queue: Type.TOptional<Type.TObject<{
|
|
421
|
+
maxQueuedPerKey: Type.TInteger;
|
|
422
|
+
whenFull: Type.TUnion<[Type.TLiteral<"reject">, Type.TLiteral<"coalesce">, Type.TLiteral<"replace-oldest">]>;
|
|
423
|
+
}>>;
|
|
332
424
|
}>>;
|
|
333
425
|
}>>;
|
|
334
426
|
eventConsumers: Type.TOptional<Type.TRecord<"^.*$", Type.TObject<{
|
|
@@ -346,13 +438,6 @@ export declare const InstalledServiceContractSchema: Type.TObject<{
|
|
|
346
438
|
}>;
|
|
347
439
|
export type InstalledServiceContract = Static<typeof InstalledServiceContractSchema>;
|
|
348
440
|
export declare const IsoDateSchema: Type.TCodec<Type.TString, Date>;
|
|
349
|
-
export declare const EventHeaderSchema: Type.TObject<{
|
|
350
|
-
header: Type.TObject<{
|
|
351
|
-
id: Type.TString;
|
|
352
|
-
time: Type.TCodec<Type.TString, Date>;
|
|
353
|
-
}>;
|
|
354
|
-
}>;
|
|
355
|
-
export type EventHeader = Static<typeof EventHeaderSchema>;
|
|
356
441
|
/** Schema for a bounded pagination request. */
|
|
357
442
|
export declare const PageRequestSchema: Type.TObject<{
|
|
358
443
|
offset: Type.TOptional<Type.TInteger>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"protocol.d.ts","sourceRoot":"","sources":["../../src/contract_support/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,MAAM,SAAS,CAAC;AAmB1D,eAAO,MAAM,uBAAuB;;EAElC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAEvE,eAAO,MAAM,kBAAkB;;;EAG7B,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG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MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAEjE,mEAAmE;AACnE,wBAAgB,gBAAgB,CAAC,KAAK,SAAS,OAAO,EAAE,IAAI,EAAE,KAAK;;;;;GAKlE;AAED,mDAAmD;AACnD,MAAM,MAAM,UAAU,CAAC,KAAK,IAAI;IAC9B,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,yDAAyD;AACzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,yEAAyE;IACzE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oEAAoE;AACpE,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,EAClB,OAAO,GAAE,kBAAuB,GAC/B,qBAAqB,CAgBvB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,KAAK,EAAE,CAAC,EAAE,EACV,UAAU,CAAC,EAAE,MAAM,GAClB,UAAU,CAAC,CAAC,CAAC,CAKf"}
|
|
@@ -47,6 +47,24 @@ export const ContractStateStoreSchema = Type.Object({
|
|
|
47
47
|
docs: Type.Optional(ContractDocsSchema),
|
|
48
48
|
});
|
|
49
49
|
export const ContractStateSchema = Type.Record(Type.String({ minLength: 1 }), ContractStateStoreSchema);
|
|
50
|
+
export const JobKeyConcurrencySchema = Type.Object({
|
|
51
|
+
key: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
|
|
52
|
+
maxActive: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
53
|
+
heartbeatIntervalMs: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
54
|
+
heartbeatTtlMs: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
55
|
+
stalePolicy: Type.Optional(Type.Union([
|
|
56
|
+
Type.Literal("fail-stale"),
|
|
57
|
+
Type.Literal("block"),
|
|
58
|
+
])),
|
|
59
|
+
});
|
|
60
|
+
export const JobQueueDepthSchema = Type.Object({
|
|
61
|
+
maxQueuedPerKey: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
62
|
+
whenFull: Type.Optional(Type.Union([
|
|
63
|
+
Type.Literal("reject"),
|
|
64
|
+
Type.Literal("coalesce"),
|
|
65
|
+
Type.Literal("replace-oldest"),
|
|
66
|
+
])),
|
|
67
|
+
});
|
|
50
68
|
export const ContractJobQueueSchema = Type.Object({
|
|
51
69
|
payload: ContractSchemaRefSchema,
|
|
52
70
|
result: Type.Optional(ContractSchemaRefSchema),
|
|
@@ -58,6 +76,8 @@ export const ContractJobQueueSchema = Type.Object({
|
|
|
58
76
|
logs: Type.Optional(Type.Boolean()),
|
|
59
77
|
dlq: Type.Optional(Type.Boolean()),
|
|
60
78
|
concurrency: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
79
|
+
keyConcurrency: Type.Optional(JobKeyConcurrencySchema),
|
|
80
|
+
queue: Type.Optional(JobQueueDepthSchema),
|
|
61
81
|
docs: Type.Optional(ContractDocsSchema),
|
|
62
82
|
});
|
|
63
83
|
export const ContractJobsSchema = Type.Record(Type.String({ minLength: 1 }), ContractJobQueueSchema);
|
|
@@ -94,6 +114,24 @@ export const StoreResourceBindingSchema = Type.Object({
|
|
|
94
114
|
maxObjectBytes: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
95
115
|
maxTotalBytes: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
96
116
|
});
|
|
117
|
+
export const JobsQueueKeyConcurrencyBindingSchema = Type.Object({
|
|
118
|
+
key: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
|
|
119
|
+
maxActive: Type.Integer({ minimum: 1 }),
|
|
120
|
+
heartbeatIntervalMs: Type.Integer({ minimum: 1 }),
|
|
121
|
+
heartbeatTtlMs: Type.Integer({ minimum: 1 }),
|
|
122
|
+
stalePolicy: Type.Union([
|
|
123
|
+
Type.Literal("fail-stale"),
|
|
124
|
+
Type.Literal("block"),
|
|
125
|
+
]),
|
|
126
|
+
});
|
|
127
|
+
export const JobsQueueDepthBindingSchema = Type.Object({
|
|
128
|
+
maxQueuedPerKey: Type.Integer({ minimum: 0 }),
|
|
129
|
+
whenFull: Type.Union([
|
|
130
|
+
Type.Literal("reject"),
|
|
131
|
+
Type.Literal("coalesce"),
|
|
132
|
+
Type.Literal("replace-oldest"),
|
|
133
|
+
]),
|
|
134
|
+
});
|
|
97
135
|
export const JobsQueueBindingSchema = Type.Object({
|
|
98
136
|
queueType: Type.String({ minLength: 1 }),
|
|
99
137
|
publishPrefix: Type.String({ minLength: 1 }),
|
|
@@ -109,6 +147,8 @@ export const JobsQueueBindingSchema = Type.Object({
|
|
|
109
147
|
logs: Type.Boolean(),
|
|
110
148
|
dlq: Type.Boolean(),
|
|
111
149
|
concurrency: Type.Integer({ minimum: 1 }),
|
|
150
|
+
keyConcurrency: Type.Optional(JobsQueueKeyConcurrencyBindingSchema),
|
|
151
|
+
queue: Type.Optional(JobsQueueDepthBindingSchema),
|
|
112
152
|
});
|
|
113
153
|
export const JobsResourceBindingSchema = Type.Object({
|
|
114
154
|
namespace: Type.String({ minLength: 1 }),
|
|
@@ -140,12 +180,6 @@ export const InstalledServiceContractSchema = Type.Object({
|
|
|
140
180
|
export const IsoDateSchema = Type.Codec(Type.String({ format: "date-time" }))
|
|
141
181
|
.Decode((value) => parseIsoDate(value))
|
|
142
182
|
.Encode((value) => formatIsoDate(value));
|
|
143
|
-
export const EventHeaderSchema = Type.Object({
|
|
144
|
-
header: Type.Object({
|
|
145
|
-
id: Type.String(),
|
|
146
|
-
time: IsoDateSchema,
|
|
147
|
-
}),
|
|
148
|
-
});
|
|
149
183
|
/** Schema for a bounded pagination request. */
|
|
150
184
|
export const PageRequestSchema = Type.Object({
|
|
151
185
|
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
package/esm/errors/index.d.ts
CHANGED
|
@@ -94,9 +94,9 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
94
94
|
context?: Record<string, unknown> | undefined;
|
|
95
95
|
traceId?: string | undefined;
|
|
96
96
|
type: "AuthError";
|
|
97
|
-
id: string;
|
|
98
97
|
message: string;
|
|
99
98
|
reason: "invalid_request" | "missing_session_key" | "missing_proof" | "session_not_found" | "session_expired" | "invalid_signature" | "user_not_found" | "user_already_exists" | "username_taken" | "identity_already_exists" | "identity_not_found" | "user_inactive" | "unknown_device" | "device_deployment_not_found" | "device_deployment_disabled" | "device_activation_revoked" | "unknown_service" | "service_disabled" | "iat_out_of_range" | "invalid_binding_token" | "session_corrupted" | "session_already_bound" | "authtoken_already_used" | "oauth_session_key_mismatch" | "reply_subject_mismatch" | "insufficient_permissions" | "forbidden" | "last_admin_required" | "missing_flow_id" | "device_activation_flow_not_found" | "device_activation_flow_expired" | "device_activation_rejected" | "device_identity_key_mismatch" | "invalid_device_qr_mac";
|
|
99
|
+
id: string;
|
|
100
100
|
}>;
|
|
101
101
|
readonly fromSerializable: (data: AuthErrorData) => AuthError;
|
|
102
102
|
};
|
|
@@ -106,8 +106,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
106
106
|
context?: Record<string, unknown> | undefined;
|
|
107
107
|
traceId?: string | undefined;
|
|
108
108
|
type: "TransportError";
|
|
109
|
-
id: string;
|
|
110
109
|
message: string;
|
|
110
|
+
id: string;
|
|
111
111
|
code: string;
|
|
112
112
|
hint: string;
|
|
113
113
|
}>;
|
|
@@ -119,8 +119,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
119
119
|
context?: Record<string, unknown> | undefined;
|
|
120
120
|
traceId?: string | undefined;
|
|
121
121
|
type: "ValidationError";
|
|
122
|
-
id: string;
|
|
123
122
|
message: string;
|
|
123
|
+
id: string;
|
|
124
124
|
issues: {
|
|
125
125
|
message: string;
|
|
126
126
|
path: string;
|
|
@@ -135,8 +135,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
135
135
|
operation?: string | undefined;
|
|
136
136
|
traceId?: string | undefined;
|
|
137
137
|
type: "KVError";
|
|
138
|
-
id: string;
|
|
139
138
|
message: string;
|
|
139
|
+
id: string;
|
|
140
140
|
}>;
|
|
141
141
|
readonly fromSerializable: (data: KVErrorData) => KVError;
|
|
142
142
|
};
|
|
@@ -146,8 +146,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
146
146
|
context?: Record<string, unknown> | undefined;
|
|
147
147
|
traceId?: string | undefined;
|
|
148
148
|
type: "OperationNotFoundError";
|
|
149
|
-
id: string;
|
|
150
149
|
message: string;
|
|
150
|
+
id: string;
|
|
151
151
|
operationId: string;
|
|
152
152
|
}>;
|
|
153
153
|
readonly fromSerializable: (data: OperationNotFoundErrorData) => OperationNotFoundError;
|
|
@@ -161,8 +161,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
161
161
|
state?: string | undefined;
|
|
162
162
|
traceId?: string | undefined;
|
|
163
163
|
type: "OperationAlreadyTerminalError";
|
|
164
|
-
id: string;
|
|
165
164
|
message: string;
|
|
165
|
+
id: string;
|
|
166
166
|
operationId: string;
|
|
167
167
|
}>;
|
|
168
168
|
readonly fromSerializable: (data: OperationAlreadyTerminalErrorData) => OperationAlreadyTerminalError;
|
|
@@ -175,8 +175,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
175
175
|
actualService?: string | undefined;
|
|
176
176
|
actualOperation?: string | undefined;
|
|
177
177
|
type: "OperationMismatchError";
|
|
178
|
-
id: string;
|
|
179
178
|
message: string;
|
|
179
|
+
id: string;
|
|
180
180
|
operationId: string;
|
|
181
181
|
expectedService: string;
|
|
182
182
|
expectedOperation: string;
|
|
@@ -190,8 +190,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
190
190
|
operation?: string | undefined;
|
|
191
191
|
traceId?: string | undefined;
|
|
192
192
|
type: "StoreError";
|
|
193
|
-
id: string;
|
|
194
193
|
message: string;
|
|
194
|
+
id: string;
|
|
195
195
|
}>;
|
|
196
196
|
readonly fromSerializable: (data: StoreErrorData) => StoreError;
|
|
197
197
|
};
|
|
@@ -202,8 +202,8 @@ export declare const BUILTIN_RPC_ERRORS: {
|
|
|
202
202
|
operation?: string | undefined;
|
|
203
203
|
traceId?: string | undefined;
|
|
204
204
|
type: "TransferError";
|
|
205
|
-
id: string;
|
|
206
205
|
message: string;
|
|
206
|
+
id: string;
|
|
207
207
|
}>;
|
|
208
208
|
readonly fromSerializable: (data: TransferErrorData) => TransferError;
|
|
209
209
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { OWNED_API } from "./owned_api.js";
|
|
2
|
+
import { OWNED_API as HealthApi } from "@qlever-llc/trellis/sdk/health";
|
|
2
3
|
export { OWNED_API };
|
|
3
4
|
export type UsedApi = {
|
|
4
5
|
rpc: {};
|
|
5
6
|
operations: {};
|
|
6
|
-
events: {
|
|
7
|
+
events: {
|
|
8
|
+
readonly "Health.Heartbeat": typeof HealthApi.events["Health.Heartbeat"];
|
|
9
|
+
};
|
|
7
10
|
feeds: {};
|
|
8
11
|
subjects: {};
|
|
9
12
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/sdk/_generated/auth/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../src/sdk/_generated/auth/api.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,SAAS,IAAI,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,EAAE,SAAS,EAAE,CAAC;AAErB,MAAM,MAAM,OAAO,GAAG;IACpB,GAAG,EAAE,EAAE,CAAC;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGN,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
// Generated from ./generated/contracts/manifests/trellis.auth@v1.json
|
|
2
2
|
import { OWNED_API } from "./owned_api.js";
|
|
3
|
+
import { OWNED_API as HealthApi } from "@qlever-llc/trellis/sdk/health";
|
|
3
4
|
export { OWNED_API };
|
|
4
5
|
export const USED_API = {
|
|
5
6
|
rpc: {},
|
|
6
7
|
operations: {},
|
|
7
|
-
events: {
|
|
8
|
+
events: {
|
|
9
|
+
get "Health.Heartbeat"() {
|
|
10
|
+
return HealthApi.events["Health.Heartbeat"];
|
|
11
|
+
},
|
|
12
|
+
},
|
|
8
13
|
feeds: {},
|
|
9
14
|
subjects: {},
|
|
10
15
|
};
|