@qlever-llc/trellis 0.10.9 → 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/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/server/service.d.ts +35 -13
- package/esm/server/service.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/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/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/server/service.d.ts +35 -13
- package/script/server/service.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/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/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 +92 -15
- package/src/service/deno.ts +4 -0
- package/src/service/mod.ts +4 -0
- package/src/service/node.ts +4 -0
|
@@ -5,7 +5,630 @@ const api_js_1 = require("./api.js");
|
|
|
5
5
|
const CONTRACT_MODULE_METADATA = Symbol.for("@qlever-llc/trellis/contracts/contract-module");
|
|
6
6
|
exports.CONTRACT_ID = "trellis.state@v1";
|
|
7
7
|
exports.CONTRACT_DIGEST = "XfWDYLTBlYFjDqMPBEXrTBccZbFvHp0MnqscehdRKT4";
|
|
8
|
-
exports.CONTRACT = { "description": "Trellis-managed app state for authenticated app and device participants.", "displayName": "Trellis State", "docs": { "markdown": "Provides authenticated read, write, list, delete, and admin inspection APIs for Trellis-managed participant state.", "summary": "Participant state storage APIs." }, "format": "trellis.contract.v1", "id": "trellis.state@v1", "kind": "service", "rpc": { "State.Admin.Delete": { "capabilities": { "call": ["admin"] }, "docs": { "markdown": "Deletes one state value across participants for authorized administrators.", "summary": "Admin delete a state value." }, "errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "StateAdminDeleteRequest" }, "output": { "schema": "StateAdminDeleteResponse" }, "subject": "rpc.v1.State.Admin.Delete", "version": "v1" }, "State.Admin.Get": { "capabilities": { "call": ["admin"] }, "docs": { "markdown": "Returns one state value across participants for authorized administrators.", "summary": "Admin read a state value." }, "errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "StateAdminGetRequest" }, "output": { "schema": "StateAdminGetResponse" }, "subject": "rpc.v1.State.Admin.Get", "version": "v1" }, "State.Admin.List": { "capabilities": { "call": ["admin"] }, "docs": { "markdown": "Lists state values across participants for authorized administrators.", "summary": "Admin list state values." }, "errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "StateAdminListRequest" }, "output": { "schema": "StateAdminListResponse" }, "subject": "rpc.v1.State.Admin.List", "version": "v1" }, "State.Delete": { "docs": { "markdown": "Deletes one state value from the caller's authorized scope.", "summary": "Delete a state value." }, "errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "StateDeleteRequest" }, "output": { "schema": "StateDeleteResponse" }, "subject": "rpc.v1.State.Delete", "version": "v1" }, "State.Get": { "docs": { "markdown": "Returns one state value in the caller's authorized scope.", "summary": "Read a state value." }, "errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "StateGetRequest" }, "output": { "schema": "StateGetResponse" }, "subject": "rpc.v1.State.Get", "version": "v1" }, "State.List": { "docs": { "markdown": "Lists state values visible to the caller for the requested scope and prefix.", "summary": "List state values." }, "errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "StateListRequest" }, "output": { "schema": "StateListResponse" }, "subject": "rpc.v1.State.List", "version": "v1" }, "State.Put": { "docs": { "markdown": "Creates or replaces one state value in an authorized scope.", "summary": "Write a state value." }, "errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, { "type": "ValidationError" }], "input": { "schema": "StatePutRequest" }, "output": { "schema": "StatePutResponse" }, "subject": "rpc.v1.State.Put", "version": "v1" } }, "schemas": { "JsonValue": {}, "StateAdminDeleteRequest": { "anyOf": [{ "properties": { "contractDigest": { "minLength": 1, "type": "string" }, "contractId": { "minLength": 1, "type": "string" }, "expectedRevision": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "store": { "minLength": 1, "type": "string" }, "user": { "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" }, "userId": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "contractDigest", "store", "user"], "type": "object" }, { "properties": { "contractDigest": { "minLength": 1, "type": "string" }, "contractId": { "minLength": 1, "type": "string" }, "deviceId": { "minLength": 1, "type": "string" }, "expectedRevision": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "deviceApp", "type": "string" }, "store": { "minLength": 1, "type": "string" } }, "required": ["scope", "contractId", "contractDigest", "store", "deviceId"], "type": "object" }] }, "StateAdminDeleteResponse": { "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" }, "StateAdminGetRequest": { "anyOf": [{ "properties": { "contractDigest": { "minLength": 1, "type": "string" }, "contractId": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "store": { "minLength": 1, "type": "string" }, "user": { "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" }, "userId": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "contractDigest", "store", "user"], "type": "object" }, { "properties": { "contractDigest": { "minLength": 1, "type": "string" }, "contractId": { "minLength": 1, "type": "string" }, "deviceId": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "deviceApp", "type": "string" }, "store": { "minLength": 1, "type": "string" } }, "required": ["scope", "contractId", "contractDigest", "store", "deviceId"], "type": "object" }] }, "StateAdminGetResponse": { "anyOf": [{ "properties": { "found": { "const": false, "type": "boolean" } }, "required": ["found"], "type": "object" }, { "properties": { "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "found": { "const": true, "type": "boolean" } }, "required": ["found", "entry"], "type": "object" }, { "properties": { "currentStateVersion": { "minLength": 1, "type": "string" }, "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "migrationRequired": { "const": true, "type": "boolean" }, "stateVersion": { "minLength": 1, "type": "string" }, "writerContractDigest": { "minLength": 1, "type": "string" } }, "required": ["migrationRequired", "entry", "stateVersion", "currentStateVersion", "writerContractDigest"], "type": "object" }] }, "StateAdminListRequest": { "anyOf": [{ "properties": { "contractDigest": { "minLength": 1, "type": "string" }, "contractId": { "minLength": 1, "type": "string" }, "limit": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "prefix": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "store": { "minLength": 1, "type": "string" }, "user": { "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" }, "userId": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["limit", "scope", "contractId", "contractDigest", "store", "user"], "type": "object" }, { "properties": { "contractDigest": { "minLength": 1, "type": "string" }, "contractId": { "minLength": 1, "type": "string" }, "deviceId": { "minLength": 1, "type": "string" }, "limit": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "prefix": { "minLength": 1, "type": "string" }, "scope": { "const": "deviceApp", "type": "string" }, "store": { "minLength": 1, "type": "string" } }, "required": ["limit", "scope", "contractId", "contractDigest", "store", "deviceId"], "type": "object" }] }, "StateAdminListResponse": { "properties": { "count": { "minimum": 0, "type": "integer" }, "entries": { "default": [], "items": { "anyOf": [{ "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, { "properties": { "currentStateVersion": { "minLength": 1, "type": "string" }, "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "migrationRequired": { "const": true, "type": "boolean" }, "stateVersion": { "minLength": 1, "type": "string" }, "writerContractDigest": { "minLength": 1, "type": "string" } }, "required": ["migrationRequired", "entry", "stateVersion", "currentStateVersion", "writerContractDigest"], "type": "object" }] }, "type": "array" }, "limit": { "minimum": 0, "type": "integer" }, "nextOffset": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" } }, "required": ["entries", "count", "offset", "limit"], "type": "object" }, "StateDeleteRequest": { "properties": { "expectedRevision": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "store": { "minLength": 1, "type": "string" } }, "required": ["store"], "type": "object" }, "StateDeleteResponse": { "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" }, "StateEntry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "StateGetRequest": { "properties": { "key": { "minLength": 1, "type": "string" }, "store": { "minLength": 1, "type": "string" } }, "required": ["store"], "type": "object" }, "StateGetResponse": { "anyOf": [{ "properties": { "found": { "const": false, "type": "boolean" } }, "required": ["found"], "type": "object" }, { "properties": { "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "found": { "const": true, "type": "boolean" } }, "required": ["found", "entry"], "type": "object" }, { "properties": { "currentStateVersion": { "minLength": 1, "type": "string" }, "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "migrationRequired": { "const": true, "type": "boolean" }, "stateVersion": { "minLength": 1, "type": "string" }, "writerContractDigest": { "minLength": 1, "type": "string" } }, "required": ["migrationRequired", "entry", "stateVersion", "currentStateVersion", "writerContractDigest"], "type": "object" }] }, "StateListRequest": { "properties": { "limit": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "prefix": { "minLength": 1, "type": "string" }, "store": { "minLength": 1, "type": "string" } }, "required": ["limit", "store"], "type": "object" }, "StateListResponse": { "properties": { "count": { "minimum": 0, "type": "integer" }, "entries": { "default": [], "items": { "anyOf": [{ "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, { "properties": { "currentStateVersion": { "minLength": 1, "type": "string" }, "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "migrationRequired": { "const": true, "type": "boolean" }, "stateVersion": { "minLength": 1, "type": "string" }, "writerContractDigest": { "minLength": 1, "type": "string" } }, "required": ["migrationRequired", "entry", "stateVersion", "currentStateVersion", "writerContractDigest"], "type": "object" }] }, "type": "array" }, "limit": { "minimum": 0, "type": "integer" }, "nextOffset": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" } }, "required": ["entries", "count", "offset", "limit"], "type": "object" }, "StateMigrationRequired": { "properties": { "currentStateVersion": { "minLength": 1, "type": "string" }, "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "migrationRequired": { "const": true, "type": "boolean" }, "stateVersion": { "minLength": 1, "type": "string" }, "writerContractDigest": { "minLength": 1, "type": "string" } }, "required": ["migrationRequired", "entry", "stateVersion", "currentStateVersion", "writerContractDigest"], "type": "object" }, "StatePutRequest": { "properties": { "expectedRevision": { "anyOf": [{ "minLength": 1, "type": "string" }, { "type": "null" }] }, "key": { "minLength": 1, "type": "string" }, "store": { "minLength": 1, "type": "string" }, "ttlMs": { "minimum": 1, "type": "integer" }, "value": {} }, "required": ["store", "value"], "type": "object" }, "StatePutResponse": { "anyOf": [{ "properties": { "applied": { "const": true, "type": "boolean" }, "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" } }, "required": ["applied", "entry"], "type": "object" }, { "properties": { "applied": { "const": false, "type": "boolean" }, "entry": { "anyOf": [{ "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, { "properties": { "currentStateVersion": { "minLength": 1, "type": "string" }, "entry": { "properties": { "expiresAt": { "format": "date-time", "type": "string" }, "key": { "minLength": 1, "type": "string" }, "revision": { "minLength": 1, "type": "string" }, "updatedAt": { "format": "date-time", "type": "string" }, "value": {} }, "required": ["value", "revision", "updatedAt"], "type": "object" }, "migrationRequired": { "const": true, "type": "boolean" }, "stateVersion": { "minLength": 1, "type": "string" }, "writerContractDigest": { "minLength": 1, "type": "string" } }, "required": ["migrationRequired", "entry", "stateVersion", "currentStateVersion", "writerContractDigest"], "type": "object" }] }, "found": { "type": "boolean" } }, "required": ["applied", "found"], "type": "object" }] }, "StateScope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] }, "StateUserTarget": { "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" }, "userId": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "uses": { "required": { "health": { "contract": "trellis.health@v1", "events": { "publish": ["Health.Heartbeat"] } } } } };
|
|
8
|
+
exports.CONTRACT = {
|
|
9
|
+
"description": "Trellis-managed app state for authenticated app and device participants.",
|
|
10
|
+
"displayName": "Trellis State",
|
|
11
|
+
"docs": {
|
|
12
|
+
"markdown": "Provides authenticated read, write, list, delete, and admin inspection APIs for Trellis-managed participant state.",
|
|
13
|
+
"summary": "Participant state storage APIs.",
|
|
14
|
+
},
|
|
15
|
+
"format": "trellis.contract.v1",
|
|
16
|
+
"id": "trellis.state@v1",
|
|
17
|
+
"kind": "service",
|
|
18
|
+
"rpc": {
|
|
19
|
+
"State.Admin.Delete": {
|
|
20
|
+
"capabilities": { "call": ["admin"] },
|
|
21
|
+
"docs": {
|
|
22
|
+
"markdown": "Deletes one state value across participants for authorized administrators.",
|
|
23
|
+
"summary": "Admin delete a state value.",
|
|
24
|
+
},
|
|
25
|
+
"errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, {
|
|
26
|
+
"type": "ValidationError",
|
|
27
|
+
}],
|
|
28
|
+
"input": { "schema": "StateAdminDeleteRequest" },
|
|
29
|
+
"output": { "schema": "StateAdminDeleteResponse" },
|
|
30
|
+
"subject": "rpc.v1.State.Admin.Delete",
|
|
31
|
+
"version": "v1",
|
|
32
|
+
},
|
|
33
|
+
"State.Admin.Get": {
|
|
34
|
+
"capabilities": { "call": ["admin"] },
|
|
35
|
+
"docs": {
|
|
36
|
+
"markdown": "Returns one state value across participants for authorized administrators.",
|
|
37
|
+
"summary": "Admin read a state value.",
|
|
38
|
+
},
|
|
39
|
+
"errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, {
|
|
40
|
+
"type": "ValidationError",
|
|
41
|
+
}],
|
|
42
|
+
"input": { "schema": "StateAdminGetRequest" },
|
|
43
|
+
"output": { "schema": "StateAdminGetResponse" },
|
|
44
|
+
"subject": "rpc.v1.State.Admin.Get",
|
|
45
|
+
"version": "v1",
|
|
46
|
+
},
|
|
47
|
+
"State.Admin.List": {
|
|
48
|
+
"capabilities": { "call": ["admin"] },
|
|
49
|
+
"docs": {
|
|
50
|
+
"markdown": "Lists state values across participants for authorized administrators.",
|
|
51
|
+
"summary": "Admin list state values.",
|
|
52
|
+
},
|
|
53
|
+
"errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, {
|
|
54
|
+
"type": "ValidationError",
|
|
55
|
+
}],
|
|
56
|
+
"input": { "schema": "StateAdminListRequest" },
|
|
57
|
+
"output": { "schema": "StateAdminListResponse" },
|
|
58
|
+
"subject": "rpc.v1.State.Admin.List",
|
|
59
|
+
"version": "v1",
|
|
60
|
+
},
|
|
61
|
+
"State.Delete": {
|
|
62
|
+
"docs": {
|
|
63
|
+
"markdown": "Deletes one state value from the caller's authorized scope.",
|
|
64
|
+
"summary": "Delete a state value.",
|
|
65
|
+
},
|
|
66
|
+
"errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, {
|
|
67
|
+
"type": "ValidationError",
|
|
68
|
+
}],
|
|
69
|
+
"input": { "schema": "StateDeleteRequest" },
|
|
70
|
+
"output": { "schema": "StateDeleteResponse" },
|
|
71
|
+
"subject": "rpc.v1.State.Delete",
|
|
72
|
+
"version": "v1",
|
|
73
|
+
},
|
|
74
|
+
"State.Get": {
|
|
75
|
+
"docs": {
|
|
76
|
+
"markdown": "Returns one state value in the caller's authorized scope.",
|
|
77
|
+
"summary": "Read a state value.",
|
|
78
|
+
},
|
|
79
|
+
"errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, {
|
|
80
|
+
"type": "ValidationError",
|
|
81
|
+
}],
|
|
82
|
+
"input": { "schema": "StateGetRequest" },
|
|
83
|
+
"output": { "schema": "StateGetResponse" },
|
|
84
|
+
"subject": "rpc.v1.State.Get",
|
|
85
|
+
"version": "v1",
|
|
86
|
+
},
|
|
87
|
+
"State.List": {
|
|
88
|
+
"docs": {
|
|
89
|
+
"markdown": "Lists state values visible to the caller for the requested scope and prefix.",
|
|
90
|
+
"summary": "List state values.",
|
|
91
|
+
},
|
|
92
|
+
"errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, {
|
|
93
|
+
"type": "ValidationError",
|
|
94
|
+
}],
|
|
95
|
+
"input": { "schema": "StateListRequest" },
|
|
96
|
+
"output": { "schema": "StateListResponse" },
|
|
97
|
+
"subject": "rpc.v1.State.List",
|
|
98
|
+
"version": "v1",
|
|
99
|
+
},
|
|
100
|
+
"State.Put": {
|
|
101
|
+
"docs": {
|
|
102
|
+
"markdown": "Creates or replaces one state value in an authorized scope.",
|
|
103
|
+
"summary": "Write a state value.",
|
|
104
|
+
},
|
|
105
|
+
"errors": [{ "type": "AuthError" }, { "type": "UnexpectedError" }, {
|
|
106
|
+
"type": "ValidationError",
|
|
107
|
+
}],
|
|
108
|
+
"input": { "schema": "StatePutRequest" },
|
|
109
|
+
"output": { "schema": "StatePutResponse" },
|
|
110
|
+
"subject": "rpc.v1.State.Put",
|
|
111
|
+
"version": "v1",
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
"schemas": {
|
|
115
|
+
"JsonValue": {},
|
|
116
|
+
"StateAdminDeleteRequest": {
|
|
117
|
+
"anyOf": [{
|
|
118
|
+
"properties": {
|
|
119
|
+
"contractDigest": { "minLength": 1, "type": "string" },
|
|
120
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
121
|
+
"expectedRevision": { "minLength": 1, "type": "string" },
|
|
122
|
+
"key": { "minLength": 1, "type": "string" },
|
|
123
|
+
"scope": { "const": "userApp", "type": "string" },
|
|
124
|
+
"store": { "minLength": 1, "type": "string" },
|
|
125
|
+
"user": {
|
|
126
|
+
"properties": {
|
|
127
|
+
"id": { "minLength": 1, "type": "string" },
|
|
128
|
+
"origin": { "minLength": 1, "type": "string" },
|
|
129
|
+
"userId": { "minLength": 1, "type": "string" },
|
|
130
|
+
},
|
|
131
|
+
"required": ["origin", "id"],
|
|
132
|
+
"type": "object",
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
"required": ["scope", "contractId", "contractDigest", "store", "user"],
|
|
136
|
+
"type": "object",
|
|
137
|
+
}, {
|
|
138
|
+
"properties": {
|
|
139
|
+
"contractDigest": { "minLength": 1, "type": "string" },
|
|
140
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
141
|
+
"deviceId": { "minLength": 1, "type": "string" },
|
|
142
|
+
"expectedRevision": { "minLength": 1, "type": "string" },
|
|
143
|
+
"key": { "minLength": 1, "type": "string" },
|
|
144
|
+
"scope": { "const": "deviceApp", "type": "string" },
|
|
145
|
+
"store": { "minLength": 1, "type": "string" },
|
|
146
|
+
},
|
|
147
|
+
"required": [
|
|
148
|
+
"scope",
|
|
149
|
+
"contractId",
|
|
150
|
+
"contractDigest",
|
|
151
|
+
"store",
|
|
152
|
+
"deviceId",
|
|
153
|
+
],
|
|
154
|
+
"type": "object",
|
|
155
|
+
}],
|
|
156
|
+
},
|
|
157
|
+
"StateAdminDeleteResponse": {
|
|
158
|
+
"properties": { "deleted": { "type": "boolean" } },
|
|
159
|
+
"required": ["deleted"],
|
|
160
|
+
"type": "object",
|
|
161
|
+
},
|
|
162
|
+
"StateAdminGetRequest": {
|
|
163
|
+
"anyOf": [{
|
|
164
|
+
"properties": {
|
|
165
|
+
"contractDigest": { "minLength": 1, "type": "string" },
|
|
166
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
167
|
+
"key": { "minLength": 1, "type": "string" },
|
|
168
|
+
"scope": { "const": "userApp", "type": "string" },
|
|
169
|
+
"store": { "minLength": 1, "type": "string" },
|
|
170
|
+
"user": {
|
|
171
|
+
"properties": {
|
|
172
|
+
"id": { "minLength": 1, "type": "string" },
|
|
173
|
+
"origin": { "minLength": 1, "type": "string" },
|
|
174
|
+
"userId": { "minLength": 1, "type": "string" },
|
|
175
|
+
},
|
|
176
|
+
"required": ["origin", "id"],
|
|
177
|
+
"type": "object",
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
"required": ["scope", "contractId", "contractDigest", "store", "user"],
|
|
181
|
+
"type": "object",
|
|
182
|
+
}, {
|
|
183
|
+
"properties": {
|
|
184
|
+
"contractDigest": { "minLength": 1, "type": "string" },
|
|
185
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
186
|
+
"deviceId": { "minLength": 1, "type": "string" },
|
|
187
|
+
"key": { "minLength": 1, "type": "string" },
|
|
188
|
+
"scope": { "const": "deviceApp", "type": "string" },
|
|
189
|
+
"store": { "minLength": 1, "type": "string" },
|
|
190
|
+
},
|
|
191
|
+
"required": [
|
|
192
|
+
"scope",
|
|
193
|
+
"contractId",
|
|
194
|
+
"contractDigest",
|
|
195
|
+
"store",
|
|
196
|
+
"deviceId",
|
|
197
|
+
],
|
|
198
|
+
"type": "object",
|
|
199
|
+
}],
|
|
200
|
+
},
|
|
201
|
+
"StateAdminGetResponse": {
|
|
202
|
+
"anyOf": [{
|
|
203
|
+
"properties": { "found": { "const": false, "type": "boolean" } },
|
|
204
|
+
"required": ["found"],
|
|
205
|
+
"type": "object",
|
|
206
|
+
}, {
|
|
207
|
+
"properties": {
|
|
208
|
+
"entry": {
|
|
209
|
+
"properties": {
|
|
210
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
211
|
+
"key": { "minLength": 1, "type": "string" },
|
|
212
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
213
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
214
|
+
"value": {},
|
|
215
|
+
},
|
|
216
|
+
"required": ["value", "revision", "updatedAt"],
|
|
217
|
+
"type": "object",
|
|
218
|
+
},
|
|
219
|
+
"found": { "const": true, "type": "boolean" },
|
|
220
|
+
},
|
|
221
|
+
"required": ["found", "entry"],
|
|
222
|
+
"type": "object",
|
|
223
|
+
}, {
|
|
224
|
+
"properties": {
|
|
225
|
+
"currentStateVersion": { "minLength": 1, "type": "string" },
|
|
226
|
+
"entry": {
|
|
227
|
+
"properties": {
|
|
228
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
229
|
+
"key": { "minLength": 1, "type": "string" },
|
|
230
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
231
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
232
|
+
"value": {},
|
|
233
|
+
},
|
|
234
|
+
"required": ["value", "revision", "updatedAt"],
|
|
235
|
+
"type": "object",
|
|
236
|
+
},
|
|
237
|
+
"migrationRequired": { "const": true, "type": "boolean" },
|
|
238
|
+
"stateVersion": { "minLength": 1, "type": "string" },
|
|
239
|
+
"writerContractDigest": { "minLength": 1, "type": "string" },
|
|
240
|
+
},
|
|
241
|
+
"required": [
|
|
242
|
+
"migrationRequired",
|
|
243
|
+
"entry",
|
|
244
|
+
"stateVersion",
|
|
245
|
+
"currentStateVersion",
|
|
246
|
+
"writerContractDigest",
|
|
247
|
+
],
|
|
248
|
+
"type": "object",
|
|
249
|
+
}],
|
|
250
|
+
},
|
|
251
|
+
"StateAdminListRequest": {
|
|
252
|
+
"anyOf": [{
|
|
253
|
+
"properties": {
|
|
254
|
+
"contractDigest": { "minLength": 1, "type": "string" },
|
|
255
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
256
|
+
"limit": { "minimum": 0, "type": "integer" },
|
|
257
|
+
"offset": { "minimum": 0, "type": "integer" },
|
|
258
|
+
"prefix": { "minLength": 1, "type": "string" },
|
|
259
|
+
"scope": { "const": "userApp", "type": "string" },
|
|
260
|
+
"store": { "minLength": 1, "type": "string" },
|
|
261
|
+
"user": {
|
|
262
|
+
"properties": {
|
|
263
|
+
"id": { "minLength": 1, "type": "string" },
|
|
264
|
+
"origin": { "minLength": 1, "type": "string" },
|
|
265
|
+
"userId": { "minLength": 1, "type": "string" },
|
|
266
|
+
},
|
|
267
|
+
"required": ["origin", "id"],
|
|
268
|
+
"type": "object",
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
"required": [
|
|
272
|
+
"limit",
|
|
273
|
+
"scope",
|
|
274
|
+
"contractId",
|
|
275
|
+
"contractDigest",
|
|
276
|
+
"store",
|
|
277
|
+
"user",
|
|
278
|
+
],
|
|
279
|
+
"type": "object",
|
|
280
|
+
}, {
|
|
281
|
+
"properties": {
|
|
282
|
+
"contractDigest": { "minLength": 1, "type": "string" },
|
|
283
|
+
"contractId": { "minLength": 1, "type": "string" },
|
|
284
|
+
"deviceId": { "minLength": 1, "type": "string" },
|
|
285
|
+
"limit": { "minimum": 0, "type": "integer" },
|
|
286
|
+
"offset": { "minimum": 0, "type": "integer" },
|
|
287
|
+
"prefix": { "minLength": 1, "type": "string" },
|
|
288
|
+
"scope": { "const": "deviceApp", "type": "string" },
|
|
289
|
+
"store": { "minLength": 1, "type": "string" },
|
|
290
|
+
},
|
|
291
|
+
"required": [
|
|
292
|
+
"limit",
|
|
293
|
+
"scope",
|
|
294
|
+
"contractId",
|
|
295
|
+
"contractDigest",
|
|
296
|
+
"store",
|
|
297
|
+
"deviceId",
|
|
298
|
+
],
|
|
299
|
+
"type": "object",
|
|
300
|
+
}],
|
|
301
|
+
},
|
|
302
|
+
"StateAdminListResponse": {
|
|
303
|
+
"properties": {
|
|
304
|
+
"count": { "minimum": 0, "type": "integer" },
|
|
305
|
+
"entries": {
|
|
306
|
+
"default": [],
|
|
307
|
+
"items": {
|
|
308
|
+
"anyOf": [{
|
|
309
|
+
"properties": {
|
|
310
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
311
|
+
"key": { "minLength": 1, "type": "string" },
|
|
312
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
313
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
314
|
+
"value": {},
|
|
315
|
+
},
|
|
316
|
+
"required": ["value", "revision", "updatedAt"],
|
|
317
|
+
"type": "object",
|
|
318
|
+
}, {
|
|
319
|
+
"properties": {
|
|
320
|
+
"currentStateVersion": { "minLength": 1, "type": "string" },
|
|
321
|
+
"entry": {
|
|
322
|
+
"properties": {
|
|
323
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
324
|
+
"key": { "minLength": 1, "type": "string" },
|
|
325
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
326
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
327
|
+
"value": {},
|
|
328
|
+
},
|
|
329
|
+
"required": ["value", "revision", "updatedAt"],
|
|
330
|
+
"type": "object",
|
|
331
|
+
},
|
|
332
|
+
"migrationRequired": { "const": true, "type": "boolean" },
|
|
333
|
+
"stateVersion": { "minLength": 1, "type": "string" },
|
|
334
|
+
"writerContractDigest": { "minLength": 1, "type": "string" },
|
|
335
|
+
},
|
|
336
|
+
"required": [
|
|
337
|
+
"migrationRequired",
|
|
338
|
+
"entry",
|
|
339
|
+
"stateVersion",
|
|
340
|
+
"currentStateVersion",
|
|
341
|
+
"writerContractDigest",
|
|
342
|
+
],
|
|
343
|
+
"type": "object",
|
|
344
|
+
}],
|
|
345
|
+
},
|
|
346
|
+
"type": "array",
|
|
347
|
+
},
|
|
348
|
+
"limit": { "minimum": 0, "type": "integer" },
|
|
349
|
+
"nextOffset": { "minimum": 0, "type": "integer" },
|
|
350
|
+
"offset": { "minimum": 0, "type": "integer" },
|
|
351
|
+
},
|
|
352
|
+
"required": ["entries", "count", "offset", "limit"],
|
|
353
|
+
"type": "object",
|
|
354
|
+
},
|
|
355
|
+
"StateDeleteRequest": {
|
|
356
|
+
"properties": {
|
|
357
|
+
"expectedRevision": { "minLength": 1, "type": "string" },
|
|
358
|
+
"key": { "minLength": 1, "type": "string" },
|
|
359
|
+
"store": { "minLength": 1, "type": "string" },
|
|
360
|
+
},
|
|
361
|
+
"required": ["store"],
|
|
362
|
+
"type": "object",
|
|
363
|
+
},
|
|
364
|
+
"StateDeleteResponse": {
|
|
365
|
+
"properties": { "deleted": { "type": "boolean" } },
|
|
366
|
+
"required": ["deleted"],
|
|
367
|
+
"type": "object",
|
|
368
|
+
},
|
|
369
|
+
"StateEntry": {
|
|
370
|
+
"properties": {
|
|
371
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
372
|
+
"key": { "minLength": 1, "type": "string" },
|
|
373
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
374
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
375
|
+
"value": {},
|
|
376
|
+
},
|
|
377
|
+
"required": ["value", "revision", "updatedAt"],
|
|
378
|
+
"type": "object",
|
|
379
|
+
},
|
|
380
|
+
"StateGetRequest": {
|
|
381
|
+
"properties": {
|
|
382
|
+
"key": { "minLength": 1, "type": "string" },
|
|
383
|
+
"store": { "minLength": 1, "type": "string" },
|
|
384
|
+
},
|
|
385
|
+
"required": ["store"],
|
|
386
|
+
"type": "object",
|
|
387
|
+
},
|
|
388
|
+
"StateGetResponse": {
|
|
389
|
+
"anyOf": [{
|
|
390
|
+
"properties": { "found": { "const": false, "type": "boolean" } },
|
|
391
|
+
"required": ["found"],
|
|
392
|
+
"type": "object",
|
|
393
|
+
}, {
|
|
394
|
+
"properties": {
|
|
395
|
+
"entry": {
|
|
396
|
+
"properties": {
|
|
397
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
398
|
+
"key": { "minLength": 1, "type": "string" },
|
|
399
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
400
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
401
|
+
"value": {},
|
|
402
|
+
},
|
|
403
|
+
"required": ["value", "revision", "updatedAt"],
|
|
404
|
+
"type": "object",
|
|
405
|
+
},
|
|
406
|
+
"found": { "const": true, "type": "boolean" },
|
|
407
|
+
},
|
|
408
|
+
"required": ["found", "entry"],
|
|
409
|
+
"type": "object",
|
|
410
|
+
}, {
|
|
411
|
+
"properties": {
|
|
412
|
+
"currentStateVersion": { "minLength": 1, "type": "string" },
|
|
413
|
+
"entry": {
|
|
414
|
+
"properties": {
|
|
415
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
416
|
+
"key": { "minLength": 1, "type": "string" },
|
|
417
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
418
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
419
|
+
"value": {},
|
|
420
|
+
},
|
|
421
|
+
"required": ["value", "revision", "updatedAt"],
|
|
422
|
+
"type": "object",
|
|
423
|
+
},
|
|
424
|
+
"migrationRequired": { "const": true, "type": "boolean" },
|
|
425
|
+
"stateVersion": { "minLength": 1, "type": "string" },
|
|
426
|
+
"writerContractDigest": { "minLength": 1, "type": "string" },
|
|
427
|
+
},
|
|
428
|
+
"required": [
|
|
429
|
+
"migrationRequired",
|
|
430
|
+
"entry",
|
|
431
|
+
"stateVersion",
|
|
432
|
+
"currentStateVersion",
|
|
433
|
+
"writerContractDigest",
|
|
434
|
+
],
|
|
435
|
+
"type": "object",
|
|
436
|
+
}],
|
|
437
|
+
},
|
|
438
|
+
"StateListRequest": {
|
|
439
|
+
"properties": {
|
|
440
|
+
"limit": { "minimum": 0, "type": "integer" },
|
|
441
|
+
"offset": { "minimum": 0, "type": "integer" },
|
|
442
|
+
"prefix": { "minLength": 1, "type": "string" },
|
|
443
|
+
"store": { "minLength": 1, "type": "string" },
|
|
444
|
+
},
|
|
445
|
+
"required": ["limit", "store"],
|
|
446
|
+
"type": "object",
|
|
447
|
+
},
|
|
448
|
+
"StateListResponse": {
|
|
449
|
+
"properties": {
|
|
450
|
+
"count": { "minimum": 0, "type": "integer" },
|
|
451
|
+
"entries": {
|
|
452
|
+
"default": [],
|
|
453
|
+
"items": {
|
|
454
|
+
"anyOf": [{
|
|
455
|
+
"properties": {
|
|
456
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
457
|
+
"key": { "minLength": 1, "type": "string" },
|
|
458
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
459
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
460
|
+
"value": {},
|
|
461
|
+
},
|
|
462
|
+
"required": ["value", "revision", "updatedAt"],
|
|
463
|
+
"type": "object",
|
|
464
|
+
}, {
|
|
465
|
+
"properties": {
|
|
466
|
+
"currentStateVersion": { "minLength": 1, "type": "string" },
|
|
467
|
+
"entry": {
|
|
468
|
+
"properties": {
|
|
469
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
470
|
+
"key": { "minLength": 1, "type": "string" },
|
|
471
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
472
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
473
|
+
"value": {},
|
|
474
|
+
},
|
|
475
|
+
"required": ["value", "revision", "updatedAt"],
|
|
476
|
+
"type": "object",
|
|
477
|
+
},
|
|
478
|
+
"migrationRequired": { "const": true, "type": "boolean" },
|
|
479
|
+
"stateVersion": { "minLength": 1, "type": "string" },
|
|
480
|
+
"writerContractDigest": { "minLength": 1, "type": "string" },
|
|
481
|
+
},
|
|
482
|
+
"required": [
|
|
483
|
+
"migrationRequired",
|
|
484
|
+
"entry",
|
|
485
|
+
"stateVersion",
|
|
486
|
+
"currentStateVersion",
|
|
487
|
+
"writerContractDigest",
|
|
488
|
+
],
|
|
489
|
+
"type": "object",
|
|
490
|
+
}],
|
|
491
|
+
},
|
|
492
|
+
"type": "array",
|
|
493
|
+
},
|
|
494
|
+
"limit": { "minimum": 0, "type": "integer" },
|
|
495
|
+
"nextOffset": { "minimum": 0, "type": "integer" },
|
|
496
|
+
"offset": { "minimum": 0, "type": "integer" },
|
|
497
|
+
},
|
|
498
|
+
"required": ["entries", "count", "offset", "limit"],
|
|
499
|
+
"type": "object",
|
|
500
|
+
},
|
|
501
|
+
"StateMigrationRequired": {
|
|
502
|
+
"properties": {
|
|
503
|
+
"currentStateVersion": { "minLength": 1, "type": "string" },
|
|
504
|
+
"entry": {
|
|
505
|
+
"properties": {
|
|
506
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
507
|
+
"key": { "minLength": 1, "type": "string" },
|
|
508
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
509
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
510
|
+
"value": {},
|
|
511
|
+
},
|
|
512
|
+
"required": ["value", "revision", "updatedAt"],
|
|
513
|
+
"type": "object",
|
|
514
|
+
},
|
|
515
|
+
"migrationRequired": { "const": true, "type": "boolean" },
|
|
516
|
+
"stateVersion": { "minLength": 1, "type": "string" },
|
|
517
|
+
"writerContractDigest": { "minLength": 1, "type": "string" },
|
|
518
|
+
},
|
|
519
|
+
"required": [
|
|
520
|
+
"migrationRequired",
|
|
521
|
+
"entry",
|
|
522
|
+
"stateVersion",
|
|
523
|
+
"currentStateVersion",
|
|
524
|
+
"writerContractDigest",
|
|
525
|
+
],
|
|
526
|
+
"type": "object",
|
|
527
|
+
},
|
|
528
|
+
"StatePutRequest": {
|
|
529
|
+
"properties": {
|
|
530
|
+
"expectedRevision": {
|
|
531
|
+
"anyOf": [{ "minLength": 1, "type": "string" }, { "type": "null" }],
|
|
532
|
+
},
|
|
533
|
+
"key": { "minLength": 1, "type": "string" },
|
|
534
|
+
"store": { "minLength": 1, "type": "string" },
|
|
535
|
+
"ttlMs": { "minimum": 1, "type": "integer" },
|
|
536
|
+
"value": {},
|
|
537
|
+
},
|
|
538
|
+
"required": ["store", "value"],
|
|
539
|
+
"type": "object",
|
|
540
|
+
},
|
|
541
|
+
"StatePutResponse": {
|
|
542
|
+
"anyOf": [{
|
|
543
|
+
"properties": {
|
|
544
|
+
"applied": { "const": true, "type": "boolean" },
|
|
545
|
+
"entry": {
|
|
546
|
+
"properties": {
|
|
547
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
548
|
+
"key": { "minLength": 1, "type": "string" },
|
|
549
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
550
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
551
|
+
"value": {},
|
|
552
|
+
},
|
|
553
|
+
"required": ["value", "revision", "updatedAt"],
|
|
554
|
+
"type": "object",
|
|
555
|
+
},
|
|
556
|
+
},
|
|
557
|
+
"required": ["applied", "entry"],
|
|
558
|
+
"type": "object",
|
|
559
|
+
}, {
|
|
560
|
+
"properties": {
|
|
561
|
+
"applied": { "const": false, "type": "boolean" },
|
|
562
|
+
"entry": {
|
|
563
|
+
"anyOf": [{
|
|
564
|
+
"properties": {
|
|
565
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
566
|
+
"key": { "minLength": 1, "type": "string" },
|
|
567
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
568
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
569
|
+
"value": {},
|
|
570
|
+
},
|
|
571
|
+
"required": ["value", "revision", "updatedAt"],
|
|
572
|
+
"type": "object",
|
|
573
|
+
}, {
|
|
574
|
+
"properties": {
|
|
575
|
+
"currentStateVersion": { "minLength": 1, "type": "string" },
|
|
576
|
+
"entry": {
|
|
577
|
+
"properties": {
|
|
578
|
+
"expiresAt": { "format": "date-time", "type": "string" },
|
|
579
|
+
"key": { "minLength": 1, "type": "string" },
|
|
580
|
+
"revision": { "minLength": 1, "type": "string" },
|
|
581
|
+
"updatedAt": { "format": "date-time", "type": "string" },
|
|
582
|
+
"value": {},
|
|
583
|
+
},
|
|
584
|
+
"required": ["value", "revision", "updatedAt"],
|
|
585
|
+
"type": "object",
|
|
586
|
+
},
|
|
587
|
+
"migrationRequired": { "const": true, "type": "boolean" },
|
|
588
|
+
"stateVersion": { "minLength": 1, "type": "string" },
|
|
589
|
+
"writerContractDigest": { "minLength": 1, "type": "string" },
|
|
590
|
+
},
|
|
591
|
+
"required": [
|
|
592
|
+
"migrationRequired",
|
|
593
|
+
"entry",
|
|
594
|
+
"stateVersion",
|
|
595
|
+
"currentStateVersion",
|
|
596
|
+
"writerContractDigest",
|
|
597
|
+
],
|
|
598
|
+
"type": "object",
|
|
599
|
+
}],
|
|
600
|
+
},
|
|
601
|
+
"found": { "type": "boolean" },
|
|
602
|
+
},
|
|
603
|
+
"required": ["applied", "found"],
|
|
604
|
+
"type": "object",
|
|
605
|
+
}],
|
|
606
|
+
},
|
|
607
|
+
"StateScope": {
|
|
608
|
+
"anyOf": [{ "const": "userApp", "type": "string" }, {
|
|
609
|
+
"const": "deviceApp",
|
|
610
|
+
"type": "string",
|
|
611
|
+
}],
|
|
612
|
+
},
|
|
613
|
+
"StateUserTarget": {
|
|
614
|
+
"properties": {
|
|
615
|
+
"id": { "minLength": 1, "type": "string" },
|
|
616
|
+
"origin": { "minLength": 1, "type": "string" },
|
|
617
|
+
"userId": { "minLength": 1, "type": "string" },
|
|
618
|
+
},
|
|
619
|
+
"required": ["origin", "id"],
|
|
620
|
+
"type": "object",
|
|
621
|
+
},
|
|
622
|
+
},
|
|
623
|
+
"uses": {
|
|
624
|
+
"required": {
|
|
625
|
+
"health": {
|
|
626
|
+
"contract": "trellis.health@v1",
|
|
627
|
+
"events": { "publish": ["Health.Heartbeat"] },
|
|
628
|
+
},
|
|
629
|
+
},
|
|
630
|
+
},
|
|
631
|
+
};
|
|
9
632
|
function assertSelectedKeysExist(kind, keys, api) {
|
|
10
633
|
if (!keys) {
|
|
11
634
|
return;
|
|
@@ -28,27 +651,35 @@ exports.sdk = {
|
|
|
28
651
|
CONTRACT_DIGEST: exports.CONTRACT_DIGEST,
|
|
29
652
|
CONTRACT: exports.CONTRACT,
|
|
30
653
|
API: api_js_1.API,
|
|
31
|
-
use: (
|
|
654
|
+
use: (spec) => {
|
|
32
655
|
assertValidUseSpec(spec);
|
|
33
656
|
const dependencyUse = {
|
|
34
657
|
contract: exports.CONTRACT_ID,
|
|
35
658
|
...(spec.rpc?.call ? { rpc: { call: [...spec.rpc.call] } } : {}),
|
|
36
|
-
...(spec.operations?.call
|
|
659
|
+
...(spec.operations?.call
|
|
660
|
+
? { operations: { call: [...spec.operations.call] } }
|
|
661
|
+
: {}),
|
|
37
662
|
...((spec.events?.publish || spec.events?.subscribe)
|
|
38
663
|
? {
|
|
39
664
|
events: {
|
|
40
|
-
...(spec.events.publish
|
|
41
|
-
|
|
665
|
+
...(spec.events.publish
|
|
666
|
+
? { publish: [...spec.events.publish] }
|
|
667
|
+
: {}),
|
|
668
|
+
...(spec.events.subscribe
|
|
669
|
+
? { subscribe: [...spec.events.subscribe] }
|
|
670
|
+
: {}),
|
|
42
671
|
},
|
|
43
672
|
}
|
|
44
673
|
: {}),
|
|
45
|
-
...(spec.feeds?.subscribe
|
|
674
|
+
...(spec.feeds?.subscribe
|
|
675
|
+
? { feeds: { subscribe: [...spec.feeds.subscribe] } }
|
|
676
|
+
: {}),
|
|
46
677
|
};
|
|
47
678
|
Object.defineProperty(dependencyUse, CONTRACT_MODULE_METADATA, {
|
|
48
679
|
value: exports.sdk,
|
|
49
680
|
enumerable: false,
|
|
50
681
|
});
|
|
51
682
|
return dependencyUse;
|
|
52
|
-
}
|
|
683
|
+
},
|
|
53
684
|
};
|
|
54
685
|
exports.use = exports.sdk.use;
|