@metabase/cli 0.5.4 → 0.5.6
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.
- package/dist/{add-collection-D2x34KVO.mjs → add-collection-C_PXX4ls.mjs} +1 -1
- package/dist/{alert-B-w0c61D.mjs → alert-C8-KXr_o.mjs} +6 -6
- package/dist/{alerts-nnrpqD-U.mjs → alerts-BXEyXQRl.mjs} +2 -2
- package/dist/{api-key-CTyXuYui.mjs → api-key-DgEtUdtr.mjs} +3 -3
- package/dist/{append-BPrVW4RB.mjs → append-DHsRfdyS.mjs} +2 -2
- package/dist/{archive-p7gGwh0n.mjs → archive-1u8702EH.mjs} +1 -1
- package/dist/{archive-Bw_cvk_4.mjs → archive-78gVBFu3.mjs} +1 -1
- package/dist/{archive-CJFUFozc.mjs → archive-BHhKF2_r.mjs} +1 -1
- package/dist/{archive-CTZs6Hl6.mjs → archive-BfCuJyWK.mjs} +1 -1
- package/dist/{archive-Cwetg5kK.mjs → archive-BofgzTAr.mjs} +1 -1
- package/dist/{archive-BYo35OGC.mjs → archive-CU9OhyrM.mjs} +1 -1
- package/dist/{archive-F5hoWW7f.mjs → archive-Cm3GcZRd.mjs} +1 -1
- package/dist/{archive-Ccf6Qqrf.mjs → archive-D87H0xOc.mjs} +1 -1
- package/dist/{archive-BZVRJYTT.mjs → archive-DxLrdlxM.mjs} +1 -1
- package/dist/{archive-OZQaaQkK.mjs → archive-DyB65bNo.mjs} +1 -1
- package/dist/{archive-DBQnauVo.mjs → archive-Lgd6irTm.mjs} +1 -1
- package/dist/{archive-tmrsG41w.mjs → archive-eINikapF.mjs} +1 -1
- package/dist/{auth-eogOlU4X.mjs → auth-CeSe2l6R.mjs} +4 -4
- package/dist/{branches-CERgKqFq.mjs → branches-iu9tRXr6.mjs} +1 -1
- package/dist/{breaking-B8f_vl0i.mjs → breaking-DicKTkii.mjs} +1 -1
- package/dist/{broken-mrkOdV4j.mjs → broken-70_zMy0L.mjs} +1 -1
- package/dist/{bulk-discard-values-BQ3z6nJb.mjs → bulk-discard-values-Bsdq0Aid.mjs} +1 -1
- package/dist/{bulk-edit-CJxoxDGQ.mjs → bulk-edit-vWzm2uEj.mjs} +1 -1
- package/dist/{bulk-rescan-values-DflzyxEj.mjs → bulk-rescan-values-qTNZkMRH.mjs} +1 -1
- package/dist/{bulk-sync-schema-CBIs4yHs.mjs → bulk-sync-schema-neL4AxaB.mjs} +1 -1
- package/dist/{cancel-CyTRWSOr.mjs → cancel-DsyTp_jV.mjs} +1 -1
- package/dist/{cancel-task-BuZsQuLp.mjs → cancel-task-DMlaD81O.mjs} +1 -1
- package/dist/{card-DA1W3Axw.mjs → card-uZeDk5uH.mjs} +8 -8
- package/dist/{cards-BEeFNiCt.mjs → cards-DLEx1zfQ.mjs} +1 -1
- package/dist/cli.mjs +38 -38
- package/dist/{client-DvWllzKd.mjs → client-BN93yUlt.mjs} +10 -5
- package/dist/{collection-C98jgufi.mjs → collection-Cowt7nWW.mjs} +7 -7
- package/dist/{content-translation-1coWME1P.mjs → content-translation-C2V3jNV7.mjs} +2 -2
- package/dist/{copy-DVe4rcLK.mjs → copy-9iOg50lN.mjs} +1 -1
- package/dist/{copy-hE6SaHfb.mjs → copy-C4Nf6Sqt.mjs} +1 -1
- package/dist/{create-DJg0Ohj5.mjs → create-9p0vyQkK.mjs} +1 -1
- package/dist/{create-BjH0i2BC.mjs → create-B5h_621T.mjs} +1 -1
- package/dist/{create-XCzUuT42.mjs → create-BDBHkgLv.mjs} +1 -1
- package/dist/{create-DR5tpMUA.mjs → create-BNgkKeY4.mjs} +1 -1
- package/dist/{create-D271V9Cf.mjs → create-BUmS6B9_.mjs} +1 -1
- package/dist/{create-DdfFgF-w.mjs → create-BafMBtrH.mjs} +1 -1
- package/dist/{create-DCoo3sI2.mjs → create-BtExn-0P.mjs} +1 -1
- package/dist/{create-XVjr8IDS.mjs → create-C1DBXOxh.mjs} +1 -1
- package/dist/{create-Btwnm6D2.mjs → create-CA9c4U1m.mjs} +1 -1
- package/dist/{create-DXivfl69.mjs → create-CBk4CFjA.mjs} +1 -1
- package/dist/{create-DR8g_rEL.mjs → create-CWMC90-0.mjs} +1 -1
- package/dist/{create-LpdQKxUt.mjs → create-D6eWvVcd.mjs} +2 -2
- package/dist/{create-D6Xm2b2D.mjs → create-DBWbf0DF.mjs} +2 -2
- package/dist/{create-DEIIUohY2.mjs → create-DDEKafSb2.mjs} +1 -1
- package/dist/{create-CCb2_Kcc.mjs → create-DJzWxTOV.mjs} +1 -1
- package/dist/{create-B3P62NaN.mjs → create-D_AwGujc.mjs} +1 -1
- package/dist/{create-Dz4c8E33.mjs → create-VPzYsXKz.mjs} +1 -1
- package/dist/{create-BPRuU7Mv.mjs → create-ZKrdArmQ.mjs} +1 -1
- package/dist/{create-branch-D_nbKxDS.mjs → create-branch-D56lVQNd.mjs} +1 -1
- package/dist/{create-B3kz_fHg.mjs → create-il08Ub78.mjs} +1 -1
- package/dist/{create-DkFCjBp3.mjs → create-vN4sgCHU.mjs} +1 -1
- package/dist/{csv-LP7sE-CS.mjs → csv-D50rzoTk.mjs} +2 -2
- package/dist/{current-task-DhgwtGN3.mjs → current-task-CpPUJYbQ.mjs} +1 -1
- package/dist/{dashboard-CR97_zXn.mjs → dashboard-CrD7w0mE.mjs} +11 -11
- package/dist/{data-action-C4jE-RLb.mjs → data-action-p-8TbHAj.mjs} +7 -7
- package/dist/{data-app-BlBvvRzC.mjs → data-app-3cmb-x-I.mjs} +9 -9
- package/dist/{data-app-project-DjDDWgUF.mjs → data-app-project-DUCJcvfJ.mjs} +1 -1
- package/dist/{db-D8mPRqZc.mjs → db-BO1aJAAn.mjs} +7 -7
- package/dist/{delete-DWTqIlbr.mjs → delete-8qsotOGB.mjs} +1 -1
- package/dist/{delete-DaqzPLcG.mjs → delete-BSCnAB2g.mjs} +1 -1
- package/dist/{delete-DuaJ8PUI.mjs → delete-ByYgGnoo.mjs} +1 -1
- package/dist/{delete-CaaPrNOf.mjs → delete-CTtToAYO.mjs} +1 -1
- package/dist/{delete-CuyGTe0i.mjs → delete-DHJ3ea0o.mjs} +1 -1
- package/dist/{delete-8k7oYDFr.mjs → delete-DU-Kinm4.mjs} +1 -1
- package/dist/{delete-DC-DEYSq.mjs → delete-DU1K-Cy4.mjs} +1 -1
- package/dist/{delete-ZjLpkwgx.mjs → delete-DXL1orAc.mjs} +1 -1
- package/dist/{delete-B1SbEVIc.mjs → delete-DuVEKGA5.mjs} +1 -1
- package/dist/{delete-CqyBkMCd.mjs → delete-DwNkDTga.mjs} +1 -1
- package/dist/{delete-table-CnGv1gx9.mjs → delete-table-RAznoioi.mjs} +1 -1
- package/dist/{dependencies-D6SNdLW8.mjs → dependencies-CKT460jf.mjs} +1 -1
- package/dist/{dependency-Bbg9x1V9.mjs → dependency-B1wYuRR1.mjs} +5 -5
- package/dist/{dependents-BizQb14Q.mjs → dependents-D85CaupB.mjs} +1 -1
- package/dist/{dirty-BHwdHOEj.mjs → dirty-BnuuGVxz.mjs} +1 -1
- package/dist/{discard-values-BWlh2ce8.mjs → discard-values-CXyBp5pq.mjs} +1 -1
- package/dist/{document-B6254tue.mjs → document-BHXXSx3u.mjs} +6 -6
- package/dist/{download-D2wEAgi_.mjs → download--RQk3dyK.mjs} +1 -1
- package/dist/{eid-KtWIPUCC.mjs → eid-BwhUajT8.mjs} +1 -1
- package/dist/{entry-flags-DLS6r8Vf.mjs → entry-flags-DS_MMJbV.mjs} +1 -1
- package/dist/{events-B8yMqrrD.mjs → events-DuHSrJuz.mjs} +1 -1
- package/dist/{execute-Bebvab7D.mjs → execute-BjWeMJ0l.mjs} +1 -1
- package/dist/{export-BNj3RvAl.mjs → export-C_G6D1MF.mjs} +2 -2
- package/dist/{export-preflight-F3OapAD5.mjs → export-preflight-DeqCCYP0.mjs} +1 -1
- package/dist/{field-DQAcCjXr.mjs → field-C02nW-20.mjs} +7 -7
- package/dist/{fields-BkAS_wIA.mjs → fields-Ds2PnxA7.mjs} +1 -1
- package/dist/{fks--SaqvPw1.mjs → fks-CCKTcQ4c.mjs} +1 -1
- package/dist/{get-B2nBYYCw.mjs → get-8gu6wblt.mjs} +1 -1
- package/dist/{get-uHs9Ve-4.mjs → get-BB0b96ox.mjs} +1 -1
- package/dist/{get-iOs1ci6x.mjs → get-BOcwk9jz.mjs} +1 -1
- package/dist/{get-CTTKQDr7.mjs → get-B_5Y65cZ.mjs} +1 -1
- package/dist/{get-CM9IOr82.mjs → get-B_Vz5OMY.mjs} +1 -1
- package/dist/{get-f2km9wsq.mjs → get-C6qjCvoM.mjs} +1 -1
- package/dist/{get-B1uiZyyi.mjs → get-CDA-g71Z.mjs} +1 -1
- package/dist/{get-BSKpQJVB.mjs → get-CGrfQxXy.mjs} +1 -1
- package/dist/{get-Boql3_0n.mjs → get-CJEE2ApL.mjs} +1 -1
- package/dist/{get-Cdcj1c9U.mjs → get-CTwU2SwT.mjs} +1 -1
- package/dist/{get-gGSl7Se4.mjs → get-D3k4Pyfn.mjs} +1 -1
- package/dist/{get-CWDz6eV2.mjs → get-D3kYRX7B.mjs} +1 -1
- package/dist/{get-C_hatP_z.mjs → get-D7Uq4t19.mjs} +1 -1
- package/dist/{get-CGPxAoow.mjs → get-DSQSwjDw.mjs} +1 -1
- package/dist/{get-B1S1kW2N.mjs → get-DVctVDj6.mjs} +1 -1
- package/dist/{get-De6qpuzO.mjs → get-DXH0zRv1.mjs} +1 -1
- package/dist/{get-BseHija1.mjs → get-D_eGmu67.mjs} +1 -1
- package/dist/{get-C9VumVZ3.mjs → get-DkEOLIF5.mjs} +2 -2
- package/dist/{get-VpGfaL7c.mjs → get-Du0KCtaC.mjs} +1 -1
- package/dist/{get-BjgB5l7X.mjs → get-R4_vq3U9.mjs} +1 -1
- package/dist/{get-run-CHup8cMl.mjs → get-run-Ds50O2Rn.mjs} +1 -1
- package/dist/{get-CiLYhFjU.mjs → get-v_BtTCdl.mjs} +1 -1
- package/dist/{get-CU1zKfBS.mjs → get-xJTVgvSu.mjs} +1 -1
- package/dist/git-sync-Dje-mnMh.mjs +29 -0
- package/dist/{glossary-BVxRpD7o.mjs → glossary-TBjFyeRN.mjs} +4 -4
- package/dist/{graph-B7SlzpkC.mjs → graph-DeGkHvI5.mjs} +1 -1
- package/dist/{has-remote-changes-DZq7q2Wk.mjs → has-remote-changes-DUCn8d5k.mjs} +1 -1
- package/dist/{import-DKZF0kMU.mjs → import-Bnun0H8L.mjs} +2 -2
- package/dist/{is-dirty-haRLODo1.mjs → is-dirty-BRdzj548.mjs} +1 -1
- package/dist/{items-BGWE5hLl.mjs → items-BmFznkYw.mjs} +1 -1
- package/dist/{library-e3aiJ1Yb.mjs → library-Cy8n_GoQ.mjs} +4 -4
- package/dist/{list-BNel4hYs.mjs → list-B8FE0mi7.mjs} +1 -1
- package/dist/{list-DUCxqhtn.mjs → list-B8WxIHZh.mjs} +1 -1
- package/dist/{list-DJyIkrY1.mjs → list-BJaTl4Z3.mjs} +3 -3
- package/dist/{list-B9yhUzCc.mjs → list-BXgbS3xg.mjs} +1 -1
- package/dist/{list-DcXqKZyg.mjs → list-CgiBw3H-.mjs} +1 -1
- package/dist/{list-DDt1iLXj.mjs → list-ChPsUv0M.mjs} +1 -1
- package/dist/{list-Dvf1iB8r.mjs → list-CnQnHNwI.mjs} +1 -1
- package/dist/{list-D0ASRA_6.mjs → list-CucyGz_M.mjs} +1 -1
- package/dist/{list-HI7Mpoy-.mjs → list-Cv9U6hop.mjs} +1 -1
- package/dist/{list-P7FnSsbZ.mjs → list-D7oLTX1F.mjs} +1 -1
- package/dist/{list-gcDxZ7Th.mjs → list-DCooGGd-.mjs} +1 -1
- package/dist/{list-D_8GeDG-.mjs → list-DQNmzmbE.mjs} +1 -1
- package/dist/{list-COPGHkWL.mjs → list-DVdfoOmD.mjs} +1 -1
- package/dist/{list-CNiCM1NL.mjs → list-DkJsUigU.mjs} +1 -1
- package/dist/{list-CsXdnNyp.mjs → list-DqvwXEY3.mjs} +2 -2
- package/dist/{list-DFxfpa4W.mjs → list-DwA83Hut.mjs} +1 -1
- package/dist/{list-DAa4EWlv.mjs → list-Hkl1mEcn.mjs} +1 -1
- package/dist/{list-DednUvr3.mjs → list-emgvzTcQ.mjs} +1 -1
- package/dist/{list-Bbc8VYDi.mjs → list-hrR_sluM.mjs} +1 -1
- package/dist/{list-BiIZdUoN.mjs → list-jPZgEqWH.mjs} +1 -1
- package/dist/{list-C-AnwSRP.mjs → list-jfnzEgFg.mjs} +1 -1
- package/dist/{list-OUSeeuXb.mjs → list-uDe8e-8m.mjs} +1 -1
- package/dist/{list-DFuydMdV.mjs → list-zIJcjZwa.mjs} +1 -1
- package/dist/{login-APHXId1p.mjs → login-DMpRrZoJ.mjs} +31 -14
- package/dist/{logout-V0pxj6AM.mjs → logout-DEB_Rs3z.mjs} +1 -1
- package/dist/{measure-DnGWkKyx.mjs → measure-Dop8G1p3.mjs} +5 -5
- package/dist/{parameter-values-DfZSEK3O.mjs → parameter-values-CuNu1kDf.mjs} +1 -1
- package/dist/{path-Bni-pnKS.mjs → path-6xIAWlup.mjs} +2 -2
- package/dist/{poll-vxN__4cz.mjs → poll-uailHW3t.mjs} +1 -1
- package/dist/{publish-DkYn86ak.mjs → publish-D7tndpBc.mjs} +9 -3
- package/dist/{query-gHeYfWj_.mjs → query-C_6GZwbJ.mjs} +1 -1
- package/dist/{query-CZbI4Rlv.mjs → query-Do1Ms0k9.mjs} +1 -1
- package/dist/{remapping-hcWkFQsx.mjs → remapping-B5Z3Ustf.mjs} +1 -1
- package/dist/{remove-collection-Qne5ww6M.mjs → remove-collection-p9OgcXQ0.mjs} +1 -1
- package/dist/{render-d1-sCPn_.mjs → render-C3ygE5nO.mjs} +1 -1
- package/dist/{replace-DoU0IFGd.mjs → replace-D3I8Cb6E.mjs} +2 -2
- package/dist/{requirement-check-BoVSK1uK.mjs → requirement-check-DWGbJZUM.mjs} +1 -1
- package/dist/{rescan-values-COzM86P5.mjs → rescan-values-DgUwDmwZ.mjs} +1 -1
- package/dist/{rescan-values-s82n_You.mjs → rescan-values-DwYuiNzi.mjs} +1 -1
- package/dist/{run-JYNbEO_V.mjs → run-BtRi59Hd.mjs} +2 -2
- package/dist/{run-Q7fHux1F.mjs → run-Dr-DsQVO.mjs} +2 -2
- package/dist/{run-Bwj4Uuxk.mjs → run-qAs_RthF.mjs} +1 -1
- package/dist/{runs-GQD6FO2k.mjs → runs-hulvKxUw.mjs} +1 -1
- package/dist/{runtime-iIsqiOwO.mjs → runtime-CEAFobLj.mjs} +77 -39
- package/dist/{scaffold-CJo9l-2p.mjs → scaffold-CO9Oea2N.mjs} +3 -3
- package/dist/{schema-2JhmK8FM.mjs → schema-D5AhDYTD.mjs} +1 -1
- package/dist/{schema-tables-CarGLayY.mjs → schema-tables-KIsDvvGs.mjs} +1 -1
- package/dist/{schemas-oSjtuQ4G.mjs → schemas-DuGltR33.mjs} +1 -1
- package/dist/{search-CvGEL2h-.mjs → search-BJPNMvnK.mjs} +1 -1
- package/dist/{search-Ca0sIr28.mjs → search-CM3ybv8O.mjs} +1 -1
- package/dist/{segment-BJCEJwNY.mjs → segment-BROyKyC3.mjs} +5 -5
- package/dist/{send-B4nZI6CU.mjs → send-cSr60J2Z.mjs} +1 -1
- package/dist/{set-BjMZCdN8.mjs → set-DpBA6eOn.mjs} +1 -1
- package/dist/{set-active-CWDdv3kN.mjs → set-active-DaGUZCbh.mjs} +1 -1
- package/dist/{set-bundle-C2uk4jdt.mjs → set-bundle-CgJuQ3fe.mjs} +5 -5
- package/dist/{set-data-actions-lWl05ekf.mjs → set-data-actions-CyuKhCDs.mjs} +1 -1
- package/dist/{set-enabled-CPhw1AX4.mjs → set-enabled-DxxlZePU.mjs} +4 -4
- package/dist/{set-sensitivity-B7WI5BJC.mjs → set-sensitivity-BBkuW5wQ.mjs} +1 -1
- package/dist/{setting-BvPpFjJT.mjs → setting-BixEhGR2.mjs} +3 -3
- package/dist/{setup-DPRa8Uxm.mjs → setup-DqAjBhZz.mjs} +1 -1
- package/dist/{skills-BCivFuuZ.mjs → skills-ByZWUsPC.mjs} +3 -3
- package/dist/{skills-BY3MCR8i.mjs → skills-CPNaSE_d.mjs} +1 -1
- package/dist/{snippet-BcN1UwoS.mjs → snippet-CK5QjPXs.mjs} +5 -5
- package/dist/{stash-leoW1fby.mjs → stash-BMitlOt0.mjs} +2 -2
- package/dist/{status-BezD_K-g.mjs → status-4ewKKM1J.mjs} +1 -1
- package/dist/{status-AA4APlwZ.mjs → status-BxYGT5I4.mjs} +2 -2
- package/dist/{subscription-BDukZFlC.mjs → subscription-9WV3hwAq.mjs} +5 -5
- package/dist/{subscriptions-CU4E_p7B.mjs → subscriptions-EVIRobQM.mjs} +2 -2
- package/dist/{summary-BFspP71W.mjs → summary-CaWLpvcZ.mjs} +1 -1
- package/dist/{sync-schema-BhRhsm8Y.mjs → sync-schema-BntqB-68.mjs} +2 -2
- package/dist/{sync-schema-BtjC-PNY.mjs → sync-schema-Dt0zekZR.mjs} +1 -1
- package/dist/table-BAOSPOlO.mjs +26 -0
- package/dist/{timeline-Cr5d4Oer.mjs → timeline-CyIVLhsz.mjs} +7 -7
- package/dist/{timeline-event-BiYDbW3r.mjs → timeline-event-CaXRyGXH.mjs} +5 -5
- package/dist/transform-C8ZiOTWq.mjs +28 -0
- package/dist/transform-job-BKX10IUY.mjs +22 -0
- package/dist/{transform-tag-DQXOPhmt.mjs → transform-tag-QBmEYxZi.mjs} +4 -4
- package/dist/{transform-test-wmAjyaka.mjs → transform-test-DMShXj--.mjs} +6 -6
- package/dist/{transforms-DcXL4Dox.mjs → transforms-yuckjEH-.mjs} +1 -1
- package/dist/{transport-DZSxmmtY.mjs → transport-3xv524C_.mjs} +2 -3
- package/dist/{tree-DrYYCdXP.mjs → tree-DhZWC6AW.mjs} +1 -1
- package/dist/{typed-schema-DEzmTY3J.mjs → typed-schema-9umakTr7.mjs} +2 -2
- package/dist/{unpublish-D8hmulCx.mjs → unpublish-BmrZNEcs.mjs} +1 -1
- package/dist/{unreferenced-C3CqO3tu.mjs → unreferenced-C0dYogu7.mjs} +1 -1
- package/dist/{update-4sOfpwpv.mjs → update-B0j7R5BU.mjs} +1 -1
- package/dist/{update-4TDRNrV-.mjs → update-BIDjJnEh.mjs} +1 -1
- package/dist/{update-BVz0oIwS.mjs → update-BsCY9WoI.mjs} +1 -1
- package/dist/{update-B21GAnzT.mjs → update-BtyHjKV6.mjs} +1 -1
- package/dist/{update-LlJM4tUd.mjs → update-CqqZHGBZ.mjs} +1 -1
- package/dist/{update-BxRFktpB.mjs → update-CsYMNm1n.mjs} +1 -1
- package/dist/{update-3lRE8G9k.mjs → update-CzCc5og7.mjs} +1 -1
- package/dist/{update-DvGIaZdl.mjs → update-D4s8mpef.mjs} +1 -1
- package/dist/{update-l4WRN6Jh.mjs → update-DIsbIcWv.mjs} +1 -1
- package/dist/{update-Zv7PP8nl.mjs → update-DRH78xMc.mjs} +1 -1
- package/dist/{update-Ch6AAOeh.mjs → update-DTvdH8rF.mjs} +1 -1
- package/dist/{update-DmMHHn75.mjs → update-DVEqN-uO.mjs} +1 -1
- package/dist/{update-CEDMvgJI.mjs → update-D_9HdXGt.mjs} +1 -1
- package/dist/{update-CcNYCalv.mjs → update-DoZZ-pii.mjs} +1 -1
- package/dist/{update-sma1ZRm2.mjs → update-Dr66Dv3x.mjs} +3 -3
- package/dist/{update-CctMr2T1.mjs → update-DuJ7Pu5t.mjs} +2 -2
- package/dist/{update-CtuLA42g.mjs → update-Gv4cQsS3.mjs} +1 -1
- package/dist/{update-dashcard-BijqiYQd.mjs → update-dashcard-fWxyfSG5.mjs} +1 -1
- package/dist/{update-7iXRB23T2.mjs → update-eL6rSQvo2.mjs} +1 -1
- package/dist/{update-552UGPAG.mjs → update-nZkZHbL5.mjs} +1 -1
- package/dist/{update-DVD77mVR.mjs → update-zKgO1dbJ.mjs} +1 -1
- package/dist/{upgrade-TzILOkiM.mjs → upgrade-PIUDxb6V.mjs} +1 -2
- package/dist/{upload-Do-kOGtc.mjs → upload-B6S0Vqgn.mjs} +2 -2
- package/dist/{upload-B37bUVl_.mjs → upload-Dzn5OAbv.mjs} +3 -3
- package/dist/{upload-CdiDKe69.mjs → upload-KuHgzGJU.mjs} +1 -1
- package/dist/{uuid-Dqq2WfAT.mjs → uuid-BPr2deuu.mjs} +1 -1
- package/dist/{values-CtY5zv0m.mjs → values-DHvfVT9h.mjs} +1 -1
- package/dist/{verify-DBTlWx-S.mjs → verify-CvGdvC7R.mjs} +1 -1
- package/dist/{verify-DJ7fGyLL.mjs → verify-D9i63gmK.mjs} +2 -2
- package/dist/{verify-BiB8jzXB.mjs → verify-DS0REVed.mjs} +1 -1
- package/dist/{wait-DEYagfq4.mjs → wait-DrOL01Y_.mjs} +3 -3
- package/dist/{wait-flags-C3cu_O0w.mjs → wait-flags-DT1zA69Z.mjs} +1 -1
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +5 -2
- package/skill-data/data-app/SKILL.md +16 -17
- package/skill-data/data-app/template/README.md +7 -3
- package/skill-data/data-app/template/gitignore +1 -1
- package/skill-data/data-app/template/package.json +1 -0
- package/skill-data/data-app-actions/SKILL.md +3 -0
- package/skill-data/data-app-data/SKILL.md +6 -6
- package/skill-data/data-app-filters/SKILL.md +12 -4
- package/skill-data/data-app-ui/SKILL.md +11 -11
- package/skill-data/data-workflow/references/reusable-definitions.md +2 -2
- package/skill-data/git-sync/SKILL.md +13 -11
- package/skill-data/mbql/SKILL.md +2 -2
- package/dist/git-sync-Czena0TW.mjs +0 -29
- package/dist/signal-BNUlQjpc.mjs +0 -25
- package/dist/table-Dzp1uANs.mjs +0 -26
- package/dist/transform-C-0nV5Et.mjs +0 -28
- package/dist/transform-job-B9MPk7S5.mjs +0 -22
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
|
|
5
5
|
import { h as DashcardPatchInput, m as DashcardDetail } from "./dashboard-Cwsf-e9T.mjs";
|
|
6
6
|
import { r as dashcardView } from "./dashboard-Bx2sYijR.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
|
|
5
5
|
import { o as TransformJobUpdateInput, t as TransformJob } from "./transform-job-CDIb3B9o.mjs";
|
|
6
6
|
import { t as transformJobView } from "./transform-job-D18XRLBK.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
|
|
5
5
|
import { a as PulseUpdateInput, t as Pulse } from "./pulse-B2AmIWsO.mjs";
|
|
6
6
|
import { t as pulseView } from "./pulse-CPSpum5U.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
|
|
5
5
|
import { c as TimelineUpdateInput, t as Timeline } from "./timeline-DcsCXNUt.mjs";
|
|
6
6
|
import { n as timelineView } from "./timeline-BgWz8DYK.mjs";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { g as errorMessage, i as AbortError, m as UnknownError, p as TimeoutError, u as NetworkError } from "./predicates-0C0TsWcJ.mjs";
|
|
2
2
|
import { K as HttpError, X as parseJson, lt as outputFlags, nt as name, o as renderItem, p as writeText, rt as version, t as interruptSignal, v as promptConfirm } from "./cli.mjs";
|
|
3
|
-
import { E as USER_AGENT, t as defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { n as throwIfAborted, t as combineAborts } from "./signal-BNUlQjpc.mjs";
|
|
3
|
+
import { E as USER_AGENT, U as combineAborts, W as throwIfAborted, t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
5
4
|
import { n as streamProcess } from "./process-BQC3mK2k.mjs";
|
|
6
5
|
import { z } from "zod";
|
|
7
6
|
import { realpathSync } from "node:fs";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
3
3
|
import { t as ContentTranslationUploadResult } from "./content-translation-BrHOrmj9.mjs";
|
|
4
|
-
import { n as requireUploadFilePath, t as readCsvFile } from "./upload-
|
|
4
|
+
import { n as requireUploadFilePath, t as readCsvFile } from "./upload-KuHgzGJU.mjs";
|
|
5
5
|
//#region src/output/views/content-translation.ts
|
|
6
6
|
const contentTranslationUploadView = {
|
|
7
7
|
compactPick: ContentTranslationUploadResult,
|
|
@@ -4,9 +4,9 @@ var upload_default = defineCommandGroup({
|
|
|
4
4
|
name: "upload",
|
|
5
5
|
description: "Upload CSV files into Metabase",
|
|
6
6
|
subCommands: {
|
|
7
|
-
csv: () => import("./csv-
|
|
8
|
-
append: () => import("./append-
|
|
9
|
-
replace: () => import("./replace-
|
|
7
|
+
csv: () => import("./csv-D50rzoTk.mjs").then((m) => m.default),
|
|
8
|
+
append: () => import("./append-DHsRfdyS.mjs").then((m) => m.default),
|
|
9
|
+
replace: () => import("./replace-D3I8Cb6E.mjs").then((m) => m.default)
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { o as ConfigError, v as isFileNotFoundError } from "./predicates-0C0TsWcJ.mjs";
|
|
2
|
-
import { D as fileNotFoundError } from "./runtime-
|
|
2
|
+
import { D as fileNotFoundError } from "./runtime-CEAFobLj.mjs";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { basename } from "node:path";
|
|
5
5
|
//#region src/runtime/upload.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { o as ConfigError } from "./predicates-0C0TsWcJ.mjs";
|
|
2
2
|
import { f as writeJson, lt as outputFlags, mt as parseInteger, p as writeText } from "./cli.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
import { randomUUID } from "node:crypto";
|
|
6
6
|
//#region src/commands/uuid.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h as formatScalar, it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { d as FieldValues } from "./field-C2qOViFZ.mjs";
|
|
5
5
|
import { s as fieldValuesView } from "./field-CT4r6b92.mjs";
|
|
6
6
|
//#region src/commands/field/values.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { t as ModerationReview } from "./moderation-review-Bf9bPNQI.mjs";
|
|
5
5
|
import { i as moderationReviewView, n as verifyFlags, r as describeReview, t as reviewInput } from "./verify-flags-DEVMB9w0.mjs";
|
|
6
6
|
//#region src/commands/dashboard/verify.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { n as createClient } from "./client-
|
|
1
|
+
import { n as createClient } from "./client-BN93yUlt.mjs";
|
|
2
2
|
import { g as errorMessage, l as MetabaseError, p as TimeoutError, u as NetworkError } from "./predicates-0C0TsWcJ.mjs";
|
|
3
3
|
import { K as HttpError } from "./cli.mjs";
|
|
4
|
-
import { B as probeServer, E as USER_AGENT } from "./runtime-
|
|
4
|
+
import { B as probeServer, E as USER_AGENT } from "./runtime-CEAFobLj.mjs";
|
|
5
5
|
//#region src/core/auth/verify.ts
|
|
6
6
|
const VERIFY_TIMEOUT_MS = 15e3;
|
|
7
7
|
async function verifyAndProbe(url, credential, options = {}) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
4
4
|
import { t as ModerationReview } from "./moderation-review-Bf9bPNQI.mjs";
|
|
5
5
|
import { i as moderationReviewView, n as verifyFlags, r as describeReview, t as reviewInput } from "./verify-flags-DEVMB9w0.mjs";
|
|
6
6
|
//#region src/commands/card/verify.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { it as connectionFlags, l as renderSummary, lt as outputFlags, ut as profileFlag } from "./cli.mjs";
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-
|
|
3
|
-
import { n as DEFAULT_TIMEOUT_MS, t as DEFAULT_INTERVAL_MS } from "./poll-
|
|
4
|
-
import { r as parseWaitSchedule } from "./wait-flags-
|
|
2
|
+
import { t as defineMetabaseCommand } from "./runtime-CEAFobLj.mjs";
|
|
3
|
+
import { n as DEFAULT_TIMEOUT_MS, t as DEFAULT_INTERVAL_MS } from "./poll-uailHW3t.mjs";
|
|
4
|
+
import { r as parseWaitSchedule } from "./wait-flags-DT1zA69Z.mjs";
|
|
5
5
|
import { u as syncTaskView } from "./git-sync-D1aKczo6.mjs";
|
|
6
6
|
import { a as throwIfFailedTask, i as taskPollOptions, n as formatSyncTask, r as syncTaskIdleView, t as SyncTaskOrIdle } from "./sync-task-Gf86CU9l.mjs";
|
|
7
7
|
//#region src/commands/git-sync/wait.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as interruptSignal } from "./cli.mjs";
|
|
2
2
|
import { t as parseId } from "./parse-id-EXZan40V.mjs";
|
|
3
|
-
import { n as DEFAULT_TIMEOUT_MS, t as DEFAULT_INTERVAL_MS } from "./poll-
|
|
3
|
+
import { n as DEFAULT_TIMEOUT_MS, t as DEFAULT_INTERVAL_MS } from "./poll-uailHW3t.mjs";
|
|
4
4
|
//#region src/commands/wait-flags.ts
|
|
5
5
|
const waitScheduleFlags = {
|
|
6
6
|
timeout: {
|
package/package.json
CHANGED
package/skill-data/core/SKILL.md
CHANGED
|
@@ -156,7 +156,7 @@ What `--help` doesn't say: footguns and non-obvious behaviors.
|
|
|
156
156
|
- **setup is one-shot.** `mb setup` walks `/api/setup` for a **fresh** instance only and errors on a configured one; mostly for bootstrapping local / e2e instances.
|
|
157
157
|
- **eid** translates a string entity id → numeric id: `mb eid --model <model> <eid1,eid2> --json`. Entity ids are NanoIDs that can start with `-`, which the positional form misreads as a flag (shell quotes don't help) — for those, use `--body '{"entity_ids":{"card":["-…"]}}'` (the id is a JSON string value, immune to flag parsing).
|
|
158
158
|
<!-- requires: library -->
|
|
159
|
-
- **library.** The Library is a curated subtree (`library-data` "Data" + `library-metrics` "Metrics" under a `library` root): tables in **Data** lead data pickers and rank up in search; metrics in **Metrics** lead nav, search, and the query builder. `library get` shows its Data/Metrics collection ids; `library create` provisions it (idempotent). `library publish --table-ids/--db-ids/--schemas` publishes tables into Data, **resolving the Data collection and creating the Library if absent**; each `--schemas` entry is `<db-id>:<schema>` (`1:public`), not a bare name. `publish` cascades to upstream FK dependencies, `unpublish` to downstream dependents; both need **admin or data-analyst** (Curate alone won't publish) and exit **403** without write **and** query permission on every affected table. `table get`/`table list` carry `is_published` (`collection_id` under `--full`).
|
|
159
|
+
- **library.** The Library is a curated subtree (`library-data` "Data" + `library-metrics` "Metrics" under a `library` root): tables in **Data** lead data pickers and rank up in search; metrics in **Metrics** lead nav, search, and the query builder. `library get` shows its Data/Metrics collection ids; `library create` provisions it (idempotent). `library publish --table-ids/--db-ids/--schemas` publishes tables into Data, **resolving the Data collection and creating the Library if absent**; each `--schemas` entry is `<db-id>:<schema>` (`1:public`), not a bare name. `publish` cascades to upstream FK dependencies, `unpublish` to downstream dependents; both need **admin or data-analyst** (Curate alone won't publish) and exit **403** without write **and** query permission on every affected table. `table get`/`table list` carry `is_published` (`collection_id` under `--full`). On a remote-sync instance, `mb git-sync add-collection <library-id>` (the root) makes exports carry published tables' metadata (see `git-sync`).
|
|
160
160
|
<!-- /requires -->
|
|
161
161
|
- **query / uuid.** `mb query` runs MBQL (`--dry-run` → run; `mbql`). `mb uuid --count <n>` mints an aggregation's `lib/uuid` (`mbql`) and document node `_id`s (`document`).
|
|
162
162
|
<!-- requires: library, tableListPublishedFilter -->
|
|
@@ -165,7 +165,7 @@ What `--help` doesn't say: footguns and non-obvious behaviors.
|
|
|
165
165
|
|
|
166
166
|
## Specialized skills (load on demand)
|
|
167
167
|
|
|
168
|
-
This file is enough for any single-command task. For anything deeper, load the relevant skill
|
|
168
|
+
This file is enough for any single-command task. For anything deeper, load the relevant skill (`mb skills get <name>`) **proactively** — don't wing it from this overview.
|
|
169
169
|
|
|
170
170
|
- **`mbql`** — authoring/fixing any MBQL query body (`mb query`, card `dataset_query`, transform `source.query`, measure/segment `definition`); reading `--dry-run` errors. The query-body reference.
|
|
171
171
|
- **`native-sql`** — authoring a native SQL `dataset_query` with parameters: template tags, field filters vs. raw variables, snippets, card references, and wiring a tag to a dashboard filter. The SQL fallback when MBQL can't express it (`mbql` first).
|
|
@@ -185,6 +185,9 @@ This file is enough for any single-command task. For anything deeper, load the r
|
|
|
185
185
|
<!-- /requires -->
|
|
186
186
|
<!-- requires: remoteSync -->
|
|
187
187
|
- **`git-sync`** — round-tripping content to/from a git remote.
|
|
188
|
+
<!-- /requires -->
|
|
189
|
+
<!-- requires: dataApps -->
|
|
190
|
+
- **`data-app`** — data apps: create, preview, publish (start here).
|
|
188
191
|
<!-- /requires -->
|
|
189
192
|
- **`data-workflow`** — the guided, end-to-end data workflow: investigate raw data, build clean analysis-ready tables, define reusable segments/measures/metrics, answer questions, build dashboards. **Start here when the user states a goal rather than a single verb** — "make sense of my data", "build a data model", "be my data analyst". It detects where the data is and routes to the right stage.
|
|
190
193
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
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
|
|
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 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
4
|
allowed-tools: Read, Write, Edit, Bash, AskUserQuestion
|
|
5
5
|
requires: [dataApps]
|
|
6
6
|
---
|
|
@@ -17,11 +17,11 @@ The work, in order:
|
|
|
17
17
|
4. Start the dev preview (_Dev preview_), then write the UI under `src/` (`data-app-ui`; filter controls in `data-app-filters`).
|
|
18
18
|
5. Build and publish (_Build and publish_).
|
|
19
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,
|
|
20
|
+
For every later change: regenerate `src/metabase.ts` if the app's collection changed, then build and set the bundle; in a synced repository, then export and commit the source as in _Move to another instance_. Metabase receives only the built bundle; the source stays in the project directory, which is the app's folder in the synced git repository when there is one (_Scaffold and install_).
|
|
21
21
|
|
|
22
22
|
## Before you start
|
|
23
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
|
|
24
|
+
- Use an **admin** profile — only admins create apps and write the app's collection. `mb auth status --profile <name> --json | jq .user.isAdmin` prints `true` for one, and every command below takes that `--profile`; otherwise ask the user for an admin profile (`mb auth list`).
|
|
25
25
|
- Run `mb data-app list`. A failure means the instance has no data apps: stop and tell the user.
|
|
26
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
27
|
|
|
@@ -31,18 +31,18 @@ For every later change: regenerate `src/metabase.ts` if the app's collection cha
|
|
|
31
31
|
mb data-app create --body '{"name":"sales-overview","display_name":"Sales overview"}' --json
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
`name` is the slug; `display_name` and `description` are optional. The app starts
|
|
34
|
+
`name` is the slug; `display_name` and `description` are optional. The app starts enabled, with an empty bundle, open to admins until a group is assigned. 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
35
|
|
|
36
36
|
## Scaffold and install
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
mb data-app scaffold sales-overview && cd sales-overview
|
|
39
|
+
mb data-app scaffold <repo>/data_apps/sales-overview && cd <repo>/data_apps/sales-overview
|
|
40
40
|
```
|
|
41
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:
|
|
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. When the instance syncs with a git repository (`mb git-sync status`), the directory is `data_apps/<slug>/` in a local clone of that repository (ask the user for its path, or clone the remote), where an export writes the app's `data_app.yaml` and bundle: an export leaves the source alone and an import ignores it, so the repository keeps the source with the app. `scaffold` needs an empty directory, so scaffold before the app's first export; for an app already in the repository, scaffold into a new directory and copy its files, dotfiles included (`cp -R <dir>/. data_apps/<slug>/`), in beside `data_app.yaml` and `dist/`; check `.gitignore` is there before `npm install`. Without a repository, use any new directory, and once remote sync is set up, move the project (without `node_modules/`, `build/`, `dist/`, `.env.local` and a hand-written `data_app.yaml`) into `data_apps/<slug>/` before committing its source. Then install the SDK, then the rest:
|
|
43
43
|
|
|
44
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`)
|
|
45
|
+
npm install @metabase/embedding-sdk-react@<major>-beta # <major>: 66 for a version tag v1.66.x (`mb auth status --profile <name> --json | jq -r .version.tag`)
|
|
46
46
|
npm install && npm run typecheck && npm run build
|
|
47
47
|
```
|
|
48
48
|
|
|
@@ -58,12 +58,12 @@ The template is the bundle contract. Don't edit `package.json` by hand, and neve
|
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
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)
|
|
61
|
+
URL=$(mb auth status --profile <name> --json | jq -r .url)
|
|
62
|
+
KEY=$(mb api-key create --profile <name> --body '{"name":"data-app <slug> dev","group_id":2}' --json | jq -r .unmasked_key)
|
|
63
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
64
|
```
|
|
65
65
|
|
|
66
|
-
Group `2` is Administrators. Never print `.env.local`. Delete the key at handoff (`mb api-key list
|
|
66
|
+
Group `2` is Administrators. Never print `.env.local`. Delete the key at handoff (`mb api-key list --profile <name>`, then `mb api-key delete <id> --yes --profile <name>`); the next session writes a new one. Metabase allows any localhost origin unless `MB_DISABLE_CORS_ON_LOCALHOST` is set, so a CORS error from the preview means it is: ask the user to unset it on this instance. Otherwise check `DATA_APP_MB_URL`.
|
|
67
67
|
|
|
68
68
|
### The diagnostics feed
|
|
69
69
|
|
|
@@ -96,7 +96,7 @@ curl -s "http://localhost:5174/__data-app/diagnostics?startEventId=0"
|
|
|
96
96
|
- `clients: 0` means no tab is open, so empty `entries` prove nothing.
|
|
97
97
|
- Before an edit, note `nextEventId`; after it, read again with that value as `startEventId`.
|
|
98
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.
|
|
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`, and in a synced repository you set `allowed_hosts` with `mb data-app update`, export, and pull the export branch (_Move to another instance_) instead of editing `data_app.yaml`. A `frame-src` or `form-action` block can't be lifted in the preview (`data-app-ui`). The feed keeps the last 200 entries; `curl -X DELETE …/__data-app/diagnostics` clears it.
|
|
100
100
|
|
|
101
101
|
| `kind` | Fix |
|
|
102
102
|
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -110,12 +110,11 @@ curl -s "http://localhost:5174/__data-app/diagnostics?startEventId=0"
|
|
|
110
110
|
```bash
|
|
111
111
|
npm run typecheck && npm run build
|
|
112
112
|
mb data-app set-bundle sales-overview
|
|
113
|
-
mb data-app set-enabled sales-overview true # the first time
|
|
114
113
|
```
|
|
115
114
|
|
|
116
|
-
`set-bundle` uploads `
|
|
115
|
+
`set-bundle` uploads `build/index.js`, the file `npm run build` writes (`--bundle` for another path), and replaces the app's bundle, live at once. A new app is on from the start; `mb data-app set-enabled <slug> false` turns it off, which only the user decides. An app turned off opens only in Data Studio → Data apps → the app → Overview; `/apps/<slug>` says "not found", for admins too. Give the user `<metabase-url>/apps/<slug>`.
|
|
117
116
|
|
|
118
|
-
|
|
117
|
+
A viewer needs one of their groups assigned to the app (otherwise "You don't have access"), which only the user can do (Data Studio → Data apps → the app → Permissions). A group reaches the app's collection and nothing more, so a viewer also needs data access to the tables its questions read.
|
|
119
118
|
|
|
120
119
|
## Pitfalls
|
|
121
120
|
|
|
@@ -133,6 +132,6 @@ Admins open every app, enabled or not. Anyone else needs the app enabled (otherw
|
|
|
133
132
|
## Change, move, delete
|
|
134
133
|
|
|
135
134
|
- **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
|
|
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`
|
|
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.
|
|
135
|
+
- **Outdated:** an app Data Studio lists as _Outdated_ targets an older data-app contract: it won't open for anyone, and only admins see it, until it's migrated. Tell the user; don't change its code ad hoc.
|
|
136
|
+
- **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` works there. The first import there creates the app on, like `create`, open to admins until the user assigns groups; later imports keep its on/off state. The import doesn't check that the questions' tables are published on that instance, so the Library content they read goes in the same export: flag the Library root once (`mb git-sync add-collection <library-id>`, `git-sync`), or its metrics, measures and segments stay out of the repository; a data action needs its database's toggle on there too. Once the app is done, commit its source in `data_apps/<slug>/` on the branch you exported to, after the export. Pull the export branch: `git fetch`, `git switch <branch>`, `git pull --ff-only`. Then `git add data_apps/<slug>`, commit and push, and `mb git-sync import` whatever a cached `has-remote-changes` says, or the next export ends in `conflict`. The export writes `data_app.yaml` and `dist/index.js`, the bundle you uploaded; never edit those two, and leave them out of your commits unless the bundle ships through git (below). The template's `.gitignore` keeps `node_modules/`, `build/` and `.env.local` out. A bundle can instead ship through git, from CI say: `npm run build:ci` writes `dist/index.js`, and once that is committed and pushed, the next import loads it. On a read-only synced instance only `set-enabled` works: creating, bundling, updating and deleting an app answer 403, and so does editing its collection; change it where it was built and export again.
|
|
137
|
+
- **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: in a synced repository, the next export removes the app's `data_app.yaml`, bundle and collection files; after that export, switch and pull the same way, delete the source in `data_apps/<slug>/` in a commit of your own, push, and import.
|
|
@@ -7,7 +7,7 @@ and the `mb` data-app skills.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
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`);
|
|
10
|
+
`<major>` is 66 for a version tag v1.66.x (`mb auth status --profile <name> --json | jq -r .version.tag`);
|
|
11
11
|
`package.json` asks for any version, which would install `latest`.
|
|
12
12
|
|
|
13
13
|
```bash
|
|
@@ -20,10 +20,14 @@ npm install
|
|
|
20
20
|
```bash
|
|
21
21
|
npm run dev # preview at http://localhost:5174, in the sandbox Metabase runs apps in
|
|
22
22
|
npm run typecheck # type-checks src/ and vite.config.ts
|
|
23
|
-
npm run build # builds
|
|
23
|
+
npm run build # builds build/index.js
|
|
24
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
|
|
25
|
+
mb data-app set-bundle <slug> # makes build/index.js the app's bundle
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
To ship the bundle through git instead, for example from CI, run
|
|
29
|
+
`npm run build:ci` and commit `dist/index.js`, the file the app's
|
|
30
|
+
`data_app.yaml` names; the next git-sync import loads it.
|
|
31
|
+
|
|
28
32
|
`npm run dev` reads `DATA_APP_MB_URL` and `DATA_APP_MB_API_KEY` from
|
|
29
33
|
`.env.local`; `.env.local.example` lists them.
|
|
@@ -13,6 +13,8 @@ An **action** is a saved, parameterized SQL write — `INSERT`, `UPDATE` or `DEL
|
|
|
13
13
|
2. Regenerate `src/metabase.ts` (`data-app-data`).
|
|
14
14
|
3. Pass `actions.<name>` from it to `useAction`.
|
|
15
15
|
|
|
16
|
+
An action in the app's collection can't be archived: to drop one, move it to a data actions collection (`mb data-action update <id> --body '{"collection_id":<id>}'`), then archive it.
|
|
17
|
+
|
|
16
18
|
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
19
|
|
|
18
20
|
## The hook
|
|
@@ -83,6 +85,7 @@ export function NoteForm({ orderId, onSaved }: { orderId: number; onSaved: () =>
|
|
|
83
85
|
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
86
|
|
|
85
87
|
- 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.
|
|
88
|
+
- A `StaticQuestion` panel has no `refetch`: give it a `key` the parent bumps after the write, which remounts it and runs the question again.
|
|
86
89
|
- Await the refresh before clearing the form or closing the modal, so stale rows never flash.
|
|
87
90
|
- Never prepend `result` to a local list instead: ids, timestamps and computed columns come from the server.
|
|
88
91
|
|
|
@@ -15,11 +15,11 @@ A data app runs only the questions and actions in **the app's collection** (`dat
|
|
|
15
15
|
|
|
16
16
|
## Sources: the semantic layer only
|
|
17
17
|
|
|
18
|
-
An app reads only what the user curated in the Library.
|
|
18
|
+
An app reads only what the user curated in the Library. Metabase refuses a question in the app's collection that breaks these rules:
|
|
19
19
|
|
|
20
|
-
- **Tables published to the Library**, and nothing else: `mb table list --published-only --json`. That covers the question's source table, every join,
|
|
21
|
-
- **Metrics in the Library's Metrics collection
|
|
22
|
-
- **
|
|
20
|
+
- **Tables published to the Library**, and nothing else: `mb table list --published-only --json`. That covers the question's source table, every join, every table reached through a foreign key column, the tables behind its segments and measures, and the tables whose columns Metabase shows in place of a foreign key.
|
|
21
|
+
- **Metrics in the Library's Metrics collection**, as aggregations (its id is in `mb library get`; list it with `mb collection items <id> --json`), and the segments and measures of published tables (`mb segment list`, `mb measure list`). Prefer one that matches the concept over rebuilding it with filters and thresholds of your own.
|
|
22
|
+
- **No other question as a source** — not a question in the app's collection, a model or a metric. Every question starts from a published table.
|
|
23
23
|
- **MBQL only**, never native SQL.
|
|
24
24
|
|
|
25
25
|
When the app needs a table or metric the Library lacks, stop: name what's missing and ask the user to publish the table or move the metric into the Library. Don't publish it yourself unless the user says to, and never work around the gap with an unpublished table, a copy of the data, or SQL.
|
|
@@ -44,7 +44,7 @@ mb card query <id> --json --max-bytes 0 | jq '{row_count, first: .data.rows[0]}'
|
|
|
44
44
|
Plan the questions from what the app shows and picks from — each chart, KPI, table and filter option list needs one, and several panels may share one. Each takes one of two shapes:
|
|
45
45
|
|
|
46
46
|
- **Aggregated**, when the breakdown is fixed: revenue by month, top products. Runtime clauses can then name only the columns it returns, its breakouts and aggregations.
|
|
47
|
-
- **Rows**, when a runtime filter targets a column an aggregation would drop — revenue by month, filtered by product category. The question returns the raw columns (`CREATED_AT`, `TOTAL`, `CATEGORY`), and the hook filters and aggregates them at runtime (_Runtime clauses_).
|
|
47
|
+
- **Rows**, when a runtime filter targets a column an aggregation would drop — revenue by month, filtered by product category. The question returns the raw columns (`CREATED_AT`, `TOTAL`, `CATEGORY`), and the hook filters and aggregates them at runtime (_Runtime clauses_). When a Library metric or measure defines the number, never rebuild it from rows: filter an aggregated question instead (_Runtime clauses_).
|
|
48
48
|
|
|
49
49
|
Also:
|
|
50
50
|
|
|
@@ -150,7 +150,7 @@ const { query } = useMetabaseQueryObject(queries.orderRows, {
|
|
|
150
150
|
- `filter(...)` takes one value: `filter(col, "=", [a, b])` compiles but is not an IN filter, and several filters AND together. So a filter picks one value or All; for a multi-select, ask the user whether a single choice will do.
|
|
151
151
|
- Text operators are case-sensitive, with no option to change it: say so in the search box's placeholder.
|
|
152
152
|
- `time-interval` (`[-30, "day"]`, `[0, "year"]` for this year) is relative to when the query runs: a fixed window belongs in the question, not the hook.
|
|
153
|
-
- On a rows question, aggregate with any of `aggregations.count`, `sum`, `avg`, `median`, `min`, `max`, `distinct`, naming each result (`{ name: "revenue" }`) to order or read it by — two unnamed results of one operator collide, and generated names such as `sum_2` aren't stable.
|
|
153
|
+
- On a rows question, aggregate with any of `aggregations.count`, `sum`, `avg`, `median`, `min`, `max`, `distinct`, naming each result (`{ name: "revenue" }`) to order or read it by — two unnamed results of one operator collide, and generated names such as `sum_2` aren't stable. Never aggregate an aggregated question at runtime: a sum over its rows is wrong for distinct counts, averages, ratios and levels such as MRR. A runtime filter only picks its rows. So a date filter on it offers presets of whole, complete buckets at the question's own grain (Last month, Last 12 months on a month question), each range from the first bucket's start to the last bucket's start, and no Custom range; a KPI shows one bucket, as `scalar` (a `smartscalar` filtered to one bucket loses its comparison), with no All time. A filter on a column needs a question broken out by that column too; its All is no clause when the panel shows that column (a series per value), and otherwise a second question without that breakout, both hooks called and switched with `enabled`. When a request needs more, say so.
|
|
154
154
|
- A sort the user picks: map each choice to a column explicitly (`{ revenue: "revenue", orders: "order_count" }`) rather than passing the user's value through.
|
|
155
155
|
- `enabled: false` holds the query back, for example until the user picks an item.
|
|
156
156
|
- Write the arrays inline (spreads are fine): the hooks compare by content, so a new array per render doesn't refetch. A clauses object built outside the call needs `as const`, or `aggregations` loses the tuple type `breakouts` need; a shared `ReturnType<typeof filter>[]` built with `push` breaks the operator types the same way.
|
|
@@ -19,12 +19,13 @@ Before any control, write one row per filter: the question that gives its option
|
|
|
19
19
|
| Plan | orders broken out by plan | plan text | orders | revenue, stock |
|
|
20
20
|
|
|
21
21
|
- A filter in the page's global bar changes every panel that can take it. One that can't reach a panel is scoped to its section, visibly, or left out. A KPI and its detail table about the same thing take the same filters, unless the UI says why not.
|
|
22
|
+
- A KPI on an aggregated question shows one complete bucket (`data-app-data`, _Runtime clauses_): it gets its own control of one-bucket presets starting at the last complete bucket, never All time, rather than a shared bar's ranges.
|
|
22
23
|
- One date control per scope. Never a global date range beside a page-specific date where one of the two does nothing; a page whose cards use another date column gets one control for that column.
|
|
23
24
|
- Build each panel's clauses from its own question's columns, inline at its hook call. Never reuse an array built for another question.
|
|
24
25
|
|
|
25
26
|
## Values and options
|
|
26
27
|
|
|
27
|
-
- Every filter starts at **All
|
|
28
|
+
- Every filter starts at **All**, except a KPI's own date control (above). Keep it as `"all"` in state and send it as no clause (`[]`), except on an aggregated question whose panel doesn't show the filtered column, where All is its own question (`data-app-data`, _Runtime clauses_); treat `""`, `null` and `undefined` the same way. In a Yes/No/All filter, Yes and No each filter (`true`, `false`), and only All sends nothing.
|
|
28
29
|
- Options come at runtime from their own question in the app's collection, broken out on the filtered column — never hardcoded unless the user gave a closed list. Dedupe them from its rows, and keep the label apart from the value.
|
|
29
30
|
- Filter by a stable raw value (an id) and show its label; never filter by a display label when an id exists, and never feed free text into an exact-id filter.
|
|
30
31
|
- All stays selectable while options load, come back empty or fail; don't disable the control. When fresh options no longer hold the selected value, reset to All:
|
|
@@ -48,7 +49,7 @@ Any list whose options come from a question — an id shown as a name, a categor
|
|
|
48
49
|
|
|
49
50
|
## Date ranges
|
|
50
51
|
|
|
51
|
-
A preset bar lists the durations, then All time, then Custom last — leave Custom out only if the user asked for fixed presets. Every option ends in the same `[start, end]` range (All time is `[null, null]`), so one `between` filter serves them all. Custom is `DateRangePopover` around your own trigger, or `DateRangeCalendar` inline, both from `@metabase/embedding-sdk-react/data-app`. No date-picker library and no `<input type="date">` for a range.
|
|
52
|
+
A preset bar lists the durations, then All time, then Custom last — leave Custom out only if the user asked for fixed presets, or the bar filters an aggregated question, which offers only whole, complete buckets and no All time on a KPI (`data-app-data`, _Runtime clauses_). Every option ends in the same `[start, end]` range (All time is `[null, null]`), so one `between` filter serves them all. Custom is `DateRangePopover` around your own trigger, or `DateRangeCalendar` inline, both from `@metabase/embedding-sdk-react/data-app`. No date-picker library and no `<input type="date">` for a range.
|
|
52
53
|
|
|
53
54
|
```tsx
|
|
54
55
|
import { DateRangePopover, filter, useDateFormatter } from "@metabase/embedding-sdk-react/data-app";
|
|
@@ -68,7 +69,7 @@ const [start, end] = range;
|
|
|
68
69
|
- Label it with `formatDateRange(range)` (or `formatDate` for one end), which formats in the instance's locale; both take a dayjs `format`, and `formatDateRange` a `separator`. It returns `""` until the SDK loads. Never `new Date("YYYY-MM-DD")`: a date-only string parses as UTC and shows the previous day west of Greenwich.
|
|
69
70
|
- The popover closes once both ends are picked (`closeOnSelect`); `opened` and `onOpenedChange` control it yourself. Also `defaultValue`, `minDate` and `maxDate` (`YYYY-MM-DD`), `numberOfColumns` (default 2) and `position` (default `bottom-start`). `DateRangeCalendar` takes the same value props plus `className` and `style`.
|
|
70
71
|
|
|
71
|
-
A preset's range, from local dates — never `toISOString()`, which shifts the day:
|
|
72
|
+
A preset's range, from local dates — never `toISOString()`, which shifts the day. `lastMonths` is a rolling window, for a rows question; on a month question, `lastCompleteMonths` gives bucket starts:
|
|
72
73
|
|
|
73
74
|
```ts
|
|
74
75
|
const ymd = (d: Date) =>
|
|
@@ -78,10 +79,17 @@ const lastMonths = (n: number): [string, string] => {
|
|
|
78
79
|
const start = new Date(end.getFullYear(), end.getMonth() - n, end.getDate());
|
|
79
80
|
return [ymd(start), ymd(end)];
|
|
80
81
|
};
|
|
82
|
+
const lastCompleteMonths = (n: number): [string, string] => {
|
|
83
|
+
const now = new Date();
|
|
84
|
+
return [
|
|
85
|
+
ymd(new Date(now.getFullYear(), now.getMonth() - n, 1)),
|
|
86
|
+
ymd(new Date(now.getFullYear(), now.getMonth() - 1, 1)),
|
|
87
|
+
];
|
|
88
|
+
};
|
|
81
89
|
```
|
|
82
90
|
|
|
83
91
|
**A single date or a date-time** is the one case for a library: `npm install react-datepicker`, import `react-datepicker/dist/react-datepicker.css`, type the callback (`(date: Date | null) => …`), and convert with `ymd` above. Pass `null`, never `new Date("")`, for an empty value.
|
|
84
92
|
|
|
85
93
|
## Check
|
|
86
94
|
|
|
87
|
-
For every visible filter: All runs the unfiltered question; its options come from a question; each option changes every panel the contract says it reaches, and no other; a preset bar ends with Custom; and no scope has two date controls. Search the filter controls for `<select` and `type="date"` — an action form keeps its date inputs. Then build and publish (`data-app`, _Build and publish_).
|
|
95
|
+
For every visible filter except a KPI's own date control: All runs the unfiltered question, or its All question; its options come from a question; each option changes every panel the contract says it reaches, and no other; a preset bar ends with Custom unless it filters an aggregated question; and no scope has two date controls. Search the filter controls for `<select` and `type="date"` — an action form keeps its date inputs. Then build and publish (`data-app`, _Build and publish_).
|
|
@@ -35,7 +35,7 @@ Everything here runs inside the sandbox, the same in the dev preview as in Metab
|
|
|
35
35
|
| `navigator.geolocation` and other device APIs | Nothing. |
|
|
36
36
|
| Key, input, composition and clipboard listeners (`keydown`, `paste`, `input`, …) on `window` or `document` | A React handler (`onKeyDown`, `onPaste`, …) on your own element. |
|
|
37
37
|
|
|
38
|
-
**External APIs.** A raw `fetch` reaches only the origins in the app's `allowed_hosts`, exact or with a `*.` subdomain wildcard: `mb data-app update <slug> --body '{"allowed_hosts":["https://api.example.com"]}'
|
|
38
|
+
**External APIs.** A raw `fetch` reaches only the origins in the app's `allowed_hosts`, exact or with a `*.` subdomain wildcard: `mb data-app update <slug> --body '{"allowed_hosts":["https://api.example.com"]}'`. The preview reads the `allowed_hosts:` list in `data_app.yaml` beside `package.json`: in a synced repository that file is the app's exported manifest, so export again and pull the export branch (`data-app`, _Move to another instance_) to refresh it rather than writing it; without one, write the list there yourself. Then restart `npm run dev`. Never list the Metabase URL. In Metabase the same list governs `<iframe src>` and native `<form action>` submits, and the target must allow framing; the preview blocks both. Use `<form onSubmit>` with `preventDefault`: a native submit navigates the app away.
|
|
39
39
|
|
|
40
40
|
## Layout
|
|
41
41
|
|
|
@@ -69,12 +69,12 @@ export function AppError({ message }: SdkErrorComponentProps) {
|
|
|
69
69
|
|
|
70
70
|
## SDK components
|
|
71
71
|
|
|
72
|
-
| Import
|
|
73
|
-
|
|
|
74
|
-
| `StaticQuestion`
|
|
75
|
-
| `InteractiveQuestion`
|
|
76
|
-
|
|
77
|
-
|
|
72
|
+
| Import | For |
|
|
73
|
+
| --------------------- | --------------------------------------------------------------------------------------- |
|
|
74
|
+
| `StaticQuestion` | A chart, KPI or table without drill-through — the default. |
|
|
75
|
+
| `InteractiveQuestion` | One meant to be explored: drill-through, chart switching; pass `isSaveEnabled={false}`. |
|
|
76
|
+
|
|
77
|
+
Both take a question in the app's collection. Dashboards and the authoring components (`CreateQuestion`, `CreateDashboardModal`, saving from the editor) don't work in an app: its collection can't hold a dashboard, and an app can't save content.
|
|
78
78
|
|
|
79
79
|
## A Metabase chart or your own
|
|
80
80
|
|
|
@@ -82,13 +82,13 @@ Ask "can Metabase draw this at all?", never "which looks closer to the design?"
|
|
|
82
82
|
|
|
83
83
|
- **Yes** — bar, line, area, combo, row, pie, scalar, smartscalar, gauge, progress, funnel, scatter, waterfall, boxplot, sankey, pivot, map, tables: render it with `useMetabaseQueryObject` and `StaticQuestion` (`data-app-data`). It keeps the instance's formatting, tooltips, theming and drill-through. Styling is never a reason to draw it yourself.
|
|
84
84
|
- **No**, or the user asked for a custom one — scorecards, timelines, calendar grids, one visual from several queries: draw it from `useMetabaseQuery` rows, with SVG or a chart library the app already has.
|
|
85
|
-
- A KPI is `scalar`, `smartscalar`, `gauge` or `progress
|
|
85
|
+
- A KPI is `scalar`, `smartscalar`, `gauge` or `progress` — on a question filtered at runtime to one bucket, `scalar` (a `smartscalar` loses its comparison); put what Metabase doesn't draw (a caption, stars) beside it.
|
|
86
86
|
- `InteractiveQuestion`: pass `isSaveEnabled={false}`, and `title={false}` in a panel with its own heading. Children replace its layout: `<InteractiveQuestion card={card}><InteractiveQuestion.QuestionVisualization height={360} /></InteractiveQuestion>` is the chart alone.
|
|
87
87
|
|
|
88
|
-
**Visualization settings.** Add `visualizationSettings` only for a change the user asked for. Their keys are a question's `visualization_settings` keys — the `visualization` skill lists them — and the installed types decide what's legal: `rg -n "<key>|declare type .*VisualizationSettings" node_modules/@metabase/embedding-sdk-react/dist/index.d.ts`, never the whole file, never from memory. Keep them few: keys such as `graph.dimensions`, `pie.metric` and `column_settings` name result columns and break when the question changes.
|
|
88
|
+
**Visualization settings.** Add `visualizationSettings` only for a change the user asked for, or `scalar.field` on a KPI whose first column isn't the number. Their keys are a question's `visualization_settings` keys — the `visualization` skill lists them — and the installed types decide what's legal: `rg -n "<key>|declare type .*VisualizationSettings" node_modules/@metabase/embedding-sdk-react/dist/index.d.ts`, never the whole file, never from memory. Keep them few: keys such as `graph.dimensions`, `pie.metric` and `column_settings` name result columns and break when the question changes.
|
|
89
89
|
|
|
90
90
|
- A `table` with two breakouts and one aggregation renders as a pivot when a breakout has at most 16 values; `{ "table.pivot": false }` keeps one row per group.
|
|
91
|
-
- A scalar shows the first column: with a key column first, point it at the number with `{ "scalar.field": "avg_rating" }`.
|
|
91
|
+
- A scalar shows the first column: with a key or breakout column first (a date on a month question), point it at the number with `{ "scalar.field": "avg_rating" }`.
|
|
92
92
|
- A header: `column_settings: { '["name","approvers"]': { column_title: "Approvers" } }`.
|
|
93
93
|
|
|
94
94
|
## Pages
|
|
@@ -117,4 +117,4 @@ Metabase mirrors each route to `/apps/<slug>/<path>`, and a reload there opens t
|
|
|
117
117
|
|
|
118
118
|
## Before handoff
|
|
119
119
|
|
|
120
|
-
`npm run dev` only transpiles: run `npm run typecheck` after every round of edits and fix what it reports, and report the result, errors grouped by cause. Search the changed files and fix what turns up: `card={{` (every `card` comes from `useMemo`), `row[0]` and `as unknown as` (rows are keyed by column name), `<select` for a list from a question (`data-app-filters`), `type="date"` and `new Date(` in a date filter, `* 100` and `%`. Read the diagnostics feed with every panel mounted, then build and publish (`data-app`, _Build and publish_).
|
|
120
|
+
`npm run dev` only transpiles: run `npm run typecheck` after every round of edits and fix what it reports, and report the result, errors grouped by cause. Search the changed files and fix what turns up: `card={{` (every `card` comes from `useMemo`), `row[0]` and `as unknown as` (rows are keyed by column name), `<select` for a list from a question (`data-app-filters`), `type="date"` and `new Date("` (a date string parsed as UTC) in a date filter, `* 100` and `%`. Read the diagnostics feed with every panel mounted, then build and publish (`data-app`, _Build and publish_).
|
|
@@ -49,7 +49,7 @@ Two things never bend in any mode: when genuinely unsure, **ask** (the Shared Co
|
|
|
49
49
|
- "Let me filter to just the active ones" → a **segment** (saved filter).
|
|
50
50
|
- "Let me add up revenue the same way everywhere, on this table" → a **measure** on the table.
|
|
51
51
|
- "Revenue is an _official company number_ people pull onto dashboards" → a **metric** in a collection, with a default month-by-month view so it charts cleanly. Lean: make it a metric when it's a headline figure the org reuses across many questions/dashboards; keep it a measure when it's a table-local convenience.
|
|
52
|
-
- **Where the metric lives.** Metrics sit in a collection (folder). Lean: put the org's blessed ones in the
|
|
52
|
+
- **Where the metric lives.** Metrics sit in a collection (folder). Lean: put the org's blessed ones in the Library's **Metrics** collection so they surface prominently; keep experimental ones in a working collection until trusted.
|
|
53
53
|
<!-- requires: library -->
|
|
54
54
|
- **Publish the official tables to the Library.** The clean, analysis-ready tables your definitions sit on are the org's official starting points — the **Library** is how you mark them as such. Tables published to the Library's **Data** section appear _first_ when anyone picks a data source, nudging people toward your curated tables instead of raw warehouse ones. Lean: publish the wide clean tables you built the semantic layer on; hold back raw or half-built ones. Surface which tables you'd publish and confirm. (Only admins and data analysts can publish — mechanics in `core`.)
|
|
55
55
|
<!-- /requires -->
|
|
@@ -102,7 +102,7 @@ Build each agreed definition. The verb mechanics (create/update flags, the `revi
|
|
|
102
102
|
|
|
103
103
|
- **Segment** → `mb segment create`. A flat MBQL filter clause on a table.
|
|
104
104
|
- **Measure** → `mb measure create`. **Exactly one** aggregation on a table.
|
|
105
|
-
- **Metric** → `mb card create` with the metric shape (`type: "metric"`) — it lives in a **collection**, carries the aggregation plus an optional default time dimension. Put org-blessed ones in the Library collection.
|
|
105
|
+
- **Metric** → `mb card create` with the metric shape (`type: "metric"`) — it lives in a **collection**, carries the aggregation plus an optional default time dimension. Put org-blessed ones in the Library's **Metrics** collection (id from `mb library get`).
|
|
106
106
|
<!-- requires: library -->
|
|
107
107
|
- **Publish the official tables** → `mb library create` then `mb library publish` (mechanics in `core`) to move the clean tables your definitions sit on into the Library's **Data** section, so people start from your curated set, not raw warehouse tables.
|
|
108
108
|
<!-- /requires -->
|