@qlever-llc/trellis 0.6.0 → 0.7.0-rc.2
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/README.md +6 -2
- package/esm/auth/device_activation.d.ts +194 -0
- package/esm/auth/device_activation.d.ts.map +1 -0
- package/esm/auth/{workload_activation.js → device_activation.js} +85 -60
- package/esm/auth/mod.d.ts +2 -2
- package/esm/auth/mod.d.ts.map +1 -1
- package/esm/auth/mod.js +2 -2
- package/esm/auth/protocol.d.ts +175 -72
- package/esm/auth/protocol.d.ts.map +1 -1
- package/esm/auth/protocol.js +126 -78
- package/esm/contracts/mod.d.ts +22 -2
- package/esm/contracts/mod.d.ts.map +1 -1
- package/esm/contracts/mod.js +30 -4
- package/esm/contracts/protocol.d.ts +34 -0
- package/esm/contracts/protocol.d.ts.map +1 -1
- package/esm/contracts/protocol.js +15 -0
- package/esm/server/deno.d.ts +1 -6
- package/esm/server/deno.d.ts.map +1 -1
- package/esm/server/deno.js +1 -16
- package/esm/server/mod.d.ts +3 -2
- package/esm/server/mod.d.ts.map +1 -1
- package/esm/server/mod.js +2 -2
- package/esm/server/node.d.ts +1 -6
- package/esm/server/node.d.ts.map +1 -1
- package/esm/server/node.js +1 -16
- package/esm/server/service.d.ts +32 -10
- package/esm/server/service.d.ts.map +1 -1
- package/esm/server/service.js +188 -41
- package/esm/server/transfer.d.ts +41 -0
- package/esm/server/transfer.d.ts.map +1 -0
- package/esm/server/transfer.js +418 -0
- package/esm/telemetry/init.d.ts +4 -0
- package/esm/telemetry/init.d.ts.map +1 -0
- package/esm/telemetry/init.js +7 -0
- package/esm/telemetry/mod.d.ts +1 -2
- package/esm/telemetry/mod.d.ts.map +1 -1
- package/esm/telemetry/mod.js +1 -2
- package/esm/telemetry/runtime.d.ts.map +1 -1
- package/esm/telemetry/runtime.js +9 -5
- package/esm/telemetry/trellis.d.ts +0 -1
- package/esm/telemetry/trellis.d.ts.map +1 -1
- package/esm/telemetry/trellis.js +0 -6
- package/esm/trellis/_sdk/activity/contract.d.ts +1 -1
- package/esm/trellis/_sdk/activity/contract.d.ts.map +1 -1
- package/esm/trellis/_sdk/activity/contract.js +2 -2
- package/esm/trellis/_sdk/activity/types.d.ts +1 -1
- package/esm/trellis/_sdk/activity/types.js +1 -1
- package/esm/trellis/_sdk/auth/api.d.ts.map +1 -1
- package/esm/trellis/_sdk/auth/api.js +132 -110
- package/esm/trellis/_sdk/auth/contract.d.ts +1 -1
- package/esm/trellis/_sdk/auth/contract.d.ts.map +1 -1
- package/esm/trellis/_sdk/auth/contract.js +2 -2
- package/esm/trellis/_sdk/auth/schemas.d.ts +4212 -3069
- package/esm/trellis/_sdk/auth/schemas.d.ts.map +1 -1
- package/esm/trellis/_sdk/auth/schemas.js +144 -125
- package/esm/trellis/_sdk/auth/types.d.ts +417 -267
- package/esm/trellis/_sdk/auth/types.d.ts.map +1 -1
- package/esm/trellis/_sdk/auth/types.js +1 -1
- package/esm/trellis/_sdk/core/contract.d.ts +1 -1
- package/esm/trellis/_sdk/core/contract.d.ts.map +1 -1
- package/esm/trellis/_sdk/core/contract.js +2 -2
- package/esm/trellis/_sdk/core/schemas.d.ts +122 -0
- package/esm/trellis/_sdk/core/schemas.d.ts.map +1 -1
- package/esm/trellis/_sdk/core/schemas.js +4 -4
- package/esm/trellis/_sdk/core/types.d.ts +18 -1
- package/esm/trellis/_sdk/core/types.d.ts.map +1 -1
- package/esm/trellis/_sdk/core/types.js +1 -1
- package/esm/trellis/_sdk/state/_dnt.polyfills.d.ts +12 -0
- package/esm/trellis/_sdk/state/_dnt.polyfills.d.ts.map +1 -0
- package/esm/trellis/_sdk/state/_dnt.polyfills.js +15 -0
- package/esm/trellis/_sdk/state/api.d.ts +10 -0
- package/esm/trellis/_sdk/state/api.d.ts.map +1 -0
- package/esm/trellis/_sdk/state/api.js +71 -0
- package/esm/trellis/_sdk/state/contract.d.ts +8 -0
- package/esm/trellis/_sdk/state/contract.d.ts.map +1 -0
- package/esm/trellis/_sdk/state/contract.js +59 -0
- package/esm/trellis/_sdk/state/mod.d.ts +7 -0
- package/esm/trellis/_sdk/state/mod.d.ts.map +1 -0
- package/esm/trellis/_sdk/state/mod.js +5 -0
- package/esm/trellis/_sdk/state/package.json +3 -0
- package/esm/trellis/_sdk/state/schemas.d.ts +1437 -0
- package/esm/trellis/_sdk/state/schemas.d.ts.map +1 -0
- package/esm/trellis/_sdk/state/schemas.js +62 -0
- package/esm/trellis/_sdk/state/types.d.ts +206 -0
- package/esm/trellis/_sdk/state/types.d.ts.map +1 -0
- package/esm/trellis/_sdk/state/types.js +3 -0
- package/esm/trellis/client_connect.d.ts +53 -0
- package/esm/trellis/client_connect.d.ts.map +1 -0
- package/esm/trellis/client_connect.js +300 -0
- package/esm/trellis/contract.d.ts +1 -7
- package/esm/trellis/contract.d.ts.map +1 -1
- package/esm/trellis/contract.js +1 -12
- package/esm/trellis/device.d.ts +41 -0
- package/esm/trellis/device.d.ts.map +1 -0
- package/esm/trellis/device.js +209 -0
- package/esm/trellis/errors/AuthError.d.ts +1 -1
- package/esm/trellis/errors/AuthError.js +9 -9
- package/esm/trellis/errors/StoreError.d.ts +22 -0
- package/esm/trellis/errors/StoreError.d.ts.map +1 -0
- package/esm/trellis/errors/StoreError.js +41 -0
- package/esm/trellis/errors/TransferError.d.ts +22 -0
- package/esm/trellis/errors/TransferError.d.ts.map +1 -0
- package/esm/trellis/errors/TransferError.js +41 -0
- package/esm/trellis/errors/index.d.ts +8 -0
- package/esm/trellis/errors/index.d.ts.map +1 -1
- package/esm/trellis/errors/index.js +8 -0
- package/esm/trellis/index.d.ts +10 -4
- package/esm/trellis/index.d.ts.map +1 -1
- package/esm/trellis/index.js +6 -4
- package/esm/trellis/kv.d.ts +2 -0
- package/esm/trellis/kv.d.ts.map +1 -1
- package/esm/trellis/kv.js +6 -0
- package/esm/trellis/models/trellis/TrellisError.d.ts +15 -1
- package/esm/trellis/models/trellis/TrellisError.d.ts.map +1 -1
- package/esm/trellis/models/trellis/TrellisError.js +4 -0
- package/esm/trellis/runtime_transport.d.ts +12 -0
- package/esm/trellis/runtime_transport.d.ts.map +1 -0
- package/esm/trellis/runtime_transport.js +35 -0
- package/esm/trellis/sdk/state.d.ts +4 -0
- package/esm/trellis/sdk/state.d.ts.map +1 -0
- package/esm/trellis/sdk/state.js +3 -0
- package/esm/trellis/store.d.ts +51 -0
- package/esm/trellis/store.d.ts.map +1 -0
- package/esm/trellis/store.js +310 -0
- package/esm/trellis/tracing.js +1 -1
- package/esm/trellis/transfer.d.ts +118 -0
- package/esm/trellis/transfer.d.ts.map +1 -0
- package/esm/trellis/transfer.js +357 -0
- package/esm/trellis/trellis.d.ts +3 -0
- package/esm/trellis/trellis.d.ts.map +1 -1
- package/esm/trellis/trellis.js +48 -17
- package/package.json +8 -3
- package/script/auth/device_activation.d.ts +194 -0
- package/script/auth/device_activation.d.ts.map +1 -0
- package/script/auth/{workload_activation.js → device_activation.js} +99 -74
- package/script/auth/mod.d.ts +2 -2
- package/script/auth/mod.d.ts.map +1 -1
- package/script/auth/mod.js +84 -76
- package/script/auth/protocol.d.ts +175 -72
- package/script/auth/protocol.d.ts.map +1 -1
- package/script/auth/protocol.js +129 -81
- package/script/contracts/mod.d.ts +22 -2
- package/script/contracts/mod.d.ts.map +1 -1
- package/script/contracts/mod.js +32 -4
- package/script/contracts/protocol.d.ts +34 -0
- package/script/contracts/protocol.d.ts.map +1 -1
- package/script/contracts/protocol.js +16 -1
- package/script/telemetry/init.d.ts +4 -0
- package/script/telemetry/init.d.ts.map +1 -0
- package/script/telemetry/init.js +11 -0
- package/script/telemetry/mod.d.ts +1 -2
- package/script/telemetry/mod.d.ts.map +1 -1
- package/script/telemetry/mod.js +1 -4
- package/script/telemetry/runtime.d.ts.map +1 -1
- package/script/telemetry/runtime.js +9 -28
- package/script/telemetry/trellis.d.ts +0 -1
- package/script/telemetry/trellis.d.ts.map +1 -1
- package/script/telemetry/trellis.js +0 -7
- package/script/trellis/_sdk/activity/contract.d.ts +1 -1
- package/script/trellis/_sdk/activity/contract.d.ts.map +1 -1
- package/script/trellis/_sdk/activity/contract.js +2 -2
- package/script/trellis/_sdk/activity/types.d.ts +1 -1
- package/script/trellis/_sdk/activity/types.js +1 -1
- package/script/trellis/_sdk/auth/api.d.ts.map +1 -1
- package/script/trellis/_sdk/auth/api.js +132 -110
- package/script/trellis/_sdk/auth/contract.d.ts +1 -1
- package/script/trellis/_sdk/auth/contract.d.ts.map +1 -1
- package/script/trellis/_sdk/auth/contract.js +2 -2
- package/script/trellis/_sdk/auth/schemas.d.ts +4212 -3069
- package/script/trellis/_sdk/auth/schemas.d.ts.map +1 -1
- package/script/trellis/_sdk/auth/schemas.js +144 -125
- package/script/trellis/_sdk/auth/types.d.ts +417 -267
- package/script/trellis/_sdk/auth/types.d.ts.map +1 -1
- package/script/trellis/_sdk/auth/types.js +1 -1
- package/script/trellis/_sdk/core/contract.d.ts +1 -1
- package/script/trellis/_sdk/core/contract.d.ts.map +1 -1
- package/script/trellis/_sdk/core/contract.js +2 -2
- package/script/trellis/_sdk/core/schemas.d.ts +122 -0
- package/script/trellis/_sdk/core/schemas.d.ts.map +1 -1
- package/script/trellis/_sdk/core/schemas.js +4 -4
- package/script/trellis/_sdk/core/types.d.ts +18 -1
- package/script/trellis/_sdk/core/types.d.ts.map +1 -1
- package/script/trellis/_sdk/core/types.js +1 -1
- package/script/trellis/_sdk/state/_dnt.polyfills.d.ts +12 -0
- package/script/trellis/_sdk/state/_dnt.polyfills.d.ts.map +1 -0
- package/script/trellis/_sdk/state/_dnt.polyfills.js +16 -0
- package/script/trellis/_sdk/state/api.d.ts +10 -0
- package/script/trellis/_sdk/state/api.d.ts.map +1 -0
- package/script/trellis/_sdk/state/api.js +74 -0
- package/script/trellis/_sdk/state/contract.d.ts +8 -0
- package/script/trellis/_sdk/state/contract.d.ts.map +1 -0
- package/script/trellis/_sdk/state/contract.js +62 -0
- package/script/trellis/_sdk/state/mod.d.ts +7 -0
- package/script/trellis/_sdk/state/mod.d.ts.map +1 -0
- package/script/trellis/_sdk/state/mod.js +30 -0
- package/script/trellis/_sdk/state/package.json +3 -0
- package/script/trellis/_sdk/state/schemas.d.ts +1437 -0
- package/script/trellis/_sdk/state/schemas.d.ts.map +1 -0
- package/script/trellis/_sdk/state/schemas.js +65 -0
- package/script/trellis/_sdk/state/types.d.ts +206 -0
- package/script/trellis/_sdk/state/types.d.ts.map +1 -0
- package/script/trellis/_sdk/state/types.js +6 -0
- package/script/trellis/client_connect.d.ts +53 -0
- package/script/trellis/client_connect.d.ts.map +1 -0
- package/script/trellis/client_connect.js +304 -0
- package/script/trellis/contract.d.ts +1 -7
- package/script/trellis/contract.d.ts.map +1 -1
- package/script/trellis/contract.js +1 -12
- package/script/trellis/device.d.ts +41 -0
- package/script/trellis/device.d.ts.map +1 -0
- package/script/trellis/device.js +213 -0
- package/script/trellis/errors/AuthError.d.ts +1 -1
- package/script/trellis/errors/AuthError.js +9 -9
- package/script/trellis/errors/StoreError.d.ts +22 -0
- package/script/trellis/errors/StoreError.d.ts.map +1 -0
- package/script/trellis/errors/StoreError.js +48 -0
- package/script/trellis/errors/TransferError.d.ts +22 -0
- package/script/trellis/errors/TransferError.d.ts.map +1 -0
- package/script/trellis/errors/TransferError.js +48 -0
- package/script/trellis/errors/index.d.ts +8 -0
- package/script/trellis/errors/index.d.ts.map +1 -1
- package/script/trellis/errors/index.js +13 -1
- package/script/trellis/index.d.ts +10 -4
- package/script/trellis/index.d.ts.map +1 -1
- package/script/trellis/index.js +17 -6
- package/script/trellis/kv.d.ts +2 -0
- package/script/trellis/kv.d.ts.map +1 -1
- package/script/trellis/kv.js +6 -0
- package/script/trellis/models/trellis/TrellisError.d.ts +15 -1
- package/script/trellis/models/trellis/TrellisError.d.ts.map +1 -1
- package/script/trellis/models/trellis/TrellisError.js +4 -0
- package/script/trellis/runtime_transport.d.ts +12 -0
- package/script/trellis/runtime_transport.d.ts.map +1 -0
- package/script/trellis/runtime_transport.js +37 -0
- package/script/trellis/store.d.ts +51 -0
- package/script/trellis/store.d.ts.map +1 -0
- package/script/trellis/store.js +316 -0
- package/script/trellis/tracing.js +1 -1
- package/script/trellis/transfer.d.ts +118 -0
- package/script/trellis/transfer.d.ts.map +1 -0
- package/script/trellis/transfer.js +367 -0
- package/script/trellis/trellis.d.ts +3 -0
- package/script/trellis/trellis.d.ts.map +1 -1
- package/script/trellis/trellis.js +48 -17
- package/esm/auth/workload_activation.d.ts +0 -192
- package/esm/auth/workload_activation.d.ts.map +0 -1
- package/esm/trellis/workload.d.ts +0 -45
- package/esm/trellis/workload.d.ts.map +0 -1
- package/esm/trellis/workload.js +0 -144
- package/script/auth/workload_activation.d.ts +0 -192
- package/script/auth/workload_activation.d.ts.map +0 -1
- package/script/trellis/workload.d.ts +0 -45
- package/script/trellis/workload.d.ts.map +0 -1
- package/script/trellis/workload.js +0 -172
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ifests/trellis.state@v1.json
|
|
2
|
+
export const SCHEMAS = {
|
|
3
|
+
schemas: {
|
|
4
|
+
"JsonValue": {},
|
|
5
|
+
"StateAdminDeleteRequest": { "anyOf": [{ "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "expectedRevision": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "user": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "user", "key"], "type": "object" }, { "additionalProperties": false, "properties": { "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" } }, "required": ["scope", "contractId", "deviceId", "key"], "type": "object" }] },
|
|
6
|
+
"StateAdminDeleteResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
|
|
7
|
+
"StateAdminGetRequest": { "anyOf": [{ "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "user": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "user", "key"], "type": "object" }, { "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "deviceId": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "deviceApp", "type": "string" } }, "required": ["scope", "contractId", "deviceId", "key"], "type": "object" }] },
|
|
8
|
+
"StateAdminGetResponse": { "anyOf": [{ "additionalProperties": false, "properties": { "found": { "const": false, "type": "boolean" } }, "required": ["found"], "type": "object" }, { "additionalProperties": false, "properties": { "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "found": { "const": true, "type": "boolean" } }, "required": ["found", "entry"], "type": "object" }] },
|
|
9
|
+
"StateAdminListRequest": { "allOf": [{ "properties": { "limit": { "default": 10, "minimum": 0, "type": "integer" }, "offset": { "default": 0, "minimum": 0, "type": "integer" } }, "required": ["offset", "limit"], "type": "object" }, { "anyOf": [{ "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "prefix": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "user": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "user"], "type": "object" }, { "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "deviceId": { "minLength": 1, "type": "string" }, "prefix": { "minLength": 1, "type": "string" }, "scope": { "const": "deviceApp", "type": "string" } }, "required": ["scope", "contractId", "deviceId"], "type": "object" }] }] },
|
|
10
|
+
"StateAdminListResponse": { "allOf": [{ "properties": { "count": { "minimum": 0, "type": "integer" }, "limit": { "minimum": 0, "type": "integer" }, "next": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "prev": { "minimum": 0, "type": "integer" } }, "required": ["count", "offset", "limit"], "type": "object" }, { "additionalProperties": false, "properties": { "entries": { "default": [], "items": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "type": "array" } }, "required": ["entries"], "type": "object" }] },
|
|
11
|
+
"StateCompareAndSetRequest": { "additionalProperties": false, "properties": { "expectedRevision": { "anyOf": [{ "minLength": 1, "type": "string" }, { "type": "null" }] }, "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] }, "ttlMs": { "minimum": 1, "type": "integer" }, "value": {} }, "required": ["scope", "key", "expectedRevision", "value"], "type": "object" },
|
|
12
|
+
"StateCompareAndSetResponse": { "anyOf": [{ "additionalProperties": false, "properties": { "applied": { "const": true, "type": "boolean" }, "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" } }, "required": ["applied", "entry"], "type": "object" }, { "additionalProperties": false, "properties": { "applied": { "const": false, "type": "boolean" }, "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "found": { "type": "boolean" } }, "required": ["applied", "found"], "type": "object" }] },
|
|
13
|
+
"StateDeleteRequest": { "additionalProperties": false, "properties": { "expectedRevision": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope", "key"], "type": "object" },
|
|
14
|
+
"StateDeleteResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
|
|
15
|
+
"StateEntry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" },
|
|
16
|
+
"StateGetRequest": { "additionalProperties": false, "properties": { "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope", "key"], "type": "object" },
|
|
17
|
+
"StateGetResponse": { "anyOf": [{ "additionalProperties": false, "properties": { "found": { "const": false, "type": "boolean" } }, "required": ["found"], "type": "object" }, { "additionalProperties": false, "properties": { "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "found": { "const": true, "type": "boolean" } }, "required": ["found", "entry"], "type": "object" }] },
|
|
18
|
+
"StateListRequest": { "allOf": [{ "properties": { "limit": { "default": 10, "minimum": 0, "type": "integer" }, "offset": { "default": 0, "minimum": 0, "type": "integer" } }, "required": ["offset", "limit"], "type": "object" }, { "additionalProperties": false, "properties": { "prefix": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope"], "type": "object" }] },
|
|
19
|
+
"StateListResponse": { "allOf": [{ "properties": { "count": { "minimum": 0, "type": "integer" }, "limit": { "minimum": 0, "type": "integer" }, "next": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "prev": { "minimum": 0, "type": "integer" } }, "required": ["count", "offset", "limit"], "type": "object" }, { "additionalProperties": false, "properties": { "entries": { "default": [], "items": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "type": "array" } }, "required": ["entries"], "type": "object" }] },
|
|
20
|
+
"StatePutRequest": { "additionalProperties": false, "properties": { "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] }, "ttlMs": { "minimum": 1, "type": "integer" }, "value": {} }, "required": ["scope", "key", "value"], "type": "object" },
|
|
21
|
+
"StatePutResponse": { "additionalProperties": false, "properties": { "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" } }, "required": ["entry"], "type": "object" },
|
|
22
|
+
"StateScope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] },
|
|
23
|
+
"StateUserTarget": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" },
|
|
24
|
+
},
|
|
25
|
+
rpc: {
|
|
26
|
+
"State.Admin.Delete": {
|
|
27
|
+
input: { "anyOf": [{ "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "expectedRevision": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "user": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "user", "key"], "type": "object" }, { "additionalProperties": false, "properties": { "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" } }, "required": ["scope", "contractId", "deviceId", "key"], "type": "object" }] },
|
|
28
|
+
output: { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
|
|
29
|
+
},
|
|
30
|
+
"State.Admin.Get": {
|
|
31
|
+
input: { "anyOf": [{ "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "user": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "user", "key"], "type": "object" }, { "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "deviceId": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "const": "deviceApp", "type": "string" } }, "required": ["scope", "contractId", "deviceId", "key"], "type": "object" }] },
|
|
32
|
+
output: { "anyOf": [{ "additionalProperties": false, "properties": { "found": { "const": false, "type": "boolean" } }, "required": ["found"], "type": "object" }, { "additionalProperties": false, "properties": { "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "found": { "const": true, "type": "boolean" } }, "required": ["found", "entry"], "type": "object" }] },
|
|
33
|
+
},
|
|
34
|
+
"State.Admin.List": {
|
|
35
|
+
input: { "allOf": [{ "properties": { "limit": { "default": 10, "minimum": 0, "type": "integer" }, "offset": { "default": 0, "minimum": 0, "type": "integer" } }, "required": ["offset", "limit"], "type": "object" }, { "anyOf": [{ "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "prefix": { "minLength": 1, "type": "string" }, "scope": { "const": "userApp", "type": "string" }, "user": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } }, "required": ["scope", "contractId", "user"], "type": "object" }, { "additionalProperties": false, "properties": { "contractId": { "minLength": 1, "type": "string" }, "deviceId": { "minLength": 1, "type": "string" }, "prefix": { "minLength": 1, "type": "string" }, "scope": { "const": "deviceApp", "type": "string" } }, "required": ["scope", "contractId", "deviceId"], "type": "object" }] }] },
|
|
36
|
+
output: { "allOf": [{ "properties": { "count": { "minimum": 0, "type": "integer" }, "limit": { "minimum": 0, "type": "integer" }, "next": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "prev": { "minimum": 0, "type": "integer" } }, "required": ["count", "offset", "limit"], "type": "object" }, { "additionalProperties": false, "properties": { "entries": { "default": [], "items": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "type": "array" } }, "required": ["entries"], "type": "object" }] },
|
|
37
|
+
},
|
|
38
|
+
"State.CompareAndSet": {
|
|
39
|
+
input: { "additionalProperties": false, "properties": { "expectedRevision": { "anyOf": [{ "minLength": 1, "type": "string" }, { "type": "null" }] }, "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] }, "ttlMs": { "minimum": 1, "type": "integer" }, "value": {} }, "required": ["scope", "key", "expectedRevision", "value"], "type": "object" },
|
|
40
|
+
output: { "anyOf": [{ "additionalProperties": false, "properties": { "applied": { "const": true, "type": "boolean" }, "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" } }, "required": ["applied", "entry"], "type": "object" }, { "additionalProperties": false, "properties": { "applied": { "const": false, "type": "boolean" }, "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "found": { "type": "boolean" } }, "required": ["applied", "found"], "type": "object" }] },
|
|
41
|
+
},
|
|
42
|
+
"State.Delete": {
|
|
43
|
+
input: { "additionalProperties": false, "properties": { "expectedRevision": { "minLength": 1, "type": "string" }, "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope", "key"], "type": "object" },
|
|
44
|
+
output: { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
|
|
45
|
+
},
|
|
46
|
+
"State.Get": {
|
|
47
|
+
input: { "additionalProperties": false, "properties": { "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope", "key"], "type": "object" },
|
|
48
|
+
output: { "anyOf": [{ "additionalProperties": false, "properties": { "found": { "const": false, "type": "boolean" } }, "required": ["found"], "type": "object" }, { "additionalProperties": false, "properties": { "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "found": { "const": true, "type": "boolean" } }, "required": ["found", "entry"], "type": "object" }] },
|
|
49
|
+
},
|
|
50
|
+
"State.List": {
|
|
51
|
+
input: { "allOf": [{ "properties": { "limit": { "default": 10, "minimum": 0, "type": "integer" }, "offset": { "default": 0, "minimum": 0, "type": "integer" } }, "required": ["offset", "limit"], "type": "object" }, { "additionalProperties": false, "properties": { "prefix": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope"], "type": "object" }] },
|
|
52
|
+
output: { "allOf": [{ "properties": { "count": { "minimum": 0, "type": "integer" }, "limit": { "minimum": 0, "type": "integer" }, "next": { "minimum": 0, "type": "integer" }, "offset": { "minimum": 0, "type": "integer" }, "prev": { "minimum": 0, "type": "integer" } }, "required": ["count", "offset", "limit"], "type": "object" }, { "additionalProperties": false, "properties": { "entries": { "default": [], "items": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" }, "type": "array" } }, "required": ["entries"], "type": "object" }] },
|
|
53
|
+
},
|
|
54
|
+
"State.Put": {
|
|
55
|
+
input: { "additionalProperties": false, "properties": { "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] }, "ttlMs": { "minimum": 1, "type": "integer" }, "value": {} }, "required": ["scope", "key", "value"], "type": "object" },
|
|
56
|
+
output: { "additionalProperties": false, "properties": { "entry": { "additionalProperties": false, "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": ["key", "value", "revision", "updatedAt"], "type": "object" } }, "required": ["entry"], "type": "object" },
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
operations: {},
|
|
60
|
+
events: {},
|
|
61
|
+
subjects: {},
|
|
62
|
+
};
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
export declare const CONTRACT_ID: "trellis.state@v1";
|
|
2
|
+
export declare const CONTRACT_DIGEST: "LP8W0VuB24C0lzYO-s_J1c3xMf35qnvX491K27Ww4lU";
|
|
3
|
+
export type StateAdminDeleteInput = ({
|
|
4
|
+
contractId: string;
|
|
5
|
+
expectedRevision?: string;
|
|
6
|
+
key: string;
|
|
7
|
+
scope: "userApp";
|
|
8
|
+
user: {
|
|
9
|
+
id: string;
|
|
10
|
+
origin: string;
|
|
11
|
+
};
|
|
12
|
+
} | {
|
|
13
|
+
contractId: string;
|
|
14
|
+
deviceId: string;
|
|
15
|
+
expectedRevision?: string;
|
|
16
|
+
key: string;
|
|
17
|
+
scope: "deviceApp";
|
|
18
|
+
});
|
|
19
|
+
export type StateAdminDeleteOutput = {
|
|
20
|
+
deleted: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type StateAdminGetInput = ({
|
|
23
|
+
contractId: string;
|
|
24
|
+
key: string;
|
|
25
|
+
scope: "userApp";
|
|
26
|
+
user: {
|
|
27
|
+
id: string;
|
|
28
|
+
origin: string;
|
|
29
|
+
};
|
|
30
|
+
} | {
|
|
31
|
+
contractId: string;
|
|
32
|
+
deviceId: string;
|
|
33
|
+
key: string;
|
|
34
|
+
scope: "deviceApp";
|
|
35
|
+
});
|
|
36
|
+
export type StateAdminGetOutput = ({
|
|
37
|
+
found: false;
|
|
38
|
+
} | {
|
|
39
|
+
entry: {
|
|
40
|
+
expiresAt?: string;
|
|
41
|
+
key: string;
|
|
42
|
+
revision: string;
|
|
43
|
+
updatedAt: string;
|
|
44
|
+
value: unknown;
|
|
45
|
+
};
|
|
46
|
+
found: true;
|
|
47
|
+
});
|
|
48
|
+
export type StateAdminListInput = ({
|
|
49
|
+
limit: number;
|
|
50
|
+
offset: number;
|
|
51
|
+
} & ({
|
|
52
|
+
contractId: string;
|
|
53
|
+
prefix?: string;
|
|
54
|
+
scope: "userApp";
|
|
55
|
+
user: {
|
|
56
|
+
id: string;
|
|
57
|
+
origin: string;
|
|
58
|
+
};
|
|
59
|
+
} | {
|
|
60
|
+
contractId: string;
|
|
61
|
+
deviceId: string;
|
|
62
|
+
prefix?: string;
|
|
63
|
+
scope: "deviceApp";
|
|
64
|
+
}));
|
|
65
|
+
export type StateAdminListOutput = ({
|
|
66
|
+
count: number;
|
|
67
|
+
limit: number;
|
|
68
|
+
next?: number;
|
|
69
|
+
offset: number;
|
|
70
|
+
prev?: number;
|
|
71
|
+
} & {
|
|
72
|
+
entries: Array<{
|
|
73
|
+
expiresAt?: string;
|
|
74
|
+
key: string;
|
|
75
|
+
revision: string;
|
|
76
|
+
updatedAt: string;
|
|
77
|
+
value: unknown;
|
|
78
|
+
}>;
|
|
79
|
+
});
|
|
80
|
+
export type StateCompareAndSetInput = {
|
|
81
|
+
expectedRevision: (string | null);
|
|
82
|
+
key: string;
|
|
83
|
+
scope: ("userApp" | "deviceApp");
|
|
84
|
+
ttlMs?: number;
|
|
85
|
+
value: unknown;
|
|
86
|
+
};
|
|
87
|
+
export type StateCompareAndSetOutput = ({
|
|
88
|
+
applied: true;
|
|
89
|
+
entry: {
|
|
90
|
+
expiresAt?: string;
|
|
91
|
+
key: string;
|
|
92
|
+
revision: string;
|
|
93
|
+
updatedAt: string;
|
|
94
|
+
value: unknown;
|
|
95
|
+
};
|
|
96
|
+
} | {
|
|
97
|
+
applied: false;
|
|
98
|
+
entry?: {
|
|
99
|
+
expiresAt?: string;
|
|
100
|
+
key: string;
|
|
101
|
+
revision: string;
|
|
102
|
+
updatedAt: string;
|
|
103
|
+
value: unknown;
|
|
104
|
+
};
|
|
105
|
+
found: boolean;
|
|
106
|
+
});
|
|
107
|
+
export type StateDeleteInput = {
|
|
108
|
+
expectedRevision?: string;
|
|
109
|
+
key: string;
|
|
110
|
+
scope: ("userApp" | "deviceApp");
|
|
111
|
+
};
|
|
112
|
+
export type StateDeleteOutput = {
|
|
113
|
+
deleted: boolean;
|
|
114
|
+
};
|
|
115
|
+
export type StateGetInput = {
|
|
116
|
+
key: string;
|
|
117
|
+
scope: ("userApp" | "deviceApp");
|
|
118
|
+
};
|
|
119
|
+
export type StateGetOutput = ({
|
|
120
|
+
found: false;
|
|
121
|
+
} | {
|
|
122
|
+
entry: {
|
|
123
|
+
expiresAt?: string;
|
|
124
|
+
key: string;
|
|
125
|
+
revision: string;
|
|
126
|
+
updatedAt: string;
|
|
127
|
+
value: unknown;
|
|
128
|
+
};
|
|
129
|
+
found: true;
|
|
130
|
+
});
|
|
131
|
+
export type StateListInput = ({
|
|
132
|
+
limit: number;
|
|
133
|
+
offset: number;
|
|
134
|
+
} & {
|
|
135
|
+
prefix?: string;
|
|
136
|
+
scope: ("userApp" | "deviceApp");
|
|
137
|
+
});
|
|
138
|
+
export type StateListOutput = ({
|
|
139
|
+
count: number;
|
|
140
|
+
limit: number;
|
|
141
|
+
next?: number;
|
|
142
|
+
offset: number;
|
|
143
|
+
prev?: number;
|
|
144
|
+
} & {
|
|
145
|
+
entries: Array<{
|
|
146
|
+
expiresAt?: string;
|
|
147
|
+
key: string;
|
|
148
|
+
revision: string;
|
|
149
|
+
updatedAt: string;
|
|
150
|
+
value: unknown;
|
|
151
|
+
}>;
|
|
152
|
+
});
|
|
153
|
+
export type StatePutInput = {
|
|
154
|
+
key: string;
|
|
155
|
+
scope: ("userApp" | "deviceApp");
|
|
156
|
+
ttlMs?: number;
|
|
157
|
+
value: unknown;
|
|
158
|
+
};
|
|
159
|
+
export type StatePutOutput = {
|
|
160
|
+
entry: {
|
|
161
|
+
expiresAt?: string;
|
|
162
|
+
key: string;
|
|
163
|
+
revision: string;
|
|
164
|
+
updatedAt: string;
|
|
165
|
+
value: unknown;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
export interface RpcMap {
|
|
169
|
+
"State.Admin.Delete": {
|
|
170
|
+
input: StateAdminDeleteInput;
|
|
171
|
+
output: StateAdminDeleteOutput;
|
|
172
|
+
};
|
|
173
|
+
"State.Admin.Get": {
|
|
174
|
+
input: StateAdminGetInput;
|
|
175
|
+
output: StateAdminGetOutput;
|
|
176
|
+
};
|
|
177
|
+
"State.Admin.List": {
|
|
178
|
+
input: StateAdminListInput;
|
|
179
|
+
output: StateAdminListOutput;
|
|
180
|
+
};
|
|
181
|
+
"State.CompareAndSet": {
|
|
182
|
+
input: StateCompareAndSetInput;
|
|
183
|
+
output: StateCompareAndSetOutput;
|
|
184
|
+
};
|
|
185
|
+
"State.Delete": {
|
|
186
|
+
input: StateDeleteInput;
|
|
187
|
+
output: StateDeleteOutput;
|
|
188
|
+
};
|
|
189
|
+
"State.Get": {
|
|
190
|
+
input: StateGetInput;
|
|
191
|
+
output: StateGetOutput;
|
|
192
|
+
};
|
|
193
|
+
"State.List": {
|
|
194
|
+
input: StateListInput;
|
|
195
|
+
output: StateListOutput;
|
|
196
|
+
};
|
|
197
|
+
"State.Put": {
|
|
198
|
+
input: StatePutInput;
|
|
199
|
+
output: StatePutOutput;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export interface EventMap {
|
|
203
|
+
}
|
|
204
|
+
export interface SubjectMap {
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,oBAA8B,CAAC;AACvD,eAAO,MAAM,eAAe,+CAAyD,CAAC;AAEtF,MAAM,MAAM,qBAAqB,GAAG,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;KAAE,CAAC;CAAE,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;CAAE,CAAC,CAAC;AACvQ,MAAM,MAAM,sBAAsB,GAAG;IAAE,OAAO,EAAE,OAAO,CAAC;CAAE,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG,CAAC;IAAE,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;AAED,MAAM,WAAW,UAAU;CAC1B"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ClientOpts } from "./client.js";
|
|
2
|
+
import type { TrellisAPI, TrellisContractV1 } from "./contracts.js";
|
|
3
|
+
import { type RuntimeTransport } from "./runtime_transport.js";
|
|
4
|
+
import { Trellis } from "./trellis.js";
|
|
5
|
+
import { type SessionKeyHandle } from "../auth/browser/session.js";
|
|
6
|
+
type ClientContract<TApi extends TrellisAPI = TrellisAPI> = {
|
|
7
|
+
CONTRACT: TrellisContractV1;
|
|
8
|
+
API: {
|
|
9
|
+
trellis: TApi;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
type BrowserClientAuthOptions = {
|
|
13
|
+
mode?: "browser";
|
|
14
|
+
handle?: SessionKeyHandle;
|
|
15
|
+
provider?: string;
|
|
16
|
+
redirectTo?: string;
|
|
17
|
+
landingPath?: string;
|
|
18
|
+
context?: unknown;
|
|
19
|
+
currentUrl?: URL | string;
|
|
20
|
+
};
|
|
21
|
+
type SessionKeyClientAuthOptions = {
|
|
22
|
+
mode: "session_key";
|
|
23
|
+
sessionKeySeed: string;
|
|
24
|
+
provider?: string;
|
|
25
|
+
redirectTo: string;
|
|
26
|
+
context?: unknown;
|
|
27
|
+
flowId?: string;
|
|
28
|
+
};
|
|
29
|
+
export type ClientAuthOptions = BrowserClientAuthOptions | SessionKeyClientAuthOptions;
|
|
30
|
+
export type ClientAuthRequiredContext = {
|
|
31
|
+
loginUrl: string;
|
|
32
|
+
sessionKey: string;
|
|
33
|
+
mode: "browser" | "session_key";
|
|
34
|
+
};
|
|
35
|
+
export type ClientAuthContinuation = {
|
|
36
|
+
flowId: string;
|
|
37
|
+
} | void;
|
|
38
|
+
export type TrellisClientConnectArgs<TApi extends TrellisAPI = TrellisAPI> = ClientOpts & {
|
|
39
|
+
trellisUrl: string;
|
|
40
|
+
contract: ClientContract<TApi>;
|
|
41
|
+
auth?: ClientAuthOptions;
|
|
42
|
+
onAuthRequired?: (ctx: ClientAuthRequiredContext) => Promise<ClientAuthContinuation> | ClientAuthContinuation;
|
|
43
|
+
};
|
|
44
|
+
type ClientConnectDeps = {
|
|
45
|
+
loadTransport(): Promise<RuntimeTransport>;
|
|
46
|
+
now(): number;
|
|
47
|
+
};
|
|
48
|
+
export declare function connectClientWithDeps<TApi extends TrellisAPI>(args: TrellisClientConnectArgs<TApi>, deps: ClientConnectDeps): Promise<Trellis<TApi>>;
|
|
49
|
+
export declare class TrellisClient {
|
|
50
|
+
static connect<TApi extends TrellisAPI>(args: TrellisClientConnectArgs<TApi>): Promise<Trellis<TApi>>;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=client_connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client_connect.d.ts","sourceRoot":"","sources":["../../src/trellis/client_connect.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC,OAAO,EACL,KAAK,gBAAgB,EAKtB,MAAM,4BAA4B,CAAC;AAEpC,KAAK,cAAc,CAAC,IAAI,SAAS,UAAU,GAAG,UAAU,IAAI;IAC1D,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,GAAG,EAAE;QACH,OAAO,EAAE,IAAI,CAAC;KACf,CAAC;CACH,CAAC;AAEF,KAAK,wBAAwB,GAAG;IAC9B,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,C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