@qlever-llc/trellis 0.6.1 → 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.
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
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,mBAA6B,CAAC;AACtD,eAAO,MAAM,eAAe,+CAAyD,CAAC;AAEtF,MAAM,MAAM,uBAAuB,GAAG;IAAE,UAAU,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAAE,CAAC;AAChF,MAAM,MAAM,wBAAwB,GAAG;IAAE,OAAO,CAAC,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE;YAAE,IAAI,CAAC,EAAE;gBAAE,S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,oBAAoB,CAAC;KAAE,CAAC;IACjF,sBAAsB,EAAE;QAAE,KAAK,EAAE,uBAAuB,CAAC;QAAC,MAAM,EAAE,wBAAwB,CAAC;KAAE,CAAC;CAC/F;AAED,MAAM,WAAW,QAAQ;CACxB;AAED,MAAM,WAAW,UAAU;CAC1B"}
@@ -1,3 +1,3 @@
1
1
  // Generated from ./generated/contracts/manifests/trellis.core@v1.json
2
2
  export const CONTRACT_ID = "trellis.core@v1";
3
- export const CONTRACT_DIGEST = "0gojWnRrvQQZ1RsFoXCIR-N08bh9Sqpud3p8zeRHs8o";
3
+ export const CONTRACT_DIGEST = "CYttbIsb0NRRBaNzpPRn9E6aT2Dj1RIECmMFNZL0fic";
@@ -0,0 +1,12 @@
1
+ declare global {
2
+ interface Object {
3
+ /**
4
+ * Determines whether an object has a property with the specified name.
5
+ * @param o An object.
6
+ * @param v A property name.
7
+ */
8
+ hasOwn(o: object, v: PropertyKey): boolean;
9
+ }
10
+ }
11
+ export {};
12
+ //# sourceMappingURL=_dnt.polyfills.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAeA,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd;;;;WAIG;QACH,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC;KAC5C;CACF;AAED,OAAO,EAAE,CAAC"}
@@ -0,0 +1,15 @@
1
+ // https://github.com/tc39/proposal-accessible-object-hasownproperty/blob/main/polyfill.js
2
+ if (!Object.hasOwn) {
3
+ Object.defineProperty(Object, "hasOwn", {
4
+ value: function (object, property) {
5
+ if (object == null) {
6
+ throw new TypeError("Cannot convert undefined or null to object");
7
+ }
8
+ return Object.prototype.hasOwnProperty.call(Object(object), property);
9
+ },
10
+ configurable: true,
11
+ enumerable: false,
12
+ writable: true,
13
+ });
14
+ }
15
+ export {};
@@ -0,0 +1,10 @@
1
+ export declare const OWNED_API: TrellisAPI;
2
+ export declare const API: {
3
+ readonly owned: TrellisAPI;
4
+ readonly used: TrellisAPI;
5
+ readonly trellis: TrellisAPI;
6
+ };
7
+ export type OwnedApi = typeof API.owned;
8
+ export type Api = typeof API.trellis;
9
+ export type ApiViews = typeof API;
10
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,SAAS,YAiEA,CAAC;AAIvB,eAAO,MAAM,GAAG;;;;CAIN,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC,KAAK,CAAC;AACxC,MAAM,MAAM,GAAG,GAAG,OAAO,GAAG,CAAC,OAAO,CAAC;AACrC,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { schema } from "../../../contracts/mod.js";
2
+ import { SCHEMAS } from "./schemas.js";
3
+ export const OWNED_API = {
4
+ rpc: {
5
+ "State.Admin.Delete": {
6
+ subject: "rpc.v1.State.Admin.Delete",
7
+ input: schema(SCHEMAS.rpc["State.Admin.Delete"].input),
8
+ output: schema(SCHEMAS.rpc["State.Admin.Delete"].output),
9
+ callerCapabilities: ["admin"],
10
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
11
+ },
12
+ "State.Admin.Get": {
13
+ subject: "rpc.v1.State.Admin.Get",
14
+ input: schema(SCHEMAS.rpc["State.Admin.Get"].input),
15
+ output: schema(SCHEMAS.rpc["State.Admin.Get"].output),
16
+ callerCapabilities: ["admin"],
17
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
18
+ },
19
+ "State.Admin.List": {
20
+ subject: "rpc.v1.State.Admin.List",
21
+ input: schema(SCHEMAS.rpc["State.Admin.List"].input),
22
+ output: schema(SCHEMAS.rpc["State.Admin.List"].output),
23
+ callerCapabilities: ["admin"],
24
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
25
+ },
26
+ "State.CompareAndSet": {
27
+ subject: "rpc.v1.State.CompareAndSet",
28
+ input: schema(SCHEMAS.rpc["State.CompareAndSet"].input),
29
+ output: schema(SCHEMAS.rpc["State.CompareAndSet"].output),
30
+ callerCapabilities: [],
31
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
32
+ },
33
+ "State.Delete": {
34
+ subject: "rpc.v1.State.Delete",
35
+ input: schema(SCHEMAS.rpc["State.Delete"].input),
36
+ output: schema(SCHEMAS.rpc["State.Delete"].output),
37
+ callerCapabilities: [],
38
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
39
+ },
40
+ "State.Get": {
41
+ subject: "rpc.v1.State.Get",
42
+ input: schema(SCHEMAS.rpc["State.Get"].input),
43
+ output: schema(SCHEMAS.rpc["State.Get"].output),
44
+ callerCapabilities: [],
45
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
46
+ },
47
+ "State.List": {
48
+ subject: "rpc.v1.State.List",
49
+ input: schema(SCHEMAS.rpc["State.List"].input),
50
+ output: schema(SCHEMAS.rpc["State.List"].output),
51
+ callerCapabilities: [],
52
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
53
+ },
54
+ "State.Put": {
55
+ subject: "rpc.v1.State.Put",
56
+ input: schema(SCHEMAS.rpc["State.Put"].input),
57
+ output: schema(SCHEMAS.rpc["State.Put"].output),
58
+ callerCapabilities: [],
59
+ errors: ["AuthError", "ValidationError", "UnexpectedError"],
60
+ },
61
+ },
62
+ operations: {},
63
+ events: {},
64
+ subjects: {},
65
+ };
66
+ const EMPTY_API = { rpc: {}, operations: {}, events: {}, subjects: {} };
67
+ export const API = {
68
+ owned: OWNED_API,
69
+ used: EMPTY_API,
70
+ trellis: OWNED_API,
71
+ };
@@ -0,0 +1,8 @@
1
+ import type { SdkContractModule, TrellisContractV1 } from "../../../contracts/mod.js";
2
+ import { API } from "./api.js";
3
+ export declare const CONTRACT_ID: "trellis.state@v1";
4
+ export declare const CONTRACT_DIGEST: "LP8W0VuB24C0lzYO-s_J1c3xMf35qnvX491K27Ww4lU";
5
+ export declare const CONTRACT: TrellisContractV1;
6
+ export declare const state: SdkContractModule<typeof CONTRACT_ID, typeof API.owned>;
7
+ export declare const use: any;
8
+ //# sourceMappingURL=contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,iBAAiB,EAAW,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAI/B,eAAO,MAAM,WAAW,oBAA8B,CAAC;AACvD,eAAO,MAAM,eAAe,+CAAyD,CAAC;AACtF,eAAO,MAAM,QAAQ,EAAkiW,iBAAiB,CAAC;AA2BzkW,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,OAAO,WAAW,EAAE,OAAO,GAAG,CAAC,KAAK,CAqCzE,CAAC;AAEF,eAAO,MAAM,GAAG,KAAY,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { API } from "./api.js";
2
+ const CONTRACT_MODULE_METADATA = Symbol.for("../../../contracts/mod.js/contract-module");
3
+ export const CONTRACT_ID = "trellis.state@v1";
4
+ export const CONTRACT_DIGEST = "LP8W0VuB24C0lzYO-s_J1c3xMf35qnvX491K27Ww4lU";
5
+ export const CONTRACT = { "description": "Trellis-managed app state for authenticated app and device participants.", "displayName": "Trellis State", "format": "trellis.contract.v1", "id": "trellis.state@v1", "kind": "service", "rpc": { "State.Admin.Delete": { "capabilities": { "call": ["admin"] }, "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StateAdminDeleteRequest" }, "output": { "schema": "StateAdminDeleteResponse" }, "subject": "rpc.v1.State.Admin.Delete", "version": "v1" }, "State.Admin.Get": { "capabilities": { "call": ["admin"] }, "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StateAdminGetRequest" }, "output": { "schema": "StateAdminGetResponse" }, "subject": "rpc.v1.State.Admin.Get", "version": "v1" }, "State.Admin.List": { "capabilities": { "call": ["admin"] }, "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StateAdminListRequest" }, "output": { "schema": "StateAdminListResponse" }, "subject": "rpc.v1.State.Admin.List", "version": "v1" }, "State.CompareAndSet": { "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StateCompareAndSetRequest" }, "output": { "schema": "StateCompareAndSetResponse" }, "subject": "rpc.v1.State.CompareAndSet", "version": "v1" }, "State.Delete": { "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StateDeleteRequest" }, "output": { "schema": "StateDeleteResponse" }, "subject": "rpc.v1.State.Delete", "version": "v1" }, "State.Get": { "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StateGetRequest" }, "output": { "schema": "StateGetResponse" }, "subject": "rpc.v1.State.Get", "version": "v1" }, "State.List": { "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StateListRequest" }, "output": { "schema": "StateListResponse" }, "subject": "rpc.v1.State.List", "version": "v1" }, "State.Put": { "errors": [{ "type": "AuthError" }, { "type": "ValidationError" }, { "type": "UnexpectedError" }], "input": { "schema": "StatePutRequest" }, "output": { "schema": "StatePutResponse" }, "subject": "rpc.v1.State.Put", "version": "v1" } }, "schemas": { "JsonValue": {}, "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" }] }, "StateAdminDeleteResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" }, "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" }] }, "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" }] }, "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" }] }] }, "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" }] }, "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" }, "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" }] }, "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" }, "StateDeleteResponse": { "additionalProperties": false, "properties": { "deleted": { "type": "boolean" } }, "required": ["deleted"], "type": "object" }, "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" }, "StateGetRequest": { "additionalProperties": false, "properties": { "key": { "minLength": 1, "type": "string" }, "scope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] } }, "required": ["scope", "key"], "type": "object" }, "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" }] }, "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" }] }, "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" }] }, "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" }, "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" }, "StateScope": { "anyOf": [{ "const": "userApp", "type": "string" }, { "const": "deviceApp", "type": "string" }] }, "StateUserTarget": { "additionalProperties": false, "properties": { "id": { "minLength": 1, "type": "string" }, "origin": { "minLength": 1, "type": "string" } }, "required": ["origin", "id"], "type": "object" } } };
6
+ function assertSelectedKeysExist(kind, keys, api) {
7
+ if (!keys) {
8
+ return;
9
+ }
10
+ for (const key of keys) {
11
+ if (!Object.hasOwn(api, key)) {
12
+ throw new Error(`Contract '${CONTRACT_ID}' does not expose ${kind} key '${key}'`);
13
+ }
14
+ }
15
+ }
16
+ function assertValidUseSpec(spec) {
17
+ assertSelectedKeysExist("rpc", spec.rpc?.call, API.owned.rpc);
18
+ assertSelectedKeysExist("operations", spec.operations?.call, API.owned.operations);
19
+ assertSelectedKeysExist("events", spec.events?.publish, API.owned.events);
20
+ assertSelectedKeysExist("events", spec.events?.subscribe, API.owned.events);
21
+ assertSelectedKeysExist("subjects", spec.subjects?.publish, API.owned.subjects);
22
+ assertSelectedKeysExist("subjects", spec.subjects?.subscribe, API.owned.subjects);
23
+ }
24
+ export const state = {
25
+ CONTRACT_ID,
26
+ CONTRACT_DIGEST,
27
+ CONTRACT,
28
+ API,
29
+ use: ((spec) => {
30
+ assertValidUseSpec(spec);
31
+ const dependencyUse = {
32
+ contract: CONTRACT_ID,
33
+ ...(spec.rpc?.call ? { rpc: { call: [...spec.rpc.call] } } : {}),
34
+ ...(spec.operations?.call ? { operations: { call: [...spec.operations.call] } } : {}),
35
+ ...((spec.events?.publish || spec.events?.subscribe)
36
+ ? {
37
+ events: {
38
+ ...(spec.events.publish ? { publish: [...spec.events.publish] } : {}),
39
+ ...(spec.events.subscribe ? { subscribe: [...spec.events.subscribe] } : {}),
40
+ },
41
+ }
42
+ : {}),
43
+ ...((spec.subjects?.publish || spec.subjects?.subscribe)
44
+ ? {
45
+ subjects: {
46
+ ...(spec.subjects.publish ? { publish: [...spec.subjects.publish] } : {}),
47
+ ...(spec.subjects.subscribe ? { subscribe: [...spec.subjects.subscribe] } : {}),
48
+ },
49
+ }
50
+ : {}),
51
+ };
52
+ Object.defineProperty(dependencyUse, CONTRACT_MODULE_METADATA, {
53
+ value: state,
54
+ enumerable: false,
55
+ });
56
+ return dependencyUse;
57
+ }),
58
+ };
59
+ export const use = state.use;
@@ -0,0 +1,7 @@
1
+ import "./_dnt.polyfills.js";
2
+ export { API, OWNED_API } from "./api.js";
3
+ export type { Api, ApiViews, OwnedApi } from "./api.js";
4
+ export * from "./types.js";
5
+ export { SCHEMAS } from "./schemas.js";
6
+ export { CONTRACT, CONTRACT_DIGEST, CONTRACT_ID, use, state } from "./contract.js";
7
+ //# sourceMappingURL=mod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../src/mod.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,YAAY,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,WAAW,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1,5 @@
1
+ import "./_dnt.polyfills.js";
2
+ export { API, OWNED_API } from "./api.js";
3
+ export * from "./types.js";
4
+ export { SCHEMAS } from "./schemas.js";
5
+ export { CONTRACT, CONTRACT_DIGEST, CONTRACT_ID, use, state } from "./contract.js";
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }