@qlever-llc/trellis 0.10.22 → 0.11.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 +55 -0
- package/esm/auth/protocol.d.ts.map +1 -1
- package/esm/browser.d.ts +3 -3
- package/esm/browser.d.ts.map +1 -1
- package/esm/browser.js +1 -1
- package/esm/client_connect.d.ts +12 -3
- package/esm/client_connect.d.ts.map +1 -1
- package/esm/client_connect.js +112 -7
- package/esm/codec.d.ts +7 -6
- package/esm/codec.d.ts.map +1 -1
- package/esm/codec.js +125 -6
- 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 +125 -10
- package/esm/contract_support/mod.d.ts.map +1 -1
- package/esm/contract_support/mod.js +159 -5
- 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 +41 -7
- package/esm/contract_support/runtime.d.ts +4 -1
- package/esm/contract_support/runtime.d.ts.map +1 -1
- package/esm/errors/SchemaValidationError.d.ts +49 -0
- package/esm/errors/SchemaValidationError.d.ts.map +1 -0
- package/esm/errors/SchemaValidationError.js +67 -0
- package/esm/errors/index.d.ts +38 -9
- package/esm/errors/index.d.ts.map +1 -1
- package/esm/errors/index.js +16 -0
- package/esm/generated-sdk/auth/api.d.ts +33 -605
- 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 +129 -134
- package/esm/generated-sdk/auth/client.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.d.ts +2 -601
- package/esm/generated-sdk/auth/contract.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.js +310 -93
- package/esm/generated-sdk/auth/mod.d.ts +1 -1
- package/esm/generated-sdk/auth/mod.d.ts.map +1 -1
- package/esm/generated-sdk/auth/owned_api.d.ts +88 -86
- package/esm/generated-sdk/auth/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/auth/owned_api.js +6 -0
- package/esm/generated-sdk/auth/schemas.d.ts +284 -136
- package/esm/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/auth/schemas.js +231 -92
- package/esm/generated-sdk/auth/types.d.ts +565 -89
- 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/api.d.ts +29 -18
- package/esm/generated-sdk/health/api.d.ts.map +1 -1
- package/esm/generated-sdk/health/client.d.ts +7 -21
- package/esm/generated-sdk/health/client.d.ts.map +1 -1
- package/esm/generated-sdk/health/contract.d.ts +2 -15
- 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/mod.d.ts +1 -1
- package/esm/generated-sdk/health/mod.d.ts.map +1 -1
- package/esm/generated-sdk/health/owned_api.d.ts +2 -2
- 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 +10 -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 +29 -109
- package/esm/generated-sdk/jobs/api.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/client.d.ts +21 -33
- package/esm/generated-sdk/jobs/client.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/contract.d.ts +2 -106
- 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/mod.d.ts +1 -1
- package/esm/generated-sdk/jobs/mod.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/owned_api.d.ts +22 -9
- 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 +195 -12
- 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/api.d.ts +29 -68
- package/esm/generated-sdk/state/api.d.ts.map +1 -1
- package/esm/generated-sdk/state/client.d.ts +17 -31
- package/esm/generated-sdk/state/client.d.ts.map +1 -1
- package/esm/generated-sdk/state/contract.d.ts +1 -64
- package/esm/generated-sdk/state/contract.d.ts.map +1 -1
- package/esm/generated-sdk/state/mod.d.ts +1 -1
- package/esm/generated-sdk/state/mod.d.ts.map +1 -1
- package/esm/generated-sdk/state/owned_api.d.ts +7 -7
- package/esm/generated-sdk/state/types.d.ts +52 -9
- package/esm/generated-sdk/state/types.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/api.d.ts +33 -45
- 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 +31 -20
- package/esm/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/contract.d.ts +2 -41
- 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/mod.d.ts +1 -1
- package/esm/generated-sdk/trellis-core/mod.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/owned_api.d.ts +4 -4
- 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 +54 -7
- 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 +4 -4
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +2 -2
- 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 +58 -2
- package/esm/server/internal_jobs/job-manager.d.ts.map +1 -1
- package/esm/server/internal_jobs/job-manager.js +429 -55
- package/esm/server/internal_jobs/key-coordinator.d.ts +269 -0
- package/esm/server/internal_jobs/key-coordinator.d.ts.map +1 -0
- package/esm/server/internal_jobs/key-coordinator.js +677 -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/runtime.d.ts.map +1 -1
- package/esm/server/service.d.ts +81 -112
- package/esm/server/service.d.ts.map +1 -1
- package/esm/server/service.js +372 -130
- package/esm/server.d.ts +3 -3
- package/esm/server.d.ts.map +1 -1
- package/esm/service/deno.d.ts +1 -1
- package/esm/service/deno.d.ts.map +1 -1
- package/esm/service/drizzle.d.ts +52 -0
- package/esm/service/drizzle.d.ts.map +1 -0
- package/esm/service/drizzle.js +108 -0
- package/esm/service/mod.d.ts +3 -3
- package/esm/service/mod.d.ts.map +1 -1
- package/esm/service/mod.js +2 -2
- package/esm/service/node.d.ts +1 -1
- package/esm/service/node.d.ts.map +1 -1
- package/esm/service/outbox_inbox.d.ts +76 -22
- package/esm/service/outbox_inbox.d.ts.map +1 -1
- package/esm/service/outbox_inbox.js +231 -70
- package/esm/telemetry/metrics.d.ts +55 -0
- package/esm/telemetry/metrics.d.ts.map +1 -1
- package/esm/telemetry/metrics.js +86 -0
- package/esm/telemetry/mod.d.ts +2 -1
- package/esm/telemetry/mod.d.ts.map +1 -1
- package/esm/telemetry/mod.js +1 -1
- package/esm/trellis.d.ts +62 -30
- package/esm/trellis.d.ts.map +1 -1
- package/esm/trellis.js +125 -42
- 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 +11 -4
- package/script/auth/protocol.d.ts +55 -0
- package/script/auth/protocol.d.ts.map +1 -1
- package/script/browser.d.ts +3 -3
- package/script/browser.d.ts.map +1 -1
- package/script/browser.js +3 -2
- package/script/client_connect.d.ts +12 -3
- package/script/client_connect.d.ts.map +1 -1
- package/script/client_connect.js +111 -6
- package/script/codec.d.ts +7 -6
- package/script/codec.d.ts.map +1 -1
- package/script/codec.js +124 -5
- 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 +125 -10
- package/script/contract_support/mod.d.ts.map +1 -1
- package/script/contract_support/mod.js +165 -5
- 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 +42 -8
- package/script/contract_support/runtime.d.ts +4 -1
- package/script/contract_support/runtime.d.ts.map +1 -1
- package/script/errors/SchemaValidationError.d.ts +49 -0
- package/script/errors/SchemaValidationError.d.ts.map +1 -0
- package/script/errors/SchemaValidationError.js +74 -0
- package/script/errors/index.d.ts +38 -9
- package/script/errors/index.d.ts.map +1 -1
- package/script/errors/index.js +20 -1
- package/script/generated-sdk/auth/api.d.ts +33 -605
- 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 +129 -134
- package/script/generated-sdk/auth/client.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.d.ts +2 -601
- package/script/generated-sdk/auth/contract.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.js +310 -93
- package/script/generated-sdk/auth/mod.d.ts +1 -1
- package/script/generated-sdk/auth/mod.d.ts.map +1 -1
- package/script/generated-sdk/auth/owned_api.d.ts +88 -86
- package/script/generated-sdk/auth/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/auth/owned_api.js +6 -0
- package/script/generated-sdk/auth/schemas.d.ts +284 -136
- package/script/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/script/generated-sdk/auth/schemas.js +231 -92
- package/script/generated-sdk/auth/types.d.ts +565 -89
- 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/api.d.ts +29 -18
- package/script/generated-sdk/health/api.d.ts.map +1 -1
- package/script/generated-sdk/health/client.d.ts +7 -21
- package/script/generated-sdk/health/client.d.ts.map +1 -1
- package/script/generated-sdk/health/contract.d.ts +2 -15
- 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/mod.d.ts +1 -1
- package/script/generated-sdk/health/mod.d.ts.map +1 -1
- package/script/generated-sdk/health/owned_api.d.ts +2 -2
- 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 +10 -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 +29 -109
- package/script/generated-sdk/jobs/api.d.ts.map +1 -1
- package/script/generated-sdk/jobs/client.d.ts +21 -33
- package/script/generated-sdk/jobs/client.d.ts.map +1 -1
- package/script/generated-sdk/jobs/contract.d.ts +2 -106
- 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/mod.d.ts +1 -1
- package/script/generated-sdk/jobs/mod.d.ts.map +1 -1
- package/script/generated-sdk/jobs/owned_api.d.ts +22 -9
- 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 +195 -12
- 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/api.d.ts +29 -68
- package/script/generated-sdk/state/api.d.ts.map +1 -1
- package/script/generated-sdk/state/client.d.ts +17 -31
- package/script/generated-sdk/state/client.d.ts.map +1 -1
- package/script/generated-sdk/state/contract.d.ts +1 -64
- package/script/generated-sdk/state/contract.d.ts.map +1 -1
- package/script/generated-sdk/state/mod.d.ts +1 -1
- package/script/generated-sdk/state/mod.d.ts.map +1 -1
- package/script/generated-sdk/state/owned_api.d.ts +7 -7
- package/script/generated-sdk/state/types.d.ts +52 -9
- package/script/generated-sdk/state/types.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/api.d.ts +33 -45
- 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 +31 -20
- package/script/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/contract.d.ts +2 -41
- 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/mod.d.ts +1 -1
- package/script/generated-sdk/trellis-core/mod.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/owned_api.d.ts +4 -4
- 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 +54 -7
- 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 +4 -4
- package/script/index.d.ts.map +1 -1
- package/script/index.js +2 -2
- 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 +58 -2
- package/script/server/internal_jobs/job-manager.d.ts.map +1 -1
- package/script/server/internal_jobs/job-manager.js +429 -54
- package/script/server/internal_jobs/key-coordinator.d.ts +269 -0
- package/script/server/internal_jobs/key-coordinator.d.ts.map +1 -0
- package/script/server/internal_jobs/key-coordinator.js +690 -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/runtime.d.ts.map +1 -1
- package/script/server/service.d.ts +81 -112
- package/script/server/service.d.ts.map +1 -1
- package/script/server/service.js +369 -127
- package/script/server.d.ts +3 -3
- package/script/server.d.ts.map +1 -1
- package/script/service/deno.d.ts +1 -1
- package/script/service/deno.d.ts.map +1 -1
- package/script/service/drizzle.d.ts +52 -0
- package/script/service/drizzle.d.ts.map +1 -0
- package/script/service/drizzle.js +113 -0
- package/script/service/mod.d.ts +3 -3
- package/script/service/mod.d.ts.map +1 -1
- package/script/service/mod.js +4 -3
- package/script/service/node.d.ts +1 -1
- package/script/service/node.d.ts.map +1 -1
- package/script/service/outbox_inbox.d.ts +76 -22
- package/script/service/outbox_inbox.d.ts.map +1 -1
- package/script/service/outbox_inbox.js +233 -70
- package/script/telemetry/metrics.d.ts +55 -0
- package/script/telemetry/metrics.d.ts.map +1 -1
- package/script/telemetry/metrics.js +88 -0
- package/script/telemetry/mod.d.ts +2 -1
- package/script/telemetry/mod.d.ts.map +1 -1
- package/script/telemetry/mod.js +3 -1
- package/script/trellis.d.ts +62 -30
- package/script/trellis.d.ts.map +1 -1
- package/script/trellis.js +124 -41
- package/src/auth/mod.ts +7 -0
- package/src/browser.ts +5 -7
- package/src/client_connect.ts +200 -12
- package/src/codec.ts +186 -11
- package/src/contract_support/canonical.ts +3 -0
- package/src/contract_support/mod.ts +380 -9
- package/src/contract_support/protocol.ts +57 -10
- package/src/contract_support/runtime.ts +7 -0
- package/src/errors/SchemaValidationError.ts +67 -0
- package/src/errors/index.ts +28 -0
- package/src/health.ts +0 -1
- package/src/index.ts +7 -8
- package/src/jobs.ts +138 -1
- package/src/sdk/_generated/auth/api.ts +38 -7
- package/src/sdk/_generated/auth/client.ts +168 -530
- package/src/sdk/_generated/auth/contract.ts +310 -93
- package/src/sdk/_generated/auth/mod.ts +0 -1
- package/src/sdk/_generated/auth/owned_api.ts +92 -86
- package/src/sdk/_generated/auth/schemas.ts +231 -92
- package/src/sdk/_generated/auth/types.ts +1069 -273
- package/src/sdk/_generated/core/api.ts +38 -7
- package/src/sdk/_generated/core/client.ts +47 -73
- package/src/sdk/_generated/core/contract.ts +91 -1
- package/src/sdk/_generated/core/mod.ts +0 -1
- package/src/sdk/_generated/core/owned_api.ts +4 -4
- package/src/sdk/_generated/core/schemas.ts +81 -0
- package/src/sdk/_generated/core/types.ts +79 -15
- package/src/sdk/_generated/health/api.ts +29 -5
- package/src/sdk/_generated/health/client.ts +11 -58
- package/src/sdk/_generated/health/contract.ts +2 -10
- package/src/sdk/_generated/health/mod.ts +0 -1
- package/src/sdk/_generated/health/owned_api.ts +2 -2
- package/src/sdk/_generated/health/schemas.ts +1 -9
- package/src/sdk/_generated/health/types.ts +23 -2
- package/src/sdk/_generated/jobs/api.ts +29 -5
- package/src/sdk/_generated/jobs/client.ts +25 -109
- package/src/sdk/_generated/jobs/contract.ts +269 -1
- package/src/sdk/_generated/jobs/mod.ts +0 -1
- package/src/sdk/_generated/jobs/owned_api.ts +30 -9
- package/src/sdk/_generated/jobs/schemas.ts +213 -0
- package/src/sdk/_generated/jobs/types.ts +252 -18
- package/src/sdk/_generated/state/api.ts +29 -5
- package/src/sdk/_generated/state/client.ts +18 -95
- package/src/sdk/_generated/state/mod.ts +0 -1
- package/src/sdk/_generated/state/owned_api.ts +7 -7
- package/src/sdk/_generated/state/types.ts +91 -15
- 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 +553 -24
- package/src/server/internal_jobs/key-coordinator.ts +1080 -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/runtime.ts +4 -0
- package/src/server/service.ts +645 -625
- package/src/server.ts +14 -7
- package/src/service/deno.ts +0 -5
- package/src/service/drizzle.ts +184 -0
- package/src/service/mod.ts +17 -7
- package/src/service/node.ts +0 -5
- package/src/service/outbox_inbox.ts +354 -88
- package/src/telemetry/metrics.ts +198 -1
- package/src/telemetry/mod.ts +6 -0
- package/src/trellis.ts +286 -105
|
@@ -1,19 +1,35 @@
|
|
|
1
1
|
// Generated from ./generated/contracts/manifests/trellis.jobs@v1.json
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type {
|
|
3
|
+
BaseError,
|
|
4
|
+
HandlerTrellis,
|
|
5
|
+
Result,
|
|
6
|
+
RpcHandlerContext,
|
|
7
|
+
TrellisErrorInstance,
|
|
8
|
+
} from "../../../index.js";
|
|
9
|
+
|
|
10
|
+
import type { Api } from "./api.js";
|
|
4
11
|
|
|
5
12
|
import { type SerializableErrorData, TrellisError } from "../../../index.js";
|
|
6
13
|
|
|
7
14
|
import { NotFoundErrorDataSchema } from "./schemas.js";
|
|
8
15
|
|
|
16
|
+
export type HandlerClient = HandlerTrellis<Api>;
|
|
17
|
+
|
|
9
18
|
export const CONTRACT_ID = "trellis.jobs@v1" as const;
|
|
10
19
|
export const CONTRACT_DIGEST =
|
|
11
|
-
"
|
|
20
|
+
"xDigtrlrF3n3ZNgHVdwDJFcwi0PEJBiDyBG6FnzFzM8" as const;
|
|
12
21
|
|
|
13
22
|
export type JobsCancelInput = { id: string };
|
|
14
23
|
export type JobsCancelOutput = {
|
|
15
24
|
job: {
|
|
16
25
|
completedAt?: string;
|
|
26
|
+
concurrency?: {
|
|
27
|
+
heartbeatAt?: string;
|
|
28
|
+
key: string;
|
|
29
|
+
keyHash: string;
|
|
30
|
+
leaseExpiresAt?: string;
|
|
31
|
+
staleTakeoverCount?: number;
|
|
32
|
+
};
|
|
17
33
|
context: {
|
|
18
34
|
requestId: string;
|
|
19
35
|
traceId: string;
|
|
@@ -35,6 +51,12 @@ export type JobsCancelOutput = {
|
|
|
35
51
|
step?: string;
|
|
36
52
|
total?: number;
|
|
37
53
|
};
|
|
54
|
+
queuePolicy?: {
|
|
55
|
+
existingJobId?: string;
|
|
56
|
+
outcome: string;
|
|
57
|
+
reason?: string;
|
|
58
|
+
replacedJobId?: string;
|
|
59
|
+
};
|
|
38
60
|
result?: unknown;
|
|
39
61
|
service: string;
|
|
40
62
|
startedAt?: string;
|
|
@@ -58,6 +80,13 @@ export type JobsDismissDLQInput = { id: string };
|
|
|
58
80
|
export type JobsDismissDLQOutput = {
|
|
59
81
|
job: {
|
|
60
82
|
completedAt?: string;
|
|
83
|
+
concurrency?: {
|
|
84
|
+
heartbeatAt?: string;
|
|
85
|
+
key: string;
|
|
86
|
+
keyHash: string;
|
|
87
|
+
leaseExpiresAt?: string;
|
|
88
|
+
staleTakeoverCount?: number;
|
|
89
|
+
};
|
|
61
90
|
context: {
|
|
62
91
|
requestId: string;
|
|
63
92
|
traceId: string;
|
|
@@ -79,6 +108,12 @@ export type JobsDismissDLQOutput = {
|
|
|
79
108
|
step?: string;
|
|
80
109
|
total?: number;
|
|
81
110
|
};
|
|
111
|
+
queuePolicy?: {
|
|
112
|
+
existingJobId?: string;
|
|
113
|
+
outcome: string;
|
|
114
|
+
reason?: string;
|
|
115
|
+
replacedJobId?: string;
|
|
116
|
+
};
|
|
82
117
|
result?: unknown;
|
|
83
118
|
service: string;
|
|
84
119
|
startedAt?: string;
|
|
@@ -102,6 +137,13 @@ export type JobsGetInput = { id: string };
|
|
|
102
137
|
export type JobsGetOutput = {
|
|
103
138
|
job: {
|
|
104
139
|
completedAt?: string;
|
|
140
|
+
concurrency?: {
|
|
141
|
+
heartbeatAt?: string;
|
|
142
|
+
key: string;
|
|
143
|
+
keyHash: string;
|
|
144
|
+
leaseExpiresAt?: string;
|
|
145
|
+
staleTakeoverCount?: number;
|
|
146
|
+
};
|
|
105
147
|
context: {
|
|
106
148
|
requestId: string;
|
|
107
149
|
traceId: string;
|
|
@@ -123,6 +165,12 @@ export type JobsGetOutput = {
|
|
|
123
165
|
step?: string;
|
|
124
166
|
total?: number;
|
|
125
167
|
};
|
|
168
|
+
queuePolicy?: {
|
|
169
|
+
existingJobId?: string;
|
|
170
|
+
outcome: string;
|
|
171
|
+
reason?: string;
|
|
172
|
+
replacedJobId?: string;
|
|
173
|
+
};
|
|
126
174
|
result?: unknown;
|
|
127
175
|
service: string;
|
|
128
176
|
startedAt?: string;
|
|
@@ -142,6 +190,28 @@ export type JobsGetOutput = {
|
|
|
142
190
|
};
|
|
143
191
|
};
|
|
144
192
|
|
|
193
|
+
export type JobsGetKeyInput = { key: string; service: string; type: string };
|
|
194
|
+
export type JobsGetKeyOutput = {
|
|
195
|
+
active: Array<
|
|
196
|
+
{
|
|
197
|
+
heartbeatAgeMs: number;
|
|
198
|
+
heartbeatAt: string;
|
|
199
|
+
instanceId: string;
|
|
200
|
+
jobId: string;
|
|
201
|
+
leaseExpiresAt: string;
|
|
202
|
+
startedAt: string;
|
|
203
|
+
}
|
|
204
|
+
>;
|
|
205
|
+
key: string;
|
|
206
|
+
keyHash: string;
|
|
207
|
+
latestPolicyReason?: string;
|
|
208
|
+
queued: Array<{ createdAt: string; jobId: string }>;
|
|
209
|
+
queuedDepth: number;
|
|
210
|
+
service: string;
|
|
211
|
+
staleTakeoverCount: number;
|
|
212
|
+
type: string;
|
|
213
|
+
};
|
|
214
|
+
|
|
145
215
|
export type JobsHealthInput = {};
|
|
146
216
|
export type JobsHealthOutput = {
|
|
147
217
|
checks: Array<{ [k: string]: unknown }>;
|
|
@@ -175,6 +245,13 @@ export type JobsListOutput = {
|
|
|
175
245
|
entries: Array<
|
|
176
246
|
{
|
|
177
247
|
completedAt?: string;
|
|
248
|
+
concurrency?: {
|
|
249
|
+
heartbeatAt?: string;
|
|
250
|
+
key: string;
|
|
251
|
+
keyHash: string;
|
|
252
|
+
leaseExpiresAt?: string;
|
|
253
|
+
staleTakeoverCount?: number;
|
|
254
|
+
};
|
|
178
255
|
context: {
|
|
179
256
|
requestId: string;
|
|
180
257
|
traceId: string;
|
|
@@ -196,6 +273,12 @@ export type JobsListOutput = {
|
|
|
196
273
|
step?: string;
|
|
197
274
|
total?: number;
|
|
198
275
|
};
|
|
276
|
+
queuePolicy?: {
|
|
277
|
+
existingJobId?: string;
|
|
278
|
+
outcome: string;
|
|
279
|
+
reason?: string;
|
|
280
|
+
replacedJobId?: string;
|
|
281
|
+
};
|
|
199
282
|
result?: unknown;
|
|
200
283
|
service: string;
|
|
201
284
|
startedAt?: string;
|
|
@@ -231,6 +314,13 @@ export type JobsListDLQOutput = {
|
|
|
231
314
|
entries: Array<
|
|
232
315
|
{
|
|
233
316
|
completedAt?: string;
|
|
317
|
+
concurrency?: {
|
|
318
|
+
heartbeatAt?: string;
|
|
319
|
+
key: string;
|
|
320
|
+
keyHash: string;
|
|
321
|
+
leaseExpiresAt?: string;
|
|
322
|
+
staleTakeoverCount?: number;
|
|
323
|
+
};
|
|
234
324
|
context: {
|
|
235
325
|
requestId: string;
|
|
236
326
|
traceId: string;
|
|
@@ -252,6 +342,12 @@ export type JobsListDLQOutput = {
|
|
|
252
342
|
step?: string;
|
|
253
343
|
total?: number;
|
|
254
344
|
};
|
|
345
|
+
queuePolicy?: {
|
|
346
|
+
existingJobId?: string;
|
|
347
|
+
outcome: string;
|
|
348
|
+
reason?: string;
|
|
349
|
+
replacedJobId?: string;
|
|
350
|
+
};
|
|
255
351
|
result?: unknown;
|
|
256
352
|
service: string;
|
|
257
353
|
startedAt?: string;
|
|
@@ -303,6 +399,13 @@ export type JobsReplayDLQInput = { id: string };
|
|
|
303
399
|
export type JobsReplayDLQOutput = {
|
|
304
400
|
job: {
|
|
305
401
|
completedAt?: string;
|
|
402
|
+
concurrency?: {
|
|
403
|
+
heartbeatAt?: string;
|
|
404
|
+
key: string;
|
|
405
|
+
keyHash: string;
|
|
406
|
+
leaseExpiresAt?: string;
|
|
407
|
+
staleTakeoverCount?: number;
|
|
408
|
+
};
|
|
306
409
|
context: {
|
|
307
410
|
requestId: string;
|
|
308
411
|
traceId: string;
|
|
@@ -324,6 +427,12 @@ export type JobsReplayDLQOutput = {
|
|
|
324
427
|
step?: string;
|
|
325
428
|
total?: number;
|
|
326
429
|
};
|
|
430
|
+
queuePolicy?: {
|
|
431
|
+
existingJobId?: string;
|
|
432
|
+
outcome: string;
|
|
433
|
+
reason?: string;
|
|
434
|
+
replacedJobId?: string;
|
|
435
|
+
};
|
|
327
436
|
result?: unknown;
|
|
328
437
|
service: string;
|
|
329
438
|
startedAt?: string;
|
|
@@ -347,6 +456,13 @@ export type JobsRetryInput = { id: string };
|
|
|
347
456
|
export type JobsRetryOutput = {
|
|
348
457
|
job: {
|
|
349
458
|
completedAt?: string;
|
|
459
|
+
concurrency?: {
|
|
460
|
+
heartbeatAt?: string;
|
|
461
|
+
key: string;
|
|
462
|
+
keyHash: string;
|
|
463
|
+
leaseExpiresAt?: string;
|
|
464
|
+
staleTakeoverCount?: number;
|
|
465
|
+
};
|
|
350
466
|
context: {
|
|
351
467
|
requestId: string;
|
|
352
468
|
traceId: string;
|
|
@@ -368,6 +484,12 @@ export type JobsRetryOutput = {
|
|
|
368
484
|
step?: string;
|
|
369
485
|
total?: number;
|
|
370
486
|
};
|
|
487
|
+
queuePolicy?: {
|
|
488
|
+
existingJobId?: string;
|
|
489
|
+
outcome: string;
|
|
490
|
+
reason?: string;
|
|
491
|
+
replacedJobId?: string;
|
|
492
|
+
};
|
|
371
493
|
result?: unknown;
|
|
372
494
|
service: string;
|
|
373
495
|
startedAt?: string;
|
|
@@ -425,6 +547,7 @@ export interface RpcMap {
|
|
|
425
547
|
output: JobsDismissDLQOutput;
|
|
426
548
|
};
|
|
427
549
|
"Jobs.Get": { input: JobsGetInput; output: JobsGetOutput };
|
|
550
|
+
"Jobs.GetKey": { input: JobsGetKeyInput; output: JobsGetKeyOutput };
|
|
428
551
|
"Jobs.Health": { input: JobsHealthInput; output: JobsHealthOutput };
|
|
429
552
|
"Jobs.List": { input: JobsListInput; output: JobsListOutput };
|
|
430
553
|
"Jobs.ListDLQ": { input: JobsListDLQInput; output: JobsListDLQOutput };
|
|
@@ -436,24 +559,135 @@ export interface RpcMap {
|
|
|
436
559
|
"Jobs.Retry": { input: JobsRetryInput; output: JobsRetryOutput };
|
|
437
560
|
}
|
|
438
561
|
|
|
439
|
-
export type
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
562
|
+
export type JobsCancelHandlerError =
|
|
563
|
+
| TrellisErrorInstance
|
|
564
|
+
| BaseError<NotFoundErrorData>;
|
|
565
|
+
export type JobsCancelHandlerResult = Result<
|
|
566
|
+
JobsCancelOutput,
|
|
567
|
+
JobsCancelHandlerError
|
|
568
|
+
>;
|
|
569
|
+
export type JobsCancelHandler = (
|
|
570
|
+
args: {
|
|
571
|
+
input: JobsCancelInput;
|
|
572
|
+
context: RpcHandlerContext;
|
|
573
|
+
client: HandlerClient;
|
|
574
|
+
},
|
|
575
|
+
) => JobsCancelHandlerResult | Promise<JobsCancelHandlerResult>;
|
|
576
|
+
export type JobsDismissDLQHandlerError =
|
|
577
|
+
| TrellisErrorInstance
|
|
578
|
+
| BaseError<NotFoundErrorData>;
|
|
579
|
+
export type JobsDismissDLQHandlerResult = Result<
|
|
580
|
+
JobsDismissDLQOutput,
|
|
581
|
+
JobsDismissDLQHandlerError
|
|
443
582
|
>;
|
|
444
|
-
export type
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
583
|
+
export type JobsDismissDLQHandler = (
|
|
584
|
+
args: {
|
|
585
|
+
input: JobsDismissDLQInput;
|
|
586
|
+
context: RpcHandlerContext;
|
|
587
|
+
client: HandlerClient;
|
|
588
|
+
},
|
|
589
|
+
) => JobsDismissDLQHandlerResult | Promise<JobsDismissDLQHandlerResult>;
|
|
590
|
+
export type JobsGetHandlerError =
|
|
591
|
+
| TrellisErrorInstance
|
|
592
|
+
| BaseError<NotFoundErrorData>;
|
|
593
|
+
export type JobsGetHandlerResult = Result<JobsGetOutput, JobsGetHandlerError>;
|
|
594
|
+
export type JobsGetHandler = (
|
|
595
|
+
args: {
|
|
596
|
+
input: JobsGetInput;
|
|
597
|
+
context: RpcHandlerContext;
|
|
598
|
+
client: HandlerClient;
|
|
599
|
+
},
|
|
600
|
+
) => JobsGetHandlerResult | Promise<JobsGetHandlerResult>;
|
|
601
|
+
export type JobsGetKeyHandlerError =
|
|
602
|
+
| TrellisErrorInstance
|
|
603
|
+
| BaseError<NotFoundErrorData>;
|
|
604
|
+
export type JobsGetKeyHandlerResult = Result<
|
|
605
|
+
JobsGetKeyOutput,
|
|
606
|
+
JobsGetKeyHandlerError
|
|
607
|
+
>;
|
|
608
|
+
export type JobsGetKeyHandler = (
|
|
609
|
+
args: {
|
|
610
|
+
input: JobsGetKeyInput;
|
|
611
|
+
context: RpcHandlerContext;
|
|
612
|
+
client: HandlerClient;
|
|
613
|
+
},
|
|
614
|
+
) => JobsGetKeyHandlerResult | Promise<JobsGetKeyHandlerResult>;
|
|
615
|
+
export type JobsHealthHandlerError = TrellisErrorInstance;
|
|
616
|
+
export type JobsHealthHandlerResult = Result<
|
|
617
|
+
JobsHealthOutput,
|
|
618
|
+
JobsHealthHandlerError
|
|
619
|
+
>;
|
|
620
|
+
export type JobsHealthHandler = (
|
|
621
|
+
args: {
|
|
622
|
+
input: JobsHealthInput;
|
|
623
|
+
context: RpcHandlerContext;
|
|
624
|
+
client: HandlerClient;
|
|
625
|
+
},
|
|
626
|
+
) => JobsHealthHandlerResult | Promise<JobsHealthHandlerResult>;
|
|
627
|
+
export type JobsListHandlerError = TrellisErrorInstance;
|
|
628
|
+
export type JobsListHandlerResult = Result<
|
|
629
|
+
JobsListOutput,
|
|
630
|
+
JobsListHandlerError
|
|
631
|
+
>;
|
|
632
|
+
export type JobsListHandler = (
|
|
633
|
+
args: {
|
|
634
|
+
input: JobsListInput;
|
|
635
|
+
context: RpcHandlerContext;
|
|
636
|
+
client: HandlerClient;
|
|
637
|
+
},
|
|
638
|
+
) => JobsListHandlerResult | Promise<JobsListHandlerResult>;
|
|
639
|
+
export type JobsListDLQHandlerError = TrellisErrorInstance;
|
|
640
|
+
export type JobsListDLQHandlerResult = Result<
|
|
641
|
+
JobsListDLQOutput,
|
|
642
|
+
JobsListDLQHandlerError
|
|
643
|
+
>;
|
|
644
|
+
export type JobsListDLQHandler = (
|
|
645
|
+
args: {
|
|
646
|
+
input: JobsListDLQInput;
|
|
647
|
+
context: RpcHandlerContext;
|
|
648
|
+
client: HandlerClient;
|
|
649
|
+
},
|
|
650
|
+
) => JobsListDLQHandlerResult | Promise<JobsListDLQHandlerResult>;
|
|
651
|
+
export type JobsListServicesHandlerError = TrellisErrorInstance;
|
|
652
|
+
export type JobsListServicesHandlerResult = Result<
|
|
653
|
+
JobsListServicesOutput,
|
|
654
|
+
JobsListServicesHandlerError
|
|
655
|
+
>;
|
|
656
|
+
export type JobsListServicesHandler = (
|
|
657
|
+
args: {
|
|
658
|
+
input: JobsListServicesInput;
|
|
659
|
+
context: RpcHandlerContext;
|
|
660
|
+
client: HandlerClient;
|
|
661
|
+
},
|
|
662
|
+
) => JobsListServicesHandlerResult | Promise<JobsListServicesHandlerResult>;
|
|
663
|
+
export type JobsReplayDLQHandlerError =
|
|
664
|
+
| TrellisErrorInstance
|
|
665
|
+
| BaseError<NotFoundErrorData>;
|
|
666
|
+
export type JobsReplayDLQHandlerResult = Result<
|
|
667
|
+
JobsReplayDLQOutput,
|
|
668
|
+
JobsReplayDLQHandlerError
|
|
451
669
|
>;
|
|
452
|
-
export type JobsReplayDLQHandler =
|
|
453
|
-
|
|
454
|
-
|
|
670
|
+
export type JobsReplayDLQHandler = (
|
|
671
|
+
args: {
|
|
672
|
+
input: JobsReplayDLQInput;
|
|
673
|
+
context: RpcHandlerContext;
|
|
674
|
+
client: HandlerClient;
|
|
675
|
+
},
|
|
676
|
+
) => JobsReplayDLQHandlerResult | Promise<JobsReplayDLQHandlerResult>;
|
|
677
|
+
export type JobsRetryHandlerError =
|
|
678
|
+
| TrellisErrorInstance
|
|
679
|
+
| BaseError<NotFoundErrorData>;
|
|
680
|
+
export type JobsRetryHandlerResult = Result<
|
|
681
|
+
JobsRetryOutput,
|
|
682
|
+
JobsRetryHandlerError
|
|
455
683
|
>;
|
|
456
|
-
export type JobsRetryHandler =
|
|
684
|
+
export type JobsRetryHandler = (
|
|
685
|
+
args: {
|
|
686
|
+
input: JobsRetryInput;
|
|
687
|
+
context: RpcHandlerContext;
|
|
688
|
+
client: HandlerClient;
|
|
689
|
+
},
|
|
690
|
+
) => JobsRetryHandlerResult | Promise<JobsRetryHandlerResult>;
|
|
457
691
|
|
|
458
692
|
export interface EventMap {
|
|
459
693
|
}
|
|
@@ -4,6 +4,25 @@ import { OWNED_API as HealthApi } from "../health/mod.js";
|
|
|
4
4
|
|
|
5
5
|
export { OWNED_API };
|
|
6
6
|
|
|
7
|
+
type __TrellisGeneratedOptionalOperationProgress<TDesc> = TDesc extends
|
|
8
|
+
{ progress: infer TProgress } ? { progress?: TProgress }
|
|
9
|
+
: { progress?: undefined };
|
|
10
|
+
type __TrellisGeneratedOptionalOperationOutput<TDesc> = TDesc extends
|
|
11
|
+
{ output: infer TOutput } ? { output?: TOutput }
|
|
12
|
+
: { output?: undefined };
|
|
13
|
+
type __TrellisGeneratedOptionalOperationIO<TDesc> = TDesc extends
|
|
14
|
+
{ input: infer TInput } ?
|
|
15
|
+
& Omit<TDesc, "input" | "progress" | "output">
|
|
16
|
+
& {
|
|
17
|
+
input: TInput;
|
|
18
|
+
}
|
|
19
|
+
& __TrellisGeneratedOptionalOperationProgress<TDesc>
|
|
20
|
+
& __TrellisGeneratedOptionalOperationOutput<TDesc>
|
|
21
|
+
: TDesc;
|
|
22
|
+
type __TrellisGeneratedOperationApi<TApi> = {
|
|
23
|
+
readonly [K in keyof TApi]: __TrellisGeneratedOptionalOperationIO<TApi[K]>;
|
|
24
|
+
};
|
|
25
|
+
|
|
7
26
|
export type UsedApi = {
|
|
8
27
|
rpc: {};
|
|
9
28
|
operations: {};
|
|
@@ -26,7 +45,9 @@ export const USED_API: UsedApi = {
|
|
|
26
45
|
subjects: {},
|
|
27
46
|
};
|
|
28
47
|
|
|
29
|
-
export type OwnedApi = typeof OWNED_API
|
|
48
|
+
export type OwnedApi = Omit<typeof OWNED_API, "operations"> & {
|
|
49
|
+
operations: __TrellisGeneratedOperationApi<typeof OWNED_API["operations"]>;
|
|
50
|
+
};
|
|
30
51
|
export type Api = {
|
|
31
52
|
rpc: OwnedApi["rpc"] & UsedApi["rpc"];
|
|
32
53
|
operations: OwnedApi["operations"] & UsedApi["operations"];
|
|
@@ -35,9 +56,12 @@ export type Api = {
|
|
|
35
56
|
subjects: OwnedApi["subjects"] & UsedApi["subjects"];
|
|
36
57
|
};
|
|
37
58
|
|
|
38
|
-
export
|
|
59
|
+
export type ApiViews = {
|
|
60
|
+
owned: OwnedApi;
|
|
61
|
+
used: UsedApi;
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const API: ApiViews = {
|
|
39
65
|
owned: OWNED_API,
|
|
40
66
|
used: USED_API,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export type ApiViews = typeof API;
|
|
67
|
+
};
|
|
@@ -15,13 +15,11 @@ import type {
|
|
|
15
15
|
OperationRef,
|
|
16
16
|
OperationRefData,
|
|
17
17
|
OperationRuntimeHandle,
|
|
18
|
-
OperationTransferHandle,
|
|
19
18
|
PreparedTrellisEvent,
|
|
20
19
|
ReceiveTransferGrant,
|
|
21
20
|
ReceiveTransferHandle,
|
|
22
21
|
RequestOpts,
|
|
23
22
|
Result,
|
|
24
|
-
RpcHandlerContext,
|
|
25
23
|
SendTransferGrant,
|
|
26
24
|
SendTransferHandle,
|
|
27
25
|
TerminalOperation,
|
|
@@ -35,8 +33,6 @@ import type { API, Api } from "./api.js";
|
|
|
35
33
|
import type * as Types from "./types.js";
|
|
36
34
|
import type * as HealthSdk from "../health/mod.js";
|
|
37
35
|
|
|
38
|
-
type WithDeps<TDeps> = [TDeps] extends [undefined] ? {} : { deps: TDeps };
|
|
39
|
-
|
|
40
36
|
type EventCallback<TMessage> = {
|
|
41
37
|
bivarianceHack(
|
|
42
38
|
message: TMessage,
|
|
@@ -44,46 +40,10 @@ type EventCallback<TMessage> = {
|
|
|
44
40
|
): MaybeAsync<void, BaseError>;
|
|
45
41
|
}["bivarianceHack"];
|
|
46
42
|
|
|
47
|
-
type
|
|
48
|
-
args:
|
|
49
|
-
& { event: TEvent; context: EventListenerContext; client: HandlerClient }
|
|
50
|
-
& WithDeps<TDeps>,
|
|
43
|
+
type DependencyServiceEventHandler<TEvent> = (
|
|
44
|
+
args: { event: TEvent; context: EventListenerContext; client: HandlerClient },
|
|
51
45
|
) => MaybeAsync<void, BaseError>;
|
|
52
46
|
|
|
53
|
-
type RpcHandler<TInput, TOutput, TDeps = undefined> = (
|
|
54
|
-
args:
|
|
55
|
-
& { input: TInput; context: RpcHandlerContext; client: HandlerClient }
|
|
56
|
-
& WithDeps<TDeps>,
|
|
57
|
-
) => MaybeAsync<TOutput, BaseError>;
|
|
58
|
-
|
|
59
|
-
type FeedHandler<TInput, TEvent, TDeps = undefined> = (
|
|
60
|
-
context: {
|
|
61
|
-
input: TInput;
|
|
62
|
-
caller: unknown;
|
|
63
|
-
signal: AbortSignal;
|
|
64
|
-
emit(event: TEvent): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
65
|
-
client: HandlerClient;
|
|
66
|
-
} & WithDeps<TDeps>,
|
|
67
|
-
) => unknown | Promise<unknown>;
|
|
68
|
-
|
|
69
|
-
type OperationHandler<
|
|
70
|
-
TInput,
|
|
71
|
-
TProgress,
|
|
72
|
-
TOutput,
|
|
73
|
-
TTransfer,
|
|
74
|
-
TDeps = undefined,
|
|
75
|
-
> = (
|
|
76
|
-
context:
|
|
77
|
-
& {
|
|
78
|
-
input: TInput;
|
|
79
|
-
op: OperationRuntimeHandle<TProgress, TOutput>;
|
|
80
|
-
caller: unknown;
|
|
81
|
-
client: HandlerClient;
|
|
82
|
-
}
|
|
83
|
-
& TTransfer
|
|
84
|
-
& WithDeps<TDeps>,
|
|
85
|
-
) => unknown | Promise<unknown>;
|
|
86
|
-
|
|
87
47
|
export type TrellisStateState = {};
|
|
88
48
|
|
|
89
49
|
export interface TrellisStateClient {
|
|
@@ -131,12 +91,12 @@ export interface TrellisStateClient {
|
|
|
131
91
|
readonly health: {
|
|
132
92
|
heartbeat: {
|
|
133
93
|
publish(
|
|
134
|
-
event:
|
|
94
|
+
event: HealthSdk.HealthHeartbeatEvent,
|
|
135
95
|
): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
136
96
|
prepare(
|
|
137
|
-
event:
|
|
97
|
+
event: HealthSdk.HealthHeartbeatEvent,
|
|
138
98
|
): Result<
|
|
139
|
-
PreparedTrellisEvent<
|
|
99
|
+
PreparedTrellisEvent<HealthSdk.HealthHeartbeatEvent>,
|
|
140
100
|
ValidationError | UnexpectedError
|
|
141
101
|
>;
|
|
142
102
|
listen(
|
|
@@ -154,29 +114,22 @@ export interface TrellisStateClient {
|
|
|
154
114
|
|
|
155
115
|
export interface Service extends TrellisStateClient {
|
|
156
116
|
readonly handle: ServiceHandle;
|
|
157
|
-
with<TDeps>(deps: TDeps): ServiceWithDeps<TDeps>;
|
|
158
117
|
}
|
|
159
118
|
|
|
160
|
-
export
|
|
161
|
-
readonly event: ServiceEventSurface<TDeps>;
|
|
162
|
-
readonly handle: ServiceHandle<TDeps>;
|
|
163
|
-
with<TNextDeps>(deps: TNextDeps): ServiceWithDeps<TNextDeps>;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export interface ServiceEventSurface<TDeps> {
|
|
119
|
+
export interface ServiceEventSurface {
|
|
167
120
|
readonly health: {
|
|
168
121
|
heartbeat: {
|
|
169
122
|
publish(
|
|
170
|
-
event:
|
|
123
|
+
event: HealthSdk.HealthHeartbeatEvent,
|
|
171
124
|
): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
172
125
|
prepare(
|
|
173
|
-
event:
|
|
126
|
+
event: HealthSdk.HealthHeartbeatEvent,
|
|
174
127
|
): Result<
|
|
175
|
-
PreparedTrellisEvent<
|
|
128
|
+
PreparedTrellisEvent<HealthSdk.HealthHeartbeatEvent>,
|
|
176
129
|
ValidationError | UnexpectedError
|
|
177
130
|
>;
|
|
178
131
|
listen(
|
|
179
|
-
handler:
|
|
132
|
+
handler: DependencyServiceEventHandler<HealthSdk.HealthHeartbeatEvent>,
|
|
180
133
|
subjectData?: Record<string, unknown>,
|
|
181
134
|
opts?: EventOpts,
|
|
182
135
|
): AsyncResult<void, ValidationError | UnexpectedError>;
|
|
@@ -184,46 +137,16 @@ export interface ServiceEventSurface<TDeps> {
|
|
|
184
137
|
};
|
|
185
138
|
}
|
|
186
139
|
|
|
187
|
-
export interface ServiceHandle
|
|
140
|
+
export interface ServiceHandle {
|
|
188
141
|
readonly rpc: {
|
|
189
142
|
readonly state: {
|
|
190
|
-
adminDelete(
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
): Promise<void>;
|
|
197
|
-
adminGet(
|
|
198
|
-
handler: RpcHandler<
|
|
199
|
-
Types.StateAdminGetInput,
|
|
200
|
-
Types.StateAdminGetOutput,
|
|
201
|
-
TDeps
|
|
202
|
-
>,
|
|
203
|
-
): Promise<void>;
|
|
204
|
-
adminList(
|
|
205
|
-
handler: RpcHandler<
|
|
206
|
-
Types.StateAdminListInput,
|
|
207
|
-
Types.StateAdminListOutput,
|
|
208
|
-
TDeps
|
|
209
|
-
>,
|
|
210
|
-
): Promise<void>;
|
|
211
|
-
delete(
|
|
212
|
-
handler: RpcHandler<
|
|
213
|
-
Types.StateDeleteInput,
|
|
214
|
-
Types.StateDeleteOutput,
|
|
215
|
-
TDeps
|
|
216
|
-
>,
|
|
217
|
-
): Promise<void>;
|
|
218
|
-
get(
|
|
219
|
-
handler: RpcHandler<Types.StateGetInput, Types.StateGetOutput, TDeps>,
|
|
220
|
-
): Promise<void>;
|
|
221
|
-
list(
|
|
222
|
-
handler: RpcHandler<Types.StateListInput, Types.StateListOutput, TDeps>,
|
|
223
|
-
): Promise<void>;
|
|
224
|
-
put(
|
|
225
|
-
handler: RpcHandler<Types.StatePutInput, Types.StatePutOutput, TDeps>,
|
|
226
|
-
): Promise<void>;
|
|
143
|
+
adminDelete(handler: Types.StateAdminDeleteHandler): Promise<void>;
|
|
144
|
+
adminGet(handler: Types.StateAdminGetHandler): Promise<void>;
|
|
145
|
+
adminList(handler: Types.StateAdminListHandler): Promise<void>;
|
|
146
|
+
delete(handler: Types.StateDeleteHandler): Promise<void>;
|
|
147
|
+
get(handler: Types.StateGetHandler): Promise<void>;
|
|
148
|
+
list(handler: Types.StateListHandler): Promise<void>;
|
|
149
|
+
put(handler: Types.StatePutHandler): Promise<void>;
|
|
227
150
|
};
|
|
228
151
|
};
|
|
229
152
|
readonly feed: {};
|
|
@@ -27,7 +27,7 @@ export const OWNED_API = {
|
|
|
27
27
|
output: schema<Types.StateAdminDeleteOutput>(
|
|
28
28
|
StateAdminDeleteResponseSchema,
|
|
29
29
|
),
|
|
30
|
-
callerCapabilities: ["admin"],
|
|
30
|
+
callerCapabilities: ["admin"] as const,
|
|
31
31
|
errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
|
|
32
32
|
declaredErrorTypes: [
|
|
33
33
|
"AuthError",
|
|
@@ -39,7 +39,7 @@ export const OWNED_API = {
|
|
|
39
39
|
subject: "rpc.v1.State.Admin.Get",
|
|
40
40
|
input: schema<Types.StateAdminGetInput>(StateAdminGetRequestSchema),
|
|
41
41
|
output: schema<Types.StateAdminGetOutput>(StateAdminGetResponseSchema),
|
|
42
|
-
callerCapabilities: ["admin"],
|
|
42
|
+
callerCapabilities: ["admin"] as const,
|
|
43
43
|
errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
|
|
44
44
|
declaredErrorTypes: [
|
|
45
45
|
"AuthError",
|
|
@@ -51,7 +51,7 @@ export const OWNED_API = {
|
|
|
51
51
|
subject: "rpc.v1.State.Admin.List",
|
|
52
52
|
input: schema<Types.StateAdminListInput>(StateAdminListRequestSchema),
|
|
53
53
|
output: schema<Types.StateAdminListOutput>(StateAdminListResponseSchema),
|
|
54
|
-
callerCapabilities: ["admin"],
|
|
54
|
+
callerCapabilities: ["admin"] as const,
|
|
55
55
|
errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
|
|
56
56
|
declaredErrorTypes: [
|
|
57
57
|
"AuthError",
|
|
@@ -63,7 +63,7 @@ export const OWNED_API = {
|
|
|
63
63
|
subject: "rpc.v1.State.Delete",
|
|
64
64
|
input: schema<Types.StateDeleteInput>(StateDeleteRequestSchema),
|
|
65
65
|
output: schema<Types.StateDeleteOutput>(StateDeleteResponseSchema),
|
|
66
|
-
callerCapabilities: [],
|
|
66
|
+
callerCapabilities: [] as const,
|
|
67
67
|
errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
|
|
68
68
|
declaredErrorTypes: [
|
|
69
69
|
"AuthError",
|
|
@@ -75,7 +75,7 @@ export const OWNED_API = {
|
|
|
75
75
|
subject: "rpc.v1.State.Get",
|
|
76
76
|
input: schema<Types.StateGetInput>(StateGetRequestSchema),
|
|
77
77
|
output: schema<Types.StateGetOutput>(StateGetResponseSchema),
|
|
78
|
-
callerCapabilities: [],
|
|
78
|
+
callerCapabilities: [] as const,
|
|
79
79
|
errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
|
|
80
80
|
declaredErrorTypes: [
|
|
81
81
|
"AuthError",
|
|
@@ -87,7 +87,7 @@ export const OWNED_API = {
|
|
|
87
87
|
subject: "rpc.v1.State.List",
|
|
88
88
|
input: schema<Types.StateListInput>(StateListRequestSchema),
|
|
89
89
|
output: schema<Types.StateListOutput>(StateListResponseSchema),
|
|
90
|
-
callerCapabilities: [],
|
|
90
|
+
callerCapabilities: [] as const,
|
|
91
91
|
errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
|
|
92
92
|
declaredErrorTypes: [
|
|
93
93
|
"AuthError",
|
|
@@ -99,7 +99,7 @@ export const OWNED_API = {
|
|
|
99
99
|
subject: "rpc.v1.State.Put",
|
|
100
100
|
input: schema<Types.StatePutInput>(StatePutRequestSchema),
|
|
101
101
|
output: schema<Types.StatePutOutput>(StatePutResponseSchema),
|
|
102
|
-
callerCapabilities: [],
|
|
102
|
+
callerCapabilities: [] as const,
|
|
103
103
|
errors: ["AuthError", "UnexpectedError", "ValidationError"] as const,
|
|
104
104
|
declaredErrorTypes: [
|
|
105
105
|
"AuthError",
|