@zarel-ai/sdk 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 (375) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +412 -0
  3. package/dist/_internal/auth-headers.d.ts +19 -0
  4. package/dist/_internal/auth-headers.d.ts.map +1 -0
  5. package/dist/_internal/auth-headers.js +30 -0
  6. package/dist/_internal/auth-headers.js.map +1 -0
  7. package/dist/_internal/confirmation.d.ts +24 -0
  8. package/dist/_internal/confirmation.d.ts.map +1 -0
  9. package/dist/_internal/confirmation.js +54 -0
  10. package/dist/_internal/confirmation.js.map +1 -0
  11. package/dist/_internal/event-iterator.d.ts +18 -0
  12. package/dist/_internal/event-iterator.d.ts.map +1 -0
  13. package/dist/_internal/event-iterator.js +151 -0
  14. package/dist/_internal/event-iterator.js.map +1 -0
  15. package/dist/_internal/fetch-client.d.ts +141 -0
  16. package/dist/_internal/fetch-client.d.ts.map +1 -0
  17. package/dist/_internal/fetch-client.js +471 -0
  18. package/dist/_internal/fetch-client.js.map +1 -0
  19. package/dist/_internal/interceptors.d.ts +40 -0
  20. package/dist/_internal/interceptors.d.ts.map +1 -0
  21. package/dist/_internal/interceptors.js +28 -0
  22. package/dist/_internal/interceptors.js.map +1 -0
  23. package/dist/_internal/mcp.d.ts +11 -0
  24. package/dist/_internal/mcp.d.ts.map +1 -0
  25. package/dist/_internal/mcp.js +79 -0
  26. package/dist/_internal/mcp.js.map +1 -0
  27. package/dist/_internal/pagination.d.ts +71 -0
  28. package/dist/_internal/pagination.d.ts.map +1 -0
  29. package/dist/_internal/pagination.js +130 -0
  30. package/dist/_internal/pagination.js.map +1 -0
  31. package/dist/_internal/require-token.d.ts +17 -0
  32. package/dist/_internal/require-token.d.ts.map +1 -0
  33. package/dist/_internal/require-token.js +25 -0
  34. package/dist/_internal/require-token.js.map +1 -0
  35. package/dist/_internal/retry-after.d.ts +2 -0
  36. package/dist/_internal/retry-after.d.ts.map +1 -0
  37. package/dist/_internal/retry-after.js +34 -0
  38. package/dist/_internal/retry-after.js.map +1 -0
  39. package/dist/_internal/sse-client.d.ts +43 -0
  40. package/dist/_internal/sse-client.d.ts.map +1 -0
  41. package/dist/_internal/sse-client.js +250 -0
  42. package/dist/_internal/sse-client.js.map +1 -0
  43. package/dist/_internal/version.d.ts +5 -0
  44. package/dist/_internal/version.d.ts.map +1 -0
  45. package/dist/_internal/version.js +12 -0
  46. package/dist/_internal/version.js.map +1 -0
  47. package/dist/client.d.ts +74 -0
  48. package/dist/client.d.ts.map +1 -0
  49. package/dist/client.js +86 -0
  50. package/dist/client.js.map +1 -0
  51. package/dist/contract/_singleton.d.ts +18 -0
  52. package/dist/contract/_singleton.d.ts.map +1 -0
  53. package/dist/contract/_singleton.js +27 -0
  54. package/dist/contract/_singleton.js.map +1 -0
  55. package/dist/contract/actions.d.ts +18 -0
  56. package/dist/contract/actions.d.ts.map +1 -0
  57. package/dist/contract/actions.js +36 -0
  58. package/dist/contract/actions.js.map +1 -0
  59. package/dist/contract/assistant.d.ts +65 -0
  60. package/dist/contract/assistant.d.ts.map +1 -0
  61. package/dist/contract/assistant.js +44 -0
  62. package/dist/contract/assistant.js.map +1 -0
  63. package/dist/contract/batch.d.ts +27 -0
  64. package/dist/contract/batch.d.ts.map +1 -0
  65. package/dist/contract/batch.js +20 -0
  66. package/dist/contract/batch.js.map +1 -0
  67. package/dist/contract/capabilities.d.ts +21 -0
  68. package/dist/contract/capabilities.d.ts.map +1 -0
  69. package/dist/contract/capabilities.js +31 -0
  70. package/dist/contract/capabilities.js.map +1 -0
  71. package/dist/contract/constraints.d.ts +21 -0
  72. package/dist/contract/constraints.d.ts.map +1 -0
  73. package/dist/contract/constraints.js +31 -0
  74. package/dist/contract/constraints.js.map +1 -0
  75. package/dist/contract/events.d.ts +33 -0
  76. package/dist/contract/events.d.ts.map +1 -0
  77. package/dist/contract/events.js +56 -0
  78. package/dist/contract/events.js.map +1 -0
  79. package/dist/contract/flows.d.ts +44 -0
  80. package/dist/contract/flows.d.ts.map +1 -0
  81. package/dist/contract/flows.js +109 -0
  82. package/dist/contract/flows.js.map +1 -0
  83. package/dist/contract/governance.d.ts +6 -0
  84. package/dist/contract/governance.d.ts.map +1 -0
  85. package/dist/contract/governance.js +17 -0
  86. package/dist/contract/governance.js.map +1 -0
  87. package/dist/contract/index.d.ts +137 -0
  88. package/dist/contract/index.d.ts.map +1 -0
  89. package/dist/contract/index.js +177 -0
  90. package/dist/contract/index.js.map +1 -0
  91. package/dist/contract/metadata.d.ts +26 -0
  92. package/dist/contract/metadata.d.ts.map +1 -0
  93. package/dist/contract/metadata.js +25 -0
  94. package/dist/contract/metadata.js.map +1 -0
  95. package/dist/contract/process-model.d.ts +31 -0
  96. package/dist/contract/process-model.d.ts.map +1 -0
  97. package/dist/contract/process-model.js +51 -0
  98. package/dist/contract/process-model.js.map +1 -0
  99. package/dist/contract/roots/channels.d.ts +27 -0
  100. package/dist/contract/roots/channels.d.ts.map +1 -0
  101. package/dist/contract/roots/channels.js +53 -0
  102. package/dist/contract/roots/channels.js.map +1 -0
  103. package/dist/contract/roots/events.d.ts +7 -0
  104. package/dist/contract/roots/events.d.ts.map +1 -0
  105. package/dist/contract/roots/events.js +19 -0
  106. package/dist/contract/roots/events.js.map +1 -0
  107. package/dist/contract/roots/index.d.ts +15 -0
  108. package/dist/contract/roots/index.d.ts.map +1 -0
  109. package/dist/contract/roots/index.js +38 -0
  110. package/dist/contract/roots/index.js.map +1 -0
  111. package/dist/contract/roots/mcp-servers.d.ts +46 -0
  112. package/dist/contract/roots/mcp-servers.d.ts.map +1 -0
  113. package/dist/contract/roots/mcp-servers.js +68 -0
  114. package/dist/contract/roots/mcp-servers.js.map +1 -0
  115. package/dist/contract/roots/profiles.d.ts +18 -0
  116. package/dist/contract/roots/profiles.d.ts.map +1 -0
  117. package/dist/contract/roots/profiles.js +31 -0
  118. package/dist/contract/roots/profiles.js.map +1 -0
  119. package/dist/contract/roots/timezone.d.ts +10 -0
  120. package/dist/contract/roots/timezone.d.ts.map +1 -0
  121. package/dist/contract/roots/timezone.js +19 -0
  122. package/dist/contract/roots/timezone.js.map +1 -0
  123. package/dist/contract/roots/treatment.d.ts +11 -0
  124. package/dist/contract/roots/treatment.d.ts.map +1 -0
  125. package/dist/contract/roots/treatment.js +37 -0
  126. package/dist/contract/roots/treatment.js.map +1 -0
  127. package/dist/contract/roots/vocabulary.d.ts +18 -0
  128. package/dist/contract/roots/vocabulary.d.ts.map +1 -0
  129. package/dist/contract/roots/vocabulary.js +31 -0
  130. package/dist/contract/roots/vocabulary.js.map +1 -0
  131. package/dist/contract/schemas.d.ts +18 -0
  132. package/dist/contract/schemas.d.ts.map +1 -0
  133. package/dist/contract/schemas.js +31 -0
  134. package/dist/contract/schemas.js.map +1 -0
  135. package/dist/contract/skills.d.ts +20 -0
  136. package/dist/contract/skills.d.ts.map +1 -0
  137. package/dist/contract/skills.js +36 -0
  138. package/dist/contract/skills.js.map +1 -0
  139. package/dist/errors.d.ts +65 -0
  140. package/dist/errors.d.ts.map +1 -0
  141. package/dist/errors.js +80 -0
  142. package/dist/errors.js.map +1 -0
  143. package/dist/generated/contract.d.ts +7688 -0
  144. package/dist/generated/contract.d.ts.map +1 -0
  145. package/dist/generated/contract.js +7 -0
  146. package/dist/generated/contract.js.map +1 -0
  147. package/dist/generated/index.d.ts +41 -0
  148. package/dist/generated/index.d.ts.map +1 -0
  149. package/dist/generated/index.js +3 -0
  150. package/dist/generated/index.js.map +1 -0
  151. package/dist/generated/runtime.d.ts +4020 -0
  152. package/dist/generated/runtime.d.ts.map +1 -0
  153. package/dist/generated/runtime.js +7 -0
  154. package/dist/generated/runtime.js.map +1 -0
  155. package/dist/generated/unwrap-map.d.ts +989 -0
  156. package/dist/generated/unwrap-map.d.ts.map +1 -0
  157. package/dist/generated/unwrap-map.js +344 -0
  158. package/dist/generated/unwrap-map.js.map +1 -0
  159. package/dist/index.d.ts +38 -0
  160. package/dist/index.d.ts.map +1 -0
  161. package/dist/index.js +27 -0
  162. package/dist/index.js.map +1 -0
  163. package/dist/resources/actions.d.ts +33 -0
  164. package/dist/resources/actions.d.ts.map +1 -0
  165. package/dist/resources/actions.js +52 -0
  166. package/dist/resources/actions.js.map +1 -0
  167. package/dist/resources/audit.d.ts +52 -0
  168. package/dist/resources/audit.d.ts.map +1 -0
  169. package/dist/resources/audit.js +86 -0
  170. package/dist/resources/audit.js.map +1 -0
  171. package/dist/resources/authorization-ceiling.d.ts +25 -0
  172. package/dist/resources/authorization-ceiling.d.ts.map +1 -0
  173. package/dist/resources/authorization-ceiling.js +26 -0
  174. package/dist/resources/authorization-ceiling.js.map +1 -0
  175. package/dist/resources/authorization-operation-ids.d.ts +15 -0
  176. package/dist/resources/authorization-operation-ids.d.ts.map +1 -0
  177. package/dist/resources/authorization-operation-ids.js +31 -0
  178. package/dist/resources/authorization-operation-ids.js.map +1 -0
  179. package/dist/resources/authorization.d.ts +60 -0
  180. package/dist/resources/authorization.d.ts.map +1 -0
  181. package/dist/resources/authorization.js +51 -0
  182. package/dist/resources/authorization.js.map +1 -0
  183. package/dist/resources/authorizations.d.ts +38 -0
  184. package/dist/resources/authorizations.d.ts.map +1 -0
  185. package/dist/resources/authorizations.js +19 -0
  186. package/dist/resources/authorizations.js.map +1 -0
  187. package/dist/resources/channels.d.ts +36 -0
  188. package/dist/resources/channels.d.ts.map +1 -0
  189. package/dist/resources/channels.js +61 -0
  190. package/dist/resources/channels.js.map +1 -0
  191. package/dist/resources/contracts.d.ts +46 -0
  192. package/dist/resources/contracts.d.ts.map +1 -0
  193. package/dist/resources/contracts.js +86 -0
  194. package/dist/resources/contracts.js.map +1 -0
  195. package/dist/resources/conversation-sessions.d.ts +62 -0
  196. package/dist/resources/conversation-sessions.d.ts.map +1 -0
  197. package/dist/resources/conversation-sessions.js +48 -0
  198. package/dist/resources/conversation-sessions.js.map +1 -0
  199. package/dist/resources/conversation.d.ts +48 -0
  200. package/dist/resources/conversation.d.ts.map +1 -0
  201. package/dist/resources/conversation.js +104 -0
  202. package/dist/resources/conversation.js.map +1 -0
  203. package/dist/resources/embedding-credentials.d.ts +60 -0
  204. package/dist/resources/embedding-credentials.d.ts.map +1 -0
  205. package/dist/resources/embedding-credentials.js +53 -0
  206. package/dist/resources/embedding-credentials.js.map +1 -0
  207. package/dist/resources/entities.d.ts +66 -0
  208. package/dist/resources/entities.d.ts.map +1 -0
  209. package/dist/resources/entities.js +106 -0
  210. package/dist/resources/entities.js.map +1 -0
  211. package/dist/resources/events.d.ts +45 -0
  212. package/dist/resources/events.d.ts.map +1 -0
  213. package/dist/resources/events.js +71 -0
  214. package/dist/resources/events.js.map +1 -0
  215. package/dist/resources/flows.d.ts +45 -0
  216. package/dist/resources/flows.d.ts.map +1 -0
  217. package/dist/resources/flows.js +82 -0
  218. package/dist/resources/flows.js.map +1 -0
  219. package/dist/resources/imports.d.ts +8 -0
  220. package/dist/resources/imports.d.ts.map +1 -0
  221. package/dist/resources/imports.js +14 -0
  222. package/dist/resources/imports.js.map +1 -0
  223. package/dist/resources/index.d.ts +24 -0
  224. package/dist/resources/index.d.ts.map +1 -0
  225. package/dist/resources/index.js +41 -0
  226. package/dist/resources/index.js.map +1 -0
  227. package/dist/resources/llm-credentials.d.ts +47 -0
  228. package/dist/resources/llm-credentials.d.ts.map +1 -0
  229. package/dist/resources/llm-credentials.js +46 -0
  230. package/dist/resources/llm-credentials.js.map +1 -0
  231. package/dist/resources/llm-services.d.ts +46 -0
  232. package/dist/resources/llm-services.d.ts.map +1 -0
  233. package/dist/resources/llm-services.js +41 -0
  234. package/dist/resources/llm-services.js.map +1 -0
  235. package/dist/resources/mcp.d.ts +8 -0
  236. package/dist/resources/mcp.d.ts.map +1 -0
  237. package/dist/resources/mcp.js +25 -0
  238. package/dist/resources/mcp.js.map +1 -0
  239. package/dist/resources/receipts.d.ts +25 -0
  240. package/dist/resources/receipts.d.ts.map +1 -0
  241. package/dist/resources/receipts.js +54 -0
  242. package/dist/resources/receipts.js.map +1 -0
  243. package/dist/resources/records.d.ts +51 -0
  244. package/dist/resources/records.d.ts.map +1 -0
  245. package/dist/resources/records.js +103 -0
  246. package/dist/resources/records.js.map +1 -0
  247. package/dist/resources/role-assignments.d.ts +27 -0
  248. package/dist/resources/role-assignments.d.ts.map +1 -0
  249. package/dist/resources/role-assignments.js +40 -0
  250. package/dist/resources/role-assignments.js.map +1 -0
  251. package/dist/resources/roles.d.ts +39 -0
  252. package/dist/resources/roles.d.ts.map +1 -0
  253. package/dist/resources/roles.js +42 -0
  254. package/dist/resources/roles.js.map +1 -0
  255. package/dist/resources/runtime-entities.d.ts +23 -0
  256. package/dist/resources/runtime-entities.d.ts.map +1 -0
  257. package/dist/resources/runtime-entities.js +29 -0
  258. package/dist/resources/runtime-entities.js.map +1 -0
  259. package/dist/resources/state-machine.d.ts +45 -0
  260. package/dist/resources/state-machine.d.ts.map +1 -0
  261. package/dist/resources/state-machine.js +86 -0
  262. package/dist/resources/state-machine.js.map +1 -0
  263. package/dist/resources/system.d.ts +12 -0
  264. package/dist/resources/system.d.ts.map +1 -0
  265. package/dist/resources/system.js +26 -0
  266. package/dist/resources/system.js.map +1 -0
  267. package/dist/resources/tools.d.ts +22 -0
  268. package/dist/resources/tools.d.ts.map +1 -0
  269. package/dist/resources/tools.js +33 -0
  270. package/dist/resources/tools.js.map +1 -0
  271. package/dist/resources/traces.d.ts +65 -0
  272. package/dist/resources/traces.d.ts.map +1 -0
  273. package/dist/resources/traces.js +97 -0
  274. package/dist/resources/traces.js.map +1 -0
  275. package/dist/runtime/index.d.ts +128 -0
  276. package/dist/runtime/index.d.ts.map +1 -0
  277. package/dist/runtime/index.js +210 -0
  278. package/dist/runtime/index.js.map +1 -0
  279. package/dist/types/actions.d.ts +32 -0
  280. package/dist/types/actions.d.ts.map +1 -0
  281. package/dist/types/actions.js +9 -0
  282. package/dist/types/actions.js.map +1 -0
  283. package/dist/types/audit.d.ts +65 -0
  284. package/dist/types/audit.d.ts.map +1 -0
  285. package/dist/types/audit.js +14 -0
  286. package/dist/types/audit.js.map +1 -0
  287. package/dist/types/channels.d.ts +37 -0
  288. package/dist/types/channels.d.ts.map +1 -0
  289. package/dist/types/channels.js +6 -0
  290. package/dist/types/channels.js.map +1 -0
  291. package/dist/types/confirmation.d.ts +53 -0
  292. package/dist/types/confirmation.d.ts.map +1 -0
  293. package/dist/types/confirmation.js +17 -0
  294. package/dist/types/confirmation.js.map +1 -0
  295. package/dist/types/contracts.d.ts +194 -0
  296. package/dist/types/contracts.d.ts.map +1 -0
  297. package/dist/types/contracts.js +10 -0
  298. package/dist/types/contracts.js.map +1 -0
  299. package/dist/types/conversation-sessions.d.ts +58 -0
  300. package/dist/types/conversation-sessions.d.ts.map +1 -0
  301. package/dist/types/conversation-sessions.js +6 -0
  302. package/dist/types/conversation-sessions.js.map +1 -0
  303. package/dist/types/conversation.d.ts +96 -0
  304. package/dist/types/conversation.d.ts.map +1 -0
  305. package/dist/types/conversation.js +3 -0
  306. package/dist/types/conversation.js.map +1 -0
  307. package/dist/types/entities.d.ts +22 -0
  308. package/dist/types/entities.d.ts.map +1 -0
  309. package/dist/types/entities.js +4 -0
  310. package/dist/types/entities.js.map +1 -0
  311. package/dist/types/events-stream.d.ts +82 -0
  312. package/dist/types/events-stream.d.ts.map +1 -0
  313. package/dist/types/events-stream.js +65 -0
  314. package/dist/types/events-stream.js.map +1 -0
  315. package/dist/types/flows-contract.d.ts +8 -0
  316. package/dist/types/flows-contract.d.ts.map +1 -0
  317. package/dist/types/flows-contract.js +7 -0
  318. package/dist/types/flows-contract.js.map +1 -0
  319. package/dist/types/flows.d.ts +66 -0
  320. package/dist/types/flows.d.ts.map +1 -0
  321. package/dist/types/flows.js +25 -0
  322. package/dist/types/flows.js.map +1 -0
  323. package/dist/types/imports.d.ts +57 -0
  324. package/dist/types/imports.d.ts.map +1 -0
  325. package/dist/types/imports.js +3 -0
  326. package/dist/types/imports.js.map +1 -0
  327. package/dist/types/index.d.ts +17 -0
  328. package/dist/types/index.d.ts.map +1 -0
  329. package/dist/types/index.js +3 -0
  330. package/dist/types/index.js.map +1 -0
  331. package/dist/types/locale.d.ts +24 -0
  332. package/dist/types/locale.d.ts.map +1 -0
  333. package/dist/types/locale.js +17 -0
  334. package/dist/types/locale.js.map +1 -0
  335. package/dist/types/mcp.d.ts +28 -0
  336. package/dist/types/mcp.d.ts.map +1 -0
  337. package/dist/types/mcp.js +12 -0
  338. package/dist/types/mcp.js.map +1 -0
  339. package/dist/types/platform.d.ts +51 -0
  340. package/dist/types/platform.d.ts.map +1 -0
  341. package/dist/types/platform.js +4 -0
  342. package/dist/types/platform.js.map +1 -0
  343. package/dist/types/receipt.d.ts +79 -0
  344. package/dist/types/receipt.d.ts.map +1 -0
  345. package/dist/types/receipt.js +15 -0
  346. package/dist/types/receipt.js.map +1 -0
  347. package/dist/types/records.d.ts +45 -0
  348. package/dist/types/records.d.ts.map +1 -0
  349. package/dist/types/records.js +4 -0
  350. package/dist/types/records.js.map +1 -0
  351. package/dist/types/spec.d.ts +6 -0
  352. package/dist/types/spec.d.ts.map +1 -0
  353. package/dist/types/spec.js +3 -0
  354. package/dist/types/spec.js.map +1 -0
  355. package/dist/types/state-machine.d.ts +100 -0
  356. package/dist/types/state-machine.d.ts.map +1 -0
  357. package/dist/types/state-machine.js +9 -0
  358. package/dist/types/state-machine.js.map +1 -0
  359. package/dist/types/system.d.ts +28 -0
  360. package/dist/types/system.d.ts.map +1 -0
  361. package/dist/types/system.js +3 -0
  362. package/dist/types/system.js.map +1 -0
  363. package/dist/types/tools.d.ts +188 -0
  364. package/dist/types/tools.d.ts.map +1 -0
  365. package/dist/types/tools.js +22 -0
  366. package/dist/types/tools.js.map +1 -0
  367. package/dist/types/traces.d.ts +77 -0
  368. package/dist/types/traces.d.ts.map +1 -0
  369. package/dist/types/traces.js +11 -0
  370. package/dist/types/traces.js.map +1 -0
  371. package/dist/types/workflows.d.ts +42 -0
  372. package/dist/types/workflows.d.ts.map +1 -0
  373. package/dist/types/workflows.js +11 -0
  374. package/dist/types/workflows.js.map +1 -0
  375. package/package.json +103 -0
@@ -0,0 +1,46 @@
1
+ /**
2
+ * LLM service catalog resource (T074, SpecKit 010 / ADR-0087).
3
+ *
4
+ * Read-only over the LLM service catalog, ALWAYS actor-filtered (FR-B02
5
+ * no-leak). The wire surface returns only services for which the actor has
6
+ * a `use` policy in the requested scope; privileged roles see everything
7
+ * because their YAML policies grant them `use` on every service (no code-
8
+ * level role bypass — ADR-0001 §6).
9
+ */
10
+ import type { FetchClient } from '../_internal/fetch-client';
11
+ import type { LocaleOptions } from '../types/locale';
12
+ export type LlmServiceProvider = 'anthropic' | 'bedrock' | 'gemini' | 'openai';
13
+ export type LlmServiceScope = 'runtime' | 'contract';
14
+ export interface LlmService {
15
+ name: string;
16
+ provider: LlmServiceProvider;
17
+ model: string;
18
+ priority: number;
19
+ position: number;
20
+ /** Per-service override; absent when null (drops null per FR-A06). */
21
+ temperature?: number;
22
+ /** Per-service override; absent when null. */
23
+ max_tokens?: number;
24
+ }
25
+ export type LlmServicesListResponse = LlmService[];
26
+ export type LlmServiceResponse = LlmService;
27
+ export interface LlmServiceQuery {
28
+ /** REQUIRED — `runtime` or `contract`. The actor's allowlist for that scope. */
29
+ scope: LlmServiceScope;
30
+ }
31
+ export declare class LlmServicesResource {
32
+ private readonly client;
33
+ constructor(client: FetchClient);
34
+ /**
35
+ * List the LLM services the actor is authorized to `use` in `scope`.
36
+ * Privileged operators see the full catalog because their YAML policies
37
+ * grant them `use` on every service.
38
+ */
39
+ list(query: LlmServiceQuery, options?: LocaleOptions): Promise<LlmServicesListResponse>;
40
+ /**
41
+ * Fetch a single service by name in `scope`. Returns 404 indistinguishable
42
+ * from "doesn't exist" when the actor is not authorized (FR-B02 no-leak).
43
+ */
44
+ get(name: string, query: LlmServiceQuery, options?: LocaleOptions): Promise<LlmServiceResponse>;
45
+ }
46
+ //# sourceMappingURL=llm-services.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-services.d.ts","sourceRoot":"","sources":["../../src/resources/llm-services.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAC/E,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,UAAU,CAAC;AAErD,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,uBAAuB,GAAG,UAAU,EAAE,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAE5C,MAAM,WAAW,eAAe;IAC5B,gFAAgF;IAChF,KAAK,EAAE,eAAe,CAAC;CAC1B;AAED,qBAAa,mBAAmB;IAChB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;;OAIG;IACG,IAAI,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAM7F;;;OAGG;IACG,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC;CASxG"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ /**
3
+ * LLM service catalog resource (T074, SpecKit 010 / ADR-0087).
4
+ *
5
+ * Read-only over the LLM service catalog, ALWAYS actor-filtered (FR-B02
6
+ * no-leak). The wire surface returns only services for which the actor has
7
+ * a `use` policy in the requested scope; privileged roles see everything
8
+ * because their YAML policies grant them `use` on every service (no code-
9
+ * level role bypass — ADR-0001 §6).
10
+ */
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.LlmServicesResource = void 0;
13
+ class LlmServicesResource {
14
+ client;
15
+ constructor(client) {
16
+ this.client = client;
17
+ }
18
+ /**
19
+ * List the LLM services the actor is authorized to `use` in `scope`.
20
+ * Privileged operators see the full catalog because their YAML policies
21
+ * grant them `use` on every service.
22
+ */
23
+ async list(query, options) {
24
+ const params = new URLSearchParams({ scope: query.scope });
25
+ if (options?.locale)
26
+ params.set('locale', options.locale);
27
+ return this.client.get(`/runtime/llm/services?${params.toString()}`, undefined, { operationId: 'listLlmServices' });
28
+ }
29
+ /**
30
+ * Fetch a single service by name in `scope`. Returns 404 indistinguishable
31
+ * from "doesn't exist" when the actor is not authorized (FR-B02 no-leak).
32
+ */
33
+ async get(name, query, options) {
34
+ const params = new URLSearchParams({ scope: query.scope });
35
+ if (options?.locale)
36
+ params.set('locale', options.locale);
37
+ return this.client.get(`/runtime/llm/services/${encodeURIComponent(name)}?${params.toString()}`, undefined, { operationId: 'getLlmService' });
38
+ }
39
+ }
40
+ exports.LlmServicesResource = LlmServicesResource;
41
+ //# sourceMappingURL=llm-services.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"llm-services.js","sourceRoot":"","sources":["../../src/resources/llm-services.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;AA8BH,MAAa,mBAAmB;IACC;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;;OAIG;IACH,KAAK,CAAC,IAAI,CAAC,KAAsB,EAAE,OAAuB;QACtD,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3D,IAAI,OAAO,EAAE,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA0B,yBAAyB,MAAM,CAAC,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC,CAAC;IACjJ,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,KAAsB,EAAE,OAAuB;QACnE,MAAM,MAAM,GAAG,IAAI,eAAe,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3D,IAAI,OAAO,EAAE,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAClB,yBAAyB,kBAAkB,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,EAAE,EACxE,SAAS,EACT,EAAE,WAAW,EAAE,eAAe,EAAE,CACnC,CAAC;IACN,CAAC;CACJ;AA3BD,kDA2BC"}
@@ -0,0 +1,8 @@
1
+ import type { FetchClient } from '../_internal/fetch-client';
2
+ import type { McpJsonRpcRequest, McpJsonRpcResponse } from '../types/mcp';
3
+ export declare class McpResource {
4
+ private readonly client;
5
+ constructor(client: FetchClient);
6
+ call(message: McpJsonRpcRequest): Promise<McpJsonRpcResponse>;
7
+ }
8
+ //# sourceMappingURL=mcp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.d.ts","sourceRoot":"","sources":["../../src/resources/mcp.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAE1E,qBAAa,WAAW;IACR,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,IAAI,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAGhE"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ // Spec 2 (track G) — runtime.mcp.call.
3
+ //
4
+ // Types the now-real MCP "Streamable HTTP" transport (POST /runtime/mcp,
5
+ // stateless JSON-RPC; Spec 1 = PR #133). Sends one MCP JSON-RPC message and
6
+ // returns the typed response, de-framing either an application/json body or a
7
+ // single text/event-stream frame. Bare JSON-RPC — NOT the {success,data}
8
+ // envelope. A protocol-level JSON-RPC error is returned in the union (callers
9
+ // discriminate with `'error' in res`); transport failures throw. Single
10
+ // attempt — no retry (tools/call may be a non-idempotent mutation). For a full
11
+ // MCP client (sessions, server-push) use @modelcontextprotocol/sdk; this is a
12
+ // thin, zero-dependency one-shot call.
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.McpResource = void 0;
15
+ class McpResource {
16
+ client;
17
+ constructor(client) {
18
+ this.client = client;
19
+ }
20
+ call(message) {
21
+ return this.client.postMcp('/runtime/mcp', message);
22
+ }
23
+ }
24
+ exports.McpResource = McpResource;
25
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../../src/resources/mcp.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,8EAA8E;AAC9E,yEAAyE;AACzE,8EAA8E;AAC9E,wEAAwE;AACxE,+EAA+E;AAC/E,8EAA8E;AAC9E,uCAAuC;;;AAKvC,MAAa,WAAW;IACS;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,IAAI,CAAC,OAA0B;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;CACJ;AAND,kCAMC"}
@@ -0,0 +1,25 @@
1
+ import type { FetchClient } from '../_internal/fetch-client';
2
+ import { PagePromise } from '../_internal/pagination';
3
+ import type { Receipt, ReceiptListParams, ReceiptListResponse } from '../types/receipt';
4
+ /**
5
+ * End-user verifiable receipts resource (Desk Spec 3).
6
+ *
7
+ * client.runtime.receipts.list() → GET /runtime/receipts
8
+ * client.runtime.receipts.list({ signal: 'refusal' })
9
+ * client.runtime.receipts.list({ trace_id })
10
+ *
11
+ * Returns a {@link PagePromise}: `await` it for the first page
12
+ * (`{ items, next_cursor }`), or `for await (… of …)` to auto-paginate over
13
+ * every receipt to exhaustion. Each `Receipt` is the CALLER'S OWN governance
14
+ * event (scoped server-side to the token actor — no `view_traces`), carrying
15
+ * only a non-reversible proof (hash + masked value), never the raw value.
16
+ * Mirrors `client.runtime.audit.list` (the operator, tenant-wide surface).
17
+ */
18
+ export declare class ReceiptsResource {
19
+ private readonly client;
20
+ constructor(client: FetchClient);
21
+ list(params?: ReceiptListParams, options?: {
22
+ signal?: AbortSignal;
23
+ }): PagePromise<ReceiptListResponse, Receipt>;
24
+ }
25
+ //# sourceMappingURL=receipts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receipts.d.ts","sourceRoot":"","sources":["../../src/resources/receipts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAgC,MAAM,yBAAyB,CAAC;AACpF,OAAO,KAAK,EAAE,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAExF;;;;;;;;;;;;;GAaG;AACH,qBAAa,gBAAgB;IACN,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,IAAI,CACP,MAAM,CAAC,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GACnC,WAAW,CAAC,mBAAmB,EAAE,OAAO,CAAC;CA6B/C"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReceiptsResource = void 0;
4
+ const pagination_1 = require("../_internal/pagination");
5
+ /**
6
+ * End-user verifiable receipts resource (Desk Spec 3).
7
+ *
8
+ * client.runtime.receipts.list() → GET /runtime/receipts
9
+ * client.runtime.receipts.list({ signal: 'refusal' })
10
+ * client.runtime.receipts.list({ trace_id })
11
+ *
12
+ * Returns a {@link PagePromise}: `await` it for the first page
13
+ * (`{ items, next_cursor }`), or `for await (… of …)` to auto-paginate over
14
+ * every receipt to exhaustion. Each `Receipt` is the CALLER'S OWN governance
15
+ * event (scoped server-side to the token actor — no `view_traces`), carrying
16
+ * only a non-reversible proof (hash + masked value), never the raw value.
17
+ * Mirrors `client.runtime.audit.list` (the operator, tenant-wide surface).
18
+ */
19
+ class ReceiptsResource {
20
+ client;
21
+ constructor(client) {
22
+ this.client = client;
23
+ }
24
+ list(params, options) {
25
+ const path = '/runtime/receipts';
26
+ const buildQuery = (cursor, limit) => {
27
+ const query = {};
28
+ if (params?.signal !== undefined)
29
+ query.signal = params.signal;
30
+ if (params?.trace_id !== undefined)
31
+ query.trace_id = params.trace_id;
32
+ if (params?.from !== undefined)
33
+ query.from = params.from;
34
+ if (params?.to !== undefined)
35
+ query.to = params.to;
36
+ if (limit !== undefined)
37
+ query.limit = limit;
38
+ if (cursor !== undefined)
39
+ query.cursor = cursor;
40
+ return query;
41
+ };
42
+ const signal = options?.signal;
43
+ const fetchPage = (p) => this.client.get(path, buildQuery(p.cursor, p.limit), {
44
+ operationId: 'listReceipts',
45
+ ...(signal ? { signal } : {}),
46
+ });
47
+ return new pagination_1.PagePromise(fetchPage, (0, pagination_1.cursorBased)((page) => page.items, (page) => page.next_cursor), {
48
+ ...(params?.limit !== undefined ? { limit: params.limit } : {}),
49
+ ...(params?.cursor !== undefined ? { cursor: params.cursor } : {}),
50
+ });
51
+ }
52
+ }
53
+ exports.ReceiptsResource = ReceiptsResource;
54
+ //# sourceMappingURL=receipts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"receipts.js","sourceRoot":"","sources":["../../src/resources/receipts.ts"],"names":[],"mappings":";;;AACA,wDAAoF;AAGpF;;;;;;;;;;;;;GAaG;AACH,MAAa,gBAAgB;IACW;IAApC,YAAoC,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,IAAI,CACP,MAA0B,EAC1B,OAAkC;QAElC,MAAM,IAAI,GAAG,mBAAmB,CAAC;QACjC,MAAM,UAAU,GAAG,CAAC,MAAe,EAAE,KAAc,EAAyD,EAAE;YAC1G,MAAM,KAAK,GAA0D,EAAE,CAAC;YACxE,IAAI,MAAM,EAAE,MAAM,KAAK,SAAS;gBAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;YAC/D,IAAI,MAAM,EAAE,QAAQ,KAAK,SAAS;gBAAE,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;YACrE,IAAI,MAAM,EAAE,IAAI,KAAK,SAAS;gBAAE,KAAK,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;YACzD,IAAI,MAAM,EAAE,EAAE,KAAK,SAAS;gBAAE,KAAK,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;YACnD,IAAI,KAAK,KAAK,SAAS;gBAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;YAC7C,IAAI,MAAM,KAAK,SAAS;gBAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;YAChD,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC;QAEF,MAAM,MAAM,GAAG,OAAO,EAAE,MAAM,CAAC;QAC/B,MAAM,SAAS,GAAG,CAAC,CAAa,EAAgC,EAAE,CAC9D,IAAI,CAAC,MAAM,CAAC,GAAG,CAAsB,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,EAAE;YACtE,WAAW,EAAE,cAAc;YAC3B,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAChC,CAAC,CAAC;QAEP,OAAO,IAAI,wBAAW,CAClB,SAAS,EACT,IAAA,wBAAW,EAA+B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,WAAW,CAAC,EAC3F;YACI,GAAG,CAAC,MAAM,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAC/D,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrE,CACJ,CAAC;IACN,CAAC;CACJ;AAnCD,4CAmCC"}
@@ -0,0 +1,51 @@
1
+ import { type FetchClient } from '../_internal/fetch-client';
2
+ import { PagePromise } from '../_internal/pagination';
3
+ import type { ConfirmationRetryOptions } from '../types/confirmation';
4
+ import type { BulkImportRequest, BulkImportResponse } from '../types/imports';
5
+ import type { RecordData, RecordListParams, RecordListResponse, RecordResponse } from '../types/records';
6
+ import type { LocaleOptions } from '../types/locale';
7
+ /** Options for paginated list calls — locale plus an optional cancellation signal. */
8
+ type ListOptions = LocaleOptions & {
9
+ signal?: AbortSignal;
10
+ };
11
+ export declare class RecordsResource {
12
+ private readonly client;
13
+ constructor(client: FetchClient);
14
+ /**
15
+ * List and filter records for a given entity.
16
+ *
17
+ * Returns a {@link PagePromise}: `await` it for the first page
18
+ * (`{ records, total }` — unchanged), or `for await (… of …)` to
19
+ * auto-paginate over every record across all pages. Pass `{ signal }` to
20
+ * cancel an in-flight page; `break` also stops further fetches.
21
+ */
22
+ list(entityName: string, params?: RecordListParams, options?: ListOptions): PagePromise<RecordListResponse, RecordData>;
23
+ /**
24
+ * Get a single record by ID.
25
+ */
26
+ get(entityName: string, recordId: string | number, options?: LocaleOptions): Promise<RecordResponse>;
27
+ /**
28
+ * Create a new record for the specified entity.
29
+ *
30
+ * A `confirm` guard can pause this write: the thrown `ZarelAPIError` carries
31
+ * `.confirmation` (ADR-0127 US3). Show every `guards[].prompt`, then call
32
+ * again with the IDENTICAL `data` plus `{ confirmationToken }`.
33
+ */
34
+ create(entityName: string, data: Record<string, unknown>, options?: ConfirmationRetryOptions): Promise<RecordResponse>;
35
+ /**
36
+ * Create multiple records for the specified entity in a single request.
37
+ */
38
+ bulk(entityName: string, request: BulkImportRequest): Promise<BulkImportResponse>;
39
+ /**
40
+ * Update an existing record. See {@link create} for the confirmation
41
+ * round-trip `options.confirmationToken` completes.
42
+ */
43
+ update(entityName: string, recordId: string | number, data: Partial<RecordData>, options?: ConfirmationRetryOptions): Promise<RecordResponse>;
44
+ /**
45
+ * Delete a record. See {@link create} for the confirmation round-trip
46
+ * `options.confirmationToken` completes.
47
+ */
48
+ delete(entityName: string, recordId: string | number, options?: ConfirmationRetryOptions): Promise<void>;
49
+ }
50
+ export {};
51
+ //# sourceMappingURL=records.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../src/resources/records.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,2BAA2B,CAAC;AAE1E,OAAO,EAAE,WAAW,EAAoC,MAAM,yBAAyB,CAAC;AACxF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EACR,UAAU,EACV,gBAAgB,EAChB,kBAAkB,EAClB,cAAc,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,sFAAsF;AACtF,KAAK,WAAW,GAAG,aAAa,GAAG;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,CAAC;AAE5D,qBAAa,eAAe;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;;;;;OAOG;IACH,IAAI,CACA,UAAU,EAAE,MAAM,EAClB,MAAM,CAAC,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,WAAW,GACtB,WAAW,CAAC,kBAAkB,EAAE,UAAU,CAAC;IAyC9C;;OAEG;IACG,GAAG,CACL,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,OAAO,CAAC,EAAE,aAAa,GACxB,OAAO,CAAC,cAAc,CAAC;IAQ1B;;;;;;OAMG;IACG,MAAM,CACR,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,OAAO,CAAC,EAAE,wBAAwB,GACnC,OAAO,CAAC,cAAc,CAAC;IAO1B;;OAEG;IACG,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAIvF;;;OAGG;IACG,MAAM,CACR,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,EACzB,OAAO,CAAC,EAAE,wBAAwB,GACnC,OAAO,CAAC,cAAc,CAAC;IAO1B;;;OAGG;IACG,MAAM,CACR,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,OAAO,CAAC,EAAE,wBAAwB,GACnC,OAAO,CAAC,IAAI,CAAC;CAMnB"}
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RecordsResource = void 0;
4
+ const fetch_client_1 = require("../_internal/fetch-client");
5
+ const confirmation_1 = require("../_internal/confirmation");
6
+ const pagination_1 = require("../_internal/pagination");
7
+ class RecordsResource {
8
+ client;
9
+ constructor(client) {
10
+ this.client = client;
11
+ }
12
+ /**
13
+ * List and filter records for a given entity.
14
+ *
15
+ * Returns a {@link PagePromise}: `await` it for the first page
16
+ * (`{ records, total }` — unchanged), or `for await (… of …)` to
17
+ * auto-paginate over every record across all pages. Pass `{ signal }` to
18
+ * cancel an in-flight page; `break` also stops further fetches.
19
+ */
20
+ list(entityName, params, options) {
21
+ const buildQuery = (offset, limit) => {
22
+ const query = {};
23
+ if (limit !== undefined)
24
+ query.limit = limit;
25
+ if (offset !== undefined)
26
+ query.offset = offset;
27
+ if (params?.filters) {
28
+ for (const [key, value] of Object.entries(params.filters)) {
29
+ if (value === null || value === undefined)
30
+ continue;
31
+ if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
32
+ query[`filters[${key}]`] = value;
33
+ }
34
+ else {
35
+ query[`filters[${key}]`] = JSON.stringify(value);
36
+ }
37
+ }
38
+ }
39
+ if (params?.sort && params.sort.length > 0) {
40
+ query.sort = JSON.stringify(params.sort);
41
+ }
42
+ if (options?.locale)
43
+ query.locale = options.locale;
44
+ return query;
45
+ };
46
+ const signal = options?.signal;
47
+ const fetchPage = (p) => {
48
+ const query = buildQuery(p.offset, p.limit);
49
+ return this.client.get(`/runtime/records/${entityName}`, query, { operationId: 'listRuntimeRecords', ...(signal ? { signal } : {}) });
50
+ };
51
+ return new pagination_1.PagePromise(fetchPage, (0, pagination_1.offsetWithTotal)((page) => page.records, (page) => page.total), {
52
+ ...(params?.limit !== undefined ? { limit: params.limit } : {}),
53
+ ...(params?.offset !== undefined ? { offset: params.offset } : {}),
54
+ });
55
+ }
56
+ /**
57
+ * Get a single record by ID.
58
+ */
59
+ async get(entityName, recordId, options) {
60
+ return this.client.get(`/runtime/records/${entityName}/${recordId}`, (0, fetch_client_1.localeQuery)(options), { operationId: 'getRuntimeRecord' });
61
+ }
62
+ /**
63
+ * Create a new record for the specified entity.
64
+ *
65
+ * A `confirm` guard can pause this write: the thrown `ZarelAPIError` carries
66
+ * `.confirmation` (ADR-0127 US3). Show every `guards[].prompt`, then call
67
+ * again with the IDENTICAL `data` plus `{ confirmationToken }`.
68
+ */
69
+ async create(entityName, data, options) {
70
+ return this.client.post(`/runtime/records/${entityName}`, data, {
71
+ operationId: 'createRuntimeRecord',
72
+ headers: (0, confirmation_1.confirmationHeaders)(options?.confirmationToken),
73
+ });
74
+ }
75
+ /**
76
+ * Create multiple records for the specified entity in a single request.
77
+ */
78
+ async bulk(entityName, request) {
79
+ return this.client.post(`/runtime/records/${entityName}/bulk`, request, { operationId: 'bulkImportRuntimeRecords' });
80
+ }
81
+ /**
82
+ * Update an existing record. See {@link create} for the confirmation
83
+ * round-trip `options.confirmationToken` completes.
84
+ */
85
+ async update(entityName, recordId, data, options) {
86
+ return this.client.patch(`/runtime/records/${entityName}/${recordId}`, data, {
87
+ operationId: 'patchRuntimeRecord',
88
+ headers: (0, confirmation_1.confirmationHeaders)(options?.confirmationToken),
89
+ });
90
+ }
91
+ /**
92
+ * Delete a record. See {@link create} for the confirmation round-trip
93
+ * `options.confirmationToken` completes.
94
+ */
95
+ async delete(entityName, recordId, options) {
96
+ await this.client.del(`/runtime/records/${entityName}/${recordId}`, {
97
+ operationId: 'deleteRuntimeRecord',
98
+ headers: (0, confirmation_1.confirmationHeaders)(options?.confirmationToken),
99
+ });
100
+ }
101
+ }
102
+ exports.RecordsResource = RecordsResource;
103
+ //# sourceMappingURL=records.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"records.js","sourceRoot":"","sources":["../../src/resources/records.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,27 @@
1
+ import { type FetchClient } from '../_internal/fetch-client';
2
+ import type { RoleAssignRequest } from '../types/platform';
3
+ import type { LocaleOptions } from '../types/locale';
4
+ import type { RoleAssignmentListPayload, RoleAssignmentPayload } from '../generated';
5
+ /**
6
+ * Role assignments (runtime-scope, resource-shaped). Replaces the pre-P12
7
+ * action-style `RolesResource.assign/revoke` with canonical CRUD that
8
+ * mirrors `/runtime/roles/assignments`.
9
+ */
10
+ export declare class RoleAssignmentsResource {
11
+ private readonly client;
12
+ constructor(client: FetchClient);
13
+ list(options?: LocaleOptions): Promise<RoleAssignmentListPayload>;
14
+ /**
15
+ * Assign a role to a user (canonical POST).
16
+ *
17
+ * The SDK input shape uses `target_user_name` to distinguish the
18
+ * grantee from the calling actor; the api-service collection takes
19
+ * `user_name`, so the body is mapped here at the wire boundary.
20
+ */
21
+ create(request: RoleAssignRequest): Promise<RoleAssignmentPayload>;
22
+ /**
23
+ * Revoke a role assignment (canonical DELETE by composite natural key).
24
+ */
25
+ delete(userName: string, roleName: string): Promise<void>;
26
+ }
27
+ //# sourceMappingURL=role-assignments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role-assignments.d.ts","sourceRoot":"","sources":["../../src/resources/role-assignments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAErF;;;;GAIG;AACH,qBAAa,uBAAuB;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAIvE;;;;;;OAMG;IACG,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAQxE;;OAEG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAMlE"}
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RoleAssignmentsResource = void 0;
4
+ const fetch_client_1 = require("../_internal/fetch-client");
5
+ /**
6
+ * Role assignments (runtime-scope, resource-shaped). Replaces the pre-P12
7
+ * action-style `RolesResource.assign/revoke` with canonical CRUD that
8
+ * mirrors `/runtime/roles/assignments`.
9
+ */
10
+ class RoleAssignmentsResource {
11
+ client;
12
+ constructor(client) {
13
+ this.client = client;
14
+ }
15
+ async list(options) {
16
+ return this.client.get('/runtime/roles/assignments', (0, fetch_client_1.localeQuery)(options), { operationId: 'listRoleAssignments' });
17
+ }
18
+ /**
19
+ * Assign a role to a user (canonical POST).
20
+ *
21
+ * The SDK input shape uses `target_user_name` to distinguish the
22
+ * grantee from the calling actor; the api-service collection takes
23
+ * `user_name`, so the body is mapped here at the wire boundary.
24
+ */
25
+ async create(request) {
26
+ return this.client.post('/runtime/roles/assignments', {
27
+ user_name: request.target_user_name,
28
+ role_name: request.role_name,
29
+ ...(request.expires_at !== undefined ? { expires_at: request.expires_at } : {}),
30
+ }, { operationId: 'createRoleAssignment' });
31
+ }
32
+ /**
33
+ * Revoke a role assignment (canonical DELETE by composite natural key).
34
+ */
35
+ async delete(userName, roleName) {
36
+ await this.client.del(`/runtime/roles/assignments/${encodeURIComponent(userName)}/${encodeURIComponent(roleName)}`, { operationId: 'deleteRoleAssignment' });
37
+ }
38
+ }
39
+ exports.RoleAssignmentsResource = RoleAssignmentsResource;
40
+ //# sourceMappingURL=role-assignments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"role-assignments.js","sourceRoot":"","sources":["../../src/resources/role-assignments.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAK1E;;;;GAIG;AACH,MAAa,uBAAuB;IACH;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAAC,OAAuB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAA4B,4BAA4B,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAC,CAAC;IAClJ,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,OAA0B;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAwB,4BAA4B,EAAE;YACzE,SAAS,EAAE,OAAO,CAAC,gBAAgB;YACnC,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,GAAG,CAAC,OAAO,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClF,EAAE,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAAC,CAAC;IAChD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,QAAgB;QAC3C,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CACjB,8BAA8B,kBAAkB,CAAC,QAAQ,CAAC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE,EAC5F,EAAE,WAAW,EAAE,sBAAsB,EAAE,CAC1C,CAAC;IACN,CAAC;CACJ;AA/BD,0DA+BC"}
@@ -0,0 +1,39 @@
1
+ import { type FetchClient } from '../_internal/fetch-client';
2
+ import type { LocaleOptions } from '../types/locale';
3
+ import type { RolePayload } from '../generated';
4
+ export interface RoleCreateInput {
5
+ readonly name: string;
6
+ readonly label: string;
7
+ readonly description?: string;
8
+ readonly auto_assign?: boolean;
9
+ }
10
+ export interface RoleUpdatePatch {
11
+ readonly label?: string;
12
+ readonly description?: string;
13
+ readonly auto_assign?: boolean;
14
+ }
15
+ /** Codegen-derived (ADR-0109); the stable consumer-facing name is kept. */
16
+ export type RoleRecord = RolePayload;
17
+ /**
18
+ * CRUD over `contract.roles` — the role definitions the tenant declares
19
+ * outside (or alongside) a YAML import. Maps to api-service `/roles` per
20
+ * ADR-0077 canonical routes; class name follows ADR-0080 §1
21
+ * (`contract.roles` → `RoleRepository` → `RolesResource`).
22
+ *
23
+ * Role assignments live on `runtime."roles/assignments"` and are exposed
24
+ * via `RoleAssignmentsResource` — they are a separate table, not a
25
+ * sub-method of this resource (see role-assignments.ts).
26
+ */
27
+ export declare class RolesResource {
28
+ private readonly client;
29
+ constructor(client: FetchClient);
30
+ list(options?: LocaleOptions): Promise<RoleRecord[]>;
31
+ /** Read a single role definition by name. Sub-spec A (A4) gap-fill. */
32
+ get(name: string, options?: LocaleOptions): Promise<RoleRecord>;
33
+ create(input: RoleCreateInput): Promise<RoleRecord>;
34
+ /** Replace a role definition wholesale (PUT). {@link update} is the partial (PATCH) counterpart. */
35
+ put(name: string, input: RoleCreateInput): Promise<RoleRecord>;
36
+ update(name: string, patch: RoleUpdatePatch): Promise<RoleRecord>;
37
+ delete(name: string): Promise<void>;
38
+ }
39
+ //# sourceMappingURL=roles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/resources/roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAe,MAAM,2BAA2B,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;CAClC;AAED,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAAG,WAAW,CAAC;AAErC;;;;;;;;;GASG;AACH,qBAAa,aAAa;IACV,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,IAAI,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAI1D,uEAAuE;IACjE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC;IAI/D,MAAM,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IAIzD,oGAAoG;IAC9F,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IAI9D,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,UAAU,CAAC;IAIjE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG5C"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RolesResource = void 0;
4
+ const fetch_client_1 = require("../_internal/fetch-client");
5
+ /**
6
+ * CRUD over `contract.roles` — the role definitions the tenant declares
7
+ * outside (or alongside) a YAML import. Maps to api-service `/roles` per
8
+ * ADR-0077 canonical routes; class name follows ADR-0080 §1
9
+ * (`contract.roles` → `RoleRepository` → `RolesResource`).
10
+ *
11
+ * Role assignments live on `runtime."roles/assignments"` and are exposed
12
+ * via `RoleAssignmentsResource` — they are a separate table, not a
13
+ * sub-method of this resource (see role-assignments.ts).
14
+ */
15
+ class RolesResource {
16
+ client;
17
+ constructor(client) {
18
+ this.client = client;
19
+ }
20
+ async list(options) {
21
+ return this.client.get('/contract/roles', (0, fetch_client_1.localeQuery)(options), { operationId: 'listRoles' });
22
+ }
23
+ /** Read a single role definition by name. Sub-spec A (A4) gap-fill. */
24
+ async get(name, options) {
25
+ return this.client.get(`/contract/roles/${encodeURIComponent(name)}`, (0, fetch_client_1.localeQuery)(options), { operationId: 'getRole' });
26
+ }
27
+ async create(input) {
28
+ return this.client.post('/contract/roles', input, { operationId: 'createRole' });
29
+ }
30
+ /** Replace a role definition wholesale (PUT). {@link update} is the partial (PATCH) counterpart. */
31
+ async put(name, input) {
32
+ return this.client.put(`/contract/roles/${encodeURIComponent(name)}`, input, { operationId: 'replaceRole' });
33
+ }
34
+ async update(name, patch) {
35
+ return this.client.patch(`/contract/roles/${encodeURIComponent(name)}`, patch, { operationId: 'patchRole' });
36
+ }
37
+ async delete(name) {
38
+ await this.client.del(`/contract/roles/${encodeURIComponent(name)}`, { operationId: 'deleteRole' });
39
+ }
40
+ }
41
+ exports.RolesResource = RolesResource;
42
+ //# sourceMappingURL=roles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.js","sourceRoot":"","sources":["../../src/resources/roles.ts"],"names":[],"mappings":";;;AAAA,4DAA0E;AAoB1E;;;;;;;;;GASG;AACH,MAAa,aAAa;IACO;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,IAAI,CAAC,OAAuB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAe,iBAAiB,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IAChH,CAAC;IAED,uEAAuE;IACvE,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,OAAuB;QAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa,mBAAmB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,IAAA,0BAAW,EAAC,OAAO,CAAC,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,CAAC,CAAC;IACxI,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAsB;QAC/B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAa,iBAAiB,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;IACjG,CAAC;IAED,oGAAoG;IACpG,KAAK,CAAC,GAAG,CAAC,IAAY,EAAE,KAAsB;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAa,mBAAmB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,CAAC;IAC7H,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY,EAAE,KAAsB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAa,mBAAmB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IAC7H,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAAY;QACrB,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,mBAAmB,kBAAkB,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;IACxG,CAAC;CACJ;AA5BD,sCA4BC"}
@@ -0,0 +1,23 @@
1
+ import type { FetchClient } from '../_internal/fetch-client';
2
+ import type { EntityMutationPayload } from '../generated';
3
+ /**
4
+ * Runtime-plane entity operations.
5
+ *
6
+ * Only `recompute` lives here, and deliberately so: ADR-0098 D9 puts entity and
7
+ * field AUTHORING on the contract plane (`client.contract.entities`), because
8
+ * those mutate contract state. Recompute mutates `runtime.records`, so it is a
9
+ * runtime-plane verb and shares both implementation and authority with the MCP
10
+ * `recompute_entity` tool.
11
+ *
12
+ * It moved here from `contract.entities.recompute`, where serving it required
13
+ * the contract binary to spawn a runtime writer.
14
+ */
15
+ export declare class RuntimeEntitiesResource {
16
+ private readonly client;
17
+ constructor(client: FetchClient);
18
+ /**
19
+ * Recompute the derived fields of every record of an entity.
20
+ */
21
+ recompute(entityName: string): Promise<EntityMutationPayload>;
22
+ }
23
+ //# sourceMappingURL=runtime-entities.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-entities.d.ts","sourceRoot":"","sources":["../../src/resources/runtime-entities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAE1D;;;;;;;;;;;GAWG;AACH,qBAAa,uBAAuB;IACpB,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;OAEG;IACG,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;CAOtE"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RuntimeEntitiesResource = void 0;
4
+ /**
5
+ * Runtime-plane entity operations.
6
+ *
7
+ * Only `recompute` lives here, and deliberately so: ADR-0098 D9 puts entity and
8
+ * field AUTHORING on the contract plane (`client.contract.entities`), because
9
+ * those mutate contract state. Recompute mutates `runtime.records`, so it is a
10
+ * runtime-plane verb and shares both implementation and authority with the MCP
11
+ * `recompute_entity` tool.
12
+ *
13
+ * It moved here from `contract.entities.recompute`, where serving it required
14
+ * the contract binary to spawn a runtime writer.
15
+ */
16
+ class RuntimeEntitiesResource {
17
+ client;
18
+ constructor(client) {
19
+ this.client = client;
20
+ }
21
+ /**
22
+ * Recompute the derived fields of every record of an entity.
23
+ */
24
+ async recompute(entityName) {
25
+ return this.client.post(`/runtime/entities/${encodeURIComponent(entityName)}/recompute`, undefined, { operationId: 'recomputeEntity' });
26
+ }
27
+ }
28
+ exports.RuntimeEntitiesResource = RuntimeEntitiesResource;
29
+ //# sourceMappingURL=runtime-entities.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime-entities.js","sourceRoot":"","sources":["../../src/resources/runtime-entities.ts"],"names":[],"mappings":";;;AAGA;;;;;;;;;;;GAWG;AACH,MAAa,uBAAuB;IACH;IAA7B,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;OAEG;IACH,KAAK,CAAC,SAAS,CAAC,UAAkB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CACnB,qBAAqB,kBAAkB,CAAC,UAAU,CAAC,YAAY,EAC/D,SAAS,EACT,EAAE,WAAW,EAAE,iBAAiB,EAAE,CACrC,CAAC;IACN,CAAC;CACJ;AAbD,0DAaC"}