@qlever-llc/trellis 0.10.8 → 0.10.10
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/contract_support/mod.d.ts +1 -1
- package/esm/contract_support/mod.d.ts.map +1 -1
- package/esm/contract_support/mod.js +1 -1
- package/esm/contract_support/protocol.d.ts +67 -0
- package/esm/contract_support/protocol.d.ts.map +1 -1
- package/esm/contract_support/protocol.js +90 -0
- package/esm/generated-sdk/auth/api.d.ts.map +1 -1
- package/esm/generated-sdk/auth/client.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.d.ts.map +1 -1
- package/esm/generated-sdk/auth/contract.js +9590 -7
- package/esm/generated-sdk/auth/mod.d.ts +3 -3
- package/esm/generated-sdk/auth/mod.d.ts.map +1 -1
- package/esm/generated-sdk/auth/mod.js +1 -1
- package/esm/generated-sdk/auth/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/auth/owned_api.js +305 -62
- package/esm/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/auth/schemas.js +6492 -139
- package/esm/generated-sdk/auth/types.d.ts +254 -254
- package/esm/generated-sdk/auth/types.d.ts.map +1 -1
- package/esm/generated-sdk/health/api.d.ts.map +1 -1
- package/esm/generated-sdk/health/client.d.ts.map +1 -1
- package/esm/generated-sdk/health/contract.d.ts.map +1 -1
- package/esm/generated-sdk/health/contract.js +117 -7
- package/esm/generated-sdk/health/mod.d.ts +2 -2
- package/esm/generated-sdk/health/mod.d.ts.map +1 -1
- package/esm/generated-sdk/health/mod.js +1 -1
- package/esm/generated-sdk/health/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/health/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/health/schemas.js +79 -1
- package/esm/generated-sdk/health/types.d.ts +4 -4
- package/esm/generated-sdk/health/types.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/api.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/api.js +12 -4
- package/esm/generated-sdk/jobs/client.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/contract.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/contract.js +1080 -7
- package/esm/generated-sdk/jobs/mod.d.ts +2 -2
- package/esm/generated-sdk/jobs/mod.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/mod.js +1 -1
- package/esm/generated-sdk/jobs/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/owned_api.js +26 -6
- package/esm/generated-sdk/jobs/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/jobs/schemas.js +768 -18
- package/esm/generated-sdk/jobs/types.d.ts +14 -14
- package/esm/generated-sdk/jobs/types.d.ts.map +1 -1
- package/esm/generated-sdk/state/api.d.ts.map +1 -1
- package/esm/generated-sdk/state/api.js +3 -1
- package/esm/generated-sdk/state/client.d.ts.map +1 -1
- package/esm/generated-sdk/state/contract.d.ts.map +1 -1
- package/esm/generated-sdk/state/contract.js +638 -7
- package/esm/generated-sdk/state/mod.d.ts +2 -2
- package/esm/generated-sdk/state/mod.d.ts.map +1 -1
- package/esm/generated-sdk/state/mod.js +1 -1
- package/esm/generated-sdk/state/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/state/owned_api.js +36 -8
- package/esm/generated-sdk/state/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/state/schemas.js +441 -14
- package/esm/generated-sdk/state/types.d.ts +15 -15
- package/esm/generated-sdk/state/types.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/api.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/contract.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/contract.js +744 -7
- package/esm/generated-sdk/trellis-core/mod.d.ts +2 -2
- package/esm/generated-sdk/trellis-core/mod.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/mod.js +1 -1
- package/esm/generated-sdk/trellis-core/owned_api.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/owned_api.js +1 -1
- package/esm/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
- package/esm/generated-sdk/trellis-core/schemas.js +626 -8
- package/esm/generated-sdk/trellis-core/types.d.ts +14 -14
- package/esm/generated-sdk/trellis-core/types.d.ts.map +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/server/service.d.ts +40 -9
- package/esm/server/service.d.ts.map +1 -1
- package/esm/server/service.js +28 -4
- package/esm/service/deno.d.ts +1 -1
- package/esm/service/deno.d.ts.map +1 -1
- package/esm/service/mod.d.ts +1 -1
- package/esm/service/mod.d.ts.map +1 -1
- package/esm/service/node.d.ts +1 -1
- package/esm/service/node.d.ts.map +1 -1
- package/package.json +2 -2
- package/script/contract_support/mod.d.ts +1 -1
- package/script/contract_support/mod.d.ts.map +1 -1
- package/script/contract_support/mod.js +8 -1
- package/script/contract_support/protocol.d.ts +67 -0
- package/script/contract_support/protocol.d.ts.map +1 -1
- package/script/contract_support/protocol.js +96 -1
- package/script/generated-sdk/auth/api.d.ts.map +1 -1
- package/script/generated-sdk/auth/client.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.d.ts.map +1 -1
- package/script/generated-sdk/auth/contract.js +9590 -7
- package/script/generated-sdk/auth/mod.d.ts +3 -3
- package/script/generated-sdk/auth/mod.d.ts.map +1 -1
- package/script/generated-sdk/auth/mod.js +2 -2
- package/script/generated-sdk/auth/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/auth/owned_api.js +304 -61
- package/script/generated-sdk/auth/schemas.d.ts.map +1 -1
- package/script/generated-sdk/auth/schemas.js +6492 -139
- package/script/generated-sdk/auth/types.d.ts +254 -254
- package/script/generated-sdk/auth/types.d.ts.map +1 -1
- package/script/generated-sdk/health/api.d.ts.map +1 -1
- package/script/generated-sdk/health/client.d.ts.map +1 -1
- package/script/generated-sdk/health/contract.d.ts.map +1 -1
- package/script/generated-sdk/health/contract.js +117 -7
- package/script/generated-sdk/health/mod.d.ts +2 -2
- package/script/generated-sdk/health/mod.d.ts.map +1 -1
- package/script/generated-sdk/health/mod.js +2 -2
- package/script/generated-sdk/health/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/health/schemas.d.ts.map +1 -1
- package/script/generated-sdk/health/schemas.js +79 -1
- package/script/generated-sdk/health/types.d.ts +4 -4
- package/script/generated-sdk/health/types.d.ts.map +1 -1
- package/script/generated-sdk/jobs/api.d.ts.map +1 -1
- package/script/generated-sdk/jobs/api.js +12 -4
- package/script/generated-sdk/jobs/client.d.ts.map +1 -1
- package/script/generated-sdk/jobs/contract.d.ts.map +1 -1
- package/script/generated-sdk/jobs/contract.js +1080 -7
- package/script/generated-sdk/jobs/mod.d.ts +2 -2
- package/script/generated-sdk/jobs/mod.d.ts.map +1 -1
- package/script/generated-sdk/jobs/mod.js +2 -2
- package/script/generated-sdk/jobs/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/jobs/owned_api.js +25 -5
- package/script/generated-sdk/jobs/schemas.d.ts.map +1 -1
- package/script/generated-sdk/jobs/schemas.js +768 -18
- package/script/generated-sdk/jobs/types.d.ts +14 -14
- package/script/generated-sdk/jobs/types.d.ts.map +1 -1
- package/script/generated-sdk/state/api.d.ts.map +1 -1
- package/script/generated-sdk/state/api.js +3 -1
- package/script/generated-sdk/state/client.d.ts.map +1 -1
- package/script/generated-sdk/state/contract.d.ts.map +1 -1
- package/script/generated-sdk/state/contract.js +638 -7
- package/script/generated-sdk/state/mod.d.ts +2 -2
- package/script/generated-sdk/state/mod.d.ts.map +1 -1
- package/script/generated-sdk/state/mod.js +2 -2
- package/script/generated-sdk/state/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/state/owned_api.js +35 -7
- package/script/generated-sdk/state/schemas.d.ts.map +1 -1
- package/script/generated-sdk/state/schemas.js +441 -14
- package/script/generated-sdk/state/types.d.ts +15 -15
- package/script/generated-sdk/state/types.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/api.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/client.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/contract.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/contract.js +744 -7
- package/script/generated-sdk/trellis-core/mod.d.ts +2 -2
- package/script/generated-sdk/trellis-core/mod.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/mod.js +2 -2
- package/script/generated-sdk/trellis-core/owned_api.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/schemas.d.ts.map +1 -1
- package/script/generated-sdk/trellis-core/schemas.js +626 -8
- package/script/generated-sdk/trellis-core/types.d.ts +14 -14
- package/script/generated-sdk/trellis-core/types.d.ts.map +1 -1
- package/script/index.d.ts +2 -2
- package/script/index.d.ts.map +1 -1
- package/script/index.js +9 -2
- package/script/server/service.d.ts +40 -9
- package/script/server/service.d.ts.map +1 -1
- package/script/server/service.js +27 -3
- package/script/service/deno.d.ts +1 -1
- package/script/service/deno.d.ts.map +1 -1
- package/script/service/mod.d.ts +1 -1
- package/script/service/mod.d.ts.map +1 -1
- package/script/service/node.d.ts +1 -1
- package/script/service/node.d.ts.map +1 -1
- package/src/contract_support/mod.ts +12 -0
- package/src/contract_support/protocol.ts +137 -0
- package/src/index.ts +12 -0
- package/src/sdk/_generated/auth/api.ts +10 -21
- package/src/sdk/_generated/auth/client.ts +1178 -160
- package/src/sdk/_generated/auth/contract.ts +9637 -13
- package/src/sdk/_generated/auth/mod.ts +22 -3
- package/src/sdk/_generated/auth/owned_api.ts +897 -264
- package/src/sdk/_generated/auth/schemas.ts +6630 -278
- package/src/sdk/_generated/auth/types.ts +2950 -359
- package/src/sdk/_generated/core/api.ts +10 -21
- package/src/sdk/_generated/core/client.ts +105 -12
- package/src/sdk/_generated/core/contract.ts +774 -13
- package/src/sdk/_generated/core/mod.ts +17 -2
- package/src/sdk/_generated/core/owned_api.ts +40 -24
- package/src/sdk/_generated/core/schemas.ts +626 -9
- package/src/sdk/_generated/core/types.ts +233 -18
- package/src/sdk/_generated/health/api.ts +10 -21
- package/src/sdk/_generated/health/client.ts +104 -8
- package/src/sdk/_generated/health/contract.ts +144 -13
- package/src/sdk/_generated/health/mod.ts +17 -2
- package/src/sdk/_generated/health/owned_api.ts +4 -9
- package/src/sdk/_generated/health/schemas.ts +79 -2
- package/src/sdk/_generated/health/types.ts +31 -4
- package/src/sdk/_generated/jobs/api.ts +20 -18
- package/src/sdk/_generated/jobs/client.ts +199 -28
- package/src/sdk/_generated/jobs/contract.ts +1119 -13
- package/src/sdk/_generated/jobs/mod.ts +17 -2
- package/src/sdk/_generated/jobs/owned_api.ts +64 -27
- package/src/sdk/_generated/jobs/schemas.ts +776 -20
- package/src/sdk/_generated/jobs/types.ts +407 -34
- package/src/sdk/_generated/state/api.ts +11 -18
- package/src/sdk/_generated/state/client.ts +169 -22
- package/src/sdk/_generated/state/contract.ts +670 -13
- package/src/sdk/_generated/state/mod.ts +17 -2
- package/src/sdk/_generated/state/owned_api.ts +65 -25
- package/src/sdk/_generated/state/schemas.ts +441 -15
- package/src/sdk/_generated/state/types.ts +229 -26
- package/src/server/service.ts +133 -7
- package/src/service/deno.ts +4 -0
- package/src/service/mod.ts +4 -0
- package/src/service/node.ts +4 -0
|
@@ -1,12 +1,755 @@
|
|
|
1
1
|
// Generated from ./generated/contracts/manifests/trellis.core@v1.json
|
|
2
|
-
import type {
|
|
2
|
+
import type {
|
|
3
|
+
ContractDependencyUse,
|
|
4
|
+
SdkContractModule,
|
|
5
|
+
TrellisContractV1,
|
|
6
|
+
UseSpec,
|
|
7
|
+
} from "../../../index.js";
|
|
3
8
|
import { API } from "./api.js";
|
|
4
9
|
|
|
5
|
-
const CONTRACT_MODULE_METADATA = Symbol.for(
|
|
10
|
+
const CONTRACT_MODULE_METADATA = Symbol.for(
|
|
11
|
+
"@qlever-llc/trellis/contracts/contract-module",
|
|
12
|
+
);
|
|
6
13
|
|
|
7
14
|
export const CONTRACT_ID = "trellis.core@v1" as const;
|
|
8
|
-
export const CONTRACT_DIGEST =
|
|
9
|
-
export const CONTRACT = {"capabilities":{"trellis.core::catalog.read":{"description":"List the installed Trellis contract catalog.","displayName":"Read contract catalog"},"trellis.core::contract.read":{"description":"Read installed contract manifests and metadata.","displayName":"Read installed contracts"}},"description":"Trellis runtime RPCs available to all connected participants.","displayName":"Trellis Core","docs":{"markdown":"Exposes the Trellis catalog, contract details, runtime bindings, and surface availability checks used by platform participants.","summary":"Runtime catalog and binding APIs."},"format":"trellis.contract.v1","id":"trellis.core@v1","kind":"service","rpc":{"Trellis.Bindings.Get":{"capabilities":{"call":["service"]},"docs":{"markdown":"Returns runtime resource bindings for the caller's active service contract.","summary":"Read service resource bindings."},"errors":[{"type":"UnexpectedError"},{"type":"ValidationError"}],"input":{"schema":"TrellisBindingsGetRequest"},"internal":true,"output":{"schema":"TrellisBindingsGetResponse"},"subject":"rpc.v1.Trellis.Bindings.Get","version":"v1"},"Trellis.Catalog":{"capabilities":{"call":["trellis.core::catalog.read"]},"docs":{"markdown":"Returns the active contract catalog entries available in the deployment.","summary":"List visible contracts."},"errors":[{"type":"UnexpectedError"},{"type":"ValidationError"}],"input":{"schema":"TrellisCatalogRequest"},"output":{"schema":"TrellisCatalogResponse"},"subject":"rpc.v1.Trellis.Catalog","version":"v1"},"Trellis.Contract.Get":{"capabilities":{"call":["trellis.core::contract.read"]},"docs":{"markdown":"Returns the normalized contract manifest for a known contract digest.","summary":"Read one contract manifest."},"errors":[{"type":"UnexpectedError"},{"type":"ValidationError"}],"input":{"schema":"TrellisContractGetRequest"},"output":{"schema":"TrellisContractGetResponse"},"subject":"rpc.v1.Trellis.Contract.Get","version":"v1"},"Trellis.Surface.Status":{"capabilities":{"call":["trellis.core::catalog.read"]},"docs":{"markdown":"Reports capability and deployment authority status for a contract-owned surface.","summary":"Inspect surface availability."},"errors":[{"type":"UnexpectedError"},{"type":"ValidationError"}],"input":{"schema":"TrellisSurfaceStatusRequest"},"output":{"schema":"TrellisSurfaceStatusResponse"},"subject":"rpc.v1.Trellis.Surface.Status","version":"v1"}},"schemas":{"TrellisBindingsGetRequest":{"properties":{"contractId":{"minLength":1,"type":"string"},"digest":{"pattern":"^[A-Za-z0-9_-]+$","type":"string"}},"type":"object"},"TrellisBindingsGetResponse":{"properties":{"binding":{"properties":{"contractId":{"minLength":1,"type":"string"},"digest":{"pattern":"^[A-Za-z0-9_-]+$","type":"string"},"resources":{"properties":{"eventConsumers":{"patternProperties":{"^.*$":{"properties":{"ackWaitMs":{"minimum":1,"type":"integer"},"backoffMs":{"items":{"minimum":0,"type":"integer"},"type":"array"},"concurrency":{"minimum":1,"type":"integer"},"consumerName":{"minLength":1,"type":"string"},"filterSubjects":{"items":{"minLength":1,"type":"string"},"type":"array"},"maxDeliver":{"minimum":1,"type":"integer"},"ordering":{"const":"strict","type":"string"},"replay":{"anyOf":[{"const":"new","type":"string"},{"const":"all","type":"string"}]},"stream":{"minLength":1,"type":"string"}},"required":["stream","consumerName","filterSubjects","replay","ordering","concurrency","ackWaitMs","maxDeliver","backoffMs"],"type":"object"}},"type":"object"},"jobs":{"properties":{"namespace":{"minLength":1,"type":"string"},"queues":{"patternProperties":{"^.*$":{"properties":{"ackWaitMs":{"minimum":1,"type":"integer"},"backoffMs":{"items":{"minimum":0,"type":"integer"},"type":"array"},"concurrency":{"minimum":1,"type":"integer"},"consumerName":{"minLength":1,"type":"string"},"defaultDeadlineMs":{"minimum":1,"type":"integer"},"dlq":{"type":"boolean"},"logs":{"type":"boolean"},"maxDeliver":{"minimum":1,"type":"integer"},"payload":{"properties":{"schema":{"minLength":1,"type":"string"}},"required":["schema"],"type":"object"},"progress":{"type":"boolean"},"publishPrefix":{"minLength":1,"type":"string"},"queueType":{"minLength":1,"type":"string"},"result":{"properties":{"schema":{"minLength":1,"type":"string"}},"required":["schema"],"type":"object"},"workSubject":{"minLength":1,"type":"string"}},"required":["queueType","publishPrefix","workSubject","consumerName","payload","maxDeliver","backoffMs","ackWaitMs","progress","logs","dlq","concurrency"],"type":"object"}},"type":"object"},"workStream":{"minLength":1,"type":"string"}},"required":["namespace","queues"],"type":"object"},"kv":{"patternProperties":{"^.*$":{"properties":{"bucket":{"minLength":1,"type":"string"},"history":{"minimum":1,"type":"integer"},"maxValueBytes":{"minimum":1,"type":"integer"},"ttlMs":{"minimum":0,"type":"integer"}},"required":["bucket","history","ttlMs"],"type":"object"}},"type":"object"},"store":{"patternProperties":{"^.*$":{"properties":{"maxObjectBytes":{"minimum":1,"type":"integer"},"maxTotalBytes":{"minimum":1,"type":"integer"},"name":{"minLength":1,"type":"string"},"ttlMs":{"minimum":0,"type":"integer"}},"required":["name","ttlMs"],"type":"object"}},"type":"object"}},"type":"object"}},"required":["contractId","digest","resources"],"type":"object"},"eventConsumers":{"patternProperties":{"^.*$":{"properties":{"ackWaitMs":{"minimum":1,"type":"integer"},"backoffMs":{"items":{"minimum":0,"type":"integer"},"type":"array"},"concurrency":{"minimum":1,"type":"integer"},"consumerName":{"minLength":1,"type":"string"},"filterSubjects":{"items":{"minLength":1,"type":"string"},"type":"array"},"maxDeliver":{"minimum":1,"type":"integer"},"ordering":{"const":"strict","type":"string"},"replay":{"anyOf":[{"const":"new","type":"string"},{"const":"all","type":"string"}]},"stream":{"minLength":1,"type":"string"}},"required":["stream","consumerName","filterSubjects","replay","ordering","concurrency","ackWaitMs","maxDeliver","backoffMs"],"type":"object"}},"type":"object"}},"type":"object"},"TrellisCatalogRequest":{"properties":{},"type":"object"},"TrellisCatalogResponse":{"properties":{"catalog":{"properties":{"contracts":{"items":{"properties":{"description":{"minLength":1,"type":"string"},"digest":{"type":"string"},"displayName":{"minLength":1,"type":"string"},"id":{"type":"string"}},"required":["id","digest","displayName","description"],"type":"object"},"type":"array"},"format":{"const":"trellis.catalog.v1","type":"string"},"issues":{"items":{"properties":{"actions":{"items":{"properties":{"action":{"anyOf":[{"const":"keep-current","type":"string"},{"const":"force-replace","type":"string"}]},"deploymentIds":{"items":{"type":"string"},"type":"array"},"description":{"minLength":1,"type":"string"},"digests":{"items":{"type":"string"},"type":"array"},"label":{"minLength":1,"type":"string"},"risk":{"anyOf":[{"const":"recommended","type":"string"},{"const":"dangerous","type":"string"}]}},"required":["action","label","description","risk","deploymentIds","digests"],"type":"object"},"type":"array"},"conflictingDeploymentIds":{"items":{"type":"string"},"type":"array"},"conflictingDigest":{"type":"string"},"conflictingDigests":{"items":{"type":"string"},"type":"array"},"contractId":{"type":"string"},"deploymentIds":{"items":{"type":"string"},"type":"array"},"digest":{"type":"string"},"effectiveDeploymentIds":{"items":{"type":"string"},"type":"array"},"effectiveDigests":{"items":{"type":"string"},"type":"array"},"issueId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"missing-active-contract","type":"string"},{"const":"invalid-active-contract","type":"string"},{"const":"incompatible-active-contract","type":"string"},{"const":"invalid-active-contract-uses","type":"string"}]},"message":{"minLength":1,"type":"string"}},"required":["issueId","kind","message","deploymentIds","actions"],"type":"object"},"type":"array"}},"required":["format","contracts"],"type":"object"}},"required":["catalog"],"type":"object"},"TrellisContractGetRequest":{"properties":{"digest":{"pattern":"^[A-Za-z0-9_-]+$","type":"string"}},"required":["digest"],"type":"object"},"TrellisContractGetResponse":{"properties":{"contract":{"properties":{"description":{"minLength":1,"type":"string"},"displayName":{"minLength":1,"type":"string"},"docs":{"properties":{"markdown":{"type":"string"},"summary":{"type":"string"}},"required":["markdown"],"type":"object"},"errors":{"patternProperties":{"^.*$":{"type":"object"}},"type":"object"},"events":{"patternProperties":{"^.*$":{"type":"object"}},"type":"object"},"exports":{"properties":{"schemas":{"items":{"minLength":1,"type":"string"},"type":"array"}},"type":"object"},"format":{"const":"trellis.contract.v1","type":"string"},"id":{"minLength":1,"type":"string"},"jobs":{"patternProperties":{"^.*$":{"properties":{"ackWaitMs":{"minimum":1,"type":"integer"},"backoffMs":{"items":{"minimum":0,"type":"integer"},"type":"array"},"concurrency":{"minimum":1,"type":"integer"},"defaultDeadlineMs":{"minimum":1,"type":"integer"},"dlq":{"type":"boolean"},"docs":{"properties":{"markdown":{"type":"string"},"summary":{"type":"string"}},"required":["markdown"],"type":"object"},"logs":{"type":"boolean"},"maxDeliver":{"minimum":1,"type":"integer"},"payload":{"properties":{"schema":{"minLength":1,"type":"string"}},"required":["schema"],"type":"object"},"progress":{"type":"boolean"},"result":{"properties":{"schema":{"minLength":1,"type":"string"}},"required":["schema"],"type":"object"}},"required":["payload"],"type":"object"}},"type":"object"},"kind":{"anyOf":[{"const":"service","type":"string"},{"const":"app","type":"string"},{"const":"device","type":"string"},{"const":"agent","type":"string"}]},"operations":{"patternProperties":{"^.*$":{"type":"object"}},"type":"object"},"resources":{"additionalProperties":false,"properties":{"kv":{"patternProperties":{"^.*$":{"properties":{"docs":{"properties":{"markdown":{"type":"string"},"summary":{"type":"string"}},"required":["markdown"],"type":"object"},"history":{"default":1,"minimum":1,"type":"integer"},"maxValueBytes":{"minimum":1,"type":"integer"},"purpose":{"minLength":1,"type":"string"},"required":{"default":true,"type":"boolean"},"schema":{"properties":{"schema":{"minLength":1,"type":"string"}},"required":["schema"],"type":"object"},"ttlMs":{"default":0,"minimum":0,"type":"integer"}},"required":["purpose","schema"],"type":"object"}},"type":"object"},"store":{"patternProperties":{"^.*$":{"properties":{"docs":{"properties":{"markdown":{"type":"string"},"summary":{"type":"string"}},"required":["markdown"],"type":"object"},"maxObjectBytes":{"minimum":1,"type":"integer"},"maxTotalBytes":{"minimum":1,"type":"integer"},"purpose":{"minLength":1,"type":"string"},"required":{"default":true,"type":"boolean"},"ttlMs":{"default":0,"minimum":0,"type":"integer"}},"required":["purpose"],"type":"object"}},"type":"object"}},"type":"object"},"rpc":{"patternProperties":{"^.*$":{"type":"object"}},"type":"object"},"schemas":{"patternProperties":{"^.*$":{"anyOf":[{"type":"object"},{"type":"boolean"}]}},"type":"object"},"state":{"patternProperties":{"^.*$":{"properties":{"acceptedVersions":{"patternProperties":{"^.*$":{"properties":{"schema":{"minLength":1,"type":"string"}},"required":["schema"],"type":"object"}},"type":"object"},"docs":{"properties":{"markdown":{"type":"string"},"summary":{"type":"string"}},"required":["markdown"],"type":"object"},"kind":{"anyOf":[{"const":"value","type":"string"},{"const":"map","type":"string"}]},"schema":{"properties":{"schema":{"minLength":1,"type":"string"}},"required":["schema"],"type":"object"},"stateVersion":{"minLength":1,"type":"string"}},"required":["kind","schema"],"type":"object"}},"type":"object"},"uses":{"patternProperties":{"^.*$":{"type":"object"}},"type":"object"}},"required":["format","id","displayName","description","kind"],"type":"object"}},"required":["contract"],"type":"object"},"TrellisSurfaceStatusRequest":{"properties":{"action":{"anyOf":[{"const":"call","type":"string"},{"const":"publish","type":"string"},{"const":"subscribe","type":"string"},{"const":"observe","type":"string"}]},"contractId":{"minLength":1,"type":"string"},"kind":{"anyOf":[{"const":"rpc","type":"string"},{"const":"operation","type":"string"},{"const":"event","type":"string"},{"const":"feed","type":"string"}]},"surface":{"minLength":1,"type":"string"}},"required":["contractId","kind","surface"],"type":"object"},"TrellisSurfaceStatusResponse":{"properties":{"status":{"anyOf":[{"properties":{"liveImplementer":{"type":"boolean"},"runtime":{"anyOf":[{"const":"live","type":"string"},{"const":"no_live_implementer","type":"string"},{"const":"disabled","type":"string"}]},"state":{"const":"available","type":"string"}},"required":["state","liveImplementer","runtime"],"type":"object"},{"properties":{"reason":{"anyOf":[{"const":"authority_unavailable","type":"string"}]},"state":{"const":"unavailable","type":"string"}},"required":["state","reason"],"type":"object"},{"properties":{"missingCapabilities":{"items":{"type":"string"},"type":"array"},"state":{"const":"unauthorized","type":"string"}},"required":["state","missingCapabilities"],"type":"object"},{"properties":{"contractId":{"minLength":1,"type":"string"},"state":{"const":"unknown_contract","type":"string"}},"required":["state","contractId"],"type":"object"},{"properties":{"contractId":{"minLength":1,"type":"string"},"kind":{"minLength":1,"type":"string"},"state":{"const":"unknown_surface","type":"string"},"surface":{"minLength":1,"type":"string"}},"required":["state","contractId","kind","surface"],"type":"object"}]}},"required":["status"],"type":"object"}},"uses":{"required":{"health":{"contract":"trellis.health@v1","events":{"publish":["Health.Heartbeat"]}}}}} as TrellisContractV1;
|
|
15
|
+
export const CONTRACT_DIGEST =
|
|
16
|
+
"L4HW6uUIxDhK1Kpa_PUxpumoMberMgiCgJTNN5Qvje0" as const;
|
|
17
|
+
export const CONTRACT = {
|
|
18
|
+
"capabilities": {
|
|
19
|
+
"trellis.core::catalog.read": {
|
|
20
|
+
"description": "List the installed Trellis contract catalog.",
|
|
21
|
+
"displayName": "Read contract catalog",
|
|
22
|
+
},
|
|
23
|
+
"trellis.core::contract.read": {
|
|
24
|
+
"description": "Read installed contract manifests and metadata.",
|
|
25
|
+
"displayName": "Read installed contracts",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
"description":
|
|
29
|
+
"Trellis runtime RPCs available to all connected participants.",
|
|
30
|
+
"displayName": "Trellis Core",
|
|
31
|
+
"docs": {
|
|
32
|
+
"markdown":
|
|
33
|
+
"Exposes the Trellis catalog, contract details, runtime bindings, and surface availability checks used by platform participants.",
|
|
34
|
+
"summary": "Runtime catalog and binding APIs.",
|
|
35
|
+
},
|
|
36
|
+
"format": "trellis.contract.v1",
|
|
37
|
+
"id": "trellis.core@v1",
|
|
38
|
+
"kind": "service",
|
|
39
|
+
"rpc": {
|
|
40
|
+
"Trellis.Bindings.Get": {
|
|
41
|
+
"capabilities": { "call": ["service"] },
|
|
42
|
+
"docs": {
|
|
43
|
+
"markdown":
|
|
44
|
+
"Returns runtime resource bindings for the caller's active service contract.",
|
|
45
|
+
"summary": "Read service resource bindings.",
|
|
46
|
+
},
|
|
47
|
+
"errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }],
|
|
48
|
+
"input": { "schema": "TrellisBindingsGetRequest" },
|
|
49
|
+
"internal": true,
|
|
50
|
+
"output": { "schema": "TrellisBindingsGetResponse" },
|
|
51
|
+
"subject": "rpc.v1.Trellis.Bindings.Get",
|
|
52
|
+
"version": "v1",
|
|
53
|
+
},
|
|
54
|
+
"Trellis.Catalog": {
|
|
55
|
+
"capabilities": { "call": ["trellis.core::catalog.read"] },
|
|
56
|
+
"docs": {
|
|
57
|
+
"markdown":
|
|
58
|
+
"Returns the active contract catalog entries available in the deployment.",
|
|
59
|
+
"summary": "List visible contracts.",
|
|
60
|
+
},
|
|
61
|
+
"errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }],
|
|
62
|
+
"input": { "schema": "TrellisCatalogRequest" },
|
|
63
|
+
"output": { "schema": "TrellisCatalogResponse" },
|
|
64
|
+
"subject": "rpc.v1.Trellis.Catalog",
|
|
65
|
+
"version": "v1",
|
|
66
|
+
},
|
|
67
|
+
"Trellis.Contract.Get": {
|
|
68
|
+
"capabilities": { "call": ["trellis.core::contract.read"] },
|
|
69
|
+
"docs": {
|
|
70
|
+
"markdown":
|
|
71
|
+
"Returns the normalized contract manifest for a known contract digest.",
|
|
72
|
+
"summary": "Read one contract manifest.",
|
|
73
|
+
},
|
|
74
|
+
"errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }],
|
|
75
|
+
"input": { "schema": "TrellisContractGetRequest" },
|
|
76
|
+
"output": { "schema": "TrellisContractGetResponse" },
|
|
77
|
+
"subject": "rpc.v1.Trellis.Contract.Get",
|
|
78
|
+
"version": "v1",
|
|
79
|
+
},
|
|
80
|
+
"Trellis.Surface.Status": {
|
|
81
|
+
"capabilities": { "call": ["trellis.core::catalog.read"] },
|
|
82
|
+
"docs": {
|
|
83
|
+
"markdown":
|
|
84
|
+
"Reports capability and deployment authority status for a contract-owned surface.",
|
|
85
|
+
"summary": "Inspect surface availability.",
|
|
86
|
+
},
|
|
87
|
+
"errors": [{ "type": "UnexpectedError" }, { "type": "ValidationError" }],
|
|
88
|
+
"input": { "schema": "TrellisSurfaceStatusRequest" },
|
|
89
|
+
"output": { "schema": "TrellisSurfaceStatusResponse" },
|
|
90
|
+
"subject": "rpc.v1.Trellis.Surface.Status",
|
|
91
|
+
"version": "v1",
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
"schemas": {
|
|
95
|
+
"TrellisBindingsGetRequest": {
|
|
96
|
+
"properties": {
|
|
97
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
98
|
+
"digest": { "pattern": "^[A-Za-z0-9_-]+$", "type": "string" },
|
|
99
|
+
},
|
|
100
|
+
"type": "object",
|
|
101
|
+
},
|
|
102
|
+
"TrellisBindingsGetResponse": {
|
|
103
|
+
"properties": {
|
|
104
|
+
"binding": {
|
|
105
|
+
"properties": {
|
|
106
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
107
|
+
"digest": { "pattern": "^[A-Za-z0-9_-]+$", "type": "string" },
|
|
108
|
+
"resources": {
|
|
109
|
+
"properties": {
|
|
110
|
+
"eventConsumers": {
|
|
111
|
+
"patternProperties": {
|
|
112
|
+
"^.*$": {
|
|
113
|
+
"properties": {
|
|
114
|
+
"ackWaitMs": { "minimum": 1, "type": "integer" },
|
|
115
|
+
"backoffMs": {
|
|
116
|
+
"items": { "minimum": 0, "type": "integer" },
|
|
117
|
+
"type": "array",
|
|
118
|
+
},
|
|
119
|
+
"concurrency": { "minimum": 1, "type": "integer" },
|
|
120
|
+
"consumerName": { "minLength": 1, "type": "string" },
|
|
121
|
+
"filterSubjects": {
|
|
122
|
+
"items": { "minLength": 1, "type": "string" },
|
|
123
|
+
"type": "array",
|
|
124
|
+
},
|
|
125
|
+
"maxDeliver": { "minimum": 1, "type": "integer" },
|
|
126
|
+
"ordering": { "const": "strict", "type": "string" },
|
|
127
|
+
"replay": {
|
|
128
|
+
"anyOf": [{ "const": "new", "type": "string" }, {
|
|
129
|
+
"const": "all",
|
|
130
|
+
"type": "string",
|
|
131
|
+
}],
|
|
132
|
+
},
|
|
133
|
+
"stream": { "minLength": 1, "type": "string" },
|
|
134
|
+
},
|
|
135
|
+
"required": [
|
|
136
|
+
"stream",
|
|
137
|
+
"consumerName",
|
|
138
|
+
"filterSubjects",
|
|
139
|
+
"replay",
|
|
140
|
+
"ordering",
|
|
141
|
+
"concurrency",
|
|
142
|
+
"ackWaitMs",
|
|
143
|
+
"maxDeliver",
|
|
144
|
+
"backoffMs",
|
|
145
|
+
],
|
|
146
|
+
"type": "object",
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
"type": "object",
|
|
150
|
+
},
|
|
151
|
+
"jobs": {
|
|
152
|
+
"properties": {
|
|
153
|
+
"namespace": { "minLength": 1, "type": "string" },
|
|
154
|
+
"queues": {
|
|
155
|
+
"patternProperties": {
|
|
156
|
+
"^.*$": {
|
|
157
|
+
"properties": {
|
|
158
|
+
"ackWaitMs": { "minimum": 1, "type": "integer" },
|
|
159
|
+
"backoffMs": {
|
|
160
|
+
"items": { "minimum": 0, "type": "integer" },
|
|
161
|
+
"type": "array",
|
|
162
|
+
},
|
|
163
|
+
"concurrency": { "minimum": 1, "type": "integer" },
|
|
164
|
+
"consumerName": {
|
|
165
|
+
"minLength": 1,
|
|
166
|
+
"type": "string",
|
|
167
|
+
},
|
|
168
|
+
"defaultDeadlineMs": {
|
|
169
|
+
"minimum": 1,
|
|
170
|
+
"type": "integer",
|
|
171
|
+
},
|
|
172
|
+
"dlq": { "type": "boolean" },
|
|
173
|
+
"logs": { "type": "boolean" },
|
|
174
|
+
"maxDeliver": { "minimum": 1, "type": "integer" },
|
|
175
|
+
"payload": {
|
|
176
|
+
"properties": {
|
|
177
|
+
"schema": { "minLength": 1, "type": "string" },
|
|
178
|
+
},
|
|
179
|
+
"required": ["schema"],
|
|
180
|
+
"type": "object",
|
|
181
|
+
},
|
|
182
|
+
"progress": { "type": "boolean" },
|
|
183
|
+
"publishPrefix": {
|
|
184
|
+
"minLength": 1,
|
|
185
|
+
"type": "string",
|
|
186
|
+
},
|
|
187
|
+
"queueType": { "minLength": 1, "type": "string" },
|
|
188
|
+
"result": {
|
|
189
|
+
"properties": {
|
|
190
|
+
"schema": { "minLength": 1, "type": "string" },
|
|
191
|
+
},
|
|
192
|
+
"required": ["schema"],
|
|
193
|
+
"type": "object",
|
|
194
|
+
},
|
|
195
|
+
"workSubject": { "minLength": 1, "type": "string" },
|
|
196
|
+
},
|
|
197
|
+
"required": [
|
|
198
|
+
"queueType",
|
|
199
|
+
"publishPrefix",
|
|
200
|
+
"workSubject",
|
|
201
|
+
"consumerName",
|
|
202
|
+
"payload",
|
|
203
|
+
"maxDeliver",
|
|
204
|
+
"backoffMs",
|
|
205
|
+
"ackWaitMs",
|
|
206
|
+
"progress",
|
|
207
|
+
"logs",
|
|
208
|
+
"dlq",
|
|
209
|
+
"concurrency",
|
|
210
|
+
],
|
|
211
|
+
"type": "object",
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
"type": "object",
|
|
215
|
+
},
|
|
216
|
+
"workStream": { "minLength": 1, "type": "string" },
|
|
217
|
+
},
|
|
218
|
+
"required": ["namespace", "queues"],
|
|
219
|
+
"type": "object",
|
|
220
|
+
},
|
|
221
|
+
"kv": {
|
|
222
|
+
"patternProperties": {
|
|
223
|
+
"^.*$": {
|
|
224
|
+
"properties": {
|
|
225
|
+
"bucket": { "minLength": 1, "type": "string" },
|
|
226
|
+
"history": { "minimum": 1, "type": "integer" },
|
|
227
|
+
"maxValueBytes": { "minimum": 1, "type": "integer" },
|
|
228
|
+
"ttlMs": { "minimum": 0, "type": "integer" },
|
|
229
|
+
},
|
|
230
|
+
"required": ["bucket", "history", "ttlMs"],
|
|
231
|
+
"type": "object",
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
"type": "object",
|
|
235
|
+
},
|
|
236
|
+
"store": {
|
|
237
|
+
"patternProperties": {
|
|
238
|
+
"^.*$": {
|
|
239
|
+
"properties": {
|
|
240
|
+
"maxObjectBytes": { "minimum": 1, "type": "integer" },
|
|
241
|
+
"maxTotalBytes": { "minimum": 1, "type": "integer" },
|
|
242
|
+
"name": { "minLength": 1, "type": "string" },
|
|
243
|
+
"ttlMs": { "minimum": 0, "type": "integer" },
|
|
244
|
+
},
|
|
245
|
+
"required": ["name", "ttlMs"],
|
|
246
|
+
"type": "object",
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
"type": "object",
|
|
250
|
+
},
|
|
251
|
+
},
|
|
252
|
+
"type": "object",
|
|
253
|
+
},
|
|
254
|
+
},
|
|
255
|
+
"required": ["contractId", "digest", "resources"],
|
|
256
|
+
"type": "object",
|
|
257
|
+
},
|
|
258
|
+
"eventConsumers": {
|
|
259
|
+
"patternProperties": {
|
|
260
|
+
"^.*$": {
|
|
261
|
+
"properties": {
|
|
262
|
+
"ackWaitMs": { "minimum": 1, "type": "integer" },
|
|
263
|
+
"backoffMs": {
|
|
264
|
+
"items": { "minimum": 0, "type": "integer" },
|
|
265
|
+
"type": "array",
|
|
266
|
+
},
|
|
267
|
+
"concurrency": { "minimum": 1, "type": "integer" },
|
|
268
|
+
"consumerName": { "minLength": 1, "type": "string" },
|
|
269
|
+
"filterSubjects": {
|
|
270
|
+
"items": { "minLength": 1, "type": "string" },
|
|
271
|
+
"type": "array",
|
|
272
|
+
},
|
|
273
|
+
"maxDeliver": { "minimum": 1, "type": "integer" },
|
|
274
|
+
"ordering": { "const": "strict", "type": "string" },
|
|
275
|
+
"replay": {
|
|
276
|
+
"anyOf": [{ "const": "new", "type": "string" }, {
|
|
277
|
+
"const": "all",
|
|
278
|
+
"type": "string",
|
|
279
|
+
}],
|
|
280
|
+
},
|
|
281
|
+
"stream": { "minLength": 1, "type": "string" },
|
|
282
|
+
},
|
|
283
|
+
"required": [
|
|
284
|
+
"stream",
|
|
285
|
+
"consumerName",
|
|
286
|
+
"filterSubjects",
|
|
287
|
+
"replay",
|
|
288
|
+
"ordering",
|
|
289
|
+
"concurrency",
|
|
290
|
+
"ackWaitMs",
|
|
291
|
+
"maxDeliver",
|
|
292
|
+
"backoffMs",
|
|
293
|
+
],
|
|
294
|
+
"type": "object",
|
|
295
|
+
},
|
|
296
|
+
},
|
|
297
|
+
"type": "object",
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
"type": "object",
|
|
301
|
+
},
|
|
302
|
+
"TrellisCatalogRequest": { "properties": {}, "type": "object" },
|
|
303
|
+
"TrellisCatalogResponse": {
|
|
304
|
+
"properties": {
|
|
305
|
+
"catalog": {
|
|
306
|
+
"properties": {
|
|
307
|
+
"contracts": {
|
|
308
|
+
"items": {
|
|
309
|
+
"properties": {
|
|
310
|
+
"description": { "minLength": 1, "type": "string" },
|
|
311
|
+
"digest": { "type": "string" },
|
|
312
|
+
"displayName": { "minLength": 1, "type": "string" },
|
|
313
|
+
"id": { "type": "string" },
|
|
314
|
+
},
|
|
315
|
+
"required": ["id", "digest", "displayName", "description"],
|
|
316
|
+
"type": "object",
|
|
317
|
+
},
|
|
318
|
+
"type": "array",
|
|
319
|
+
},
|
|
320
|
+
"format": { "const": "trellis.catalog.v1", "type": "string" },
|
|
321
|
+
"issues": {
|
|
322
|
+
"items": {
|
|
323
|
+
"properties": {
|
|
324
|
+
"actions": {
|
|
325
|
+
"items": {
|
|
326
|
+
"properties": {
|
|
327
|
+
"action": {
|
|
328
|
+
"anyOf": [{
|
|
329
|
+
"const": "keep-current",
|
|
330
|
+
"type": "string",
|
|
331
|
+
}, { "const": "force-replace", "type": "string" }],
|
|
332
|
+
},
|
|
333
|
+
"deploymentIds": {
|
|
334
|
+
"items": { "type": "string" },
|
|
335
|
+
"type": "array",
|
|
336
|
+
},
|
|
337
|
+
"description": { "minLength": 1, "type": "string" },
|
|
338
|
+
"digests": {
|
|
339
|
+
"items": { "type": "string" },
|
|
340
|
+
"type": "array",
|
|
341
|
+
},
|
|
342
|
+
"label": { "minLength": 1, "type": "string" },
|
|
343
|
+
"risk": {
|
|
344
|
+
"anyOf": [{
|
|
345
|
+
"const": "recommended",
|
|
346
|
+
"type": "string",
|
|
347
|
+
}, { "const": "dangerous", "type": "string" }],
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
"required": [
|
|
351
|
+
"action",
|
|
352
|
+
"label",
|
|
353
|
+
"description",
|
|
354
|
+
"risk",
|
|
355
|
+
"deploymentIds",
|
|
356
|
+
"digests",
|
|
357
|
+
],
|
|
358
|
+
"type": "object",
|
|
359
|
+
},
|
|
360
|
+
"type": "array",
|
|
361
|
+
},
|
|
362
|
+
"conflictingDeploymentIds": {
|
|
363
|
+
"items": { "type": "string" },
|
|
364
|
+
"type": "array",
|
|
365
|
+
},
|
|
366
|
+
"conflictingDigest": { "type": "string" },
|
|
367
|
+
"conflictingDigests": {
|
|
368
|
+
"items": { "type": "string" },
|
|
369
|
+
"type": "array",
|
|
370
|
+
},
|
|
371
|
+
"contractId": { "type": "string" },
|
|
372
|
+
"deploymentIds": {
|
|
373
|
+
"items": { "type": "string" },
|
|
374
|
+
"type": "array",
|
|
375
|
+
},
|
|
376
|
+
"digest": { "type": "string" },
|
|
377
|
+
"effectiveDeploymentIds": {
|
|
378
|
+
"items": { "type": "string" },
|
|
379
|
+
"type": "array",
|
|
380
|
+
},
|
|
381
|
+
"effectiveDigests": {
|
|
382
|
+
"items": { "type": "string" },
|
|
383
|
+
"type": "array",
|
|
384
|
+
},
|
|
385
|
+
"issueId": { "minLength": 1, "type": "string" },
|
|
386
|
+
"kind": {
|
|
387
|
+
"anyOf": [
|
|
388
|
+
{ "const": "missing-active-contract", "type": "string" },
|
|
389
|
+
{ "const": "invalid-active-contract", "type": "string" },
|
|
390
|
+
{
|
|
391
|
+
"const": "incompatible-active-contract",
|
|
392
|
+
"type": "string",
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"const": "invalid-active-contract-uses",
|
|
396
|
+
"type": "string",
|
|
397
|
+
},
|
|
398
|
+
],
|
|
399
|
+
},
|
|
400
|
+
"message": { "minLength": 1, "type": "string" },
|
|
401
|
+
},
|
|
402
|
+
"required": [
|
|
403
|
+
"issueId",
|
|
404
|
+
"kind",
|
|
405
|
+
"message",
|
|
406
|
+
"deploymentIds",
|
|
407
|
+
"actions",
|
|
408
|
+
],
|
|
409
|
+
"type": "object",
|
|
410
|
+
},
|
|
411
|
+
"type": "array",
|
|
412
|
+
},
|
|
413
|
+
},
|
|
414
|
+
"required": ["format", "contracts"],
|
|
415
|
+
"type": "object",
|
|
416
|
+
},
|
|
417
|
+
},
|
|
418
|
+
"required": ["catalog"],
|
|
419
|
+
"type": "object",
|
|
420
|
+
},
|
|
421
|
+
"TrellisContractGetRequest": {
|
|
422
|
+
"properties": {
|
|
423
|
+
"digest": { "pattern": "^[A-Za-z0-9_-]+$", "type": "string" },
|
|
424
|
+
},
|
|
425
|
+
"required": ["digest"],
|
|
426
|
+
"type": "object",
|
|
427
|
+
},
|
|
428
|
+
"TrellisContractGetResponse": {
|
|
429
|
+
"properties": {
|
|
430
|
+
"contract": {
|
|
431
|
+
"properties": {
|
|
432
|
+
"description": { "minLength": 1, "type": "string" },
|
|
433
|
+
"displayName": { "minLength": 1, "type": "string" },
|
|
434
|
+
"docs": {
|
|
435
|
+
"properties": {
|
|
436
|
+
"markdown": { "type": "string" },
|
|
437
|
+
"summary": { "type": "string" },
|
|
438
|
+
},
|
|
439
|
+
"required": ["markdown"],
|
|
440
|
+
"type": "object",
|
|
441
|
+
},
|
|
442
|
+
"errors": {
|
|
443
|
+
"patternProperties": { "^.*$": { "type": "object" } },
|
|
444
|
+
"type": "object",
|
|
445
|
+
},
|
|
446
|
+
"events": {
|
|
447
|
+
"patternProperties": { "^.*$": { "type": "object" } },
|
|
448
|
+
"type": "object",
|
|
449
|
+
},
|
|
450
|
+
"exports": {
|
|
451
|
+
"properties": {
|
|
452
|
+
"schemas": {
|
|
453
|
+
"items": { "minLength": 1, "type": "string" },
|
|
454
|
+
"type": "array",
|
|
455
|
+
},
|
|
456
|
+
},
|
|
457
|
+
"type": "object",
|
|
458
|
+
},
|
|
459
|
+
"format": { "const": "trellis.contract.v1", "type": "string" },
|
|
460
|
+
"id": { "minLength": 1, "type": "string" },
|
|
461
|
+
"jobs": {
|
|
462
|
+
"patternProperties": {
|
|
463
|
+
"^.*$": {
|
|
464
|
+
"properties": {
|
|
465
|
+
"ackWaitMs": { "minimum": 1, "type": "integer" },
|
|
466
|
+
"backoffMs": {
|
|
467
|
+
"items": { "minimum": 0, "type": "integer" },
|
|
468
|
+
"type": "array",
|
|
469
|
+
},
|
|
470
|
+
"concurrency": { "minimum": 1, "type": "integer" },
|
|
471
|
+
"defaultDeadlineMs": { "minimum": 1, "type": "integer" },
|
|
472
|
+
"dlq": { "type": "boolean" },
|
|
473
|
+
"docs": {
|
|
474
|
+
"properties": {
|
|
475
|
+
"markdown": { "type": "string" },
|
|
476
|
+
"summary": { "type": "string" },
|
|
477
|
+
},
|
|
478
|
+
"required": ["markdown"],
|
|
479
|
+
"type": "object",
|
|
480
|
+
},
|
|
481
|
+
"logs": { "type": "boolean" },
|
|
482
|
+
"maxDeliver": { "minimum": 1, "type": "integer" },
|
|
483
|
+
"payload": {
|
|
484
|
+
"properties": {
|
|
485
|
+
"schema": { "minLength": 1, "type": "string" },
|
|
486
|
+
},
|
|
487
|
+
"required": ["schema"],
|
|
488
|
+
"type": "object",
|
|
489
|
+
},
|
|
490
|
+
"progress": { "type": "boolean" },
|
|
491
|
+
"result": {
|
|
492
|
+
"properties": {
|
|
493
|
+
"schema": { "minLength": 1, "type": "string" },
|
|
494
|
+
},
|
|
495
|
+
"required": ["schema"],
|
|
496
|
+
"type": "object",
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
"required": ["payload"],
|
|
500
|
+
"type": "object",
|
|
501
|
+
},
|
|
502
|
+
},
|
|
503
|
+
"type": "object",
|
|
504
|
+
},
|
|
505
|
+
"kind": {
|
|
506
|
+
"anyOf": [
|
|
507
|
+
{ "const": "service", "type": "string" },
|
|
508
|
+
{ "const": "app", "type": "string" },
|
|
509
|
+
{ "const": "device", "type": "string" },
|
|
510
|
+
{ "const": "agent", "type": "string" },
|
|
511
|
+
],
|
|
512
|
+
},
|
|
513
|
+
"operations": {
|
|
514
|
+
"patternProperties": { "^.*$": { "type": "object" } },
|
|
515
|
+
"type": "object",
|
|
516
|
+
},
|
|
517
|
+
"resources": {
|
|
518
|
+
"additionalProperties": false,
|
|
519
|
+
"properties": {
|
|
520
|
+
"kv": {
|
|
521
|
+
"patternProperties": {
|
|
522
|
+
"^.*$": {
|
|
523
|
+
"properties": {
|
|
524
|
+
"docs": {
|
|
525
|
+
"properties": {
|
|
526
|
+
"markdown": { "type": "string" },
|
|
527
|
+
"summary": { "type": "string" },
|
|
528
|
+
},
|
|
529
|
+
"required": ["markdown"],
|
|
530
|
+
"type": "object",
|
|
531
|
+
},
|
|
532
|
+
"history": {
|
|
533
|
+
"default": 1,
|
|
534
|
+
"minimum": 1,
|
|
535
|
+
"type": "integer",
|
|
536
|
+
},
|
|
537
|
+
"maxValueBytes": { "minimum": 1, "type": "integer" },
|
|
538
|
+
"purpose": { "minLength": 1, "type": "string" },
|
|
539
|
+
"required": { "default": true, "type": "boolean" },
|
|
540
|
+
"schema": {
|
|
541
|
+
"properties": {
|
|
542
|
+
"schema": { "minLength": 1, "type": "string" },
|
|
543
|
+
},
|
|
544
|
+
"required": ["schema"],
|
|
545
|
+
"type": "object",
|
|
546
|
+
},
|
|
547
|
+
"ttlMs": {
|
|
548
|
+
"default": 0,
|
|
549
|
+
"minimum": 0,
|
|
550
|
+
"type": "integer",
|
|
551
|
+
},
|
|
552
|
+
},
|
|
553
|
+
"required": ["purpose", "schema"],
|
|
554
|
+
"type": "object",
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
"type": "object",
|
|
558
|
+
},
|
|
559
|
+
"store": {
|
|
560
|
+
"patternProperties": {
|
|
561
|
+
"^.*$": {
|
|
562
|
+
"properties": {
|
|
563
|
+
"docs": {
|
|
564
|
+
"properties": {
|
|
565
|
+
"markdown": { "type": "string" },
|
|
566
|
+
"summary": { "type": "string" },
|
|
567
|
+
},
|
|
568
|
+
"required": ["markdown"],
|
|
569
|
+
"type": "object",
|
|
570
|
+
},
|
|
571
|
+
"maxObjectBytes": { "minimum": 1, "type": "integer" },
|
|
572
|
+
"maxTotalBytes": { "minimum": 1, "type": "integer" },
|
|
573
|
+
"purpose": { "minLength": 1, "type": "string" },
|
|
574
|
+
"required": { "default": true, "type": "boolean" },
|
|
575
|
+
"ttlMs": {
|
|
576
|
+
"default": 0,
|
|
577
|
+
"minimum": 0,
|
|
578
|
+
"type": "integer",
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
"required": ["purpose"],
|
|
582
|
+
"type": "object",
|
|
583
|
+
},
|
|
584
|
+
},
|
|
585
|
+
"type": "object",
|
|
586
|
+
},
|
|
587
|
+
},
|
|
588
|
+
"type": "object",
|
|
589
|
+
},
|
|
590
|
+
"rpc": {
|
|
591
|
+
"patternProperties": { "^.*$": { "type": "object" } },
|
|
592
|
+
"type": "object",
|
|
593
|
+
},
|
|
594
|
+
"schemas": {
|
|
595
|
+
"patternProperties": {
|
|
596
|
+
"^.*$": {
|
|
597
|
+
"anyOf": [{ "type": "object" }, { "type": "boolean" }],
|
|
598
|
+
},
|
|
599
|
+
},
|
|
600
|
+
"type": "object",
|
|
601
|
+
},
|
|
602
|
+
"state": {
|
|
603
|
+
"patternProperties": {
|
|
604
|
+
"^.*$": {
|
|
605
|
+
"properties": {
|
|
606
|
+
"acceptedVersions": {
|
|
607
|
+
"patternProperties": {
|
|
608
|
+
"^.*$": {
|
|
609
|
+
"properties": {
|
|
610
|
+
"schema": { "minLength": 1, "type": "string" },
|
|
611
|
+
},
|
|
612
|
+
"required": ["schema"],
|
|
613
|
+
"type": "object",
|
|
614
|
+
},
|
|
615
|
+
},
|
|
616
|
+
"type": "object",
|
|
617
|
+
},
|
|
618
|
+
"docs": {
|
|
619
|
+
"properties": {
|
|
620
|
+
"markdown": { "type": "string" },
|
|
621
|
+
"summary": { "type": "string" },
|
|
622
|
+
},
|
|
623
|
+
"required": ["markdown"],
|
|
624
|
+
"type": "object",
|
|
625
|
+
},
|
|
626
|
+
"kind": {
|
|
627
|
+
"anyOf": [{ "const": "value", "type": "string" }, {
|
|
628
|
+
"const": "map",
|
|
629
|
+
"type": "string",
|
|
630
|
+
}],
|
|
631
|
+
},
|
|
632
|
+
"schema": {
|
|
633
|
+
"properties": {
|
|
634
|
+
"schema": { "minLength": 1, "type": "string" },
|
|
635
|
+
},
|
|
636
|
+
"required": ["schema"],
|
|
637
|
+
"type": "object",
|
|
638
|
+
},
|
|
639
|
+
"stateVersion": { "minLength": 1, "type": "string" },
|
|
640
|
+
},
|
|
641
|
+
"required": ["kind", "schema"],
|
|
642
|
+
"type": "object",
|
|
643
|
+
},
|
|
644
|
+
},
|
|
645
|
+
"type": "object",
|
|
646
|
+
},
|
|
647
|
+
"uses": {
|
|
648
|
+
"patternProperties": { "^.*$": { "type": "object" } },
|
|
649
|
+
"type": "object",
|
|
650
|
+
},
|
|
651
|
+
},
|
|
652
|
+
"required": ["format", "id", "displayName", "description", "kind"],
|
|
653
|
+
"type": "object",
|
|
654
|
+
},
|
|
655
|
+
},
|
|
656
|
+
"required": ["contract"],
|
|
657
|
+
"type": "object",
|
|
658
|
+
},
|
|
659
|
+
"TrellisSurfaceStatusRequest": {
|
|
660
|
+
"properties": {
|
|
661
|
+
"action": {
|
|
662
|
+
"anyOf": [
|
|
663
|
+
{ "const": "call", "type": "string" },
|
|
664
|
+
{ "const": "publish", "type": "string" },
|
|
665
|
+
{ "const": "subscribe", "type": "string" },
|
|
666
|
+
{ "const": "observe", "type": "string" },
|
|
667
|
+
],
|
|
668
|
+
},
|
|
669
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
670
|
+
"kind": {
|
|
671
|
+
"anyOf": [
|
|
672
|
+
{ "const": "rpc", "type": "string" },
|
|
673
|
+
{ "const": "operation", "type": "string" },
|
|
674
|
+
{ "const": "event", "type": "string" },
|
|
675
|
+
{ "const": "feed", "type": "string" },
|
|
676
|
+
],
|
|
677
|
+
},
|
|
678
|
+
"surface": { "minLength": 1, "type": "string" },
|
|
679
|
+
},
|
|
680
|
+
"required": ["contractId", "kind", "surface"],
|
|
681
|
+
"type": "object",
|
|
682
|
+
},
|
|
683
|
+
"TrellisSurfaceStatusResponse": {
|
|
684
|
+
"properties": {
|
|
685
|
+
"status": {
|
|
686
|
+
"anyOf": [{
|
|
687
|
+
"properties": {
|
|
688
|
+
"liveImplementer": { "type": "boolean" },
|
|
689
|
+
"runtime": {
|
|
690
|
+
"anyOf": [{ "const": "live", "type": "string" }, {
|
|
691
|
+
"const": "no_live_implementer",
|
|
692
|
+
"type": "string",
|
|
693
|
+
}, { "const": "disabled", "type": "string" }],
|
|
694
|
+
},
|
|
695
|
+
"state": { "const": "available", "type": "string" },
|
|
696
|
+
},
|
|
697
|
+
"required": ["state", "liveImplementer", "runtime"],
|
|
698
|
+
"type": "object",
|
|
699
|
+
}, {
|
|
700
|
+
"properties": {
|
|
701
|
+
"reason": {
|
|
702
|
+
"anyOf": [{
|
|
703
|
+
"const": "authority_unavailable",
|
|
704
|
+
"type": "string",
|
|
705
|
+
}],
|
|
706
|
+
},
|
|
707
|
+
"state": { "const": "unavailable", "type": "string" },
|
|
708
|
+
},
|
|
709
|
+
"required": ["state", "reason"],
|
|
710
|
+
"type": "object",
|
|
711
|
+
}, {
|
|
712
|
+
"properties": {
|
|
713
|
+
"missingCapabilities": {
|
|
714
|
+
"items": { "type": "string" },
|
|
715
|
+
"type": "array",
|
|
716
|
+
},
|
|
717
|
+
"state": { "const": "unauthorized", "type": "string" },
|
|
718
|
+
},
|
|
719
|
+
"required": ["state", "missingCapabilities"],
|
|
720
|
+
"type": "object",
|
|
721
|
+
}, {
|
|
722
|
+
"properties": {
|
|
723
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
724
|
+
"state": { "const": "unknown_contract", "type": "string" },
|
|
725
|
+
},
|
|
726
|
+
"required": ["state", "contractId"],
|
|
727
|
+
"type": "object",
|
|
728
|
+
}, {
|
|
729
|
+
"properties": {
|
|
730
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
731
|
+
"kind": { "minLength": 1, "type": "string" },
|
|
732
|
+
"state": { "const": "unknown_surface", "type": "string" },
|
|
733
|
+
"surface": { "minLength": 1, "type": "string" },
|
|
734
|
+
},
|
|
735
|
+
"required": ["state", "contractId", "kind", "surface"],
|
|
736
|
+
"type": "object",
|
|
737
|
+
}],
|
|
738
|
+
},
|
|
739
|
+
},
|
|
740
|
+
"required": ["status"],
|
|
741
|
+
"type": "object",
|
|
742
|
+
},
|
|
743
|
+
},
|
|
744
|
+
"uses": {
|
|
745
|
+
"required": {
|
|
746
|
+
"health": {
|
|
747
|
+
"contract": "trellis.health@v1",
|
|
748
|
+
"events": { "publish": ["Health.Heartbeat"] },
|
|
749
|
+
},
|
|
750
|
+
},
|
|
751
|
+
},
|
|
752
|
+
} as TrellisContractV1;
|
|
10
753
|
|
|
11
754
|
function assertSelectedKeysExist(
|
|
12
755
|
kind: "rpc" | "operations" | "events" | "feeds",
|
|
@@ -19,14 +762,20 @@ function assertSelectedKeysExist(
|
|
|
19
762
|
|
|
20
763
|
for (const key of keys) {
|
|
21
764
|
if (!Object.hasOwn(api, key)) {
|
|
22
|
-
throw new Error(
|
|
765
|
+
throw new Error(
|
|
766
|
+
`Contract '${CONTRACT_ID}' does not expose ${kind} key '${key}'`,
|
|
767
|
+
);
|
|
23
768
|
}
|
|
24
769
|
}
|
|
25
770
|
}
|
|
26
771
|
|
|
27
772
|
function assertValidUseSpec(spec: UseSpec<typeof API.owned>) {
|
|
28
773
|
assertSelectedKeysExist("rpc", spec.rpc?.call, API.owned.rpc);
|
|
29
|
-
assertSelectedKeysExist(
|
|
774
|
+
assertSelectedKeysExist(
|
|
775
|
+
"operations",
|
|
776
|
+
spec.operations?.call,
|
|
777
|
+
API.owned.operations,
|
|
778
|
+
);
|
|
30
779
|
assertSelectedKeysExist("events", spec.events?.publish, API.owned.events);
|
|
31
780
|
assertSelectedKeysExist("events", spec.events?.subscribe, API.owned.events);
|
|
32
781
|
assertSelectedKeysExist("feeds", spec.feeds?.subscribe, API.owned.feeds);
|
|
@@ -37,22 +786,30 @@ export const sdk: SdkContractModule<typeof CONTRACT_ID, typeof API.owned> = {
|
|
|
37
786
|
CONTRACT_DIGEST,
|
|
38
787
|
CONTRACT,
|
|
39
788
|
API,
|
|
40
|
-
use:
|
|
789
|
+
use: <const TSpec extends UseSpec<typeof API.owned>>(spec: TSpec) => {
|
|
41
790
|
assertValidUseSpec(spec);
|
|
42
791
|
|
|
43
792
|
const dependencyUse = {
|
|
44
793
|
contract: CONTRACT_ID,
|
|
45
794
|
...(spec.rpc?.call ? { rpc: { call: [...spec.rpc.call] } } : {}),
|
|
46
|
-
...(spec.operations?.call
|
|
795
|
+
...(spec.operations?.call
|
|
796
|
+
? { operations: { call: [...spec.operations.call] } }
|
|
797
|
+
: {}),
|
|
47
798
|
...((spec.events?.publish || spec.events?.subscribe)
|
|
48
799
|
? {
|
|
49
800
|
events: {
|
|
50
|
-
...(spec.events.publish
|
|
51
|
-
|
|
801
|
+
...(spec.events.publish
|
|
802
|
+
? { publish: [...spec.events.publish] }
|
|
803
|
+
: {}),
|
|
804
|
+
...(spec.events.subscribe
|
|
805
|
+
? { subscribe: [...spec.events.subscribe] }
|
|
806
|
+
: {}),
|
|
52
807
|
},
|
|
53
808
|
}
|
|
54
809
|
: {}),
|
|
55
|
-
...(spec.feeds?.subscribe
|
|
810
|
+
...(spec.feeds?.subscribe
|
|
811
|
+
? { feeds: { subscribe: [...spec.feeds.subscribe] } }
|
|
812
|
+
: {}),
|
|
56
813
|
};
|
|
57
814
|
|
|
58
815
|
Object.defineProperty(dependencyUse, CONTRACT_MODULE_METADATA, {
|
|
@@ -60,8 +817,12 @@ export const sdk: SdkContractModule<typeof CONTRACT_ID, typeof API.owned> = {
|
|
|
60
817
|
enumerable: false,
|
|
61
818
|
});
|
|
62
819
|
|
|
63
|
-
return dependencyUse as ContractDependencyUse<
|
|
64
|
-
|
|
820
|
+
return dependencyUse as ContractDependencyUse<
|
|
821
|
+
typeof CONTRACT_ID,
|
|
822
|
+
typeof API.owned,
|
|
823
|
+
TSpec
|
|
824
|
+
>;
|
|
825
|
+
},
|
|
65
826
|
};
|
|
66
827
|
|
|
67
828
|
export const use = sdk.use;
|