@qlever-llc/trellis 0.5.1 → 0.6.0

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 (490) hide show
  1. package/README.md +16 -2
  2. package/esm/_dnt.polyfills.d.ts +11 -0
  3. package/esm/_dnt.polyfills.d.ts.map +1 -1
  4. package/esm/_dnt.polyfills.js +14 -0
  5. package/esm/_dnt.shims.d.ts +6 -0
  6. package/esm/_dnt.shims.d.ts.map +1 -0
  7. package/esm/_dnt.shims.js +61 -0
  8. package/esm/auth/browser/login.d.ts +27 -0
  9. package/esm/auth/browser/login.d.ts.map +1 -0
  10. package/esm/auth/browser/login.js +94 -0
  11. package/esm/auth/browser/portal.d.ts +11 -0
  12. package/esm/auth/browser/portal.d.ts.map +1 -0
  13. package/esm/auth/browser/portal.js +33 -0
  14. package/esm/auth/browser/session.d.ts +19 -0
  15. package/esm/auth/browser/session.d.ts.map +1 -0
  16. package/esm/auth/browser/session.js +65 -0
  17. package/esm/auth/browser/storage.d.ts +12 -0
  18. package/esm/auth/browser/storage.d.ts.map +1 -0
  19. package/esm/auth/browser/storage.js +61 -0
  20. package/esm/auth/browser.d.ts +13 -0
  21. package/esm/auth/browser.d.ts.map +1 -0
  22. package/esm/auth/browser.js +11 -0
  23. package/esm/auth/keys.d.ts +5 -0
  24. package/esm/auth/keys.d.ts.map +1 -0
  25. package/esm/auth/keys.js +50 -0
  26. package/esm/auth/mod.d.ts +18 -0
  27. package/esm/auth/mod.d.ts.map +1 -0
  28. package/esm/auth/mod.js +17 -0
  29. package/esm/auth/proof.d.ts +9 -0
  30. package/esm/auth/proof.d.ts.map +1 -0
  31. package/esm/auth/proof.js +43 -0
  32. package/esm/auth/protocol.d.ts +1212 -0
  33. package/esm/auth/protocol.d.ts.map +1 -0
  34. package/esm/auth/protocol.js +682 -0
  35. package/esm/auth/schemas.d.ts +93 -0
  36. package/esm/auth/schemas.d.ts.map +1 -0
  37. package/esm/auth/schemas.js +64 -0
  38. package/esm/auth/session_auth.d.ts +20 -0
  39. package/esm/auth/session_auth.d.ts.map +1 -0
  40. package/esm/auth/session_auth.js +42 -0
  41. package/esm/auth/trellis_id.d.ts +2 -0
  42. package/esm/auth/trellis_id.d.ts.map +1 -0
  43. package/esm/auth/trellis_id.js +5 -0
  44. package/esm/auth/types.d.ts +8 -0
  45. package/esm/auth/types.d.ts.map +1 -0
  46. package/esm/auth/types.js +1 -0
  47. package/esm/auth/utils.d.ts +11 -0
  48. package/esm/auth/utils.d.ts.map +1 -0
  49. package/esm/auth/utils.js +68 -0
  50. package/esm/auth/workload_activation.d.ts +192 -0
  51. package/esm/auth/workload_activation.d.ts.map +1 -0
  52. package/esm/auth/workload_activation.js +290 -0
  53. package/esm/contracts/canonical.d.ts +14 -0
  54. package/esm/contracts/canonical.d.ts.map +1 -0
  55. package/esm/contracts/canonical.js +135 -0
  56. package/esm/contracts/mod.d.ts +462 -0
  57. package/esm/contracts/mod.d.ts.map +1 -0
  58. package/esm/contracts/mod.js +532 -0
  59. package/esm/contracts/protocol.d.ts +301 -0
  60. package/esm/contracts/protocol.d.ts.map +1 -0
  61. package/esm/contracts/protocol.js +130 -0
  62. package/esm/contracts/runtime.d.ts +48 -0
  63. package/esm/contracts/runtime.d.ts.map +1 -0
  64. package/esm/contracts/runtime.js +9 -0
  65. package/esm/contracts/schema_pointers.d.ts +18 -0
  66. package/esm/contracts/schema_pointers.d.ts.map +1 -0
  67. package/esm/contracts/schema_pointers.js +59 -0
  68. package/esm/server/deno.d.ts +7 -0
  69. package/esm/server/deno.d.ts.map +1 -0
  70. package/esm/server/deno.js +16 -0
  71. package/esm/server/health.d.ts +92 -0
  72. package/esm/server/health.d.ts.map +1 -0
  73. package/esm/server/health.js +74 -0
  74. package/esm/server/health_rpc.d.ts +16 -0
  75. package/esm/server/health_rpc.d.ts.map +1 -0
  76. package/esm/server/health_rpc.js +23 -0
  77. package/esm/server/health_schemas.d.ts +20 -0
  78. package/esm/server/health_schemas.d.ts.map +1 -0
  79. package/esm/server/health_schemas.js +18 -0
  80. package/esm/server/mod.d.ts +17 -0
  81. package/esm/server/mod.d.ts.map +1 -0
  82. package/esm/server/mod.js +17 -0
  83. package/esm/server/node.d.ts +7 -0
  84. package/esm/server/node.d.ts.map +1 -0
  85. package/esm/server/node.js +16 -0
  86. package/esm/server/runtime.d.ts +16 -0
  87. package/esm/server/runtime.d.ts.map +1 -0
  88. package/esm/server/runtime.js +1 -0
  89. package/esm/server/service.d.ts +121 -0
  90. package/esm/server/service.d.ts.map +1 -0
  91. package/esm/server/service.js +256 -0
  92. package/esm/server/subscription.d.ts +99 -0
  93. package/esm/server/subscription.d.ts.map +1 -0
  94. package/esm/server/subscription.js +25 -0
  95. package/esm/telemetry/carrier.d.ts +9 -0
  96. package/esm/telemetry/carrier.d.ts.map +1 -0
  97. package/esm/telemetry/carrier.js +20 -0
  98. package/esm/telemetry/core.d.ts +8 -0
  99. package/esm/telemetry/core.d.ts.map +1 -0
  100. package/esm/telemetry/core.js +14 -0
  101. package/esm/telemetry/env.d.ts +2 -0
  102. package/esm/telemetry/env.d.ts.map +1 -0
  103. package/esm/telemetry/env.js +10 -0
  104. package/esm/telemetry/mod.d.ts +11 -0
  105. package/esm/telemetry/mod.d.ts.map +1 -0
  106. package/esm/telemetry/mod.js +7 -0
  107. package/esm/telemetry/nats.d.ts +7 -0
  108. package/esm/telemetry/nats.d.ts.map +1 -0
  109. package/esm/telemetry/nats.js +6 -0
  110. package/esm/telemetry/result.d.ts +2 -0
  111. package/esm/telemetry/result.d.ts.map +1 -0
  112. package/esm/telemetry/result.js +18 -0
  113. package/esm/telemetry/runtime.d.ts +2 -0
  114. package/esm/telemetry/runtime.d.ts.map +1 -0
  115. package/esm/telemetry/runtime.js +53 -0
  116. package/esm/telemetry/trace.d.ts +5 -0
  117. package/esm/telemetry/trace.d.ts.map +1 -0
  118. package/esm/telemetry/trace.js +26 -0
  119. package/esm/telemetry/trellis.d.ts +3 -0
  120. package/esm/telemetry/trellis.d.ts.map +1 -0
  121. package/esm/telemetry/trellis.js +7 -0
  122. package/esm/trellis/_sdk/activity/_dnt.polyfills.d.ts +12 -0
  123. package/esm/trellis/_sdk/activity/_dnt.polyfills.d.ts.map +1 -0
  124. package/esm/trellis/_sdk/activity/_dnt.polyfills.js +15 -0
  125. package/esm/trellis/_sdk/activity/api.d.ts +10 -0
  126. package/esm/trellis/_sdk/activity/api.d.ts.map +1 -0
  127. package/esm/trellis/_sdk/activity/api.js +43 -0
  128. package/esm/trellis/_sdk/activity/contract.d.ts +8 -0
  129. package/esm/trellis/_sdk/activity/contract.d.ts.map +1 -0
  130. package/esm/trellis/_sdk/activity/contract.js +59 -0
  131. package/esm/trellis/_sdk/activity/mod.d.ts +7 -0
  132. package/esm/trellis/_sdk/activity/mod.d.ts.map +1 -0
  133. package/esm/trellis/_sdk/activity/mod.js +5 -0
  134. package/esm/trellis/_sdk/activity/package.json +3 -0
  135. package/esm/trellis/_sdk/activity/schemas.d.ts +607 -0
  136. package/esm/trellis/_sdk/activity/schemas.d.ts.map +1 -0
  137. package/esm/trellis/_sdk/activity/schemas.js +33 -0
  138. package/esm/trellis/_sdk/activity/types.d.ts +96 -0
  139. package/esm/trellis/_sdk/activity/types.d.ts.map +1 -0
  140. package/esm/trellis/_sdk/activity/types.js +3 -0
  141. package/esm/trellis/_sdk/auth/_dnt.polyfills.d.ts +12 -0
  142. package/esm/trellis/_sdk/auth/_dnt.polyfills.d.ts.map +1 -0
  143. package/esm/trellis/_sdk/auth/_dnt.polyfills.js +15 -0
  144. package/esm/trellis/_sdk/auth/api.d.ts +10 -0
  145. package/esm/trellis/_sdk/auth/api.d.ts.map +1 -0
  146. package/esm/trellis/_sdk/auth/api.js +354 -0
  147. package/esm/trellis/_sdk/auth/contract.d.ts +28 -0
  148. package/esm/trellis/_sdk/auth/contract.d.ts.map +1 -0
  149. package/esm/trellis/_sdk/auth/contract.js +83 -0
  150. package/esm/trellis/_sdk/auth/mod.d.ts +7 -0
  151. package/esm/trellis/_sdk/auth/mod.d.ts.map +1 -0
  152. package/esm/trellis/_sdk/auth/mod.js +5 -0
  153. package/esm/trellis/_sdk/auth/package.json +3 -0
  154. package/esm/trellis/_sdk/auth/schemas.d.ts +8967 -0
  155. package/esm/trellis/_sdk/auth/schemas.d.ts.map +1 -0
  156. package/esm/trellis/_sdk/auth/schemas.js +306 -0
  157. package/esm/trellis/_sdk/auth/types.d.ts +1232 -0
  158. package/esm/trellis/_sdk/auth/types.d.ts.map +1 -0
  159. package/esm/trellis/_sdk/auth/types.js +3 -0
  160. package/esm/trellis/_sdk/core/_dnt.polyfills.d.ts +12 -0
  161. package/esm/trellis/_sdk/core/_dnt.polyfills.d.ts.map +1 -0
  162. package/esm/trellis/_sdk/core/_dnt.polyfills.js +15 -0
  163. package/esm/trellis/_sdk/core/api.d.ts +10 -0
  164. package/esm/trellis/_sdk/core/api.d.ts.map +1 -0
  165. package/esm/trellis/_sdk/core/api.js +36 -0
  166. package/esm/trellis/_sdk/core/contract.d.ts +8 -0
  167. package/esm/trellis/_sdk/core/contract.d.ts.map +1 -0
  168. package/esm/trellis/_sdk/core/contract.js +59 -0
  169. package/esm/trellis/_sdk/core/mod.d.ts +7 -0
  170. package/esm/trellis/_sdk/core/mod.d.ts.map +1 -0
  171. package/esm/trellis/_sdk/core/mod.js +5 -0
  172. package/esm/trellis/_sdk/core/package.json +3 -0
  173. package/esm/trellis/_sdk/core/schemas.d.ts +1144 -0
  174. package/esm/trellis/_sdk/core/schemas.d.ts.map +1 -0
  175. package/esm/trellis/_sdk/core/schemas.js +28 -0
  176. package/esm/trellis/_sdk/core/types.d.ts +176 -0
  177. package/esm/trellis/_sdk/core/types.d.ts.map +1 -0
  178. package/esm/trellis/_sdk/core/types.js +3 -0
  179. package/esm/trellis/auth/browser.d.ts +3 -0
  180. package/esm/trellis/auth/browser.d.ts.map +1 -0
  181. package/esm/trellis/auth/browser.js +2 -0
  182. package/esm/trellis/auth.d.ts +3 -0
  183. package/esm/trellis/auth.d.ts.map +1 -0
  184. package/esm/trellis/auth.js +2 -0
  185. package/esm/trellis/browser.d.ts +2 -7
  186. package/esm/trellis/browser.d.ts.map +1 -1
  187. package/esm/trellis/browser.js +2 -7
  188. package/esm/trellis/client.d.ts +6 -4
  189. package/esm/trellis/client.d.ts.map +1 -1
  190. package/esm/trellis/client.js +28 -1
  191. package/esm/trellis/codec.d.ts +4 -3
  192. package/esm/trellis/codec.d.ts.map +1 -1
  193. package/esm/trellis/codec.js +15 -2
  194. package/esm/trellis/contract.d.ts +11 -0
  195. package/esm/trellis/contract.d.ts.map +1 -0
  196. package/esm/trellis/contract.js +15 -0
  197. package/esm/trellis/contracts.d.ts +5 -0
  198. package/esm/trellis/contracts.d.ts.map +1 -0
  199. package/esm/trellis/contracts.js +3 -0
  200. package/esm/trellis/env.d.ts +1 -1
  201. package/esm/trellis/env.d.ts.map +1 -1
  202. package/esm/trellis/env.js +1 -1
  203. package/esm/trellis/errors/AuthError.d.ts +1 -1
  204. package/esm/trellis/errors/AuthError.d.ts.map +1 -1
  205. package/esm/trellis/errors/AuthError.js +11 -0
  206. package/esm/trellis/errors/RemoteError.d.ts +3 -3
  207. package/esm/trellis/errors/RemoteError.d.ts.map +1 -1
  208. package/esm/trellis/errors/RemoteError.js +3 -3
  209. package/esm/trellis/errors/TrellisError.d.ts +1 -1
  210. package/esm/trellis/errors/TrellisError.js +1 -1
  211. package/esm/trellis/errors/index.d.ts +2 -1
  212. package/esm/trellis/errors/index.d.ts.map +1 -1
  213. package/esm/trellis/errors/index.js +3 -2
  214. package/esm/trellis/globals.d.ts +9 -1
  215. package/esm/trellis/globals.d.ts.map +1 -1
  216. package/esm/trellis/globals.js +16 -8
  217. package/esm/trellis/helpers.d.ts +2 -1
  218. package/esm/trellis/helpers.d.ts.map +1 -1
  219. package/esm/trellis/helpers.js +1 -0
  220. package/esm/trellis/index.d.ts +13 -5
  221. package/esm/trellis/index.d.ts.map +1 -1
  222. package/esm/trellis/index.js +8 -3
  223. package/esm/trellis/kv.d.ts +10 -7
  224. package/esm/trellis/kv.d.ts.map +1 -1
  225. package/esm/trellis/kv.js +57 -34
  226. package/esm/trellis/models/trellis/TrellisError.d.ts +1 -1
  227. package/esm/trellis/models/trellis/TrellisError.js +1 -1
  228. package/esm/trellis/operations.d.ts +81 -0
  229. package/esm/trellis/operations.d.ts.map +1 -0
  230. package/esm/trellis/operations.js +206 -0
  231. package/esm/trellis/sdk/activity.d.ts +3 -0
  232. package/esm/trellis/sdk/activity.d.ts.map +1 -0
  233. package/esm/trellis/sdk/activity.js +2 -0
  234. package/esm/trellis/sdk/auth.d.ts +4 -0
  235. package/esm/trellis/sdk/auth.d.ts.map +1 -0
  236. package/esm/trellis/sdk/auth.js +3 -0
  237. package/esm/trellis/sdk/core.d.ts +4 -0
  238. package/esm/trellis/sdk/core.d.ts.map +1 -0
  239. package/esm/trellis/sdk/core.js +3 -0
  240. package/esm/trellis/server/deno.d.ts +3 -0
  241. package/esm/trellis/server/deno.d.ts.map +1 -0
  242. package/esm/trellis/server/deno.js +2 -0
  243. package/esm/trellis/server/health.d.ts +5 -0
  244. package/esm/trellis/server/health.d.ts.map +1 -0
  245. package/esm/trellis/server/health.js +3 -0
  246. package/esm/trellis/server/mod.d.ts +3 -0
  247. package/esm/trellis/server/mod.d.ts.map +1 -0
  248. package/esm/trellis/server/mod.js +2 -0
  249. package/esm/trellis/server/node.d.ts +3 -0
  250. package/esm/trellis/server/node.d.ts.map +1 -0
  251. package/esm/trellis/server/node.js +2 -0
  252. package/esm/trellis/server/runtime.d.ts +4 -0
  253. package/esm/trellis/server/runtime.d.ts.map +1 -0
  254. package/esm/trellis/server/runtime.js +2 -0
  255. package/esm/trellis/server.d.ts +21 -0
  256. package/esm/trellis/server.d.ts.map +1 -0
  257. package/esm/trellis/server.js +536 -0
  258. package/esm/trellis/server_logger.d.ts +3 -0
  259. package/esm/trellis/server_logger.d.ts.map +1 -0
  260. package/esm/trellis/server_logger.js +7 -0
  261. package/esm/trellis/tasks.d.ts +3 -3
  262. package/esm/trellis/tasks.d.ts.map +1 -1
  263. package/esm/trellis/tasks.js +1 -1
  264. package/esm/trellis/tracing.d.ts +2 -2
  265. package/esm/trellis/tracing.d.ts.map +1 -1
  266. package/esm/trellis/tracing.js +2 -2
  267. package/esm/trellis/trellis.d.ts +167 -78
  268. package/esm/trellis/trellis.d.ts.map +1 -1
  269. package/esm/trellis/trellis.js +281 -87
  270. package/esm/trellis/workload.d.ts +45 -0
  271. package/esm/trellis/workload.d.ts.map +1 -0
  272. package/esm/trellis/workload.js +144 -0
  273. package/package.json +63 -4
  274. package/script/auth/browser/login.d.ts +27 -0
  275. package/script/auth/browser/login.d.ts.map +1 -0
  276. package/script/auth/browser/login.js +100 -0
  277. package/script/auth/browser/portal.d.ts +11 -0
  278. package/script/auth/browser/portal.d.ts.map +1 -0
  279. package/script/auth/browser/portal.js +40 -0
  280. package/script/auth/browser/session.d.ts +19 -0
  281. package/script/auth/browser/session.d.ts.map +1 -0
  282. package/script/auth/browser/session.js +79 -0
  283. package/script/auth/browser/storage.d.ts +12 -0
  284. package/script/auth/browser/storage.d.ts.map +1 -0
  285. package/script/auth/browser/storage.js +67 -0
  286. package/script/auth/browser.d.ts +13 -0
  287. package/script/auth/browser.d.ts.map +1 -0
  288. package/script/auth/browser.js +46 -0
  289. package/script/auth/keys.d.ts +5 -0
  290. package/script/auth/keys.d.ts.map +1 -0
  291. package/script/auth/keys.js +56 -0
  292. package/script/auth/mod.d.ts +18 -0
  293. package/script/auth/mod.d.ts.map +1 -0
  294. package/script/auth/mod.js +172 -0
  295. package/script/auth/proof.d.ts +9 -0
  296. package/script/auth/proof.d.ts.map +1 -0
  297. package/script/auth/proof.js +48 -0
  298. package/script/auth/protocol.d.ts +1212 -0
  299. package/script/auth/protocol.d.ts.map +1 -0
  300. package/script/auth/protocol.js +687 -0
  301. package/script/auth/schemas.d.ts +93 -0
  302. package/script/auth/schemas.d.ts.map +1 -0
  303. package/script/auth/schemas.js +67 -0
  304. package/script/auth/session_auth.d.ts +20 -0
  305. package/script/auth/session_auth.d.ts.map +1 -0
  306. package/script/auth/session_auth.js +45 -0
  307. package/script/auth/trellis_id.d.ts +2 -0
  308. package/script/auth/trellis_id.d.ts.map +1 -0
  309. package/script/auth/trellis_id.js +8 -0
  310. package/script/auth/types.d.ts +8 -0
  311. package/script/auth/types.d.ts.map +1 -0
  312. package/script/auth/utils.d.ts +11 -0
  313. package/script/auth/utils.d.ts.map +1 -0
  314. package/script/auth/utils.js +77 -0
  315. package/script/auth/workload_activation.d.ts +192 -0
  316. package/script/auth/workload_activation.d.ts.map +1 -0
  317. package/script/auth/workload_activation.js +308 -0
  318. package/script/contracts/canonical.d.ts +14 -0
  319. package/script/contracts/canonical.d.ts.map +1 -0
  320. package/script/contracts/canonical.js +144 -0
  321. package/script/contracts/mod.d.ts +462 -0
  322. package/script/contracts/mod.d.ts.map +1 -0
  323. package/script/contracts/mod.js +555 -0
  324. package/script/contracts/protocol.d.ts +301 -0
  325. package/script/contracts/protocol.d.ts.map +1 -0
  326. package/script/contracts/protocol.js +136 -0
  327. package/script/contracts/runtime.d.ts +48 -0
  328. package/script/contracts/runtime.d.ts.map +1 -0
  329. package/script/contracts/runtime.js +13 -0
  330. package/script/contracts/schema_pointers.d.ts +18 -0
  331. package/script/contracts/schema_pointers.d.ts.map +1 -0
  332. package/script/contracts/schema_pointers.js +63 -0
  333. package/script/telemetry/carrier.d.ts +9 -0
  334. package/script/telemetry/carrier.d.ts.map +1 -0
  335. package/script/telemetry/carrier.js +25 -0
  336. package/script/telemetry/core.d.ts +8 -0
  337. package/script/telemetry/core.d.ts.map +1 -0
  338. package/script/telemetry/core.js +24 -0
  339. package/script/telemetry/env.d.ts +2 -0
  340. package/script/telemetry/env.d.ts.map +1 -0
  341. package/script/telemetry/env.js +12 -0
  342. package/script/telemetry/mod.d.ts +11 -0
  343. package/script/telemetry/mod.d.ts.map +1 -0
  344. package/script/telemetry/mod.js +29 -0
  345. package/script/telemetry/nats.d.ts +7 -0
  346. package/script/telemetry/nats.d.ts.map +1 -0
  347. package/script/telemetry/nats.js +9 -0
  348. package/script/telemetry/result.d.ts +2 -0
  349. package/script/telemetry/result.d.ts.map +1 -0
  350. package/script/telemetry/result.js +21 -0
  351. package/script/telemetry/runtime.d.ts +2 -0
  352. package/script/telemetry/runtime.d.ts.map +1 -0
  353. package/script/telemetry/runtime.js +79 -0
  354. package/script/telemetry/trace.d.ts +5 -0
  355. package/script/telemetry/trace.d.ts.map +1 -0
  356. package/script/telemetry/trace.js +31 -0
  357. package/script/telemetry/trellis.d.ts +3 -0
  358. package/script/telemetry/trellis.d.ts.map +1 -0
  359. package/script/telemetry/trellis.js +14 -0
  360. package/script/trellis/_sdk/activity/_dnt.polyfills.d.ts +12 -0
  361. package/script/trellis/_sdk/activity/_dnt.polyfills.d.ts.map +1 -0
  362. package/script/trellis/_sdk/activity/_dnt.polyfills.js +16 -0
  363. package/script/trellis/_sdk/activity/api.d.ts +10 -0
  364. package/script/trellis/_sdk/activity/api.d.ts.map +1 -0
  365. package/script/trellis/_sdk/activity/api.js +46 -0
  366. package/script/trellis/_sdk/activity/contract.d.ts +8 -0
  367. package/script/trellis/_sdk/activity/contract.d.ts.map +1 -0
  368. package/script/trellis/_sdk/activity/contract.js +62 -0
  369. package/script/trellis/_sdk/activity/mod.d.ts +7 -0
  370. package/script/trellis/_sdk/activity/mod.d.ts.map +1 -0
  371. package/script/trellis/_sdk/activity/mod.js +30 -0
  372. package/script/trellis/_sdk/activity/package.json +3 -0
  373. package/script/trellis/_sdk/activity/schemas.d.ts +607 -0
  374. package/script/trellis/_sdk/activity/schemas.d.ts.map +1 -0
  375. package/script/trellis/_sdk/activity/schemas.js +36 -0
  376. package/script/trellis/_sdk/activity/types.d.ts +96 -0
  377. package/script/trellis/_sdk/activity/types.d.ts.map +1 -0
  378. package/script/trellis/_sdk/activity/types.js +6 -0
  379. package/script/trellis/_sdk/auth/_dnt.polyfills.d.ts +12 -0
  380. package/script/trellis/_sdk/auth/_dnt.polyfills.d.ts.map +1 -0
  381. package/script/trellis/_sdk/auth/_dnt.polyfills.js +16 -0
  382. package/script/trellis/_sdk/auth/api.d.ts +10 -0
  383. package/script/trellis/_sdk/auth/api.d.ts.map +1 -0
  384. package/script/trellis/_sdk/auth/api.js +357 -0
  385. package/script/trellis/_sdk/auth/contract.d.ts +28 -0
  386. package/script/trellis/_sdk/auth/contract.d.ts.map +1 -0
  387. package/script/trellis/_sdk/auth/contract.js +86 -0
  388. package/script/trellis/_sdk/auth/mod.d.ts +7 -0
  389. package/script/trellis/_sdk/auth/mod.d.ts.map +1 -0
  390. package/script/trellis/_sdk/auth/mod.js +31 -0
  391. package/script/trellis/_sdk/auth/package.json +3 -0
  392. package/script/trellis/_sdk/auth/schemas.d.ts +8967 -0
  393. package/script/trellis/_sdk/auth/schemas.d.ts.map +1 -0
  394. package/script/trellis/_sdk/auth/schemas.js +309 -0
  395. package/script/trellis/_sdk/auth/types.d.ts +1232 -0
  396. package/script/trellis/_sdk/auth/types.d.ts.map +1 -0
  397. package/script/trellis/_sdk/auth/types.js +6 -0
  398. package/script/trellis/_sdk/core/_dnt.polyfills.d.ts +12 -0
  399. package/script/trellis/_sdk/core/_dnt.polyfills.d.ts.map +1 -0
  400. package/script/trellis/_sdk/core/_dnt.polyfills.js +16 -0
  401. package/script/trellis/_sdk/core/api.d.ts +10 -0
  402. package/script/trellis/_sdk/core/api.d.ts.map +1 -0
  403. package/script/trellis/_sdk/core/api.js +39 -0
  404. package/script/trellis/_sdk/core/contract.d.ts +8 -0
  405. package/script/trellis/_sdk/core/contract.d.ts.map +1 -0
  406. package/script/trellis/_sdk/core/contract.js +62 -0
  407. package/script/trellis/_sdk/core/mod.d.ts +7 -0
  408. package/script/trellis/_sdk/core/mod.d.ts.map +1 -0
  409. package/script/trellis/_sdk/core/mod.js +30 -0
  410. package/script/trellis/_sdk/core/package.json +3 -0
  411. package/script/trellis/_sdk/core/schemas.d.ts +1144 -0
  412. package/script/trellis/_sdk/core/schemas.d.ts.map +1 -0
  413. package/script/trellis/_sdk/core/schemas.js +31 -0
  414. package/script/trellis/_sdk/core/types.d.ts +176 -0
  415. package/script/trellis/_sdk/core/types.d.ts.map +1 -0
  416. package/script/trellis/_sdk/core/types.js +6 -0
  417. package/script/trellis/auth.d.ts +2 -0
  418. package/script/trellis/auth.d.ts.map +1 -0
  419. package/script/trellis/auth.js +17 -0
  420. package/script/trellis/client.d.ts +8 -6
  421. package/script/trellis/client.d.ts.map +1 -1
  422. package/script/trellis/client.js +54 -3
  423. package/script/trellis/codec.d.ts +5 -4
  424. package/script/trellis/codec.d.ts.map +1 -1
  425. package/script/trellis/codec.js +31 -17
  426. package/script/trellis/contract.d.ts +11 -0
  427. package/script/trellis/contract.d.ts.map +1 -0
  428. package/script/trellis/contract.js +18 -0
  429. package/script/trellis/contracts.d.ts +4 -0
  430. package/script/trellis/contracts.d.ts.map +1 -0
  431. package/script/trellis/contracts.js +20 -0
  432. package/script/trellis/errors/AuthError.d.ts +2 -2
  433. package/script/trellis/errors/AuthError.d.ts.map +1 -1
  434. package/script/trellis/errors/AuthError.js +13 -2
  435. package/script/trellis/errors/KVError.d.ts +1 -1
  436. package/script/trellis/errors/KVError.d.ts.map +1 -1
  437. package/script/trellis/errors/KVError.js +2 -2
  438. package/script/trellis/errors/RemoteError.d.ts +4 -4
  439. package/script/trellis/errors/RemoteError.d.ts.map +1 -1
  440. package/script/trellis/errors/RemoteError.js +11 -11
  441. package/script/trellis/errors/TrellisError.d.ts +1 -1
  442. package/script/trellis/errors/TrellisError.d.ts.map +1 -1
  443. package/script/trellis/errors/TrellisError.js +2 -2
  444. package/script/trellis/errors/ValidationError.d.ts +1 -1
  445. package/script/trellis/errors/ValidationError.d.ts.map +1 -1
  446. package/script/trellis/errors/ValidationError.js +2 -2
  447. package/script/trellis/errors/index.d.ts +14 -14
  448. package/script/trellis/errors/index.d.ts.map +1 -1
  449. package/script/trellis/errors/index.js +31 -31
  450. package/script/trellis/globals.d.ts +9 -1
  451. package/script/trellis/globals.d.ts.map +1 -1
  452. package/script/trellis/globals.js +16 -8
  453. package/script/trellis/helpers.d.ts +1 -1
  454. package/script/trellis/helpers.d.ts.map +1 -1
  455. package/script/trellis/index.d.ts +17 -10
  456. package/script/trellis/index.d.ts.map +1 -1
  457. package/script/trellis/index.js +57 -22
  458. package/script/trellis/kv.d.ts +11 -8
  459. package/script/trellis/kv.d.ts.map +1 -1
  460. package/script/trellis/kv.js +91 -68
  461. package/script/trellis/models/trellis/TrellisError.d.ts +1 -1
  462. package/script/trellis/models/trellis/TrellisError.d.ts.map +1 -1
  463. package/script/trellis/models/trellis/TrellisError.js +8 -8
  464. package/script/trellis/operations.d.ts +81 -0
  465. package/script/trellis/operations.d.ts.map +1 -0
  466. package/script/trellis/operations.js +212 -0
  467. package/script/trellis/sdk/core.d.ts +3 -0
  468. package/script/trellis/sdk/core.d.ts.map +1 -0
  469. package/script/trellis/sdk/core.js +20 -0
  470. package/script/trellis/tasks.d.ts +3 -3
  471. package/script/trellis/tasks.d.ts.map +1 -1
  472. package/script/trellis/tasks.js +5 -5
  473. package/script/trellis/tracing.d.ts +2 -3
  474. package/script/trellis/tracing.d.ts.map +1 -1
  475. package/script/trellis/tracing.js +17 -20
  476. package/script/trellis/trellis.d.ts +169 -80
  477. package/script/trellis/trellis.d.ts.map +1 -1
  478. package/script/trellis/trellis.js +379 -177
  479. package/script/trellis/workload.d.ts +45 -0
  480. package/script/trellis/workload.d.ts.map +1 -0
  481. package/script/trellis/workload.js +172 -0
  482. package/script/_dnt.polyfills.d.ts +0 -7
  483. package/script/_dnt.polyfills.d.ts.map +0 -1
  484. package/script/trellis/browser.d.ts +0 -11
  485. package/script/trellis/browser.d.ts.map +0 -1
  486. package/script/trellis/browser.js +0 -21
  487. package/script/trellis/env.d.ts +0 -2
  488. package/script/trellis/env.d.ts.map +0 -1
  489. package/script/trellis/env.js +0 -5
  490. /package/script/{_dnt.polyfills.js → auth/types.js} +0 -0
@@ -1,9 +1,9 @@
1
- import { Result } from "@qlever-llc/trellis-result";
1
+ import { Result } from "@qlever-llc/result";
2
2
  import Type from "typebox";
3
3
  import { ParseError, Value } from "typebox/value";
4
- import { ValidationError } from "./ValidationError.js";
5
- import { TrellisError } from "./TrellisError.js";
6
4
  import { TrellisErrorDataSchema } from "../models/trellis/TrellisError.js";
5
+ import { TrellisError } from "./TrellisError.js";
6
+ import { ValidationError } from "./ValidationError.js";
7
7
  export const RemoteErrorDataSchema = Type.Object({
8
8
  id: Type.String(),
9
9
  type: Type.Literal("RemoteError"),
@@ -2,7 +2,7 @@
2
2
  * Base class for all Trellis-specific errors.
3
3
  * Extends BaseError and relies on the traceId getter being configured via initTracing.
4
4
  */
5
- import { BaseError, type BaseErrorSchema } from "@qlever-llc/trellis-result";
5
+ import { BaseError, type BaseErrorSchema } from "@qlever-llc/result";
6
6
  /**
7
7
  * Abstract base class for Trellis errors.
8
8
  * Trellis errors automatically include traceId when initTracing() has been called
@@ -2,7 +2,7 @@
2
2
  * Base class for all Trellis-specific errors.
3
3
  * Extends BaseError and relies on the traceId getter being configured via initTracing.
4
4
  */
5
- import { BaseError } from "@qlever-llc/trellis-result";
5
+ import { BaseError } from "@qlever-llc/result";
6
6
  /**
7
7
  * Abstract base class for Trellis errors.
8
8
  * Trellis errors automatically include traceId when initTracing() has been called
@@ -1,8 +1,9 @@
1
+ import "../../_dnt.polyfills.js";
1
2
  import { AuthError } from "./AuthError.js";
2
3
  import { ValidationError } from "./ValidationError.js";
3
4
  import { RemoteError } from "./RemoteError.js";
4
5
  import { KVError } from "./KVError.js";
5
- export { UnexpectedError } from "@qlever-llc/trellis-result";
6
+ export { UnexpectedError } from "@qlever-llc/result";
6
7
  export { TrellisError } from "./TrellisError.js";
7
8
  export { AuthError } from "./AuthError.js";
8
9
  export { ValidationError } from "./ValidationError.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/trellis/errors/index.ts"],"names":[],"m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Ac,GAAG,YAAY,CAAC,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;CAC7E,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,MAAM,eAAe,CAAC;AACrD,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAC,gBAAgB,CAAC,CAAC;AACrE,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,SAAS,gBAAgB,EAAE,IAAI;KACvE,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,gBAAgB,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK;CAC9E,CAAC,MAAM,CAAC,CAAC"}
@@ -1,9 +1,10 @@
1
- import { UnexpectedError } from "@qlever-llc/trellis-result";
1
+ import "../../_dnt.polyfills.js";
2
+ import { UnexpectedError } from "@qlever-llc/result";
2
3
  import { AuthError } from "./AuthError.js";
3
4
  import { ValidationError } from "./ValidationError.js";
4
5
  import { RemoteError } from "./RemoteError.js";
5
6
  import { KVError } from "./KVError.js";
6
- export { UnexpectedError } from "@qlever-llc/trellis-result";
7
+ export { UnexpectedError } from "@qlever-llc/result";
7
8
  export { TrellisError } from "./TrellisError.js";
8
9
  export { AuthError } from "./AuthError.js";
9
10
  export { ValidationError } from "./ValidationError.js";
@@ -1,2 +1,10 @@
1
- export declare const logger: import("pino").Logger<never, boolean>;
1
+ export type LoggerLike = {
2
+ child(bindings: Record<string, unknown>): LoggerLike;
3
+ trace(...args: unknown[]): void;
4
+ debug(...args: unknown[]): void;
5
+ info(...args: unknown[]): void;
6
+ warn(...args: unknown[]): void;
7
+ error(...args: unknown[]): void;
8
+ };
9
+ export declare const logger: LoggerLike;
2
10
  //# sourceMappingURL=globals.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../src/trellis/globals.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,uCAGjB,CAAC"}
1
+ {"version":3,"file":"globals.d.ts","sourceRoot":"","sources":["../../src/trellis/globals.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAAC;IACrD,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAChC,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CACjC,CAAC;AAkBF,eAAO,MAAM,MAAM,EAAE,UAA+B,CAAC"}
@@ -1,8 +1,16 @@
1
- import { pino } from "pino";
2
- import { getEnv } from "./env.js";
3
- // Support Deno and browser (+ Svelte's strict TS rules)
4
- const level = getEnv("PINO_LEVEL") || "info";
5
- export const logger = pino({
6
- level,
7
- base: { library: "@qlever-llc/trellis" },
8
- });
1
+ function createNoopLogger() {
2
+ const noop = () => { };
3
+ const logger = {
4
+ child: () => logger,
5
+ trace: noop,
6
+ debug: noop,
7
+ info: noop,
8
+ warn: noop,
9
+ error: noop,
10
+ };
11
+ return logger;
12
+ }
13
+ // Keep the root package browser-safe: importing `@qlever-llc/trellis` must not
14
+ // pull in `pino` or Node-only side effects. Server-only entrypoints can inject
15
+ // a real logger, while the shared runtime defaults to a no-op logger here.
16
+ export const logger = createNoopLogger();
@@ -1,4 +1,5 @@
1
- import type { Paginated } from "@qlever-llc/trellis-contracts";
1
+ import "../_dnt.polyfills.js";
2
+ import type { Paginated } from "./contracts.js";
2
3
  /**
3
4
  * Compute the subject template from the message itself
4
5
  */
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/trellis/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D;;GAEG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAC/C,IAAI,GAAE;IAAE,cAAc,EAAE,OAAO,CAAA;CAA8B,GAC5D,MAAM,CAWR;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYhD;AAGD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAW/C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUnD;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,SAAS,CAQX"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/trellis/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAGhD;;GAEG;AACH,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,EAC/C,IAAI,GAAE;IAAE,cAAc,EAAE,OAAO,CAAA;CAA8B,GAC5D,MAAM,CAWR;AAGD,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAYhD;AAGD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAW/C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAUnD;AAED,wBAAgB,aAAa,CAC3B,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,SAAS,CAQX"}
@@ -1,3 +1,4 @@
1
+ import "../_dnt.polyfills.js";
1
2
  import { Pointer } from "typebox/value";
2
3
  /**
3
4
  * Compute the subject template from the message itself
@@ -1,11 +1,19 @@
1
1
  import "../_dnt.polyfills.js";
2
- export type { TrellisAPI } from "@qlever-llc/trellis-contracts";
3
- export { err, isErr, isOk, ok, Result } from "@qlever-llc/trellis-result";
2
+ export { bindFlow, bindSession, buildLoginUrl, clearSessionKey, createAuth, createRpcProof, fetchPortalFlowState, generateSessionKey, getOrCreateSessionKey, getPublicSessionKey, hasSessionKey, isBindSuccessResponse, loadSessionKey, natsConnectSigForBindingToken, portalFlowIdFromUrl, portalProviderLoginUrl, portalRedirectLocation, signBytes, submitPortalApproval, } from "./auth.js";
3
+ export type { ApprovalDecision, AuthConfig, BindResponse, BindSuccessResponse, PortalFlowState, NatsConnectOptions, SessionKeyHandle, } from "./auth.js";
4
+ export { canonicalizeJson, CATALOG_FORMAT_V1, CONTRACT_FORMAT_V1, digestJson, isJsonValue, schema, unwrapSchema, } from "./contracts.js";
5
+ export type { InferSchemaType, JsonValue, TrellisAPI, } from "./contracts.js";
6
+ export { defineContract, } from "./contract.js";
7
+ export type { ContractApiViews, ContractDependencyUse, ContractModule, ContractUseFn, DefineContractInput, EmptyApi, SdkContractModule, TrellisApiLike, TrellisContractV1, UseSpec, } from "./contract.js";
8
+ export { err, isErr, isOk, ok, Result } from "@qlever-llc/result";
4
9
  export type { ClientOpts } from "./client.js";
5
- export { createClient } from "./client.js";
10
+ export { createClient, createCoreClient } from "./client.js";
11
+ export { TrellisWorkload } from "./workload.js";
6
12
  export type { TrellisErrorInstance } from "./errors/index.js";
7
13
  export { AuthError, KVError, RemoteError, TrellisError, UnexpectedError, ValidationError, } from "./errors/index.js";
8
14
  export { TypedKV } from "./kv.js";
9
- export type { TrellisAuth, TrellisSigner } from "./trellis.js";
10
- export { Trellis, TrellisServer } from "./trellis.js";
15
+ export type { OperationEvent, OperationRefData, OperationSnapshot, OperationState, OperationTransport, TerminalOperation, } from "./operations.js";
16
+ export { controlSubject, OperationInvoker, OperationRef, } from "./operations.js";
17
+ export type { OperationHandlerContext, OperationRegistration, TrellisAuth, TrellisSigner, } from "./trellis.js";
18
+ export { Trellis } from "./trellis.js";
11
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trellis/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,YAAY,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAC1E,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,SAAS,EACT,OAAO,EACP,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,GAChB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/trellis/index.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EACL,QAAQ,EACR,WAAW,EACX,aAAa,EACb,eAAe,EACf,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,aAAa,EACb,qBAAqB,EACrB,cAAc,EACd,6BAA6B,EAC7B,mBAA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AChB,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,uBAAuB,EACvB,qBAAqB,EACrB,WAAW,EACX,aAAa,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -1,6 +1,11 @@
1
1
  import "../_dnt.polyfills.js";
2
- export { err, isErr, isOk, ok, Result } from "@qlever-llc/trellis-result";
3
- export { createClient } from "./client.js";
2
+ export { bindFlow, bindSession, buildLoginUrl, clearSessionKey, createAuth, createRpcProof, fetchPortalFlowState, generateSessionKey, getOrCreateSessionKey, getPublicSessionKey, hasSessionKey, isBindSuccessResponse, loadSessionKey, natsConnectSigForBindingToken, portalFlowIdFromUrl, portalProviderLoginUrl, portalRedirectLocation, signBytes, submitPortalApproval, } from "./auth.js";
3
+ export { canonicalizeJson, CATALOG_FORMAT_V1, CONTRACT_FORMAT_V1, digestJson, isJsonValue, schema, unwrapSchema, } from "./contracts.js";
4
+ export { defineContract, } from "./contract.js";
5
+ export { err, isErr, isOk, ok, Result } from "@qlever-llc/result";
6
+ export { createClient, createCoreClient } from "./client.js";
7
+ export { TrellisWorkload } from "./workload.js";
4
8
  export { AuthError, KVError, RemoteError, TrellisError, UnexpectedError, ValidationError, } from "./errors/index.js";
5
9
  export { TypedKV } from "./kv.js";
6
- export { Trellis, TrellisServer } from "./trellis.js";
10
+ export { controlSubject, OperationInvoker, OperationRef, } from "./operations.js";
11
+ export { Trellis } from "./trellis.js";
@@ -1,6 +1,6 @@
1
1
  import { type KV, type KvEntry } from "@nats-io/kv";
2
2
  import type { NatsConnection } from "@nats-io/nats-core/internal";
3
- import { Result } from "@qlever-llc/trellis-result";
3
+ import { Result } from "@qlever-llc/result";
4
4
  import type { StaticDecode, TSchema } from "typebox";
5
5
  import { KVError, ValidationError } from "./errors/index.js";
6
6
  /**
@@ -29,6 +29,7 @@ export declare class TypedKV<S extends TSchema> {
29
29
  readonly schema: S;
30
30
  readonly kv: KV;
31
31
  private constructor();
32
+ private static fromParts;
32
33
  static open<S extends TSchema>(nats: NatsConnection, name: string, schema: S, options: {
33
34
  history?: number;
34
35
  ttl?: number;
@@ -36,8 +37,9 @@ export declare class TypedKV<S extends TSchema> {
36
37
  maxValueBytes?: number;
37
38
  }): Promise<Result<TypedKV<S>, KVError>>;
38
39
  get(key: string): Promise<Result<TypedKVEntry<S>, KVError | ValidationError>>;
39
- create(key: string, value: StaticDecode<S>): Promise<Result<void, KVError>>;
40
- put(key: string, value: StaticDecode<S>): Promise<Result<void, KVError>>;
40
+ private serialize;
41
+ create(key: string, value: unknown): Promise<Result<void, KVError>>;
42
+ put(key: string, value: unknown): Promise<Result<void, KVError>>;
41
43
  delete(key: string): Promise<Result<void, KVError>>;
42
44
  keys(filter?: string | string[]): Promise<Result<AsyncIterable<string>, KVError>>;
43
45
  status(): Promise<Result<{
@@ -45,11 +47,12 @@ export declare class TypedKV<S extends TSchema> {
45
47
  }, KVError>>;
46
48
  }
47
49
  export declare class TypedKVEntry<S extends TSchema> {
50
+ #private;
48
51
  private schema;
49
52
  private kv;
50
53
  private entry;
51
- readonly value: StaticDecode<S>;
52
- constructor(schema: S, kv: KV, entry: KvEntry, value: StaticDecode<S>);
54
+ constructor(schema: S, kv: KV, entry: KvEntry, value: unknown);
55
+ get value(): StaticDecode<S>;
53
56
  static create<S extends TSchema>(schema: S, kv: KV, entry: KvEntry): Promise<Result<TypedKVEntry<S>, ValidationError>>;
54
57
  get key(): string;
55
58
  /**
@@ -60,8 +63,8 @@ export declare class TypedKVEntry<S extends TSchema> {
60
63
  * @returns A function to stop watching
61
64
  */
62
65
  watch(callback: (event: WatchEvent<S>) => void, opts?: WatchOptions): Promise<() => void>;
63
- merge(value: Partial<StaticDecode<S>>, vcc?: boolean): Promise<Result<void, KVError | ValidationError>>;
64
- put(value: StaticDecode<S>, vcc?: boolean): Promise<Result<void, KVError>>;
66
+ merge(value: unknown, vcc?: boolean): Promise<Result<void, KVError | ValidationError>>;
67
+ put(value: unknown, vcc?: boolean): Promise<Result<void, KVError>>;
65
68
  delete(vcc?: boolean): Promise<Result<void, KVError>>;
66
69
  }
67
70
  //# sourceMappingURL=kv.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kv.d.ts","sourceRoot":"","sources":["../../src/trellis/kv.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,OAAO,EAAO,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAqC7D;;GAEG;AACH,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,OAAO,IAAI;IAC1C,mFAAmF;IACnF,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,2BAA2B;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,KAAK,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;IACxB,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,6EAA6E;IAC7E,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,qBAAa,OAAO,CAAC,CAAC,SAAS,OAAO;IAElC,QAAQ,CAAC,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,EAAE,EAAE;IAFjB,OAAO;WAKM,IAAI,CAAC,CAAC,SAAS,OAAO,EACjC,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,CAAC,EACT,OAAO,EAAE;QACP,OAAO,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B7C,GAAG,CACP,KAAK,EAAE,OAAO,EACd,GAAG,CAAC,EAAE,OAAO,GACZ,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAc3B,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;CAY5D"}
package/esm/trellis/kv.js CHANGED
@@ -1,7 +1,17 @@
1
- // @ts-nocheck -- svelte-check hits pathological generic instantiation in this file
1
+ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
2
+ if (kind === "m") throw new TypeError("Private method is not writable");
3
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
4
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
5
+ return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
6
+ };
7
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
8
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
9
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
10
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
+ };
12
+ var _TypedKVEntry_value;
2
13
  import { Kvm } from "@nats-io/kv";
3
- import { Result } from "@qlever-llc/trellis-result";
4
- import { merge } from "ts-deepmerge";
14
+ import { Result } from "@qlever-llc/result";
5
15
  import Value, { ParseError } from "typebox/value";
6
16
  import { KVError, ValidationError } from "./errors/index.js";
7
17
  import { decodeSubject, escapeKvKey } from "./helpers.js";
@@ -35,6 +45,21 @@ function serializeValue(schema, value) {
35
45
  function serializeExternalValue(schema, value) {
36
46
  return serializeValue(schema, value);
37
47
  }
48
+ function isPlainObject(value) {
49
+ return value !== null && typeof value === "object" && !Array.isArray(value);
50
+ }
51
+ function mergeUnknown(target, source) {
52
+ if (!isPlainObject(target) || !isPlainObject(source)) {
53
+ return source;
54
+ }
55
+ const out = { ...target };
56
+ for (const [key, entry] of Object.entries(source)) {
57
+ if (entry === undefined)
58
+ continue;
59
+ out[key] = mergeUnknown(target[key], entry);
60
+ }
61
+ return out;
62
+ }
38
63
  export class TypedKV {
39
64
  constructor(schema, kv) {
40
65
  Object.defineProperty(this, "schema", {
@@ -50,6 +75,9 @@ export class TypedKV {
50
75
  value: kv
51
76
  });
52
77
  }
78
+ static fromParts(schema, kv) {
79
+ return new TypedKV(schema, kv);
80
+ }
53
81
  static async open(nats, name, schema, options) {
54
82
  try {
55
83
  const kvm = new Kvm(nats);
@@ -60,7 +88,7 @@ export class TypedKV {
60
88
  ttl: options.ttl ?? 0,
61
89
  ...(options.maxValueBytes ? { maxValueSize: options.maxValueBytes } : {}),
62
90
  });
63
- const typedKv = new TypedKV(schema, kv);
91
+ const typedKv = TypedKV.fromParts(schema, kv);
64
92
  return Result.ok(typedKv);
65
93
  }
66
94
  catch (cause) {
@@ -81,15 +109,15 @@ export class TypedKV {
81
109
  context: { key, reason: "not found" },
82
110
  }));
83
111
  }
84
- return await createTypedKvEntry(this.schema, this.kv, s);
112
+ const result = await createTypedKvEntry(this.schema, this.kv, s);
113
+ return result;
114
+ }
115
+ serialize(value) {
116
+ return serializeExternalValue(this.schema, value);
85
117
  }
86
118
  async create(key, value) {
87
- const schema = this.schema;
88
- const rawValue = value;
89
- // @ts-expect-error svelte-check hits excessive type instantiation here
90
- const serialized = serializeExternalValue(schema, rawValue);
91
119
  try {
92
- await this.kv.create(escapeKvKey(key), serialized);
120
+ await this.kv.create(escapeKvKey(key), this.serialize(value));
93
121
  return Result.ok(undefined);
94
122
  }
95
123
  catch (cause) {
@@ -97,12 +125,8 @@ export class TypedKV {
97
125
  }
98
126
  }
99
127
  async put(key, value) {
100
- const schema = this.schema;
101
- const rawValue = value;
102
- // @ts-expect-error svelte-check hits excessive type instantiation here
103
- const serialized = serializeExternalValue(schema, rawValue);
104
128
  try {
105
- await this.kv.put(escapeKvKey(key), serialized);
129
+ await this.kv.put(escapeKvKey(key), this.serialize(value));
106
130
  return Result.ok(undefined);
107
131
  }
108
132
  catch (cause) {
@@ -156,17 +180,15 @@ export class TypedKVEntry {
156
180
  writable: true,
157
181
  value: entry
158
182
  });
159
- Object.defineProperty(this, "value", {
160
- enumerable: true,
161
- configurable: true,
162
- writable: true,
163
- value: void 0
164
- });
165
- // @ts-expect-error svelte-check hits excessive type instantiation on assignment
166
- this.value = value;
183
+ _TypedKVEntry_value.set(this, void 0);
184
+ __classPrivateFieldSet(this, _TypedKVEntry_value, value, "f");
185
+ }
186
+ get value() {
187
+ return __classPrivateFieldGet(this, _TypedKVEntry_value, "f");
167
188
  }
168
189
  static async create(schema, kv, entry) {
169
- return await createTypedKvEntry(schema, kv, entry);
190
+ const result = await createTypedKvEntry(schema, kv, entry);
191
+ return result;
170
192
  }
171
193
  get key() {
172
194
  return decodeSubject(this.entry.key);
@@ -232,16 +254,12 @@ export class TypedKVEntry {
232
254
  };
233
255
  }
234
256
  async merge(value, vcc) {
235
- // @ts-expect-error svelte-check hits excessive type instantiation here
236
- const mergedData = merge(this.value, value);
237
- const schema = this.schema;
238
- const mergedRawValue = mergedData;
239
- // @ts-expect-error svelte-check hits excessive type instantiation here
240
- const mergeResult = Result.try(() => serializeExternalValue(schema, mergedRawValue));
257
+ const mergedData = mergeUnknown(__classPrivateFieldGet(this, _TypedKVEntry_value, "f"), value);
258
+ const mergeResult = Result.try(() => serializeExternalValue(this.schema, mergedData));
241
259
  if (mergeResult.isErr()) {
242
260
  const cause = mergeResult.error.cause;
243
261
  if (cause instanceof ParseError) {
244
- const errors = Value.Errors(schema, externalizeValue(mergedData));
262
+ const errors = Value.Errors(this.schema, externalizeValue(mergedData));
245
263
  return Result.err(new ValidationError({ errors, cause }));
246
264
  }
247
265
  return Result.err(new KVError({ operation: "merge", cause: mergeResult.error, context: { key: this.key } }));
@@ -249,8 +267,7 @@ export class TypedKVEntry {
249
267
  return this.put(mergedData, vcc);
250
268
  }
251
269
  async put(value, vcc) {
252
- const schema = this.schema;
253
- const serialized = serializeValue(schema, value);
270
+ const serialized = serializeValue(this.schema, value);
254
271
  try {
255
272
  await this.kv.put(this.entry.key, serialized, {
256
273
  previousSeq: vcc ? this.entry.revision : undefined,
@@ -273,6 +290,7 @@ export class TypedKVEntry {
273
290
  }
274
291
  }
275
292
  }
293
+ _TypedKVEntry_value = new WeakMap();
276
294
  async function createTypedKvEntry(schema, kv, entry) {
277
295
  async function deleteInvalidEntry(reason) {
278
296
  try {
@@ -306,7 +324,12 @@ async function createTypedKvEntry(schema, kv, entry) {
306
324
  }));
307
325
  }
308
326
  const json = jsonResult.take();
309
- const parseResult = Result.try(() => parseExternalValue(schema, json));
327
+ const parseResult = Result.try(() => {
328
+ if (Value.HasCodec(schema)) {
329
+ return Value.Decode(schema, json);
330
+ }
331
+ return Value.Parse(schema, json);
332
+ });
310
333
  if (parseResult.isErr()) {
311
334
  const cause = parseResult.error.cause;
312
335
  if (cause instanceof ParseError) {
@@ -24,7 +24,7 @@ export declare const TrellisErrorDataSchema: Type.TUnion<[Type.TObject<{
24
24
  id: Type.TString;
25
25
  type: Type.TLiteral<"AuthError">;
26
26
  message: Type.TString;
27
- reason: Type.TUnion<[Type.TLiteral<"invalid_request">, Type.TLiteral<"missing_session_key">, Type.TLiteral<"missing_proof">, Type.TLiteral<"session_not_found">, Type.TLiteral<"session_expired">, Type.TLiteral<"invalid_signature">, Type.TLiteral<"user_not_found">, Type.TLiteral<"user_inactive">, Type.TLiteral<"unknown_service">, Type.TLiteral<"service_disabled">, Type.TLiteral<"iat_out_of_range">, Type.TLiteral<"invalid_binding_token">, Type.TLiteral<"session_corrupted">, Type.TLiteral<"session_already_bound">, Type.TLiteral<"authtoken_already_used">, Type.TLiteral<"oauth_session_key_mismatch">, Type.TLiteral<"service_role_on_user">, Type.TLiteral<"reply_subject_mismatch">, Type.TLiteral<"insufficient_permissions">, Type.TLiteral<"forbidden">]>;
27
+ reason: Type.TUnion<[Type.TLiteral<"invalid_request">, Type.TLiteral<"missing_session_key">, Type.TLiteral<"missing_proof">, Type.TLiteral<"session_not_found">, Type.TLiteral<"session_expired">, Type.TLiteral<"invalid_signature">, Type.TLiteral<"user_not_found">, Type.TLiteral<"user_inactive">, Type.TLiteral<"unknown_workload">, Type.TLiteral<"workload_profile_not_found">, Type.TLiteral<"workload_profile_disabled">, Type.TLiteral<"workload_activation_revoked">, Type.TLiteral<"unknown_service">, Type.TLiteral<"service_disabled">, Type.TLiteral<"iat_out_of_range">, Type.TLiteral<"invalid_binding_token">, Type.TLiteral<"session_corrupted">, Type.TLiteral<"session_already_bound">, Type.TLiteral<"authtoken_already_used">, Type.TLiteral<"oauth_session_key_mismatch">, Type.TLiteral<"service_role_on_user">, Type.TLiteral<"reply_subject_mismatch">, Type.TLiteral<"insufficient_permissions">, Type.TLiteral<"forbidden">, Type.TLiteral<"missing_handoff_id">, Type.TLiteral<"missing_profile_id">, Type.TLiteral<"workload_activation_handoff_not_found">, Type.TLiteral<"workload_activation_handoff_expired">, Type.TLiteral<"workload_activation_rejected">, Type.TLiteral<"workload_identity_key_mismatch">, Type.TLiteral<"invalid_workload_qr_mac">]>;
28
28
  context: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
29
29
  traceId: Type.TOptional<Type.TString>;
30
30
  }>, Type.TObject<{
@@ -1,5 +1,5 @@
1
1
  import Type from "typebox";
2
- import { UnexpectedErrorDataSchema } from "@qlever-llc/trellis-result";
2
+ import { UnexpectedErrorDataSchema } from "@qlever-llc/result";
3
3
  import { ValidationErrorDataSchema } from "../../errors/ValidationError.js";
4
4
  import { AuthErrorDataSchema } from "../../errors/AuthError.js";
5
5
  import { KVErrorDataSchema } from "../../errors/KVError.js";
@@ -0,0 +1,81 @@
1
+ import type { InferSchemaType } from "./contracts.js";
2
+ import { type Result } from "@qlever-llc/result";
3
+ import type { JsonValue } from "./codec.js";
4
+ import { UnexpectedError } from "./errors/index.js";
5
+ export type OperationState = "pending" | "running" | "completed" | "failed" | "cancelled";
6
+ export type OperationRefData = {
7
+ id: string;
8
+ service: string;
9
+ operation: string;
10
+ };
11
+ export type OperationSnapshot<TProgress = unknown, TOutput = unknown> = {
12
+ id: string;
13
+ service: string;
14
+ operation: string;
15
+ revision: number;
16
+ state: OperationState;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ completedAt?: string;
20
+ progress?: TProgress;
21
+ output?: TOutput;
22
+ error?: {
23
+ type: string;
24
+ message: string;
25
+ };
26
+ };
27
+ export type TerminalOperation<TProgress = unknown, TOutput = unknown> = OperationSnapshot<TProgress, TOutput> & {
28
+ state: "completed" | "failed" | "cancelled";
29
+ };
30
+ export type OperationEvent<TProgress = unknown, TOutput = unknown> = {
31
+ type: "accepted";
32
+ snapshot: OperationSnapshot<TProgress, TOutput>;
33
+ } | {
34
+ type: "started";
35
+ snapshot: OperationSnapshot<TProgress, TOutput>;
36
+ } | {
37
+ type: "progress";
38
+ snapshot: OperationSnapshot<TProgress, TOutput>;
39
+ } | {
40
+ type: "completed";
41
+ snapshot: TerminalOperation<TProgress, TOutput>;
42
+ } | {
43
+ type: "failed";
44
+ snapshot: TerminalOperation<TProgress, TOutput>;
45
+ } | {
46
+ type: "cancelled";
47
+ snapshot: TerminalOperation<TProgress, TOutput>;
48
+ };
49
+ type OperationShape = {
50
+ subject: string;
51
+ input: unknown;
52
+ progress?: unknown;
53
+ output?: unknown;
54
+ cancel?: boolean;
55
+ };
56
+ type OperationInputOf<TDesc extends OperationShape> = InferSchemaType<TDesc["input"]>;
57
+ type OperationProgressOf<TDesc extends OperationShape> = TDesc["progress"] extends undefined ? unknown : InferSchemaType<NonNullable<TDesc["progress"]>>;
58
+ type OperationOutputOf<TDesc extends OperationShape> = TDesc["output"] extends undefined ? unknown : InferSchemaType<NonNullable<TDesc["output"]>>;
59
+ export interface OperationTransport {
60
+ requestJson(subject: string, body: JsonValue): Promise<Result<JsonValue, UnexpectedError>>;
61
+ watchJson(subject: string, body: JsonValue): Promise<Result<AsyncIterable<Result<JsonValue, UnexpectedError>>, UnexpectedError>>;
62
+ }
63
+ export declare function controlSubject(subject: string): string;
64
+ export declare class OperationRef<TDesc extends OperationShape, TProgress = OperationProgressOf<TDesc>, TOutput = OperationOutputOf<TDesc>> {
65
+ #private;
66
+ readonly id: string;
67
+ readonly service: string;
68
+ readonly operation: string;
69
+ constructor(transport: OperationTransport, descriptor: TDesc, ref: OperationRefData);
70
+ get(): Promise<Result<OperationSnapshot<TProgress, TOutput>, UnexpectedError>>;
71
+ wait(): Promise<Result<TerminalOperation<TProgress, TOutput>, UnexpectedError>>;
72
+ cancel(): Promise<Result<OperationSnapshot<TProgress, TOutput>, UnexpectedError>>;
73
+ watch(): Promise<Result<AsyncIterable<OperationEvent<TProgress, TOutput>>, UnexpectedError>>;
74
+ }
75
+ export declare class OperationInvoker<TDesc extends OperationShape, TInput = OperationInputOf<TDesc>, TProgress = OperationProgressOf<TDesc>, TOutput = OperationOutputOf<TDesc>> {
76
+ #private;
77
+ constructor(transport: OperationTransport, descriptor: TDesc);
78
+ start(input: TInput): Promise<Result<OperationRef<TDesc, TProgress, TOutput>, UnexpectedError>>;
79
+ }
80
+ export {};
81
+ //# sourceMappingURL=operations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/trellis/operations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAChB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAkB,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,MAAM,cAAc,GACtB,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,WAAW,CAAC;AAE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