@metabase/cli 0.1.2 → 0.1.4-alpha.skill-packaging.1c8ec40
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/.claude-plugin/marketplace.json +19 -0
- package/README.md +467 -388
- package/dist/add-collection-B3NhkLRT.mjs +11 -0
- package/dist/{add-collection-DwxQDXzL.mjs → add-collection-CEvZTea_.mjs} +5 -5
- package/dist/{api-key-BktzvPb7.mjs → api-key-BpmnzLLb.mjs} +1 -1
- package/dist/{archive-CLWtbvvH.mjs → archive-BPLLOdfL.mjs} +7 -7
- package/dist/{archive-C1mF-9Kj.mjs → archive-CazAWIrV.mjs} +6 -6
- package/dist/{archive-kYoy5LK5.mjs → archive-D596Cq7R.mjs} +7 -7
- package/dist/{archive-Cq4WKmJt.mjs → archive-DqPqXMZm.mjs} +7 -7
- package/dist/auth-DJp4QoWI.mjs +19 -0
- package/dist/{body-rDrR-C1c.mjs → body-CVSMGqZk.mjs} +3 -3
- package/dist/{branches-CH2UcCpX.mjs → branches--TavvEK1.mjs} +7 -7
- package/dist/{cancel-CgLZcItQ.mjs → cancel-BUitag4_.mjs} +6 -6
- package/dist/{cancel-task-DcYrFsM6.mjs → cancel-task-BHcWJUMu.mjs} +7 -7
- package/dist/card-DtUIadDM.mjs +20 -0
- package/dist/{cards-C4NIaERo.mjs → cards-Bir6wRS_.mjs} +6 -6
- package/dist/cli.mjs +31 -27
- package/dist/collection-4-gZeCWg.mjs +19 -0
- package/dist/{create-CNvd5T8h.mjs → create-4OjxTGAe.mjs} +10 -10
- package/dist/{create-bqc_rmix.mjs → create-BISpvrml.mjs} +10 -10
- package/dist/{create-BUCLNqiN.mjs → create-Bi8sqzL-.mjs} +13 -13
- package/dist/{create-Cbh1cGj9.mjs → create-C1cdoSw5.mjs} +12 -12
- package/dist/{create-Dh0p-c2Y.mjs → create-C3TiMJhQ.mjs} +10 -10
- package/dist/{create-QgN369N5.mjs → create-CZZc1KM8.mjs} +13 -13
- package/dist/{create-DU0ZhnZu.mjs → create-CxMpPsRO.mjs} +9 -9
- package/dist/{create-CB0Yp__0.mjs → create-Dj-fO-nV.mjs} +12 -12
- package/dist/{create-DvrVZ2hS.mjs → create-DuyWlx-S.mjs} +11 -11
- package/dist/{create-branch-BJFH9Hda.mjs → create-branch-CH1FmnxS.mjs} +7 -7
- package/dist/{create-CzfNOhOF.mjs → create-hYdLOyw_.mjs} +12 -12
- package/dist/{credentials-DTP1xuKz.mjs → credentials-BARfQeBr.mjs} +11 -9
- package/dist/{current-task-z_TiJ0kt.mjs → current-task-TX7rJmon.mjs} +7 -7
- package/dist/dashboard-C-azCGk-.mjs +20 -0
- package/dist/{database-DQkUxTLd.mjs → database-BKfGtTmB.mjs} +3 -3
- package/dist/db-D--IArxI.mjs +22 -0
- package/dist/{delete-DeZQ1r9w.mjs → delete-BxUaF8kW.mjs} +8 -8
- package/dist/{delete-CVYII8mq.mjs → delete-DzTd5w_y.mjs} +8 -8
- package/dist/{delete-runtime-BMzvfj_B.mjs → delete-runtime-DfFMWJJ6.mjs} +2 -2
- package/dist/{delete-table-ZiR9-ndv.mjs → delete-table-DWfA7uVn.mjs} +8 -8
- package/dist/{deprovision-BhD3J-Am.mjs → deprovision-CadXjs_7.mjs} +12 -12
- package/dist/{dirty-D9agt7Os.mjs → dirty-an-DQtBG.mjs} +7 -7
- package/dist/{docker-CHpV8PRz.mjs → docker-C9WQCjkt.mjs} +6 -103
- package/dist/{eid-B5wawMmO.mjs → eid-Cz9r5RX5.mjs} +1 -1
- package/dist/{export-Bfk7JAlR.mjs → export-BHq8ztFL.mjs} +10 -10
- package/dist/field-Do1HcUfq.mjs +18 -0
- package/dist/{fields-7ByLsxLg.mjs → fields-B21DeL2I.mjs} +6 -6
- package/dist/{flag-pair-DtR1AiBQ.mjs → flag-pair-Fmcdkrfx.mjs} +1 -1
- package/dist/{get-DikegGzi.mjs → get-BAqeeIQ-.mjs} +6 -6
- package/dist/{get-tISo-cmg.mjs → get-BHCgwPPT.mjs} +9 -9
- package/dist/{get-CQGeF-eP.mjs → get-BPah4iYM.mjs} +6 -6
- package/dist/{get-DKy3DAJX.mjs → get-C4_7ZrIS.mjs} +7 -7
- package/dist/{get-cuHp9-6U.mjs → get-CAYnc9sd.mjs} +6 -6
- package/dist/{get-BE6Izpus.mjs → get-ChEFd1sT.mjs} +7 -7
- package/dist/{get-gOT_RarI.mjs → get-ChxcxY2D.mjs} +7 -7
- package/dist/{get-DUSR5i99.mjs → get-Cy9YIesM.mjs} +6 -6
- package/dist/{get-bYc7eGYe.mjs → get-D-zU7VmK.mjs} +6 -6
- package/dist/{get-D2m4jhwT.mjs → get-DFm7pR7F.mjs} +8 -8
- package/dist/get-DWttywn_.mjs +79 -0
- package/dist/{get-StkjKuh0.mjs → get-RPL4h0It.mjs} +8 -8
- package/dist/{get-C3CcAJGg.mjs → get-dqrzLuwA.mjs} +8 -8
- package/dist/{get-run-D59Yqaoh.mjs → get-run-CG3QFs9T.mjs} +7 -7
- package/dist/git-sync-COKsdLkS.mjs +28 -0
- package/dist/{has-remote-changes-B1TciDVD.mjs → has-remote-changes-ecra9BFO.mjs} +7 -7
- package/dist/{import-DnnmmJbp.mjs → import-BzOKkYnp.mjs} +10 -10
- package/dist/{input-ikCiip6x.mjs → input-BQ-BZA8h.mjs} +1 -1
- package/dist/{is-dirty-DlfX7e39.mjs → is-dirty-7afLBOtn.mjs} +4 -4
- package/dist/is-dirty-Dnw0AHFw.mjs +10 -0
- package/dist/{items-DQFQSpjF.mjs → items-BEWSuEfe.mjs} +10 -10
- package/dist/{key-NDEARu2L.mjs → key-CCJdVWKc.mjs} +1 -1
- package/dist/{license-DBh13sc8.mjs → license-D3mFdxAq.mjs} +3 -3
- package/dist/{list-DQj-QJAs.mjs → list-B5E7LFDb.mjs} +8 -8
- package/dist/{list-BwjqQ6pp.mjs → list-B9mEqMZ5.mjs} +5 -5
- package/dist/{list-D067ZSE5.mjs → list-BJAC356Q.mjs} +7 -7
- package/dist/{list-Di529OJD.mjs → list-BOQWvb8b.mjs} +5 -5
- package/dist/{list-Cy0VhXQs.mjs → list-BZFTuiBr.mjs} +6 -6
- package/dist/{list-DJN-OvTZ.mjs → list-By3t67Y8.mjs} +7 -7
- package/dist/{list-GFfR9SuT.mjs → list-ByPzCM2G.mjs} +5 -5
- package/dist/{list-9AOWhxqp.mjs → list-C8b-KxY6.mjs} +8 -8
- package/dist/{list-iFVEdi2J.mjs → list-CiHlWufc.mjs} +6 -6
- package/dist/{list-DlKzgnqo.mjs → list-D_exD3LP.mjs} +7 -7
- package/dist/{list-4kYCGv01.mjs → list-DiAyv9l3.mjs} +6 -6
- package/dist/{list-CP5RNjO6.mjs → list-DtSOfMZ2.mjs} +6 -6
- package/dist/list-DwF6on6O.mjs +44 -0
- package/dist/{list-DAZP-IM5.mjs → list-nIxzXqr-.mjs} +5 -5
- package/dist/{login-DxgkosGx.mjs → login-Cka2HZWz.mjs} +9 -9
- package/dist/{logout-BlVwqBog.mjs → logout-rA25M-oa.mjs} +6 -6
- package/dist/{logs-CudNEkT4.mjs → logs-B5cGXoDi.mjs} +11 -10
- package/dist/{manifest-Dv5B9Blc.mjs → manifest-CGM7XNLC.mjs} +2 -2
- package/dist/measure-CwJ2o89T.mjs +19 -0
- package/dist/{metadata-BTJAFVvZ.mjs → metadata-BEd6s_Qf.mjs} +6 -6
- package/dist/{metadata-B2Td415K.mjs → metadata-DirWO0cS.mjs} +6 -6
- package/dist/{package-DV6Asqim.mjs → package-VV3qWWIQ.mjs} +10 -3
- package/dist/{parse-id-B38zTlYs.mjs → parse-id-DbSjfzoU.mjs} +1 -1
- package/dist/{parse-ref-DGvh4aDn.mjs → parse-ref-D1yeDOn8.mjs} +1 -1
- package/dist/{parse-schemas-Ds-cVE-O.mjs → parse-schemas-BXTlpoaf.mjs} +2 -2
- package/dist/path-DarsuSkB.mjs +58 -0
- package/dist/{poll-Bh6oAifO.mjs → poll-Cd8bRMmZ.mjs} +2 -2
- package/dist/{poll-task-vPwV31Fs.mjs → poll-task-BwKuhZ9P.mjs} +2 -2
- package/dist/{predicates-DiIiS3k7.mjs → predicates-CGO17Q15.mjs} +1 -1
- package/dist/{preflight-DxJb-hUV.mjs → preflight-RkDLqtNm.mjs} +3 -3
- package/dist/process-zJeVJZTM.mjs +105 -0
- package/dist/{prompt-Bf3DQ-qE.mjs → prompt-DgDNy_Pc.mjs} +1 -1
- package/dist/{provision-B-I0zuDe.mjs → provision-DBqPA-De.mjs} +15 -15
- package/dist/{ps-CaiOFCv2.mjs → ps-Cn3lzak-.mjs} +4 -4
- package/dist/ps-DIm7IScc.mjs +11 -0
- package/dist/{query-BtF1yWZZ.mjs → query-BoOismbH.mjs} +13 -13
- package/dist/{query-jmfqaXRP.mjs → query-CkNa5Nam.mjs} +9 -9
- package/dist/{remove-xskleeru.mjs → remove-B7NUBOqF.mjs} +6 -6
- package/dist/{remove-C2iv0g03.mjs → remove-C08c3vne.mjs} +10 -9
- package/dist/{remove-collection-DhZghaZy.mjs → remove-collection-cFO9M-qV.mjs} +9 -9
- package/dist/{render-DXv-D6fU.mjs → render-DuoDUTVL.mjs} +1 -1
- package/dist/{rescan-values-DW6u90ep.mjs → rescan-values-D1-IyyU7.mjs} +6 -6
- package/dist/{revision-message-flag-CWQbKhdl.mjs → revision-message-flag-oyq2xrDU.mjs} +1 -1
- package/dist/{run-DxVzhcF3.mjs → run-BCzKf_TV.mjs} +9 -9
- package/dist/{runs-BOHk1XnM.mjs → runs-pVgTv7cK.mjs} +9 -9
- package/dist/{runtime-cwBS8wwK.mjs → runtime-DPdP0sl1.mjs} +6 -6
- package/dist/{schema-tables-CcFbY_jN.mjs → schema-tables-c6K9AkS-.mjs} +6 -6
- package/dist/{schemas-DZmv_V62.mjs → schemas-s3PRMTwc.mjs} +6 -6
- package/dist/{search-CYMuc7Fg.mjs → search-DsF08cm9.mjs} +8 -8
- package/dist/segment-CvPF5gLG.mjs +19 -0
- package/dist/{set-CbGfQ7Ye.mjs → set-BNQjt8S1.mjs} +12 -12
- package/dist/{set-B_rrVwU4.mjs → set-DlfevPxG.mjs} +9 -9
- package/dist/{setting-DqZY9NXP.mjs → setting-Cc5FWSNN.mjs} +3 -3
- package/dist/{setup-DxmcAorA.mjs → setup-CIsvZgEA.mjs} +9 -9
- package/dist/skills-CHU7uuDU.mjs +191 -0
- package/dist/skills-Dws-azxD.mjs +18 -0
- package/dist/snippet-W-TaXdio.mjs +19 -0
- package/dist/{start-Cn0epTks.mjs → start-xREv6hev.mjs} +19 -17
- package/dist/{stash-BFZIl9F4.mjs → stash-ZLbOejYk.mjs} +9 -9
- package/dist/{status-UALK3OJl.mjs → status-CYWbB67d.mjs} +5 -5
- package/dist/{status-FDIDmqvM.mjs → status-DiXaGNmb.mjs} +5 -5
- package/dist/{status-BjCeJNLp.mjs → status-DjRAgzXl.mjs} +8 -8
- package/dist/{stop-DUwrDWw8.mjs → stop-CWKn_jI8.mjs} +10 -9
- package/dist/{summary-CS4UGiFJ.mjs → summary-CIFwiame.mjs} +6 -6
- package/dist/{sync-schema-IrHdJxmX.mjs → sync-schema-_SRMfBSQ.mjs} +6 -6
- package/dist/table-uhBlfNYj.mjs +19 -0
- package/dist/transform-UJ7T_BSb.mjs +24 -0
- package/dist/transform-job-DXs5apQ1.mjs +19 -0
- package/dist/{translate-B__zbDKm.mjs → translate-DVN_sIVb.mjs} +10 -10
- package/dist/{tree-Mh0uQ_Wy.mjs → tree-BTZfgldu.mjs} +5 -5
- package/dist/{update-D2VI_5cy.mjs → update-Bjd7YRyh.mjs} +13 -13
- package/dist/{update-Bw0WZix_.mjs → update-CCFegz4q.mjs} +15 -15
- package/dist/{update-BfBsM_y1.mjs → update-CDdML0mE.mjs} +14 -14
- package/dist/{update-B9DBMo30.mjs → update-CGYM_wWQ.mjs} +12 -12
- package/dist/{update-Cp1789qq.mjs → update-CYMsVUQX.mjs} +10 -10
- package/dist/{update-j9vgemKR.mjs → update-D48EYMKn.mjs} +10 -10
- package/dist/{update-1Di9hbPo.mjs → update-D6jptFDw.mjs} +14 -14
- package/dist/{update-B5_pp6Jj.mjs → update-DSjj9UQb.mjs} +15 -15
- package/dist/{update-Masp5WeT.mjs → update-DjfNbEgo.mjs} +11 -11
- package/dist/{update-D8GwQTcL.mjs → update-ZRF-sYqN.mjs} +16 -16
- package/dist/{update-dashcard-CNiQw1MD.mjs → update-dashcard-BfcB6pFx.mjs} +10 -10
- package/dist/upgrade-Cw_mP31_.mjs +432 -0
- package/dist/{url-GFM76VIK.mjs → url-DsDSVEnK.mjs} +9 -8
- package/dist/{uuid-Uif0lNk8.mjs → uuid-DbtHyH33.mjs} +7 -7
- package/dist/{validate-DCYx6jdL.mjs → validate-CB0bu50i.mjs} +3 -3
- package/dist/{validate-query-B07oGG4K.mjs → validate-query-CavIA0Q2.mjs} +3 -3
- package/dist/{values-DrwNHUAI.mjs → values-C1JRC3O2.mjs} +6 -6
- package/dist/{wait-DO7tS7NI.mjs → wait-Ed4Q7ccW.mjs} +2 -2
- package/dist/{wait-BoKk8CJy.mjs → wait-LRmiGepb.mjs} +8 -8
- package/dist/{wait-flags-CjX2sEGm.mjs → wait-flags-pItBfuzi.mjs} +2 -2
- package/dist/workspace-BozpZKez.mjs +24 -0
- package/dist/{workspace-credentials-B6BL-X0d.mjs → workspace-credentials-4lIxxz4g.mjs} +2 -41
- package/dist/yaml-ECiog374.mjs +43 -0
- package/package.json +8 -3
- package/skill-data/core/SKILL.md +575 -0
- package/skill-data/git-sync/SKILL.md +196 -0
- package/skill-data/transform/SKILL.md +235 -0
- package/skill-data/workspace/SKILL.md +408 -0
- package/skills/metabase-cli/SKILL.md +42 -0
- package/dist/add-collection-SL08iMub.mjs +0 -11
- package/dist/auth-DfYkakP3.mjs +0 -19
- package/dist/card-ZCGU2JEh.mjs +0 -20
- package/dist/collection-D_uFLIAS.mjs +0 -19
- package/dist/dashboard-G1-dGLUR.mjs +0 -20
- package/dist/db-CBaEfumR.mjs +0 -22
- package/dist/field-BDJ1pEgr.mjs +0 -18
- package/dist/git-sync-BiTWfLgY.mjs +0 -28
- package/dist/is-dirty-DClGFOGV.mjs +0 -10
- package/dist/measure-C7SbdYQk.mjs +0 -19
- package/dist/ps-BmYQYC7t.mjs +0 -10
- package/dist/segment-Df4pfjco.mjs +0 -19
- package/dist/snippet-CwSHjQyn.mjs +0 -19
- package/dist/table-Cdr5bKp1.mjs +0 -19
- package/dist/transform-CeZusR_w.mjs +0 -24
- package/dist/transform-job-BOn9-CGa.mjs +0 -19
- package/dist/workspace-CyEX40D-.mjs +0 -24
- /package/dist/{snippet-Dw0Sjzkr.mjs → snippet-CSWqkslB.mjs} +0 -0
- /package/dist/{transform-IEX4Mx3X.mjs → transform-DR4ejuPM.mjs} +0 -0
- /package/dist/{transform-job-Csr86muI.mjs → transform-job-BrhOLO4M.mjs} +0 -0
- /package/dist/{workspace-DVuqKJGG.mjs → workspace-DUfqhPm5.mjs} +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-VV3qWWIQ.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import "./predicates-
|
|
5
|
-
import "./input-
|
|
6
|
-
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-
|
|
7
|
-
import { readBody } from "./body-
|
|
3
|
+
import { renderItem } from "./render-DuoDUTVL.mjs";
|
|
4
|
+
import "./predicates-CGO17Q15.mjs";
|
|
5
|
+
import "./input-BQ-BZA8h.mjs";
|
|
6
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DPdP0sl1.mjs";
|
|
7
|
+
import { readBody } from "./body-CVSMGqZk.mjs";
|
|
8
8
|
import { bodyInputFlags } from "./body-flags-BK7J6Daz.mjs";
|
|
9
|
-
import { parseId } from "./parse-id-
|
|
9
|
+
import { parseId } from "./parse-id-DbSjfzoU.mjs";
|
|
10
10
|
import "./field-B3gvaqpK.mjs";
|
|
11
11
|
import { Card, CardUpdateInput, cardView } from "./card-CQxvHeyP.mjs";
|
|
12
|
-
import "./validate-
|
|
13
|
-
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-
|
|
12
|
+
import "./validate-CB0bu50i.mjs";
|
|
13
|
+
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CavIA0Q2.mjs";
|
|
14
14
|
|
|
15
15
|
//#region src/commands/card/update.ts
|
|
16
16
|
var update_default = defineMetabaseCommand({
|
|
17
17
|
meta: {
|
|
18
18
|
name: "update",
|
|
19
|
-
description: "Update a card by id; if dataset_query is MBQL 5 (lib/type: mbql/query) it is pre-flight-validated against the same schema as `
|
|
19
|
+
description: "Update a card by id; if dataset_query is MBQL 5 (lib/type: mbql/query) it is pre-flight-validated against the same schema as `mb query` (see `mb query --print-schema`)"
|
|
20
20
|
},
|
|
21
21
|
args: {
|
|
22
22
|
...outputFlags,
|
|
@@ -32,12 +32,12 @@ var update_default = defineMetabaseCommand({
|
|
|
32
32
|
},
|
|
33
33
|
outputSchema: Card,
|
|
34
34
|
examples: [
|
|
35
|
-
"cat patch.json |
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
35
|
+
"cat patch.json | mb card update 1",
|
|
36
|
+
"mb card update 1 --file patch.json",
|
|
37
|
+
"mb card update 1 --body '{\"name\":\"renamed\"}'",
|
|
38
|
+
"mb card update 1 --body '{\"display\":\"bar\"}'",
|
|
39
|
+
"mb card update 1 --body '{\"archived\":true}'",
|
|
40
|
+
"mb card update 1 --file patch.json --skip-validate"
|
|
41
41
|
],
|
|
42
42
|
async run({ args, ctx, getClient }) {
|
|
43
43
|
const id = parseId(args.id);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-VV3qWWIQ.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import { ConfigError } from "./predicates-
|
|
5
|
-
import "./input-
|
|
6
|
-
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-
|
|
7
|
-
import { readBody } from "./body-
|
|
3
|
+
import { renderItem } from "./render-DuoDUTVL.mjs";
|
|
4
|
+
import { ConfigError } from "./predicates-CGO17Q15.mjs";
|
|
5
|
+
import "./input-BQ-BZA8h.mjs";
|
|
6
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DPdP0sl1.mjs";
|
|
7
|
+
import { readBody } from "./body-CVSMGqZk.mjs";
|
|
8
8
|
import { bodyInputFlags } from "./body-flags-BK7J6Daz.mjs";
|
|
9
|
-
import { parseId } from "./parse-id-
|
|
9
|
+
import { parseId } from "./parse-id-DbSjfzoU.mjs";
|
|
10
10
|
import { DashboardDetail, Dashcard, DashcardPatchInput, dashcardView } from "./dashboard-CnMD04PQ.mjs";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/dashboard/update-dashcard.ts
|
|
@@ -33,9 +33,9 @@ var update_dashcard_default = defineMetabaseCommand({
|
|
|
33
33
|
},
|
|
34
34
|
outputSchema: Dashcard,
|
|
35
35
|
examples: [
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"cat patch.json |
|
|
36
|
+
"mb dashboard update-dashcard 1 5 --body '{\"row\":2,\"col\":0}'",
|
|
37
|
+
"mb dashboard update-dashcard 1 5 --body '{\"size_x\":12,\"size_y\":4}'",
|
|
38
|
+
"cat patch.json | mb dashboard update-dashcard 1 5"
|
|
39
39
|
],
|
|
40
40
|
async run({ args, ctx, getClient }) {
|
|
41
41
|
const dashboardId = parseId(args["dashboard-id"], "dashboard-id");
|
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { package_default } from "./package-VV3qWWIQ.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { renderItem, writeText } from "./render-DuoDUTVL.mjs";
|
|
4
|
+
import { AbortError, NetworkError, TimeoutError, UnknownError, errorMessage } from "./predicates-CGO17Q15.mjs";
|
|
5
|
+
import { HttpError, USER_AGENT, combineAborts, defineMetabaseCommand, outputFlags, parseJson, throwIfAborted } from "./runtime-DPdP0sl1.mjs";
|
|
6
|
+
import { promptConfirm } from "./prompt-DgDNy_Pc.mjs";
|
|
7
|
+
import { streamProcess } from "./process-zJeVJZTM.mjs";
|
|
8
|
+
import { z } from "zod";
|
|
9
|
+
import { realpathSync } from "node:fs";
|
|
10
|
+
import { compare, valid } from "semver";
|
|
11
|
+
|
|
12
|
+
//#region src/core/http/npm-registry.ts
|
|
13
|
+
const DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
|
14
|
+
const DEFAULT_TIMEOUT_MS = 15e3;
|
|
15
|
+
const ERROR_BODY_BYTE_CAP = 8 * 1024;
|
|
16
|
+
const NpmDistTags = z.object({ latest: z.string() }).loose();
|
|
17
|
+
async function fetchNpmDistTags(packageName, opts = {}) {
|
|
18
|
+
const registry = opts.registry ?? DEFAULT_REGISTRY;
|
|
19
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
20
|
+
const fetchImpl = opts.fetchImpl ?? globalThis.fetch.bind(globalThis);
|
|
21
|
+
const url = buildDistTagsUrl(registry, packageName);
|
|
22
|
+
const timeoutSignal = AbortSignal.timeout(timeoutMs);
|
|
23
|
+
const { combined, processSignal } = combineAborts(timeoutSignal, opts.signal);
|
|
24
|
+
let response;
|
|
25
|
+
try {
|
|
26
|
+
response = await fetchImpl(url, {
|
|
27
|
+
method: "GET",
|
|
28
|
+
headers: {
|
|
29
|
+
accept: "application/json",
|
|
30
|
+
"user-agent": USER_AGENT
|
|
31
|
+
},
|
|
32
|
+
signal: combined
|
|
33
|
+
});
|
|
34
|
+
} catch (error) {
|
|
35
|
+
throwIfAborted(opts.signal, processSignal);
|
|
36
|
+
if (timeoutSignal.aborted) throw new TimeoutError(`npm registry request timed out after ${timeoutMs}ms`, {
|
|
37
|
+
kind: "http",
|
|
38
|
+
method: "GET",
|
|
39
|
+
url,
|
|
40
|
+
timeoutMs
|
|
41
|
+
});
|
|
42
|
+
const cause = errorMessage(error);
|
|
43
|
+
throw new NetworkError(`could not reach npm registry: ${cause}`, {
|
|
44
|
+
method: "GET",
|
|
45
|
+
url,
|
|
46
|
+
cause
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
if (!response.ok) {
|
|
50
|
+
const rawBody = await readErrorBody(response);
|
|
51
|
+
throw new HttpError({
|
|
52
|
+
status: response.status,
|
|
53
|
+
statusText: response.statusText,
|
|
54
|
+
method: "GET",
|
|
55
|
+
url,
|
|
56
|
+
responseHeaders: response.headers,
|
|
57
|
+
rawBody
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
const text = await response.text();
|
|
61
|
+
return parseJson(text, NpmDistTags, { source: url });
|
|
62
|
+
}
|
|
63
|
+
function buildDistTagsUrl(registry, packageName) {
|
|
64
|
+
const base = registry.replace(/\/+$/, "");
|
|
65
|
+
const encoded = packageName.replace("/", "%2F");
|
|
66
|
+
return `${base}/-/package/${encoded}/dist-tags`;
|
|
67
|
+
}
|
|
68
|
+
async function readErrorBody(response) {
|
|
69
|
+
try {
|
|
70
|
+
const text = await response.text();
|
|
71
|
+
return text.slice(0, ERROR_BODY_BYTE_CAP);
|
|
72
|
+
} catch (error) {
|
|
73
|
+
return `[body read failed: ${errorMessage(error)}]`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region src/core/install-method.ts
|
|
79
|
+
const InstallMethodKindSchema = z.enum([
|
|
80
|
+
"npm-global",
|
|
81
|
+
"npm-local",
|
|
82
|
+
"npx",
|
|
83
|
+
"dev",
|
|
84
|
+
"unknown"
|
|
85
|
+
]);
|
|
86
|
+
const PackageManagerSchema = z.enum([
|
|
87
|
+
"npm",
|
|
88
|
+
"pnpm",
|
|
89
|
+
"yarn",
|
|
90
|
+
"bun",
|
|
91
|
+
"unknown"
|
|
92
|
+
]);
|
|
93
|
+
const GLOBAL_MARKERS = [
|
|
94
|
+
{
|
|
95
|
+
marker: "/.bun/install/global/node_modules/",
|
|
96
|
+
packageManager: "bun"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
marker: "/Library/pnpm/global/",
|
|
100
|
+
packageManager: "pnpm"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
marker: "/.local/share/pnpm/global/",
|
|
104
|
+
packageManager: "pnpm"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
marker: "/share/pnpm/global/",
|
|
108
|
+
packageManager: "pnpm"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
marker: "/AppData/Local/pnpm/global/",
|
|
112
|
+
packageManager: "pnpm"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
marker: "/pnpm-global/node_modules/",
|
|
116
|
+
packageManager: "pnpm"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
marker: "/.config/yarn/global/node_modules/",
|
|
120
|
+
packageManager: "yarn"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
marker: "/AppData/Local/Yarn/Data/global/node_modules/",
|
|
124
|
+
packageManager: "yarn"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
marker: "/lib/node_modules/",
|
|
128
|
+
packageManager: "npm"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
marker: "/.npm-global/node_modules/",
|
|
132
|
+
packageManager: "npm"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
marker: "/AppData/Roaming/npm/node_modules/",
|
|
136
|
+
packageManager: "npm"
|
|
137
|
+
}
|
|
138
|
+
];
|
|
139
|
+
const NPX_MARKER = "/_npx/";
|
|
140
|
+
const NODE_MODULES_MARKER = "/node_modules/";
|
|
141
|
+
function detectInstallMethod(scriptPath, options = {}) {
|
|
142
|
+
if (scriptPath === void 0 || scriptPath === "") return {
|
|
143
|
+
kind: "unknown",
|
|
144
|
+
packageManager: "unknown",
|
|
145
|
+
realPath: ""
|
|
146
|
+
};
|
|
147
|
+
const realPath = safeRealpath(scriptPath);
|
|
148
|
+
const normalized = realPath.replaceAll("\\", "/");
|
|
149
|
+
if (realPath.endsWith(".ts")) return {
|
|
150
|
+
kind: "dev",
|
|
151
|
+
packageManager: "unknown",
|
|
152
|
+
realPath
|
|
153
|
+
};
|
|
154
|
+
if (normalized.includes(NPX_MARKER)) return {
|
|
155
|
+
kind: "npx",
|
|
156
|
+
packageManager: "npm",
|
|
157
|
+
realPath
|
|
158
|
+
};
|
|
159
|
+
for (const { marker, packageManager } of GLOBAL_MARKERS) if (normalized.includes(marker)) return {
|
|
160
|
+
kind: "npm-global",
|
|
161
|
+
packageManager,
|
|
162
|
+
realPath
|
|
163
|
+
};
|
|
164
|
+
const customPrefix = resolveNpmConfigPrefix(options.npmConfigPrefix);
|
|
165
|
+
if (customPrefix !== null && normalized.startsWith(customPrefix)) return {
|
|
166
|
+
kind: "npm-global",
|
|
167
|
+
packageManager: "npm",
|
|
168
|
+
realPath
|
|
169
|
+
};
|
|
170
|
+
if (normalized.includes(NODE_MODULES_MARKER)) return {
|
|
171
|
+
kind: "npm-local",
|
|
172
|
+
packageManager: "npm",
|
|
173
|
+
realPath
|
|
174
|
+
};
|
|
175
|
+
return {
|
|
176
|
+
kind: "dev",
|
|
177
|
+
packageManager: "unknown",
|
|
178
|
+
realPath
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
function resolveNpmConfigPrefix(override) {
|
|
182
|
+
const raw = override ?? process.env["npm_config_prefix"] ?? process.env["NPM_CONFIG_PREFIX"];
|
|
183
|
+
if (raw === void 0 || raw === "") return null;
|
|
184
|
+
const normalized = raw.replaceAll("\\", "/").replace(/\/+$/, "");
|
|
185
|
+
return `${normalized}/`;
|
|
186
|
+
}
|
|
187
|
+
function buildInstallCommand(install, packageName, targetVersion) {
|
|
188
|
+
const spec = `${packageName}@${targetVersion}`;
|
|
189
|
+
switch (install.kind) {
|
|
190
|
+
case "npm-global": return makeCommand(globalArgv(install.packageManager, spec));
|
|
191
|
+
case "npm-local": return makeCommand([
|
|
192
|
+
"npm",
|
|
193
|
+
"install",
|
|
194
|
+
spec
|
|
195
|
+
]);
|
|
196
|
+
case "npx":
|
|
197
|
+
case "dev":
|
|
198
|
+
case "unknown": return null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function globalArgv(packageManager, spec) {
|
|
202
|
+
switch (packageManager) {
|
|
203
|
+
case "pnpm": return [
|
|
204
|
+
"pnpm",
|
|
205
|
+
"add",
|
|
206
|
+
"-g",
|
|
207
|
+
spec
|
|
208
|
+
];
|
|
209
|
+
case "yarn": return [
|
|
210
|
+
"yarn",
|
|
211
|
+
"global",
|
|
212
|
+
"add",
|
|
213
|
+
spec
|
|
214
|
+
];
|
|
215
|
+
case "bun": return [
|
|
216
|
+
"bun",
|
|
217
|
+
"add",
|
|
218
|
+
"-g",
|
|
219
|
+
spec
|
|
220
|
+
];
|
|
221
|
+
case "npm":
|
|
222
|
+
case "unknown": return [
|
|
223
|
+
"npm",
|
|
224
|
+
"install",
|
|
225
|
+
"-g",
|
|
226
|
+
spec
|
|
227
|
+
];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function makeCommand(argv) {
|
|
231
|
+
return {
|
|
232
|
+
argv,
|
|
233
|
+
display: argv.join(" ")
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
function safeRealpath(path) {
|
|
237
|
+
try {
|
|
238
|
+
return realpathSync(path);
|
|
239
|
+
} catch (error) {
|
|
240
|
+
if (error instanceof Error) return path;
|
|
241
|
+
throw error;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/core/version.ts
|
|
247
|
+
const SEMVER_MESSAGE = "expected semver MAJOR.MINOR.PATCH[-prerelease][+build]";
|
|
248
|
+
const SemverString = z.string().refine((value) => valid(value) !== null, { message: SEMVER_MESSAGE });
|
|
249
|
+
function compareSemver(a, b) {
|
|
250
|
+
return compare(a, b);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
//#endregion
|
|
254
|
+
//#region src/commands/upgrade.ts
|
|
255
|
+
const UpgradeCommandSchema = z.object({
|
|
256
|
+
argv: z.array(z.string()).min(1),
|
|
257
|
+
display: z.string()
|
|
258
|
+
});
|
|
259
|
+
const UpgradeStatus = z.object({
|
|
260
|
+
packageName: z.string(),
|
|
261
|
+
currentVersion: SemverString,
|
|
262
|
+
latestVersion: SemverString,
|
|
263
|
+
targetVersion: SemverString,
|
|
264
|
+
updateAvailable: z.boolean(),
|
|
265
|
+
changeRequired: z.boolean(),
|
|
266
|
+
installMethod: InstallMethodKindSchema,
|
|
267
|
+
packageManager: PackageManagerSchema,
|
|
268
|
+
binaryPath: z.string(),
|
|
269
|
+
command: UpgradeCommandSchema.nullable(),
|
|
270
|
+
canAutoInstall: z.boolean()
|
|
271
|
+
});
|
|
272
|
+
const upgradeStatusView = {
|
|
273
|
+
compactPick: UpgradeStatus,
|
|
274
|
+
tableColumns: [
|
|
275
|
+
{
|
|
276
|
+
key: "currentVersion",
|
|
277
|
+
label: "Current"
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
key: "latestVersion",
|
|
281
|
+
label: "Latest"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
key: "targetVersion",
|
|
285
|
+
label: "Target"
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
key: "updateAvailable",
|
|
289
|
+
label: "Update available"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
key: "installMethod",
|
|
293
|
+
label: "Install method"
|
|
294
|
+
},
|
|
295
|
+
{
|
|
296
|
+
key: "command",
|
|
297
|
+
label: "Upgrade command",
|
|
298
|
+
format: formatCommandCell
|
|
299
|
+
}
|
|
300
|
+
]
|
|
301
|
+
};
|
|
302
|
+
var upgrade_default = defineMetabaseCommand({
|
|
303
|
+
meta: {
|
|
304
|
+
name: "upgrade",
|
|
305
|
+
description: "Upgrade the Metabase CLI itself to the latest published release"
|
|
306
|
+
},
|
|
307
|
+
args: {
|
|
308
|
+
...outputFlags,
|
|
309
|
+
check: {
|
|
310
|
+
type: "boolean",
|
|
311
|
+
description: "Print update status without installing"
|
|
312
|
+
},
|
|
313
|
+
yes: {
|
|
314
|
+
type: "boolean",
|
|
315
|
+
description: "Skip the confirmation prompt",
|
|
316
|
+
alias: "y"
|
|
317
|
+
},
|
|
318
|
+
to: {
|
|
319
|
+
type: "string",
|
|
320
|
+
description: "Target version (default: latest published)"
|
|
321
|
+
},
|
|
322
|
+
registry: {
|
|
323
|
+
type: "string",
|
|
324
|
+
description: "npm registry URL (default: https://registry.npmjs.org)"
|
|
325
|
+
}
|
|
326
|
+
},
|
|
327
|
+
outputSchema: UpgradeStatus,
|
|
328
|
+
examples: [
|
|
329
|
+
"mb upgrade",
|
|
330
|
+
"mb upgrade --check",
|
|
331
|
+
"mb upgrade --check --json",
|
|
332
|
+
"mb upgrade --yes",
|
|
333
|
+
"mb upgrade --to 0.1.2"
|
|
334
|
+
],
|
|
335
|
+
async run({ args, ctx }) {
|
|
336
|
+
const currentVersion = SemverString.parse(package_default.version);
|
|
337
|
+
const install = detectInstallMethod(process.argv[1]);
|
|
338
|
+
const distTags = await fetchNpmDistTags(package_default.name, distTagsOptions(args.registry));
|
|
339
|
+
const latestVersion = SemverString.parse(distTags.latest);
|
|
340
|
+
const targetVersion = resolveTargetVersion(args.to, latestVersion);
|
|
341
|
+
const updateAvailable = compareSemver(currentVersion, latestVersion) < 0;
|
|
342
|
+
const changeRequired = compareSemver(currentVersion, targetVersion) !== 0;
|
|
343
|
+
const command = buildInstallCommand(install, package_default.name, targetVersion);
|
|
344
|
+
const canAutoInstall = install.kind === "npm-global" && command !== null;
|
|
345
|
+
const status = {
|
|
346
|
+
packageName: package_default.name,
|
|
347
|
+
currentVersion,
|
|
348
|
+
latestVersion,
|
|
349
|
+
targetVersion,
|
|
350
|
+
updateAvailable,
|
|
351
|
+
changeRequired,
|
|
352
|
+
installMethod: install.kind,
|
|
353
|
+
packageManager: install.packageManager,
|
|
354
|
+
binaryPath: install.realPath,
|
|
355
|
+
command: command === null ? null : {
|
|
356
|
+
argv: [...command.argv],
|
|
357
|
+
display: command.display
|
|
358
|
+
},
|
|
359
|
+
canAutoInstall
|
|
360
|
+
};
|
|
361
|
+
emitStatus(status, install, command, ctx);
|
|
362
|
+
if (args.check || !changeRequired || command === null || !canAutoInstall) return;
|
|
363
|
+
const needsPrompt = !args.yes;
|
|
364
|
+
if (needsPrompt && !process.stdin.isTTY) return;
|
|
365
|
+
if (needsPrompt) {
|
|
366
|
+
const confirmed = await promptConfirm({
|
|
367
|
+
message: `Run "${command.display}" now?`,
|
|
368
|
+
initialValue: true
|
|
369
|
+
});
|
|
370
|
+
if (!confirmed) throw new AbortError();
|
|
371
|
+
}
|
|
372
|
+
const [bin, ...rest] = command.argv;
|
|
373
|
+
const exitCode = await streamProcess(bin, rest, { shell: process.platform === "win32" });
|
|
374
|
+
if (exitCode !== 0) throw new UnknownError({
|
|
375
|
+
originalMessage: `upgrade command exited with code ${exitCode ?? "unknown"}`,
|
|
376
|
+
stack: null
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
});
|
|
380
|
+
function distTagsOptions(registryArg) {
|
|
381
|
+
const registry = registryArg?.trim();
|
|
382
|
+
if (registry === void 0 || registry === "") return {};
|
|
383
|
+
return { registry };
|
|
384
|
+
}
|
|
385
|
+
function resolveTargetVersion(toArg, latestVersion) {
|
|
386
|
+
const trimmed = toArg?.trim();
|
|
387
|
+
if (trimmed === void 0 || trimmed === "") return latestVersion;
|
|
388
|
+
return SemverString.parse(trimmed);
|
|
389
|
+
}
|
|
390
|
+
function emitStatus(status, install, command, ctx) {
|
|
391
|
+
if (ctx.format === "json" || ctx.fields !== void 0 || ctx.full) {
|
|
392
|
+
renderItem(status, upgradeStatusView, ctx);
|
|
393
|
+
return;
|
|
394
|
+
}
|
|
395
|
+
writeText(buildHumanText(status, install, command));
|
|
396
|
+
}
|
|
397
|
+
function buildHumanText(status, install, command) {
|
|
398
|
+
if (!status.changeRequired) return `Up to date (${status.currentVersion}).`;
|
|
399
|
+
const header = [`Current version: ${status.currentVersion}`, `Latest version: ${status.latestVersion}`];
|
|
400
|
+
if (status.targetVersion !== status.latestVersion) header.push(`Target version: ${status.targetVersion}`);
|
|
401
|
+
const tail = buildHumanTail(install, command);
|
|
402
|
+
return [
|
|
403
|
+
...header,
|
|
404
|
+
"",
|
|
405
|
+
...tail
|
|
406
|
+
].join("\n");
|
|
407
|
+
}
|
|
408
|
+
function buildHumanTail(install, command) {
|
|
409
|
+
switch (install.kind) {
|
|
410
|
+
case "npm-global": return [
|
|
411
|
+
`Installed via: ${install.packageManager} (global)`,
|
|
412
|
+
`Binary path: ${install.realPath}`,
|
|
413
|
+
...command === null ? [] : [`Upgrade command: ${command.display}`]
|
|
414
|
+
];
|
|
415
|
+
case "npm-local": return [
|
|
416
|
+
`Installed via: ${install.packageManager} (local install)`,
|
|
417
|
+
`Binary path: ${install.realPath}`,
|
|
418
|
+
...command === null ? [] : [`Run in that project: ${command.display}`]
|
|
419
|
+
];
|
|
420
|
+
case "npx": return [`Running via npx — no upgrade needed.`, `npx fetches the latest version on each invocation.`];
|
|
421
|
+
case "dev": return [`Running from source at ${install.realPath}.`, `Pull the latest changes from git and rebuild to upgrade.`];
|
|
422
|
+
case "unknown": return [`Could not detect how the CLI was installed${install.realPath === "" ? "" : ` (${install.realPath})`}.`, `Reinstall with your package manager — for example: npm install -g @metabase/cli@latest`];
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
function formatCommandCell(value) {
|
|
426
|
+
if (value === null || value === void 0) return "";
|
|
427
|
+
if (typeof value === "object" && "display" in value && typeof value.display === "string") return value.display;
|
|
428
|
+
return "";
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
//#endregion
|
|
432
|
+
export { upgrade_default as default };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-VV3qWWIQ.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import "./predicates-
|
|
5
|
-
import { defineMetabaseCommand, localUrl, outputFlags } from "./runtime-
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import "./poll-
|
|
8
|
-
import
|
|
3
|
+
import { renderItem } from "./render-DuoDUTVL.mjs";
|
|
4
|
+
import "./predicates-CGO17Q15.mjs";
|
|
5
|
+
import { defineMetabaseCommand, localUrl, outputFlags } from "./runtime-DPdP0sl1.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-DbSjfzoU.mjs";
|
|
7
|
+
import "./poll-Cd8bRMmZ.mjs";
|
|
8
|
+
import "./process-zJeVJZTM.mjs";
|
|
9
|
+
import { checkDockerReady, requireWorkspaceContainerLocation } from "./docker-C9WQCjkt.mjs";
|
|
9
10
|
import { z } from "zod";
|
|
10
11
|
|
|
11
12
|
//#region src/commands/workspace/url.ts
|
|
@@ -37,7 +38,7 @@ var url_default = defineMetabaseCommand({
|
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
outputSchema: UrlResult,
|
|
40
|
-
examples: ["
|
|
41
|
+
examples: ["mb workspace url 1", "mb workspace url 1 --json"],
|
|
41
42
|
async run({ args, ctx }) {
|
|
42
43
|
const workspaceId = parseId(args.id);
|
|
43
44
|
await checkDockerReady();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-VV3qWWIQ.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { writeJson, writeText } from "./render-
|
|
4
|
-
import { ConfigError } from "./predicates-
|
|
5
|
-
import { defineMetabaseCommand, outputFlags, parseInteger } from "./runtime-
|
|
3
|
+
import { writeJson, writeText } from "./render-DuoDUTVL.mjs";
|
|
4
|
+
import { ConfigError } from "./predicates-CGO17Q15.mjs";
|
|
5
|
+
import { defineMetabaseCommand, outputFlags, parseInteger } from "./runtime-DPdP0sl1.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
|
|
@@ -24,9 +24,9 @@ var uuid_default = defineMetabaseCommand({
|
|
|
24
24
|
},
|
|
25
25
|
outputSchema: UuidList,
|
|
26
26
|
examples: [
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
27
|
+
"mb uuid",
|
|
28
|
+
"mb uuid --count 5",
|
|
29
|
+
"mb uuid --count 5 --json"
|
|
30
30
|
],
|
|
31
31
|
run({ args, ctx }) {
|
|
32
32
|
const count = parseInteger(args.count, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ConfigError, escapeJsonPointerSegment, isPlainObject } from "./predicates-
|
|
1
|
+
import { ConfigError, escapeJsonPointerSegment, isPlainObject } from "./predicates-CGO17Q15.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
4
4
|
import addFormats from "ajv-formats";
|
|
@@ -1369,8 +1369,8 @@ function getValidator() {
|
|
|
1369
1369
|
validator = compiled;
|
|
1370
1370
|
return validator;
|
|
1371
1371
|
}
|
|
1372
|
-
const UUID_HINT_MESSAGE = "must be a UUID v4 (RFC 4122) — run `
|
|
1373
|
-
const FIELD_SLOT1_HINT_MESSAGE = "must be the field options object — MBQL 5 field refs are [\"field\", {options}, fieldId]; the legacy MBQL 4 shape [\"field\", id, opts] is not accepted here. (Tip: `
|
|
1372
|
+
const UUID_HINT_MESSAGE = "must be a UUID v4 (RFC 4122) — run `mb uuid` (or `mb uuid --count N`) to mint one. The MBQL 5 schema rejects placeholder strings (`a1`, `uuid-1`, etc.); agents must call the CLI for UUIDs rather than authoring them.";
|
|
1373
|
+
const FIELD_SLOT1_HINT_MESSAGE = "must be the field options object — MBQL 5 field refs are [\"field\", {options}, fieldId]; the legacy MBQL 4 shape [\"field\", id, opts] is not accepted here. (Tip: `mb uuid` mints `lib/uuid` strings if you need them.)";
|
|
1374
1374
|
function clauseSlot1HintMessage(operator, slot1) {
|
|
1375
1375
|
return `must be the clause options object — every MBQL 5 clause is ["${operator}", {options}, ...args]; got ${describeJsonValue(slot1)} at index 1`;
|
|
1376
1376
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { writeJson } from "./render-
|
|
2
|
-
import { ConfigError } from "./predicates-
|
|
3
|
-
import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-
|
|
1
|
+
import { writeJson } from "./render-DuoDUTVL.mjs";
|
|
2
|
+
import { ConfigError } from "./predicates-CGO17Q15.mjs";
|
|
3
|
+
import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-CB0bu50i.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/validate-query.ts
|
|
6
6
|
const skipValidateFlag = { "skip-validate": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-VV3qWWIQ.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import "./predicates-
|
|
5
|
-
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
3
|
+
import { renderItem } from "./render-DuoDUTVL.mjs";
|
|
4
|
+
import "./predicates-CGO17Q15.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DPdP0sl1.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-DbSjfzoU.mjs";
|
|
7
7
|
import { FieldValues, fieldValuesView } from "./field-B3gvaqpK.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/commands/field/values.ts
|
|
@@ -23,7 +23,7 @@ var values_default = defineMetabaseCommand({
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
outputSchema: FieldValues,
|
|
26
|
-
examples: ["
|
|
26
|
+
examples: ["mb field values 100", "mb field values 100 --json"],
|
|
27
27
|
async run({ args, ctx, getClient }) {
|
|
28
28
|
const id = parseId(args.id);
|
|
29
29
|
const client = await getClient();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { pollUntil } from "./poll-
|
|
2
|
-
import { Workspace } from "./workspace-
|
|
1
|
+
import { pollUntil } from "./poll-Cd8bRMmZ.mjs";
|
|
2
|
+
import { Workspace } from "./workspace-DUfqhPm5.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/workspace/database/wait.ts
|
|
5
5
|
async function waitForDatabaseProvisioned(client, workspaceId, databaseId, schedule) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./package-
|
|
1
|
+
import "./package-VV3qWWIQ.mjs";
|
|
2
2
|
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
-
import { renderItem } from "./render-
|
|
4
|
-
import "./predicates-
|
|
5
|
-
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import { SyncTaskOrIdle, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-
|
|
8
|
-
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-
|
|
3
|
+
import { renderItem } from "./render-DuoDUTVL.mjs";
|
|
4
|
+
import "./predicates-CGO17Q15.mjs";
|
|
5
|
+
import { connectionFlags, defineMetabaseCommand, outputFlags, profileFlag } from "./runtime-DPdP0sl1.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-DbSjfzoU.mjs";
|
|
7
|
+
import { SyncTaskOrIdle, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-BwKuhZ9P.mjs";
|
|
8
|
+
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-Cd8bRMmZ.mjs";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/git-sync/wait.ts
|
|
11
11
|
const WaitResult = SyncTaskOrIdle;
|
|
@@ -30,7 +30,7 @@ var wait_default = defineMetabaseCommand({
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
outputSchema: WaitResult,
|
|
33
|
-
examples: ["
|
|
33
|
+
examples: ["mb git-sync wait", "mb git-sync wait --timeout 300000 --json"],
|
|
34
34
|
async run({ args, ctx, getClient }) {
|
|
35
35
|
const timeoutMs = parseId(args.timeout, "timeout");
|
|
36
36
|
const intervalMs = parseId(args.interval, "interval");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseId } from "./parse-id-
|
|
2
|
-
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-
|
|
1
|
+
import { parseId } from "./parse-id-DbSjfzoU.mjs";
|
|
2
|
+
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-Cd8bRMmZ.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/wait-flags.ts
|
|
5
5
|
const waitFlags = {
|