@metabase/cli 0.1.15 → 0.1.17
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 +69 -32
- package/dist/{add-collection-CXhrMjXU.mjs → add-collection-C-t9SQBk.mjs} +5 -5
- package/dist/add-collection-Dek6kiRI.mjs +11 -0
- package/dist/{archive-BUwiCFnd.mjs → archive-C7dnyzVY.mjs} +9 -7
- package/dist/{archive-Blc1dz8Z.mjs → archive-CaoUUTIb.mjs} +8 -7
- package/dist/{archive-D-Ovk0-E.mjs → archive-D1FX-sbU.mjs} +7 -6
- package/dist/{archive-CQiaCBSj.mjs → archive-DS-KEB4a.mjs} +7 -6
- package/dist/{archive-yTvDRQUZ.mjs → archive-LG8u7ec5.mjs} +7 -6
- package/dist/{archive-BxGSR7El.mjs → archive-qSOcACQo.mjs} +8 -6
- package/dist/{archive-Drt-rWvU.mjs → archive-wNXwIiF0.mjs} +8 -7
- package/dist/auth-Kv2MRkRk.mjs +22 -0
- package/dist/{body-B9XTTDEu.mjs → body-IcJ5kFtk.mjs} +3 -3
- package/dist/{branches-Ct3PK5U3.mjs → branches-BlNCTmFB.mjs} +7 -6
- package/dist/{cancel-tST8Bh0w.mjs → cancel-BnveTPNw.mjs} +6 -5
- package/dist/{cancel-task-BHnzRQKL.mjs → cancel-task-CSVI8Zgl.mjs} +7 -6
- package/dist/{capabilities-BX1rnVuH.mjs → capabilities-N0jo5U7S.mjs} +1 -1
- package/dist/card-Bp58WEUF.mjs +26 -0
- package/dist/{card-wCPcuKSi.mjs → card-DEmcRlNO.mjs} +6 -5
- package/dist/{cards-BySIFsLG.mjs → cards-CMgGA8OZ.mjs} +8 -6
- package/dist/cli.mjs +54 -26
- package/dist/collection-D8TI20Ir.mjs +23 -0
- package/dist/{collection-namespace-D8ohM5gD.mjs → collection-namespace-CsaxEqOb.mjs} +2 -2
- package/dist/command-augment-DdZIfx1V.mjs +11 -0
- package/dist/{create-HZ-9GMLx.mjs → create-AeWNv0v-.mjs} +9 -8
- package/dist/create-B1xfaZJB.mjs +35 -0
- package/dist/{create-DxDD6n1d.mjs → create-B6LQutd0.mjs} +17 -12
- package/dist/{create-C7FPeJqF.mjs → create-B79M8YpX.mjs} +10 -9
- package/dist/{create-DGxZmbxh.mjs → create-Bg_uMu0p.mjs} +9 -8
- package/dist/{create-C43RQYgj.mjs → create-BpkWlgoR.mjs} +18 -12
- package/dist/{create-DnT1Sayk.mjs → create-C7u3umLj.mjs} +9 -8
- package/dist/{create-4mAGsBd0.mjs → create-FZOrCw5k.mjs} +21 -12
- package/dist/{create-fIDFkdox.mjs → create-I5Cv-MBa.mjs} +16 -11
- package/dist/{create-D3cVDtxM.mjs → create-LHqwcVbS.mjs} +16 -11
- package/dist/{create-BDWthCYq.mjs → create-SHKlj0z3.mjs} +9 -8
- package/dist/{create-branch-jPE7nW-E.mjs → create-branch-CGyT99Ny.mjs} +7 -6
- package/dist/{current-task-rW54KJax.mjs → current-task-C-0hw2Ae.mjs} +7 -6
- package/dist/dashboard-C9pQCnX6.mjs +28 -0
- package/dist/{dashboard-B4bn3z6t.mjs → dashboard-DOplbKyQ.mjs} +7 -5
- package/dist/{database-BmsxuRmO.mjs → database-D9fftP-i.mjs} +1 -1
- package/dist/db-DWykmBOh.mjs +28 -0
- package/dist/{delete-BWO6uB4P.mjs → delete--NYYN6wv.mjs} +8 -7
- package/dist/{delete-CeigtfRI.mjs → delete-Do3nn9sl.mjs} +8 -7
- package/dist/{delete-runtime-PzLFavb0.mjs → delete-runtime-B0ha5QR4.mjs} +3 -3
- package/dist/{delete-CBwztF6P.mjs → delete-tCVrYjKD.mjs} +8 -7
- package/dist/{delete-table-BXzvDEPG.mjs → delete-table-CWSGPw0i.mjs} +8 -7
- package/dist/{dependencies-D2N9eqm1.mjs → dependencies-CyFocD8I.mjs} +7 -6
- package/dist/{dirty-DoEZRSGB.mjs → dirty-BXM0YJ_a.mjs} +7 -6
- package/dist/document-DNDm8_Py.mjs +22 -0
- package/dist/{eid-1mROiwJr.mjs → eid-p-zn_1RJ.mjs} +13 -7
- package/dist/{error-D5bZ5BUX.mjs → error-5H_tcfL8.mjs} +2 -2
- package/dist/{export-Bgv5B4_F.mjs → export-B_8wghyo.mjs} +9 -8
- package/dist/field-CFt1-KDR.mjs +21 -0
- package/dist/{fields-VA7tXHJz.mjs → fields-BsufL9kv.mjs} +8 -7
- package/dist/{get-DAsaor0n.mjs → get-4lufgahL.mjs} +7 -6
- package/dist/{get-B8etVxWD.mjs → get-68P-L4ja.mjs} +7 -6
- package/dist/{get-qnGGGRTa.mjs → get-B45uYMAs.mjs} +8 -6
- package/dist/get-B67pe00Z.mjs +36 -0
- package/dist/{get-DvQoDU2m.mjs → get-BJoZkATD.mjs} +7 -6
- package/dist/{get-BgIE_YEg.mjs → get-BTKeO4vE.mjs} +7 -6
- package/dist/{get-RQFSmnpY.mjs → get-C7mq17-2.mjs} +7 -6
- package/dist/{get-CGkhSY5L.mjs → get-CDLa6LiC.mjs} +9 -8
- package/dist/{get-D9o38nK5.mjs → get-CPw0ROO4.mjs} +7 -6
- package/dist/{get-Wj88mnhn.mjs → get-Cl5Ak73C.mjs} +9 -7
- package/dist/{get-CqnCaosn.mjs → get-D3k2JUsa.mjs} +7 -6
- package/dist/{get-C-UeGtgW.mjs → get-DTqBuIf3.mjs} +6 -5
- package/dist/{get-eUYDNALt.mjs → get-DeLnNVQE.mjs} +8 -7
- package/dist/{get-DLRBq8kR.mjs → get-Df_3LCVC.mjs} +7 -6
- package/dist/{get-BtAD26gc.mjs → get-DurjkUKJ.mjs} +7 -6
- package/dist/{get-run-CATz-XMS.mjs → get-run-Dq4qfGfD.mjs} +7 -6
- package/dist/git-sync-ByvjqSiy.mjs +31 -0
- package/dist/group-BNE_RiH5.mjs +28 -0
- package/dist/{has-remote-changes-B6YEMC90.mjs → has-remote-changes-E-4N_O_t.mjs} +7 -6
- package/dist/{import-Bl2Wj9Xf.mjs → import-Dg0j3HCP.mjs} +9 -8
- package/dist/{input-BXWgdKiS.mjs → input-7Sj85_K7.mjs} +1 -1
- package/dist/is-dirty-D7UMN0mt.mjs +10 -0
- package/dist/{is-dirty-D9MoFj0T.mjs → is-dirty-DWw1yBeR.mjs} +4 -4
- package/dist/{items-LjtICjvX.mjs → items-CQtt9X4M.mjs} +9 -8
- package/dist/{key-C8q5oIr5.mjs → key-bltP32Pm.mjs} +1 -1
- package/dist/library-B5AvpACG.mjs +24 -0
- package/dist/{list-ChK06rJh.mjs → list-B1uVWy6A.mjs} +8 -6
- package/dist/{list-DaJk60dd.mjs → list-BAOTQHst.mjs} +6 -5
- package/dist/{list-C410Ptw_.mjs → list-BF-W4jOZ.mjs} +9 -7
- package/dist/{list-DMik04Dh.mjs → list-BFVuPodI.mjs} +6 -5
- package/dist/{list-DfoNv0gb.mjs → list-BHAWYZ1z.mjs} +6 -5
- package/dist/{list-DcjenlTM.mjs → list-BKUvhAs4.mjs} +6 -5
- package/dist/{list-Dq86BAMG.mjs → list-BgUWqZa2.mjs} +8 -7
- package/dist/{list-CfWblVHJ.mjs → list-C4bALfCs.mjs} +7 -6
- package/dist/{list-CoRX8Ruc.mjs → list-C9O2RY5u.mjs} +6 -5
- package/dist/{list-cnqPlJgC.mjs → list-CfqpDTna.mjs} +6 -5
- package/dist/{list-C6U3Ftg8.mjs → list-CvhVYOVl.mjs} +7 -6
- package/dist/{list-B5Q7E2Km.mjs → list-D3TSAqwl.mjs} +6 -5
- package/dist/list-D5Gdz8hi.mjs +100 -0
- package/dist/{list-Bjp9nd0o.mjs → list-DG0FIhTK.mjs} +6 -5
- package/dist/{list-DtrfE0sF.mjs → list-KxQNqp4T.mjs} +8 -7
- package/dist/{login-Cn2UtFUt.mjs → login-Bt6j6yBM.mjs} +10 -9
- package/dist/{logout-_HXgEmqA.mjs → logout-ANkL02p0.mjs} +6 -5
- package/dist/{manifest-DYeLri80.mjs → manifest-BVf8P4bl.mjs} +9 -2
- package/dist/measure-CgFwtL1r.mjs +25 -0
- package/dist/{metadata-8yqT8OZI.mjs → metadata-ClehtgZj.mjs} +9 -8
- package/dist/{metadata-DHODjg1d.mjs → metadata-DplshwI3.mjs} +8 -7
- package/dist/{command-augment-CAur0XOQ.mjs → notice-DyVl5aYB.mjs} +1 -11
- package/dist/parameter-CiJ4CwWE.mjs +118 -0
- package/dist/parameter-values-D4J8Ctu0.mjs +56 -0
- package/dist/{parse-enum-BatHQ-Gs.mjs → parse-enum-BL9i_brN.mjs} +1 -1
- package/dist/{parse-id-DNPeV0Iu.mjs → parse-id-D4LeTUsP.mjs} +1 -1
- package/dist/{parse-ref-CZr1bYIl.mjs → parse-ref-CB_KvF9h.mjs} +1 -1
- package/dist/{path-BflajM08.mjs → path-5nQgdvrs.mjs} +6 -5
- package/dist/{poll-CYkX02Bm.mjs → poll-BpAJpvb-.mjs} +2 -2
- package/dist/{poll-task-oXpl3wzp.mjs → poll-task-TilgciQn.mjs} +2 -2
- package/dist/{preflight-BdJr2amA.mjs → preflight-OfHU3Toi.mjs} +4 -4
- package/dist/{process-DsGf7Mg5.mjs → process-j8UHMHc2.mjs} +1 -1
- package/dist/{prompt-Bc_bHSD0.mjs → prompt-C85xd9HR.mjs} +1 -1
- package/dist/publish-DKiqyDwo.mjs +67 -0
- package/dist/{query-CxTjguwp.mjs → query-BWJ5h1g3.mjs} +19 -13
- package/dist/{query-DWQaN7hO.mjs → query-CQ3xXa9P.mjs} +10 -8
- package/dist/{query-result-L5_NrwQR.mjs → query-result-D6mfoVfQ.mjs} +1 -1
- package/dist/{remove-collection-BwcFi8Fs.mjs → remove-collection-CO-aMzTO.mjs} +9 -8
- package/dist/{rescan-values-B9Qtsd32.mjs → rescan-values-DpL6LGAK.mjs} +9 -8
- package/dist/resolve-Dj2MTBkn.mjs +84 -0
- package/dist/{run-C-vftXCu.mjs → run-DUcdaZs3.mjs} +6 -5
- package/dist/{run-3eFtdI2Z.mjs → run-QYJ-mAaG.mjs} +9 -8
- package/dist/{runs-CpRTkn1W.mjs → runs-DgasTnGd.mjs} +8 -7
- package/dist/{runtime-C1QgWHM7.mjs → runtime-BJtuxWM8.mjs} +5 -3
- package/dist/{schema-tables-rdeupgsu.mjs → schema-tables-ooYjimrV.mjs} +8 -7
- package/dist/{schemas-Cr7RjYqV.mjs → schemas-HjFPzsd-.mjs} +6 -5
- package/dist/{search-D7Yq2MDu.mjs → search-vaT5EwhG.mjs} +11 -5
- package/dist/segment-BPC725mo.mjs +25 -0
- package/dist/{selectors-DPc2ZDdd.mjs → selectors-DlmZpo2L.mjs} +4 -4
- package/dist/{set-X2N6x7pe.mjs → set-CLHJauzG.mjs} +9 -8
- package/dist/{set-active-BoBa3pOw.mjs → set-active-oZOUe9V7.mjs} +6 -5
- package/dist/setting-DHYO-W5g.mjs +20 -0
- package/dist/{setup-C47WUieB.mjs → setup-D1de5Sbc.mjs} +8 -7
- package/dist/{skills-CJ8g8fhQ.mjs → skills-B6gfH0iR.mjs} +1 -1
- package/dist/{skills-Po0YPVU5.mjs → skills-NhgVypJ7.mjs} +3 -3
- package/dist/snippet-DtLmHr2J.mjs +22 -0
- package/dist/{stash-BV4sEp73.mjs → stash-DoRwelwY.mjs} +9 -8
- package/dist/{status-BKF9rRnk.mjs → status-BpMOlfsA.mjs} +8 -7
- package/dist/{status-Cf8c0NON.mjs → status-CmRgHTrV.mjs} +6 -5
- package/dist/{summary-RgLcBcEh.mjs → summary-BEu7pmpq.mjs} +7 -6
- package/dist/{sync-schema-DKEel2Sv.mjs → sync-schema-DTUXubMg.mjs} +11 -10
- package/dist/table-B1iBqmNu.mjs +22 -0
- package/dist/{table-qDD2kApF.mjs → table-DE3i82T_.mjs} +9 -2
- package/dist/transform-BuIooRQh.mjs +31 -0
- package/dist/transform-job-C3yz0krA.mjs +25 -0
- package/dist/transform-tag-CJD6mJUe.mjs +21 -0
- package/dist/{transforms-BOQ9CG0l.mjs → transforms-CWvMpLc9.mjs} +7 -6
- package/dist/{tree-CF8mscd9.mjs → tree-D18vYSe4.mjs} +6 -5
- package/dist/{unpublish-CmaRNjK3.mjs → unpublish-CJbL4ZsC.mjs} +20 -18
- package/dist/{update-Kz4kyqY_.mjs → update-7DacwIvi.mjs} +10 -9
- package/dist/{update-CgQOSuZt.mjs → update-BjjZIe2W.mjs} +10 -9
- package/dist/{update-nwXgVNQa.mjs → update-Bos8nnv0.mjs} +18 -13
- package/dist/{update-BXZBEeUp.mjs → update-BvsvyBw9.mjs} +17 -12
- package/dist/{update-DQPg0_-d.mjs → update-CSxwZ2us.mjs} +11 -10
- package/dist/{update-BuypOaXq.mjs → update-Ck0Kxv8u.mjs} +10 -9
- package/dist/{update-B59h7KmS.mjs → update-DV7IY7IQ.mjs} +10 -9
- package/dist/{update-DERsb0eO.mjs → update-DhOfrW1j.mjs} +19 -13
- package/dist/{update-DR4WkAET.mjs → update-Doia9MP_.mjs} +17 -12
- package/dist/{update-rhfPHALN.mjs → update-Dxa_6H2A.mjs} +22 -13
- package/dist/{update-dashcard-BJVeSGvO.mjs → update-dashcard-CZUWZhal.mjs} +11 -9
- package/dist/{update-DoQpy9SA.mjs → update-mr9todHq.mjs} +10 -9
- package/dist/{upgrade-CNrkJF6s.mjs → upgrade-CBW8V9qZ.mjs} +7 -6
- package/dist/{uuid-Dpl3ALKq.mjs → uuid-D6JVJ-R1.mjs} +10 -5
- package/dist/{validate-VawhJ5Sc.mjs → validate-BqNW4Sk1.mjs} +2 -2
- package/dist/{validate-query-CSV-TTnd.mjs → validate-query-CcZVKYPV.mjs} +3 -3
- package/dist/{values-DMYpkoEH.mjs → values-DBvuGnnA.mjs} +7 -6
- package/dist/{verify-By9ZYzx4.mjs → verify-LIShMNZ2.mjs} +2 -2
- package/dist/{wait-BzIAj8lJ.mjs → wait-DUHze3_B.mjs} +8 -7
- package/dist/{wait-flags-DQrxnlwv.mjs → wait-flags-Ybpt98PK.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +45 -57
- package/skill-data/data-workflow/SKILL.md +116 -0
- package/skill-data/{data-analysis/SKILL.md → data-workflow/references/answering-questions.md} +7 -13
- package/skill-data/{data-transformation/SKILL.md → data-workflow/references/building-clean-tables.md} +46 -48
- package/skill-data/{semantic-layer/SKILL.md → data-workflow/references/reusable-definitions.md} +29 -54
- package/skill-data/document/SKILL.md +10 -20
- package/skill-data/git-sync/SKILL.md +36 -36
- package/skill-data/mbql/SKILL.md +3 -15
- package/skill-data/mbql/references/operators.md +9 -0
- package/skill-data/transform/SKILL.md +26 -42
- package/skill-data/visualization/SKILL.md +6 -6
- package/skill-data/visualization/references/settings.md +12 -0
- package/skills/metabase-cli/SKILL.md +2 -2
- package/dist/add-collection-Bnuh0d4j.mjs +0 -10
- package/dist/auth-Bkue4Psy.mjs +0 -19
- package/dist/card-faWo9ZWU.mjs +0 -20
- package/dist/collection-DcRz7fmf.mjs +0 -20
- package/dist/dashboard-pXAxJTTx.mjs +0 -21
- package/dist/db-CmHHj5eI.mjs +0 -22
- package/dist/document-DQIhL75C.mjs +0 -19
- package/dist/field-B-UcqFzm.mjs +0 -18
- package/dist/git-sync-CwOvcUI2.mjs +0 -28
- package/dist/is-dirty-MT0BT4CS.mjs +0 -9
- package/dist/list-Cx8JxS2C.mjs +0 -42
- package/dist/measure-BIAoqgcS.mjs +0 -19
- package/dist/publish-CGUkIqSm.mjs +0 -70
- package/dist/segment-BN8sFunv.mjs +0 -19
- package/dist/setting-zZjcOPyE.mjs +0 -17
- package/dist/snippet-DK0ZA8m5.mjs +0 -19
- package/dist/table-COAKXNuj.mjs +0 -21
- package/dist/transform-Bto4U82j.mjs +0 -25
- package/dist/transform-job-_fW1y2tg.mjs +0 -22
- package/dist/transform-tag-C8n1oTr1.mjs +0 -18
- package/skill-data/robot-data-engineer/SKILL.md +0 -142
- /package/dist/{body-flags-D7q87Btw.mjs → body-flags-DWTTxJpP.mjs} +0 -0
- /package/dist/{collection-Deiziuu2.mjs → collection-DrLpA1SO.mjs} +0 -0
- /package/dist/{document-qfwR0r63.mjs → document-1W7NRaO_.mjs} +0 -0
- /package/dist/{field-E0IBy4Uw.mjs → field-CMY_LWUe.mjs} +0 -0
- /package/dist/{measure-JJAdFoqK.mjs → measure-DoJvtCaA.mjs} +0 -0
- /package/dist/{paginate-BexjkjbY.mjs → paginate-FVZUxL4J.mjs} +0 -0
- /package/dist/{render-CkuFkWlQ.mjs → render-BTKnWL0d.mjs} +0 -0
- /package/dist/{revision-message-flag-C7zBeWEt.mjs → revision-message-flag-CHrJgFFx.mjs} +0 -0
- /package/dist/{segment-B9SEv9V_.mjs → segment-TXktTCfU.mjs} +0 -0
- /package/dist/{setting-i0pugNHl.mjs → setting-m46MUtW5.mjs} +0 -0
- /package/dist/{snippet-NNzqlksR.mjs → snippet-CtA2Pkoa.mjs} +0 -0
- /package/dist/{transform-n376akp8.mjs → transform-DEF38FWe.mjs} +0 -0
- /package/dist/{transform-job-C8lIS-7Q.mjs → transform-job-CtixL4An.mjs} +0 -0
- /package/dist/{transform-tag-DB46AhAj.mjs → transform-tag-rsIrckCM.mjs} +0 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region src/domain/parameter.ts
|
|
4
|
+
const ParameterType = z.enum([
|
|
5
|
+
"number",
|
|
6
|
+
"text",
|
|
7
|
+
"date",
|
|
8
|
+
"boolean",
|
|
9
|
+
"date/single",
|
|
10
|
+
"id",
|
|
11
|
+
"category",
|
|
12
|
+
"location/city",
|
|
13
|
+
"location/state",
|
|
14
|
+
"location/zip_code",
|
|
15
|
+
"location/country",
|
|
16
|
+
"date/range",
|
|
17
|
+
"date/month-year",
|
|
18
|
+
"date/quarter-year",
|
|
19
|
+
"date/relative",
|
|
20
|
+
"date/all-options",
|
|
21
|
+
"temporal-unit",
|
|
22
|
+
"number/!=",
|
|
23
|
+
"number/<=",
|
|
24
|
+
"number/=",
|
|
25
|
+
"number/>=",
|
|
26
|
+
"number/between",
|
|
27
|
+
"string/!=",
|
|
28
|
+
"string/=",
|
|
29
|
+
"string/contains",
|
|
30
|
+
"string/does-not-contain",
|
|
31
|
+
"string/ends-with",
|
|
32
|
+
"string/starts-with",
|
|
33
|
+
"boolean/="
|
|
34
|
+
]);
|
|
35
|
+
const TemporalUnit = z.enum([
|
|
36
|
+
"millisecond",
|
|
37
|
+
"second",
|
|
38
|
+
"minute",
|
|
39
|
+
"hour",
|
|
40
|
+
"day",
|
|
41
|
+
"week",
|
|
42
|
+
"month",
|
|
43
|
+
"quarter",
|
|
44
|
+
"year",
|
|
45
|
+
"second-of-minute",
|
|
46
|
+
"minute-of-hour",
|
|
47
|
+
"hour-of-day",
|
|
48
|
+
"day-of-week",
|
|
49
|
+
"day-of-month",
|
|
50
|
+
"day-of-year",
|
|
51
|
+
"week-of-year",
|
|
52
|
+
"month-of-year",
|
|
53
|
+
"quarter-of-year",
|
|
54
|
+
"year-of-era",
|
|
55
|
+
"default"
|
|
56
|
+
]);
|
|
57
|
+
const ValuesSourceType = z.enum(["static-list", "card"]);
|
|
58
|
+
const ValuesQueryType = z.enum([
|
|
59
|
+
"list",
|
|
60
|
+
"search",
|
|
61
|
+
"none"
|
|
62
|
+
]);
|
|
63
|
+
const TemplateTagRef = z.tuple([z.literal("template-tag"), z.union([z.string(), z.object({ id: z.string() }).loose()])]);
|
|
64
|
+
const FieldRefLike = z.tuple([z.string()]).rest(z.unknown());
|
|
65
|
+
const DimensionTarget = z.tuple([z.literal("dimension"), z.union([TemplateTagRef, FieldRefLike])]).rest(z.unknown());
|
|
66
|
+
const VariableTarget = z.tuple([z.literal("variable"), z.union([TemplateTagRef, FieldRefLike])]);
|
|
67
|
+
const TextTagTarget = z.tuple([z.literal("text-tag"), z.string()]);
|
|
68
|
+
const ParameterTarget = z.union([
|
|
69
|
+
DimensionTarget,
|
|
70
|
+
VariableTarget,
|
|
71
|
+
TextTagTarget,
|
|
72
|
+
z.number().int(),
|
|
73
|
+
FieldRefLike
|
|
74
|
+
]);
|
|
75
|
+
const ValuesSourceConfig = z.object({
|
|
76
|
+
values: z.array(z.unknown()).optional(),
|
|
77
|
+
card_id: z.number().int().optional(),
|
|
78
|
+
value_field: FieldRefLike.optional(),
|
|
79
|
+
label_field: FieldRefLike.optional()
|
|
80
|
+
}).loose();
|
|
81
|
+
const Parameter = z.object({
|
|
82
|
+
id: z.string(),
|
|
83
|
+
type: ParameterType,
|
|
84
|
+
name: z.string().optional(),
|
|
85
|
+
slug: z.string().optional(),
|
|
86
|
+
sectionId: z.string().optional(),
|
|
87
|
+
default: z.unknown().optional(),
|
|
88
|
+
required: z.boolean().optional(),
|
|
89
|
+
filteringParameters: z.array(z.string()).nullable().optional(),
|
|
90
|
+
target: ParameterTarget.optional(),
|
|
91
|
+
temporal_units: z.array(TemporalUnit).nullable().optional(),
|
|
92
|
+
values_query_type: ValuesQueryType.nullable().optional(),
|
|
93
|
+
values_source_type: ValuesSourceType.nullable().optional(),
|
|
94
|
+
values_source_config: ValuesSourceConfig.nullable().optional()
|
|
95
|
+
}).loose();
|
|
96
|
+
const ParameterMapping = z.object({
|
|
97
|
+
parameter_id: z.string(),
|
|
98
|
+
target: ParameterTarget,
|
|
99
|
+
card_id: z.number().int().nullable().optional()
|
|
100
|
+
}).loose();
|
|
101
|
+
const ParameterValues = z.object({
|
|
102
|
+
values: z.array(z.array(z.unknown())),
|
|
103
|
+
has_more_values: z.boolean()
|
|
104
|
+
}).loose();
|
|
105
|
+
const ParameterValuesCompact = ParameterValues.pick({
|
|
106
|
+
values: true,
|
|
107
|
+
has_more_values: true
|
|
108
|
+
}).strip();
|
|
109
|
+
const parameterValuesView = {
|
|
110
|
+
compactPick: ParameterValuesCompact,
|
|
111
|
+
tableColumns: [{
|
|
112
|
+
key: "has_more_values",
|
|
113
|
+
label: "More available"
|
|
114
|
+
}]
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
export { Parameter, ParameterMapping, ParameterValues, parameterValuesView };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ConfigError } from "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import { ParameterValues, parameterValuesView } from "./parameter-CiJ4CwWE.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
8
|
+
|
|
9
|
+
//#region src/commands/dashboard/parameter-values.ts
|
|
10
|
+
var parameter_values_default = defineMetabaseCommand({
|
|
11
|
+
meta: {
|
|
12
|
+
name: "parameter-values",
|
|
13
|
+
description: "Fetch the selectable values for a dashboard parameter"
|
|
14
|
+
},
|
|
15
|
+
details: "Reads the chain-filter value endpoint. With --query the server returns only values containing the substring (first 1000 matches).",
|
|
16
|
+
skills: [{
|
|
17
|
+
skill: "core",
|
|
18
|
+
purpose: "dashboard parameters and mapping"
|
|
19
|
+
}],
|
|
20
|
+
capabilities: { minVersion: 58 },
|
|
21
|
+
args: {
|
|
22
|
+
...outputFlags,
|
|
23
|
+
...profileFlag,
|
|
24
|
+
...connectionFlags,
|
|
25
|
+
"dashboard-id": {
|
|
26
|
+
type: "positional",
|
|
27
|
+
description: "Dashboard id",
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
"parameter-id": {
|
|
31
|
+
type: "positional",
|
|
32
|
+
description: "Parameter id (the parameter's id, not its slug)",
|
|
33
|
+
required: true
|
|
34
|
+
},
|
|
35
|
+
query: {
|
|
36
|
+
type: "string",
|
|
37
|
+
description: "Substring to search values for (server-side)"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
outputSchema: ParameterValues,
|
|
41
|
+
examples: ["mb dashboard parameter-values 1 order_status --json", "mb dashboard parameter-values 1 order_status --query Cam --json"],
|
|
42
|
+
async run({ args, ctx, getClient }) {
|
|
43
|
+
const dashboardId = parseId(args["dashboard-id"], "dashboard-id");
|
|
44
|
+
const parameterId = args["parameter-id"];
|
|
45
|
+
if (parameterId === "") throw new ConfigError("parameter-id must not be empty");
|
|
46
|
+
const client = await getClient();
|
|
47
|
+
const base = `/api/dashboard/${dashboardId}/params/${encodeURIComponent(parameterId)}`;
|
|
48
|
+
const path = args.query === void 0 || args.query === "" ? `${base}/values` : `${base}/search/${encodeURIComponent(args.query)}`;
|
|
49
|
+
const result = await client.requestParsed(ParameterValues, path);
|
|
50
|
+
const more = result.has_more_values ? " (more available — narrow with --query)" : "";
|
|
51
|
+
renderSummary(result, parameterValuesView, `${result.values.length} value(s)${more}.`, ctx);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { parameter_values_default as default };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { listEnvelopeSchema, outputFlags, wrapList } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { listEnvelopeSchema, outputFlags, wrapList } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderList } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import { findSkillByName, loadAllSkills, loadVisibleSkills } from "./skills-B6gfH0iR.mjs";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
|
|
8
9
|
//#region src/commands/skills/path.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TimeoutError } from "./
|
|
2
|
-
import { combineAborts, throwIfAborted } from "./runtime-
|
|
1
|
+
import { TimeoutError } from "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { combineAborts, throwIfAborted } from "./runtime-BJtuxWM8.mjs";
|
|
3
3
|
import { setTimeout } from "node:timers/promises";
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/poll.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseJsonOrPlain } from "./runtime-
|
|
2
|
-
import { pollUntil } from "./poll-
|
|
1
|
+
import { parseJsonOrPlain } from "./runtime-BJtuxWM8.mjs";
|
|
2
|
+
import { pollUntil } from "./poll-BpAJpvb-.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/domain/git-sync.ts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ChainedRequestError, ConfigError, MetabaseError } from "./
|
|
2
|
-
import { HttpError } from "./runtime-
|
|
3
|
-
import { writeJson } from "./capabilities-
|
|
4
|
-
import { Card } from "./card-
|
|
1
|
+
import { ChainedRequestError, ConfigError, MetabaseError } from "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { HttpError } from "./runtime-BJtuxWM8.mjs";
|
|
3
|
+
import { writeJson } from "./capabilities-N0jo5U7S.mjs";
|
|
4
|
+
import { Card } from "./card-DEmcRlNO.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
//#region src/commands/dashboard/preflight.ts
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import "./parse-id-D4LeTUsP.mjs";
|
|
7
|
+
import { Collection, CollectionCompact } from "./collection-DrLpA1SO.mjs";
|
|
8
|
+
import { ensureLibraryDataCollectionId } from "./resolve-Dj2MTBkn.mjs";
|
|
9
|
+
import { parseTableSelectors, tableSelectorFlags } from "./selectors-DlmZpo2L.mjs";
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
|
|
12
|
+
//#region src/commands/library/publish.ts
|
|
13
|
+
const PUBLISH_TABLES_PATH = "/api/ee/data-studio/table/publish-tables";
|
|
14
|
+
const LibraryPublishResult = z.object({ target_collection: Collection.nullable() });
|
|
15
|
+
const LibraryPublishResultCompact = z.object({ target_collection: CollectionCompact.nullable() });
|
|
16
|
+
const libraryPublishResultView = {
|
|
17
|
+
compactPick: LibraryPublishResultCompact,
|
|
18
|
+
tableColumns: [{
|
|
19
|
+
key: "target_collection",
|
|
20
|
+
label: "Target collection"
|
|
21
|
+
}]
|
|
22
|
+
};
|
|
23
|
+
var publish_default = defineMetabaseCommand({
|
|
24
|
+
meta: {
|
|
25
|
+
name: "publish",
|
|
26
|
+
description: "Publish tables (and their upstream dependencies) to the Library Data collection"
|
|
27
|
+
},
|
|
28
|
+
details: "Sets each selected table and every upstream table it depends on into the Library Data collection, so they appear first in data pickers and rank up in search. The Library Data collection is resolved automatically (and the Library is created if it doesn't exist yet). Select with --table-ids, --db-ids, or --schemas (each schema id is \"<db-id>:<schema>\", e.g. 1:public); the filters are combined.",
|
|
29
|
+
capabilities: {
|
|
30
|
+
minVersion: 59,
|
|
31
|
+
tokenFeature: "library"
|
|
32
|
+
},
|
|
33
|
+
args: {
|
|
34
|
+
...outputFlags,
|
|
35
|
+
...profileFlag,
|
|
36
|
+
...connectionFlags,
|
|
37
|
+
...tableSelectorFlags
|
|
38
|
+
},
|
|
39
|
+
outputSchema: LibraryPublishResult,
|
|
40
|
+
examples: [
|
|
41
|
+
"mb library publish --table-ids 1,2,3",
|
|
42
|
+
"mb library publish --db-ids 1 --json",
|
|
43
|
+
"mb library publish --schemas 1:public,1:analytics"
|
|
44
|
+
],
|
|
45
|
+
async run({ args, ctx, getClient }) {
|
|
46
|
+
const selectors = parseTableSelectors(args);
|
|
47
|
+
const client = await getClient();
|
|
48
|
+
const collectionId = await ensureLibraryDataCollectionId(client);
|
|
49
|
+
const body = {
|
|
50
|
+
collection_id: collectionId,
|
|
51
|
+
...selectors
|
|
52
|
+
};
|
|
53
|
+
const result = await client.requestParsed(LibraryPublishResult, PUBLISH_TABLES_PATH, {
|
|
54
|
+
method: "POST",
|
|
55
|
+
body
|
|
56
|
+
});
|
|
57
|
+
renderSummary(result, libraryPublishResultView, summaryLine(result), ctx);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
function summaryLine(result) {
|
|
61
|
+
const collection = result.target_collection;
|
|
62
|
+
if (collection === null) return "Published tables to the Library.";
|
|
63
|
+
return `Published tables to the Library (collection ${collection.id} "${collection.name}").`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
//#endregion
|
|
67
|
+
export { publish_default as default };
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
1
|
+
import { ConfigError } from "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary, writeJson } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import "./input-7Sj85_K7.mjs";
|
|
7
|
+
import "./field-CMY_LWUe.mjs";
|
|
8
|
+
import "./parameter-CiJ4CwWE.mjs";
|
|
9
|
+
import { CardQueryResult, cardQueryView } from "./card-DEmcRlNO.mjs";
|
|
10
|
+
import { readBody } from "./body-IcJ5kFtk.mjs";
|
|
11
|
+
import { bodyInputFlags } from "./body-flags-DWTTxJpP.mjs";
|
|
12
|
+
import { assertNotLegacyEnvelopeWrappingMbql5, getQuerySchemaBundle, isMbql5Query, validateQuery } from "./validate-BqNW4Sk1.mjs";
|
|
13
|
+
import { skipValidateFlag } from "./validate-query-CcZVKYPV.mjs";
|
|
14
|
+
import { formatQueryResult } from "./query-result-D6mfoVfQ.mjs";
|
|
13
15
|
import { z } from "zod";
|
|
14
16
|
|
|
15
17
|
//#region src/commands/query.ts
|
|
@@ -20,7 +22,11 @@ var query_default = defineMetabaseCommand({
|
|
|
20
22
|
name: "query",
|
|
21
23
|
description: "Run an ad-hoc MBQL or native query"
|
|
22
24
|
},
|
|
23
|
-
details: "Reads a JSON query body from --body, --file, or stdin and runs it. MBQL 5 is Metabase's structured query format, shaped {\"lib/type\":\"mbql/query\", \"database\": <id>, \"stages\": [...]}; it is checked against a bundled JSON Schema before sending — --print-schema prints that schema, and --dry-run reports any errors as {ok, errors:[{path, message}]} and exits 2 without sending. Legacy MBQL 4 and native-SQL bodies are not checked and run as-is.
|
|
25
|
+
details: "Reads a JSON query body from --body, --file, or stdin and runs it. MBQL 5 is Metabase's structured query format, shaped {\"lib/type\":\"mbql/query\", \"database\": <id>, \"stages\": [...]}; it is checked against a bundled JSON Schema before sending — --print-schema prints that schema, and --dry-run reports any errors as {ok, errors:[{path, message}]} and exits 2 without sending. Legacy MBQL 4 and native-SQL bodies are not checked and run as-is.",
|
|
26
|
+
skills: [{
|
|
27
|
+
skill: "mbql",
|
|
28
|
+
purpose: "body shape, clause rules, and the dry-run loop"
|
|
29
|
+
}],
|
|
24
30
|
capabilities: { minVersion: 58 },
|
|
25
31
|
args: {
|
|
26
32
|
...outputFlags,
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
1
|
+
import { ConfigError } from "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand, parseJson } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import "./field-CMY_LWUe.mjs";
|
|
7
|
+
import "./parameter-CiJ4CwWE.mjs";
|
|
8
|
+
import { CardQueryResult, cardQueryView } from "./card-DEmcRlNO.mjs";
|
|
9
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
10
|
+
import { formatQueryResult } from "./query-result-D6mfoVfQ.mjs";
|
|
9
11
|
import { z } from "zod";
|
|
10
12
|
import { Writable } from "node:stream";
|
|
11
13
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import "./poll-
|
|
8
|
-
import
|
|
1
|
+
import "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
7
|
+
import "./poll-BpAJpvb-.mjs";
|
|
8
|
+
import "./poll-task-TilgciQn.mjs";
|
|
9
|
+
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-C-t9SQBk.mjs";
|
|
9
10
|
|
|
10
11
|
//#region src/commands/git-sync/remove-collection.ts
|
|
11
12
|
var remove_collection_default = defineMetabaseCommand({
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import
|
|
1
|
+
import "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import "./field-CMY_LWUe.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
8
|
+
import "./table-DE3i82T_.mjs";
|
|
9
|
+
import { DatabaseSyncResult, DatabaseTaskAck, databaseSyncResultView } from "./database-D9fftP-i.mjs";
|
|
9
10
|
|
|
10
11
|
//#region src/commands/db/rescan-values.ts
|
|
11
12
|
var rescan_values_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { Collection } from "./collection-DrLpA1SO.mjs";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
//#region src/domain/library.ts
|
|
5
|
+
const LibraryChild = Collection.pick({
|
|
6
|
+
id: true,
|
|
7
|
+
name: true,
|
|
8
|
+
type: true,
|
|
9
|
+
description: true
|
|
10
|
+
}).strip();
|
|
11
|
+
const Library = Collection.extend({ effective_children: z.array(LibraryChild) }).loose();
|
|
12
|
+
const LibraryCompact = Library.pick({
|
|
13
|
+
id: true,
|
|
14
|
+
name: true,
|
|
15
|
+
type: true,
|
|
16
|
+
effective_children: true
|
|
17
|
+
}).strip();
|
|
18
|
+
const libraryView = {
|
|
19
|
+
compactPick: LibraryCompact,
|
|
20
|
+
tableColumns: [
|
|
21
|
+
{
|
|
22
|
+
key: "id",
|
|
23
|
+
label: "ID"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: "name",
|
|
27
|
+
label: "Name"
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
key: "type",
|
|
31
|
+
label: "Type"
|
|
32
|
+
}
|
|
33
|
+
]
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
//#region src/commands/library/resolve.ts
|
|
38
|
+
const LIBRARY_ROOT_PATH = "/api/ee/library/";
|
|
39
|
+
const COLLECTION_LIST_PATH = "/api/collection";
|
|
40
|
+
const LIBRARY_DATA_TYPE = "library-data";
|
|
41
|
+
const AbsentLibrary = z.object({ data: z.null() });
|
|
42
|
+
const LibraryOrAbsent = z.union([Library, AbsentLibrary]);
|
|
43
|
+
const LibraryCollectionEntry = Collection.pick({
|
|
44
|
+
id: true,
|
|
45
|
+
type: true
|
|
46
|
+
}).strip();
|
|
47
|
+
const LibraryCollections = z.array(LibraryCollectionEntry);
|
|
48
|
+
async function fetchLibrary(client) {
|
|
49
|
+
const result = await client.requestParsed(LibraryOrAbsent, LIBRARY_ROOT_PATH);
|
|
50
|
+
if (!("effective_children" in result)) return null;
|
|
51
|
+
const typeById = await fetchLibraryCollectionTypes(client);
|
|
52
|
+
const effective_children = result.effective_children.map((child) => typeof child.id === "number" ? {
|
|
53
|
+
...child,
|
|
54
|
+
type: typeById.get(child.id) ?? child.type
|
|
55
|
+
} : child);
|
|
56
|
+
return {
|
|
57
|
+
...result,
|
|
58
|
+
effective_children
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
async function fetchLibraryCollectionTypes(client) {
|
|
62
|
+
const collections = await client.requestParsed(LibraryCollections, COLLECTION_LIST_PATH, { query: { "include-library": true } });
|
|
63
|
+
const typeById = new Map();
|
|
64
|
+
for (const collection of collections) if (typeof collection.id === "number" && collection.type != null) typeById.set(collection.id, collection.type);
|
|
65
|
+
return typeById;
|
|
66
|
+
}
|
|
67
|
+
async function createLibrary(client) {
|
|
68
|
+
const existing = await fetchLibrary(client);
|
|
69
|
+
if (existing !== null) return existing;
|
|
70
|
+
await client.requestRaw(LIBRARY_ROOT_PATH, { method: "POST" });
|
|
71
|
+
const created = await fetchLibrary(client);
|
|
72
|
+
if (created === null) throw new Error(`Library was not created after POST ${LIBRARY_ROOT_PATH}`);
|
|
73
|
+
return created;
|
|
74
|
+
}
|
|
75
|
+
async function ensureLibraryDataCollectionId(client) {
|
|
76
|
+
const library = await createLibrary(client);
|
|
77
|
+
const data = library.effective_children.find((child) => child.type === LIBRARY_DATA_TYPE);
|
|
78
|
+
if (data === void 0) throw new Error("Library has no Data collection to publish into");
|
|
79
|
+
if (typeof data.id !== "number") throw new Error(`Library Data collection has a non-numeric id ${String(data.id)}`);
|
|
80
|
+
return data.id;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
export { Library, createLibrary, ensureLibraryDataCollectionId, fetchLibrary, libraryView };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
|
|
8
9
|
//#region src/commands/transform-job/run.ts
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { TimeoutError } from "./
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
1
|
+
import { TimeoutError } from "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
7
|
+
import { pollUntil } from "./poll-BpAJpvb-.mjs";
|
|
8
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-Ybpt98PK.mjs";
|
|
9
|
+
import { Transform, TransformRun } from "./transform-DEF38FWe.mjs";
|
|
9
10
|
import { z } from "zod";
|
|
10
11
|
|
|
11
12
|
//#region src/commands/transform/run.ts
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderList } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
7
|
+
import { collectPaginated } from "./paginate-FVZUxL4J.mjs";
|
|
8
|
+
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-DEF38FWe.mjs";
|
|
8
9
|
|
|
9
10
|
//#region src/commands/transform/runs.ts
|
|
10
11
|
const TransformRunListEnvelope = listEnvelopeSchema(TransformRunCompact);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AbortError, ConfigError, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, ValidationError, errorMessage, flagConsumesValue, isNotFoundError, normalizeFlag,
|
|
2
|
-
import { DEFAULT_MAX_BYTES, ENV_API_KEY, ENV_DISABLE_KEYRING, ENV_PROFILE, ENV_SKIP_PREFLIGHT, ENV_URL, consumeLegacyEnvWarnings, package_default, readEnv, reportError } from "./error-
|
|
3
|
-
import {
|
|
1
|
+
import { AbortError, ConfigError, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, ValidationError, errorMessage, flagConsumesValue, isNotFoundError, normalizeFlag, toAliasArray, warn } from "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { DEFAULT_MAX_BYTES, ENV_API_KEY, ENV_DISABLE_KEYRING, ENV_PROFILE, ENV_SKIP_PREFLIGHT, ENV_URL, consumeLegacyEnvWarnings, package_default, readEnv, reportError } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import { setMetabaseAugment } from "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { BASELINE_CAPABILITIES, isPlainObject } from "./capabilities-N0jo5U7S.mjs";
|
|
4
5
|
import { defineCommand } from "citty";
|
|
5
6
|
import { z } from "zod";
|
|
6
7
|
import { promises } from "node:fs";
|
|
@@ -1627,6 +1628,7 @@ function defineMetabaseCommand(def) {
|
|
|
1627
1628
|
setMetabaseAugment(cmd, {
|
|
1628
1629
|
examples: def.examples ?? [],
|
|
1629
1630
|
details: def.details ? def.details : null,
|
|
1631
|
+
skills: def.skills ?? [],
|
|
1630
1632
|
outputSchema: def.outputSchema ?? null,
|
|
1631
1633
|
capabilities: required
|
|
1632
1634
|
});
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import "./notice-DyVl5aYB.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-5H_tcfL8.mjs";
|
|
3
|
+
import "./command-augment-DdZIfx1V.mjs";
|
|
4
|
+
import { defineMetabaseCommand } from "./runtime-BJtuxWM8.mjs";
|
|
5
|
+
import { renderList } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
+
import "./field-CMY_LWUe.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
8
|
+
import { Table, TableCompact, tableView } from "./table-DE3i82T_.mjs";
|
|
8
9
|
import { z } from "zod";
|
|
9
10
|
|
|
10
11
|
//#region src/commands/db/schema-tables.ts
|