@metabase/cli 0.1.17 → 0.2.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 +61 -35
- package/dist/{add-collection-C-t9SQBk.mjs → add-collection-BTSGp4f9.mjs} +4 -5
- package/dist/add-collection-DlAwt2Z3.mjs +9 -0
- package/dist/append-DY1-O789.mjs +42 -0
- package/dist/{archive-wNXwIiF0.mjs → archive-BOEEMrYL.mjs} +6 -8
- package/dist/{archive-CaoUUTIb.mjs → archive-CJ9rElKn.mjs} +6 -8
- package/dist/{archive-DS-KEB4a.mjs → archive-CWtUzlHO.mjs} +5 -7
- package/dist/{archive-LG8u7ec5.mjs → archive-DCPw3df6.mjs} +5 -7
- package/dist/{archive-D1FX-sbU.mjs → archive-DOa1u1aJ.mjs} +5 -7
- package/dist/{archive-C7dnyzVY.mjs → archive-pHsa4dL0.mjs} +8 -9
- package/dist/{archive-qSOcACQo.mjs → archive-w6TX-zEk.mjs} +7 -8
- package/dist/auth-BrQtY0pO.mjs +22 -0
- package/dist/{body-IcJ5kFtk.mjs → body-C1_AaTS4.mjs} +3 -3
- package/dist/{branches-BlNCTmFB.mjs → branches-BsBzaGIf.mjs} +5 -7
- package/dist/{cancel-BnveTPNw.mjs → cancel-BNM0yyx-.mjs} +4 -6
- package/dist/{cancel-task-CSVI8Zgl.mjs → cancel-task-Bggzn4JL.mjs} +5 -7
- package/dist/capabilities-DrDJo_ng.mjs +684 -0
- package/dist/{card-DEmcRlNO.mjs → card-B8G5jQQT.mjs} +24 -18
- package/dist/card-DHCcmpgr.mjs +26 -0
- package/dist/{cards-CMgGA8OZ.mjs → cards-D0hvA13L.mjs} +7 -8
- package/dist/cli.mjs +175 -29
- package/dist/{collection-DrLpA1SO.mjs → collection-CFoLPrY5.mjs} +1 -1
- package/dist/collection-D0O9gp3S.mjs +23 -0
- package/dist/{collection-namespace-CsaxEqOb.mjs → collection-namespace-DqPNrCdQ.mjs} +2 -2
- package/dist/{create-I5Cv-MBa.mjs → create-05rX4oL-.mjs} +11 -12
- package/dist/{create-B6LQutd0.mjs → create-BR7x66KW.mjs} +12 -13
- package/dist/{create-B79M8YpX.mjs → create-C17Fh1_X.mjs} +9 -10
- package/dist/{create-FZOrCw5k.mjs → create-C8ndg3g4.mjs} +28 -21
- package/dist/{create-C7u3umLj.mjs → create-CZ9KFnbi.mjs} +8 -9
- package/dist/{create-B1xfaZJB.mjs → create-Cii_utzV.mjs} +5 -7
- package/dist/{create-SHKlj0z3.mjs → create-Cyv7vHV_.mjs} +8 -9
- package/dist/{create-Bg_uMu0p.mjs → create-DKuixGJ2.mjs} +8 -9
- package/dist/{create-AeWNv0v-.mjs → create-E6L3WMqV.mjs} +8 -9
- package/dist/{create-LHqwcVbS.mjs → create-a3s1S2Dw.mjs} +11 -12
- package/dist/{create-branch-CGyT99Ny.mjs → create-branch-Dxn6UnV_.mjs} +5 -7
- package/dist/{create-BpkWlgoR.mjs → create-oLb0E-ZP.mjs} +17 -14
- package/dist/csv-T6_vlLJS.mjs +58 -0
- package/dist/{current-task-C-0hw2Ae.mjs → current-task-DxWbw-bU.mjs} +5 -7
- package/dist/{dashboard-DOplbKyQ.mjs → dashboard-B-MTpfeS.mjs} +35 -15
- package/dist/dashboard-BpSPoeAn.mjs +35 -0
- package/dist/{database-D9fftP-i.mjs → database-CIbVSfua.mjs} +2 -2
- package/dist/db-DBRijnh4.mjs +27 -0
- package/dist/{delete-tCVrYjKD.mjs → delete--P1xFX37.mjs} +6 -8
- package/dist/{delete-Do3nn9sl.mjs → delete-BBOIUl0D.mjs} +6 -8
- package/dist/{delete--NYYN6wv.mjs → delete-Ce2EBQYA.mjs} +6 -8
- package/dist/{delete-runtime-B0ha5QR4.mjs → delete-runtime-B-8I9V1g.mjs} +2 -3
- package/dist/{delete-table-CWSGPw0i.mjs → delete-table-Bj32NsXn.mjs} +6 -8
- package/dist/{dependencies-CyFocD8I.mjs → dependencies-ixzjVjUz.mjs} +5 -7
- package/dist/{dirty-BXM0YJ_a.mjs → dirty-CH70h5m5.mjs} +5 -7
- package/dist/{document-1W7NRaO_.mjs → document-CL4ML5FN.mjs} +20 -4
- package/dist/document-dZpuFu3I.mjs +22 -0
- package/dist/{eid-p-zn_1RJ.mjs → eid-XjkBbyb_.mjs} +10 -11
- package/dist/embedding-CKdw8q7p.mjs +11 -0
- package/dist/{export-B_8wghyo.mjs → export-CChMg-mL.mjs} +7 -9
- package/dist/field-B1heFeCz.mjs +21 -0
- package/dist/{field-CMY_LWUe.mjs → field-DsXTeqBy.mjs} +6 -4
- package/dist/{fields-BsufL9kv.mjs → fields-C7h2QwUp.mjs} +6 -8
- package/dist/{get-Cl5Ak73C.mjs → get-AvGH_oph.mjs} +8 -9
- package/dist/{get-DurjkUKJ.mjs → get-B6ZJCJ8H.mjs} +5 -7
- package/dist/{get-68P-L4ja.mjs → get-BWHJDa0B.mjs} +5 -7
- package/dist/{get-B67pe00Z.mjs → get-BsyccuCH.mjs} +5 -7
- package/dist/{get-C7mq17-2.mjs → get-C98IFgFi.mjs} +5 -7
- package/dist/{get-BTKeO4vE.mjs → get-Cj90oyxG.mjs} +5 -7
- package/dist/{get-BJoZkATD.mjs → get-D9r2znrn.mjs} +5 -7
- package/dist/{get-D3k2JUsa.mjs → get-DRZENkCj.mjs} +5 -7
- package/dist/{get-4lufgahL.mjs → get-DWWmpQ87.mjs} +5 -7
- package/dist/{get-CPw0ROO4.mjs → get-Dg1J0wxb.mjs} +5 -7
- package/dist/{get-B45uYMAs.mjs → get-DrWYvefc.mjs} +7 -8
- package/dist/{get-DTqBuIf3.mjs → get-KVN9ANVh.mjs} +4 -6
- package/dist/get-RlP_xiUd.mjs +67 -0
- package/dist/{get-Df_3LCVC.mjs → get-cyR67Lmq.mjs} +5 -7
- package/dist/{get-DeLnNVQE.mjs → get-kqY2lwhO.mjs} +16 -9
- package/dist/{get-run-Dq4qfGfD.mjs → get-run-C4C_QQqO.mjs} +5 -7
- package/dist/git-sync-JHa7bIyY.mjs +31 -0
- package/dist/{group-BNE_RiH5.mjs → group-CILtQqCL.mjs} +2 -1
- package/dist/{has-remote-changes-E-4N_O_t.mjs → has-remote-changes-dLUGr0MD.mjs} +5 -7
- package/dist/{import-Dg0j3HCP.mjs → import-Byull6jF.mjs} +7 -9
- package/dist/{input-7Sj85_K7.mjs → input-m9ctfLxZ.mjs} +6 -3
- package/dist/is-dirty-Bb2dfEYs.mjs +8 -0
- package/dist/{is-dirty-DWw1yBeR.mjs → is-dirty-CU3ovgdG.mjs} +3 -4
- package/dist/{items-CQtt9X4M.mjs → items-CEGDYWuF.mjs} +7 -9
- package/dist/{key-bltP32Pm.mjs → key-Ge4VwWvS.mjs} +1 -1
- package/dist/{library-B5AvpACG.mjs → library-DHWWa4Tt.mjs} +6 -6
- package/dist/{list-BFVuPodI.mjs → list-3z1ZChTG.mjs} +4 -6
- package/dist/{list-D3TSAqwl.mjs → list-B9TyELob.mjs} +4 -6
- package/dist/{list-BAOTQHst.mjs → list-BFm4iEBt.mjs} +4 -6
- package/dist/{list-BKUvhAs4.mjs → list-BliCJAjt.mjs} +4 -6
- package/dist/{list-BgUWqZa2.mjs → list-Bpv06V24.mjs} +6 -8
- package/dist/{list-DG0FIhTK.mjs → list-Br48kL09.mjs} +4 -6
- package/dist/{list-BHAWYZ1z.mjs → list-BtcpNl4-.mjs} +4 -6
- package/dist/{list-B1uVWy6A.mjs → list-BuyRG3GB.mjs} +7 -8
- package/dist/{list-CvhVYOVl.mjs → list-CMb03cv3.mjs} +5 -7
- package/dist/{list-CfqpDTna.mjs → list-CmCJwaGT.mjs} +4 -6
- package/dist/{list-C4bALfCs.mjs → list-Cur_72xZ.mjs} +5 -7
- package/dist/{list-BF-W4jOZ.mjs → list-D9FY30xH.mjs} +8 -9
- package/dist/{list-D5Gdz8hi.mjs → list-DEkPxVZu.mjs} +4 -6
- package/dist/{list-C9O2RY5u.mjs → list-O2w5xd1q.mjs} +4 -6
- package/dist/{list-KxQNqp4T.mjs → list-th_Ym6Cv.mjs} +6 -8
- package/dist/{login-Bt6j6yBM.mjs → login-hKlYsAa1.mjs} +8 -10
- package/dist/{logout-ANkL02p0.mjs → logout-DO8GVC6b.mjs} +4 -6
- package/dist/measure-R3T20wnB.mjs +25 -0
- package/dist/{measure-DoJvtCaA.mjs → measure-S9WszHre.mjs} +5 -4
- package/dist/{parameter-values-D4J8Ctu0.mjs → parameter-values-BJb2GuLz.mjs} +7 -9
- package/dist/{parse-enum-BL9i_brN.mjs → parse-enum-Cfne2suT.mjs} +1 -1
- package/dist/{parse-id-D4LeTUsP.mjs → parse-id-DfY0Lugw.mjs} +1 -1
- package/dist/{parse-ref-CB_KvF9h.mjs → parse-ref-C_MsXYI6.mjs} +1 -1
- package/dist/{path-5nQgdvrs.mjs → path-DzhQVCH8.mjs} +4 -6
- package/dist/{poll-BpAJpvb-.mjs → poll-D1Yg78c3.mjs} +2 -2
- package/dist/{poll-task-TilgciQn.mjs → poll-task-DLUZaglY.mjs} +2 -2
- package/dist/{preflight-OfHU3Toi.mjs → preflight-Cy2jUSca.mjs} +4 -5
- package/dist/{process-j8UHMHc2.mjs → process-D5HN1wpT.mjs} +1 -1
- package/dist/{prompt-C85xd9HR.mjs → prompt-ZG9Drin_.mjs} +1 -1
- package/dist/{publish-DKiqyDwo.mjs → publish-3hmHoaX-.mjs} +7 -9
- package/dist/{query-CQ3xXa9P.mjs → query-DTASj9Zu.mjs} +9 -10
- package/dist/{query-BWJ5h1g3.mjs → query-DkZViD_3.mjs} +15 -15
- package/dist/{query-result-D6mfoVfQ.mjs → query-result-CbTFdlSf.mjs} +1 -1
- package/dist/{remove-collection-CO-aMzTO.mjs → remove-collection-D3wH9H6R.mjs} +7 -9
- package/dist/replace-CFzqkZXs.mjs +42 -0
- package/dist/requests-KBiY9UYy.mjs +96 -0
- package/dist/{rescan-values-DpL6LGAK.mjs → rescan-values-B1WycObS.mjs} +7 -9
- package/dist/{resolve-Dj2MTBkn.mjs → resolve-Ct084wx3.mjs} +1 -1
- package/dist/{run-DUcdaZs3.mjs → run-B8qEEdC8.mjs} +4 -6
- package/dist/{run-QYJ-mAaG.mjs → run-cw0qTEQ7.mjs} +7 -9
- package/dist/{runs-DgasTnGd.mjs → runs-BOA4kK_X.mjs} +6 -8
- package/dist/{runtime-BJtuxWM8.mjs → runtime-B-c-Fc2i.mjs} +3 -4
- package/dist/{schema-tables-ooYjimrV.mjs → schema-tables-DRYzSVcW.mjs} +6 -8
- package/dist/{schemas-HjFPzsd-.mjs → schemas-BiMjD25L.mjs} +4 -6
- package/dist/{search-vaT5EwhG.mjs → search-DjKxRXO5.mjs} +4 -6
- package/dist/{segment-TXktTCfU.mjs → segment-BPb1H6DW.mjs} +6 -5
- package/dist/segment-CZkk0g79.mjs +25 -0
- package/dist/{selectors-DlmZpo2L.mjs → selectors-B7MJUn3I.mjs} +3 -3
- package/dist/{set-active-oZOUe9V7.mjs → set-active-CF868qdW.mjs} +4 -6
- package/dist/{set-CLHJauzG.mjs → set-kyoORFG3.mjs} +10 -10
- package/dist/setting-BZgjURQ_.mjs +20 -0
- package/dist/{setup-D1de5Sbc.mjs → setup-D9joJYPb.mjs} +11 -12
- package/dist/{skills-B6gfH0iR.mjs → skills-BqI05u72.mjs} +1 -1
- package/dist/{skills-NhgVypJ7.mjs → skills-D8NrJxjp.mjs} +3 -3
- package/dist/{snippet-CtA2Pkoa.mjs → snippet-DWiXNy4T.mjs} +7 -4
- package/dist/snippet-y_FzKxaQ.mjs +22 -0
- package/dist/{stash-DoRwelwY.mjs → stash-BVMerTaF.mjs} +7 -9
- package/dist/{status-CmRgHTrV.mjs → status-C-0jFjFn.mjs} +4 -6
- package/dist/{status-BpMOlfsA.mjs → status-x8bDOa1i.mjs} +6 -8
- package/dist/{summary-BEu7pmpq.mjs → summary-B-R9SdMF.mjs} +5 -7
- package/dist/{sync-schema-DTUXubMg.mjs → sync-schema-wne2KXIW.mjs} +9 -11
- package/dist/{table-DE3i82T_.mjs → table-C3RIKiYM.mjs} +16 -4
- package/dist/table-CS2-2INi.mjs +21 -0
- package/dist/transform-6hqM1DXA.mjs +31 -0
- package/dist/{transform-DEF38FWe.mjs → transform-JQel7e5H.mjs} +31 -5
- package/dist/transform-job-DuERhLaj.mjs +25 -0
- package/dist/transform-tag-DaNKreDj.mjs +21 -0
- package/dist/{transforms-CWvMpLc9.mjs → transforms-DB2WNP2R.mjs} +5 -7
- package/dist/{tree-D18vYSe4.mjs → tree-BIOphGVs.mjs} +4 -6
- package/dist/{unpublish-CJbL4ZsC.mjs → unpublish-BWM36ZTg.mjs} +5 -7
- package/dist/{update-mr9todHq.mjs → update-6umfSz5t.mjs} +9 -10
- package/dist/{update-BjjZIe2W.mjs → update-7Ts7KrB8.mjs} +9 -10
- package/dist/{update-Doia9MP_.mjs → update-BCbv880u.mjs} +12 -13
- package/dist/{update-CSxwZ2us.mjs → update-BchtHlbH.mjs} +10 -11
- package/dist/{update-BvsvyBw9.mjs → update-BiUeEGU-.mjs} +12 -13
- package/dist/{update-DhOfrW1j.mjs → update-BlzcZwRQ.mjs} +18 -15
- package/dist/{update-Bos8nnv0.mjs → update-CTZg2Lia.mjs} +13 -14
- package/dist/{update-DV7IY7IQ.mjs → update-DJDuIhYG.mjs} +9 -10
- package/dist/{update-Dxa_6H2A.mjs → update-HxYcvpSq.mjs} +15 -15
- package/dist/{update-Ck0Kxv8u.mjs → update-Sz0QRGWB.mjs} +9 -10
- package/dist/{update-dashcard-CZUWZhal.mjs → update-dashcard-CfDpy7Lz.mjs} +11 -11
- package/dist/{update-7DacwIvi.mjs → update-zfLbmC-H.mjs} +9 -10
- package/dist/{upgrade-CBW8V9qZ.mjs → upgrade-BWl0VjMK.mjs} +5 -7
- package/dist/upload-CPzOhGeX.mjs +16 -0
- package/dist/{uuid-D6JVJ-R1.mjs → uuid-D_YeqDui.mjs} +3 -5
- package/dist/{validate-BqNW4Sk1.mjs → validate-clAWO3X-.mjs} +1 -2
- package/dist/{validate-query-CcZVKYPV.mjs → validate-query-CsK2_2_u.mjs} +2 -3
- package/dist/{values-DBvuGnnA.mjs → values-DSk8ZJ3B.mjs} +5 -7
- package/dist/{verify-LIShMNZ2.mjs → verify-DkQdLjf3.mjs} +2 -2
- package/dist/{wait-DUHze3_B.mjs → wait-DvSsMjea.mjs} +6 -8
- package/dist/{wait-flags-Ybpt98PK.mjs → wait-flags-dXGThljd.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +31 -22
- package/skill-data/dashboard/SKILL.md +130 -0
- package/skill-data/data-workflow/SKILL.md +17 -15
- package/skill-data/data-workflow/references/building-clean-tables.md +1 -1
- package/skill-data/document/SKILL.md +3 -3
- package/skill-data/git-sync/SKILL.md +5 -5
- package/skill-data/mbql/SKILL.md +17 -17
- package/skill-data/mbql/references/operators.md +4 -3
- package/skill-data/metadata/SKILL.md +78 -0
- package/skill-data/metadata/references/semantic-types.md +83 -0
- package/skill-data/native-sql/SKILL.md +118 -0
- package/skill-data/native-sql/references/template-tags.md +178 -0
- package/skill-data/transform/SKILL.md +6 -6
- package/skill-data/visualization/SKILL.md +3 -3
- package/skill-data/visualization/references/settings.md +2 -0
- package/dist/add-collection-Dek6kiRI.mjs +0 -11
- package/dist/auth-Kv2MRkRk.mjs +0 -22
- package/dist/capabilities-N0jo5U7S.mjs +0 -239
- package/dist/card-Bp58WEUF.mjs +0 -26
- package/dist/collection-D8TI20Ir.mjs +0 -23
- package/dist/dashboard-C9pQCnX6.mjs +0 -28
- package/dist/db-DWykmBOh.mjs +0 -28
- package/dist/document-DNDm8_Py.mjs +0 -22
- package/dist/error-5H_tcfL8.mjs +0 -227
- package/dist/field-CFt1-KDR.mjs +0 -21
- package/dist/get-CDLa6LiC.mjs +0 -50
- package/dist/git-sync-ByvjqSiy.mjs +0 -31
- package/dist/is-dirty-D7UMN0mt.mjs +0 -10
- package/dist/manifest-BVf8P4bl.mjs +0 -126
- package/dist/measure-CgFwtL1r.mjs +0 -25
- package/dist/metadata-ClehtgZj.mjs +0 -39
- package/dist/metadata-DplshwI3.mjs +0 -38
- package/dist/notice-DyVl5aYB.mjs +0 -206
- package/dist/segment-BPC725mo.mjs +0 -25
- package/dist/setting-DHYO-W5g.mjs +0 -20
- package/dist/snippet-DtLmHr2J.mjs +0 -22
- package/dist/table-B1iBqmNu.mjs +0 -22
- package/dist/transform-BuIooRQh.mjs +0 -31
- package/dist/transform-job-C3yz0krA.mjs +0 -25
- package/dist/transform-tag-CJD6mJUe.mjs +0 -21
- /package/dist/{body-flags-DWTTxJpP.mjs → body-flags-CgHgJBRC.mjs} +0 -0
- /package/dist/{command-augment-DdZIfx1V.mjs → command-augment-D9pI9Vbh.mjs} +0 -0
- /package/dist/{paginate-FVZUxL4J.mjs → paginate-CMqbqhMC.mjs} +0 -0
- /package/dist/{parameter-CiJ4CwWE.mjs → parameter-BZ6y-Gfs.mjs} +0 -0
- /package/dist/{render-BTKnWL0d.mjs → render-CkuFkWlQ.mjs} +0 -0
- /package/dist/{revision-message-flag-CHrJgFFx.mjs → revision-message-flag-CHzX0cqV.mjs} +0 -0
- /package/dist/{setting-m46MUtW5.mjs → setting-Cko6bE_w.mjs} +0 -0
- /package/dist/{transform-job-CtixL4An.mjs → transform-job-CtVziW85.mjs} +0 -0
- /package/dist/{transform-tag-rsIrckCM.mjs → transform-tag-wFiWmiyO.mjs} +0 -0
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { formatQueryResult } from "./query-result-D6mfoVfQ.mjs";
|
|
1
|
+
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseJson } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./embedding-CKdw8q7p.mjs";
|
|
5
|
+
import "./field-DsXTeqBy.mjs";
|
|
6
|
+
import "./parameter-BZ6y-Gfs.mjs";
|
|
7
|
+
import { CardQueryResult, cardQueryView } from "./card-B8G5jQQT.mjs";
|
|
8
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
9
|
+
import { formatQueryResult } from "./query-result-CbTFdlSf.mjs";
|
|
11
10
|
import { z } from "zod";
|
|
12
11
|
import { Writable } from "node:stream";
|
|
13
12
|
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { formatQueryResult } from "./query-result-D6mfoVfQ.mjs";
|
|
1
|
+
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary, writeJson } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import "./embedding-CKdw8q7p.mjs";
|
|
6
|
+
import "./field-DsXTeqBy.mjs";
|
|
7
|
+
import "./parameter-BZ6y-Gfs.mjs";
|
|
8
|
+
import { CardQueryResult, cardQueryView } from "./card-B8G5jQQT.mjs";
|
|
9
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
10
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
11
|
+
import { assertNotLegacyEnvelopeWrappingMbql5, getQuerySchemaBundle, isMbql5Query, validateQuery } from "./validate-clAWO3X-.mjs";
|
|
12
|
+
import { skipValidateFlag } from "./validate-query-CsK2_2_u.mjs";
|
|
13
|
+
import { formatQueryResult } from "./query-result-CbTFdlSf.mjs";
|
|
15
14
|
import { z } from "zod";
|
|
16
15
|
|
|
17
16
|
//#region src/commands/query.ts
|
|
18
|
-
const QueryBody = z.unknown();
|
|
17
|
+
const QueryBody = z.unknown().describe("MBQL 5, legacy MBQL, or native query body — full MBQL 5 schema: mb query --print-schema");
|
|
19
18
|
const QUERY_ENDPOINT = "/api/dataset";
|
|
20
19
|
var query_default = defineMetabaseCommand({
|
|
21
20
|
meta: {
|
|
@@ -43,6 +42,7 @@ var query_default = defineMetabaseCommand({
|
|
|
43
42
|
},
|
|
44
43
|
...skipValidateFlag
|
|
45
44
|
},
|
|
45
|
+
inputSchema: QueryBody,
|
|
46
46
|
outputSchema: CardQueryResult,
|
|
47
47
|
examples: [
|
|
48
48
|
"mb query --print-schema",
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import "./poll-task-TilgciQn.mjs";
|
|
9
|
-
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-C-t9SQBk.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
5
|
+
import "./poll-D1Yg78c3.mjs";
|
|
6
|
+
import "./poll-task-DLUZaglY.mjs";
|
|
7
|
+
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-BTSGp4f9.mjs";
|
|
10
8
|
|
|
11
9
|
//#region src/commands/git-sync/remove-collection.ts
|
|
12
10
|
var remove_collection_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
6
|
+
import { UploadUpdateResult, readCsvFile, requireUploadFilePath, updateTableFromCsv, uploadUpdateResultView } from "./requests-KBiY9UYy.mjs";
|
|
7
|
+
|
|
8
|
+
//#region src/commands/upload/replace.ts
|
|
9
|
+
var replace_default = defineMetabaseCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: "replace",
|
|
12
|
+
description: "Replace an existing uploaded table's rows with a CSV file"
|
|
13
|
+
},
|
|
14
|
+
details: "Replaces the contents of the table with the given id with the rows of the CSV. The table must have been created by a CSV upload and the CSV columns must match.",
|
|
15
|
+
capabilities: { minVersion: 58 },
|
|
16
|
+
args: {
|
|
17
|
+
...outputFlags,
|
|
18
|
+
...profileFlag,
|
|
19
|
+
...connectionFlags,
|
|
20
|
+
file: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Path to the CSV/TSV file to upload"
|
|
23
|
+
},
|
|
24
|
+
id: {
|
|
25
|
+
type: "positional",
|
|
26
|
+
description: "Target table id",
|
|
27
|
+
required: true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
outputSchema: UploadUpdateResult,
|
|
31
|
+
examples: ["mb upload replace 42 --file rows.csv", "mb upload replace 42 --file rows.csv --json"],
|
|
32
|
+
async run({ args, ctx, getClient }) {
|
|
33
|
+
const id = parseId(args.id);
|
|
34
|
+
const file = await readCsvFile(requireUploadFilePath(args.file));
|
|
35
|
+
const client = await getClient();
|
|
36
|
+
const result = await updateTableFromCsv(client, id, "replace", file);
|
|
37
|
+
renderSummary(result, uploadUpdateResultView, `Replaced table ${id} with "${file.filename}".`, ctx);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { replace_default as default };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { ConfigError, isNotFoundError } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import { fileNotFoundError } from "./input-m9ctfLxZ.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
import { basename } from "node:path";
|
|
5
|
+
import { readFile } from "node:fs/promises";
|
|
6
|
+
|
|
7
|
+
//#region src/runtime/upload.ts
|
|
8
|
+
const CSV_CONTENT_TYPE = "text/csv";
|
|
9
|
+
function requireUploadFilePath(file) {
|
|
10
|
+
if (typeof file !== "string" || file.trim() === "") throw new ConfigError("provide the CSV file to upload with --file <path>");
|
|
11
|
+
return file;
|
|
12
|
+
}
|
|
13
|
+
async function readCsvFile(path) {
|
|
14
|
+
try {
|
|
15
|
+
const bytes = await readFile(path);
|
|
16
|
+
return {
|
|
17
|
+
filename: basename(path),
|
|
18
|
+
bytes
|
|
19
|
+
};
|
|
20
|
+
} catch (error) {
|
|
21
|
+
if (isNotFoundError(error)) throw fileNotFoundError(path);
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function buildCsvFormData(file) {
|
|
26
|
+
const form = new FormData();
|
|
27
|
+
form.append("file", new Blob([file.bytes], { type: CSV_CONTENT_TYPE }), file.filename);
|
|
28
|
+
return form;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/commands/upload/results.ts
|
|
33
|
+
const UploadResult = z.object({
|
|
34
|
+
model_id: z.number().int(),
|
|
35
|
+
table_id: z.number().int()
|
|
36
|
+
});
|
|
37
|
+
const uploadResultView = {
|
|
38
|
+
compactPick: UploadResult,
|
|
39
|
+
tableColumns: [{
|
|
40
|
+
key: "model_id",
|
|
41
|
+
label: "Model ID"
|
|
42
|
+
}, {
|
|
43
|
+
key: "table_id",
|
|
44
|
+
label: "Table ID"
|
|
45
|
+
}]
|
|
46
|
+
};
|
|
47
|
+
const UploadUpdateAction = z.enum(["append", "replace"]);
|
|
48
|
+
const UploadUpdateResult = z.object({
|
|
49
|
+
table_id: z.number().int(),
|
|
50
|
+
action: UploadUpdateAction
|
|
51
|
+
});
|
|
52
|
+
const uploadUpdateResultView = {
|
|
53
|
+
compactPick: UploadUpdateResult,
|
|
54
|
+
tableColumns: [{
|
|
55
|
+
key: "table_id",
|
|
56
|
+
label: "Table ID"
|
|
57
|
+
}, {
|
|
58
|
+
key: "action",
|
|
59
|
+
label: "Action"
|
|
60
|
+
}]
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
//#endregion
|
|
64
|
+
//#region src/commands/upload/requests.ts
|
|
65
|
+
const UPLOAD_TABLE_ID_HEADER = "metabase-table-id";
|
|
66
|
+
const UPLOAD_UPDATE_PATHS = {
|
|
67
|
+
append: "append-csv",
|
|
68
|
+
replace: "replace-csv"
|
|
69
|
+
};
|
|
70
|
+
async function updateTableFromCsv(client, tableId, action, file) {
|
|
71
|
+
await client.requestRaw(`/api/table/${tableId}/${UPLOAD_UPDATE_PATHS[action]}`, {
|
|
72
|
+
method: "POST",
|
|
73
|
+
body: buildCsvFormData(file),
|
|
74
|
+
expectContentType: "binary"
|
|
75
|
+
});
|
|
76
|
+
return {
|
|
77
|
+
table_id: tableId,
|
|
78
|
+
action
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
function parseCreateUploadResult(bodyText, headers) {
|
|
82
|
+
return UploadResult.parse({
|
|
83
|
+
model_id: parseResponseInteger(bodyText, "response body"),
|
|
84
|
+
table_id: parseResponseInteger(headers.get(UPLOAD_TABLE_ID_HEADER), `${UPLOAD_TABLE_ID_HEADER} header`)
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function parseResponseInteger(value, source) {
|
|
88
|
+
const trimmed = value?.trim() ?? "";
|
|
89
|
+
if (trimmed === "") throw new Error(`upload succeeded but the ${source} was empty`);
|
|
90
|
+
const parsed = Number(trimmed);
|
|
91
|
+
if (!Number.isInteger(parsed)) throw new Error(`upload succeeded but the ${source} was not an integer: ${JSON.stringify(trimmed)}`);
|
|
92
|
+
return parsed;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
//#endregion
|
|
96
|
+
export { UploadResult, UploadUpdateResult, buildCsvFormData, parseCreateUploadResult, readCsvFile, requireUploadFilePath, updateTableFromCsv, uploadResultView, uploadUpdateResultView };
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import "./table-DE3i82T_.mjs";
|
|
9
|
-
import { DatabaseSyncResult, DatabaseTaskAck, databaseSyncResultView } from "./database-D9fftP-i.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./field-DsXTeqBy.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
6
|
+
import "./table-C3RIKiYM.mjs";
|
|
7
|
+
import { DatabaseSyncResult, DatabaseTaskAck, databaseSyncResultView } from "./database-CIbVSfua.mjs";
|
|
10
8
|
|
|
11
9
|
//#region src/commands/db/rescan-values.ts
|
|
12
10
|
var rescan_values_default = defineMetabaseCommand({
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
-
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
7
5
|
import { z } from "zod";
|
|
8
6
|
|
|
9
7
|
//#region src/commands/transform-job/run.ts
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { TimeoutError } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { parseWaitFlags, waitFlags } from "./wait-flags-Ybpt98PK.mjs";
|
|
9
|
-
import { Transform, TransformRun } from "./transform-DEF38FWe.mjs";
|
|
1
|
+
import { TimeoutError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
5
|
+
import { pollUntil } from "./poll-D1Yg78c3.mjs";
|
|
6
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-dXGThljd.mjs";
|
|
7
|
+
import { Transform, TransformRun } from "./transform-JQel7e5H.mjs";
|
|
10
8
|
import { z } from "zod";
|
|
11
9
|
|
|
12
10
|
//#region src/commands/transform/run.ts
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { collectPaginated } from "./paginate-FVZUxL4J.mjs";
|
|
8
|
-
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-DEF38FWe.mjs";
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
5
|
+
import { collectPaginated } from "./paginate-CMqbqhMC.mjs";
|
|
6
|
+
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-JQel7e5H.mjs";
|
|
9
7
|
|
|
10
8
|
//#region src/commands/transform/runs.ts
|
|
11
9
|
const TransformRunListEnvelope = listEnvelopeSchema(TransformRunCompact);
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { AbortError, ConfigError, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, ValidationError, errorMessage, flagConsumesValue, isNotFoundError, normalizeFlag, toAliasArray, warn } from "./
|
|
2
|
-
import {
|
|
3
|
-
import { setMetabaseAugment } from "./command-augment-DdZIfx1V.mjs";
|
|
4
|
-
import { BASELINE_CAPABILITIES, isPlainObject } from "./capabilities-N0jo5U7S.mjs";
|
|
1
|
+
import { AbortError, BASELINE_CAPABILITIES, ConfigError, DEFAULT_MAX_BYTES, ENV_API_KEY, ENV_DISABLE_KEYRING, ENV_PROFILE, ENV_SKIP_PREFLIGHT, ENV_URL, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, ValidationError, consumeLegacyEnvWarnings, errorMessage, flagConsumesValue, isNotFoundError, isPlainObject, normalizeFlag, package_default, readEnv, reportError, toAliasArray, warn } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import { setMetabaseAugment } from "./command-augment-D9pI9Vbh.mjs";
|
|
5
3
|
import { defineCommand } from "citty";
|
|
6
4
|
import { z } from "zod";
|
|
7
5
|
import { promises } from "node:fs";
|
|
@@ -1629,6 +1627,7 @@ function defineMetabaseCommand(def) {
|
|
|
1629
1627
|
examples: def.examples ?? [],
|
|
1630
1628
|
details: def.details ? def.details : null,
|
|
1631
1629
|
skills: def.skills ?? [],
|
|
1630
|
+
inputSchema: def.inputSchema ?? null,
|
|
1632
1631
|
outputSchema: def.outputSchema ?? null,
|
|
1633
1632
|
capabilities: required
|
|
1634
1633
|
});
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
8
|
-
import { Table, TableCompact, tableView } from "./table-DE3i82T_.mjs";
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./field-DsXTeqBy.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
6
|
+
import { Table, TableCompact, tableView } from "./table-C3RIKiYM.mjs";
|
|
9
7
|
import { z } from "zod";
|
|
10
8
|
|
|
11
9
|
//#region src/commands/db/schema-tables.ts
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { renderList } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
-
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList, wrapList } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
7
5
|
import { z } from "zod";
|
|
8
6
|
|
|
9
7
|
//#region src/commands/db/schemas.ts
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { renderList } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
-
import { parseId } from "./parse-id-D4LeTUsP.mjs";
|
|
1
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, renderList } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseEnumCsv } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
7
5
|
import { z } from "zod";
|
|
8
6
|
|
|
9
7
|
//#region src/domain/search.ts
|
|
@@ -49,21 +49,22 @@ const segmentView = {
|
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
};
|
|
52
|
+
const SegmentDefinition = z.record(z.string(), z.unknown()).describe("MBQL query holding the filter — full MBQL 5 schema: mb query --print-schema");
|
|
52
53
|
const SegmentCreateInput = z.object({
|
|
53
54
|
name: z.string().min(1),
|
|
54
55
|
table_id: z.number().int().positive(),
|
|
55
|
-
definition:
|
|
56
|
+
definition: SegmentDefinition,
|
|
56
57
|
description: z.string().nullable().optional()
|
|
57
58
|
}).loose();
|
|
58
59
|
const SegmentUpdateInput = z.object({
|
|
59
|
-
name: z.string().min(1).optional(),
|
|
60
|
-
definition:
|
|
60
|
+
name: z.string().min(1).nullable().optional(),
|
|
61
|
+
definition: SegmentDefinition.nullable().optional(),
|
|
61
62
|
revision_message: z.string().min(1),
|
|
62
|
-
archived: z.boolean().optional(),
|
|
63
|
+
archived: z.boolean().nullable().optional(),
|
|
63
64
|
description: z.string().nullable().optional(),
|
|
64
65
|
caveats: z.string().nullable().optional(),
|
|
65
66
|
points_of_interest: z.string().nullable().optional(),
|
|
66
|
-
show_in_getting_started: z.boolean().optional()
|
|
67
|
+
show_in_getting_started: z.boolean().nullable().optional()
|
|
67
68
|
}).loose();
|
|
68
69
|
|
|
69
70
|
//#endregion
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/segment/index.ts
|
|
5
|
+
var segment_default = defineCommandGroup({
|
|
6
|
+
name: "segment",
|
|
7
|
+
description: "Manage Metabase segments",
|
|
8
|
+
skills: [{
|
|
9
|
+
skill: "mbql",
|
|
10
|
+
purpose: "the definition filter clause"
|
|
11
|
+
}, {
|
|
12
|
+
skill: "data-workflow",
|
|
13
|
+
purpose: "define reusable segments"
|
|
14
|
+
}],
|
|
15
|
+
subCommands: {
|
|
16
|
+
list: () => import("./list-BliCJAjt.mjs").then((mod) => mod.default),
|
|
17
|
+
get: () => import("./get-DRZENkCj.mjs").then((mod) => mod.default),
|
|
18
|
+
create: () => import("./create-05rX4oL-.mjs").then((mod) => mod.default),
|
|
19
|
+
update: () => import("./update-BCbv880u.mjs").then((mod) => mod.default),
|
|
20
|
+
archive: () => import("./archive-CJ9rElKn.mjs").then((mod) => mod.default)
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { segment_default as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import { parseCsv } from "./runtime-
|
|
3
|
-
import { parseId } from "./parse-id-
|
|
1
|
+
import { ConfigError } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import { parseCsv } from "./runtime-B-c-Fc2i.mjs";
|
|
3
|
+
import { parseId } from "./parse-id-DfY0Lugw.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/library/selectors.ts
|
|
6
6
|
const tableSelectorFlags = {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
-
import { parseEnumFlag } from "./parse-enum-BL9i_brN.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import { parseEnumFlag } from "./parse-enum-Cfne2suT.mjs";
|
|
7
5
|
import { z } from "zod";
|
|
8
6
|
|
|
9
7
|
//#region src/commands/transform-job/set-active.ts
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import { SettingValue, settingValueView } from "./setting-m46MUtW5.mjs";
|
|
9
|
-
import { parseSettingKey, rethrowSettingError } from "./key-bltP32Pm.mjs";
|
|
1
|
+
import { connectionFlags, formatScalar, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
6
|
+
import { SettingValue, settingValueView } from "./setting-Cko6bE_w.mjs";
|
|
7
|
+
import { parseSettingKey, rethrowSettingError } from "./key-Ge4VwWvS.mjs";
|
|
10
8
|
import { z } from "zod";
|
|
11
9
|
|
|
12
10
|
//#region src/commands/setting/set.ts
|
|
11
|
+
const SettingValueInput = z.unknown().describe("Any JSON value; the setting's own type constraints are enforced server-side");
|
|
13
12
|
var set_default = defineMetabaseCommand({
|
|
14
13
|
meta: {
|
|
15
14
|
name: "set",
|
|
@@ -35,6 +34,7 @@ var set_default = defineMetabaseCommand({
|
|
|
35
34
|
required: false
|
|
36
35
|
}
|
|
37
36
|
},
|
|
37
|
+
inputSchema: SettingValueInput,
|
|
38
38
|
outputSchema: SettingValue,
|
|
39
39
|
examples: [
|
|
40
40
|
`mb setting set remote-sync-branch '"main"'`,
|
|
@@ -49,7 +49,7 @@ var set_default = defineMetabaseCommand({
|
|
|
49
49
|
file: args.file,
|
|
50
50
|
positional: args.value,
|
|
51
51
|
source: `setting ${key} value`
|
|
52
|
-
},
|
|
52
|
+
}, SettingValueInput);
|
|
53
53
|
const client = await getClient();
|
|
54
54
|
await client.requestRaw(`/api/setting/${encodeURIComponent(key)}`, {
|
|
55
55
|
method: "PUT",
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/setting/index.ts
|
|
5
|
+
var setting_default = defineCommandGroup({
|
|
6
|
+
name: "setting",
|
|
7
|
+
description: "Inspect and update Metabase settings",
|
|
8
|
+
skills: [{
|
|
9
|
+
skill: "core",
|
|
10
|
+
purpose: "setting get/set JSON value quoting"
|
|
11
|
+
}],
|
|
12
|
+
subCommands: {
|
|
13
|
+
list: () => import("./list-O2w5xd1q.mjs").then((m) => m.default),
|
|
14
|
+
get: () => import("./get-Dg1J0wxb.mjs").then((m) => m.default),
|
|
15
|
+
set: () => import("./set-kyoORFG3.mjs").then((m) => m.default)
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { setting_default as default };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import { readBody } from "./body-IcJ5kFtk.mjs";
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-DWTTxJpP.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-DrDJo_ng.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-B-c-Fc2i.mjs";
|
|
4
|
+
import "./input-m9ctfLxZ.mjs";
|
|
5
|
+
import { readBody } from "./body-C1_AaTS4.mjs";
|
|
6
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
9
7
|
import { z } from "zod";
|
|
10
8
|
|
|
11
9
|
//#region src/domain/setup.ts
|
|
12
10
|
const SetupUserInput = z.object({
|
|
13
|
-
first_name: z.string().nullable().optional(),
|
|
14
|
-
last_name: z.string().nullable().optional(),
|
|
15
|
-
email: z.
|
|
16
|
-
password: z.string().min(1)
|
|
11
|
+
first_name: z.string().min(1).nullable().optional(),
|
|
12
|
+
last_name: z.string().min(1).nullable().optional(),
|
|
13
|
+
email: z.email(),
|
|
14
|
+
password: z.string().min(1).describe("must satisfy the server's password complexity requirements")
|
|
17
15
|
}).loose();
|
|
18
16
|
const SetupPrefsInput = z.object({
|
|
19
17
|
site_name: z.string().min(1),
|
|
@@ -48,6 +46,7 @@ var setup_default = defineMetabaseCommand({
|
|
|
48
46
|
...connectionFlags,
|
|
49
47
|
...bodyInputFlags
|
|
50
48
|
},
|
|
49
|
+
inputSchema: SetupInput,
|
|
51
50
|
outputSchema: SetupResult,
|
|
52
51
|
examples: [
|
|
53
52
|
"cat setup.json | mb setup",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigError, ValidationError, errorMessage, isNotFoundError } from "./
|
|
1
|
+
import { ConfigError, ValidationError, errorMessage, isNotFoundError } from "./capabilities-DrDJo_ng.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import { closeSync, openSync, readFileSync, readSync, readdirSync, statSync } from "node:fs";
|
|
4
4
|
import { dirname, join, resolve } from "node:path";
|
|
@@ -8,9 +8,9 @@ var skills_default = defineCommand({
|
|
|
8
8
|
},
|
|
9
9
|
default: "list",
|
|
10
10
|
subCommands: {
|
|
11
|
-
list: () => import("./list-
|
|
12
|
-
get: () => import("./get-
|
|
13
|
-
path: () => import("./path-
|
|
11
|
+
list: () => import("./list-DEkPxVZu.mjs").then((m) => m.default),
|
|
12
|
+
get: () => import("./get-KVN9ANVh.mjs").then((m) => m.default),
|
|
13
|
+
path: () => import("./path-DzhQVCH8.mjs").then((m) => m.default)
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -46,17 +46,20 @@ const snippetView = {
|
|
|
46
46
|
}
|
|
47
47
|
]
|
|
48
48
|
};
|
|
49
|
+
const SNIPPET_NAME_PATTERN = /^(?!\s)[^}]*$/;
|
|
50
|
+
const SNIPPET_NAME_MESSAGE = "snippet names cannot include '}' or start with spaces";
|
|
51
|
+
const snippetName = z.string().regex(SNIPPET_NAME_PATTERN, SNIPPET_NAME_MESSAGE);
|
|
49
52
|
const SnippetCreateInput = z.object({
|
|
50
|
-
name:
|
|
53
|
+
name: snippetName,
|
|
51
54
|
content: z.string(),
|
|
52
55
|
description: z.string().nullable().optional(),
|
|
53
56
|
collection_id: z.number().int().positive().nullable().optional()
|
|
54
57
|
}).loose();
|
|
55
58
|
const SnippetUpdateInput = z.object({
|
|
56
|
-
name:
|
|
57
|
-
content: z.string().optional(),
|
|
59
|
+
name: snippetName.nullable().optional(),
|
|
60
|
+
content: z.string().nullable().optional(),
|
|
58
61
|
description: z.string().nullable().optional(),
|
|
59
|
-
archived: z.boolean().optional(),
|
|
62
|
+
archived: z.boolean().nullable().optional(),
|
|
60
63
|
collection_id: z.number().int().positive().nullable().optional()
|
|
61
64
|
}).loose();
|
|
62
65
|
|