@metabase/cli 0.5.1 → 0.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (316) hide show
  1. package/README.md +1 -1
  2. package/dist/{add-collection-BnGPc0Vv.mjs → add-collection-c1dfnavz.mjs} +4 -4
  3. package/dist/{alert-DQkF8jYR.mjs → alert-BkpPdBQ_.mjs} +6 -6
  4. package/dist/{alerts-BncG7w1_.mjs → alerts-TDYiIxjs.mjs} +3 -3
  5. package/dist/api-key-9jVV67hF.mjs +38 -0
  6. package/dist/api-key-DbsqHlN6.mjs +31 -0
  7. package/dist/api-key-wGtJ8kYy.mjs +13 -0
  8. package/dist/{append-D4ekYCuD.mjs → append-CoeZRD6u.mjs} +3 -3
  9. package/dist/{archive-ULXc3xzI.mjs → archive-3fdIvMsf.mjs} +2 -2
  10. package/dist/{archive-v08JESCM.mjs → archive-9uzfWGuq.mjs} +2 -2
  11. package/dist/{archive-BQ4OA-R4.mjs → archive-CAJHrKwd.mjs} +2 -2
  12. package/dist/{archive-DpCP4yR1.mjs → archive-CH1h8jz5.mjs} +2 -2
  13. package/dist/{archive-BifJXCHF.mjs → archive-D-BJwRLc.mjs} +2 -2
  14. package/dist/{archive-BXr9kFNz.mjs → archive-DQRehboT.mjs} +5 -5
  15. package/dist/{archive-DjHLWUfC.mjs → archive-DY76wU2k.mjs} +2 -2
  16. package/dist/{archive-EhW6blNc.mjs → archive-DZDkfhdH.mjs} +4 -4
  17. package/dist/{archive-D2WCz3Oe.mjs → archive-DxUnaV4x.mjs} +2 -2
  18. package/dist/{archive-DocyUIME.mjs → archive-N3lp1o-k.mjs} +4 -4
  19. package/dist/{archive-CxNUeWII2.mjs → archive-NfFWXRx5.mjs} +4 -4
  20. package/dist/{archive-DnCF-Ecm.mjs → archive-f7wKQ7Uy.mjs} +2 -2
  21. package/dist/{auth-BPbsm8yV.mjs → auth-hgkvHPpH.mjs} +4 -4
  22. package/dist/{body-BkkQkGJg.mjs → body-M5qsJoub.mjs} +2 -2
  23. package/dist/{branch-flag-CTDvbaBa.mjs → branch-flag-CPTQ4wXp.mjs} +1 -1
  24. package/dist/{branches-lPHtM_xR.mjs → branches-B3gHAanU.mjs} +2 -2
  25. package/dist/{breaking-DjMlCD96.mjs → breaking-DuWIof4T.mjs} +5 -5
  26. package/dist/{broken-DUX3GWS5.mjs → broken-D2ST8sTx.mjs} +7 -7
  27. package/dist/{bulk-discard-values-Dl8Lzypf.mjs → bulk-discard-values-77khEfpj.mjs} +4 -4
  28. package/dist/{bulk-edit-N2xLVtfG.mjs → bulk-edit-girwcjY6.mjs} +5 -5
  29. package/dist/{bulk-rescan-values-BK2rH2Ik.mjs → bulk-rescan-values-Df8KK8um.mjs} +4 -4
  30. package/dist/{bulk-sync-schema-BKJc9Rzq.mjs → bulk-sync-schema-DEPUZ6MN.mjs} +4 -4
  31. package/dist/{cancel-DzkRVGIk.mjs → cancel-Oek5PJnu.mjs} +2 -2
  32. package/dist/{cancel-task-BiTlDY7a.mjs → cancel-task-rkqY0qLU.mjs} +3 -3
  33. package/dist/{card-CQNUT9pm.mjs → card-3NmUiU5F.mjs} +1 -1
  34. package/dist/{card-BTBDBsu-.mjs → card-BWTjCE93.mjs} +8 -8
  35. package/dist/{card-P5mBknsl.mjs → card-QR3zEu6E.mjs} +39 -16
  36. package/dist/{cards-CSL8ukS1.mjs → cards-DWJOtZoN.mjs} +5 -5
  37. package/dist/cli.mjs +172 -37
  38. package/dist/{client-BBwYPXDW.mjs → client-BFP2Ssqu.mjs} +221 -39
  39. package/dist/{collection-B19phRNU.mjs → collection-9_mj8rVX.mjs} +7 -7
  40. package/dist/{collection-CTnYZ2Jj.mjs → collection-D5vt2IJ_.mjs} +1 -1
  41. package/dist/{collection-B2wRXyTF.mjs → collection-DNmFKALA.mjs} +1 -0
  42. package/dist/{collection-namespace-B1OkM7p1.mjs → collection-namespace-Dl8_7xII.mjs} +1 -1
  43. package/dist/{content-translation-DoGTQnvH.mjs → content-translation-B3oARbgD.mjs} +2 -2
  44. package/dist/{copy-BYukQEtf.mjs → copy-BzBp5FaY.mjs} +5 -5
  45. package/dist/{copy-XlCT3gvG.mjs → copy-C7Rc4qM7.mjs} +3 -3
  46. package/dist/{copy-flags-ByB2MicL.mjs → copy-flags-CTM91pxH.mjs} +2 -2
  47. package/dist/{create-T4PZPVE9.mjs → create-71_DODbc.mjs} +3 -3
  48. package/dist/{create-jr4xJgSI.mjs → create-BKRD11i-.mjs} +3 -3
  49. package/dist/{create-k1Bo7h7g.mjs → create-Bc4ADRmU.mjs} +2 -2
  50. package/dist/{create-Bnb1abv_.mjs → create-Bh3q3eHg.mjs} +5 -5
  51. package/dist/{create-3_oY9KHY.mjs → create-ByeGK_BE.mjs} +2 -2
  52. package/dist/{create-DZJQp3r7.mjs → create-C-2ivjed.mjs} +2 -2
  53. package/dist/{create-CLZ7w83R.mjs → create-C0gmhNnk.mjs} +3 -3
  54. package/dist/create-C3H9ljex.mjs +34 -0
  55. package/dist/{create-DxMmIHI4.mjs → create-CGE1D0Ay.mjs} +2 -2
  56. package/dist/{create-CbT4SPHV.mjs → create-CGxxztoE.mjs} +2 -2
  57. package/dist/{create-CYoarNrb.mjs → create-CfXKNnkK.mjs} +2 -2
  58. package/dist/{create-Bl9sS7v7.mjs → create-CjGEkSFz.mjs} +6 -6
  59. package/dist/{create-Cdt8u1wF.mjs → create-DO4ic4Kx.mjs} +5 -5
  60. package/dist/{create-BP39g5Jk.mjs → create-DQJ9h86G.mjs} +2 -2
  61. package/dist/{create-DBNxy5rN.mjs → create-YBDXZgyP.mjs} +2 -2
  62. package/dist/{create-D5_c5SHo.mjs → create-YIC3Q0a-.mjs} +2 -2
  63. package/dist/create-_rOCx5b8.mjs +38 -0
  64. package/dist/{create-branch-CUNFdKyB.mjs → create-branch-DBCBMDWh.mjs} +4 -4
  65. package/dist/{create-CqF7vqXC.mjs → create-f0bBEfDI.mjs} +4 -4
  66. package/dist/{create-B3fm5I-l2.mjs → create-myJ8HR4B.mjs} +4 -4
  67. package/dist/{create-CrtIqtXN.mjs → create-vgP9K2eH2.mjs} +4 -4
  68. package/dist/{csv-CcnhKpuj.mjs → csv-Dtgy7sTg.mjs} +3 -3
  69. package/dist/{current-task-nl2z8sHI.mjs → current-task-AwQisIT9.mjs} +3 -3
  70. package/dist/{dashboard-BP0p62fp.mjs → dashboard-BZV-0Qjp.mjs} +11 -11
  71. package/dist/{dashboard-Phz3XpRM.mjs → dashboard-Chjy5GKR.mjs} +52 -5
  72. package/dist/{dashboard-XSTr9QCr.mjs → dashboard-D5E3fMKh.mjs} +1 -1
  73. package/dist/{data-action-Cr17CfgE.mjs → data-action-B7kRpvCH.mjs} +7 -7
  74. package/dist/data-app-BIAvvV2P.mjs +41 -0
  75. package/dist/data-app-BUW-HlUo.mjs +52 -0
  76. package/dist/data-app-Blz61mG5.mjs +29 -0
  77. package/dist/data-app-project-BL4xpu_m.mjs +57 -0
  78. package/dist/{database-2HYCdHqK.mjs → database-CxykzTAA.mjs} +14 -3
  79. package/dist/{database-BewllGR7.mjs → database-D8XzgJEz.mjs} +19 -2
  80. package/dist/{dataset-D-x2Ho2i.mjs → dataset-DIQLAp2P.mjs} +5 -4
  81. package/dist/db-wsSYKqCB.mjs +25 -0
  82. package/dist/delete-4v4_lDwD.mjs +44 -0
  83. package/dist/{delete-BOma6qIq.mjs → delete-BHX_F8Qu.mjs} +3 -3
  84. package/dist/{delete-DulVnxD_.mjs → delete-BP9-YS-f.mjs} +3 -3
  85. package/dist/delete-BSgxmR3y.mjs +40 -0
  86. package/dist/{delete-BUCh72Bq.mjs → delete-BegkpIGi.mjs} +3 -3
  87. package/dist/{delete-xf2n7SNg.mjs → delete-D9FB7qjX.mjs} +3 -3
  88. package/dist/{delete-QHsiWYay.mjs → delete-DmM5L0wO.mjs} +3 -3
  89. package/dist/{delete-BrbmJ3sn.mjs → delete-E-g5b-HU.mjs} +3 -3
  90. package/dist/{delete-Oc2GE170.mjs → delete-WrV9I9uw.mjs} +3 -3
  91. package/dist/delete-runtime-CJ7gMYA1.mjs +72 -0
  92. package/dist/{delete-table-LgJ17t6j.mjs → delete-table-CJq8JM5J.mjs} +3 -3
  93. package/dist/{delete-BXMc-g3Q.mjs → delete-wnHUWWjX.mjs} +3 -3
  94. package/dist/{dependencies-BE5QW7Lb.mjs → dependencies-CnW3RSoZ.mjs} +3 -3
  95. package/dist/{dependency-qP1hx2YN.mjs → dependency-CaC6XuTY.mjs} +2 -2
  96. package/dist/{dependency-BlTYysYG.mjs → dependency-DDRGBlFL.mjs} +5 -5
  97. package/dist/{dependency-BACk_cVP.mjs → dependency-Dxvb2Znu.mjs} +1 -1
  98. package/dist/{dependents-mbgHQNiv.mjs → dependents-DHXqJ3lo.mjs} +8 -8
  99. package/dist/{dirty-fYlA1N1e.mjs → dirty-BRPWPUYH.mjs} +4 -4
  100. package/dist/{discard-values-cIRBP5nT.mjs → discard-values-DBHfVN8o.mjs} +4 -4
  101. package/dist/{document-BaRQ5fBd.mjs → document-BeLf7NqP.mjs} +6 -6
  102. package/dist/{download-CokVpeK6.mjs → download-BFu9xYHX.mjs} +1 -1
  103. package/dist/{eid-CaumGUFD.mjs → eid-eKmbXRds.mjs} +3 -4
  104. package/dist/{entity-BHYJtRxp.mjs → entity-DjDkaMkB.mjs} +2 -2
  105. package/dist/{entry-flags-DjICpQkc.mjs → entry-flags-Cxn09krz.mjs} +3 -3
  106. package/dist/{events-jEo9fytL.mjs → events-CZL9MU64.mjs} +3 -3
  107. package/dist/{execute-H09Qus4_.mjs → execute-DBJGtHHG.mjs} +3 -3
  108. package/dist/{export-flags-DzW0Ktkh.mjs → export-flags-CpukgETM.mjs} +13 -5
  109. package/dist/{export-preflight-Db_TChn5.mjs → export-preflight-SM9zJkBp.mjs} +4 -4
  110. package/dist/{export-YtdZo7LZ.mjs → export-xn_-NaBd.mjs} +24 -12
  111. package/dist/{field-wmN6raOG.mjs → field-BVz4AS3f.mjs} +1 -1
  112. package/dist/{field-DktidTPB.mjs → field-CQDz-6DK.mjs} +7 -7
  113. package/dist/{field-5nivEfd6.mjs → field-DoWQUl7V.mjs} +58 -45
  114. package/dist/{fields-DUXlosmx.mjs → fields-CB06GFBW.mjs} +5 -5
  115. package/dist/{filter-flags-DTDcU7OI.mjs → filter-flags-DhE4olyf.mjs} +4 -4
  116. package/dist/{fks-Cl2sq-c0.mjs → fks-CSoS7xZ6.mjs} +5 -5
  117. package/dist/{get-C_rjxpoe.mjs → get--1qTpTIQ.mjs} +4 -4
  118. package/dist/{get-BilMWiFq.mjs → get-B8xQXMU6.mjs} +2 -2
  119. package/dist/{get-okEsnkvC.mjs → get-B8xrmipw.mjs} +2 -2
  120. package/dist/{get-DPiNYmXo.mjs → get-BIf6eFWZ.mjs} +2 -2
  121. package/dist/{get-DtcChy9h.mjs → get-BQ7SAJEz.mjs} +2 -2
  122. package/dist/{get-XS-6R81E.mjs → get-BSPxmP_W.mjs} +4 -4
  123. package/dist/{get-zPMv3kZE.mjs → get-BW3jSR3y.mjs} +2 -2
  124. package/dist/{get-DyK_bvg6.mjs → get-BYAzIaGG.mjs} +2 -2
  125. package/dist/{get-Cg0up9gm.mjs → get-BZDUOZxI.mjs} +2 -2
  126. package/dist/{get-oQNL6pLY.mjs → get-BZFyqZXa.mjs} +2 -2
  127. package/dist/{get-CVMWhbA82.mjs → get-BfFZCiZR.mjs} +4 -4
  128. package/dist/get-Bq_9VSTa.mjs +28 -0
  129. package/dist/{get-FxCF0rxc.mjs → get-Bt4C-oxh.mjs} +2 -2
  130. package/dist/{get-GuWW4J24.mjs → get-C1rCVUYw.mjs} +3 -3
  131. package/dist/{get-CqlNUyFY.mjs → get-Cc4-e-Q_.mjs} +4 -4
  132. package/dist/{get-CTtzccwr.mjs → get-Cl-O6dFs.mjs} +3 -3
  133. package/dist/{get-Bt_zhviQ.mjs → get-CtDZOoWy.mjs} +5 -5
  134. package/dist/{get-CWyRAHpz.mjs → get-CuSwArMS.mjs} +5 -5
  135. package/dist/{get-CM596pmP.mjs → get-DIfjxTP8.mjs} +2 -2
  136. package/dist/{get-B-WT6ess.mjs → get-DePbMmjc.mjs} +5 -5
  137. package/dist/{get-DTDvlLT3.mjs → get-eZEHipwA.mjs} +2 -2
  138. package/dist/{get-DySyvotk2.mjs → get-jbOgdCQg.mjs} +2 -2
  139. package/dist/{get-run-CFGxSm_S.mjs → get-run-C-CNDbv3.mjs} +2 -2
  140. package/dist/{git-sync-Ch1V1fEK.mjs → git-sync-D1aKczo6.mjs} +15 -8
  141. package/dist/{git-sync-COokpYgc.mjs → git-sync-DP4wQFzm.mjs} +18 -1
  142. package/dist/git-sync-D_T9oNC6.mjs +29 -0
  143. package/dist/{glossary-BSgRQ2HO.mjs → glossary-BVK5DaLV.mjs} +4 -4
  144. package/dist/{graph-Wf4e0XIa.mjs → graph-CqBe2J4N.mjs} +5 -5
  145. package/dist/{has-remote-changes-BsS3XB0P.mjs → has-remote-changes-CDe1teSb.mjs} +3 -3
  146. package/dist/{import-CXd5HdB0.mjs → import-B64gjryF.mjs} +7 -7
  147. package/dist/{is-dirty-TDcfeOde.mjs → is-dirty-DhR3Xqjk.mjs} +1 -1
  148. package/dist/{items-BxvhoxYm.mjs → items-CLl2QgS8.mjs} +5 -5
  149. package/dist/{key-CUPbYxkk.mjs → key-BYEv4Wgq.mjs} +2 -2
  150. package/dist/{library-DzejNMqX.mjs → library-C3eO2J07.mjs} +4 -4
  151. package/dist/{library-BKSFtIV9.mjs → library-DKIqzyUk.mjs} +2 -2
  152. package/dist/{library-DuIrR8LS.mjs → library-wUiD2jbw.mjs} +1 -1
  153. package/dist/{list-DA1Fo6S6.mjs → list-B7Yvz5vA.mjs} +2 -2
  154. package/dist/{list-DlgjWr4r.mjs → list-BIqqh3A-.mjs} +2 -2
  155. package/dist/{list-CRXTfEFk.mjs → list-BiSwl56L.mjs} +2 -2
  156. package/dist/{list-DpK3ioES.mjs → list-BmvitCWZ.mjs} +5 -5
  157. package/dist/{list-D7yH-64Z.mjs → list-C3GBocvB.mjs} +4 -4
  158. package/dist/{list-B8V_OESj.mjs → list-C7TFreS8.mjs} +2 -2
  159. package/dist/{list-6nGX0Rqc.mjs → list-CA939qkn.mjs} +5 -5
  160. package/dist/list-CFaJA317.mjs +48 -0
  161. package/dist/{list-3Dh5yeq-.mjs → list-CdcFNphE.mjs} +2 -2
  162. package/dist/{list-DjlfBd7W.mjs → list-CjpZCiks.mjs} +2 -2
  163. package/dist/{list-B5kRBn7k.mjs → list-Cu6ET_yD.mjs} +4 -4
  164. package/dist/{list-BUjI5G0_.mjs → list-D4HNG282.mjs} +4 -4
  165. package/dist/{list-Ba7u5Ai9.mjs → list-DDPvxfhe.mjs} +5 -5
  166. package/dist/{list-Cr5Hoq-E.mjs → list-DLLzMaS3.mjs} +2 -2
  167. package/dist/{list-D_fsrh8w.mjs → list-DLwby7YA.mjs} +2 -2
  168. package/dist/{list-B3Pngm2j.mjs → list-D_IT8l9B.mjs} +2 -2
  169. package/dist/{list-CCCy6cBI.mjs → list-DpfOh8-5.mjs} +3 -3
  170. package/dist/{list-DsR58aMq.mjs → list-DrIcKxXX.mjs} +3 -3
  171. package/dist/{list-D1Q8H3jn.mjs → list-DyFu5Wx1.mjs} +3 -3
  172. package/dist/{list-Cf6A9Csi.mjs → list-DyQNRVAf.mjs} +2 -2
  173. package/dist/list-YFwmHXGG.mjs +33 -0
  174. package/dist/{list-Do-Xnz0I.mjs → list-eGlqXJno.mjs} +2 -2
  175. package/dist/list-s9_LlXCV.mjs +29 -0
  176. package/dist/{login-CXbCAcuB.mjs → login-Bg7Z3jDy.mjs} +15 -8
  177. package/dist/{logout-B6IGzkpG.mjs → logout-CAmp7DcS.mjs} +2 -2
  178. package/dist/{measure-CbMgNhlG.mjs → measure-C31HLp1C.mjs} +5 -5
  179. package/dist/{moderation-review-BdqEH6N1.mjs → moderation-review-Bf9bPNQI.mjs} +1 -1
  180. package/dist/{parameter-Celg0wZa.mjs → parameter-DvRQMKd2.mjs} +6 -6
  181. package/dist/{parameter-values-IWi_DNhp.mjs → parameter-values-3eHpqznI.mjs} +21 -7
  182. package/dist/{parse-enum-B2rGiC6p.mjs → parse-enum-DAcTzG1q.mjs} +1 -1
  183. package/dist/{parse-id-Cv5eM7sg.mjs → parse-id-5BZGQ9Vd.mjs} +1 -1
  184. package/dist/{parse-ref-DW7ik6ny.mjs → parse-ref-ByXc-pls.mjs} +1 -1
  185. package/dist/{parse-text-CUCSWOeR.mjs → parse-text-FgX60vIg.mjs} +1 -1
  186. package/dist/{path-C9r9urRK.mjs → path-XwdHlC23.mjs} +3 -3
  187. package/dist/{poll-CX3jPtXb.mjs → poll-CgtcJopL.mjs} +2 -2
  188. package/dist/{preflight-CiTgqNUy.mjs → preflight-ChTKhB8Y.mjs} +2 -2
  189. package/dist/{process-DImdroix.mjs → process-aqXm5QgC.mjs} +1 -1
  190. package/dist/{publish-xH1n74gd.mjs → publish-C2-pK0cf.mjs} +4 -4
  191. package/dist/{pulse-Dz0ocv0l.mjs → pulse-CC81N2_0.mjs} +1 -1
  192. package/dist/{pulse-CFj1WfIC.mjs → pulse-JPrq6NFP.mjs} +1 -1
  193. package/dist/{query-CN3BW5WB.mjs → query-DkaUzmMa.mjs} +12 -12
  194. package/dist/{query-BOCw0FBK.mjs → query-pmw23KkL.mjs} +17 -7
  195. package/dist/{remapping-Dggq2Fv0.mjs → remapping-C3htTzJn.mjs} +4 -4
  196. package/dist/{remove-collection-cxSSFxza.mjs → remove-collection-p_t9rUUX.mjs} +4 -4
  197. package/dist/{render-Cb8Hct67.mjs → render-C50k8-jc.mjs} +2 -2
  198. package/dist/{replace-wVi_XDut.mjs → replace-BQBuFJ1B.mjs} +3 -3
  199. package/dist/{requirement-check-BE3PuGsC.mjs → requirement-check-CpiVuL0H.mjs} +1 -1
  200. package/dist/{rescan-values-DAp_avxY.mjs → rescan-values-Ctq8wpkI.mjs} +4 -4
  201. package/dist/{rescan-values-C7b1Ghy-.mjs → rescan-values-DOqXJ3qH.mjs} +4 -4
  202. package/dist/{run-CUGs7mok.mjs → run-2xgPRuKR.mjs} +4 -4
  203. package/dist/{run-DywhwjNG.mjs → run-CtMbObQI.mjs} +4 -4
  204. package/dist/{run-CE6ei7s7.mjs → run-Dn3e8G4x.mjs} +2 -2
  205. package/dist/{runs--14jim_0.mjs → runs-CgNoQW6M.mjs} +3 -3
  206. package/dist/{runtime-Ckns6TKK.mjs → runtime-Y4VFWmmr.mjs} +63 -80
  207. package/dist/scaffold-BuL0_ptz.mjs +50 -0
  208. package/dist/{schema-tables-CeW0kpA5.mjs → schema-tables-BdXuo_lG.mjs} +5 -5
  209. package/dist/{schemas-CHMD0HrY.mjs → schemas-Dap3KFwY.mjs} +3 -3
  210. package/dist/{search-CXRavT7G.mjs → search-1et9tv_s.mjs} +21 -4
  211. package/dist/{search-LmBQu1Jg.mjs → search-DUmFK5Sy.mjs} +5 -5
  212. package/dist/{search-DyC54bGf.mjs → search-Dxcejw_v.mjs} +20 -5
  213. package/dist/{segment-DeT_Yic6.mjs → segment-CebcXn2E.mjs} +5 -5
  214. package/dist/{send-BWSJMrDL.mjs → send-DYdwcPTb.mjs} +2 -2
  215. package/dist/{set-active-C5cLG4_O.mjs → set-active-CVI_DDQi.mjs} +2 -2
  216. package/dist/set-bundle-DX5HqDji.mjs +40 -0
  217. package/dist/set-data-actions-DAI1XCQ2.mjs +46 -0
  218. package/dist/set-enabled-0QI-CHAT.mjs +41 -0
  219. package/dist/{set-sensitivity-BMLKazua.mjs → set-sensitivity-DqGkiLSr.mjs} +5 -5
  220. package/dist/{set-r2xiXrT_.mjs → set-xs8Vyvy2.mjs} +3 -3
  221. package/dist/{setting-CDRusiqP.mjs → setting-Bmry-y_l.mjs} +3 -3
  222. package/dist/{setup-BZaJVww3.mjs → setup-UM8N9Vh3.mjs} +2 -2
  223. package/dist/{signal-4tpCIkqR.mjs → signal-D8MH3LMN.mjs} +1 -1
  224. package/dist/{skills-9ihLaSmM.mjs → skills-BiSfuDqA.mjs} +3 -3
  225. package/dist/{skills-y2iVfW9k.mjs → skills-CcLTm3_2.mjs} +2 -2
  226. package/dist/slug-qeARO25o.mjs +15 -0
  227. package/dist/{snippet-Ce0o33Rj.mjs → snippet-DKARah-L.mjs} +5 -5
  228. package/dist/{stash-Dj-mnIa4.mjs → stash-e5cSvnj3.mjs} +6 -6
  229. package/dist/{status-BtWz7Pzn.mjs → status-BHiO3YBe.mjs} +36 -15
  230. package/dist/{status-B2Xj_q8f.mjs → status-CH7BAWGe.mjs} +2 -2
  231. package/dist/{subscription-Dh--agqE.mjs → subscription-DWleULhN.mjs} +5 -5
  232. package/dist/{subscriptions-CJ8Jdp9A.mjs → subscriptions-DcCOA2p1.mjs} +4 -4
  233. package/dist/{summary-ccbkNDbC.mjs → summary-CipFA6M6.mjs} +4 -4
  234. package/dist/{sync-schema-CewUOkmm.mjs → sync-schema-C45WO4db.mjs} +5 -5
  235. package/dist/{sync-schema-HwQectZd.mjs → sync-schema-D7p-P8F6.mjs} +4 -4
  236. package/dist/{sync-task-DEzhiaU9.mjs → sync-task-DNKG9Bk4.mjs} +2 -2
  237. package/dist/{table-CFZU-BRg.mjs → table-BDsqRU7a.mjs} +2 -2
  238. package/dist/table-BPYHnzyV.mjs +26 -0
  239. package/dist/{table-zAdW5_3H.mjs → table-CF7zW9cI.mjs} +33 -20
  240. package/dist/{table-selector-flags-p4jun7-v.mjs → table-selector-flags-CHfrVpYQ.mjs} +3 -3
  241. package/dist/{timeline-DLaBypse.mjs → timeline-C2m_QHxn.mjs} +7 -7
  242. package/dist/{timeline-event-xAAR6b-v.mjs → timeline-event-BF1dqSnD.mjs} +5 -5
  243. package/dist/transform-N_elgRuh.mjs +28 -0
  244. package/dist/transform-job-CTV6KRP2.mjs +22 -0
  245. package/dist/{transform-tag-BXusFzMX.mjs → transform-tag-BYoguZfW.mjs} +4 -4
  246. package/dist/{transform-test-UsH1udc4.mjs → transform-test-jaBpHOM5.mjs} +6 -6
  247. package/dist/{transforms-CqV01bMM.mjs → transforms-C6MFnT4C.mjs} +3 -3
  248. package/dist/{transport-0qFZhEuP.mjs → transport-k_fabWdF.mjs} +4 -4
  249. package/dist/{tree-Td6rgyOa.mjs → tree-C4Igf6xs.mjs} +3 -3
  250. package/dist/typed-schema-Bo0Q6C0S.mjs +45 -0
  251. package/dist/{unpublish-D4XTZsFW.mjs → unpublish-EStytsEm.mjs} +2 -2
  252. package/dist/{unreferenced-cR-l4zXN.mjs → unreferenced-DtUuyBrr.mjs} +5 -5
  253. package/dist/{update-C8xdeYI2.mjs → update-B0Na11v-.mjs} +5 -5
  254. package/dist/{update-C7Wmom6x.mjs → update-B1UXRPN-.mjs} +7 -7
  255. package/dist/{update-dQeji6RA.mjs → update-BOg1jZ_s.mjs} +5 -5
  256. package/dist/{update-CpwWURTp.mjs → update-BXLY92om.mjs} +4 -4
  257. package/dist/{update-DrVc25R8.mjs → update-Bba_zPSE.mjs} +4 -4
  258. package/dist/{update-C4iu-vQm.mjs → update-BogvN2Mb.mjs} +3 -3
  259. package/dist/{update-nGURR-y6.mjs → update-CCLpNTPa.mjs} +3 -3
  260. package/dist/{update-CHB4kvz-.mjs → update-CciLWH_s.mjs} +7 -8
  261. package/dist/{update-BqkqMOVN.mjs → update-DAG8m5f4.mjs} +5 -5
  262. package/dist/{update-Dk0E66Va.mjs → update-DECiEVlk.mjs} +7 -7
  263. package/dist/update-DIBaY-fy.mjs +37 -0
  264. package/dist/{update-C7dZLbsf.mjs → update-DT2ViMFr.mjs} +3 -3
  265. package/dist/{update-CND9At61.mjs → update-DT8U29Kk.mjs} +3 -3
  266. package/dist/{update-Js0IiqCq.mjs → update-DhgfReDD.mjs} +5 -5
  267. package/dist/{update-DFK2iUSP.mjs → update-DkvIK-eL.mjs} +3 -3
  268. package/dist/{update-DZHgr6Gu.mjs → update-FfeHReec.mjs} +4 -4
  269. package/dist/{update-BJL5975i.mjs → update-HbggUPuy.mjs} +3 -3
  270. package/dist/{update-D-cTgmb0.mjs → update-VGgvQu7W.mjs} +3 -3
  271. package/dist/{update-dashcard-BmkfJ7t9.mjs → update-dashcard-m-hkIGUu.mjs} +6 -6
  272. package/dist/{update-DROjGe3Q.mjs → update-pk0b6vXU.mjs} +3 -3
  273. package/dist/{update-DqCZsbLh.mjs → update-z8ZGCg1r.mjs} +3 -3
  274. package/dist/{upgrade-B6V_1cUh.mjs → upgrade-iETJ8fH2.mjs} +4 -4
  275. package/dist/{upload-B6zBzMPW.mjs → upload-BF5pdKRN.mjs} +3 -3
  276. package/dist/{upload-CfYmBv51.mjs → upload-CoK5LnyA.mjs} +2 -2
  277. package/dist/{upload-Dvjfz16M.mjs → upload-CqSGEZQW.mjs} +3 -3
  278. package/dist/{uuid-B8ynbkqG.mjs → uuid-8Ha-8bDX.mjs} +2 -2
  279. package/dist/{validate-C7DGkwb-.mjs → validate-BQ7vI8_x.mjs} +1 -1
  280. package/dist/{validate-query-CYUvRvVM.mjs → validate-query-YtH3d5BP.mjs} +2 -2
  281. package/dist/{values-36bzf9cK.mjs → values-BsgA7-6h.mjs} +4 -4
  282. package/dist/{verify-C4Tml4fD.mjs → verify-CzBZbP4W.mjs} +4 -4
  283. package/dist/{verify-BdW-GExk.mjs → verify-cjUPMF_B.mjs} +4 -4
  284. package/dist/{verify-Cs9e28YA.mjs → verify-crIrbGZV.mjs} +3 -3
  285. package/dist/{verify-flags-CMpRkMPa.mjs → verify-flags-DEVMB9w0.mjs} +1 -1
  286. package/dist/{wait-flags-DjyK03cm.mjs → wait-flags-BnZ-dfE2.mjs} +2 -2
  287. package/dist/{wait-BV6JOdgi.mjs → wait-mFUfpSaj.mjs} +5 -5
  288. package/package.json +2 -2
  289. package/skill-data/core/SKILL.md +1 -1
  290. package/skill-data/data-action/SKILL.md +18 -7
  291. package/skill-data/data-app/SKILL.md +138 -0
  292. package/skill-data/data-app/template/.env.local.example +2 -0
  293. package/skill-data/data-app/template/LICENSE +21 -0
  294. package/skill-data/data-app/template/README.md +29 -0
  295. package/skill-data/data-app/template/gitignore +5 -0
  296. package/skill-data/data-app/template/package.json +25 -0
  297. package/skill-data/data-app/template/src/App.tsx +9 -0
  298. package/skill-data/data-app/template/src/index.tsx +14 -0
  299. package/skill-data/data-app/template/src/theme.ts +25 -0
  300. package/skill-data/data-app/template/tsconfig.json +25 -0
  301. package/skill-data/data-app/template/vite.config.ts +3 -0
  302. package/skill-data/data-app-actions/SKILL.md +96 -0
  303. package/skill-data/data-app-data/SKILL.md +158 -0
  304. package/skill-data/data-app-filters/SKILL.md +87 -0
  305. package/skill-data/data-app-ui/SKILL.md +120 -0
  306. package/skill-data/git-sync/SKILL.md +3 -3
  307. package/skill-data/transform/SKILL.md +1 -1
  308. package/dist/db-m5bQcXdn.mjs +0 -24
  309. package/dist/delete-runtime-CkNvZfFA.mjs +0 -55
  310. package/dist/embedding-i-KqpefC.mjs +0 -9
  311. package/dist/git-sync-BwkWeJAz.mjs +0 -29
  312. package/dist/input-AXP2LCOV.mjs +0 -61
  313. package/dist/list-CUj04tg3.mjs +0 -38
  314. package/dist/table-P9ovwcaB.mjs +0 -26
  315. package/dist/transform-10YE8j5K.mjs +0 -28
  316. package/dist/transform-job-D97AutnF.mjs +0 -22
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: data-action
3
- description: Author and run Metabase data actions with the `mb` CLI — saved, parameterized native SQL writes (INSERT, UPDATE, DELETE) filed in a collection and run with values. Covers enabling them on a database, the body, mapping template tags to parameters, running, and the lifecycle. Triggers — "add a data action", "let users update a row", "a button that inserts a record", "run a write query", "a form that saves to the database", "delete rows from Metabase".
3
+ description: Author and run Metabase data actions with the `mb` CLI — saved, parameterized native SQL writes (INSERT, UPDATE, DELETE) filed in a collection and run with values. Covers enabling them on a database, the collection they go in, the body, mapping template tags to parameters, running, and the lifecycle. Triggers — "add a data action", "let users update a row", "a button that inserts a record", "run a write query", "a form that saves to the database", "delete rows from Metabase". Inside a data app, start with `data-app-actions`.
4
4
  allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
5
  requires: [dataActionsWithoutModel]
6
6
  ---
@@ -13,17 +13,27 @@ Flag conventions and `./.scratch` are in `core`; the native query and its templa
13
13
 
14
14
  ## Check the database first
15
15
 
16
- Data actions are off on every database until an admin turns on **Model actions** for it (Admin → Databases → the database). `mb` cannot change that setting.
16
+ Data actions are off on every database until an admin turns on **Data actions** for it ("Allow data actions that use this database to be run", Admin → Databases → the database). That toggle is the database setting `database-enable-actions`.
17
17
 
18
18
  ```bash
19
19
  mb db get <id> --full --json
20
20
  ```
21
21
 
22
22
  - `features` must contain `"actions"` — otherwise the driver cannot run writes; pick another database.
23
- - `settings["database-enable-actions"]` must be `true`. If it is not, ask the user to have an admin enable it. Create and execute fail with `Actions are not enabled.` until then.
23
+ - `settings["database-enable-actions"]` must be `true`. Create and execute fail with `Actions are not enabled.` until then. An admin profile turns it on with `mb db set-data-actions <id> true`; anyone else asks an admin to. Turning it on lets anyone with access to the database's actions write to it, so confirm with the user first.
24
+
25
+ ## Pick the collection
26
+
27
+ A data action goes in a data actions collection, a data app collection, or the data actions root (omit `collection_id`). A regular collection is refused with `An action without a model can only go in a data actions or data app collection.` Make one with:
28
+
29
+ ```bash
30
+ mb collection create --namespace data-actions --body '{"name":"Order actions"}' --json
31
+ ```
24
32
 
25
33
  ## The body
26
34
 
35
+ Mint one template-tag `id` per tag with `mb uuid --count <n> --format text`.
36
+
27
37
  ```json
28
38
  {
29
39
  "name": "Set order note",
@@ -39,14 +49,14 @@ mb db get <id> --full --json
39
49
  "native": "UPDATE orders SET note = {{note}} WHERE id = {{order_id}}",
40
50
  "template-tags": {
41
51
  "order_id": {
42
- "id": "order_id",
52
+ "id": "6f1c9a4e-2b7d-4e0a-9c3f-1d2e3f4a5b6c",
43
53
  "name": "order_id",
44
54
  "display-name": "Order ID",
45
55
  "type": "number",
46
56
  "required": true
47
57
  },
48
58
  "note": {
49
- "id": "note",
59
+ "id": "0b8d7c6e-5f4a-4b3c-8d2e-1f0a9b8c7d6e",
50
60
  "name": "note",
51
61
  "display-name": "Note",
52
62
  "type": "text",
@@ -78,7 +88,8 @@ mb db get <id> --full --json
78
88
  ```
79
89
 
80
90
  - `type` is always `"query"`. Never set `model_id` or `type: "implicit"`; `mb data-action create` refuses both.
81
- - `database_id` and `dataset_query.database` are the same id (`mb db list`). Omit `collection_id` for the root collection (`mb collection list`).
91
+ - `database_id` and `dataset_query.database` are the same id (`mb db list`). `collection_id` is the data actions collection (here `12`); omit it for the data actions root.
92
+ - A template tag's `id` is a UUID, unique among the tags: the representation schema requires one.
82
93
  - One statement, no `;`. `create` and `update` validate `dataset_query` as `native-sql` does.
83
94
 
84
95
  ## Parameters: one per template tag
@@ -92,7 +103,7 @@ Each `{{name}}` needs a `template-tags` entry and a `parameters` entry, all usin
92
103
  | `date` | `date/single` |
93
104
  | `boolean` | `boolean/=` |
94
105
 
95
- - Parameter `id` and `slug` are the tag name; `target` is `["variable", ["template-tag", "<name>"]]`.
106
+ - Parameter `id` and `slug` are the tag name (not the tag's UUID `id`); `target` is `["variable", ["template-tag", "<name>"]]`.
96
107
  - Use raw variables only. A field filter (`type: "dimension"`), snippet or card reference does not work in a write — write the comparison yourself (`WHERE id = {{order_id}}`).
97
108
  - Set `required: true` on every input the statement cannot run without (`WHERE` keys, `NOT NULL` columns).
98
109
  - Wrap an optional input in `[[ … ]]` with `required: false`; the clause drops out when no value is given. This makes one action do partial updates: `UPDATE orders SET updated_at = now() [[, note = {{note}}]] [[, status = {{status}}]] WHERE id = {{order_id}}`.
@@ -0,0 +1,138 @@
1
+ ---
2
+ name: data-app
3
+ description: Create, preview, publish and manage a Metabase data app — a React app Metabase serves at /apps/<slug> — create it, scaffold its project, run the dev preview and read its diagnostics feed, build and publish the bundle, turn it on or off, move it to another instance, delete it. Triggers — "build a data app", "make an internal tool in Metabase", "scaffold a data app", "publish my data app", "update the app", "the app is blank". Start here; the UI is in `data-app-ui`, questions and charts in `data-app-data`, filter controls in `data-app-filters`, writes in `data-app-actions`.
4
+ allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
+ requires: [dataApps]
6
+ ---
7
+
8
+ # Data apps
9
+
10
+ A **data app** is a React app built into one JavaScript bundle, which Metabase runs in a sandbox at `/apps/<slug>`. Each app has its own collection — **the app's collection** — and the questions and actions in it are everything the app can run. Flag conventions are in `core`.
11
+
12
+ The work, in order:
13
+
14
+ 1. Create the app on the instance.
15
+ 2. Scaffold the project and install the SDK.
16
+ 3. Give it data: questions over the Library's published tables and metrics in the app's collection, then `src/metabase.ts` (`data-app-data`); writes are `data-app-actions`.
17
+ 4. Start the dev preview (_Dev preview_), then write the UI under `src/` (`data-app-ui`; filter controls in `data-app-filters`).
18
+ 5. Build and publish (_Build and publish_).
19
+
20
+ For every later change: regenerate `src/metabase.ts` if the app's collection changed, then build and set the bundle. Metabase receives only the built bundle; the source stays in the project directory, under git if the user keeps one.
21
+
22
+ ## Before you start
23
+
24
+ - Use an **admin** profile — only admins create apps and write the app's collection. `mb auth status --json | jq .user.isAdmin` prints `true` for one; otherwise ask the user for an admin profile (`mb auth list`).
25
+ - Run `mb data-app list`. A failure means the instance has no data apps: stop and tell the user.
26
+ - Settle the **slug**, the `/apps/<slug>` URL: lowercase letters, digits and single dashes (`sales-overview`), at most 100 characters. If the app's purpose is unclear, ask "what's this app for?" and propose one.
27
+
28
+ ## Create the app
29
+
30
+ ```bash
31
+ mb data-app create --body '{"name":"sales-overview","display_name":"Sales overview"}' --json
32
+ ```
33
+
34
+ `name` is the slug; `display_name` and `description` are optional. The app starts disabled, with an empty bundle. The answer's `resource_collection_id` is the id of the app's collection — note it. A `409` means the slug is taken: `mb data-app list` shows that app; reuse it or pick another slug.
35
+
36
+ ## Scaffold and install
37
+
38
+ ```bash
39
+ mb data-app scaffold sales-overview && cd sales-overview
40
+ ```
41
+
42
+ `scaffold [dir]` takes a **directory**, not the slug: it copies the Vite + React + TypeScript template into a new or empty directory (the current one when omitted) and needs no server. Then install the SDK, then the rest:
43
+
44
+ ```bash
45
+ npm install @metabase/embedding-sdk-react@<major>-beta # <major>: 66 for a version tag v1.66.x (`mb auth status --json | jq -r .version.tag`)
46
+ npm install && npm run typecheck && npm run build
47
+ ```
48
+
49
+ Skip the SDK line when `package.json` already points it at a local build (`file:` or `link:`), and never install `latest`. A tag without a version number, such as `vLOCAL_DEV`, is a development build: ask the user which SDK build to install. The starter renders "Hello, data app".
50
+
51
+ The template is the bundle contract. Don't edit `package.json` by hand, and never rewrite `vite.config.ts`, `tsconfig.json` or `src/index.tsx`: `vite.config.ts` stays `export default dataAppConfig()` (its only option is `port`), and `src/index.tsx` default-exports the `DataAppFactory` — change it only to add a `providerProps` key. Metabase and the dev preview each wrap the app in a `<MetabaseProvider>`, so the app never renders one.
52
+
53
+ **An existing project.** Before changing an app you didn't scaffold in this session, check both: `vite.config.ts` is `export default dataAppConfig()` from `@metabase/embedding-sdk-react/data-app-dev/config`, with no local `config/` directory; and `src/index.tsx` default-exports a `DataAppFactory` that takes no arguments and returns `{ component, providerProps? }`. If either fails, stop: tell the user the project differs from the template, and ask whether to scaffold a fresh project and port the code over, or go on at their own risk.
54
+
55
+ ## Dev preview
56
+
57
+ `npm run dev` serves the app at `http://localhost:5174` — or the next free port, in Vite's `Local:` line — through the same sandbox Metabase uses. An edit under `src/` rebuilds the bundle and remounts the app, resetting component state. The preview reads `DATA_APP_MB_URL` and an admin `DATA_APP_MB_API_KEY` from `.env.local` beside `package.json`. Write a new key straight into that file, never into the chat or the terminal:
58
+
59
+ ```bash
60
+ ( umask 077
61
+ URL=$(mb auth status --json | jq -r .url)
62
+ KEY=$(mb api-key create --body '{"name":"data-app <slug> dev","group_id":2}' --json | jq -r .unmasked_key)
63
+ [ -n "$KEY" ] && [ "$KEY" != null ] && printf 'DATA_APP_MB_URL=%s\nDATA_APP_MB_API_KEY=%s\n' "$URL" "$KEY" > .env.local && echo written )
64
+ ```
65
+
66
+ Group `2` is Administrators. Never print `.env.local`. Delete the key at handoff (`mb api-key list`, then `mb api-key delete <id> --yes`); the next session writes a new one. A CORS error means the instance doesn't allow the preview's origin: ask the user to add `http://localhost:5174` under Admin → Embedding → Embedded analytics SDK → CORS.
67
+
68
+ ### The diagnostics feed
69
+
70
+ Sandbox blocks, failed queries and uncaught errors never reach the terminal. With a preview tab open, read them from the feed:
71
+
72
+ ```bash
73
+ curl -s "http://localhost:5174/__data-app/diagnostics?startEventId=0"
74
+ ```
75
+
76
+ ```jsonc
77
+ {
78
+ "entries": [
79
+ {
80
+ "eventId": 31,
81
+ "kind": "blocked-network",
82
+ "alert": true,
83
+ "summary": "Blocked fetch to api.example.com (not in allowed_hosts)",
84
+ "detail": null,
85
+ "hint": "…",
86
+ "buildId": 7,
87
+ },
88
+ ],
89
+ "clients": 1, // open preview tabs; 0 means nothing ran
90
+ "buildId": 7, // the bundle running now
91
+ "staleEntries": 164, // withheld: reported by a build already replaced
92
+ "nextEventId": 32, // pass back as ?startEventId=
93
+ }
94
+ ```
95
+
96
+ - `clients: 0` means no tab is open, so empty `entries` prove nothing.
97
+ - Before an edit, note `nextEventId`; after it, read again with that value as `startEventId`.
98
+ - The feed answers for the running bundle: entries from replaced builds are counted in `staleEntries`, and anything still broken reports again under the new `buildId` (`?includeStale=true` shows the withheld ones). A failed build doesn't advance `buildId` and doesn't reach the feed — read the `npm run dev` terminal.
99
+ - Quote `summary` as it is when you report it, and follow `hint` when there is one — except that you never add the Metabase URL to `allowed_hosts`. The feed keeps the last 200 entries; `curl -X DELETE …/__data-app/diagnostics` clears it.
100
+
101
+ | `kind` | Fix |
102
+ | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
103
+ | `blocked-network`, `csp-violation` | An external API: `data-app-ui`, _External APIs_. A `script-src` or `style-src` violation: bundle the asset instead. |
104
+ | `blocked-api` | Blocked in Metabase too: use the replacement in `data-app-ui`. |
105
+ | `sdk-call` with `alert: true` | A Metabase request failed; `summary` names it. |
106
+ | `error` | A bug; `detail` has the stack. |
107
+
108
+ ## Build and publish
109
+
110
+ ```bash
111
+ npm run typecheck && npm run build
112
+ mb data-app set-bundle sales-overview
113
+ mb data-app set-enabled sales-overview true # the first time
114
+ ```
115
+
116
+ `set-bundle` uploads `dist/index.js` (`--bundle` for another path) and replaces the app's bundle, live at once. A new app is disabled until `set-enabled` turns it on. Give the user `<metabase-url>/apps/<slug>`.
117
+
118
+ Admins open every app, enabled or not. Anyone else needs the app enabled (otherwise "not found") and one of their groups assigned to it (otherwise "You don't have access"), which only the user can do (Admin → Settings → Data apps → the app → Groups). A group reaches the app's collection and nothing more, so a viewer also needs data access to the tables its questions read.
119
+
120
+ ## Pitfalls
121
+
122
+ | Symptom | Fix |
123
+ | ------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
124
+ | `set-bundle`: bundle not found | Run `npm run build` in the project directory first. |
125
+ | Blank app, `Bundle did not assign a function to __dataAppFactory__` | `src/index.tsx` must `export default` the factory and nothing else; otherwise the diagnostics feed has the real error. |
126
+ | "Failed to fetch the user, the session might be invalid." | A bad key in `.env.local`, or CORS (_Dev preview_). |
127
+ | A bundle of several MB | `vite.config.ts` no longer uses `dataAppConfig()`, or the SDK isn't the `<major>-beta` tag. |
128
+ | "Invalid hook call" | A second React got bundled: nothing may add another `react` or `react-dom`. |
129
+ | Drill-through popups don't open | The app renders its own `<MetabaseProvider>`: remove it. |
130
+ | A rebuilt or reinstalled SDK still behaves like the old one | Vite caches it: stop `npm run dev`, delete `node_modules/.vite`, start again. |
131
+ | A viewer's query or action fails with 403 | It reads something outside the app's collection, or the viewer lacks data access to its tables. |
132
+
133
+ ## Change, move, delete
134
+
135
+ - **Turn off:** `mb data-app set-enabled <slug> false`. **Rename:** `mb data-app update <slug> --body '{"display_name":"…"}'` (also `description`, `allowed_hosts`).
136
+ - **Outdated:** an app Metabase lists as _Outdated_ targets an older data-app contract: it won't open for anyone, and only admins see it listed, until it's migrated. Tell the user; don't change its code ad hoc.
137
+ - **Move to another instance:** the app, its collection and what the collection holds are git-synced content. `mb git-sync export` (`git-sync`) writes `data_apps/<slug>/` with the bundle, and the collection under `collections/data_apps/`; importing the repository on the other instance recreates them with the same entity IDs, so the same `src/metabase.ts` and bundle work there. On a read-only instance the app's collection can't be edited: change it where it was built and export again.
138
+ - **Delete:** confirm with the user, then `mb data-app delete <slug> --yes` — it removes the app, its bundle, its collection and the questions and actions in it. The project directory stays.
@@ -0,0 +1,2 @@
1
+ DATA_APP_MB_URL=http://localhost:3000
2
+ DATA_APP_MB_API_KEY=mb_replace_me
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Metabase
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,29 @@
1
+ # Data app
2
+
3
+ A Metabase data app: a single-bundle React app, built with the Embedding SDK,
4
+ that Metabase serves at `/apps/<slug>`. Build and change it with a coding agent
5
+ and the `mb` data-app skills.
6
+
7
+ ## Install
8
+
9
+ Install the SDK tag matching the Metabase instance first, then the rest.
10
+ `<major>` is 66 for a version tag v1.66.x (`mb auth status --json | jq -r .version.tag`);
11
+ `package.json` asks for any version, which would install `latest`.
12
+
13
+ ```bash
14
+ npm install @metabase/embedding-sdk-react@<major>-beta
15
+ npm install
16
+ ```
17
+
18
+ ## Commands
19
+
20
+ ```bash
21
+ npm run dev # preview at http://localhost:5174, in the sandbox Metabase runs apps in
22
+ npm run typecheck # type-checks src/ and vite.config.ts
23
+ npm run build # builds dist/index.js
24
+ mb data-app typed-schema <slug> --out src/metabase.ts # the app's queries and actions
25
+ mb data-app set-bundle <slug> # makes dist/index.js the app's bundle
26
+ ```
27
+
28
+ `npm run dev` reads `DATA_APP_MB_URL` and `DATA_APP_MB_API_KEY` from
29
+ `.env.local`; `.env.local.example` lists them.
@@ -0,0 +1,5 @@
1
+ node_modules
2
+ dist
3
+ .env.local
4
+ .vite
5
+ .idea
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "data-app-template",
3
+ "version": "0.1.0",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "typecheck": "tsc --noEmit"
10
+ },
11
+ "dependencies": {
12
+ "@metabase/embedding-sdk-react": "*",
13
+ "react": "^18.3.1",
14
+ "react-dom": "^18.3.1"
15
+ },
16
+ "devDependencies": {
17
+ "@types/react": "^18.3.12",
18
+ "@types/react-dom": "^18.3.1",
19
+ "@vitejs/plugin-react": "^6.0.2",
20
+ "typescript": "^6.0.3",
21
+ "vite": "^8.0.16",
22
+ "vite-plugin-css-injected-by-js": "^3.5.2",
23
+ "vite-plugin-svgr": "^5.2.0"
24
+ }
25
+ }
@@ -0,0 +1,9 @@
1
+ export default function App() {
2
+ return (
3
+ <div style={{ minHeight: "100vh", boxSizing: "border-box", padding: 24 }}>
4
+ <h1 style={{ margin: 0 }}>Hello, data app</h1>
5
+
6
+ <p style={{ color: "#555" }}>Edit src/App.tsx to begin.</p>
7
+ </div>
8
+ );
9
+ }
@@ -0,0 +1,14 @@
1
+ import type { DataAppFactory } from "@metabase/embedding-sdk-react/data-app";
2
+
3
+ import App from "./App";
4
+ import { sdkTheme } from "./theme";
5
+
6
+ // The data app's entry point. Return the root component plus any `providerProps`
7
+ // the host should apply to `MetabaseProvider` (e.g. `theme`,
8
+ // `allowedCustomVisualizations`).
9
+ const factory: DataAppFactory = () => ({
10
+ component: App,
11
+ providerProps: { theme: sdkTheme },
12
+ });
13
+
14
+ export default factory;
@@ -0,0 +1,25 @@
1
+ import type { MetabaseTheme } from "@metabase/embedding-sdk-react";
2
+
3
+ export const sdkTheme: MetabaseTheme = {
4
+ colors: {
5
+ brand: "#4D96FF",
6
+ "brand-hover": "#EAF4FF",
7
+ positive: "#4D96FF",
8
+ charts: [
9
+ "#4D96FF",
10
+ "#E8743B",
11
+ "#2BA672",
12
+ "#9461D9",
13
+ "#E0475B",
14
+ "#1C9FB8",
15
+ "#C99A1E",
16
+ "#5468D4",
17
+ ],
18
+ background: "white",
19
+ "background-secondary": "white",
20
+ "text-primary": "#1f2937",
21
+ "text-secondary": "#4b5563",
22
+ "text-tertiary": "#6b7280",
23
+ },
24
+ fontFamily: "system-ui, -apple-system, Segoe UI, sans-serif",
25
+ };
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "jsx": "react-jsx",
8
+ "esModuleInterop": true,
9
+ "resolveJsonModule": true,
10
+ "isolatedModules": true,
11
+ "skipLibCheck": true,
12
+ "noEmit": true,
13
+ "strict": true,
14
+ "allowJs": false,
15
+ "checkJs": false,
16
+ "noImplicitAny": true,
17
+ "strictNullChecks": true,
18
+ "forceConsistentCasingInFileNames": true,
19
+ "noUnusedLocals": false,
20
+ "noUnusedParameters": false,
21
+ "noFallthroughCasesInSwitch": true,
22
+ "types": ["vite/client"]
23
+ },
24
+ "include": ["src", "vite.config.ts"]
25
+ }
@@ -0,0 +1,3 @@
1
+ import { dataAppConfig } from "@metabase/embedding-sdk-react/data-app-dev/config";
2
+
3
+ export default dataAppConfig();
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: data-app-actions
3
+ description: Make a Metabase data app write data — an action in the app's collection, its typed definition in `src/metabase.ts`, and the `useAction` hook from `@metabase/embedding-sdk-react/data-app` behind a form or a button, with inputs typed from each parameter, the server's error shown as it comes, and every affected query refreshed. Triggers — "a form that saves a row", "a button that updates a record", "delete an entry from the app", "submit doesn't refresh the list", "the action fails in the app". Creating the action itself is `data-action`; reads are `data-app-data`.
4
+ allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
5
+ requires: [dataApps]
6
+ ---
7
+
8
+ # Writes in a data app
9
+
10
+ An **action** is a saved, parameterized SQL write — `INSERT`, `UPDATE` or `DELETE`. A data app runs only the actions in **the app's collection** (`data-app`, _Create the app_).
11
+
12
+ 1. Draft the action as `data-action` describes — the database must allow actions — with `collection_id` the app's collection. Show the user its SQL and parameters, and create it once they agree.
13
+ 2. Regenerate `src/metabase.ts` (`data-app-data`).
14
+ 3. Pass `actions.<name>` from it to `useAction`.
15
+
16
+ Each action there lists its parameters: the parameter slug (the key `execute` takes), `displayName` (a label, never a key), `jsType` (`string`, `number`, `Date`, `boolean` or `unknown`) and `required`. Never fake a call to an action `src/metabase.ts` doesn't list.
17
+
18
+ ## The hook
19
+
20
+ ```tsx
21
+ import { useAction } from "@metabase/embedding-sdk-react/data-app";
22
+ import { actions } from "../metabase";
23
+
24
+ const { execute, isExecuting, result, error, reset } = useAction(actions.setOrderNote);
25
+ ```
26
+
27
+ - **Import it from `/data-app`.** The main `@metabase/embedding-sdk-react` entry exports the general SDK `useAction`, which takes raw ids and isn't typed from the definition. Write no generics: the definition types `execute`'s keys and values.
28
+ - `execute(params)` resolves to the response body; on failure it both throws and sets `error`. It resolves to `null` without sending anything while the SDK is still starting, so guard a call that can happen at mount. It never runs on its own and has no `enabled`: return early in the handler to skip it.
29
+ - `isExecuting` is true until it settles: disable the trigger and show progress, so a double click can't send twice.
30
+ - `result` is the last response, `null` before the first call; `result?.["rows-affected"]` is a quick confirmation. `reset()` clears `result` and `error`, for example when the user dismisses a message.
31
+
32
+ ## A form
33
+
34
+ ```tsx
35
+ export function NoteForm({ orderId, onSaved }: { orderId: number; onSaved: () => Promise<void> }) {
36
+ const { execute, isExecuting, error } = useAction(actions.setOrderNote);
37
+ const [note, setNote] = useState("");
38
+ const [isValid, setIsValid] = useState(false);
39
+
40
+ async function onSubmit(event: FormEvent<HTMLFormElement>) {
41
+ event.preventDefault();
42
+ try {
43
+ await execute({ order_id: orderId, note }); // keys are parameter slugs
44
+ await onSaved(); // the parent refetches what the write changed
45
+ setNote("");
46
+ } catch {
47
+ // shown from `error`
48
+ }
49
+ }
50
+
51
+ return (
52
+ <form onSubmit={onSubmit} onChange={(event) => setIsValid(event.currentTarget.checkValidity())}>
53
+ <input type="text" required value={note} onChange={(event) => setNote(event.target.value)} />
54
+ <button type="submit" disabled={isExecuting || !isValid}>
55
+ {isExecuting ? "Saving…" : "Save"}
56
+ </button>
57
+ {error ? (
58
+ <pre style={{ whiteSpace: "pre-wrap", margin: 0 }}>
59
+ {error.data.message ?? "Action failed."}
60
+ </pre>
61
+ ) : null}
62
+ </form>
63
+ );
64
+ }
65
+ ```
66
+
67
+ **Inputs.** Pick each input's type from `jsType`, never from the parameter slug — one called `email` with `jsType: "string"` is still `type="text"`.
68
+
69
+ | `jsType` | Input |
70
+ | --------- | ---------------------------------------------------------- |
71
+ | `string` | `type="text"` |
72
+ | `number` | `type="number"`, read with `valueAsNumber` |
73
+ | `boolean` | a checkbox or switch |
74
+ | `Date` | `type="date"`, or `datetime-local` when a time is expected |
75
+ | `unknown` | `type="text"`, converted at the call |
76
+
77
+ **Validation** is `required` on each required parameter and nothing else — no length, range or format checks of your own. Disable submit from the browser's verdict, `form.checkValidity()`, never from hand-rolled checks. Anything stricter comes back from the server.
78
+
79
+ **Errors.** `error` is `{ status?, data: { message?, errors? }, isCancelled }` — read it without a cast. A failing SQL action comes back as a 500 whose `data.message` wraps the driver's text (`Error executing Action: …`): show it as it comes, in a `white-space: pre-wrap` element, since driver messages span lines — never "Something went wrong", `String(error)` or a friendlier paraphrase. `error.data.errors?.[parameterSlug]`, when present, goes beside its field (`aria-invalid` on the input).
80
+
81
+ ## Refresh
82
+
83
+ After a write succeeds, refetch every query on screen it could have changed: `await Promise.all([orders.refetch(), totals.refetch()])`, the `refetch` that `useMetabaseQuery` returns.
84
+
85
+ - Those queries live in a component above the trigger, which passes the refresh down; a query in the trigger's own component or below it can't be wired to it.
86
+ - Await the refresh before clearing the form or closing the modal, so stale rows never flash.
87
+ - Never prepend `result` to a local list instead: ids, timestamps and computed columns come from the server.
88
+
89
+ ## When it doesn't work
90
+
91
+ 1. Log `result`, `error` and the object passed to `execute`: every key is a parameter slug, every value matches its `jsType`.
92
+ 2. `execute` resolved to `null` and nothing was sent: it ran before the SDK started.
93
+ 3. The screen doesn't update: see _Refresh_.
94
+ 4. The action is missing from `src/metabase.ts`: it isn't in the app's collection, or the file is stale — regenerate it.
95
+
96
+ Then build and publish (`data-app`, _Build and publish_).