@qlever-llc/trellis 0.6.1 → 0.7.0-rc.3

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.
Files changed (244) hide show
  1. package/README.md +6 -2
  2. package/esm/auth/device_activation.d.ts +194 -0
  3. package/esm/auth/device_activation.d.ts.map +1 -0
  4. package/esm/auth/{workload_activation.js → device_activation.js} +85 -60
  5. package/esm/auth/mod.d.ts +2 -2
  6. package/esm/auth/mod.d.ts.map +1 -1
  7. package/esm/auth/mod.js +2 -2
  8. package/esm/auth/protocol.d.ts +175 -72
  9. package/esm/auth/protocol.d.ts.map +1 -1
  10. package/esm/auth/protocol.js +126 -78
  11. package/esm/contracts/mod.d.ts +19 -3
  12. package/esm/contracts/mod.d.ts.map +1 -1
  13. package/esm/contracts/mod.js +28 -4
  14. package/esm/contracts/protocol.d.ts +34 -0
  15. package/esm/contracts/protocol.d.ts.map +1 -1
  16. package/esm/contracts/protocol.js +15 -0
  17. package/esm/server/deno.d.ts +1 -6
  18. package/esm/server/deno.d.ts.map +1 -1
  19. package/esm/server/deno.js +1 -16
  20. package/esm/server/mod.d.ts +3 -2
  21. package/esm/server/mod.d.ts.map +1 -1
  22. package/esm/server/mod.js +2 -2
  23. package/esm/server/node.d.ts +1 -6
  24. package/esm/server/node.d.ts.map +1 -1
  25. package/esm/server/node.js +1 -16
  26. package/esm/server/service.d.ts +32 -10
  27. package/esm/server/service.d.ts.map +1 -1
  28. package/esm/server/service.js +188 -41
  29. package/esm/server/transfer.d.ts +41 -0
  30. package/esm/server/transfer.d.ts.map +1 -0
  31. package/esm/server/transfer.js +418 -0
  32. package/esm/telemetry/init.d.ts +4 -0
  33. package/esm/telemetry/init.d.ts.map +1 -0
  34. package/esm/telemetry/init.js +7 -0
  35. package/esm/telemetry/mod.d.ts +1 -2
  36. package/esm/telemetry/mod.d.ts.map +1 -1
  37. package/esm/telemetry/mod.js +1 -2
  38. package/esm/telemetry/runtime.d.ts.map +1 -1
  39. package/esm/telemetry/runtime.js +9 -5
  40. package/esm/telemetry/trellis.d.ts +0 -1
  41. package/esm/telemetry/trellis.d.ts.map +1 -1
  42. package/esm/telemetry/trellis.js +0 -6
  43. package/esm/trellis/_sdk/auth/api.d.ts.map +1 -1
  44. package/esm/trellis/_sdk/auth/api.js +132 -110
  45. package/esm/trellis/_sdk/auth/contract.d.ts +1 -1
  46. package/esm/trellis/_sdk/auth/contract.d.ts.map +1 -1
  47. package/esm/trellis/_sdk/auth/contract.js +2 -2
  48. package/esm/trellis/_sdk/auth/schemas.d.ts +4212 -3069
  49. package/esm/trellis/_sdk/auth/schemas.d.ts.map +1 -1
  50. package/esm/trellis/_sdk/auth/schemas.js +144 -125
  51. package/esm/trellis/_sdk/auth/types.d.ts +417 -267
  52. package/esm/trellis/_sdk/auth/types.d.ts.map +1 -1
  53. package/esm/trellis/_sdk/auth/types.js +1 -1
  54. package/esm/trellis/_sdk/core/contract.d.ts +1 -1
  55. package/esm/trellis/_sdk/core/contract.d.ts.map +1 -1
  56. package/esm/trellis/_sdk/core/contract.js +2 -2
  57. package/esm/trellis/_sdk/core/schemas.d.ts +122 -0
  58. package/esm/trellis/_sdk/core/schemas.d.ts.map +1 -1
  59. package/esm/trellis/_sdk/core/schemas.js +4 -4
  60. package/esm/trellis/_sdk/core/types.d.ts +18 -1
  61. package/esm/trellis/_sdk/core/types.d.ts.map +1 -1
  62. package/esm/trellis/_sdk/core/types.js +1 -1
  63. package/esm/trellis/_sdk/state/_dnt.polyfills.d.ts +12 -0
  64. package/esm/trellis/_sdk/state/_dnt.polyfills.d.ts.map +1 -0
  65. package/esm/trellis/_sdk/state/_dnt.polyfills.js +15 -0
  66. package/esm/trellis/_sdk/state/api.d.ts +10 -0
  67. package/esm/trellis/_sdk/state/api.d.ts.map +1 -0
  68. package/esm/trellis/_sdk/state/api.js +71 -0
  69. package/esm/trellis/_sdk/state/contract.d.ts +8 -0
  70. package/esm/trellis/_sdk/state/contract.d.ts.map +1 -0
  71. package/esm/trellis/_sdk/state/contract.js +59 -0
  72. package/esm/trellis/_sdk/state/mod.d.ts +7 -0
  73. package/esm/trellis/_sdk/state/mod.d.ts.map +1 -0
  74. package/esm/trellis/_sdk/state/mod.js +5 -0
  75. package/esm/trellis/_sdk/state/package.json +3 -0
  76. package/esm/trellis/_sdk/state/schemas.d.ts +1437 -0
  77. package/esm/trellis/_sdk/state/schemas.d.ts.map +1 -0
  78. package/esm/trellis/_sdk/state/schemas.js +62 -0
  79. package/esm/trellis/_sdk/state/types.d.ts +206 -0
  80. package/esm/trellis/_sdk/state/types.d.ts.map +1 -0
  81. package/esm/trellis/_sdk/state/types.js +3 -0
  82. package/esm/trellis/client_connect.d.ts +53 -0
  83. package/esm/trellis/client_connect.d.ts.map +1 -0
  84. package/esm/trellis/client_connect.js +300 -0
  85. package/esm/trellis/contract.d.ts +1 -7
  86. package/esm/trellis/contract.d.ts.map +1 -1
  87. package/esm/trellis/contract.js +1 -12
  88. package/esm/trellis/device.d.ts +41 -0
  89. package/esm/trellis/device.d.ts.map +1 -0
  90. package/esm/trellis/device.js +209 -0
  91. package/esm/trellis/errors/AuthError.d.ts +1 -1
  92. package/esm/trellis/errors/AuthError.js +9 -9
  93. package/esm/trellis/errors/StoreError.d.ts +22 -0
  94. package/esm/trellis/errors/StoreError.d.ts.map +1 -0
  95. package/esm/trellis/errors/StoreError.js +41 -0
  96. package/esm/trellis/errors/TransferError.d.ts +22 -0
  97. package/esm/trellis/errors/TransferError.d.ts.map +1 -0
  98. package/esm/trellis/errors/TransferError.js +41 -0
  99. package/esm/trellis/errors/index.d.ts +8 -0
  100. package/esm/trellis/errors/index.d.ts.map +1 -1
  101. package/esm/trellis/errors/index.js +8 -0
  102. package/esm/trellis/index.d.ts +10 -4
  103. package/esm/trellis/index.d.ts.map +1 -1
  104. package/esm/trellis/index.js +6 -4
  105. package/esm/trellis/kv.d.ts +2 -0
  106. package/esm/trellis/kv.d.ts.map +1 -1
  107. package/esm/trellis/kv.js +6 -0
  108. package/esm/trellis/models/trellis/TrellisError.d.ts +15 -1
  109. package/esm/trellis/models/trellis/TrellisError.d.ts.map +1 -1
  110. package/esm/trellis/models/trellis/TrellisError.js +4 -0
  111. package/esm/trellis/runtime_transport.d.ts +12 -0
  112. package/esm/trellis/runtime_transport.d.ts.map +1 -0
  113. package/esm/trellis/runtime_transport.js +35 -0
  114. package/esm/trellis/sdk/state.d.ts +4 -0
  115. package/esm/trellis/sdk/state.d.ts.map +1 -0
  116. package/esm/trellis/sdk/state.js +3 -0
  117. package/esm/trellis/store.d.ts +51 -0
  118. package/esm/trellis/store.d.ts.map +1 -0
  119. package/esm/trellis/store.js +310 -0
  120. package/esm/trellis/tracing.js +1 -1
  121. package/esm/trellis/transfer.d.ts +118 -0
  122. package/esm/trellis/transfer.d.ts.map +1 -0
  123. package/esm/trellis/transfer.js +357 -0
  124. package/esm/trellis/trellis.d.ts +3 -0
  125. package/esm/trellis/trellis.d.ts.map +1 -1
  126. package/esm/trellis/trellis.js +48 -17
  127. package/package.json +7 -2
  128. package/script/auth/device_activation.d.ts +194 -0
  129. package/script/auth/device_activation.d.ts.map +1 -0
  130. package/script/auth/{workload_activation.js → device_activation.js} +99 -74
  131. package/script/auth/mod.d.ts +2 -2
  132. package/script/auth/mod.d.ts.map +1 -1
  133. package/script/auth/mod.js +84 -76
  134. package/script/auth/protocol.d.ts +175 -72
  135. package/script/auth/protocol.d.ts.map +1 -1
  136. package/script/auth/protocol.js +129 -81
  137. package/script/contracts/mod.d.ts +19 -3
  138. package/script/contracts/mod.d.ts.map +1 -1
  139. package/script/contracts/mod.js +30 -4
  140. package/script/contracts/protocol.d.ts +34 -0
  141. package/script/contracts/protocol.d.ts.map +1 -1
  142. package/script/contracts/protocol.js +16 -1
  143. package/script/telemetry/init.d.ts +4 -0
  144. package/script/telemetry/init.d.ts.map +1 -0
  145. package/script/telemetry/init.js +11 -0
  146. package/script/telemetry/mod.d.ts +1 -2
  147. package/script/telemetry/mod.d.ts.map +1 -1
  148. package/script/telemetry/mod.js +1 -4
  149. package/script/telemetry/runtime.d.ts.map +1 -1
  150. package/script/telemetry/runtime.js +9 -28
  151. package/script/telemetry/trellis.d.ts +0 -1
  152. package/script/telemetry/trellis.d.ts.map +1 -1
  153. package/script/telemetry/trellis.js +0 -7
  154. package/script/trellis/_sdk/auth/api.d.ts.map +1 -1
  155. package/script/trellis/_sdk/auth/api.js +132 -110
  156. package/script/trellis/_sdk/auth/contract.d.ts +1 -1
  157. package/script/trellis/_sdk/auth/contract.d.ts.map +1 -1
  158. package/script/trellis/_sdk/auth/contract.js +2 -2
  159. package/script/trellis/_sdk/auth/schemas.d.ts +4212 -3069
  160. package/script/trellis/_sdk/auth/schemas.d.ts.map +1 -1
  161. package/script/trellis/_sdk/auth/schemas.js +144 -125
  162. package/script/trellis/_sdk/auth/types.d.ts +417 -267
  163. package/script/trellis/_sdk/auth/types.d.ts.map +1 -1
  164. package/script/trellis/_sdk/auth/types.js +1 -1
  165. package/script/trellis/_sdk/core/contract.d.ts +1 -1
  166. package/script/trellis/_sdk/core/contract.d.ts.map +1 -1
  167. package/script/trellis/_sdk/core/contract.js +2 -2
  168. package/script/trellis/_sdk/core/schemas.d.ts +122 -0
  169. package/script/trellis/_sdk/core/schemas.d.ts.map +1 -1
  170. package/script/trellis/_sdk/core/schemas.js +4 -4
  171. package/script/trellis/_sdk/core/types.d.ts +18 -1
  172. package/script/trellis/_sdk/core/types.d.ts.map +1 -1
  173. package/script/trellis/_sdk/core/types.js +1 -1
  174. package/script/trellis/_sdk/state/_dnt.polyfills.d.ts +12 -0
  175. package/script/trellis/_sdk/state/_dnt.polyfills.d.ts.map +1 -0
  176. package/script/trellis/_sdk/state/_dnt.polyfills.js +16 -0
  177. package/script/trellis/_sdk/state/api.d.ts +10 -0
  178. package/script/trellis/_sdk/state/api.d.ts.map +1 -0
  179. package/script/trellis/_sdk/state/api.js +74 -0
  180. package/script/trellis/_sdk/state/contract.d.ts +8 -0
  181. package/script/trellis/_sdk/state/contract.d.ts.map +1 -0
  182. package/script/trellis/_sdk/state/contract.js +62 -0
  183. package/script/trellis/_sdk/state/mod.d.ts +7 -0
  184. package/script/trellis/_sdk/state/mod.d.ts.map +1 -0
  185. package/script/trellis/_sdk/state/mod.js +30 -0
  186. package/script/trellis/_sdk/state/package.json +3 -0
  187. package/script/trellis/_sdk/state/schemas.d.ts +1437 -0
  188. package/script/trellis/_sdk/state/schemas.d.ts.map +1 -0
  189. package/script/trellis/_sdk/state/schemas.js +65 -0
  190. package/script/trellis/_sdk/state/types.d.ts +206 -0
  191. package/script/trellis/_sdk/state/types.d.ts.map +1 -0
  192. package/script/trellis/_sdk/state/types.js +6 -0
  193. package/script/trellis/client_connect.d.ts +53 -0
  194. package/script/trellis/client_connect.d.ts.map +1 -0
  195. package/script/trellis/client_connect.js +304 -0
  196. package/script/trellis/contract.d.ts +1 -7
  197. package/script/trellis/contract.d.ts.map +1 -1
  198. package/script/trellis/contract.js +1 -12
  199. package/script/trellis/device.d.ts +41 -0
  200. package/script/trellis/device.d.ts.map +1 -0
  201. package/script/trellis/device.js +213 -0
  202. package/script/trellis/errors/AuthError.d.ts +1 -1
  203. package/script/trellis/errors/AuthError.js +9 -9
  204. package/script/trellis/errors/StoreError.d.ts +22 -0
  205. package/script/trellis/errors/StoreError.d.ts.map +1 -0
  206. package/script/trellis/errors/StoreError.js +48 -0
  207. package/script/trellis/errors/TransferError.d.ts +22 -0
  208. package/script/trellis/errors/TransferError.d.ts.map +1 -0
  209. package/script/trellis/errors/TransferError.js +48 -0
  210. package/script/trellis/errors/index.d.ts +8 -0
  211. package/script/trellis/errors/index.d.ts.map +1 -1
  212. package/script/trellis/errors/index.js +13 -1
  213. package/script/trellis/index.d.ts +10 -4
  214. package/script/trellis/index.d.ts.map +1 -1
  215. package/script/trellis/index.js +17 -6
  216. package/script/trellis/kv.d.ts +2 -0
  217. package/script/trellis/kv.d.ts.map +1 -1
  218. package/script/trellis/kv.js +6 -0
  219. package/script/trellis/models/trellis/TrellisError.d.ts +15 -1
  220. package/script/trellis/models/trellis/TrellisError.d.ts.map +1 -1
  221. package/script/trellis/models/trellis/TrellisError.js +4 -0
  222. package/script/trellis/runtime_transport.d.ts +12 -0
  223. package/script/trellis/runtime_transport.d.ts.map +1 -0
  224. package/script/trellis/runtime_transport.js +37 -0
  225. package/script/trellis/store.d.ts +51 -0
  226. package/script/trellis/store.d.ts.map +1 -0
  227. package/script/trellis/store.js +316 -0
  228. package/script/trellis/tracing.js +1 -1
  229. package/script/trellis/transfer.d.ts +118 -0
  230. package/script/trellis/transfer.d.ts.map +1 -0
  231. package/script/trellis/transfer.js +367 -0
  232. package/script/trellis/trellis.d.ts +3 -0
  233. package/script/trellis/trellis.d.ts.map +1 -1
  234. package/script/trellis/trellis.js +48 -17
  235. package/esm/auth/workload_activation.d.ts +0 -192
  236. package/esm/auth/workload_activation.d.ts.map +0 -1
  237. package/esm/trellis/workload.d.ts +0 -45
  238. package/esm/trellis/workload.d.ts.map +0 -1
  239. package/esm/trellis/workload.js +0 -144
  240. package/script/auth/workload_activation.d.ts +0 -192
  241. package/script/auth/workload_activation.d.ts.map +0 -1
  242. package/script/trellis/workload.d.ts +0 -45
  243. package/script/trellis/workload.d.ts.map +0 -1
  244. 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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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+DV,CAAC"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SCHEMAS = void 0;
4
+ // Generated from ./generated/contracts/manifests/trellis.state@v1.json
5
+ exports.SCHEMAS = {
6
+ schemas: {
7
+ "JsonValue": {},
8
+ "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" }] },
9
+ "StateAdminDeleteResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
10
+ "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" }] },
11
+ "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" }] },
12
+ "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" }] }] },
13
+ "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" }] },
14
+ "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" },
15
+ "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" }] },
16
+ "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" },
17
+ "StateDeleteResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
18
+ "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" },
19
+ "StateGetRequest": { "additionalProperties": false, "properties": { "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope", "key"], "type": "object" },
20
+ "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" }] },
21
+ "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" }] },
22
+ "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" }] },
23
+ "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" },
24
+ "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" },
25
+ "StateScope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] },
26
+ "StateUserTarget": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" },
27
+ },
28
+ rpc: {
29
+ "State.Admin.Delete": {
30
+ 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" }] },
31
+ output: { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
32
+ },
33
+ "State.Admin.Get": {
34
+ 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" }] },
35
+ 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" }] },
36
+ },
37
+ "State.Admin.List": {
38
+ 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" }] }] },
39
+ 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" }] },
40
+ },
41
+ "State.CompareAndSet": {
42
+ 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" },
43
+ 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" }] },
44
+ },
45
+ "State.Delete": {
46
+ 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" },
47
+ output: { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" },
48
+ },
49
+ "State.Get": {
50
+ input: { "additionalProperties": false, "properties": { "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope", "key"], "type": "object" },
51
+ 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" }] },
52
+ },
53
+ "State.List": {
54
+ 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" }] },
55
+ 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" }] },
56
+ },
57
+ "State.Put": {
58
+ 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" },
59
+ 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" },
60
+ },
61
+ },
62
+ operations: {},
63
+ events: {},
64
+ subjects: {},
65
+ };
@@ -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,UAAU,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,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,WAAW,CAAC;CAAE,CAAC,CAAC;AAC9M,MAAM,MAAM,mBAAmB,GAAG,CAAC;IAAE,KAAK,EAAE,KAAK,CAAC;CAAE,GAAG;IAAE,KAAK,EAAE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,WAAW,MAAM;IACrB,oBAAoB,EAAE;QAAE,KAAK,EAAE,qBAAqB,CAAC;QAAC,MAAM,EAAE,sBAAsB,CAAC;KAAE,CAAC;IACxF,iBAAiB,EAAE;QAAE,KAAK,EAAE,kBAAkB,CAAC;QAAC,MAAM,EAAE,mBAAmB,CAAC;KAAE,CAAC;IAC/E,kBAAkB,EAAE;QAAE,KAAK,EAAE,mBAAmB,CAAC;QAAC,MAAM,EAAE,oBAAoB,CAAC;KAAE,CAAC;IAClF,qBAAqB,EAAE;QAAE,KAAK,EAAE,uBAAuB,CAAC;QAAC,MAAM,EAAE,wBAAwB,CAAC;KAAE,CAAC;IAC7F,cAAc,EAAE;QAAE,KAAK,EAAE,gBAAgB,CAAC;QAAC,MAAM,EAAE,iBAAiB,CAAC;KAAE,CAAC;IACxE,WAAW,EAAE;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,cAAc,CAAC;KAAE,CAAC;IAC/D,YAAY,EAAE;QAAE,KAAK,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,eAAe,CAAC;KAAE,CAAC;IAClE,WAAW,EAAE;QAAE,KAAK,EAAE,aAAa,CAAC;QAAC,MAAM,EAAE,cAAc,CAAC;KAAE,CAAC;CAChE;AAED,MAAM,WAAW,QAAQ;CACxB;AAED,MAAM,WAAW,UAAU;CAC1B"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CONTRACT_DIGEST = exports.CONTRACT_ID = void 0;
4
+ // Generated from ./generated/contracts/manifests/trellis.state@v1.json
5
+ exports.CONTRACT_ID = "trellis.state@v1";
6
+ exports.CONTRACT_DIGEST = "LP8W0VuB24C0lzYO-s_J1c3xMf35qnvX491K27Ww4lU";
@@ -0,0 +1,53 @@
1
+ import type { ClientOpts } from "./client.ts";
2
+ import type { TrellisAPI, TrellisContractV1 } from "./contracts.ts";
3
+ import { type RuntimeTransport } from "./runtime_transport.ts";
4
+ import { Trellis } from "./trellis.ts";
5
+ import { type SessionKeyHandle } from "../auth/browser/session.ts";
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":["../../../client_connect.ts"],"names":[],"mappings":"AAQA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