@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
package/src/auth/mod.ts
CHANGED
|
@@ -82,6 +82,8 @@ export {
|
|
|
82
82
|
AuthCapabilityGroupsListSchema,
|
|
83
83
|
AuthCapabilityGroupsPutResponseSchema,
|
|
84
84
|
AuthCapabilityGroupsPutSchema,
|
|
85
|
+
AuthCatalogIssuesResolveResponseSchema,
|
|
86
|
+
AuthCatalogIssuesResolveSchema,
|
|
85
87
|
type AuthDeployment,
|
|
86
88
|
type AuthDeploymentAuthorityAcceptMigrationInput,
|
|
87
89
|
AuthDeploymentAuthorityAcceptMigrationSchema,
|
|
@@ -181,6 +183,10 @@ export {
|
|
|
181
183
|
AuthPortalsLoginSettingsGetSchema,
|
|
182
184
|
AuthPortalsLoginSettingsResponseSchema,
|
|
183
185
|
AuthPortalsLoginSettingsUpdateSchema,
|
|
186
|
+
AuthPortalsPutResponseSchema,
|
|
187
|
+
AuthPortalsPutSchema,
|
|
188
|
+
AuthPortalsRemoveResponseSchema,
|
|
189
|
+
AuthPortalsRemoveSchema,
|
|
184
190
|
AuthPortalsRoutesPutResponseSchema,
|
|
185
191
|
AuthPortalsRoutesPutSchema,
|
|
186
192
|
AuthPortalsRoutesRemoveResponseSchema,
|
|
@@ -225,7 +231,11 @@ export {
|
|
|
225
231
|
ContractAnalysisSummarySchema,
|
|
226
232
|
type DeploymentAuthority,
|
|
227
233
|
type DeploymentAuthorityCapability,
|
|
234
|
+
type DeploymentAuthorityCapabilityNeed,
|
|
235
|
+
DeploymentAuthorityCapabilityNeedSchema,
|
|
228
236
|
DeploymentAuthorityCapabilitySchema,
|
|
237
|
+
type DeploymentAuthorityContractNeed,
|
|
238
|
+
DeploymentAuthorityContractNeedSchema,
|
|
229
239
|
type DeploymentAuthorityGrantOverride,
|
|
230
240
|
DeploymentAuthorityGrantOverrideSchema,
|
|
231
241
|
type DeploymentAuthorityKind,
|
|
@@ -234,8 +244,8 @@ export {
|
|
|
234
244
|
DeploymentAuthorityMaterializationSchema,
|
|
235
245
|
type DeploymentAuthorityMigration,
|
|
236
246
|
DeploymentAuthorityMigrationSchema,
|
|
237
|
-
type
|
|
238
|
-
|
|
247
|
+
type DeploymentAuthorityNeeds,
|
|
248
|
+
DeploymentAuthorityNeedsSchema,
|
|
239
249
|
type DeploymentAuthorityPlan,
|
|
240
250
|
DeploymentAuthorityPlanSchema,
|
|
241
251
|
type DeploymentAuthorityProposal,
|
|
@@ -244,16 +254,21 @@ export {
|
|
|
244
254
|
DeploymentAuthorityReconciliationStatusSchema,
|
|
245
255
|
type DeploymentAuthorityResource,
|
|
246
256
|
DeploymentAuthorityResourceKindSchema,
|
|
257
|
+
type DeploymentAuthorityResourceNeed,
|
|
258
|
+
DeploymentAuthorityResourceNeedSchema,
|
|
247
259
|
DeploymentAuthorityResourceSchema,
|
|
248
260
|
DeploymentAuthoritySchema,
|
|
249
261
|
type DeploymentAuthoritySurface,
|
|
250
262
|
DeploymentAuthoritySurfaceActionSchema,
|
|
251
263
|
DeploymentAuthoritySurfaceKindSchema,
|
|
264
|
+
type DeploymentAuthoritySurfaceNeed,
|
|
265
|
+
DeploymentAuthoritySurfaceNeedSchema,
|
|
252
266
|
DeploymentAuthoritySurfaceSchema,
|
|
253
267
|
type DeploymentAuthorityUpdate,
|
|
254
268
|
DeploymentAuthorityUpdateSchema,
|
|
255
269
|
DeploymentPortalRouteSchema,
|
|
256
270
|
DeploymentResourceBindingSchema,
|
|
271
|
+
DeviceActivationActorSchema,
|
|
257
272
|
type DeviceActivationRecord,
|
|
258
273
|
DeviceActivationRecordSchema,
|
|
259
274
|
DeviceActivationReviewSchema,
|
|
@@ -273,6 +288,17 @@ export {
|
|
|
273
288
|
LoginPortalSettingsSchema,
|
|
274
289
|
type LoginPortalSummary,
|
|
275
290
|
LoginPortalSummarySchema,
|
|
291
|
+
type MaterializedAuthorityCapabilityGrant,
|
|
292
|
+
MaterializedAuthorityCapabilityGrantSchema,
|
|
293
|
+
type MaterializedAuthorityGrant,
|
|
294
|
+
type MaterializedAuthorityGrants,
|
|
295
|
+
MaterializedAuthorityGrantsSchema,
|
|
296
|
+
type MaterializedAuthorityNatsGrant,
|
|
297
|
+
MaterializedAuthorityNatsGrantSchema,
|
|
298
|
+
type MaterializedAuthorityNatsGrantSource,
|
|
299
|
+
MaterializedAuthorityNatsGrantSourceSchema,
|
|
300
|
+
type MaterializedAuthoritySurfaceGrant,
|
|
301
|
+
MaterializedAuthoritySurfaceGrantSchema,
|
|
276
302
|
OpenObjectSchema,
|
|
277
303
|
type ParticipantKind,
|
|
278
304
|
ParticipantKindSchema,
|
package/src/auth/protocol.ts
CHANGED
|
@@ -191,30 +191,51 @@ export type DeploymentAuthorityResource = StaticDecode<
|
|
|
191
191
|
typeof DeploymentAuthorityResourceSchema
|
|
192
192
|
>;
|
|
193
193
|
|
|
194
|
-
export const
|
|
195
|
-
Type.
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
Type.
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
194
|
+
export const DeploymentAuthorityContractNeedSchema = Type.Object({
|
|
195
|
+
contractId: Type.String({ minLength: 1 }),
|
|
196
|
+
required: Type.Boolean(),
|
|
197
|
+
});
|
|
198
|
+
export type DeploymentAuthorityContractNeed = StaticDecode<
|
|
199
|
+
typeof DeploymentAuthorityContractNeedSchema
|
|
200
|
+
>;
|
|
201
|
+
|
|
202
|
+
export const DeploymentAuthoritySurfaceNeedSchema = Type.Object({
|
|
203
|
+
contractId: Type.String({ minLength: 1 }),
|
|
204
|
+
kind: DeploymentAuthoritySurfaceKindSchema,
|
|
205
|
+
name: Type.String({ minLength: 1 }),
|
|
206
|
+
action: Type.Optional(DeploymentAuthoritySurfaceActionSchema),
|
|
207
|
+
required: Type.Boolean(),
|
|
208
|
+
});
|
|
209
|
+
export type DeploymentAuthoritySurfaceNeed = StaticDecode<
|
|
210
|
+
typeof DeploymentAuthoritySurfaceNeedSchema
|
|
211
|
+
>;
|
|
212
|
+
|
|
213
|
+
export const DeploymentAuthorityCapabilityNeedSchema = Type.Object({
|
|
214
|
+
capability: DeploymentAuthorityCapabilitySchema,
|
|
215
|
+
required: Type.Boolean(),
|
|
216
|
+
});
|
|
217
|
+
export type DeploymentAuthorityCapabilityNeed = StaticDecode<
|
|
218
|
+
typeof DeploymentAuthorityCapabilityNeedSchema
|
|
219
|
+
>;
|
|
220
|
+
|
|
221
|
+
export const DeploymentAuthorityResourceNeedSchema = Type.Object({
|
|
222
|
+
kind: DeploymentAuthorityResourceKindSchema,
|
|
223
|
+
alias: Type.String({ minLength: 1 }),
|
|
224
|
+
required: Type.Boolean(),
|
|
225
|
+
definition: Type.Optional(OpenObjectSchema),
|
|
226
|
+
});
|
|
227
|
+
export type DeploymentAuthorityResourceNeed = StaticDecode<
|
|
228
|
+
typeof DeploymentAuthorityResourceNeedSchema
|
|
229
|
+
>;
|
|
230
|
+
|
|
231
|
+
export const DeploymentAuthorityNeedsSchema = Type.Object({
|
|
232
|
+
contracts: Type.Array(DeploymentAuthorityContractNeedSchema),
|
|
233
|
+
surfaces: Type.Array(DeploymentAuthoritySurfaceNeedSchema),
|
|
234
|
+
capabilities: Type.Array(DeploymentAuthorityCapabilityNeedSchema),
|
|
235
|
+
resources: Type.Array(DeploymentAuthorityResourceNeedSchema),
|
|
236
|
+
});
|
|
237
|
+
export type DeploymentAuthorityNeeds = StaticDecode<
|
|
238
|
+
typeof DeploymentAuthorityNeedsSchema
|
|
218
239
|
>;
|
|
219
240
|
|
|
220
241
|
export const DeploymentAuthoritySchema = Type.Object({
|
|
@@ -222,7 +243,7 @@ export const DeploymentAuthoritySchema = Type.Object({
|
|
|
222
243
|
kind: DeploymentAuthorityKindSchema,
|
|
223
244
|
disabled: Type.Boolean(),
|
|
224
245
|
desiredState: Type.Object({
|
|
225
|
-
needs:
|
|
246
|
+
needs: DeploymentAuthorityNeedsSchema,
|
|
226
247
|
capabilities: Type.Array(DeploymentAuthorityCapabilitySchema),
|
|
227
248
|
resources: Type.Array(DeploymentAuthorityResourceSchema),
|
|
228
249
|
surfaces: Type.Array(DeploymentAuthoritySurfaceSchema),
|
|
@@ -241,7 +262,7 @@ export const DeploymentAuthorityProposalSchema = Type.Object({
|
|
|
241
262
|
contractId: Type.String({ minLength: 1 }),
|
|
242
263
|
contractDigest: DigestSchema,
|
|
243
264
|
contract: Type.Optional(OpenObjectSchema),
|
|
244
|
-
requestedNeeds:
|
|
265
|
+
requestedNeeds: DeploymentAuthorityNeedsSchema,
|
|
245
266
|
providedSurfaces: Type.Array(DeploymentAuthoritySurfaceSchema),
|
|
246
267
|
summary: Type.Optional(OpenObjectSchema),
|
|
247
268
|
});
|
|
@@ -263,17 +284,21 @@ export type DeploymentResourceBinding = StaticDecode<
|
|
|
263
284
|
>;
|
|
264
285
|
|
|
265
286
|
export const MaterializedAuthoritySurfaceGrantSchema = Type.Object({
|
|
266
|
-
kind: Type.Literal("surface"),
|
|
267
287
|
contractId: Type.String({ minLength: 1 }),
|
|
268
288
|
surfaceKind: DeploymentAuthoritySurfaceKindSchema,
|
|
269
289
|
name: Type.String({ minLength: 1 }),
|
|
270
290
|
action: Type.Optional(DeploymentAuthoritySurfaceActionSchema),
|
|
271
291
|
});
|
|
292
|
+
export type MaterializedAuthoritySurfaceGrant = StaticDecode<
|
|
293
|
+
typeof MaterializedAuthoritySurfaceGrantSchema
|
|
294
|
+
>;
|
|
272
295
|
|
|
273
296
|
export const MaterializedAuthorityCapabilityGrantSchema = Type.Object({
|
|
274
|
-
kind: Type.Literal("capability"),
|
|
275
297
|
capability: DeploymentAuthorityCapabilitySchema,
|
|
276
298
|
});
|
|
299
|
+
export type MaterializedAuthorityCapabilityGrant = StaticDecode<
|
|
300
|
+
typeof MaterializedAuthorityCapabilityGrantSchema
|
|
301
|
+
>;
|
|
277
302
|
|
|
278
303
|
export const MaterializedAuthorityNatsGrantSourceSchema = Type.Union([
|
|
279
304
|
Type.Literal("owned-surface"),
|
|
@@ -282,9 +307,11 @@ export const MaterializedAuthorityNatsGrantSourceSchema = Type.Union([
|
|
|
282
307
|
Type.Literal("platform-service"),
|
|
283
308
|
Type.Literal("transfer"),
|
|
284
309
|
]);
|
|
310
|
+
export type MaterializedAuthorityNatsGrantSource = StaticDecode<
|
|
311
|
+
typeof MaterializedAuthorityNatsGrantSourceSchema
|
|
312
|
+
>;
|
|
285
313
|
|
|
286
314
|
export const MaterializedAuthorityNatsGrantSchema = Type.Object({
|
|
287
|
-
kind: Type.Literal("nats"),
|
|
288
315
|
direction: Type.Union([Type.Literal("publish"), Type.Literal("subscribe")]),
|
|
289
316
|
subject: Type.String({ minLength: 1 }),
|
|
290
317
|
surface: Type.Optional(Type.Object({
|
|
@@ -296,16 +323,24 @@ export const MaterializedAuthorityNatsGrantSchema = Type.Object({
|
|
|
296
323
|
requiredCapabilities: Type.Array(Type.String({ minLength: 1 })),
|
|
297
324
|
grantSource: MaterializedAuthorityNatsGrantSourceSchema,
|
|
298
325
|
});
|
|
326
|
+
export type MaterializedAuthorityNatsGrant = StaticDecode<
|
|
327
|
+
typeof MaterializedAuthorityNatsGrantSchema
|
|
328
|
+
>;
|
|
299
329
|
|
|
300
|
-
export const
|
|
301
|
-
MaterializedAuthorityCapabilityGrantSchema,
|
|
302
|
-
MaterializedAuthoritySurfaceGrantSchema,
|
|
303
|
-
MaterializedAuthorityNatsGrantSchema,
|
|
304
|
-
|
|
305
|
-
export type
|
|
306
|
-
typeof
|
|
330
|
+
export const MaterializedAuthorityGrantsSchema = Type.Object({
|
|
331
|
+
capabilities: Type.Array(MaterializedAuthorityCapabilityGrantSchema),
|
|
332
|
+
surfaces: Type.Array(MaterializedAuthoritySurfaceGrantSchema),
|
|
333
|
+
nats: Type.Array(MaterializedAuthorityNatsGrantSchema),
|
|
334
|
+
});
|
|
335
|
+
export type MaterializedAuthorityGrants = StaticDecode<
|
|
336
|
+
typeof MaterializedAuthorityGrantsSchema
|
|
307
337
|
>;
|
|
308
338
|
|
|
339
|
+
export type MaterializedAuthorityGrant =
|
|
340
|
+
| MaterializedAuthorityCapabilityGrant
|
|
341
|
+
| MaterializedAuthoritySurfaceGrant
|
|
342
|
+
| MaterializedAuthorityNatsGrant;
|
|
343
|
+
|
|
309
344
|
export const DeploymentAuthorityMaterializationSchema = Type.Object({
|
|
310
345
|
deploymentId: Type.String({ minLength: 1 }),
|
|
311
346
|
desiredVersion: Type.String({ minLength: 1 }),
|
|
@@ -315,7 +350,7 @@ export const DeploymentAuthorityMaterializationSchema = Type.Object({
|
|
|
315
350
|
Type.Literal("failed"),
|
|
316
351
|
]),
|
|
317
352
|
resourceBindings: Type.Array(DeploymentResourceBindingSchema),
|
|
318
|
-
grants:
|
|
353
|
+
grants: MaterializedAuthorityGrantsSchema,
|
|
319
354
|
reconciledAt: Type.Union([IsoDateStringSchema, Type.Null()]),
|
|
320
355
|
error: Type.Optional(Type.String({ minLength: 1 })),
|
|
321
356
|
});
|
package/src/codec.ts
CHANGED
|
@@ -194,10 +194,12 @@ export function sha256Bytes(data: Uint8Array): Uint8Array {
|
|
|
194
194
|
return out;
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
+
/** Computes a synchronous SHA-256 digest encoded as base64url. */
|
|
197
198
|
export function sha256Base64urlSync(text: string): string {
|
|
198
199
|
return base64url(sha256Bytes(new TextEncoder().encode(text)));
|
|
199
200
|
}
|
|
200
201
|
|
|
202
|
+
/** Computes a SHA-256 digest encoded as base64url. */
|
|
201
203
|
export async function sha256Base64url(text: string): Promise<string> {
|
|
202
204
|
if (typeof crypto !== "undefined" && crypto.subtle) {
|
|
203
205
|
const data = new TextEncoder().encode(text);
|
|
@@ -207,6 +209,7 @@ export async function sha256Base64url(text: string): Promise<string> {
|
|
|
207
209
|
return sha256Base64urlSync(text);
|
|
208
210
|
}
|
|
209
211
|
|
|
212
|
+
/** Canonicalizes JSON and computes its SHA-256 base64url digest. */
|
|
210
213
|
export async function digestJson(value: JsonValue): Promise<{
|
|
211
214
|
canonical: string;
|
|
212
215
|
digest: string;
|
|
@@ -64,6 +64,10 @@ import {
|
|
|
64
64
|
ContractResourcesSchema,
|
|
65
65
|
ContractSchemaRefSchema,
|
|
66
66
|
ContractStateSchema,
|
|
67
|
+
type JobKeyConcurrency,
|
|
68
|
+
JobKeyConcurrencySchema,
|
|
69
|
+
type JobQueueDepth,
|
|
70
|
+
JobQueueDepthSchema,
|
|
67
71
|
} from "./protocol.js";
|
|
68
72
|
|
|
69
73
|
export {
|
|
@@ -80,6 +84,7 @@ export {
|
|
|
80
84
|
ContractJobQueueSchema,
|
|
81
85
|
ContractJobsSchema,
|
|
82
86
|
ContractKvResourceSchema,
|
|
87
|
+
type ContractResourceBindings,
|
|
83
88
|
ContractResourceBindingsSchema,
|
|
84
89
|
ContractResourcesSchema,
|
|
85
90
|
ContractSchemaRefSchema,
|
|
@@ -95,13 +100,19 @@ export {
|
|
|
95
100
|
CursorQuerySchema,
|
|
96
101
|
type EventConsumerResourceBinding,
|
|
97
102
|
EventConsumerResourceBindingSchema,
|
|
98
|
-
type EventHeader,
|
|
99
|
-
EventHeaderSchema,
|
|
100
103
|
type InstalledServiceContract,
|
|
101
104
|
InstalledServiceContractSchema,
|
|
102
105
|
IsoDateSchema,
|
|
106
|
+
type JobKeyConcurrency,
|
|
107
|
+
JobKeyConcurrencySchema,
|
|
108
|
+
type JobQueueDepth,
|
|
109
|
+
JobQueueDepthSchema,
|
|
103
110
|
type JobsQueueBinding,
|
|
104
111
|
JobsQueueBindingSchema,
|
|
112
|
+
type JobsQueueDepthBinding,
|
|
113
|
+
JobsQueueDepthBindingSchema,
|
|
114
|
+
type JobsQueueKeyConcurrencyBinding,
|
|
115
|
+
JobsQueueKeyConcurrencyBindingSchema,
|
|
105
116
|
type JobsResourceBinding,
|
|
106
117
|
JobsResourceBindingSchema,
|
|
107
118
|
type KvResourceBinding,
|
|
@@ -555,6 +566,8 @@ export type ContractJobQueueResource = {
|
|
|
555
566
|
logs?: boolean;
|
|
556
567
|
dlq?: boolean;
|
|
557
568
|
concurrency?: number;
|
|
569
|
+
keyConcurrency?: JobKeyConcurrency;
|
|
570
|
+
queue?: JobQueueDepth;
|
|
558
571
|
docs?: ContractDocs;
|
|
559
572
|
};
|
|
560
573
|
|
|
@@ -961,6 +974,17 @@ export type ContractSourceJobQueue<
|
|
|
961
974
|
logs?: boolean;
|
|
962
975
|
dlq?: boolean;
|
|
963
976
|
concurrency?: number;
|
|
977
|
+
keyConcurrency?: {
|
|
978
|
+
key: readonly string[];
|
|
979
|
+
maxActive?: number;
|
|
980
|
+
heartbeatIntervalMs?: number;
|
|
981
|
+
heartbeatTtlMs?: number;
|
|
982
|
+
stalePolicy?: "fail-stale" | "block";
|
|
983
|
+
};
|
|
984
|
+
queue?: {
|
|
985
|
+
maxQueuedPerKey?: number;
|
|
986
|
+
whenFull?: "reject" | "coalesce" | "replace-oldest";
|
|
987
|
+
};
|
|
964
988
|
docs?: ContractDocs;
|
|
965
989
|
};
|
|
966
990
|
|
|
@@ -3119,7 +3143,110 @@ function errorDecl(error: ContractErrorDecl): ContractErrorDecl {
|
|
|
3119
3143
|
};
|
|
3120
3144
|
}
|
|
3121
3145
|
|
|
3122
|
-
|
|
3146
|
+
type JobKeyConcurrencyLike = {
|
|
3147
|
+
key: readonly string[];
|
|
3148
|
+
maxActive?: number;
|
|
3149
|
+
heartbeatIntervalMs?: number;
|
|
3150
|
+
heartbeatTtlMs?: number;
|
|
3151
|
+
stalePolicy?: "fail-stale" | "block";
|
|
3152
|
+
};
|
|
3153
|
+
|
|
3154
|
+
type JobQueueDepthLike = {
|
|
3155
|
+
maxQueuedPerKey?: number;
|
|
3156
|
+
whenFull?: "reject" | "coalesce" | "replace-oldest";
|
|
3157
|
+
};
|
|
3158
|
+
|
|
3159
|
+
function assertValidJsonPointerSyntax(
|
|
3160
|
+
queueType: string,
|
|
3161
|
+
pointer: string,
|
|
3162
|
+
): void {
|
|
3163
|
+
if (!pointer.startsWith("/")) {
|
|
3164
|
+
throw new Error(
|
|
3165
|
+
`jobs queue '${queueType}' keyConcurrency.key pointer segment '${pointer}' must start with '/'`,
|
|
3166
|
+
);
|
|
3167
|
+
}
|
|
3168
|
+
for (let index = 0; index < pointer.length; index += 1) {
|
|
3169
|
+
if (pointer[index] !== "~") continue;
|
|
3170
|
+
const escaped = pointer[index + 1];
|
|
3171
|
+
if (escaped !== "0" && escaped !== "1") {
|
|
3172
|
+
throw new Error(
|
|
3173
|
+
`jobs queue '${queueType}' keyConcurrency.key pointer segment '${pointer}' has invalid JSON Pointer escape at offset ${index}; use '~0' for '~' and '~1' for '/'`,
|
|
3174
|
+
);
|
|
3175
|
+
}
|
|
3176
|
+
index += 1;
|
|
3177
|
+
}
|
|
3178
|
+
}
|
|
3179
|
+
|
|
3180
|
+
function assertValidJobKeyConcurrency(
|
|
3181
|
+
queueType: string,
|
|
3182
|
+
keyConcurrency: JobKeyConcurrencyLike | undefined,
|
|
3183
|
+
): void {
|
|
3184
|
+
if (!keyConcurrency) return;
|
|
3185
|
+
if (keyConcurrency.key.length === 0) {
|
|
3186
|
+
throw new Error(
|
|
3187
|
+
`jobs queue '${queueType}' keyConcurrency.key must contain at least one segment`,
|
|
3188
|
+
);
|
|
3189
|
+
}
|
|
3190
|
+
for (const segment of keyConcurrency.key) {
|
|
3191
|
+
if (segment.length === 0) {
|
|
3192
|
+
throw new Error(
|
|
3193
|
+
`jobs queue '${queueType}' keyConcurrency.key segments must be non-empty strings`,
|
|
3194
|
+
);
|
|
3195
|
+
}
|
|
3196
|
+
if (segment.startsWith("/")) {
|
|
3197
|
+
assertValidJsonPointerSyntax(queueType, segment);
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
3200
|
+
if (
|
|
3201
|
+
keyConcurrency.heartbeatIntervalMs !== undefined &&
|
|
3202
|
+
keyConcurrency.heartbeatTtlMs !== undefined &&
|
|
3203
|
+
keyConcurrency.heartbeatTtlMs <= keyConcurrency.heartbeatIntervalMs
|
|
3204
|
+
) {
|
|
3205
|
+
throw new Error(
|
|
3206
|
+
`jobs queue '${queueType}' keyConcurrency.heartbeatTtlMs must exceed heartbeatIntervalMs`,
|
|
3207
|
+
);
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
|
|
3211
|
+
function jobKeyConcurrency(
|
|
3212
|
+
queueType: string,
|
|
3213
|
+
keyConcurrency: JobKeyConcurrencyLike | undefined,
|
|
3214
|
+
): JobKeyConcurrency | undefined {
|
|
3215
|
+
assertValidJobKeyConcurrency(queueType, keyConcurrency);
|
|
3216
|
+
if (!keyConcurrency) return undefined;
|
|
3217
|
+
return {
|
|
3218
|
+
key: [...keyConcurrency.key],
|
|
3219
|
+
...(keyConcurrency.maxActive !== undefined
|
|
3220
|
+
? { maxActive: keyConcurrency.maxActive }
|
|
3221
|
+
: {}),
|
|
3222
|
+
...(keyConcurrency.heartbeatIntervalMs !== undefined
|
|
3223
|
+
? { heartbeatIntervalMs: keyConcurrency.heartbeatIntervalMs }
|
|
3224
|
+
: {}),
|
|
3225
|
+
...(keyConcurrency.heartbeatTtlMs !== undefined
|
|
3226
|
+
? { heartbeatTtlMs: keyConcurrency.heartbeatTtlMs }
|
|
3227
|
+
: {}),
|
|
3228
|
+
...(keyConcurrency.stalePolicy !== undefined
|
|
3229
|
+
? { stalePolicy: keyConcurrency.stalePolicy }
|
|
3230
|
+
: {}),
|
|
3231
|
+
};
|
|
3232
|
+
}
|
|
3233
|
+
|
|
3234
|
+
function jobQueueDepth(
|
|
3235
|
+
queue: JobQueueDepthLike | undefined,
|
|
3236
|
+
): JobQueueDepth | undefined {
|
|
3237
|
+
if (!queue) return undefined;
|
|
3238
|
+
return {
|
|
3239
|
+
...(queue.maxQueuedPerKey !== undefined
|
|
3240
|
+
? { maxQueuedPerKey: queue.maxQueuedPerKey }
|
|
3241
|
+
: {}),
|
|
3242
|
+
...(queue.whenFull !== undefined ? { whenFull: queue.whenFull } : {}),
|
|
3243
|
+
};
|
|
3244
|
+
}
|
|
3245
|
+
|
|
3246
|
+
function jobQueue(
|
|
3247
|
+
queueType: string,
|
|
3248
|
+
queue: ContractJobQueue,
|
|
3249
|
+
): ContractJobQueue {
|
|
3123
3250
|
return {
|
|
3124
3251
|
payload: schemaRef(queue.payload),
|
|
3125
3252
|
...(queue.result ? { result: schemaRef(queue.result) } : {}),
|
|
@@ -3135,6 +3262,10 @@ function jobQueue(queue: ContractJobQueue): ContractJobQueue {
|
|
|
3135
3262
|
...(queue.concurrency !== undefined
|
|
3136
3263
|
? { concurrency: queue.concurrency }
|
|
3137
3264
|
: {}),
|
|
3265
|
+
...(queue.keyConcurrency
|
|
3266
|
+
? { keyConcurrency: jobKeyConcurrency(queueType, queue.keyConcurrency) }
|
|
3267
|
+
: {}),
|
|
3268
|
+
...(queue.queue ? { queue: jobQueueDepth(queue.queue) } : {}),
|
|
3138
3269
|
...(queue.docs ? { docs: contractDocs(queue.docs) } : {}),
|
|
3139
3270
|
};
|
|
3140
3271
|
}
|
|
@@ -3208,7 +3339,16 @@ export function normalizeContractManifest(
|
|
|
3208
3339
|
: {}),
|
|
3209
3340
|
...(contract.events ? { events: mapValues(contract.events, event) } : {}),
|
|
3210
3341
|
...(contract.feeds ? { feeds: mapValues(contract.feeds, feed) } : {}),
|
|
3211
|
-
...(contract.jobs
|
|
3342
|
+
...(contract.jobs
|
|
3343
|
+
? {
|
|
3344
|
+
jobs: Object.fromEntries(
|
|
3345
|
+
Object.entries(contract.jobs).map(([queueType, queue]) => [
|
|
3346
|
+
queueType,
|
|
3347
|
+
jobQueue(queueType, queue),
|
|
3348
|
+
]),
|
|
3349
|
+
),
|
|
3350
|
+
}
|
|
3351
|
+
: {}),
|
|
3212
3352
|
...(contract.eventConsumers
|
|
3213
3353
|
? {
|
|
3214
3354
|
eventConsumers: mapValues(
|
|
@@ -3411,6 +3551,12 @@ function emitJobs(
|
|
|
3411
3551
|
...(queue.concurrency !== undefined
|
|
3412
3552
|
? { concurrency: queue.concurrency }
|
|
3413
3553
|
: {}),
|
|
3554
|
+
...(queue.keyConcurrency
|
|
3555
|
+
? {
|
|
3556
|
+
keyConcurrency: jobKeyConcurrency(queueType, queue.keyConcurrency),
|
|
3557
|
+
}
|
|
3558
|
+
: {}),
|
|
3559
|
+
...(queue.queue ? { queue: jobQueueDepth(queue.queue) } : {}),
|
|
3414
3560
|
...(queue.docs ? { docs: contractDocs(queue.docs) } : {}),
|
|
3415
3561
|
} satisfies ContractJobQueue,
|
|
3416
3562
|
]),
|
|
@@ -5459,4 +5605,11 @@ export type {
|
|
|
5459
5605
|
SerializableErrorData,
|
|
5460
5606
|
TrellisAPI,
|
|
5461
5607
|
};
|
|
5462
|
-
export {
|
|
5608
|
+
export {
|
|
5609
|
+
canonicalizeJson,
|
|
5610
|
+
digestJson,
|
|
5611
|
+
isJsonValue,
|
|
5612
|
+
schema,
|
|
5613
|
+
sha256Base64urlSync,
|
|
5614
|
+
unwrapSchema,
|
|
5615
|
+
};
|
|
@@ -76,6 +76,30 @@ export const ContractStateSchema = Type.Record(
|
|
|
76
76
|
|
|
77
77
|
export type ContractState = Static<typeof ContractStateSchema>;
|
|
78
78
|
|
|
79
|
+
export const JobKeyConcurrencySchema = Type.Object({
|
|
80
|
+
key: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
|
|
81
|
+
maxActive: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
82
|
+
heartbeatIntervalMs: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
83
|
+
heartbeatTtlMs: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
84
|
+
stalePolicy: Type.Optional(Type.Union([
|
|
85
|
+
Type.Literal("fail-stale"),
|
|
86
|
+
Type.Literal("block"),
|
|
87
|
+
])),
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
export type JobKeyConcurrency = Static<typeof JobKeyConcurrencySchema>;
|
|
91
|
+
|
|
92
|
+
export const JobQueueDepthSchema = Type.Object({
|
|
93
|
+
maxQueuedPerKey: Type.Optional(Type.Integer({ minimum: 0 })),
|
|
94
|
+
whenFull: Type.Optional(Type.Union([
|
|
95
|
+
Type.Literal("reject"),
|
|
96
|
+
Type.Literal("coalesce"),
|
|
97
|
+
Type.Literal("replace-oldest"),
|
|
98
|
+
])),
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export type JobQueueDepth = Static<typeof JobQueueDepthSchema>;
|
|
102
|
+
|
|
79
103
|
export const ContractJobQueueSchema = Type.Object({
|
|
80
104
|
payload: ContractSchemaRefSchema,
|
|
81
105
|
result: Type.Optional(ContractSchemaRefSchema),
|
|
@@ -87,6 +111,8 @@ export const ContractJobQueueSchema = Type.Object({
|
|
|
87
111
|
logs: Type.Optional(Type.Boolean()),
|
|
88
112
|
dlq: Type.Optional(Type.Boolean()),
|
|
89
113
|
concurrency: Type.Optional(Type.Integer({ minimum: 1 })),
|
|
114
|
+
keyConcurrency: Type.Optional(JobKeyConcurrencySchema),
|
|
115
|
+
queue: Type.Optional(JobQueueDepthSchema),
|
|
90
116
|
docs: Type.Optional(ContractDocsSchema),
|
|
91
117
|
});
|
|
92
118
|
|
|
@@ -173,6 +199,34 @@ export const StoreResourceBindingSchema = Type.Object({
|
|
|
173
199
|
|
|
174
200
|
export type StoreResourceBinding = Static<typeof StoreResourceBindingSchema>;
|
|
175
201
|
|
|
202
|
+
export const JobsQueueKeyConcurrencyBindingSchema = Type.Object({
|
|
203
|
+
key: Type.Array(Type.String({ minLength: 1 }), { minItems: 1 }),
|
|
204
|
+
maxActive: Type.Integer({ minimum: 1 }),
|
|
205
|
+
heartbeatIntervalMs: Type.Integer({ minimum: 1 }),
|
|
206
|
+
heartbeatTtlMs: Type.Integer({ minimum: 1 }),
|
|
207
|
+
stalePolicy: Type.Union([
|
|
208
|
+
Type.Literal("fail-stale"),
|
|
209
|
+
Type.Literal("block"),
|
|
210
|
+
]),
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
export type JobsQueueKeyConcurrencyBinding = Static<
|
|
214
|
+
typeof JobsQueueKeyConcurrencyBindingSchema
|
|
215
|
+
>;
|
|
216
|
+
|
|
217
|
+
export const JobsQueueDepthBindingSchema = Type.Object({
|
|
218
|
+
maxQueuedPerKey: Type.Integer({ minimum: 0 }),
|
|
219
|
+
whenFull: Type.Union([
|
|
220
|
+
Type.Literal("reject"),
|
|
221
|
+
Type.Literal("coalesce"),
|
|
222
|
+
Type.Literal("replace-oldest"),
|
|
223
|
+
]),
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
export type JobsQueueDepthBinding = Static<
|
|
227
|
+
typeof JobsQueueDepthBindingSchema
|
|
228
|
+
>;
|
|
229
|
+
|
|
176
230
|
export const JobsQueueBindingSchema = Type.Object({
|
|
177
231
|
queueType: Type.String({ minLength: 1 }),
|
|
178
232
|
publishPrefix: Type.String({ minLength: 1 }),
|
|
@@ -188,6 +242,8 @@ export const JobsQueueBindingSchema = Type.Object({
|
|
|
188
242
|
logs: Type.Boolean(),
|
|
189
243
|
dlq: Type.Boolean(),
|
|
190
244
|
concurrency: Type.Integer({ minimum: 1 }),
|
|
245
|
+
keyConcurrency: Type.Optional(JobsQueueKeyConcurrencyBindingSchema),
|
|
246
|
+
queue: Type.Optional(JobsQueueDepthBindingSchema),
|
|
191
247
|
});
|
|
192
248
|
|
|
193
249
|
export type JobsQueueBinding = Static<typeof JobsQueueBindingSchema>;
|
|
@@ -252,15 +308,6 @@ export const IsoDateSchema = Type.Codec(
|
|
|
252
308
|
.Decode((value: string) => parseIsoDate(value))
|
|
253
309
|
.Encode((value: Date) => formatIsoDate(value));
|
|
254
310
|
|
|
255
|
-
export const EventHeaderSchema = Type.Object({
|
|
256
|
-
header: Type.Object({
|
|
257
|
-
id: Type.String(),
|
|
258
|
-
time: IsoDateSchema,
|
|
259
|
-
}),
|
|
260
|
-
});
|
|
261
|
-
|
|
262
|
-
export type EventHeader = Static<typeof EventHeaderSchema>;
|
|
263
|
-
|
|
264
311
|
/** Schema for a bounded pagination request. */
|
|
265
312
|
export const PageRequestSchema = Type.Object({
|
|
266
313
|
offset: Type.Optional(Type.Integer({ minimum: 0 })),
|
package/src/health.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -43,7 +43,6 @@ export type {
|
|
|
43
43
|
export {
|
|
44
44
|
createHealthHeartbeat,
|
|
45
45
|
HealthCheckResultSchema,
|
|
46
|
-
HealthHeartbeatHeaderSchema,
|
|
47
46
|
HealthHeartbeatSchema,
|
|
48
47
|
HealthHeartbeatServiceSchema,
|
|
49
48
|
HealthInfoSchema,
|
|
@@ -246,6 +245,8 @@ export type {
|
|
|
246
245
|
RuntimeStateStoresForContract,
|
|
247
246
|
RuntimeStateStoreShape,
|
|
248
247
|
StateFacade,
|
|
248
|
+
TrellisEventHeader,
|
|
249
|
+
TrellisEventMessage,
|
|
249
250
|
TrellisFor,
|
|
250
251
|
ValueStateStoreClient,
|
|
251
252
|
} from "./trellis.js";
|