@metabase/cli 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1902
- package/dist/add-collection-B3Ty8SzB.mjs +36 -0
- package/dist/alert-DT-ee7yf.mjs +23 -0
- package/dist/{alerts-CRGMX4eB.mjs → alerts-Bf2RH_p_.mjs} +11 -17
- package/dist/{append-lL0IaI6U.mjs → append-DFzQRPMd.mjs} +7 -12
- package/dist/{archive-DihHU042.mjs → archive-4tmm946K.mjs} +8 -17
- package/dist/{archive-C9mJGN6J.mjs → archive-B6eXiyER.mjs} +7 -13
- package/dist/{archive-D3DErepm.mjs → archive-BxNPHxOY.mjs} +7 -13
- package/dist/{archive-DyPsHSFb.mjs → archive-ByvA49Kz.mjs} +8 -13
- package/dist/{archive-ExcEma7q.mjs → archive-C7w49Grr.mjs} +7 -16
- package/dist/{archive-Baz4OVDd.mjs → archive-Cd29QC0c.mjs} +7 -13
- package/dist/{archive-CUGRnyRV.mjs → archive-ChORH5JH.mjs} +7 -13
- package/dist/{archive-hKPQXgXa.mjs → archive-CwAdlv63.mjs} +7 -12
- package/dist/{archive-D8YrImIU.mjs → archive-Dr9Xnx_Z.mjs} +7 -15
- package/dist/{archive-BUFc1me2.mjs → archive-gid9Y09v.mjs} +8 -17
- package/dist/{archive-3rLXY0nS.mjs → archive-lQqs13Uz.mjs} +7 -13
- package/dist/auth-Dltxua89.mjs +19 -0
- package/dist/{body-DXJ2v3GY.mjs → body-Cur4NJt9.mjs} +5 -8
- package/dist/{body-flags-Cbv-Ba6W.mjs → body-flags-AqKpN01Y.mjs} +1 -2
- package/dist/{branches-ByCzTuiv.mjs → branches-DchlyU0i.mjs} +7 -13
- package/dist/{cancel-DvehNbDD.mjs → cancel-BMQa5R1Z.mjs} +5 -12
- package/dist/{cancel-task-BM8ADd3Y.mjs → cancel-task-C5CU1pxU.mjs} +6 -10
- package/dist/card-CHI2bmds.mjs +24 -0
- package/dist/{card-BFRRyTGs.mjs → card-DZxRmver.mjs} +21 -48
- package/dist/card-zyUkr2nS.mjs +44 -0
- package/dist/cards-SccWvRQD.mjs +34 -0
- package/dist/cli.mjs +664 -85
- package/dist/client-BqhzKdLM.mjs +2194 -0
- package/dist/collection-CGoVLvcD.mjs +58 -0
- package/dist/collection-CY0AB99E.mjs +20 -0
- package/dist/{collection-BrrjbPLN.mjs → collection-CfulNRBG.mjs} +16 -61
- package/dist/{collection-namespace-8i_CvWsg.mjs → collection-namespace-GwydWBF3.mjs} +3 -5
- package/dist/{create-D6bXJlBS.mjs → create-BNQ_DytP.mjs} +8 -15
- package/dist/{create-CtIOvInN.mjs → create-BOLwWt8Q.mjs} +9 -17
- package/dist/{create--_4GZUNY.mjs → create-Beh-2uoN.mjs} +8 -16
- package/dist/{create-BnNRvoyz.mjs → create-C79vErX0.mjs} +9 -20
- package/dist/{create-D57tRDrg.mjs → create-CAQV2g6V.mjs} +9 -17
- package/dist/{create-CHK9cJcK.mjs → create-CAWytBE5.mjs} +9 -17
- package/dist/{create-BynNiG1N.mjs → create-CCh_LyW9.mjs} +8 -15
- package/dist/{create-Cy57naL0.mjs → create-CD008jdE.mjs} +13 -28
- package/dist/{create-DOpa2TmH.mjs → create-CHQx7jq4.mjs} +9 -17
- package/dist/{create-COI80Veo.mjs → create-DF4QtgDL.mjs} +8 -16
- package/dist/{create-yK1-fuX5.mjs → create-DJmXXQoq.mjs} +10 -18
- package/dist/{create-1O1UiTVt.mjs → create-DV-Ln5Mo.mjs} +8 -15
- package/dist/create-branch-CYo6jZth.mjs +35 -0
- package/dist/{create-t7z8Eb4T.mjs → create-i14Wv3Tj.mjs} +8 -15
- package/dist/{create-qzjhJFP8.mjs → create-tQbnuz-I.mjs} +8 -15
- package/dist/{create-DAj8pyfQ.mjs → create-zeveFdnd.mjs} +6 -11
- package/dist/{cron-93wjhtrP.mjs → cron-LKRffEC-.mjs} +2 -4
- package/dist/{csv-yoFA1hhv.mjs → csv-B2Jgb1GM.mjs} +7 -19
- package/dist/{current-task-D8Q1uFmk.mjs → current-task-MpBFGttd.mjs} +7 -12
- package/dist/{dashboard-BSCXTX4H.mjs → dashboard-BCpSq_G-.mjs} +9 -60
- package/dist/dashboard-BHJBoaG7.mjs +33 -0
- package/dist/dashboard-CsIFFpzK.mjs +58 -0
- package/dist/database-B19qlLKZ.mjs +38 -0
- package/dist/database-C8G6ZKG0.mjs +26 -0
- package/dist/db-DsfojyeH.mjs +24 -0
- package/dist/{delete-B8dui6O6.mjs → delete-B8e01xAG.mjs} +6 -11
- package/dist/{delete-CA7IjA5J.mjs → delete-BApOjQvl.mjs} +6 -11
- package/dist/{delete-Dcu3iDkg.mjs → delete-Ck0q4Dzp.mjs} +6 -11
- package/dist/{delete-BwPgIWV8.mjs → delete-DFmX7jTp.mjs} +6 -11
- package/dist/{delete-CawUDFud.mjs → delete-Ob06PPie.mjs} +6 -11
- package/dist/{delete-runtime-00-R9iJm.mjs → delete-runtime-D74s6vhu.mjs} +6 -13
- package/dist/{delete-table-DS0b3i0k.mjs → delete-table-DuyhGrvA.mjs} +6 -11
- package/dist/{dependencies-BQVZylqV.mjs → dependencies-Bj3QrGIm.mjs} +10 -13
- package/dist/dirty-DNYoM6Bp.mjs +31 -0
- package/dist/document-BbskZPTT.mjs +19 -0
- package/dist/{document-C7IR6T8c.mjs → document-Cd2mmqCp.mjs} +5 -33
- package/dist/document-D6OybtP2.mjs +29 -0
- package/dist/{eid-DcCAs-RP.mjs → eid-WTZmDdsr.mjs} +12 -54
- package/dist/eid-translation-zEHtr5Oc.mjs +35 -0
- package/dist/{embedding-B0x9CPkU.mjs → embedding-i-KqpefC.mjs} +2 -4
- package/dist/events-Bn7jh5lP.mjs +39 -0
- package/dist/export-BjfoZRDJ.mjs +66 -0
- package/dist/field-BPsNa-TO.mjs +80 -0
- package/dist/{field-RYBTW2KS.mjs → field-Cr2DPUG9.mjs} +2 -81
- package/dist/field-Zau6Hc6X.mjs +18 -0
- package/dist/fields-CBBa-Prp.mjs +34 -0
- package/dist/{get-vGqyjGSW.mjs → get-00lyLv6R.mjs} +7 -11
- package/dist/{get-Cvkt6GcQ.mjs → get-B7sMgsFs.mjs} +7 -11
- package/dist/get-B_xdF1kq.mjs +31 -0
- package/dist/{get-DhS4y0K9.mjs → get-ByBOq30r.mjs} +7 -11
- package/dist/get-Bz99dAxK.mjs +35 -0
- package/dist/get-C2-Q3iQ5.mjs +31 -0
- package/dist/get-CDJFVvhj.mjs +35 -0
- package/dist/get-CDMGbgrh.mjs +31 -0
- package/dist/get-CnbUCzDM.mjs +31 -0
- package/dist/{get-CJYv3CfV.mjs → get-CvI--9S_.mjs} +16 -12
- package/dist/get-DRvsATp-.mjs +31 -0
- package/dist/{get-Db8YNxId.mjs → get-DY03Azx9.mjs} +6 -11
- package/dist/{get-4rA8pbRu.mjs → get-DYO1kywc.mjs} +7 -13
- package/dist/{get-DZRB5S37.mjs → get-D_h-G9bn.mjs} +7 -11
- package/dist/get-DdsoHaKH.mjs +31 -0
- package/dist/{get-DQ0pb4tT.mjs → get-DkWO0EI0.mjs} +7 -11
- package/dist/{get-DXiL39gi.mjs → get-Dmj9Ygz1.mjs} +7 -17
- package/dist/{get-CvXOGyFj.mjs → get-DmpB6J9g.mjs} +7 -12
- package/dist/{get-B2vvnMpl.mjs → get-Dn9ZiSZr.mjs} +8 -16
- package/dist/{get-run-BF5ZBE8o.mjs → get-run-Cnux9ln0.mjs} +7 -11
- package/dist/git-sync-BDnxPrqU.mjs +104 -0
- package/dist/git-sync-DxD_ng48.mjs +136 -0
- package/dist/git-sync-MQQYRYLg.mjs +28 -0
- package/dist/{group-DfTvzGz-.mjs → group-DBM87IgC.mjs} +2 -4
- package/dist/has-remote-changes-C684Redh.mjs +35 -0
- package/dist/import-Rmmttboo.mjs +56 -0
- package/dist/{input-BpXlmJ5J.mjs → input-DH9i67x_.mjs} +6 -11
- package/dist/{is-dirty-4kIyD4oP.mjs → is-dirty-DYeJYhBz.mjs} +4 -8
- package/dist/{items-BXH0f1r6.mjs → items-CQlPXBXE.mjs} +13 -29
- package/dist/key-BEhqIzIQ.mjs +10 -0
- package/dist/{library-BFZYsBcz.mjs → library-Bsm5KsFF.mjs} +6 -9
- package/dist/library-ClLgrAXy.mjs +19 -0
- package/dist/library-DfYAT2Ep.mjs +21 -0
- package/dist/{list-By1yYVGq.mjs → list-B4hJuMhA.mjs} +11 -27
- package/dist/{list-oRyXsJXs.mjs → list-B8nAGwP4.mjs} +10 -12
- package/dist/list-BOET6zhP.mjs +36 -0
- package/dist/list-BP3MPq-M.mjs +36 -0
- package/dist/list-BpFp9Wre.mjs +28 -0
- package/dist/list-BtkWNtvY.mjs +34 -0
- package/dist/list-BtmsNOEn.mjs +28 -0
- package/dist/list-BzVTHOoH.mjs +28 -0
- package/dist/list-C5Zs8nrb.mjs +28 -0
- package/dist/list-CKK-s3Ty.mjs +28 -0
- package/dist/{list-SiSfX4wl.mjs → list-CMpoc2TN.mjs} +10 -13
- package/dist/list-CNUiF8Z7.mjs +28 -0
- package/dist/list-CQDprvW0.mjs +39 -0
- package/dist/{list-w61Uovt2.mjs → list-CQwOgIlj.mjs} +10 -24
- package/dist/list-DE9FM957.mjs +28 -0
- package/dist/{list-CG3ec9BZ.mjs → list-DF2rvoO1.mjs} +22 -14
- package/dist/list-DMKDsBRd.mjs +38 -0
- package/dist/{list-Bar8uQRC.mjs → list-UhpKG6_m.mjs} +15 -15
- package/dist/{login-zUCMDLC8.mjs → login-CGHeSjlP.mjs} +47 -52
- package/dist/{logout-BFh7QHx6.mjs → logout-DAxOlbv4.mjs} +7 -12
- package/dist/measure-4P0bOlZ3.mjs +29 -0
- package/dist/measure-BsYv0p26.mjs +22 -0
- package/dist/{measure-DH3ow2ko.mjs → measure-CtfjqJFP.mjs} +3 -30
- package/dist/network-error-CEb9ymDW.mjs +423 -0
- package/dist/{notification-BR5wehqg.mjs → notification-DaA4bBHW.mjs} +3 -66
- package/dist/notification-Fcq1fIPw.mjs +67 -0
- package/dist/{parameter-hCQ80jnc.mjs → parameter-DUKR8NXo.mjs} +2 -11
- package/dist/{parameter-values-BYDFzxNY.mjs → parameter-values-CJTdqd8c.mjs} +17 -11
- package/dist/{parse-enum-D1zTYr_i.mjs → parse-enum-D0Jfm_Bz.mjs} +2 -4
- package/dist/{parse-id-waEVK-uR.mjs → parse-id-C_jmKFaa.mjs} +2 -4
- package/dist/{parse-ref-C3DUXwci.mjs → parse-ref-ibKVB0J4.mjs} +3 -5
- package/dist/{path-Bvs9IR4k.mjs → path-B5gHvrYL.mjs} +8 -9
- package/dist/{poll-rqLkEJVP.mjs → poll-75SvT7Zv.mjs} +11 -15
- package/dist/predicates-Bkm2IoeX.mjs +170 -0
- package/dist/preflight-YpPQo-sa.mjs +29 -0
- package/dist/{process-BxAUv3Wx.mjs → process-DBOOrmET.mjs} +4 -6
- package/dist/{publish-C1y_vGGw.mjs → publish-DijrxaCW.mjs} +29 -24
- package/dist/{pulse-C8q469KD.mjs → pulse-BmsDenXm.mjs} +3 -56
- package/dist/pulse-DhG6I9mI.mjs +57 -0
- package/dist/{query-B9LlGOZI.mjs → query-BbqECzmF.mjs} +20 -44
- package/dist/{query-DpVWKW-y.mjs → query-Dc__-KJH.mjs} +13 -24
- package/dist/{query-result-Bvh89K4f.mjs → query-result-DBDwk8TS.mjs} +4 -8
- package/dist/remove-collection-BOnxYvhj.mjs +36 -0
- package/dist/{render-rgZBe3rO.mjs → render-CI93iP0I.mjs} +9 -11
- package/dist/{replace-sHtPBNnA.mjs → replace-Cq4CxVa-.mjs} +7 -12
- package/dist/rescan-values-Dr_j416g.mjs +31 -0
- package/dist/revision-message-flag-8TCHYJV6.mjs +8 -0
- package/dist/run-C3DkS6NP.mjs +82 -0
- package/dist/{run-Ce_gPVcg.mjs → run-DdGJ544X.mjs} +8 -18
- package/dist/runs-CUNWiidL.mjs +38 -0
- package/dist/runtime-DiKyBxOw.mjs +1007 -0
- package/dist/{schema-tables-D91DWM5l.mjs → schema-tables-CV386fnC.mjs} +10 -14
- package/dist/{schemas-OVYRgvz9.mjs → schemas-DM-UqZBQ.mjs} +8 -12
- package/dist/search-DFBwUc6d.mjs +44 -0
- package/dist/{search-msFNbxU6.mjs → search-DmGScXs8.mjs} +14 -73
- package/dist/segment-BzUGM2Fr.mjs +22 -0
- package/dist/segment-C_gl5ag6.mjs +29 -0
- package/dist/{segment-cwIOOF0v.mjs → segment-OsrbUDzw.mjs} +3 -30
- package/dist/{selectors-Bsyhe1zP.mjs → selectors-DGDn0Hto.mjs} +4 -6
- package/dist/{send-BeFpVrwD.mjs → send-CVxxEpDB.mjs} +5 -16
- package/dist/{set-jRnCLhvc.mjs → set-DFolTjbd.mjs} +10 -20
- package/dist/{set-active-CFWtIWzX.mjs → set-active-BD8L1lPX.mjs} +7 -18
- package/dist/setting-CwRYgHYN.mjs +35 -0
- package/dist/setting-DTiLCW8g.mjs +22 -0
- package/dist/setting-DyhaeICs.mjs +17 -0
- package/dist/setup-BbDQN8fe.mjs +44 -0
- package/dist/setup-CO7QV-ao.mjs +21 -0
- package/dist/signal-CMd0EFUa.mjs +16 -0
- package/dist/{skills-CxqkjkdQ.mjs → skills--vK6J-e4.mjs} +4 -6
- package/dist/{skills-DlFbbaoS.mjs → skills-DTCrMcix.mjs} +13 -19
- package/dist/{snippet-1xYckIwc.mjs → snippet-CyKAgIZl.mjs} +3 -32
- package/dist/snippet-DRwKb2x7.mjs +19 -0
- package/dist/snippet-oJLaYW9V.mjs +29 -0
- package/dist/stash-D0S4JmAz.mjs +61 -0
- package/dist/{status-DCIOvsc6.mjs → status-BhswxJL1.mjs} +23 -23
- package/dist/{status-BMEdl-_G.mjs → status-hL1am-HV.mjs} +6 -8
- package/dist/{subscription-BOOBR5Ir.mjs → subscription-_d5fB45F.mjs} +7 -10
- package/dist/{subscriptions-C_1AQpZF.mjs → subscriptions-s4TF6Ax3.mjs} +11 -16
- package/dist/{summary-D1fKnwE3.mjs → summary-BytbDz6e.mjs} +1 -2
- package/dist/summary-CsPvcUwW.mjs +31 -0
- package/dist/sync-schema-DaZ_MV-u.mjs +35 -0
- package/dist/sync-task-BACcrs0i.mjs +37 -0
- package/dist/{table-fDvuvqoU.mjs → table-CeeTJgQb.mjs} +4 -38
- package/dist/table-CsIJNPFf.mjs +37 -0
- package/dist/table-DYoC1kPn.mjs +18 -0
- package/dist/{timeline-BNwnJ3g9.mjs → timeline-CCSU2qOS.mjs} +2 -66
- package/dist/timeline-event-CNQdCTDg.mjs +19 -0
- package/dist/timeline-uDCmwGFT.mjs +66 -0
- package/dist/timeline-xlDbEKWg.mjs +21 -0
- package/dist/transform-Bs0EWijQ.mjs +28 -0
- package/dist/{transform-BkSkCvpx.mjs → transform-D3QX0jxA.mjs} +28 -74
- package/dist/transform-DoTyyXAu.mjs +74 -0
- package/dist/transform-job-50GZHhKH.mjs +37 -0
- package/dist/transform-job-BcLChRup.mjs +22 -0
- package/dist/{transform-job-sJmW_En3.mjs → transform-job-DRrK28IH.mjs} +11 -38
- package/dist/{transform-tag-qTjNVfTW.mjs → transform-tag-CcElGp3C.mjs} +2 -21
- package/dist/transform-tag-Dmb4u3-Q.mjs +21 -0
- package/dist/transform-tag-_tgwlsdB.mjs +18 -0
- package/dist/{transforms-Cosz-Vq3.mjs → transforms-oU4zizbO.mjs} +10 -13
- package/dist/{tree-BkXtw0c4.mjs → tree-CH-f3bjP.mjs} +6 -10
- package/dist/{unpublish-BlGj7omM.mjs → unpublish-BUl9RU5C.mjs} +7 -18
- package/dist/{update-DpIzJ8Ts.mjs → update-BCS5FxKr.mjs} +11 -19
- package/dist/{update-hoCyoR-u.mjs → update-BZPllQoR.mjs} +9 -16
- package/dist/{update-CXlhrcy8.mjs → update-BiFDBcEH.mjs} +9 -16
- package/dist/{update-Cbsgvopz.mjs → update-BzMDeZiU.mjs} +9 -15
- package/dist/{update-CTWsiwme.mjs → update-C4YJQFDS.mjs} +9 -16
- package/dist/{update-CzrbMLZq.mjs → update-CHNSUHK4.mjs} +9 -16
- package/dist/{update-CsYFWkVd.mjs → update-CO4m4wH3.mjs} +10 -21
- package/dist/{update-DDVuyquf.mjs → update-CVPAwJaH.mjs} +10 -18
- package/dist/{update-C9K1QnOo.mjs → update-CmDTljK-.mjs} +9 -17
- package/dist/{update-DrvAdi-O.mjs → update-CvOO8TED.mjs} +9 -17
- package/dist/{update-Tw0kARao.mjs → update-D-NE60AV.mjs} +9 -16
- package/dist/{update-ZJ5T-SBW.mjs → update-Nfi44RrE.mjs} +10 -18
- package/dist/{update-C-ChEcI9.mjs → update-bD_Jh5-s.mjs} +10 -16
- package/dist/{update-CuKHukZ6.mjs → update-cYkvbqK8.mjs} +9 -16
- package/dist/update-dashcard-C3TuYO_k.mjs +50 -0
- package/dist/{update-BHhEtxwC.mjs → update-tX9mKBN_.mjs} +10 -21
- package/dist/{upgrade-D0HiyTxw.mjs → upgrade-DXMV4AyP.mjs} +37 -44
- package/dist/upload-CH632qW6.mjs +46 -0
- package/dist/upload-DAtxBBms.mjs +13 -0
- package/dist/upload-Dey_8rLf.mjs +13 -0
- package/dist/{uuid-D7NcSTj8.mjs → uuid-BJkDWj9p.mjs} +5 -7
- package/dist/validate-BWchyW0V.mjs +1469 -0
- package/dist/{validate-query-Di0VKMF-.mjs → validate-query-DaGYSmpQ.mjs} +4 -5
- package/dist/{values-OBiEVCVH.mjs → values-Dxf1JEoA.mjs} +8 -13
- package/dist/verify-K96rItG5.mjs +89 -0
- package/dist/{wait-B9qNlcTe.mjs → wait-DoMDH226.mjs} +10 -18
- package/dist/{wait-flags-D0FEgH6k.mjs → wait-flags-DWEF9tX4.mjs} +14 -11
- package/dist/window-BkvrP0gB.mjs +64 -0
- package/package.json +5 -35
- package/skill-data/core/SKILL.md +25 -22
- package/skill-data/dashboard/SKILL.md +6 -2
- package/skill-data/document/SKILL.md +2 -2
- package/skill-data/transform/SKILL.md +1 -1
- package/.claude-plugin/marketplace.json +0 -19
- package/dist/add-collection-B-Pf12HY.mjs +0 -60
- package/dist/add-collection-B2PdVMRy.mjs +0 -9
- package/dist/alert-DGcECcDb.mjs +0 -26
- package/dist/auth-B8Yb4ZaN.mjs +0 -22
- package/dist/capabilities-1HTHeDa4.mjs +0 -684
- package/dist/card-BT7ce7uO.mjs +0 -27
- package/dist/cards-Bz6anDNX.mjs +0 -38
- package/dist/cli.d.mts +0 -1
- package/dist/collection-ahFSJT-e.mjs +0 -23
- package/dist/command-augment-D9pI9Vbh.mjs +0 -11
- package/dist/create-branch-BwqFHYcZ.mjs +0 -57
- package/dist/dashboard-C__PiWrv.mjs +0 -36
- package/dist/database-B-xwx5LA.mjs +0 -61
- package/dist/db-BiLWl1J9.mjs +0 -27
- package/dist/dirty-BqdcrfUz.mjs +0 -35
- package/dist/document-C9ykHYOG.mjs +0 -22
- package/dist/events-C9PqRUCO.mjs +0 -44
- package/dist/export-CdKR5nPT.mjs +0 -103
- package/dist/field-P7aJaet9.mjs +0 -21
- package/dist/fields-D2czTLKq.mjs +0 -37
- package/dist/get-75Vdyusm.mjs +0 -49
- package/dist/get-B6fSPCfp.mjs +0 -35
- package/dist/get-BbKC0fTx.mjs +0 -35
- package/dist/get-BfFKIfpX.mjs +0 -36
- package/dist/get-Bpw05IUm.mjs +0 -38
- package/dist/get-CaIYg15K.mjs +0 -41
- package/dist/get-DXydDRVU.mjs +0 -35
- package/dist/get-Dy5f54pV.mjs +0 -35
- package/dist/git-sync-BzievbUz.mjs +0 -31
- package/dist/has-remote-changes-CjDHphUH.mjs +0 -67
- package/dist/import-DzA5Ty9_.mjs +0 -94
- package/dist/is-dirty-Cv0bdKkX.mjs +0 -8
- package/dist/key-B9AAqwjq.mjs +0 -17
- package/dist/list-AyGEaws8.mjs +0 -8
- package/dist/list-BiAVv9jX.mjs +0 -31
- package/dist/list-Bm1PlZEV.mjs +0 -31
- package/dist/list-BtgjcC2w.mjs +0 -31
- package/dist/list-CLgkOcmY.mjs +0 -39
- package/dist/list-CSnpbFML.mjs +0 -31
- package/dist/list-Cn-VruXD.mjs +0 -8
- package/dist/list-D7mMcRG5.mjs +0 -49
- package/dist/list-DOhVPh95.mjs +0 -39
- package/dist/list-DSHteJOl.mjs +0 -32
- package/dist/list-Dl81pkVs.mjs +0 -53
- package/dist/list-DwMcwucR.mjs +0 -31
- package/dist/list-IxaPXKXu.mjs +0 -31
- package/dist/list-hKRQUcGB.mjs +0 -39
- package/dist/listing-1G8iFfZe.mjs +0 -10
- package/dist/measure-DNldT89z.mjs +0 -25
- package/dist/paginate-DuDXvUPr.mjs +0 -49
- package/dist/patch-BpjI9BOz.mjs +0 -20
- package/dist/patch-DrMVqf34.mjs +0 -36
- package/dist/poll-task-CiB1o1wG.mjs +0 -194
- package/dist/preflight-DJOBTWVq.mjs +0 -90
- package/dist/prompt-DmxSLNrO.mjs +0 -52
- package/dist/remove-collection-DYQibG6d.mjs +0 -42
- package/dist/requests-Pc0u7PQS.mjs +0 -96
- package/dist/rescan-values-CuPGOzKI.mjs +0 -40
- package/dist/resolve-BiL5scF0.mjs +0 -91
- package/dist/revision-message-flag-B4BxzDXJ.mjs +0 -11
- package/dist/run-D6jyZ0nv.mjs +0 -135
- package/dist/runs-DRxrpAkU.mjs +0 -53
- package/dist/runtime-CPIHg_Zg.mjs +0 -1699
- package/dist/segment-BIKVTq_n.mjs +0 -25
- package/dist/setting-CApPg0Xr.mjs +0 -20
- package/dist/setting-CDEoJYO0.mjs +0 -55
- package/dist/setup-CruHFQJz.mjs +0 -71
- package/dist/snippet-DdoeL-7N.mjs +0 -22
- package/dist/stash-CR-ESWiX.mjs +0 -108
- package/dist/summary-WUjzNITU.mjs +0 -40
- package/dist/sync-schema-Cq5LzHHc.mjs +0 -54
- package/dist/sync-scope-Dh1wBlrg.mjs +0 -55
- package/dist/table-BK56VDw8.mjs +0 -21
- package/dist/timeline-Dl5pm5tN.mjs +0 -24
- package/dist/timeline-event-5JAeGVSI.mjs +0 -22
- package/dist/transform-ATK6rJBl.mjs +0 -31
- package/dist/transform-job-BezBE6Y8.mjs +0 -25
- package/dist/transform-tag-GqbcG_6_.mjs +0 -21
- package/dist/update-dashcard-Dnfa8_aJ.mjs +0 -73
- package/dist/upload-WT6SywFa.mjs +0 -16
- package/dist/validate-BoY75_M3.mjs +0 -1496
- package/dist/verify-VEB7TBQ_.mjs +0 -79
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region src/domain/measure.ts
|
|
2
|
+
//#region ../client/src/domain/measure.ts
|
|
4
3
|
const Measure = z.object({
|
|
5
4
|
id: z.number().int(),
|
|
6
5
|
name: z.string(),
|
|
@@ -24,32 +23,7 @@ const MeasureCompact = Measure.pick({
|
|
|
24
23
|
archived: true,
|
|
25
24
|
table_id: true
|
|
26
25
|
}).strip();
|
|
27
|
-
const
|
|
28
|
-
compactPick: MeasureCompact,
|
|
29
|
-
tableColumns: [
|
|
30
|
-
{
|
|
31
|
-
key: "id",
|
|
32
|
-
label: "ID"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
key: "name",
|
|
36
|
-
label: "Name"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
key: "description",
|
|
40
|
-
label: "Description"
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
key: "table_id",
|
|
44
|
-
label: "Table"
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
key: "archived",
|
|
48
|
-
label: "Archived"
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
};
|
|
52
|
-
const MeasureDefinition = z.record(z.string(), z.unknown()).describe("MBQL query holding exactly one aggregation — full MBQL 5 schema: mb query --print-schema");
|
|
26
|
+
const MeasureDefinition = z.record(z.string(), z.unknown()).describe("MBQL query holding exactly one aggregation");
|
|
53
27
|
const MeasureCreateInput = z.object({
|
|
54
28
|
name: z.string().min(1),
|
|
55
29
|
table_id: z.number().int().positive(),
|
|
@@ -63,6 +37,5 @@ const MeasureUpdateInput = z.object({
|
|
|
63
37
|
archived: z.boolean().nullable().optional(),
|
|
64
38
|
description: z.string().nullable().optional()
|
|
65
39
|
}).loose();
|
|
66
|
-
|
|
67
40
|
//#endregion
|
|
68
|
-
export {
|
|
41
|
+
export { MeasureUpdateInput as i, MeasureCompact as n, MeasureCreateInput as r, Measure as t };
|
|
@@ -0,0 +1,423 @@
|
|
|
1
|
+
import { d as ValidationError, f as errorMessage, i as ConfigError, o as MetabaseError, r as ChainedRequestError, s as NetworkError, t as isPlainObject } from "./predicates-Bkm2IoeX.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region ../client/src/json.ts
|
|
4
|
+
const JSON_CONTENT_TYPE = "application/json";
|
|
5
|
+
function parseJson(input, schema, opts = {}) {
|
|
6
|
+
const result = parseJsonResult(input, schema, opts);
|
|
7
|
+
if (!result.ok) throw result.error;
|
|
8
|
+
return result.value;
|
|
9
|
+
}
|
|
10
|
+
function parseJsonResult(input, schema, opts = {}) {
|
|
11
|
+
const sourcePrefix = opts.source === void 0 ? "" : `${opts.source}: `;
|
|
12
|
+
let raw;
|
|
13
|
+
try {
|
|
14
|
+
raw = JSON.parse(input);
|
|
15
|
+
} catch (error) {
|
|
16
|
+
return {
|
|
17
|
+
ok: false,
|
|
18
|
+
error: new ConfigError(`${sourcePrefix}invalid JSON: ${errorMessage(error)}`)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const parsed = schema.safeParse(raw);
|
|
22
|
+
if (!parsed.success) return {
|
|
23
|
+
ok: false,
|
|
24
|
+
error: new ValidationError(`${sourcePrefix}value did not match expected schema`, {
|
|
25
|
+
source: opts.source ?? "<input>",
|
|
26
|
+
zodIssues: parsed.error.issues
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
return {
|
|
30
|
+
ok: true,
|
|
31
|
+
value: parsed.data
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function parseJsonOrPlain(text, contentType, schema, opts = {}) {
|
|
35
|
+
if (!isJsonContentType(contentType)) return parseJson(JSON.stringify(text), schema, opts);
|
|
36
|
+
const attempt = parseJsonResult(text, schema, opts);
|
|
37
|
+
if (attempt.ok) return attempt.value;
|
|
38
|
+
if (attempt.error instanceof ValidationError) throw attempt.error;
|
|
39
|
+
return parseJson(JSON.stringify(text), schema, opts);
|
|
40
|
+
}
|
|
41
|
+
function isJsonContentType(contentType) {
|
|
42
|
+
return contentType !== null && contentType.includes("application/json");
|
|
43
|
+
}
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region ../client/src/auth/credential.ts
|
|
46
|
+
const API_KEY_HEADER = "x-api-key";
|
|
47
|
+
const AUTHORIZATION_HEADER = "authorization";
|
|
48
|
+
const BEARER_PREFIX = "Bearer ";
|
|
49
|
+
const EXPIRY_SKEW_MS = 6e4;
|
|
50
|
+
function credentialAuthHeader(credential) {
|
|
51
|
+
if (credential.kind === "apiKey") return {
|
|
52
|
+
name: API_KEY_HEADER,
|
|
53
|
+
value: credential.apiKey
|
|
54
|
+
};
|
|
55
|
+
return {
|
|
56
|
+
name: AUTHORIZATION_HEADER,
|
|
57
|
+
value: BEARER_PREFIX + credential.accessToken
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
const MAX_HEADER_CODE_UNIT = 255;
|
|
61
|
+
function headerBearingSecret(credential) {
|
|
62
|
+
if (credential.kind === "apiKey") return {
|
|
63
|
+
field: "apiKey",
|
|
64
|
+
value: credential.apiKey
|
|
65
|
+
};
|
|
66
|
+
return {
|
|
67
|
+
field: "accessToken",
|
|
68
|
+
value: credential.accessToken
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
function assertCredentialHeaderSafe(credential) {
|
|
72
|
+
const { field, value } = headerBearingSecret(credential);
|
|
73
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
74
|
+
const codeUnit = value.charCodeAt(index);
|
|
75
|
+
if (codeUnit > MAX_HEADER_CODE_UNIT) {
|
|
76
|
+
const codePoint = codeUnit.toString(16).toUpperCase().padStart(4, "0");
|
|
77
|
+
throw new ConfigError(`Credential field "${field}" has a character at index ${index} (U+${codePoint}) that cannot be sent in an HTTP header. Header values are limited to Latin-1; a smart quote, ellipsis, or dash substituted during copy-paste is the usual cause.`);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function credentialSecrets(credential) {
|
|
82
|
+
if (credential.kind === "apiKey") return [credential.apiKey];
|
|
83
|
+
return [credential.accessToken, credential.refreshToken];
|
|
84
|
+
}
|
|
85
|
+
function isOAuthExpired(credential, nowMs) {
|
|
86
|
+
const expiryMs = Date.parse(credential.expiresAt);
|
|
87
|
+
if (Number.isNaN(expiryMs)) return true;
|
|
88
|
+
return expiryMs - EXPIRY_SKEW_MS <= nowMs;
|
|
89
|
+
}
|
|
90
|
+
function expiresAtFromNow(expiresInSeconds, nowMs) {
|
|
91
|
+
return new Date(nowMs + expiresInSeconds * 1e3).toISOString();
|
|
92
|
+
}
|
|
93
|
+
function oauthCredentialFromTokens(tokens, refreshToken, clientId, nowMs) {
|
|
94
|
+
return {
|
|
95
|
+
kind: "oauth",
|
|
96
|
+
accessToken: tokens.access_token,
|
|
97
|
+
refreshToken,
|
|
98
|
+
expiresAt: expiresAtFromNow(tokens.expires_in ?? 3600, nowMs),
|
|
99
|
+
clientId
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region ../client/src/url.ts
|
|
104
|
+
function normalizeUrl(input) {
|
|
105
|
+
const trimmed = input.trim().replace(/\/+$/, "");
|
|
106
|
+
if (!/^https?:\/\//i.test(trimmed)) throw new ConfigError("URL must start with http:// or https://");
|
|
107
|
+
return trimmed;
|
|
108
|
+
}
|
|
109
|
+
function displayUrl(input) {
|
|
110
|
+
const parsed = new URL(input);
|
|
111
|
+
const path = parsed.pathname.replace(/\/+$/, "");
|
|
112
|
+
return `${parsed.origin}${path}`;
|
|
113
|
+
}
|
|
114
|
+
const LOOPBACK_HOSTS = /* @__PURE__ */ new Set([
|
|
115
|
+
"localhost",
|
|
116
|
+
"127.0.0.1",
|
|
117
|
+
"::1",
|
|
118
|
+
"[::1]"
|
|
119
|
+
]);
|
|
120
|
+
function isLoopbackHost(hostname) {
|
|
121
|
+
return LOOPBACK_HOSTS.has(hostname.toLowerCase());
|
|
122
|
+
}
|
|
123
|
+
function assertEndpointOrigin(endpoint, baseUrl, label) {
|
|
124
|
+
let parsed;
|
|
125
|
+
try {
|
|
126
|
+
parsed = new URL(endpoint);
|
|
127
|
+
} catch {
|
|
128
|
+
throw new ConfigError(`OAuth ${label} is not a valid URL: ${endpoint}`);
|
|
129
|
+
}
|
|
130
|
+
const base = new URL(baseUrl);
|
|
131
|
+
if (parsed.protocol !== "https:" && !isLoopbackHost(parsed.hostname)) throw new ConfigError(`OAuth ${label} must use https: ${endpoint}`);
|
|
132
|
+
if (parsed.origin !== base.origin) throw new ConfigError(`OAuth ${label} origin (${parsed.origin}) does not match the Metabase URL (${base.origin})`);
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region ../client/src/http/sanitize.ts
|
|
136
|
+
const SECRET_HEADER_NAMES = /* @__PURE__ */ new Set([
|
|
137
|
+
"authorization",
|
|
138
|
+
"x-api-key",
|
|
139
|
+
"x-metabase-session",
|
|
140
|
+
"cookie",
|
|
141
|
+
"set-cookie",
|
|
142
|
+
"proxy-authorization"
|
|
143
|
+
]);
|
|
144
|
+
const REDACTED = "[REDACTED]";
|
|
145
|
+
function redactHeaders(headers) {
|
|
146
|
+
const result = {};
|
|
147
|
+
const entries = headers instanceof Headers ? headers.entries() : Object.entries(headers);
|
|
148
|
+
for (const [key, value] of entries) result[key] = SECRET_HEADER_NAMES.has(key.toLowerCase()) ? REDACTED : value;
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
function redactBody(body, ctx) {
|
|
152
|
+
let result = body;
|
|
153
|
+
for (const secret of ctx.knownSecrets) {
|
|
154
|
+
if (secret.length === 0) continue;
|
|
155
|
+
result = result.replaceAll(secret, REDACTED);
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region ../client/src/http/errors.ts
|
|
161
|
+
const NOT_FOUND_STATUS = 404;
|
|
162
|
+
const ROUTE_MISSING_LITERAL = "API endpoint does not exist.";
|
|
163
|
+
const RESOURCE_MISSING_LITERAL = "Not found.";
|
|
164
|
+
const STATUS_CLASSIFICATIONS = {
|
|
165
|
+
401: { retryable: false },
|
|
166
|
+
403: { retryable: false },
|
|
167
|
+
404: { retryable: false },
|
|
168
|
+
408: {
|
|
169
|
+
retryable: true,
|
|
170
|
+
message: "Metabase timed out responding."
|
|
171
|
+
},
|
|
172
|
+
425: { retryable: true },
|
|
173
|
+
429: {
|
|
174
|
+
retryable: true,
|
|
175
|
+
message: "Metabase rate-limited the request."
|
|
176
|
+
},
|
|
177
|
+
500: { retryable: true },
|
|
178
|
+
502: { retryable: true },
|
|
179
|
+
503: { retryable: true },
|
|
180
|
+
504: {
|
|
181
|
+
retryable: true,
|
|
182
|
+
message: "Metabase timed out responding."
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
const ErrorEnvelope = z.object({
|
|
186
|
+
message: z.string().optional(),
|
|
187
|
+
error: z.string().optional(),
|
|
188
|
+
"error-message": z.string().optional(),
|
|
189
|
+
via: z.array(z.object({ message: z.string().optional() }).loose()).optional(),
|
|
190
|
+
"specific-errors": z.unknown().optional(),
|
|
191
|
+
errors: z.unknown().optional()
|
|
192
|
+
}).loose();
|
|
193
|
+
const FieldErrorNodeSchema = z.lazy(() => z.union([
|
|
194
|
+
z.string(),
|
|
195
|
+
z.array(z.string()),
|
|
196
|
+
z.record(z.string(), FieldErrorNodeSchema)
|
|
197
|
+
]));
|
|
198
|
+
const FieldErrorTree = z.record(z.string(), FieldErrorNodeSchema);
|
|
199
|
+
const FIELD_MESSAGE_SEPARATOR = "; ";
|
|
200
|
+
const MAX_EXTRACTED_MESSAGE_LEN = 500;
|
|
201
|
+
const ELLIPSIS = "…";
|
|
202
|
+
var HttpError = class extends MetabaseError {
|
|
203
|
+
category = "http";
|
|
204
|
+
status;
|
|
205
|
+
kind;
|
|
206
|
+
developerDetail;
|
|
207
|
+
constructor(input) {
|
|
208
|
+
const sanitizedBody = sanitizeBody(input.rawBody, input.redactionContext);
|
|
209
|
+
const redactedHeaders = redactHeaders(input.responseHeaders);
|
|
210
|
+
const kind = classifyKind(input.status, sanitizedBody, redactedHeaders);
|
|
211
|
+
super(input.overrideUserMessage ?? buildUserMessage(kind, input, sanitizedBody));
|
|
212
|
+
const fields = extractFieldErrors(sanitizedBody);
|
|
213
|
+
this.name = "HttpError";
|
|
214
|
+
this.status = input.status;
|
|
215
|
+
this.kind = kind;
|
|
216
|
+
this.developerDetail = {
|
|
217
|
+
status: input.status,
|
|
218
|
+
statusText: input.statusText,
|
|
219
|
+
method: input.method,
|
|
220
|
+
url: input.url,
|
|
221
|
+
responseHeaders: redactedHeaders,
|
|
222
|
+
body: sanitizedBody,
|
|
223
|
+
fieldErrors: fields.fieldErrors,
|
|
224
|
+
specificFieldErrors: fields.specificFieldErrors
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
get isRetryable() {
|
|
228
|
+
return isRetryableStatus(this.status);
|
|
229
|
+
}
|
|
230
|
+
get fieldErrors() {
|
|
231
|
+
return this.developerDetail.fieldErrors;
|
|
232
|
+
}
|
|
233
|
+
get specificFieldErrors() {
|
|
234
|
+
return this.developerDetail.specificFieldErrors;
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
function chainRequestFailure(cause, message) {
|
|
238
|
+
if (cause instanceof HttpError) return new HttpError({
|
|
239
|
+
status: cause.status,
|
|
240
|
+
statusText: cause.developerDetail.statusText,
|
|
241
|
+
method: cause.developerDetail.method,
|
|
242
|
+
url: cause.developerDetail.url,
|
|
243
|
+
responseHeaders: cause.developerDetail.responseHeaders,
|
|
244
|
+
rawBody: cause.developerDetail.body,
|
|
245
|
+
overrideUserMessage: message
|
|
246
|
+
});
|
|
247
|
+
return new ChainedRequestError(message, cause);
|
|
248
|
+
}
|
|
249
|
+
function isRetryableStatus(status) {
|
|
250
|
+
return STATUS_CLASSIFICATIONS[status]?.retryable === true;
|
|
251
|
+
}
|
|
252
|
+
function sanitizeBody(rawBody, ctx) {
|
|
253
|
+
if (rawBody === null) return null;
|
|
254
|
+
if (ctx === void 0) return rawBody;
|
|
255
|
+
return redactBody(rawBody, ctx);
|
|
256
|
+
}
|
|
257
|
+
function classifyKind(status, sanitizedBody, redactedHeaders) {
|
|
258
|
+
if (status === 401 || status === 403) return "auth";
|
|
259
|
+
if (status === NOT_FOUND_STATUS) return isRouteMissingResponse(sanitizedBody, redactedHeaders) ? "route-missing" : "resource-missing";
|
|
260
|
+
if (status === 429) return "rate-limit";
|
|
261
|
+
if (status >= 500 && status < 600) return "server-error";
|
|
262
|
+
return "generic";
|
|
263
|
+
}
|
|
264
|
+
function isRouteMissingResponse(sanitizedBody, redactedHeaders) {
|
|
265
|
+
if (sanitizedBody?.includes(ROUTE_MISSING_LITERAL)) return true;
|
|
266
|
+
if (sanitizedBody?.includes(RESOURCE_MISSING_LITERAL)) return false;
|
|
267
|
+
if (redactedHeaders["content-type"]?.includes("application/json")) return false;
|
|
268
|
+
if (sanitizedBody === null || sanitizedBody.trim() === "") return true;
|
|
269
|
+
return parseEnvelope(sanitizedBody) === null;
|
|
270
|
+
}
|
|
271
|
+
function buildUserMessage(kind, input, sanitizedBody) {
|
|
272
|
+
if (kind === "route-missing") return buildRouteMissingMessage(input);
|
|
273
|
+
if (kind === "resource-missing") return `Not found: ${input.method} ${pathFromUrl(input.url)}.`;
|
|
274
|
+
const fromBody = parseEnvelopeMessage(sanitizedBody);
|
|
275
|
+
if (fromBody !== null) return fromBody;
|
|
276
|
+
if (kind === "auth") return `Invalid or unauthorized API key (host: ${hostFromUrl(input.url)}).`;
|
|
277
|
+
return defaultMessageForStatus(input.status);
|
|
278
|
+
}
|
|
279
|
+
function buildRouteMissingMessage(input) {
|
|
280
|
+
const path = pathFromUrl(input.url);
|
|
281
|
+
if (!input.serverTag) return `This endpoint is not available on the connected Metabase: ${input.method} ${path}.`;
|
|
282
|
+
return `This endpoint is not available on Metabase ${input.serverTag}: ${input.method} ${path}. It may require a newer Metabase major version.`;
|
|
283
|
+
}
|
|
284
|
+
function pathFromUrl(url) {
|
|
285
|
+
const parsed = new URL(url);
|
|
286
|
+
return parsed.pathname + parsed.search;
|
|
287
|
+
}
|
|
288
|
+
function hostFromUrl(url) {
|
|
289
|
+
return new URL(url).host;
|
|
290
|
+
}
|
|
291
|
+
function parseEnvelope(sanitizedBody) {
|
|
292
|
+
if (!sanitizedBody) return null;
|
|
293
|
+
const result = parseJsonResult(sanitizedBody, ErrorEnvelope);
|
|
294
|
+
return result.ok ? result.value : null;
|
|
295
|
+
}
|
|
296
|
+
const NO_FIELD_ERRORS = {
|
|
297
|
+
fieldErrors: null,
|
|
298
|
+
specificFieldErrors: null
|
|
299
|
+
};
|
|
300
|
+
function extractFieldErrors(sanitizedBody) {
|
|
301
|
+
const envelope = parseEnvelope(sanitizedBody);
|
|
302
|
+
if (envelope === null) return NO_FIELD_ERRORS;
|
|
303
|
+
return {
|
|
304
|
+
fieldErrors: parseFieldErrors(envelope.errors),
|
|
305
|
+
specificFieldErrors: parseFieldErrors(envelope["specific-errors"])
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function parseFieldErrors(value) {
|
|
309
|
+
const parsed = FieldErrorTree.safeParse(value);
|
|
310
|
+
if (!parsed.success) return null;
|
|
311
|
+
const entries = collectLeafEntries(parsed.data, []);
|
|
312
|
+
if (entries.length === 0) return null;
|
|
313
|
+
return Object.fromEntries(entries.map((entry) => [entry.path, entry.message]));
|
|
314
|
+
}
|
|
315
|
+
function parseEnvelopeMessage(sanitizedBody) {
|
|
316
|
+
const envelope = parseEnvelope(sanitizedBody);
|
|
317
|
+
if (envelope === null) return null;
|
|
318
|
+
const topLevel = envelope.message ?? envelope.error ?? envelope["error-message"];
|
|
319
|
+
if (topLevel) return capLength(topLevel);
|
|
320
|
+
const viaMessage = envelope.via?.find((entry) => entry.message)?.message;
|
|
321
|
+
if (viaMessage) return capLength(viaMessage);
|
|
322
|
+
const specific = formatErrorTree(envelope["specific-errors"]);
|
|
323
|
+
if (specific) return capLength(specific);
|
|
324
|
+
const generic = formatErrorTree(envelope.errors);
|
|
325
|
+
if (generic) return capLength(generic);
|
|
326
|
+
return null;
|
|
327
|
+
}
|
|
328
|
+
function formatErrorTree(value) {
|
|
329
|
+
const entries = collectLeafEntries(value, []);
|
|
330
|
+
if (entries.length === 0) return null;
|
|
331
|
+
return entries.map(formatLeafEntry).join(FIELD_MESSAGE_SEPARATOR);
|
|
332
|
+
}
|
|
333
|
+
function formatLeafEntry(entry) {
|
|
334
|
+
return entry.path === "" ? entry.message : `${entry.path}: ${entry.message}`;
|
|
335
|
+
}
|
|
336
|
+
function collectLeafEntries(value, path) {
|
|
337
|
+
if (typeof value === "string") {
|
|
338
|
+
const trimmed = value.trim();
|
|
339
|
+
return trimmed === "" ? [] : [{
|
|
340
|
+
path: path.join("."),
|
|
341
|
+
message: trimmed
|
|
342
|
+
}];
|
|
343
|
+
}
|
|
344
|
+
if (Array.isArray(value)) {
|
|
345
|
+
const messages = value.filter((entry) => typeof entry === "string" && entry.trim() !== "");
|
|
346
|
+
if (messages.length === 0) return [];
|
|
347
|
+
return [{
|
|
348
|
+
path: path.join("."),
|
|
349
|
+
message: messages.join(FIELD_MESSAGE_SEPARATOR)
|
|
350
|
+
}];
|
|
351
|
+
}
|
|
352
|
+
if (isPlainObject(value)) return Object.entries(value).flatMap(([key, child]) => collectLeafEntries(child, [...path, key]));
|
|
353
|
+
return [];
|
|
354
|
+
}
|
|
355
|
+
function capLength(message) {
|
|
356
|
+
if (message.length <= MAX_EXTRACTED_MESSAGE_LEN) return message;
|
|
357
|
+
return message.slice(0, MAX_EXTRACTED_MESSAGE_LEN - 1) + ELLIPSIS;
|
|
358
|
+
}
|
|
359
|
+
function defaultMessageForStatus(status) {
|
|
360
|
+
return STATUS_CLASSIFICATIONS[status]?.message ?? `Metabase returned ${status}.`;
|
|
361
|
+
}
|
|
362
|
+
//#endregion
|
|
363
|
+
//#region ../client/src/http/network-error.ts
|
|
364
|
+
const NETWORK_HINTS = {
|
|
365
|
+
ECONNREFUSED: (t) => `Connection refused by ${t.host} — is Metabase running and is the port correct?`,
|
|
366
|
+
ENOTFOUND: (t) => `Host not found: ${t.hostname} — check the URL.`,
|
|
367
|
+
EAI_AGAIN: (t) => `Could not resolve ${t.hostname} — check your network connection and the URL.`,
|
|
368
|
+
ECONNRESET: (t) => `Connection to ${t.host} was reset — the server may have closed it, or http/https may be mismatched.`,
|
|
369
|
+
UND_ERR_SOCKET: (t) => `Connection to ${t.host} was closed by the other side — a pooled connection or a proxy may have dropped it.`,
|
|
370
|
+
EPIPE: (t) => `Connection to ${t.host} closed while the request was still being written — the server or a proxy dropped it.`,
|
|
371
|
+
ETIMEDOUT: (t) => `Connection to ${t.host} timed out — check the host, port, and your network.`
|
|
372
|
+
};
|
|
373
|
+
const CONNECTION_CLOSED_CODES = /* @__PURE__ */ new Set([
|
|
374
|
+
"ECONNRESET",
|
|
375
|
+
"UND_ERR_SOCKET",
|
|
376
|
+
"EPIPE"
|
|
377
|
+
]);
|
|
378
|
+
const TLS_ERROR_CODES = /* @__PURE__ */ new Set([
|
|
379
|
+
"EPROTO",
|
|
380
|
+
"DEPTH_ZERO_SELF_SIGNED_CERT",
|
|
381
|
+
"SELF_SIGNED_CERT_IN_CHAIN",
|
|
382
|
+
"UNABLE_TO_VERIFY_LEAF_SIGNATURE",
|
|
383
|
+
"CERT_HAS_EXPIRED",
|
|
384
|
+
"ERR_TLS_CERT_ALTNAME_INVALID"
|
|
385
|
+
]);
|
|
386
|
+
function buildNetworkError(error, method, url) {
|
|
387
|
+
const fallback = errorMessage(error);
|
|
388
|
+
const code = failureCode(error);
|
|
389
|
+
return new NetworkError(networkMessage(code, networkTarget(url), fallback), {
|
|
390
|
+
method,
|
|
391
|
+
url,
|
|
392
|
+
cause: code ?? fallback
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
function isConnectionClosed(error) {
|
|
396
|
+
const code = failureCode(error);
|
|
397
|
+
return code !== null && CONNECTION_CLOSED_CODES.has(code);
|
|
398
|
+
}
|
|
399
|
+
function networkMessage(code, target, fallback) {
|
|
400
|
+
if (code === null) return `Could not reach Metabase: ${fallback}`;
|
|
401
|
+
if (TLS_ERROR_CODES.has(code)) return `Could not reach Metabase: TLS error contacting ${target.host} (${code}) — the certificate could not be verified, or https:// was used against a plain-HTTP server. For a certificate the OS does not trust either, set NODE_EXTRA_CA_CERTS to its CA bundle.`;
|
|
402
|
+
const hint = NETWORK_HINTS[code];
|
|
403
|
+
if (hint === void 0) return `Could not reach Metabase: ${fallback} (${code})`;
|
|
404
|
+
return `Could not reach Metabase: ${hint(target)}`;
|
|
405
|
+
}
|
|
406
|
+
function failureCode(error) {
|
|
407
|
+
const own = errorCode(error);
|
|
408
|
+
if (own !== null) return own;
|
|
409
|
+
return errorCode(error instanceof Error ? error.cause : void 0);
|
|
410
|
+
}
|
|
411
|
+
function errorCode(value) {
|
|
412
|
+
if (value instanceof Error && "code" in value && typeof value.code === "string") return value.code;
|
|
413
|
+
return null;
|
|
414
|
+
}
|
|
415
|
+
function networkTarget(url) {
|
|
416
|
+
const parsed = new URL(url);
|
|
417
|
+
return {
|
|
418
|
+
host: parsed.host,
|
|
419
|
+
hostname: parsed.hostname
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
//#endregion
|
|
423
|
+
export { parseJsonResult as _, isRetryableStatus as a, normalizeUrl as c, credentialSecrets as d, isOAuthExpired as f, parseJsonOrPlain as g, parseJson as h, chainRequestFailure as i, assertCredentialHeaderSafe as l, JSON_CONTENT_TYPE as m, isConnectionClosed as n, assertEndpointOrigin as o, oauthCredentialFromTokens as p, HttpError as r, displayUrl as s, buildNetworkError as t, credentialAuthHeader as u };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { CronUiDisplayType } from "./cron-
|
|
1
|
+
import { t as CronUiDisplayType } from "./cron-LKRffEC-.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
|
|
4
|
-
//#region src/domain/notification.ts
|
|
3
|
+
//#region ../client/src/domain/notification.ts
|
|
5
4
|
const NotificationPayloadType = z.enum([
|
|
6
5
|
"notification/card",
|
|
7
6
|
"notification/dashboard",
|
|
@@ -100,67 +99,6 @@ const NotificationCompact = Notification.pick({
|
|
|
100
99
|
subscriptions: z.array(NotificationSubscriptionCompact),
|
|
101
100
|
handlers: z.array(NotificationHandlerCompact)
|
|
102
101
|
});
|
|
103
|
-
const NullableCardPayload = NotificationCardPayload.nullable();
|
|
104
|
-
const NotificationSubscriptionList = z.array(NotificationSubscription);
|
|
105
|
-
const NotificationHandlerList = z.array(NotificationHandler);
|
|
106
|
-
const notificationView = {
|
|
107
|
-
compactPick: NotificationCompact,
|
|
108
|
-
tableColumns: [
|
|
109
|
-
{
|
|
110
|
-
key: "id",
|
|
111
|
-
label: "ID"
|
|
112
|
-
},
|
|
113
|
-
{
|
|
114
|
-
key: "payload",
|
|
115
|
-
label: "Card",
|
|
116
|
-
format: formatPayload
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
key: "subscriptions",
|
|
120
|
-
label: "Schedule",
|
|
121
|
-
format: formatSubscriptions
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
key: "handlers",
|
|
125
|
-
label: "Delivery",
|
|
126
|
-
format: formatHandlers
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
key: "active",
|
|
130
|
-
label: "Active"
|
|
131
|
-
}
|
|
132
|
-
]
|
|
133
|
-
};
|
|
134
|
-
function formatPayload(value) {
|
|
135
|
-
const parsed = NullableCardPayload.safeParse(value);
|
|
136
|
-
if (!parsed.success || parsed.data === null) return "";
|
|
137
|
-
const { card_id, send_condition, send_once } = parsed.data;
|
|
138
|
-
const once = send_once ? ", once" : "";
|
|
139
|
-
return `${card_id} (${send_condition}${once})`;
|
|
140
|
-
}
|
|
141
|
-
function formatSubscriptions(value) {
|
|
142
|
-
const parsed = NotificationSubscriptionList.safeParse(value);
|
|
143
|
-
if (!parsed.success) return "";
|
|
144
|
-
return parsed.data.map((subscription) => subscription.cron_schedule ?? subscription.event_name ?? "").filter((label) => label !== "").join("; ");
|
|
145
|
-
}
|
|
146
|
-
function formatHandlers(value) {
|
|
147
|
-
const parsed = NotificationHandlerList.safeParse(value);
|
|
148
|
-
if (!parsed.success) return "";
|
|
149
|
-
return parsed.data.map(describeHandler).join("; ");
|
|
150
|
-
}
|
|
151
|
-
function describeHandler(handler) {
|
|
152
|
-
const channel = handler.channel_type.replace("channel/", "");
|
|
153
|
-
const recipients = (handler.recipients ?? []).map(describeRecipient).join(", ");
|
|
154
|
-
return recipients === "" ? channel : `${channel} → ${recipients}`;
|
|
155
|
-
}
|
|
156
|
-
function describeRecipient(recipient) {
|
|
157
|
-
switch (recipient.type) {
|
|
158
|
-
case "notification-recipient/user": return `user:${recipient.user_id}`;
|
|
159
|
-
case "notification-recipient/group": return `group:${recipient.permissions_group_id}`;
|
|
160
|
-
case "notification-recipient/raw-value": return recipient.details?.value ?? "";
|
|
161
|
-
case "notification-recipient/template": return "template";
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
102
|
const NotificationRecipientInput = z.object({
|
|
165
103
|
type: NotificationRecipientType,
|
|
166
104
|
user_id: z.number().int().positive().optional(),
|
|
@@ -196,6 +134,5 @@ const NotificationUpdateInput = z.object({
|
|
|
196
134
|
handlers: z.array(NotificationHandlerInput).min(1).optional(),
|
|
197
135
|
active: z.boolean().optional()
|
|
198
136
|
}).loose();
|
|
199
|
-
|
|
200
137
|
//#endregion
|
|
201
|
-
export {
|
|
138
|
+
export { NotificationCreateInput as a, NotificationUpdateInput as c, NotificationCompact as i, Notification as n, NotificationHandler as o, NotificationCardPayload as r, NotificationSubscription as s, CARD_PAYLOAD_TYPE as t };
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { d as MALFORMED_CELL } from "./cli.mjs";
|
|
2
|
+
import { i as NotificationCompact, o as NotificationHandler, r as NotificationCardPayload, s as NotificationSubscription } from "./notification-DaA4bBHW.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
//#region src/output/views/notification.ts
|
|
5
|
+
const NullableCardPayload = NotificationCardPayload.nullable();
|
|
6
|
+
const NotificationSubscriptionList = z.array(NotificationSubscription);
|
|
7
|
+
const NotificationHandlerList = z.array(NotificationHandler);
|
|
8
|
+
function formatPayload(value) {
|
|
9
|
+
const parsed = NullableCardPayload.safeParse(value);
|
|
10
|
+
if (!parsed.success) return MALFORMED_CELL;
|
|
11
|
+
if (parsed.data === null) return "";
|
|
12
|
+
const { card_id, send_condition, send_once } = parsed.data;
|
|
13
|
+
return `${card_id} (${send_condition}${send_once ? ", once" : ""})`;
|
|
14
|
+
}
|
|
15
|
+
function formatSubscriptions(value) {
|
|
16
|
+
const parsed = NotificationSubscriptionList.safeParse(value);
|
|
17
|
+
if (!parsed.success) return MALFORMED_CELL;
|
|
18
|
+
return parsed.data.map((subscription) => subscription.cron_schedule ?? subscription.event_name ?? "").filter((label) => label !== "").join("; ");
|
|
19
|
+
}
|
|
20
|
+
function describeRecipient(recipient) {
|
|
21
|
+
switch (recipient.type) {
|
|
22
|
+
case "notification-recipient/user": return `user:${recipient.user_id}`;
|
|
23
|
+
case "notification-recipient/group": return `group:${recipient.permissions_group_id}`;
|
|
24
|
+
case "notification-recipient/raw-value": return recipient.details?.value ?? "";
|
|
25
|
+
case "notification-recipient/template": return "template";
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function describeHandler(handler) {
|
|
29
|
+
const channel = handler.channel_type.replace("channel/", "");
|
|
30
|
+
const recipients = (handler.recipients ?? []).map(describeRecipient).join(", ");
|
|
31
|
+
return recipients === "" ? channel : `${channel} → ${recipients}`;
|
|
32
|
+
}
|
|
33
|
+
function formatHandlers(value) {
|
|
34
|
+
const parsed = NotificationHandlerList.safeParse(value);
|
|
35
|
+
if (!parsed.success) return MALFORMED_CELL;
|
|
36
|
+
return parsed.data.map(describeHandler).join("; ");
|
|
37
|
+
}
|
|
38
|
+
const notificationView = {
|
|
39
|
+
compactPick: NotificationCompact,
|
|
40
|
+
tableColumns: [
|
|
41
|
+
{
|
|
42
|
+
key: "id",
|
|
43
|
+
label: "ID"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: "payload",
|
|
47
|
+
label: "Card",
|
|
48
|
+
format: formatPayload
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: "subscriptions",
|
|
52
|
+
label: "Schedule",
|
|
53
|
+
format: formatSubscriptions
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "handlers",
|
|
57
|
+
label: "Delivery",
|
|
58
|
+
format: formatHandlers
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "active",
|
|
62
|
+
label: "Active"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
};
|
|
66
|
+
//#endregion
|
|
67
|
+
export { notificationView as t };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region src/domain/parameter.ts
|
|
2
|
+
//#region ../client/src/domain/parameter.ts
|
|
4
3
|
const ParameterType = z.enum([
|
|
5
4
|
"number",
|
|
6
5
|
"text",
|
|
@@ -106,13 +105,5 @@ const ParameterValuesCompact = ParameterValues.pick({
|
|
|
106
105
|
values: true,
|
|
107
106
|
has_more_values: true
|
|
108
107
|
}).strip();
|
|
109
|
-
const parameterValuesView = {
|
|
110
|
-
compactPick: ParameterValuesCompact,
|
|
111
|
-
tableColumns: [{
|
|
112
|
-
key: "has_more_values",
|
|
113
|
-
label: "More available"
|
|
114
|
-
}]
|
|
115
|
-
};
|
|
116
|
-
|
|
117
108
|
//#endregion
|
|
118
|
-
export {
|
|
109
|
+
export { ParameterValuesCompact as i, ParameterMapping as n, ParameterValues as r, Parameter as t };
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { parseId } from "./parse-id-
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { i as ConfigError } from "./predicates-Bkm2IoeX.mjs";
|
|
2
|
+
import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
|
|
3
|
+
import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
|
|
4
|
+
import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
|
|
5
|
+
import { i as ParameterValuesCompact, r as ParameterValues } from "./parameter-DUKR8NXo.mjs";
|
|
6
|
+
//#region src/output/views/parameter.ts
|
|
7
|
+
const parameterValuesView = {
|
|
8
|
+
compactPick: ParameterValuesCompact,
|
|
9
|
+
tableColumns: [{
|
|
10
|
+
key: "has_more_values",
|
|
11
|
+
label: "More available"
|
|
12
|
+
}]
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
7
15
|
//#region src/commands/dashboard/parameter-values.ts
|
|
8
16
|
var parameter_values_default = defineMetabaseCommand({
|
|
9
17
|
meta: {
|
|
@@ -42,13 +50,11 @@ var parameter_values_default = defineMetabaseCommand({
|
|
|
42
50
|
const parameterId = args["parameter-id"];
|
|
43
51
|
if (parameterId === "") throw new ConfigError("parameter-id must not be empty");
|
|
44
52
|
const client = await getClient();
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const result = await client.requestParsed(ParameterValues, path);
|
|
53
|
+
const search = args.query === void 0 || args.query === "" ? null : args.query;
|
|
54
|
+
const result = search === null ? await client.dashboard.parameterValues(dashboardId, parameterId) : await client.dashboard.searchParameterValues(dashboardId, parameterId, search);
|
|
48
55
|
const more = result.has_more_values ? " (more available — narrow with --query)" : "";
|
|
49
56
|
renderSummary(result, parameterValuesView, `${result.values.length} value(s)${more}.`, ctx);
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
|
-
|
|
53
59
|
//#endregion
|
|
54
|
-
export { parameter_values_default as default };
|
|
60
|
+
export { parameter_values_default as default };
|