@metabase/cli 0.3.1-alpha.support-worktrees.b634907 → 0.3.1-alpha.versioning.9ac5f50

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 (268) hide show
  1. package/dist/{add-collection-CxzzDG4z.mjs → add-collection-Dmd-uNeU.mjs} +6 -10
  2. package/dist/{alert-CQ7Az16h.mjs → alert-D1u2MVZj.mjs} +7 -7
  3. package/dist/{alerts-DmwyyBfW.mjs → alerts-DcBjcfEE.mjs} +7 -8
  4. package/dist/{append-B0avMkvW.mjs → append-B9Htvmab.mjs} +5 -6
  5. package/dist/{archive-CMTHh4-w.mjs → archive-B660RguB.mjs} +4 -5
  6. package/dist/{archive-THcEfy9B.mjs → archive-BNivAYGr.mjs} +5 -6
  7. package/dist/{archive-DCyeRNfV.mjs → archive-BUoYMkxO.mjs} +4 -5
  8. package/dist/{archive-BZEu6UfT.mjs → archive-BVmFGFwG.mjs} +6 -7
  9. package/dist/archive-Bf014rFm.mjs +32 -0
  10. package/dist/{archive-DFofUIEC.mjs → archive-BmsZFOZY.mjs} +4 -5
  11. package/dist/archive-CNif6BKy.mjs +32 -0
  12. package/dist/{archive-BPSNe0Ul.mjs → archive-CgmidYZV.mjs} +4 -5
  13. package/dist/{archive-Cvrkz8F8.mjs → archive-CvU2z5192.mjs} +5 -6
  14. package/dist/{archive-BQ50OZ7y.mjs → archive-DhDQIKR_.mjs} +4 -5
  15. package/dist/{archive-BVblae-p.mjs → archive-bPdDITuY.mjs} +4 -5
  16. package/dist/{auth-BEEkuu4J.mjs → auth-CefYEPP5.mjs} +5 -5
  17. package/dist/{body-DxRSAMNC.mjs → body-C7m9q4cm.mjs} +3 -3
  18. package/dist/{branches-CmWc8NyL.mjs → branches-pz04OjF2.mjs} +4 -8
  19. package/dist/{cancel-DrQqmxvn.mjs → cancel-CNLnv19e.mjs} +4 -5
  20. package/dist/cancel-task-DbnxSh7U.mjs +25 -0
  21. package/dist/card-BRarvKYX.mjs +24 -0
  22. package/dist/{card-CrBGUkGQ.mjs → card-DZxRmver.mjs} +0 -1
  23. package/dist/{card-BEeafd4Y.mjs → card-zyUkr2nS.mjs} +1 -1
  24. package/dist/{cards-M_6X8wCI.mjs → cards-DtYlVoGP.mjs} +5 -6
  25. package/dist/cli.mjs +566 -170
  26. package/dist/{client-DYD8WZYy.mjs → client-Bv7Iwdvh.mjs} +285 -269
  27. package/dist/collection-CKeO8X7U.mjs +20 -0
  28. package/dist/{collection-CJHqsFKP.mjs → collection-DALwHnbz.mjs} +1 -1
  29. package/dist/{collection-BxE7OzcQ.mjs → collection-WFdBeyqa.mjs} +4 -7
  30. package/dist/{collection-namespace-CEoQ7G08.mjs → collection-namespace-CvT0TIZA.mjs} +2 -2
  31. package/dist/{content-translation-C8MlXPOF.mjs → content-translation-D7POzJJ6.mjs} +3 -3
  32. package/dist/{create-CoubLR5o.mjs → create-BEE8uvz2.mjs} +9 -6
  33. package/dist/{create-D0anrINz.mjs → create-Bh2j733n.mjs} +11 -16
  34. package/dist/{create-BupBEwR2.mjs → create-Bwg-5p08.mjs} +8 -13
  35. package/dist/{create-ByuJ6T4k.mjs → create-CGPle4nE.mjs} +7 -8
  36. package/dist/{create-hTc131aX.mjs → create-CGgPnb7L.mjs} +4 -5
  37. package/dist/{create-CY-SzM66.mjs → create-CLgalJUe.mjs} +12 -17
  38. package/dist/{create-C2XFfbjx.mjs → create-CN24yp_W.mjs} +6 -7
  39. package/dist/{create-BLWwN0uw.mjs → create-CuYGZ4gu2.mjs} +5 -6
  40. package/dist/{create-CJ7Am4Gc.mjs → create-DGHILnnk.mjs} +5 -6
  41. package/dist/{create-z-oMrlfT.mjs → create-DYd_o9BD.mjs} +5 -9
  42. package/dist/{create-BqpkCjx4.mjs → create-DhDREiiy.mjs} +4 -5
  43. package/dist/{create-myI6doga.mjs → create-Di4YvIbK.mjs} +5 -6
  44. package/dist/{create-ldrghMd1.mjs → create-DnqnjGGf.mjs} +4 -5
  45. package/dist/{create-C7iooS6W.mjs → create-Ds-DnSBe.mjs} +9 -15
  46. package/dist/{create-BA_tTDEk.mjs → create-JOXq0ULN.mjs} +5 -6
  47. package/dist/create-branch-DWcxC30N.mjs +31 -0
  48. package/dist/{csv-DBNzJiWK.mjs → csv-CUQvcCEk.mjs} +5 -6
  49. package/dist/{current-task-YzemU0Ic.mjs → current-task-D6P0eL21.mjs} +8 -16
  50. package/dist/{dashboard-B1mpfCq_.mjs → dashboard-BudI952R.mjs} +10 -10
  51. package/dist/{db-1tLH3nYI.mjs → db-C7UTd-6P.mjs} +7 -7
  52. package/dist/{delete-CD_-B4Kq.mjs → delete-DSxqbcFE.mjs} +5 -6
  53. package/dist/{delete-QNgBV6eS.mjs → delete-DbZZKcYj.mjs} +6 -11
  54. package/dist/{delete-DjAUp9mk.mjs → delete-Ds-zGh9C.mjs} +5 -6
  55. package/dist/{delete-eAUB7p-f.mjs → delete-Ud6iliGM.mjs} +6 -11
  56. package/dist/{delete-CpKH5ia4.mjs → delete-_IHffP-A.mjs} +5 -6
  57. package/dist/{delete-runtime-b2_ZMSjj.mjs → delete-runtime-BjHL1ryM.mjs} +1 -2
  58. package/dist/{delete-table-DamlxnSO.mjs → delete-table-DtXH6IN5.mjs} +6 -11
  59. package/dist/dependencies-CR1dlq-A.mjs +36 -0
  60. package/dist/dirty-CYxnOnh0.mjs +28 -0
  61. package/dist/document-BoILnE_1.mjs +19 -0
  62. package/dist/{download-C4v7u-AV.mjs → download-DPpmmYQe.mjs} +3 -7
  63. package/dist/{eid-CP35PdEF.mjs → eid-D-BbtWjt.mjs} +4 -6
  64. package/dist/{events-DmbzKIh_.mjs → events-CJEnn8WE.mjs} +5 -6
  65. package/dist/{export-i8D6laBG.mjs → export-BOgyuIOQ.mjs} +13 -29
  66. package/dist/{field-BKn9bt7I.mjs → field-CzHBOPER.mjs} +5 -5
  67. package/dist/{fields-8_p81BqN.mjs → fields-Bwgkrvus.mjs} +5 -6
  68. package/dist/get-B89DUSvw.mjs +31 -0
  69. package/dist/get-BL90QC64.mjs +36 -0
  70. package/dist/get-BLJSCw53.mjs +31 -0
  71. package/dist/{get-BBOfshz1.mjs → get-BOLwso0V.mjs} +6 -7
  72. package/dist/{get-BvW21ujw.mjs → get-BaPadzdM.mjs} +4 -5
  73. package/dist/{get-vvs0qzzM.mjs → get-BfVCLBqc.mjs} +4 -5
  74. package/dist/{get-B0g6VMBC.mjs → get-C1ZdOvMm.mjs} +4 -5
  75. package/dist/{get-N4dOaTsp.mjs → get-CLu4yzMp2.mjs} +5 -6
  76. package/dist/get-COwdtskS.mjs +27 -0
  77. package/dist/{get-CPTbySa7.mjs → get-CWfIiXwL.mjs} +4 -5
  78. package/dist/get-CqQ-pf0q.mjs +89 -0
  79. package/dist/{get-DnCE7K0y.mjs → get-CvIgxPXV.mjs} +5 -6
  80. package/dist/{get-vrccOMBk.mjs → get-D4OTJblo.mjs} +4 -5
  81. package/dist/{get-BbHPFNqr.mjs → get-D8lHwu4-.mjs} +4 -5
  82. package/dist/{get-CWf46UFu.mjs → get-DVi3a2nm.mjs} +6 -7
  83. package/dist/{get-DFkbi5L3.mjs → get-DgnYF7LR.mjs} +4 -5
  84. package/dist/{get-BHGgXqUq.mjs → get-DsKmZfM2.mjs} +4 -5
  85. package/dist/{get-CAzSP-7o.mjs → get-DyyPiiaB.mjs} +4 -5
  86. package/dist/{get-Bds6Izxk.mjs → get-Eqq13YY-.mjs} +4 -5
  87. package/dist/{get-run-4Ng8_awa.mjs → get-run-Iya0Yw9s.mjs} +6 -7
  88. package/dist/{git-sync-DLzJrdMi.mjs → git-sync-BDnxPrqU.mjs} +3 -22
  89. package/dist/git-sync-CdN0Maun.mjs +28 -0
  90. package/dist/{git-sync-LQIVMNxO.mjs → git-sync-DxD_ng48.mjs} +2 -31
  91. package/dist/{group-YN6jj2AN.mjs → group-CmVCLBDz.mjs} +3 -3
  92. package/dist/{has-remote-changes-BXPGI9xG.mjs → has-remote-changes-DfJUMP8F.mjs} +7 -18
  93. package/dist/{import-BoxOkA-G.mjs → import-FEAx-Y5A.mjs} +12 -32
  94. package/dist/{input-DH9i67x_.mjs → input-DFZ_qGW_.mjs} +1 -1
  95. package/dist/is-dirty-BsYjBSXG.mjs +32 -0
  96. package/dist/{items-Cv6iAzrI.mjs → items-D4rstE12.mjs} +10 -18
  97. package/dist/{key-BEhqIzIQ.mjs → key-BmWundO3.mjs} +1 -1
  98. package/dist/{library-fhVn1KDC.mjs → library-CmctxHjv.mjs} +1 -1
  99. package/dist/library-DXB8sm4r.mjs +81 -0
  100. package/dist/{library-CRaOhJnj.mjs → library-uzyHWBap.mjs} +5 -5
  101. package/dist/{list-DOaWCx8S.mjs → list-1DkkU82x.mjs} +17 -25
  102. package/dist/{list-BLJkJp5a.mjs → list-B7tqNV8B.mjs} +4 -5
  103. package/dist/{list-WSJLnunb.mjs → list-BRpPbvyS.mjs} +4 -5
  104. package/dist/{list-BBp9XjYs.mjs → list-BXL8HFr_.mjs} +4 -5
  105. package/dist/{list-L2U1l6R4.mjs → list-Bjj0z5BS.mjs} +6 -7
  106. package/dist/{list-DhrapAcy.mjs → list-BmMi_wPD.mjs} +5 -6
  107. package/dist/list-CC1M_n6Z.mjs +28 -0
  108. package/dist/list-CQy0z7f9.mjs +28 -0
  109. package/dist/{list-BwkfWtP2.mjs → list-D_zvX0ms.mjs} +4 -5
  110. package/dist/{list--2T-GUEF.mjs → list-DeNGm9G4.mjs} +5 -6
  111. package/dist/list-Dgm6TkqR.mjs +38 -0
  112. package/dist/list-DoTiQc3D.mjs +36 -0
  113. package/dist/{list-C8J3n8B8.mjs → list-DrS3ePsv.mjs} +4 -5
  114. package/dist/list-bN0RC14-.mjs +59 -0
  115. package/dist/{list-oAAgU5uE.mjs → list-ndIl9XqV.mjs} +11 -18
  116. package/dist/{list-tutXEQRW.mjs → list-sQcA4g05.mjs} +5 -6
  117. package/dist/{list-9uvk9dIA.mjs → list-squb_ioH.mjs} +4 -5
  118. package/dist/{list-DOZNpX4b.mjs → list-xMfCeuZc.mjs} +5 -6
  119. package/dist/{login-DqWRF3Og.mjs → login-D_1-zE4A.mjs} +15 -13
  120. package/dist/{logout-ChCz1bkf.mjs → logout-DPi2q1Wu.mjs} +3 -5
  121. package/dist/{measure-C5dIdFj1.mjs → measure-CdA8Nl3Z.mjs} +6 -6
  122. package/dist/{notification-DVrLkjFT.mjs → notification-Fcq1fIPw.mjs} +1 -1
  123. package/dist/{parameter-values-Dy4cBs5y.mjs → parameter-values-C6dj6I4g.mjs} +4 -6
  124. package/dist/{parse-enum-D0Jfm_Bz.mjs → parse-enum-B1t8S194.mjs} +1 -1
  125. package/dist/{parse-id-DDCn3VXx.mjs → parse-id-DR8aUSdL.mjs} +1 -1
  126. package/dist/{parse-ref-Wv21Roup.mjs → parse-ref-BJ_Q0tNW.mjs} +3 -7
  127. package/dist/{path-IYhuzjQV.mjs → path-B96DI8u2.mjs} +5 -6
  128. package/dist/{poll-75SvT7Zv.mjs → poll-By46YQ5J.mjs} +2 -2
  129. package/dist/{preflight-HLUVr2Yf.mjs → preflight-Bl1oitm8.mjs} +3 -4
  130. package/dist/{process-DBOOrmET.mjs → process-CcQM4qPv.mjs} +1 -1
  131. package/dist/{publish-CMkCSt8i.mjs → publish-BKJYvxif.mjs} +9 -10
  132. package/dist/{pulse-a-83M4DV.mjs → pulse-DhG6I9mI.mjs} +1 -1
  133. package/dist/{query-tWQAV9pb.mjs → query-BKSM-pbi.mjs} +9 -11
  134. package/dist/{query-Bka77J62.mjs → query-qBHjZQc_.mjs} +7 -10
  135. package/dist/{query-result-E4Q-Gra6.mjs → query-result-DBDwk8TS.mjs} +1 -1
  136. package/dist/{remove-collection-BV9wRQZD.mjs → remove-collection-BWFW7Rn6.mjs} +6 -10
  137. package/dist/{render-DHjCcUXn.mjs → render-DmykmrFB.mjs} +11 -8
  138. package/dist/{replace-mt47dlRV.mjs → replace-BmAqD3zY.mjs} +5 -6
  139. package/dist/{rescan-values-6cRjcpTs.mjs → rescan-values-BrCLrihF.mjs} +4 -5
  140. package/dist/{run-DI_pDxji.mjs → run-CtbzjDKY.mjs} +6 -7
  141. package/dist/{run-BmGmC-GQ.mjs → run-q5Y44Fxj.mjs} +26 -15
  142. package/dist/{runs-9Fu0mug5.mjs → runs-JFlbezkQ.mjs} +7 -8
  143. package/dist/{runtime-CNAZ_FuR.mjs → runtime-BQiGgbgZ.mjs} +851 -361
  144. package/dist/{schema-tables-CLG0mtQb.mjs → schema-tables-Bzx2ShyE.mjs} +5 -6
  145. package/dist/{schemas-Cm5NWy59.mjs → schemas-ww5mU2AS.mjs} +5 -6
  146. package/dist/{search-CljYyf2F.mjs → search-J4RwCof-.mjs} +9 -15
  147. package/dist/{segment-IRzlQggt.mjs → segment-XXTjU0eG.mjs} +6 -6
  148. package/dist/{selectors-D4iOP5uB.mjs → selectors-BAAZMi43.mjs} +3 -3
  149. package/dist/{send-D7DBnQbu.mjs → send-BmpDlw9O.mjs} +4 -5
  150. package/dist/{set-DKN8fuC6.mjs → set-DUWrSza9.mjs} +5 -6
  151. package/dist/{set-active-CkE0Eiqh.mjs → set-active-BiUlbNI5.mjs} +5 -6
  152. package/dist/{setting-CN4l8N-b.mjs → setting-B1KBQN3M.mjs} +4 -4
  153. package/dist/{setup-BpTptmdO.mjs → setup-CVaNVwOd.mjs} +4 -5
  154. package/dist/{signal-CMd0EFUa.mjs → signal-GhGmuHfx.mjs} +11 -2
  155. package/dist/{list-CtZAu4im.mjs → skill-list-DTnDhnL5.mjs} +17 -47
  156. package/dist/{skills-BSAiLI3Z.mjs → skills-BWrAlj9l.mjs} +3 -3
  157. package/dist/{skills-hVKSOCUf.mjs → skills-DkDsSH5F.mjs} +102 -14
  158. package/dist/snippet-CG75L2DS.mjs +19 -0
  159. package/dist/{snippet-BxgvQ09J.mjs → snippet-CyKAgIZl.mjs} +2 -5
  160. package/dist/{snippet-DecHB4Dn.mjs → snippet-oJLaYW9V.mjs} +1 -1
  161. package/dist/{stash-DJs6A6BA.mjs → stash-DMm8YF8V.mjs} +7 -12
  162. package/dist/{status-N_2EaWb7.mjs → status-BzEQjQ_t.mjs} +15 -23
  163. package/dist/{status-DtwBDRtc.mjs → status-ClWsQD6v.mjs} +22 -48
  164. package/dist/{subscription-BnGDp1oy.mjs → subscription-CdFn2hre.mjs} +6 -6
  165. package/dist/{subscriptions-BfFwV__x.mjs → subscriptions-DBda1pE5.mjs} +7 -8
  166. package/dist/{summary-CHiq-4mz.mjs → summary-B4GPiuqD.mjs} +4 -5
  167. package/dist/{sync-schema-DhnM-rpm.mjs → sync-schema-DsIM5g2U.mjs} +5 -6
  168. package/dist/{sync-task-G1K47Nvn.mjs → sync-task-BACcrs0i.mjs} +1 -1
  169. package/dist/{table-BQaiCSNS.mjs → table-D4Alrrwh.mjs} +5 -5
  170. package/dist/timeline-DmM0BuX8.mjs +21 -0
  171. package/dist/{timeline-event-B7H1y8s8.mjs → timeline-event-DWIh3Tdt.mjs} +6 -6
  172. package/dist/transform-BcV_XlSX.mjs +28 -0
  173. package/dist/{transform-CiDOJGBW.mjs → transform-Bk0D0nIs.mjs} +2 -2
  174. package/dist/{transform-BvOEn41C.mjs → transform-DpuG-ON3.mjs} +25 -7
  175. package/dist/{transform-job-50GZHhKH.mjs → transform-job-AaMZRxAq.mjs} +1 -1
  176. package/dist/{transform-job-DRrK28IH.mjs → transform-job-CCguL6LP.mjs} +41 -4
  177. package/dist/transform-job-CjtwBGoM.mjs +22 -0
  178. package/dist/{transform-tag-jBVd6wXd.mjs → transform-tag-CcElGp3C.mjs} +4 -9
  179. package/dist/{transform-tag-Dip51YBa.mjs → transform-tag-DJ3_bksm.mjs} +5 -5
  180. package/dist/{transform-tag-DiXWRCQG.mjs → transform-tag-Dmb4u3-Q.mjs} +1 -1
  181. package/dist/{transforms-C-jYgS6z.mjs → transforms-Dg2MfB2a.mjs} +7 -8
  182. package/dist/tree-BQL0f7YX.mjs +26 -0
  183. package/dist/{unpublish-BokbnLng.mjs → unpublish-DfSvb_Rs.mjs} +4 -8
  184. package/dist/{update-D9OTkZhw.mjs → update-B-hRR8gW.mjs} +5 -6
  185. package/dist/{update-CpLEEbiJ.mjs → update-BCgAyfj_.mjs} +8 -9
  186. package/dist/{update-BCGE5UYC.mjs → update-Bhmli02m.mjs} +6 -7
  187. package/dist/{update-rkbpH0lF.mjs → update-BxIyFtrX.mjs} +5 -6
  188. package/dist/{update-AZSXMJqu.mjs → update-CDo0Orvu.mjs} +9 -15
  189. package/dist/{update-B9DcRSBQ.mjs → update-CKoBDTL7.mjs} +13 -19
  190. package/dist/{update-CfQoYVTc.mjs → update-CiYxcf8M.mjs} +7 -8
  191. package/dist/{update-e7lyQPxq.mjs → update-Cr5zHb0D.mjs} +9 -15
  192. package/dist/{update-CPEU8ZEu.mjs → update-CtDHMxW8.mjs} +6 -7
  193. package/dist/{update-BBQInyiJ.mjs → update-D1QdfpKR.mjs} +6 -7
  194. package/dist/{update-C4PbAYgW.mjs → update-D4qdTlLF.mjs} +5 -6
  195. package/dist/{update-BRXKLeJH.mjs → update-DBGaJDsj.mjs} +5 -6
  196. package/dist/{update-BErxnZrj.mjs → update-Izqip6jY.mjs} +6 -7
  197. package/dist/{update-Bc8s1TL1.mjs → update-NZhIjTCf.mjs} +5 -6
  198. package/dist/{update-dashcard-St-dGcE3.mjs → update-dashcard-D5b971AO.mjs} +5 -6
  199. package/dist/{update-CKL2FtoX.mjs → update-sYLQIUgh.mjs} +6 -7
  200. package/dist/{upgrade-CUoRHfVg.mjs → upgrade-CD1xtsIv.mjs} +6 -9
  201. package/dist/{upload-CD555ui1.mjs → upload-BUd3MG90.mjs} +2 -2
  202. package/dist/upload-DzGTlldn.mjs +13 -0
  203. package/dist/{upload-BPd1Uzxc.mjs → upload-akKFxpVA.mjs} +4 -8
  204. package/dist/{uuid-CFN8LIkP.mjs → uuid-oVdJ62eA.mjs} +3 -5
  205. package/dist/{validate-BWchyW0V.mjs → validate-CWd6l6KZ.mjs} +1 -1
  206. package/dist/{validate-query-Chc43ezW.mjs → validate-query-Boi8-cAP.mjs} +2 -3
  207. package/dist/{values-BL_U-Zdw.mjs → values-DLwZl-P8.mjs} +4 -5
  208. package/dist/{verify-DnBaRmkI.mjs → verify-CH9Tw8yv.mjs} +3 -18
  209. package/dist/{wait-flags-DzytMEG8.mjs → wait-flags-DiQ_kRjZ.mjs} +3 -3
  210. package/dist/{wait-mPoOZxrw.mjs → wait-rfTdQWdi.mjs} +9 -17
  211. package/dist/{window-DSb1tqSe.mjs → window-BkvrP0gB.mjs} +1 -1
  212. package/package.json +1 -1
  213. package/skill-data/core/SKILL.md +24 -16
  214. package/skill-data/data-workflow/references/building-clean-tables.md +6 -2
  215. package/skill-data/data-workflow/references/reusable-definitions.md +11 -3
  216. package/skill-data/document/SKILL.md +4 -1
  217. package/skill-data/git-sync/SKILL.md +6 -91
  218. package/skill-data/mbql/SKILL.md +1 -1
  219. package/skill-data/mbql/references/operators.md +20 -15
  220. package/skill-data/metadata/SKILL.md +1 -1
  221. package/skill-data/metadata/references/semantic-types.md +7 -1
  222. package/skill-data/native-sql/references/template-tags.md +6 -2
  223. package/skill-data/notification/SKILL.md +7 -1
  224. package/skill-data/transform/SKILL.md +13 -11
  225. package/skill-data/visualization/SKILL.md +11 -3
  226. package/skill-data/visualization/references/settings.md +6 -4
  227. package/skills/metabase-cli/SKILL.md +1 -1
  228. package/dist/archive-CqOKKrb2.mjs +0 -38
  229. package/dist/archive-DCjdICg7.mjs +0 -38
  230. package/dist/branch-BSeGrtP7.mjs +0 -28
  231. package/dist/cancel-task-BMQXtjW5.mjs +0 -34
  232. package/dist/card-RlzLDB2z.mjs +0 -24
  233. package/dist/collection-Bhe20ckt.mjs +0 -20
  234. package/dist/create-DwrhcI8r2.mjs +0 -144
  235. package/dist/create-branch-B3BMpF1g.mjs +0 -49
  236. package/dist/delete-D_OgiI4v.mjs +0 -86
  237. package/dist/dependencies-DEx0BsZ3.mjs +0 -41
  238. package/dist/dirty-dC1-Ud0G.mjs +0 -40
  239. package/dist/document-DOJbBWLF.mjs +0 -19
  240. package/dist/export-preflight-B5MvYhm3.mjs +0 -67
  241. package/dist/get-CNEQK0-9.mjs +0 -81
  242. package/dist/get-Cfagmy1i.mjs +0 -42
  243. package/dist/get-DvLuY5Xu.mjs +0 -38
  244. package/dist/get-DwdMvWXU.mjs +0 -44
  245. package/dist/get-jV8G90Zy.mjs +0 -42
  246. package/dist/get-mGEv-kag.mjs +0 -33
  247. package/dist/git-sync-DjoaNmRM.mjs +0 -29
  248. package/dist/is-dirty-Cwxq4_gd.mjs +0 -44
  249. package/dist/library-Cfw6eF35.mjs +0 -19
  250. package/dist/list-5Iojbr_p.mjs +0 -37
  251. package/dist/list-BD4onDqO.mjs +0 -37
  252. package/dist/list-C2yL7-CH.mjs +0 -45
  253. package/dist/list-CbbKip6U.mjs +0 -32
  254. package/dist/list-Dg2XeDON.mjs +0 -47
  255. package/dist/network-error-D6CiOEBw.mjs +0 -431
  256. package/dist/pin-BuZ_kg-u.mjs +0 -62
  257. package/dist/predicates-Bkm2IoeX.mjs +0 -170
  258. package/dist/scope-DsGuWG5w.mjs +0 -11
  259. package/dist/snippet-LlHz3FdJ.mjs +0 -19
  260. package/dist/timeline-C2VW0Ph6.mjs +0 -21
  261. package/dist/transform-DAf0Y02t.mjs +0 -28
  262. package/dist/transform-job-ntiT5Rrh.mjs +0 -22
  263. package/dist/tree-DtyJhD54.mjs +0 -36
  264. package/dist/unpin-DxbXmLtW.mjs +0 -45
  265. package/dist/upload-Dc3QLhZw.mjs +0 -13
  266. package/dist/worktree-ChdDlG3Q.mjs +0 -25
  267. package/dist/worktree-DC0kTxxQ.mjs +0 -20
  268. package/dist/worktree-xAro1xAB.mjs +0 -24
@@ -1,32 +1,31 @@
1
- import { a as InternalError, c as ResponseShapeError, d as ValidationError, f as errorMessage, i as ConfigError, l as TimeoutError, s as NetworkError } from "./predicates-Bkm2IoeX.mjs";
1
+ import { $ as ValidationError, K as ConfigError, X as ResponseShapeError, Y as NetworkError, Z as TimeoutError, et as errorMessage, it as createServerProfile, n as methodRequirements, q as InternalError } from "./cli.mjs";
2
2
  import { n as Notification, r as NotificationCardPayload, t as CARD_PAYLOAD_TYPE } from "./notification-DaA4bBHW.mjs";
3
- import { a as isRetryableStatus, c as normalizeUrl, d as credentialSecrets, g as parseJsonOrPlain, h as parseJson, l as assertCredentialHeaderSafe, m as JSON_CONTENT_TYPE, n as isConnectionClosed, r as HttpError, t as buildNetworkError, u as credentialAuthHeader } from "./network-error-D6CiOEBw.mjs";
4
- import { n as throwIfAborted, t as combineAborts } from "./signal-CMd0EFUa.mjs";
3
+ import { $ as probeServer, B as JSON_CONTENT_TYPE, F as buildNetworkError, G as credentialSecrets, H as parseJsonOrPlain, I as isConnectionClosed, J as normalizeUrl, L as HttpError, Q as checkRequirements, U as assertCredentialHeaderSafe, V as parseJson, W as credentialAuthHeader, et as CapabilityError, z as isRetryableStatus } from "./runtime-BQiGgbgZ.mjs";
4
+ import { n as throwIfAborted, r as untilAborted, t as combineAborts } from "./signal-GhGmuHfx.mjs";
5
5
  import { s as FieldValues, t as Field } from "./field-Cr2DPUG9.mjs";
6
6
  import { r as ParameterValues } from "./parameter-DUKR8NXo.mjs";
7
- import { o as CardQueryResult, t as Card } from "./card-CrBGUkGQ.mjs";
8
- import { f as CollectionTreeNode, o as CollectionItem, r as Collection } from "./collection-BxE7OzcQ.mjs";
7
+ import { o as CardQueryResult, t as Card } from "./card-DZxRmver.mjs";
8
+ import { p as CollectionTreeNode, r as Collection, s as CollectionItem } from "./collection-WFdBeyqa.mjs";
9
9
  import { t as ContentTranslationUploadResult } from "./content-translation-BrHOrmj9.mjs";
10
10
  import { i as DashboardDetail, s as Dashcard, t as Dashboard } from "./dashboard-CKUR8ZpQ.mjs";
11
11
  import { i as TableQueryMetadata, t as Table } from "./table-CeeTJgQb.mjs";
12
12
  import { t as Database } from "./database-C8G6ZKG0.mjs";
13
- import { r as pollUntil } from "./poll-75SvT7Zv.mjs";
13
+ import { r as pollUntil } from "./poll-By46YQ5J.mjs";
14
14
  import { t as Document } from "./document-Cd2mmqCp.mjs";
15
15
  import { i as EidTranslateResult } from "./eid-translation-zEHtr5Oc.mjs";
16
- import { c as SyncSettingsUpdateResult, i as SyncExportPreflight, n as SyncDirtyItem, p as isSyncTaskTerminal, s as SyncRemoteChanges, t as SyncBranchCreated, u as SyncTask } from "./git-sync-DLzJrdMi.mjs";
17
- import { t as Worktree } from "./worktree-xAro1xAB.mjs";
18
- import { t as Library } from "./library-Cfw6eF35.mjs";
16
+ import { f as isSyncTaskTerminal, l as SyncTask, n as SyncDirtyItem, o as SyncRemoteChanges, s as SyncSettingsUpdateResult, t as SyncBranchCreated } from "./git-sync-BDnxPrqU.mjs";
17
+ import { a as toLibrary, i as libraryWireSchema, n as LibraryCollectionInfo } from "./library-DXB8sm4r.mjs";
19
18
  import { t as Measure } from "./measure-CtfjqJFP.mjs";
20
19
  import { t as Pulse } from "./pulse-BmsDenXm.mjs";
21
20
  import { r as SearchResult } from "./search-DFBwUc6d.mjs";
22
21
  import { t as Segment } from "./segment-OsrbUDzw.mjs";
23
22
  import { t as Setting } from "./setting-DTiLCW8g.mjs";
24
23
  import { n as SetupResult } from "./setup-CO7QV-ao.mjs";
25
- import { t as Snippet } from "./snippet-BxgvQ09J.mjs";
24
+ import { t as Snippet } from "./snippet-CyKAgIZl.mjs";
26
25
  import { i as TimelineEvent, t as Timeline } from "./timeline-CCSU2qOS.mjs";
27
- import { i as TransformRun, l as isTransformRunFailed, t as Transform, u as isTransformRunTerminal } from "./transform-BvOEn41C.mjs";
28
- import { a as TransformJobRunResult, n as TransformJobActiveResult, t as TransformJob } from "./transform-job-DRrK28IH.mjs";
29
- import { t as TransformTag } from "./transform-tag-jBVd6wXd.mjs";
26
+ import { d as transformDetailSchema, f as transformRowSchema, i as TransformRun, l as isTransformRunFailed, u as isTransformRunTerminal } from "./transform-DpuG-ON3.mjs";
27
+ import { c as transformJobSchema, n as TransformJobActiveResult, s as transformJobRunResultSchema } from "./transform-job-CCguL6LP.mjs";
28
+ import { t as TransformTag } from "./transform-tag-CcElGp3C.mjs";
30
29
  import { t as UploadResult } from "./upload-DAtxBBms.mjs";
31
30
  import { z } from "zod";
32
31
  import { setTimeout } from "node:timers/promises";
@@ -43,7 +42,6 @@ var __exportAll = (all, no_symbols) => {
43
42
  };
44
43
  //#endregion
45
44
  //#region ../client/src/http/response-shape.ts
46
- const NO_SERVER_TAG = async () => null;
47
45
  async function parseJsonResponse(text, schema, context) {
48
46
  try {
49
47
  return parseJson(text, schema, { source: context.url });
@@ -54,7 +52,8 @@ async function parseJsonResponse(text, schema, context) {
54
52
  url: context.url,
55
53
  status: context.status,
56
54
  zodIssues: error.developerDetail.zodIssues,
57
- serverTag: await context.getServerTag()
55
+ serverTag: await context.getServerTag(),
56
+ serverSkew: context.serverSkew
58
57
  });
59
58
  throw error;
60
59
  }
@@ -105,7 +104,9 @@ function createTransport(config, options) {
105
104
  const baseUrl = normalizeUrl(config.url);
106
105
  assertCredentialHeaderSafe(config.credential);
107
106
  const fetchImpl = options.fetchImpl ?? globalThis.fetch.bind(globalThis);
108
- const getServerTag = options.getServerTag ?? NO_SERVER_TAG;
107
+ let settledProfile = options.server ?? null;
108
+ const getServerTag = options.getServerTag ?? (async () => tagOf(settledProfile));
109
+ const serverSkew = () => settledProfile === null ? null : settledProfile.skew;
109
110
  const refreshCredential = options.refreshCredential;
110
111
  let credential = config.credential;
111
112
  const knownSecrets = new Set(credentialSecrets(credential));
@@ -244,7 +245,30 @@ function createTransport(config, options) {
244
245
  cancelSignal: combineAborts(opts.signal, options.signal)
245
246
  };
246
247
  }
247
- return {
248
+ let serverProfile = options.server === void 0 ? null : Promise.resolve(options.server);
249
+ async function server(wait = {}) {
250
+ throwIfAborted(wait.signal);
251
+ if (serverProfile === null) {
252
+ const probe = probeServer(transport).then((info) => {
253
+ settledProfile = createServerProfile(info);
254
+ return settledProfile;
255
+ });
256
+ probe.catch(() => {
257
+ serverProfile = null;
258
+ });
259
+ serverProfile = probe;
260
+ }
261
+ return untilAborted(serverProfile, wait.signal);
262
+ }
263
+ const enforceRequirements = options.enforceRequirements ?? true;
264
+ async function requireFeatures(key, wait = {}) {
265
+ if (!enforceRequirements || methodRequirements(key).length === 0) return;
266
+ const failure = checkRequirements(key, await server(wait));
267
+ if (failure !== null) throw new CapabilityError(failure);
268
+ }
269
+ const transport = {
270
+ server,
271
+ require: requireFeatures,
248
272
  async requestRaw(path, opts) {
249
273
  return (await executeWithAuthRefresh(path, opts ?? {})).response;
250
274
  },
@@ -257,7 +281,8 @@ function createTransport(config, options) {
257
281
  method: prepared.method,
258
282
  url: prepared.url,
259
283
  status: response.status,
260
- getServerTag
284
+ getServerTag,
285
+ serverSkew: serverSkew()
261
286
  });
262
287
  },
263
288
  async requestStream(path, opts) {
@@ -273,6 +298,11 @@ function createTransport(config, options) {
273
298
  return response.body;
274
299
  }
275
300
  };
301
+ return transport;
302
+ }
303
+ function tagOf(profile) {
304
+ if (profile === null || profile.version === null) return null;
305
+ return profile.version.tag;
276
306
  }
277
307
  function buildUrl(baseUrl, path, query) {
278
308
  const normalizedPath = path.startsWith("/") ? path : `/${path}`;
@@ -319,18 +349,15 @@ async function readBodyForError(response) {
319
349
  //#region ../client/src/resources/card.ts
320
350
  const CardApiList = z.array(Card);
321
351
  function cardResource(transport) {
322
- /**
323
- * List cards. `f` picks a server-side preset, `model_id` scopes the presets that need an id, and
324
- * `worktree-id` lists only the cards checked out into that remote-sync worktree.
325
- */
352
+ /** List cards. `f` picks a server-side preset; `model_id` scopes the presets that need an id. */
326
353
  async function list(params = {}, options = {}) {
354
+ await transport.require("card.list", options);
327
355
  return {
328
356
  data: await transport.requestParsed(CardApiList, "/api/card", {
329
357
  ...options,
330
358
  query: {
331
359
  f: params.f,
332
- model_id: params.model_id,
333
- "worktree-id": params["worktree-id"]
360
+ model_id: params.model_id
334
361
  }
335
362
  }),
336
363
  total: null
@@ -338,10 +365,12 @@ function cardResource(transport) {
338
365
  }
339
366
  /** Get one card by id. */
340
367
  async function get(id, options = {}) {
368
+ await transport.require("card.get", options);
341
369
  return transport.requestParsed(Card, `/api/card/${id}`, { ...options });
342
370
  }
343
371
  /** Create a card — a question, a model, or a metric — from a full card body. */
344
372
  async function create(params, options = {}) {
373
+ await transport.require("card.create", options);
345
374
  return transport.requestParsed(Card, "/api/card", {
346
375
  ...options,
347
376
  method: "POST",
@@ -350,6 +379,7 @@ function cardResource(transport) {
350
379
  }
351
380
  /** Update a card by id, patching only the fields the body carries. */
352
381
  async function update(id, params, options = {}) {
382
+ await transport.require("card.update", options);
353
383
  return transport.requestParsed(Card, `/api/card/${id}`, {
354
384
  ...options,
355
385
  method: "PUT",
@@ -358,10 +388,12 @@ function cardResource(transport) {
358
388
  }
359
389
  /** Archive (soft-delete) a card by id. Metabase models this as an update, not its own endpoint. */
360
390
  async function archive(id, options = {}) {
391
+ await transport.require("card.archive", options);
361
392
  return update(id, { archived: true }, options);
362
393
  }
363
394
  /** Run a saved card and return the query result envelope. */
364
395
  async function query(id, params, options = {}) {
396
+ await transport.require("card.query", options);
365
397
  return transport.requestParsed(CardQueryResult, `/api/card/${id}/query`, {
366
398
  ...options,
367
399
  method: "POST",
@@ -373,6 +405,7 @@ function cardResource(transport) {
373
405
  * form-encoded body and answers bytes, so a caller consumes the stream rather than a value.
374
406
  */
375
407
  async function exportQuery(id, format, params, options = {}) {
408
+ await transport.require("card.exportQuery", options);
376
409
  const body = new URLSearchParams({
377
410
  parameters: JSON.stringify(params.parameters),
378
411
  format_rows: String(params.format_rows),
@@ -464,19 +497,13 @@ async function listCollectionsWithLibrary(transport, schema, options = {}) {
464
497
  });
465
498
  }
466
499
  function collectionResource(transport) {
467
- /**
468
- * List collections. `filter` picks a server-side preset — everything, archived, or personal — and
469
- * `worktree-id` lists only the collections checked out into that remote-sync worktree.
470
- */
500
+ /** List collections. `filter` picks a server-side preset: everything, archived, or personal. */
471
501
  async function list(params = {}, options = {}) {
472
- const preset = COLLECTION_LIST_QUERY[params.filter ?? DEFAULT_LIST_FILTER];
502
+ await transport.require("collection.list", options);
473
503
  return {
474
504
  data: await transport.requestParsed(CollectionApiList, "/api/collection", {
475
505
  ...options,
476
- query: {
477
- ...preset,
478
- "worktree-id": params["worktree-id"]
479
- }
506
+ query: COLLECTION_LIST_QUERY[params.filter ?? DEFAULT_LIST_FILTER]
480
507
  }),
481
508
  total: null
482
509
  };
@@ -487,6 +514,7 @@ function collectionResource(transport) {
487
514
  * caller resolves both.
488
515
  */
489
516
  async function listWithLibrary(options = {}) {
517
+ await transport.require("collection.listWithLibrary", options);
490
518
  return {
491
519
  data: await listCollectionsWithLibrary(transport, Collection, options),
492
520
  total: null
@@ -494,10 +522,12 @@ function collectionResource(transport) {
494
522
  }
495
523
  /** Get one collection by id, entity id, or the `root`/`trash` alias. */
496
524
  async function get(ref, options = {}) {
525
+ await transport.require("collection.get", options);
497
526
  return transport.requestParsed(Collection, `/api/collection/${refPath(ref)}`, { ...options });
498
527
  }
499
528
  /** Create a new collection. */
500
529
  async function create(params, options = {}) {
530
+ await transport.require("collection.create", options);
501
531
  return transport.requestParsed(Collection, "/api/collection", {
502
532
  ...options,
503
533
  method: "POST",
@@ -506,6 +536,7 @@ function collectionResource(transport) {
506
536
  }
507
537
  /** Update a collection, patching only the fields the body carries. */
508
538
  async function update(ref, params, options = {}) {
539
+ await transport.require("collection.update", options);
509
540
  return transport.requestParsed(Collection, `/api/collection/${refPath(ref)}`, {
510
541
  ...options,
511
542
  method: "PUT",
@@ -514,20 +545,20 @@ function collectionResource(transport) {
514
545
  }
515
546
  /** Archive (soft-delete) a collection. Metabase models this as an update, not its own endpoint. */
516
547
  async function archive(ref, options = {}) {
548
+ await transport.require("collection.archive", options);
517
549
  return update(ref, { archived: true }, options);
518
550
  }
519
551
  /**
520
552
  * Walk the items inside a collection one page at a time. This endpoint pages on the server, so
521
- * the caller consumes pages rather than a single list and decides how far to pull. `worktree-id`
522
- * walks the `root` alias inside a remote-sync worktree rather than the main app.
553
+ * the caller consumes pages rather than a single list and decides how far to pull.
523
554
  */
524
- function itemPages(ref, params = {}, options = {}) {
525
- return paginatePages(transport, `/api/collection/${refPath(ref)}/items`, CollectionItem, {
555
+ async function* itemPages(ref, params = {}, options = {}) {
556
+ await transport.require("collection.itemPages", options);
557
+ yield* paginatePages(transport, `/api/collection/${refPath(ref)}/items`, CollectionItem, {
526
558
  query: {
527
559
  models: params.models,
528
560
  archived: params.archived,
529
- pinned_state: params.pinned_state,
530
- "worktree-id": params["worktree-id"]
561
+ pinned_state: params.pinned_state
531
562
  },
532
563
  ...options.offset !== void 0 && { offset: options.offset },
533
564
  ...options.max !== void 0 && { max: options.max },
@@ -535,16 +566,11 @@ function collectionResource(transport) {
535
566
  ...options.signal !== void 0 && { signal: options.signal }
536
567
  });
537
568
  }
538
- /**
539
- * Fetch the collection hierarchy as a forest of nested nodes. `worktree-id` fetches the hierarchy
540
- * a remote-sync worktree checked out rather than the main app's.
541
- */
542
- async function tree(params = {}, options = {}) {
569
+ /** Fetch the collection hierarchy as a forest of nested nodes. */
570
+ async function tree(options = {}) {
571
+ await transport.require("collection.tree", options);
543
572
  return {
544
- data: await transport.requestParsed(CollectionTreeApiList, "/api/collection/tree", {
545
- ...options,
546
- query: { "worktree-id": params["worktree-id"] }
547
- }),
573
+ data: await transport.requestParsed(CollectionTreeApiList, "/api/collection/tree", { ...options }),
548
574
  total: null
549
575
  };
550
576
  }
@@ -573,10 +599,12 @@ const CONTENT_TRANSLATION_PATH = "/api/ee/content-translation";
573
599
  function contentTranslationResource(transport) {
574
600
  /** Download the complete content translation dictionary as CSV. */
575
601
  async function download(options = {}) {
602
+ await transport.require("contentTranslation.download", options);
576
603
  return transport.requestStream(`${CONTENT_TRANSLATION_PATH}/csv`, options);
577
604
  }
578
605
  /** Replace the complete content translation dictionary with the attached CSV. */
579
606
  async function upload(file, options = {}) {
607
+ await transport.require("contentTranslation.upload", options);
580
608
  const form = buildCsvFormData(file);
581
609
  return transport.requestParsed(ContentTranslationUploadResult, `${CONTENT_TRANSLATION_PATH}/upload-dictionary`, {
582
610
  ...options,
@@ -597,6 +625,7 @@ function dashboardResource(transport) {
597
625
  const card = cardResource(transport);
598
626
  /** List dashboards. `f` picks a server-side preset. */
599
627
  async function list(params = {}, options = {}) {
628
+ await transport.require("dashboard.list", options);
600
629
  return {
601
630
  data: await transport.requestParsed(DashboardApiList, "/api/dashboard", {
602
631
  ...options,
@@ -607,6 +636,7 @@ function dashboardResource(transport) {
607
636
  }
608
637
  /** Get one dashboard by id, with its dashcards, tabs and parameters. */
609
638
  async function get(id, options = {}) {
639
+ await transport.require("dashboard.get", options);
610
640
  return transport.requestParsed(DashboardDetail, `/api/dashboard/${id}`, { ...options });
611
641
  }
612
642
  /**
@@ -614,6 +644,7 @@ function dashboardResource(transport) {
614
644
  * puts content on a fresh dashboard.
615
645
  */
616
646
  async function create(params, options = {}) {
647
+ await transport.require("dashboard.create", options);
617
648
  return transport.requestParsed(Dashboard, "/api/dashboard", {
618
649
  ...options,
619
650
  method: "POST",
@@ -625,6 +656,7 @@ function dashboardResource(transport) {
625
656
  * full replacements: whatever the body omits is deleted from the dashboard.
626
657
  */
627
658
  async function update(id, params, options = {}) {
659
+ await transport.require("dashboard.update", options);
628
660
  return transport.requestParsed(DashboardDetail, `/api/dashboard/${id}`, {
629
661
  ...options,
630
662
  method: "PUT",
@@ -637,6 +669,7 @@ function dashboardResource(transport) {
637
669
  * an archive is a state change on the dashboard itself, and its dashcards are not part of it.
638
670
  */
639
671
  async function archive(id, options = {}) {
672
+ await transport.require("dashboard.archive", options);
640
673
  return transport.requestParsed(Dashboard, `/api/dashboard/${id}`, {
641
674
  ...options,
642
675
  method: "PUT",
@@ -649,6 +682,7 @@ function dashboardResource(transport) {
649
682
  * currently stands.
650
683
  */
651
684
  async function updateDashcard(dashboardId, dashcardId, params, options = {}) {
685
+ await transport.require("dashboard.updateDashcard", options);
652
686
  const dashboard = await get(dashboardId, options);
653
687
  const target = dashboard.dashcards.find((dashcard) => dashcard.id === dashcardId);
654
688
  if (target === void 0) throw new ConfigError(`dashcard ${dashcardId} not found on dashboard ${dashboardId}`);
@@ -667,6 +701,7 @@ function dashboardResource(transport) {
667
701
  * any other way propagates as the failure it was.
668
702
  */
669
703
  async function checkCardReferences(dashcards, options = {}) {
704
+ await transport.require("dashboard.checkCardReferences", options);
670
705
  const grouped = groupByCardId(collectCardReferences(dashcards));
671
706
  return (await Promise.all(Array.from(grouped.entries()).map(async ([cardId, references]) => ({
672
707
  references,
@@ -697,6 +732,7 @@ function dashboardResource(transport) {
697
732
  * Fetch the selectable values for a dashboard parameter, through the chain-filter value endpoint.
698
733
  */
699
734
  async function parameterValues(dashboardId, parameterId, options = {}) {
735
+ await transport.require("dashboard.parameterValues", options);
700
736
  return transport.requestParsed(ParameterValues, `/api/dashboard/${dashboardId}/params/${encodeURIComponent(parameterId)}/values`, { ...options });
701
737
  }
702
738
  /**
@@ -704,6 +740,7 @@ function dashboardResource(transport) {
704
740
  * substring, capped at the first 1000 matches.
705
741
  */
706
742
  async function searchParameterValues(dashboardId, parameterId, query, options = {}) {
743
+ await transport.require("dashboard.searchParameterValues", options);
707
744
  const parameter = encodeURIComponent(parameterId);
708
745
  return transport.requestParsed(ParameterValues, `/api/dashboard/${dashboardId}/params/${parameter}/search/${encodeURIComponent(query)}`, { ...options });
709
746
  }
@@ -766,6 +803,7 @@ const SYNC_COMPLETE = "complete";
766
803
  function databaseResource(transport) {
767
804
  /** List databases. `include` hydrates each database's tables; `saved` adds the Saved Questions virtual database. */
768
805
  async function list(params = {}, options = {}) {
806
+ await transport.require("database.list", options);
769
807
  const response = await transport.requestParsed(DatabaseApiList, "/api/database", {
770
808
  ...options,
771
809
  query: {
@@ -780,6 +818,7 @@ function databaseResource(transport) {
780
818
  }
781
819
  /** Get one database by id. `include` hydrates its tables, and `tables.fields` their fields too. */
782
820
  async function get(id, params = {}, options = {}) {
821
+ await transport.require("database.get", options);
783
822
  return transport.requestParsed(Database, `/api/database/${id}`, {
784
823
  ...options,
785
824
  query: { include: params.include }
@@ -787,6 +826,7 @@ function databaseResource(transport) {
787
826
  }
788
827
  /** List the schema names in a database. */
789
828
  async function schemas(id, options = {}) {
829
+ await transport.require("database.schemas", options);
790
830
  return {
791
831
  data: await transport.requestParsed(DatabaseApiSchemaList, `/api/database/${id}/schemas`, { ...options }),
792
832
  total: null
@@ -794,6 +834,7 @@ function databaseResource(transport) {
794
834
  }
795
835
  /** List the tables one schema of a database holds. */
796
836
  async function schemaTables(id, schema, options = {}) {
837
+ await transport.require("database.schemaTables", options);
797
838
  return {
798
839
  data: await transport.requestParsed(DatabaseApiSchemaTableList, `/api/database/${id}/schema/${encodeURIComponent(schema)}`, { ...options }),
799
840
  total: null
@@ -804,6 +845,7 @@ function databaseResource(transport) {
804
845
  * pass `wait` to poll the database until it reports its initial sync complete.
805
846
  */
806
847
  async function syncSchema(id, params = {}, options = {}) {
848
+ await transport.require("database.syncSchema", options);
807
849
  const ack = await transport.requestParsed(DatabaseTaskAck, `/api/database/${id}/sync_schema`, {
808
850
  ...options,
809
851
  method: "POST"
@@ -825,6 +867,7 @@ function databaseResource(transport) {
825
867
  }
826
868
  /** Trigger a rescan of the cached field values across a database. */
827
869
  async function rescanValues(id, options = {}) {
870
+ await transport.require("database.rescanValues", options);
828
871
  return {
829
872
  id,
830
873
  status: (await transport.requestParsed(DatabaseTaskAck, `/api/database/${id}/rescan_values`, {
@@ -850,6 +893,7 @@ function datasetResource(transport) {
850
893
  * MBQL, or native — rather than a reference to a saved one, so nothing here is a card.
851
894
  */
852
895
  async function query(body, options = {}) {
896
+ await transport.require("dataset.query", options);
853
897
  return transport.requestParsed(CardQueryResult, "/api/dataset", {
854
898
  ...options,
855
899
  method: "POST",
@@ -864,6 +908,7 @@ const DocumentApiList = z.object({ items: z.array(Document) }).loose();
864
908
  function documentResource(transport) {
865
909
  /** Get existing documents. */
866
910
  async function list(options = {}) {
911
+ await transport.require("document.list", options);
867
912
  return {
868
913
  data: (await transport.requestParsed(DocumentApiList, "/api/document", { ...options })).items,
869
914
  total: null
@@ -871,10 +916,12 @@ function documentResource(transport) {
871
916
  }
872
917
  /** Return an existing document by id. */
873
918
  async function get(id, options = {}) {
919
+ await transport.require("document.get", options);
874
920
  return transport.requestParsed(Document, `/api/document/${id}`, { ...options });
875
921
  }
876
922
  /** Create a new document. */
877
923
  async function create(params, options = {}) {
924
+ await transport.require("document.create", options);
878
925
  return transport.requestParsed(Document, "/api/document", {
879
926
  ...options,
880
927
  method: "POST",
@@ -883,6 +930,7 @@ function documentResource(transport) {
883
930
  }
884
931
  /** Update an existing document by id. */
885
932
  async function update(id, params, options = {}) {
933
+ await transport.require("document.update", options);
886
934
  return transport.requestParsed(Document, `/api/document/${id}`, {
887
935
  ...options,
888
936
  method: "PUT",
@@ -891,6 +939,7 @@ function documentResource(transport) {
891
939
  }
892
940
  /** Archive (soft-delete) a document by id. Metabase models this as an update, not its own endpoint. */
893
941
  async function archive(id, options = {}) {
942
+ await transport.require("document.archive", options);
894
943
  return update(id, { archived: true }, options);
895
944
  }
896
945
  return {
@@ -910,6 +959,7 @@ function eidTranslationResource(transport) {
910
959
  * lookup succeeded — the numeric id.
911
960
  */
912
961
  async function translate(params, options = {}) {
962
+ await transport.require("eidTranslation.translate", options);
913
963
  return transport.requestParsed(EidTranslateResult, "/api/eid-translation/translate", {
914
964
  ...options,
915
965
  method: "POST",
@@ -924,10 +974,12 @@ const FieldApiSummary = z.tuple([z.tuple([z.literal("count"), z.number().int()])
924
974
  function fieldResource(transport) {
925
975
  /** Get one field by id. */
926
976
  async function get(id, options = {}) {
977
+ await transport.require("field.get", options);
927
978
  return transport.requestParsed(Field, `/api/field/${id}`, { ...options });
928
979
  }
929
980
  /** Update a field by id, patching only the fields the body carries. */
930
981
  async function update(id, params, options = {}) {
982
+ await transport.require("field.update", options);
931
983
  return transport.requestParsed(Field, `/api/field/${id}`, {
932
984
  ...options,
933
985
  method: "PUT",
@@ -936,6 +988,7 @@ function fieldResource(transport) {
936
988
  }
937
989
  /** Get the row count and the distinct-value count for a field. */
938
990
  async function summary(id, options = {}) {
991
+ await transport.require("field.summary", options);
939
992
  const [[, count], [, distincts]] = await transport.requestParsed(FieldApiSummary, `/api/field/${id}/summary`, { ...options });
940
993
  return {
941
994
  field_id: id,
@@ -945,6 +998,7 @@ function fieldResource(transport) {
945
998
  }
946
999
  /** Get the cached distinct values Metabase holds for a field. */
947
1000
  async function values(id, options = {}) {
1001
+ await transport.require("field.values", options);
948
1002
  return transport.requestParsed(FieldValues, `/api/field/${id}/values`, { ...options });
949
1003
  }
950
1004
  return {
@@ -990,7 +1044,6 @@ const SyncStashStarted = z.object({
990
1044
  message: z.string(),
991
1045
  task_id: z.number().int().positive()
992
1046
  });
993
- const WorktreeApiList = z.array(Worktree);
994
1047
  const RemoteSyncSetting = z.string().nullable();
995
1048
  const FORBIDDEN_STATUS = 403;
996
1049
  const UNREGISTERED_STATUS = 404;
@@ -998,99 +1051,57 @@ function isRemoteUnreadable(error) {
998
1051
  if (!(error instanceof HttpError)) return false;
999
1052
  return error.status === FORBIDDEN_STATUS || error.status === UNREGISTERED_STATUS;
1000
1053
  }
1001
- function scopeOf(worktreeId) {
1002
- return { "worktree-id": worktreeId };
1003
- }
1004
1054
  function gitSyncResource(transport) {
1005
- /**
1006
- * Get the running or most recently finished sync task in the scope, or null when the server has
1007
- * none. `worktree-id` asks about a worktree's tasks instead of the main app's.
1008
- */
1009
- async function currentTask(params = {}, options = {}) {
1010
- return fetchOptionalParsed(transport, "/api/ee/remote-sync/current-task", SyncTask, {
1011
- ...options,
1012
- query: { "worktree-id": params["worktree-id"] }
1013
- });
1014
- }
1015
- /**
1016
- * Request cancellation of the running sync task, and answer it in the state that left it.
1017
- * `worktree_id` cancels a worktree's task instead of the main app's.
1018
- */
1019
- async function cancelTask(params = {}, options = {}) {
1055
+ /** Get the running or most recently finished sync task, or null when the server has none. */
1056
+ async function currentTask(options = {}) {
1057
+ await transport.require("gitSync.currentTask", options);
1058
+ return fetchOptionalParsed(transport, "/api/ee/remote-sync/current-task", SyncTask, options);
1059
+ }
1060
+ /** Request cancellation of the running sync task, and answer it in the state that left it. */
1061
+ async function cancelTask(options = {}) {
1062
+ await transport.require("gitSync.cancelTask", options);
1020
1063
  return transport.requestParsed(SyncTask, "/api/ee/remote-sync/current-task/cancel", {
1021
1064
  ...options,
1022
- method: "POST",
1023
- body: { worktree_id: params.worktree_id }
1065
+ method: "POST"
1024
1066
  });
1025
1067
  }
1026
- /**
1027
- * Whether the scope holds content changes the remote has not been told about. `worktree-id` asks
1028
- * about a worktree instead of the main app.
1029
- */
1030
- async function isDirty(params = {}, options = {}) {
1031
- return (await transport.requestParsed(SyncDirtyFlag, "/api/ee/remote-sync/is-dirty", {
1032
- ...options,
1033
- query: { "worktree-id": params["worktree-id"] }
1034
- })).is_dirty;
1068
+ /** Whether Metabase holds content changes the remote has not been told about. */
1069
+ async function isDirty(options = {}) {
1070
+ await transport.require("gitSync.isDirty", options);
1071
+ return (await transport.requestParsed(SyncDirtyFlag, "/api/ee/remote-sync/is-dirty", { ...options })).is_dirty;
1035
1072
  }
1036
- /**
1037
- * List the objects whose local state differs from the remote. `worktree-id` asks about a worktree
1038
- * instead of the main app.
1039
- */
1040
- async function dirty(params = {}, options = {}) {
1073
+ /** List the objects whose local state differs from the remote. */
1074
+ async function dirty(options = {}) {
1075
+ await transport.require("gitSync.dirty", options);
1041
1076
  return {
1042
- data: (await transport.requestParsed(SyncDirtyList, "/api/ee/remote-sync/dirty", {
1043
- ...options,
1044
- query: { "worktree-id": params["worktree-id"] }
1045
- })).dirty,
1077
+ data: (await transport.requestParsed(SyncDirtyList, "/api/ee/remote-sync/dirty", { ...options })).dirty,
1046
1078
  total: null
1047
1079
  };
1048
1080
  }
1049
1081
  /**
1050
- * Compare the branch the scope tracks against what Metabase last imported. The server caches the
1051
- * comparison; `force-refresh` re-reads the remote instead, and `worktree-id` checks a worktree's
1052
- * own branch rather than the main app's.
1082
+ * Compare the tracked remote branch against what Metabase last imported. The server caches the
1083
+ * comparison; `force-refresh` re-reads the remote instead.
1053
1084
  */
1054
1085
  async function hasRemoteChanges(params = {}, options = {}) {
1086
+ await transport.require("gitSync.hasRemoteChanges", options);
1055
1087
  return transport.requestParsed(SyncRemoteChanges, "/api/ee/remote-sync/has-remote-changes", {
1056
1088
  ...options,
1057
- query: {
1058
- "force-refresh": params["force-refresh"],
1059
- "worktree-id": params["worktree-id"]
1060
- }
1089
+ query: { "force-refresh": params["force-refresh"] }
1061
1090
  });
1062
1091
  }
1063
1092
  /**
1064
- * Dry-run preview of what pushing the scope's current state would do against the live remote
1065
- * branch, writing nothing: whether the remote has advanced, whether a three-way merge would
1066
- * apply cleanly, the entities that conflict, the counts a merge would fold in, and the remote
1067
- * content a force push would discard instead.
1068
- */
1069
- async function exportPreflight(params, options = {}) {
1070
- return transport.requestParsed(SyncExportPreflight, "/api/ee/remote-sync/export-preflight", {
1071
- ...options,
1072
- query: {
1073
- branch: params.branch,
1074
- "worktree-id": params["worktree-id"]
1075
- }
1076
- });
1077
- }
1078
- /**
1079
- * Import content from the remote into the scope. The endpoint queues a task and returns at once;
1093
+ * Import content from the remote into Metabase. The endpoint queues a task and returns at once;
1080
1094
  * pass `wait` to poll that task until it reaches a terminal status. A server already up to date
1081
- * answers no task id, and there is then nothing to poll. Inside a worktree the worktree's own
1082
- * branch is the target and `branch` is ignored.
1095
+ * answers no task id, and there is then nothing to poll.
1083
1096
  */
1084
- async function importFromRemote(params, options = {}) {
1097
+ async function importFromRemote(params = {}, options = {}) {
1098
+ await transport.require("gitSync.import", options);
1085
1099
  const started = await transport.requestParsed(SyncImportStarted, "/api/ee/remote-sync/import", {
1086
1100
  ...options,
1087
1101
  method: "POST",
1088
1102
  body: {
1089
1103
  branch: params.branch,
1090
- expected_branch: params.expected_branch,
1091
- force: params.force,
1092
- merge: params.merge,
1093
- worktree_id: params.worktree_id
1104
+ force: params.force
1094
1105
  }
1095
1106
  });
1096
1107
  const message = started.message ?? null;
@@ -1098,39 +1109,35 @@ function gitSyncResource(transport) {
1098
1109
  message,
1099
1110
  task_id: started.task_id
1100
1111
  };
1101
- const scope = scopeOf(params.worktree_id);
1102
1112
  return {
1103
1113
  message,
1104
1114
  task_id: started.task_id,
1105
- final: await settle(params.wait, scope, options)
1115
+ final: await settle(params.wait, options)
1106
1116
  };
1107
1117
  }
1108
1118
  /**
1109
- * Export the scope's content to the remote. The endpoint queues a task and returns at once; pass
1110
- * `wait` to poll that task until it reaches a terminal status. `branch` must be the branch the
1111
- * scope is already on — the worktree's own inside a worktree, the tracked one in the main app.
1119
+ * Export Metabase's content to the remote. The endpoint queues a task and returns at once; pass
1120
+ * `wait` to poll that task until it reaches a terminal status.
1112
1121
  */
1113
- async function exportToRemote(params, options = {}) {
1122
+ async function exportToRemote(params = {}, options = {}) {
1123
+ await transport.require("gitSync.export", options);
1114
1124
  const started = await transport.requestParsed(SyncExportStarted, "/api/ee/remote-sync/export", {
1115
1125
  ...options,
1116
1126
  method: "POST",
1117
1127
  body: {
1118
1128
  branch: params.branch,
1119
1129
  message: params.message,
1120
- force: params.force,
1121
- merge: params.merge,
1122
- worktree_id: params.worktree_id
1130
+ force: params.force
1123
1131
  }
1124
1132
  });
1125
1133
  if (params.wait === void 0) return {
1126
1134
  message: started.message,
1127
1135
  task_id: started.task_id
1128
1136
  };
1129
- const scope = scopeOf(params.worktree_id);
1130
1137
  return {
1131
1138
  message: started.message,
1132
1139
  task_id: started.task_id,
1133
- final: await settle(params.wait, scope, options)
1140
+ final: await settle(params.wait, options)
1134
1141
  };
1135
1142
  }
1136
1143
  /**
@@ -1138,6 +1145,7 @@ function gitSyncResource(transport) {
1138
1145
  * queues a task and returns at once; pass `wait` to poll that task to a terminal status.
1139
1146
  */
1140
1147
  async function stash(params, options = {}) {
1148
+ await transport.require("gitSync.stash", options);
1141
1149
  const started = await transport.requestParsed(SyncStashStarted, "/api/ee/remote-sync/stash", {
1142
1150
  ...options,
1143
1151
  method: "POST",
@@ -1155,59 +1163,24 @@ function gitSyncResource(transport) {
1155
1163
  status: started.status,
1156
1164
  message: started.message,
1157
1165
  task_id: started.task_id,
1158
- final: await settle(params.wait, {}, options)
1166
+ final: await settle(params.wait, options)
1159
1167
  };
1160
1168
  }
1161
1169
  /** List the branches the configured remote carries. */
1162
1170
  async function branches(options = {}) {
1171
+ await transport.require("gitSync.branches", options);
1163
1172
  return {
1164
1173
  data: (await transport.requestParsed(SyncBranchList, "/api/ee/remote-sync/branches", { ...options })).items,
1165
1174
  total: null
1166
1175
  };
1167
1176
  }
1168
- /**
1169
- * Create a branch on the remote from the branch git-sync is on. The instance checks the new
1170
- * branch out by default; `checkout: false` creates it and leaves the instance where it is, which
1171
- * is what checking a branch out into a worktree wants.
1172
- */
1177
+ /** Create a branch on the remote and point git-sync at it. */
1173
1178
  async function createBranch(params, options = {}) {
1179
+ await transport.require("gitSync.createBranch", options);
1174
1180
  return transport.requestParsed(SyncBranchCreated, "/api/ee/remote-sync/create-branch", {
1175
1181
  ...options,
1176
1182
  method: "POST",
1177
- body: {
1178
- name: params.name,
1179
- checkout: params.checkout
1180
- }
1181
- });
1182
- }
1183
- /** List the remote-sync worktrees the caller can read. Worktrees are superuser-only. */
1184
- async function worktrees(options = {}) {
1185
- return {
1186
- data: await transport.requestParsed(WorktreeApiList, "/api/ee/remote-sync/worktree", { ...options }),
1187
- total: null
1188
- };
1189
- }
1190
- /** Get a single remote-sync worktree by id. */
1191
- async function getWorktree(id, options = {}) {
1192
- return transport.requestParsed(Worktree, `/api/ee/remote-sync/worktree/${id}`, { ...options });
1193
- }
1194
- /**
1195
- * Create a remote-sync worktree for a branch. The branch is not created here — it is expected to
1196
- * already exist on the remote — and its content is materialized by a subsequent import.
1197
- */
1198
- async function createWorktree(params, options = {}) {
1199
- return transport.requestParsed(Worktree, "/api/ee/remote-sync/worktree", {
1200
- ...options,
1201
- method: "POST",
1202
- body: { branch: params.branch }
1203
- });
1204
- }
1205
- /** Delete a remote-sync worktree along with every piece of content it checked out. */
1206
- async function deleteWorktree(id, options = {}) {
1207
- await transport.requestRaw(`/api/ee/remote-sync/worktree/${id}`, {
1208
- ...options,
1209
- method: "DELETE",
1210
- expectContentType: "binary"
1183
+ body: { name: params.name }
1211
1184
  });
1212
1185
  }
1213
1186
  /**
@@ -1215,6 +1188,7 @@ function gitSyncResource(transport) {
1215
1188
  * by location prefix, and may queue an export task to carry the change to the remote.
1216
1189
  */
1217
1190
  async function setCollectionSynced(collectionId, synced, options = {}) {
1191
+ await transport.require("gitSync.setCollectionSynced", options);
1218
1192
  return transport.requestParsed(SyncSettingsUpdateResult, "/api/ee/remote-sync/settings", {
1219
1193
  ...options,
1220
1194
  method: "PUT",
@@ -1223,6 +1197,7 @@ function gitSyncResource(transport) {
1223
1197
  }
1224
1198
  /** The collections currently in git-sync's scope. */
1225
1199
  async function syncedCollections(options = {}) {
1200
+ await transport.require("gitSync.syncedCollections", options);
1226
1201
  return {
1227
1202
  data: (await listCollectionsWithLibrary(transport, SyncScopeCollection, options)).filter((entry) => entry.is_remote_synced === true),
1228
1203
  total: null
@@ -1230,6 +1205,7 @@ function gitSyncResource(transport) {
1230
1205
  }
1231
1206
  /** The remote's URL, or null when none is configured or the caller may not read it. */
1232
1207
  async function remoteUrl(options = {}) {
1208
+ await transport.require("gitSync.remoteUrl", options);
1233
1209
  try {
1234
1210
  const url = await fetchOptionalParsed(transport, "/api/setting/remote-sync-url", RemoteSyncSetting, options);
1235
1211
  return url === "" ? null : url;
@@ -1240,17 +1216,19 @@ function gitSyncResource(transport) {
1240
1216
  }
1241
1217
  /** The branch git-sync tracks, or null when none is configured or the caller may not read it. */
1242
1218
  async function branch(options = {}) {
1219
+ await transport.require("gitSync.branch", options);
1243
1220
  return fetchOptionalParsed(transport, "/api/setting/remote-sync-branch", RemoteSyncSetting, options);
1244
1221
  }
1245
1222
  /**
1246
- * Poll the scope's current task until it reaches a terminal status. A server with no task at all
1223
+ * Poll the current task until it reaches a terminal status. A server with no task at all
1247
1224
  * answers null, which is terminal in the same sense: nothing further will happen.
1248
1225
  */
1249
- async function waitForTask(wait, params = {}, options = {}) {
1250
- return settle(wait, params, options);
1226
+ async function waitForTask(wait, options = {}) {
1227
+ await transport.require("gitSync.waitForTask", options);
1228
+ return settle(wait, options);
1251
1229
  }
1252
- async function settle(wait, scope, options) {
1253
- return pollUntil(async (signal) => currentTask(scope, {
1230
+ async function settle(wait, options) {
1231
+ return pollUntil(async (signal) => currentTask({
1254
1232
  ...options,
1255
1233
  signal
1256
1234
  }), (task) => task === null || isSyncTaskTerminal(task.status), wait);
@@ -1266,11 +1244,6 @@ function gitSyncResource(transport) {
1266
1244
  stash,
1267
1245
  branches,
1268
1246
  createBranch,
1269
- exportPreflight,
1270
- worktrees,
1271
- getWorktree,
1272
- createWorktree,
1273
- deleteWorktree,
1274
1247
  setCollectionSynced,
1275
1248
  syncedCollections,
1276
1249
  remoteUrl,
@@ -1284,42 +1257,17 @@ const LIBRARY_ROOT_PATH = "/api/ee/library/";
1284
1257
  const PUBLISH_TABLES_PATH = "/api/ee/data-studio/table/publish-tables";
1285
1258
  const UNPUBLISH_TABLES_PATH = "/api/ee/data-studio/table/unpublish-tables";
1286
1259
  const LIBRARY_DATA_TYPE = "library-data";
1287
- const AbsentLibrary = z.object({ data: z.null() });
1288
- const LibraryOrAbsent = z.union([Library, AbsentLibrary]);
1289
1260
  const PublishTablesResponse = z.object({ target_collection: Collection.nullable() });
1290
- const LibraryCollectionInfo = Collection.pick({
1291
- id: true,
1292
- type: true,
1293
- is_remote_synced: true
1294
- }).strip();
1295
1261
  function libraryResource(transport) {
1296
- /**
1297
- * Get the Library root and its child collections, or `null` on an instance that has none.
1298
- * `worktree-id` gets the Library a remote-sync worktree checked out rather than the main app's.
1299
- */
1300
- async function get(params = {}, options = {}) {
1301
- const result = await transport.requestParsed(LibraryOrAbsent, LIBRARY_ROOT_PATH, {
1302
- ...options,
1303
- query: { "worktree-id": params["worktree-id"] }
1304
- });
1305
- if (!("effective_children" in result)) return null;
1306
- const infoById = await libraryCollectionsById(options);
1307
- const effective_children = result.effective_children.map((child) => {
1308
- if (typeof child.id !== "number") return child;
1309
- const info = infoById.get(child.id);
1310
- if (info === void 0) return child;
1311
- return {
1312
- ...child,
1313
- type: info.type ?? child.type,
1314
- is_remote_synced: info.is_remote_synced ?? child.is_remote_synced
1315
- };
1316
- });
1317
- return {
1318
- ...result,
1319
- effective_children
1320
- };
1321
- }
1322
- async function libraryCollectionsById(options) {
1262
+ /** Get the Library root and its child collections, or `null` on an instance that has none. */
1263
+ async function get(options = {}) {
1264
+ await transport.require("library.get", options);
1265
+ const { features } = await transport.server(options);
1266
+ const wire = await transport.requestParsed(libraryWireSchema(features), LIBRARY_ROOT_PATH, { ...options });
1267
+ if (wire === null) return null;
1268
+ return toLibrary(wire, await libraryListing(options));
1269
+ }
1270
+ async function libraryListing(options) {
1323
1271
  const data = await listCollectionsWithLibrary(transport, LibraryCollectionInfo, options);
1324
1272
  const byId = /* @__PURE__ */ new Map();
1325
1273
  for (const collection of data) if (typeof collection.id === "number") byId.set(collection.id, collection);
@@ -1332,18 +1280,20 @@ function libraryResource(transport) {
1332
1280
  * back from a refetch, which together make this idempotent.
1333
1281
  */
1334
1282
  async function create(options = {}) {
1335
- const existing = await get({}, options);
1283
+ await transport.require("library.create", options);
1284
+ const existing = await get(options);
1336
1285
  if (existing !== null) return existing;
1337
1286
  await transport.requestRaw(LIBRARY_ROOT_PATH, {
1338
1287
  ...options,
1339
1288
  method: "POST"
1340
1289
  });
1341
- const created = await get({}, options);
1290
+ const created = await get(options);
1342
1291
  if (created === null) throw new Error(`Library was not created after POST ${LIBRARY_ROOT_PATH}`);
1343
1292
  return created;
1344
1293
  }
1345
1294
  /** The id of the Library's Data collection, creating the Library first when it does not exist. */
1346
1295
  async function ensureDataCollectionId(options = {}) {
1296
+ await transport.require("library.ensureDataCollectionId", options);
1347
1297
  const data = (await create(options)).effective_children.find((child) => child.type === LIBRARY_DATA_TYPE);
1348
1298
  if (data === void 0) throw new Error("Library has no Data collection to publish into");
1349
1299
  if (typeof data.id !== "number") throw new Error(`Library Data collection has a non-numeric id ${String(data.id)}`);
@@ -1354,6 +1304,7 @@ function libraryResource(transport) {
1354
1304
  * data pickers and rank up in search. Answers the collection they landed in.
1355
1305
  */
1356
1306
  async function publishTables(params, options = {}) {
1307
+ await transport.require("library.publishTables", options);
1357
1308
  return (await transport.requestParsed(PublishTablesResponse, PUBLISH_TABLES_PATH, {
1358
1309
  ...options,
1359
1310
  method: "POST",
@@ -1365,6 +1316,7 @@ function libraryResource(transport) {
1365
1316
  * depends on them. The endpoint answers no JSON body.
1366
1317
  */
1367
1318
  async function unpublishTables(params, options = {}) {
1319
+ await transport.require("library.unpublishTables", options);
1368
1320
  await transport.requestRaw(UNPUBLISH_TABLES_PATH, {
1369
1321
  ...options,
1370
1322
  method: "POST",
@@ -1386,6 +1338,7 @@ const MeasureApiList = z.array(Measure);
1386
1338
  function measureResource(transport) {
1387
1339
  /** List measures. */
1388
1340
  async function list(options = {}) {
1341
+ await transport.require("measure.list", options);
1389
1342
  return {
1390
1343
  data: await transport.requestParsed(MeasureApiList, "/api/measure", { ...options }),
1391
1344
  total: null
@@ -1393,10 +1346,12 @@ function measureResource(transport) {
1393
1346
  }
1394
1347
  /** Get one measure by id. */
1395
1348
  async function get(id, options = {}) {
1349
+ await transport.require("measure.get", options);
1396
1350
  return transport.requestParsed(Measure, `/api/measure/${id}`, { ...options });
1397
1351
  }
1398
1352
  /** Create a measure — a saved aggregation tied to a table — from a full measure body. */
1399
1353
  async function create(params, options = {}) {
1354
+ await transport.require("measure.create", options);
1400
1355
  return transport.requestParsed(Measure, "/api/measure", {
1401
1356
  ...options,
1402
1357
  method: "POST",
@@ -1408,6 +1363,7 @@ function measureResource(transport) {
1408
1363
  * required and lands in the audit log.
1409
1364
  */
1410
1365
  async function update(id, params, options = {}) {
1366
+ await transport.require("measure.update", options);
1411
1367
  return transport.requestParsed(Measure, `/api/measure/${id}`, {
1412
1368
  ...options,
1413
1369
  method: "PUT",
@@ -1419,6 +1375,7 @@ function measureResource(transport) {
1419
1375
  * so it carries the same required `revision_message`.
1420
1376
  */
1421
1377
  async function archive(id, params, options = {}) {
1378
+ await transport.require("measure.archive", options);
1422
1379
  return update(id, {
1423
1380
  archived: true,
1424
1381
  revision_message: params.revision_message
@@ -1461,6 +1418,7 @@ function notificationResource(transport) {
1461
1418
  * the request pins the card payload type.
1462
1419
  */
1463
1420
  async function list(params = {}, options = {}) {
1421
+ await transport.require("notification.list", options);
1464
1422
  return {
1465
1423
  data: await transport.requestParsed(NotificationApiList, "/api/notification", {
1466
1424
  ...options,
@@ -1477,10 +1435,12 @@ function notificationResource(transport) {
1477
1435
  }
1478
1436
  /** Get one question alert by id, refusing an id that names a system-event notification. */
1479
1437
  async function get(id, options = {}) {
1438
+ await transport.require("notification.get", options);
1480
1439
  return assertCardAlert(await transport.requestParsed(Notification, `/api/notification/${id}`, { ...options }));
1481
1440
  }
1482
1441
  /** Create a question alert — its card payload, schedules and handlers — from a full body. */
1483
1442
  async function create(params, options = {}) {
1443
+ await transport.require("notification.create", options);
1484
1444
  return transport.requestParsed(Notification, "/api/notification", {
1485
1445
  ...options,
1486
1446
  method: "POST",
@@ -1489,6 +1449,7 @@ function notificationResource(transport) {
1489
1449
  }
1490
1450
  /** Update a question alert by id, merging the patch over the stored notification. */
1491
1451
  async function update(id, params, options = {}) {
1452
+ await transport.require("notification.update", options);
1492
1453
  const current = await get(id, options);
1493
1454
  return transport.requestParsed(Notification, `/api/notification/${id}`, {
1494
1455
  ...options,
@@ -1498,6 +1459,7 @@ function notificationResource(transport) {
1498
1459
  }
1499
1460
  /** Archive a question alert by id, stopping every delivery. Metabase models this as an update. */
1500
1461
  async function archive(id, options = {}) {
1462
+ await transport.require("notification.archive", options);
1501
1463
  return update(id, { active: false }, options);
1502
1464
  }
1503
1465
  /**
@@ -1505,6 +1467,7 @@ function notificationResource(transport) {
1505
1467
  * body.
1506
1468
  */
1507
1469
  async function send(id, options = {}) {
1470
+ await transport.require("notification.send", options);
1508
1471
  await get(id, options);
1509
1472
  await transport.requestRaw(`/api/notification/${id}/send`, {
1510
1473
  ...options,
@@ -1534,6 +1497,7 @@ function mergePulseUpdate(current, patch) {
1534
1497
  function pulseResource(transport) {
1535
1498
  /** List dashboard subscriptions, optionally narrowed to one dashboard or to the archived ones. */
1536
1499
  async function list(params = {}, options = {}) {
1500
+ await transport.require("pulse.list", options);
1537
1501
  return {
1538
1502
  data: await transport.requestParsed(PulseApiList, "/api/pulse", {
1539
1503
  ...options,
@@ -1547,10 +1511,12 @@ function pulseResource(transport) {
1547
1511
  }
1548
1512
  /** Get one dashboard subscription by id. */
1549
1513
  async function get(id, options = {}) {
1514
+ await transport.require("pulse.get", options);
1550
1515
  return transport.requestParsed(Pulse, `/api/pulse/${id}`, { ...options });
1551
1516
  }
1552
1517
  /** Create a dashboard subscription — its cards and its delivery channels — from a full body. */
1553
1518
  async function create(params, options = {}) {
1519
+ await transport.require("pulse.create", options);
1554
1520
  return transport.requestParsed(Pulse, "/api/pulse", {
1555
1521
  ...options,
1556
1522
  method: "POST",
@@ -1559,6 +1525,7 @@ function pulseResource(transport) {
1559
1525
  }
1560
1526
  /** Update a dashboard subscription by id, carrying the server-defaulted flags forward. */
1561
1527
  async function update(id, params, options = {}) {
1528
+ await transport.require("pulse.update", options);
1562
1529
  const current = await get(id, options);
1563
1530
  return transport.requestParsed(Pulse, `/api/pulse/${id}`, {
1564
1531
  ...options,
@@ -1571,6 +1538,7 @@ function pulseResource(transport) {
1571
1538
  * update, and disables each of the subscription's channels as a side effect.
1572
1539
  */
1573
1540
  async function archive(id, options = {}) {
1541
+ await transport.require("pulse.archive", options);
1574
1542
  return update(id, { archived: true }, options);
1575
1543
  }
1576
1544
  return {
@@ -1591,11 +1559,11 @@ function searchResource(transport) {
1591
1559
  /**
1592
1560
  * Search over the instance's content, ranked against `q`. `models` narrows which kinds of entity
1593
1561
  * may match, `archived` swaps the active set for the archived one, `table_db_id` restricts to
1594
- * items on one database, `verified` to verified content, `worktree-id` searches inside one
1595
- * remote-sync worktree rather than the main app, and `limit`/`offset` are the window the server
1596
- * applies before ranking hydration.
1562
+ * items on one database, `verified` to verified content, and `limit`/`offset` are the window the
1563
+ * server applies before ranking hydration.
1597
1564
  */
1598
1565
  async function query(params = {}, options = {}) {
1566
+ await transport.require("search.query", options);
1599
1567
  const response = await transport.requestParsed(SearchApiResponse, "/api/search", {
1600
1568
  ...options,
1601
1569
  query: {
@@ -1605,8 +1573,7 @@ function searchResource(transport) {
1605
1573
  limit: params.limit,
1606
1574
  offset: params.offset,
1607
1575
  table_db_id: params.table_db_id,
1608
- verified: params.verified,
1609
- "worktree-id": params["worktree-id"]
1576
+ verified: params.verified
1610
1577
  }
1611
1578
  });
1612
1579
  return {
@@ -1622,6 +1589,7 @@ const SegmentApiList = z.array(Segment);
1622
1589
  function segmentResource(transport) {
1623
1590
  /** List every segment the caller can see. */
1624
1591
  async function list(options = {}) {
1592
+ await transport.require("segment.list", options);
1625
1593
  return {
1626
1594
  data: await transport.requestParsed(SegmentApiList, "/api/segment", { ...options }),
1627
1595
  total: null
@@ -1629,10 +1597,12 @@ function segmentResource(transport) {
1629
1597
  }
1630
1598
  /** Get one segment by id. */
1631
1599
  async function get(id, options = {}) {
1600
+ await transport.require("segment.get", options);
1632
1601
  return transport.requestParsed(Segment, `/api/segment/${id}`, { ...options });
1633
1602
  }
1634
1603
  /** Create a segment — a reusable row filter over one table — from a full segment body. */
1635
1604
  async function create(params, options = {}) {
1605
+ await transport.require("segment.create", options);
1636
1606
  return transport.requestParsed(Segment, "/api/segment", {
1637
1607
  ...options,
1638
1608
  method: "POST",
@@ -1644,6 +1614,7 @@ function segmentResource(transport) {
1644
1614
  * required: Metabase records every segment change in its revision history.
1645
1615
  */
1646
1616
  async function update(id, params, options = {}) {
1617
+ await transport.require("segment.update", options);
1647
1618
  return transport.requestParsed(Segment, `/api/segment/${id}`, {
1648
1619
  ...options,
1649
1620
  method: "PUT",
@@ -1655,6 +1626,7 @@ function segmentResource(transport) {
1655
1626
  * same required `revision_message`.
1656
1627
  */
1657
1628
  async function archive(id, params, options = {}) {
1629
+ await transport.require("segment.archive", options);
1658
1630
  return update(id, {
1659
1631
  archived: true,
1660
1632
  revision_message: params.revision_message
@@ -1679,6 +1651,7 @@ function rethrowSettingError(error, key) {
1679
1651
  function settingResource(transport) {
1680
1652
  /** Get all settings and their values, with descriptions and environment-variable names. */
1681
1653
  async function list(options = {}) {
1654
+ await transport.require("setting.list", options);
1682
1655
  return {
1683
1656
  data: await transport.requestParsed(SettingApiList, "/api/setting", { ...options }),
1684
1657
  total: null
@@ -1686,13 +1659,15 @@ function settingResource(transport) {
1686
1659
  }
1687
1660
  /**
1688
1661
  * Fetch a single setting's value by key. An unset setting answers 204 rather than 404, which
1689
- * reaches the caller as `null`; older servers answer the value as bare text rather than JSON.
1662
+ * reaches the caller as `null`; a string-typed setting answers bare text rather than JSON.
1690
1663
  */
1691
1664
  async function get(key, options = {}) {
1665
+ await transport.require("setting.get", options);
1692
1666
  return fetchOptionalParsed(transport, `/api/setting/${encodeURIComponent(key)}`, z.unknown(), options).catch((error) => rethrowSettingError(error, key));
1693
1667
  }
1694
1668
  /** Set a single setting's value by key. The endpoint answers 204 with no body. */
1695
1669
  async function set(key, value, options = {}) {
1670
+ await transport.require("setting.set", options);
1696
1671
  await transport.requestRaw(`/api/setting/${encodeURIComponent(key)}`, {
1697
1672
  ...options,
1698
1673
  method: "PUT",
@@ -1714,6 +1689,7 @@ function setupResource(transport) {
1714
1689
  * applying the instance preferences. The setup token is single-use.
1715
1690
  */
1716
1691
  async function create(params, options = {}) {
1692
+ await transport.require("setup.create", options);
1717
1693
  return transport.requestParsed(SetupResult, "/api/setup", {
1718
1694
  ...options,
1719
1695
  method: "POST",
@@ -1726,28 +1702,25 @@ function setupResource(transport) {
1726
1702
  //#region ../client/src/resources/snippet.ts
1727
1703
  const SnippetApiList = z.array(Snippet);
1728
1704
  function snippetResource(transport) {
1729
- /**
1730
- * List native query snippets. `archived` swaps the listing to archived snippets, and
1731
- * `worktree-id` lists only the snippets checked out into that remote-sync worktree.
1732
- */
1705
+ /** List native query snippets. `archived` swaps the listing to archived snippets. */
1733
1706
  async function list(params = {}, options = {}) {
1707
+ await transport.require("snippet.list", options);
1734
1708
  return {
1735
1709
  data: await transport.requestParsed(SnippetApiList, "/api/native-query-snippet", {
1736
1710
  ...options,
1737
- query: {
1738
- archived: params.archived,
1739
- "worktree-id": params["worktree-id"]
1740
- }
1711
+ query: { archived: params.archived }
1741
1712
  }),
1742
1713
  total: null
1743
1714
  };
1744
1715
  }
1745
1716
  /** Get one native query snippet by id. */
1746
1717
  async function get(id, options = {}) {
1718
+ await transport.require("snippet.get", options);
1747
1719
  return transport.requestParsed(Snippet, `/api/native-query-snippet/${id}`, { ...options });
1748
1720
  }
1749
1721
  /** Create a native query snippet from a name, its SQL fragment, and an optional collection. */
1750
1722
  async function create(params, options = {}) {
1723
+ await transport.require("snippet.create", options);
1751
1724
  return transport.requestParsed(Snippet, "/api/native-query-snippet", {
1752
1725
  ...options,
1753
1726
  method: "POST",
@@ -1756,6 +1729,7 @@ function snippetResource(transport) {
1756
1729
  }
1757
1730
  /** Update a native query snippet by id, patching only the fields the body carries. */
1758
1731
  async function update(id, params, options = {}) {
1732
+ await transport.require("snippet.update", options);
1759
1733
  return transport.requestParsed(Snippet, `/api/native-query-snippet/${id}`, {
1760
1734
  ...options,
1761
1735
  method: "PUT",
@@ -1767,6 +1741,7 @@ function snippetResource(transport) {
1767
1741
  * own endpoint.
1768
1742
  */
1769
1743
  async function archive(id, options = {}) {
1744
+ await transport.require("snippet.archive", options);
1770
1745
  return update(id, { archived: true }, options);
1771
1746
  }
1772
1747
  return {
@@ -1787,6 +1762,7 @@ const UPLOAD_UPDATE_PATHS = {
1787
1762
  function tableResource(transport) {
1788
1763
  /** List every table the caller can see, across all databases. */
1789
1764
  async function list(options = {}) {
1765
+ await transport.require("table.list", options);
1790
1766
  return {
1791
1767
  data: await transport.requestParsed(TableApiList, "/api/table", { ...options }),
1792
1768
  total: null
@@ -1794,10 +1770,12 @@ function tableResource(transport) {
1794
1770
  }
1795
1771
  /** Get one table by id, without its fields. */
1796
1772
  async function get(id, options = {}) {
1773
+ await transport.require("table.get", options);
1797
1774
  return transport.requestParsed(Table, `/api/table/${id}`, { ...options });
1798
1775
  }
1799
1776
  /** Update a table by id, patching only the fields the body carries. */
1800
1777
  async function update(id, params, options = {}) {
1778
+ await transport.require("table.update", options);
1801
1779
  return transport.requestParsed(Table, `/api/table/${id}`, {
1802
1780
  ...options,
1803
1781
  method: "PUT",
@@ -1806,6 +1784,7 @@ function tableResource(transport) {
1806
1784
  }
1807
1785
  /** Get a table by id with its fields hydrated — the metadata the query builder runs on. */
1808
1786
  async function queryMetadata(id, options = {}) {
1787
+ await transport.require("table.queryMetadata", options);
1809
1788
  return transport.requestParsed(TableQueryMetadata, `/api/table/${id}/query_metadata`, { ...options });
1810
1789
  }
1811
1790
  async function updateFromCsv(id, action, file, options) {
@@ -1827,6 +1806,7 @@ function tableResource(transport) {
1827
1806
  * The file may be at most 50 MB; larger uploads are rejected with a 413 response.
1828
1807
  */
1829
1808
  async function appendCsv(id, file, options = {}) {
1809
+ await transport.require("table.appendCsv", options);
1830
1810
  return updateFromCsv(id, "append", file, options);
1831
1811
  }
1832
1812
  /**
@@ -1836,6 +1816,7 @@ function tableResource(transport) {
1836
1816
  * The file may be at most 50 MB; larger uploads are rejected with a 413 response.
1837
1817
  */
1838
1818
  async function replaceCsv(id, file, options = {}) {
1819
+ await transport.require("table.replaceCsv", options);
1839
1820
  return updateFromCsv(id, "replace", file, options);
1840
1821
  }
1841
1822
  return {
@@ -1852,10 +1833,12 @@ function tableResource(transport) {
1852
1833
  function timelineEventResource(transport) {
1853
1834
  /** Get one timeline event by id. */
1854
1835
  async function get(id, options = {}) {
1836
+ await transport.require("timelineEvent.get", options);
1855
1837
  return transport.requestParsed(TimelineEvent, `/api/timeline-event/${id}`, { ...options });
1856
1838
  }
1857
1839
  /** Create a timeline event on an existing timeline. */
1858
1840
  async function create(params, options = {}) {
1841
+ await transport.require("timelineEvent.create", options);
1859
1842
  return transport.requestParsed(TimelineEvent, "/api/timeline-event", {
1860
1843
  ...options,
1861
1844
  method: "POST",
@@ -1867,6 +1850,7 @@ function timelineEventResource(transport) {
1867
1850
  * the event to another timeline.
1868
1851
  */
1869
1852
  async function update(id, params, options = {}) {
1853
+ await transport.require("timelineEvent.update", options);
1870
1854
  return transport.requestParsed(TimelineEvent, `/api/timeline-event/${id}`, {
1871
1855
  ...options,
1872
1856
  method: "PUT",
@@ -1878,10 +1862,12 @@ function timelineEventResource(transport) {
1878
1862
  * endpoint.
1879
1863
  */
1880
1864
  async function archive(id, options = {}) {
1865
+ await transport.require("timelineEvent.archive", options);
1881
1866
  return update(id, { archived: true }, options);
1882
1867
  }
1883
1868
  /** Permanently delete a timeline event by id. The server answers with no body. */
1884
1869
  async function remove(id, options = {}) {
1870
+ await transport.require("timelineEvent.delete", options);
1885
1871
  await transport.requestRaw(`/api/timeline-event/${id}`, {
1886
1872
  ...options,
1887
1873
  method: "DELETE",
@@ -1903,6 +1889,7 @@ const TimelineWithEvents = Timeline.required({ events: true });
1903
1889
  function timelineResource(transport) {
1904
1890
  /** List timelines. `archived` swaps the active listing for the archived one. */
1905
1891
  async function list(params = {}, options = {}) {
1892
+ await transport.require("timeline.list", options);
1906
1893
  return {
1907
1894
  data: await transport.requestParsed(TimelineApiList, "/api/timeline", {
1908
1895
  ...options,
@@ -1913,6 +1900,7 @@ function timelineResource(transport) {
1913
1900
  }
1914
1901
  /** Get one timeline by id, without its events. */
1915
1902
  async function get(id, options = {}) {
1903
+ await transport.require("timeline.get", options);
1916
1904
  return transport.requestParsed(Timeline, `/api/timeline/${id}`, { ...options });
1917
1905
  }
1918
1906
  /**
@@ -1920,6 +1908,7 @@ function timelineResource(transport) {
1920
1908
  * timeline read hydrates them on request, and `archived` chooses which of them come back.
1921
1909
  */
1922
1910
  async function events(id, params = {}, options = {}) {
1911
+ await transport.require("timeline.events", options);
1923
1912
  return {
1924
1913
  data: (await transport.requestParsed(TimelineWithEvents, `/api/timeline/${id}`, {
1925
1914
  ...options,
@@ -1933,6 +1922,7 @@ function timelineResource(transport) {
1933
1922
  }
1934
1923
  /** Create a timeline from a full timeline body. */
1935
1924
  async function create(params, options = {}) {
1925
+ await transport.require("timeline.create", options);
1936
1926
  return transport.requestParsed(Timeline, "/api/timeline", {
1937
1927
  ...options,
1938
1928
  method: "POST",
@@ -1944,6 +1934,7 @@ function timelineResource(transport) {
1944
1934
  * cascades to every event on the timeline.
1945
1935
  */
1946
1936
  async function update(id, params, options = {}) {
1937
+ await transport.require("timeline.update", options);
1947
1938
  return transport.requestParsed(Timeline, `/api/timeline/${id}`, {
1948
1939
  ...options,
1949
1940
  method: "PUT",
@@ -1955,10 +1946,12 @@ function timelineResource(transport) {
1955
1946
  * not its own endpoint.
1956
1947
  */
1957
1948
  async function archive(id, options = {}) {
1949
+ await transport.require("timeline.archive", options);
1958
1950
  return update(id, { archived: true }, options);
1959
1951
  }
1960
1952
  /** Permanently delete a timeline and all its events by id. The server answers with no body. */
1961
1953
  async function remove(id, options = {}) {
1954
+ await transport.require("timeline.delete", options);
1962
1955
  await transport.requestRaw(`/api/timeline/${id}`, {
1963
1956
  ...options,
1964
1957
  method: "DELETE",
@@ -1977,23 +1970,27 @@ function timelineResource(transport) {
1977
1970
  }
1978
1971
  //#endregion
1979
1972
  //#region ../client/src/resources/transform-job.ts
1980
- const TransformJobApiList = z.array(TransformJob);
1981
- const TransformApiList$1 = z.array(Transform);
1982
1973
  function transformJobResource(transport) {
1983
1974
  /** List every transform job the caller can see. */
1984
1975
  async function list(options = {}) {
1976
+ await transport.require("transformJob.list", options);
1977
+ const { features } = await transport.server(options);
1985
1978
  return {
1986
- data: await transport.requestParsed(TransformJobApiList, "/api/transform-job", { ...options }),
1979
+ data: await transport.requestParsed(z.array(transformJobSchema(features)), "/api/transform-job", { ...options }),
1987
1980
  total: null
1988
1981
  };
1989
1982
  }
1990
1983
  /** Get one transform job by id. */
1991
1984
  async function get(id, options = {}) {
1992
- return transport.requestParsed(TransformJob, `/api/transform-job/${id}`, { ...options });
1985
+ await transport.require("transformJob.get", options);
1986
+ const { features } = await transport.server(options);
1987
+ return transport.requestParsed(transformJobSchema(features), `/api/transform-job/${id}`, { ...options });
1993
1988
  }
1994
1989
  /** Create a transform job — a schedule plus the tags it runs — from a full body. */
1995
1990
  async function create(params, options = {}) {
1996
- return transport.requestParsed(TransformJob, "/api/transform-job", {
1991
+ await transport.require("transformJob.create", options);
1992
+ const { features } = await transport.server(options);
1993
+ return transport.requestParsed(transformJobSchema(features), "/api/transform-job", {
1997
1994
  ...options,
1998
1995
  method: "POST",
1999
1996
  body: params
@@ -2001,7 +1998,9 @@ function transformJobResource(transport) {
2001
1998
  }
2002
1999
  /** Update a transform job by id, patching only the fields the body carries. */
2003
2000
  async function update(id, params, options = {}) {
2004
- return transport.requestParsed(TransformJob, `/api/transform-job/${id}`, {
2001
+ await transport.require("transformJob.update", options);
2002
+ const { features } = await transport.server(options);
2003
+ return transport.requestParsed(transformJobSchema(features), `/api/transform-job/${id}`, {
2005
2004
  ...options,
2006
2005
  method: "PUT",
2007
2006
  body: params
@@ -2009,6 +2008,7 @@ function transformJobResource(transport) {
2009
2008
  }
2010
2009
  /** Delete a transform job by id, leaving the transforms it ran untouched. */
2011
2010
  async function remove(id, options = {}) {
2011
+ await transport.require("transformJob.delete", options);
2012
2012
  await transport.requestRaw(`/api/transform-job/${id}`, {
2013
2013
  ...options,
2014
2014
  method: "DELETE",
@@ -2020,7 +2020,9 @@ function transformJobResource(transport) {
2020
2020
  * plus those transforms' dependencies; `run_all` re-runs dependencies that are already fresh.
2021
2021
  */
2022
2022
  async function run(id, params = {}, options = {}) {
2023
- return transport.requestParsed(TransformJobRunResult, `/api/transform-job/${id}/run`, {
2023
+ await transport.require("transformJob.run", options);
2024
+ const { features } = await transport.server(options);
2025
+ return transport.requestParsed(transformJobRunResultSchema(features), `/api/transform-job/${id}/run`, {
2024
2026
  ...options,
2025
2027
  method: "POST",
2026
2028
  body: { run_all: params.run_all }
@@ -2028,8 +2030,10 @@ function transformJobResource(transport) {
2028
2030
  }
2029
2031
  /** List the transforms a job would execute, resolved from the job's tags. */
2030
2032
  async function transforms(id, options = {}) {
2033
+ await transport.require("transformJob.transforms", options);
2034
+ const { features } = await transport.server(options);
2031
2035
  return {
2032
- data: await transport.requestParsed(TransformApiList$1, `/api/transform-job/${id}/transforms`, { ...options }),
2036
+ data: await transport.requestParsed(z.array(transformRowSchema(features)), `/api/transform-job/${id}/transforms`, { ...options }),
2033
2037
  total: null
2034
2038
  };
2035
2039
  }
@@ -2038,6 +2042,7 @@ function transformJobResource(transport) {
2038
2042
  * manual runs ignore the flag. The path carries no id and is a different endpoint from `update`.
2039
2043
  */
2040
2044
  async function setActive(active, options = {}) {
2045
+ await transport.require("transformJob.setActive", options);
2041
2046
  return transport.requestParsed(TransformJobActiveResult, "/api/transform-job/active", {
2042
2047
  ...options,
2043
2048
  method: "PUT",
@@ -2057,32 +2062,40 @@ function transformJobResource(transport) {
2057
2062
  }
2058
2063
  //#endregion
2059
2064
  //#region ../client/src/resources/transform.ts
2060
- const TransformApiList = z.array(Transform);
2065
+ function transformListSchema(features) {
2066
+ return z.array(transformRowSchema(features));
2067
+ }
2061
2068
  const TransformRunKickoff = z.object({
2062
2069
  message: z.string(),
2063
2070
  run_id: z.number().int().positive().nullable()
2064
2071
  });
2065
2072
  function transformResource(transport) {
2066
- /**
2067
- * List every transform the caller can see. `worktree-id` lists only the transforms checked out
2068
- * into that remote-sync worktree; without it the listing is the main app's.
2069
- */
2070
- async function list(params = {}, options = {}) {
2073
+ async function requestTransformList(path, opts) {
2074
+ const { features } = await transport.server(opts);
2071
2075
  return {
2072
- data: await transport.requestParsed(TransformApiList, "/api/transform", {
2073
- ...options,
2074
- query: { "worktree-id": params["worktree-id"] }
2075
- }),
2076
+ data: await transport.requestParsed(transformListSchema(features), path, opts),
2076
2077
  total: null
2077
2078
  };
2078
2079
  }
2080
+ async function requestTransform(path, opts) {
2081
+ const { features } = await transport.server(opts);
2082
+ return transport.requestParsed(transformRowSchema(features), path, opts);
2083
+ }
2084
+ /** List every transform the caller can see. */
2085
+ async function list(options = {}) {
2086
+ await transport.require("transform.list", options);
2087
+ return requestTransformList("/api/transform", { ...options });
2088
+ }
2079
2089
  /** Get one transform by id. */
2080
2090
  async function get(id, options = {}) {
2081
- return transport.requestParsed(Transform, `/api/transform/${id}`, { ...options });
2091
+ await transport.require("transform.get", options);
2092
+ const { features } = await transport.server(options);
2093
+ return transport.requestParsed(transformDetailSchema(features), `/api/transform/${id}`, { ...options });
2082
2094
  }
2083
2095
  /** Create a transform — a query plus the warehouse table it writes — from a full body. */
2084
2096
  async function create(params, options = {}) {
2085
- return transport.requestParsed(Transform, "/api/transform", {
2097
+ await transport.require("transform.create", options);
2098
+ return requestTransform("/api/transform", {
2086
2099
  ...options,
2087
2100
  method: "POST",
2088
2101
  body: params
@@ -2090,7 +2103,8 @@ function transformResource(transport) {
2090
2103
  }
2091
2104
  /** Update a transform by id, patching only the fields the body carries. */
2092
2105
  async function update(id, params, options = {}) {
2093
- return transport.requestParsed(Transform, `/api/transform/${id}`, {
2106
+ await transport.require("transform.update", options);
2107
+ return requestTransform(`/api/transform/${id}`, {
2094
2108
  ...options,
2095
2109
  method: "PUT",
2096
2110
  body: params
@@ -2098,6 +2112,7 @@ function transformResource(transport) {
2098
2112
  }
2099
2113
  /** Delete a transform by id, leaving any table it already materialized in place. */
2100
2114
  async function remove(id, options = {}) {
2115
+ await transport.require("transform.delete", options);
2101
2116
  await transport.requestRaw(`/api/transform/${id}`, {
2102
2117
  ...options,
2103
2118
  method: "DELETE",
@@ -2106,6 +2121,7 @@ function transformResource(transport) {
2106
2121
  }
2107
2122
  /** Drop a transform's materialized output table, keeping the transform definition. */
2108
2123
  async function deleteTable(id, options = {}) {
2124
+ await transport.require("transform.deleteTable", options);
2109
2125
  await transport.requestRaw(`/api/transform/${id}/table`, {
2110
2126
  ...options,
2111
2127
  method: "DELETE",
@@ -2114,13 +2130,12 @@ function transformResource(transport) {
2114
2130
  }
2115
2131
  /** List the upstream transforms a transform depends on. */
2116
2132
  async function dependencies(id, options = {}) {
2117
- return {
2118
- data: await transport.requestParsed(TransformApiList, `/api/transform/${id}/dependencies`, { ...options }),
2119
- total: null
2120
- };
2133
+ await transport.require("transform.dependencies", options);
2134
+ return requestTransformList(`/api/transform/${id}/dependencies`, { ...options });
2121
2135
  }
2122
2136
  /** Request cancellation of a transform's current run. */
2123
2137
  async function cancel(id, options = {}) {
2138
+ await transport.require("transform.cancel", options);
2124
2139
  await transport.requestRaw(`/api/transform/${id}/cancel`, {
2125
2140
  ...options,
2126
2141
  method: "POST",
@@ -2129,11 +2144,13 @@ function transformResource(transport) {
2129
2144
  }
2130
2145
  /** Get one transform run by run id — not by the id of the transform that produced it. */
2131
2146
  async function getRun(runId, options = {}) {
2147
+ await transport.require("transform.getRun", options);
2132
2148
  return transport.requestParsed(TransformRun, `/api/transform/run/${runId}`, { ...options });
2133
2149
  }
2134
2150
  /** Walk the run history, newest first, optionally narrowed to a single transform. */
2135
- function runPages(params = {}, options = {}) {
2136
- return paginatePages(transport, "/api/transform/run", TransformRun, {
2151
+ async function* runPages(params = {}, options = {}) {
2152
+ await transport.require("transform.runPages", options);
2153
+ yield* paginatePages(transport, "/api/transform/run", TransformRun, {
2137
2154
  query: { "transform-ids": params["transform-ids"] },
2138
2155
  ...options.offset !== void 0 && { offset: options.offset },
2139
2156
  ...options.max !== void 0 && { max: options.max },
@@ -2147,6 +2164,7 @@ function transformResource(transport) {
2147
2164
  * A server that answers no run id started nothing, and there is then nothing to poll.
2148
2165
  */
2149
2166
  async function run(id, params = {}, options = {}) {
2167
+ await transport.require("transform.run", options);
2150
2168
  const kickoff = await transport.requestParsed(TransformRunKickoff, `/api/transform/${id}/run`, {
2151
2169
  ...options,
2152
2170
  method: "POST"
@@ -2177,10 +2195,10 @@ function transformResource(transport) {
2177
2195
  }
2178
2196
  async function awaitTargetTableId(id, wait, options) {
2179
2197
  try {
2180
- return linkedTableId(await pollUntil(async (signal) => get(id, {
2198
+ return (await pollUntil(async (signal) => get(id, {
2181
2199
  ...options,
2182
2200
  signal
2183
- }), (transform) => linkedTableId(transform) !== null, wait));
2201
+ }), (transform) => transform.target_table_id !== null, wait)).target_table_id;
2184
2202
  } catch (error) {
2185
2203
  if (error instanceof TimeoutError) return null;
2186
2204
  throw error;
@@ -2200,28 +2218,21 @@ function transformResource(transport) {
2200
2218
  run
2201
2219
  };
2202
2220
  }
2203
- function linkedTableId(transform) {
2204
- return transform.target_table_id ?? transform.table?.id ?? null;
2205
- }
2206
2221
  //#endregion
2207
2222
  //#region ../client/src/resources/transform-tag.ts
2208
2223
  const TransformTagApiList = z.array(TransformTag);
2209
2224
  function transformTagResource(transport) {
2210
- /**
2211
- * List every transform tag the caller can see, built-in tags included. `worktree-id` lists only
2212
- * the tags checked out into that remote-sync worktree; without it the listing is the main app's.
2213
- */
2214
- async function list(params = {}, options = {}) {
2225
+ /** List every transform tag the caller can see, built-in tags included. */
2226
+ async function list(options = {}) {
2227
+ await transport.require("transformTag.list", options);
2215
2228
  return {
2216
- data: await transport.requestParsed(TransformTagApiList, "/api/transform-tag", {
2217
- ...options,
2218
- query: { "worktree-id": params["worktree-id"] }
2219
- }),
2229
+ data: await transport.requestParsed(TransformTagApiList, "/api/transform-tag", { ...options }),
2220
2230
  total: null
2221
2231
  };
2222
2232
  }
2223
2233
  /** Create a transform tag, the label a transform job matches transforms on. */
2224
2234
  async function create(params, options = {}) {
2235
+ await transport.require("transformTag.create", options);
2225
2236
  return transport.requestParsed(TransformTag, "/api/transform-tag", {
2226
2237
  ...options,
2227
2238
  method: "POST",
@@ -2230,6 +2241,7 @@ function transformTagResource(transport) {
2230
2241
  }
2231
2242
  /** Rename a transform tag by id. */
2232
2243
  async function update(id, params, options = {}) {
2244
+ await transport.require("transformTag.update", options);
2233
2245
  return transport.requestParsed(TransformTag, `/api/transform-tag/${id}`, {
2234
2246
  ...options,
2235
2247
  method: "PUT",
@@ -2238,6 +2250,7 @@ function transformTagResource(transport) {
2238
2250
  }
2239
2251
  /** Delete a transform tag by id, detaching it from every transform and job carrying it. */
2240
2252
  async function remove(id, options = {}) {
2253
+ await transport.require("transformTag.delete", options);
2241
2254
  await transport.requestRaw(`/api/transform-tag/${id}`, {
2242
2255
  ...options,
2243
2256
  method: "DELETE",
@@ -2262,6 +2275,7 @@ function uploadResource(transport) {
2262
2275
  * The file may be at most 50 MB; larger uploads are rejected with a 413 response.
2263
2276
  */
2264
2277
  async function createFromCsv(file, params, options = {}) {
2278
+ await transport.require("upload.createFromCsv", options);
2265
2279
  const form = buildCsvFormData(file);
2266
2280
  form.append("collection_id", params.collection_id);
2267
2281
  const response = await transport.requestRaw("/api/upload/csv", {
@@ -2314,6 +2328,7 @@ CurrentUser.pick({
2314
2328
  function userResource(transport) {
2315
2329
  /** Get the user the request's credentials authenticate as. */
2316
2330
  async function current(options = {}) {
2331
+ await transport.require("user.current", options);
2317
2332
  return transport.requestParsed(CurrentUser, "/api/user/current", { ...options });
2318
2333
  }
2319
2334
  return { current };
@@ -2351,6 +2366,7 @@ function createClient(config, options) {
2351
2366
  transformTag: transformTagResource(transport),
2352
2367
  upload: uploadResource(transport),
2353
2368
  user: userResource(transport),
2369
+ server: transport.server,
2354
2370
  requestParsed: transport.requestParsed,
2355
2371
  requestRaw: transport.requestRaw,
2356
2372
  requestStream: transport.requestStream