@metabase/cli 0.1.5 → 0.1.7
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 +128 -115
- package/dist/add-collection-C9BdVBs2.mjs +11 -0
- package/dist/{add-collection-C_iovi9i.mjs → add-collection-DQjTlDNF.mjs} +12 -5
- package/dist/archive-B3qiL-kK.mjs +40 -0
- package/dist/{archive-DdaP94H3.mjs → archive-BXzghEQX.mjs} +10 -9
- package/dist/{archive-WaEW85NB.mjs → archive-CBGKzEAl.mjs} +9 -8
- package/dist/{archive-BKPO8lEO.mjs → archive-CuVk8iwN.mjs} +10 -9
- package/dist/archive-DTN9tLGT.mjs +40 -0
- package/dist/{archive-Dvzrmdbk.mjs → archive-De8jzzq7.mjs} +10 -9
- package/dist/auth-D9eAyVoG.mjs +19 -0
- package/dist/{body-XtR7-uCO.mjs → body-tcURGnGh.mjs} +4 -4
- package/dist/{branches-XUY4JY-X.mjs → branches-CIGkjXIk.mjs} +11 -7
- package/dist/{cancel-BrUVO_ax.mjs → cancel-pPsvgJ0Z.mjs} +9 -8
- package/dist/{cancel-task-oXheTOB6.mjs → cancel-task-BLGE4UlL.mjs} +12 -8
- package/dist/capabilities-7e9MgquN.mjs +29 -0
- package/dist/card-DDDrWcDU.mjs +20 -0
- package/dist/{card-CQxvHeyP.mjs → card-ezYiriML.mjs} +1 -1
- package/dist/{cards-CONTTAG9.mjs → cards-Dq3nx_9n.mjs} +8 -7
- package/dist/cli.mjs +264 -44
- package/dist/collection-DkEvCDar.mjs +20 -0
- package/dist/{predicates-CGO17Q15.mjs → command-augment-BH9qgQ5u.mjs} +66 -14
- package/dist/{create-Cs2xntFG.mjs → create-9DBTkbMq.mjs} +18 -16
- package/dist/{create-kYpjobrq.mjs → create-B1dyuL9Y.mjs} +16 -10
- package/dist/create-BIphz0kO.mjs +52 -0
- package/dist/create-BcgoukG4.mjs +50 -0
- package/dist/create-BdPoSk_7.mjs +50 -0
- package/dist/{create-DZxUeqdf.mjs → create-BrUqxreg.mjs} +11 -10
- package/dist/create-DHscDhRd.mjs +50 -0
- package/dist/{create-Dq25vsMu.mjs → create-aPaUEGdr.mjs} +11 -10
- package/dist/{create-branch-D5u14AxL.mjs → create-branch-DGoc9CUU.mjs} +12 -8
- package/dist/{create-Ca9lIDwP.mjs → create-w3mQg9n4.mjs} +11 -10
- package/dist/{credentials-BIQ1cEzM.mjs → credentials-qryRLUed.mjs} +12 -11
- package/dist/current-task-DZM28rnr.mjs +40 -0
- package/dist/{dashboard-CnMD04PQ.mjs → dashboard-B4bn3z6t.mjs} +2 -1
- package/dist/dashboard-BLf1RZlk.mjs +21 -0
- package/dist/{database-vvig8k4x.mjs → database-BXiue1in.mjs} +1 -1
- package/dist/{database-BSvzYlRe.mjs → database-Ce1gOJF7.mjs} +3 -3
- package/dist/db-CWTFe_FZ.mjs +22 -0
- package/dist/{delete-VTAS9EUt.mjs → delete-BPaFdHZP.mjs} +11 -8
- package/dist/{delete-CUx6RT9e.mjs → delete-BrJOotpW.mjs} +11 -8
- package/dist/{remove-C6bS0Z6w.mjs → delete-FFj1xQWO.mjs} +25 -20
- package/dist/{delete-runtime-DfFMWJJ6.mjs → delete-runtime-uuYbd4k2.mjs} +9 -7
- package/dist/{delete-table-DzUneMKe.mjs → delete-table-CNupWUO0.mjs} +11 -8
- package/dist/{deprovision-CpJfGgCt.mjs → deprovision-BNr9fPDY.mjs} +18 -12
- package/dist/{dirty-nkAOXxgC.mjs → dirty-BCkNOY8c.mjs} +11 -7
- package/dist/{docker-D5FTIoD0.mjs → docker-Ds252Mwc.mjs} +4 -4
- package/dist/{translate-Cqsd0Px5.mjs → eid-CLY5X0Uw.mjs} +43 -23
- package/dist/error-ZsFeevV2.mjs +191 -0
- package/dist/{export-BWvY7X_G.mjs → export-CgHgWW3I.mjs} +20 -18
- package/dist/{field-B3gvaqpK.mjs → field-E0IBy4Uw.mjs} +12 -3
- package/dist/field-LL6W_c-c.mjs +18 -0
- package/dist/{fields-dH16G5UV.mjs → fields-RkRWU-u9.mjs} +9 -8
- package/dist/{get-D96QEU49.mjs → get-42tJ7BNp.mjs} +8 -7
- package/dist/{get-C6SR3A9t.mjs → get-B8l4t4Pz.mjs} +10 -9
- package/dist/{get-BnBRKHr7.mjs → get-B9kwSs6U.mjs} +8 -7
- package/dist/{get-7macOPAI.mjs → get-Bo4Cpd_c.mjs} +7 -7
- package/dist/{get-BcqxMVC1.mjs → get-C9O_aEGo.mjs} +8 -7
- package/dist/{get-CKxlhMy1.mjs → get-CRvbChoX.mjs} +8 -7
- package/dist/{get-B7i_nYJB.mjs → get-CTDqioaj.mjs} +8 -7
- package/dist/{get-D8e_RzZ0.mjs → get-CiZrZJLt.mjs} +10 -9
- package/dist/{get-B08K82JV.mjs → get-CvmqPN30.mjs} +8 -7
- package/dist/{get-CACaBFLt.mjs → get-DmzgSgrl.mjs} +9 -8
- package/dist/{get-R7OaVL_t.mjs → get-DsqGHNHN.mjs} +8 -7
- package/dist/get-run-CBwcRc8E.mjs +38 -0
- package/dist/{get-DNN1X2gN.mjs → get-sMpa-X4E.mjs} +9 -8
- package/dist/{get-DAWofnzK.mjs → get-y17zJMnU.mjs} +8 -7
- package/dist/git-sync-CrWTo3YX.mjs +28 -0
- package/dist/{has-remote-changes-BAnIXQXU.mjs → has-remote-changes-CfRidwXT.mjs} +13 -8
- package/dist/{import-CfdPEMng.mjs → import-BZV0Z2KR.mjs} +21 -18
- package/dist/{input-BQ-BZA8h.mjs → input-cMSEqISy.mjs} +7 -4
- package/dist/is-dirty-CPzOnnH6.mjs +10 -0
- package/dist/{is-dirty-CZWcG0vj.mjs → is-dirty-hKcB4OH9.mjs} +9 -4
- package/dist/{items-DqwahOKf.mjs → items-C94eW2Yd.mjs} +10 -9
- package/dist/key-vkNkH82H.mjs +17 -0
- package/dist/license-B37055sr.mjs +17 -0
- package/dist/{list-L63TpX1t.mjs → list-B0V7FeL2.mjs} +7 -7
- package/dist/{list-Bkd7Nbds.mjs → list-BFlzLGlw.mjs} +7 -6
- package/dist/{list-yxVAE1S7.mjs → list-BJXaGk-z.mjs} +7 -6
- package/dist/{list-BqNMpIXy.mjs → list-BS_Bxejg.mjs} +9 -8
- package/dist/{list-J277Qtki.mjs → list-BmHoYJr7.mjs} +7 -6
- package/dist/list-C-oZe1_p.mjs +173 -0
- package/dist/{list-ViT2KWhv.mjs → list-CF1pMN4S.mjs} +7 -6
- package/dist/{list-BpNU1neq.mjs → list-CU6sOfI-.mjs} +9 -7
- package/dist/{list-oftHLFbE.mjs → list-CqN4gvCk.mjs} +9 -7
- package/dist/{list-DBOYoJtA.mjs → list-DUXdt0XI.mjs} +10 -6
- package/dist/{list-D41gfkKb.mjs → list-DfDZr55C.mjs} +10 -8
- package/dist/{list-vF4EneaE.mjs → list-DrINpVLM.mjs} +7 -6
- package/dist/{list-DJcGwJ4W.mjs → list-DuSoEk_J.mjs} +9 -8
- package/dist/{list-CQkDqphl.mjs → list-HS15y_WN.mjs} +7 -6
- package/dist/login-enh9Yimb.mjs +181 -0
- package/dist/{logout-DD4q5whi.mjs → logout-BWLPLDh8.mjs} +13 -11
- package/dist/{logs-Ci3mJE2z.mjs → logs-Cu3QtvPs.mjs} +9 -8
- package/dist/{manifest-CGM7XNLC.mjs → manifest-BNh0Lw6p.mjs} +15 -15
- package/dist/{measure-BEQfnLdN.mjs → measure-Bt3InQsA.mjs} +2 -2
- package/dist/measure-CDlEPFtB.mjs +19 -0
- package/dist/{metadata-BDat-jN9.mjs → metadata-BTTEBWdS.mjs} +10 -9
- package/dist/{metadata-29_qlqbz.mjs → metadata-D2TxboMm.mjs} +9 -8
- package/dist/parse-enum-CrEWOhuY.mjs +11 -0
- package/dist/{parse-id-CysSaCbf.mjs → parse-id-0_tOPvfI.mjs} +1 -1
- package/dist/{parse-ref-D1yeDOn8.mjs → parse-ref-DKag6a6I.mjs} +1 -1
- package/dist/{parse-schemas-B10n01ez.mjs → parse-schemas-D-qVLl4z.mjs} +2 -2
- package/dist/{path-DLByFMMA.mjs → path-C8GrBdgT.mjs} +7 -7
- package/dist/{poll-p9Y7-JEQ.mjs → poll-4eoh5J0r.mjs} +2 -2
- package/dist/{poll-task-BQe0NvJZ.mjs → poll-task-51WRdugU.mjs} +19 -20
- package/dist/{preflight-CvFu0Cct.mjs → preflight-BhsErYz3.mjs} +4 -4
- package/dist/{process-zJeVJZTM.mjs → process-CM7Uu5q_.mjs} +1 -1
- package/dist/{prompt-DgDNy_Pc.mjs → prompt-CFKoys7k.mjs} +3 -1
- package/dist/provision-Chf86BF0.mjs +83 -0
- package/dist/{ps-BxQdpkr5.mjs → ps-CEYtsKBj.mjs} +5 -3
- package/dist/ps-CIDwaubS.mjs +11 -0
- package/dist/{query-C7zTlFJA.mjs → query-BBCAF-tG.mjs} +17 -14
- package/dist/{query-CFH4nBlK.mjs → query-DYVBnu9d.mjs} +12 -9
- package/dist/query-result-ABPLz6I4.mjs +19 -0
- package/dist/{remove-BuWxx3hY.mjs → remove-2yInufA6.mjs} +14 -12
- package/dist/remove-collection-CBAHz0Dk.mjs +44 -0
- package/dist/{render-DuoDUTVL.mjs → render-0_GsapXa.mjs} +51 -23
- package/dist/render-khznBlla.mjs +32 -0
- package/dist/{rescan-values-DabyRYQ_.mjs → rescan-values-cfTSNQZo.mjs} +12 -11
- package/dist/{run-Cl-9RtC4.mjs → run-qgdEJv-I.mjs} +17 -15
- package/dist/{runs-BH6s1Zao.mjs → runs-BFIIH4GL.mjs} +9 -8
- package/dist/{runtime-CDu6fykq.mjs → runtime-Duawf5lE.mjs} +653 -428
- package/dist/{schema-tables-i58wp_p3.mjs → schema-tables-C2xM3dho.mjs} +9 -8
- package/dist/{schemas-_m8RYRl9.mjs → schemas-BP7xiktH.mjs} +7 -6
- package/dist/{search-DObOsjbP.mjs → search-DYP3lOlq.mjs} +12 -16
- package/dist/segment-B6HnNGDs.mjs +19 -0
- package/dist/{set-CwVWeAsi.mjs → set-DpRQqdo7.mjs} +13 -11
- package/dist/{set-CJA9dpK6.mjs → set-Tt-ioa4L.mjs} +14 -13
- package/dist/setting-DUa96KF3.mjs +17 -0
- package/dist/{setup-DqBOe3HZ.mjs → setup-BPlllnim.mjs} +10 -9
- package/dist/{skills-CHU7uuDU.mjs → skills-BkregMyb.mjs} +2 -2
- package/dist/{skills-C2rTVj0n.mjs → skills-SqbPo0BI.mjs} +3 -3
- package/dist/snippet-dJ68tGsl.mjs +19 -0
- package/dist/{start-CfruN4wF.mjs → start-DJZA67WF.mjs} +70 -38
- package/dist/{stash-CWuXKSZq.mjs → stash-C89zNKxo.mjs} +21 -18
- package/dist/{status-D-RYZB9G.mjs → status-B1EJ_jv0.mjs} +16 -9
- package/dist/status-BNvFPemM.mjs +100 -0
- package/dist/status-D5wSqYV_.mjs +34 -0
- package/dist/{stop-D8Hr4cKX.mjs → stop-5rCLmkCQ.mjs} +16 -11
- package/dist/{summary-Lt2XLBK9.mjs → summary-Cihbx0Qs.mjs} +8 -7
- package/dist/{sync-schema-BDElSynU.mjs → sync-schema-C3odu0ZH.mjs} +12 -11
- package/dist/table-J2f0STnB.mjs +19 -0
- package/dist/{table-B-PYcgGb.mjs → table-qDD2kApF.mjs} +1 -1
- package/dist/{transform-job-BrhOLO4M.mjs → transform-job-DjhoJbiV.mjs} +1 -1
- package/dist/transform-job-OW4SDhsQ.mjs +19 -0
- package/dist/transform-q1LYWQtW.mjs +24 -0
- package/dist/{tree-DfvjDjmk.mjs → tree-mvq9gM9w.mjs} +7 -6
- package/dist/{update-DzgXF082.mjs → update-BoIiuC70.mjs} +16 -14
- package/dist/{update-qnFY5IuC.mjs → update-C0jP0AKT.mjs} +12 -11
- package/dist/{update-zp7pCBZH.mjs → update-CbBnHz42.mjs} +16 -14
- package/dist/{update-B0bjPqKC.mjs → update-CtOo3LsX.mjs} +13 -12
- package/dist/{update-CVxOxmt6.mjs → update-DCrOQ1PW.mjs} +17 -15
- package/dist/{update-BYduslhn.mjs → update-DEZayTb4.mjs} +20 -15
- package/dist/{update-BgcroYkF.mjs → update-DwRxdflw.mjs} +12 -11
- package/dist/{update-D9Z8cL7h.mjs → update-Rr4usmCo.mjs} +12 -11
- package/dist/{update-DuA8-cCq.mjs → update-VvKMnwsM.mjs} +16 -14
- package/dist/{update-dashcard-CQ3kmmss.mjs → update-dashcard-DFvIz8Qj.mjs} +12 -11
- package/dist/{update-CqnDMNtZ.mjs → update-tRparnUs.mjs} +18 -16
- package/dist/{upgrade-CIgTr2CG.mjs → upgrade-D-Rl_fH9.mjs} +16 -29
- package/dist/{url-B5MgZXzg.mjs → url-BB6jeNQj.mjs} +11 -10
- package/dist/{uuid-CJz9TmHI.mjs → uuid-BSVUk8u2.mjs} +8 -6
- package/dist/{validate-CB0bu50i.mjs → validate-dPEOnOf8.mjs} +2 -1
- package/dist/{validate-query-CavIA0Q2.mjs → validate-query-CYvOP8Ld.mjs} +3 -3
- package/dist/values-D1RJE4H6.mjs +45 -0
- package/dist/verify-A7BWfBPZ.mjs +79 -0
- package/dist/{wait-BFqBlg0y.mjs → wait-B17I_pWy.mjs} +2 -2
- package/dist/{wait-tDp9ZOou.mjs → wait-DK5QDZ8n.mjs} +14 -10
- package/dist/{wait-flags-CN-e9zNq.mjs → wait-flags-DlfbIXHw.mjs} +20 -9
- package/dist/{workspace-credentials-4lIxxz4g.mjs → workspace-credentials-8CBMQJFz.mjs} +2 -2
- package/dist/workspace-ri6r3zWo.mjs +25 -0
- package/dist/{yaml-ECiog374.mjs → yaml-Gv6wRFMF.mjs} +1 -1
- package/package.json +2 -1
- package/skill-data/core/SKILL.md +55 -453
- package/skill-data/git-sync/SKILL.md +1 -1
- package/skill-data/mbql/SKILL.md +156 -0
- package/skill-data/mbql/references/operators.md +253 -0
- package/skill-data/transform/SKILL.md +2 -40
- package/skill-data/viz/SKILL.md +137 -0
- package/skill-data/viz/references/settings.md +312 -0
- package/skill-data/workspace/SKILL.md +45 -63
- package/skills/metabase-cli/SKILL.md +5 -26
- package/dist/add-collection-ucsyAMkV.mjs +0 -11
- package/dist/api-key-BENHbTbV.mjs +0 -13
- package/dist/auth-DICRtJDy.mjs +0 -19
- package/dist/card-l-UmrUIo.mjs +0 -20
- package/dist/collection-oV0olVY-.mjs +0 -19
- package/dist/command-augment-D9pI9Vbh.mjs +0 -11
- package/dist/create-CrUq6sib.mjs +0 -125
- package/dist/create-D3Z878yr.mjs +0 -50
- package/dist/create-Le3Bqn7b.mjs +0 -48
- package/dist/create-V-q2rU0T.mjs +0 -48
- package/dist/create-swbIXdo5.mjs +0 -48
- package/dist/current-task-DCq7rk9V.mjs +0 -36
- package/dist/dashboard-hbKDd36X.mjs +0 -20
- package/dist/db-qVK6NsdB.mjs +0 -22
- package/dist/eid-CDFXX_6H.mjs +0 -13
- package/dist/field-C0LE7RQI.mjs +0 -18
- package/dist/flag-pair-Fmcdkrfx.mjs +0 -17
- package/dist/get-run-CwFuR4Uw.mjs +0 -36
- package/dist/git-sync-DV7YjniX.mjs +0 -28
- package/dist/is-dirty-LxVbm2C5.mjs +0 -10
- package/dist/key-CCJdVWKc.mjs +0 -12
- package/dist/license-Cb6ewEJO.mjs +0 -17
- package/dist/list-DV6CONhp.mjs +0 -55
- package/dist/login-D1nZwgKv.mjs +0 -192
- package/dist/measure-XhJuL77y.mjs +0 -19
- package/dist/package-DFUprkSZ.mjs +0 -85
- package/dist/provision-BP-b4Are.mjs +0 -77
- package/dist/ps-Bk6unzaX.mjs +0 -11
- package/dist/remove-collection-Bc4roCq0.mjs +0 -38
- package/dist/segment-DfxZdJmR.mjs +0 -19
- package/dist/setting-Czy4ws6h.mjs +0 -18
- package/dist/snippet-BCY4KHBU.mjs +0 -19
- package/dist/status-1oUnw803.mjs +0 -56
- package/dist/status-J9HIDcA5.mjs +0 -32
- package/dist/table-BwX3Ib5f.mjs +0 -19
- package/dist/transform-iaAi37V0.mjs +0 -24
- package/dist/transform-job-Bemonf82.mjs +0 -19
- package/dist/values-BXN6tx1i.mjs +0 -36
- package/dist/workspace-BBsT0H0g.mjs +0 -24
- /package/dist/{body-flags-BK7J6Daz.mjs → body-flags-D7q87Btw.mjs} +0 -0
- /package/dist/{collection-B3sPXRLs.mjs → collection-Bcy8cWYH.mjs} +0 -0
- /package/dist/{paginate-CTSfuYiF.mjs → paginate-BexjkjbY.mjs} +0 -0
- /package/dist/{revision-message-flag-oyq2xrDU.mjs → revision-message-flag-DY29-cgz.mjs} +0 -0
- /package/dist/{segment-BMrUBz94.mjs → segment-DhBmcr_E.mjs} +0 -0
- /package/dist/{setting-CTaAeMci.mjs → setting-BzCng1Ub.mjs} +0 -0
- /package/dist/{snippet-CSWqkslB.mjs → snippet-bi_0XbNT.mjs} +0 -0
- /package/dist/{transform-DR4ejuPM.mjs → transform-BKahefz_.mjs} +0 -0
- /package/dist/{workspace-DUfqhPm5.mjs → workspace-D8HtUN0y.mjs} +0 -0
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "./poll-
|
|
11
|
-
import { parseWaitFlags, waitFlags } from "./wait-flags-
|
|
12
|
-
import { Workspace, WorkspaceUpdateDatabaseInput, workspaceView } from "./workspace-
|
|
13
|
-
import { waitForDatabaseProvisioned } from "./wait-
|
|
14
|
-
import { parseSchemasCsv } from "./parse-schemas-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
8
|
+
import { readBody } from "./body-tcURGnGh.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
10
|
+
import "./poll-4eoh5J0r.mjs";
|
|
11
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-DlfbIXHw.mjs";
|
|
12
|
+
import { Workspace, WorkspaceUpdateDatabaseInput, workspaceView } from "./workspace-D8HtUN0y.mjs";
|
|
13
|
+
import { waitForDatabaseProvisioned } from "./wait-B17I_pWy.mjs";
|
|
14
|
+
import { parseSchemasCsv } from "./parse-schemas-D-qVLl4z.mjs";
|
|
15
15
|
|
|
16
16
|
//#region src/commands/workspace/database/update.ts
|
|
17
17
|
var update_default = defineMetabaseCommand({
|
|
@@ -19,6 +19,10 @@ var update_default = defineMetabaseCommand({
|
|
|
19
19
|
name: "update",
|
|
20
20
|
description: "Update a workspace's database (deprovisions then re-provisions with new input schemas)"
|
|
21
21
|
},
|
|
22
|
+
capabilities: {
|
|
23
|
+
minVersion: 62,
|
|
24
|
+
tokenFeature: "workspaces"
|
|
25
|
+
},
|
|
22
26
|
args: {
|
|
23
27
|
...outputFlags,
|
|
24
28
|
...profileFlag,
|
|
@@ -65,7 +69,8 @@ var update_default = defineMetabaseCommand({
|
|
|
65
69
|
body
|
|
66
70
|
});
|
|
67
71
|
const final = wait.enabled ? await waitForDatabaseProvisioned(client, workspaceId, databaseId, wait.schedule) : initial;
|
|
68
|
-
|
|
72
|
+
const message = wait.enabled ? `Re-provisioned database ${databaseId} in workspace ${workspaceId}.` : `Started re-provisioning database ${databaseId} in workspace ${workspaceId}; rerun with --wait to block until ready.`;
|
|
73
|
+
renderSummary(final, workspaceView, message, ctx);
|
|
69
74
|
}
|
|
70
75
|
});
|
|
71
76
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { TransformJob, TransformJobUpdateInput, transformJobView } from "./transform-job-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
8
|
+
import { readBody } from "./body-tcURGnGh.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
10
|
+
import { TransformJob, TransformJobUpdateInput, transformJobView } from "./transform-job-DjhoJbiV.mjs";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/transform-job/update.ts
|
|
13
13
|
var update_default = defineMetabaseCommand({
|
|
@@ -15,6 +15,7 @@ var update_default = defineMetabaseCommand({
|
|
|
15
15
|
name: "update",
|
|
16
16
|
description: "Update a transform job by id"
|
|
17
17
|
},
|
|
18
|
+
capabilities: { minVersion: 59 },
|
|
18
19
|
args: {
|
|
19
20
|
...outputFlags,
|
|
20
21
|
...profileFlag,
|
|
@@ -43,7 +44,7 @@ var update_default = defineMetabaseCommand({
|
|
|
43
44
|
method: "PUT",
|
|
44
45
|
body
|
|
45
46
|
});
|
|
46
|
-
|
|
47
|
+
renderSummary(updated, transformJobView, `Updated transform job ${updated.id} "${updated.name}".`, ctx);
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import { Field, FieldUpdateInput, fieldView } from "./field-E0IBy4Uw.mjs";
|
|
8
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
9
|
+
import { readBody } from "./body-tcURGnGh.mjs";
|
|
10
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/field/update.ts
|
|
13
13
|
var update_default = defineMetabaseCommand({
|
|
@@ -15,6 +15,7 @@ var update_default = defineMetabaseCommand({
|
|
|
15
15
|
name: "update",
|
|
16
16
|
description: "Update a field (description, semantic_type, FK target, visibility, etc.)"
|
|
17
17
|
},
|
|
18
|
+
capabilities: { minVersion: 58 },
|
|
18
19
|
args: {
|
|
19
20
|
...outputFlags,
|
|
20
21
|
...profileFlag,
|
|
@@ -43,7 +44,7 @@ var update_default = defineMetabaseCommand({
|
|
|
43
44
|
method: "PUT",
|
|
44
45
|
body
|
|
45
46
|
});
|
|
46
|
-
|
|
47
|
+
renderSummary(updated, fieldView, `Updated field ${updated.id} "${updated.display_name}".`, ctx);
|
|
47
48
|
}
|
|
48
49
|
});
|
|
49
50
|
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import "./validate-
|
|
11
|
-
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-
|
|
12
|
-
import { Segment, SegmentUpdateInput, segmentView } from "./segment-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
8
|
+
import { readBody } from "./body-tcURGnGh.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
10
|
+
import "./validate-dPEOnOf8.mjs";
|
|
11
|
+
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CYvOP8Ld.mjs";
|
|
12
|
+
import { Segment, SegmentUpdateInput, segmentView } from "./segment-DhBmcr_E.mjs";
|
|
13
13
|
|
|
14
14
|
//#region src/commands/segment/update.ts
|
|
15
15
|
var update_default = defineMetabaseCommand({
|
|
16
16
|
meta: {
|
|
17
17
|
name: "update",
|
|
18
|
-
description: "Update a segment by id
|
|
18
|
+
description: "Update a segment by id (body must include revision_message)"
|
|
19
19
|
},
|
|
20
|
+
details: "Patches only the fields you send and must include `revision_message` (recorded in the audit log). When `definition` is an MBQL 5 query it is checked against a bundled JSON Schema before sending; pass --skip-validate to bypass. See `mb skills get mbql`.",
|
|
21
|
+
capabilities: { minVersion: 58 },
|
|
20
22
|
args: {
|
|
21
23
|
...outputFlags,
|
|
22
24
|
...profileFlag,
|
|
@@ -48,7 +50,7 @@ var update_default = defineMetabaseCommand({
|
|
|
48
50
|
method: "PUT",
|
|
49
51
|
body
|
|
50
52
|
});
|
|
51
|
-
|
|
53
|
+
renderSummary(updated, segmentView, `Updated segment ${updated.id} "${updated.name}".`, ctx);
|
|
52
54
|
}
|
|
53
55
|
});
|
|
54
56
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { DashboardDetail, Dashcard, DashcardPatchInput, dashcardView } from "./dashboard-
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
8
|
+
import { readBody } from "./body-tcURGnGh.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
10
|
+
import { DashboardDetail, Dashcard, DashcardPatchInput, dashcardView } from "./dashboard-B4bn3z6t.mjs";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/dashboard/update-dashcard.ts
|
|
13
13
|
var update_dashcard_default = defineMetabaseCommand({
|
|
@@ -15,6 +15,7 @@ var update_dashcard_default = defineMetabaseCommand({
|
|
|
15
15
|
name: "update-dashcard",
|
|
16
16
|
description: "Patch a single dashcard's layout or settings on a dashboard"
|
|
17
17
|
},
|
|
18
|
+
capabilities: { minVersion: 58 },
|
|
18
19
|
args: {
|
|
19
20
|
...outputFlags,
|
|
20
21
|
...profileFlag,
|
|
@@ -59,7 +60,7 @@ var update_dashcard_default = defineMetabaseCommand({
|
|
|
59
60
|
});
|
|
60
61
|
const refreshed = result.dashcards.find((dashcard) => dashcard.id === dashcardId);
|
|
61
62
|
if (refreshed === void 0) throw new Error(`PUT /api/dashboard/${dashboardId}: dashcard ${dashcardId} missing from response`);
|
|
62
|
-
|
|
63
|
+
renderSummary(refreshed, dashcardView, `Updated dashcard ${dashcardId} on dashboard ${dashboardId} (row ${refreshed.row}, col ${refreshed.col}, ${refreshed.size_x}x${refreshed.size_y}).`, ctx);
|
|
63
64
|
}
|
|
64
65
|
});
|
|
65
66
|
function stripEntityId(dashcard) {
|
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { parseId } from "./parse-id-
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
12
|
-
import "./validate-
|
|
13
|
-
import { DashboardDetail, DashboardUpdateInput, dashboardView } from "./dashboard-
|
|
14
|
-
import { preflightDashcardCardReferences } from "./preflight-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import "./field-E0IBy4Uw.mjs";
|
|
8
|
+
import "./card-ezYiriML.mjs";
|
|
9
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
10
|
+
import { readBody } from "./body-tcURGnGh.mjs";
|
|
11
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
12
|
+
import "./validate-dPEOnOf8.mjs";
|
|
13
|
+
import { DashboardDetail, DashboardUpdateInput, dashboardView } from "./dashboard-B4bn3z6t.mjs";
|
|
14
|
+
import { preflightDashcardCardReferences } from "./preflight-BhsErYz3.mjs";
|
|
15
15
|
|
|
16
16
|
//#region src/commands/dashboard/update.ts
|
|
17
17
|
var update_default = defineMetabaseCommand({
|
|
18
18
|
meta: {
|
|
19
19
|
name: "update",
|
|
20
|
-
description: "Update a dashboard (and optionally its dashcards/tabs) by id
|
|
20
|
+
description: "Update a dashboard (and optionally its dashcards/tabs) by id"
|
|
21
21
|
},
|
|
22
|
+
details: "Any positive card_id referenced from dashcards is pre-flight-validated (exists and readable, not archived) before the PUT.",
|
|
23
|
+
capabilities: { minVersion: 58 },
|
|
22
24
|
args: {
|
|
23
25
|
...outputFlags,
|
|
24
26
|
...profileFlag,
|
|
@@ -49,7 +51,7 @@ var update_default = defineMetabaseCommand({
|
|
|
49
51
|
method: "PUT",
|
|
50
52
|
body
|
|
51
53
|
});
|
|
52
|
-
|
|
54
|
+
renderSummary(updated, dashboardView, `Updated dashboard ${updated.id} "${updated.name}".`, ctx);
|
|
53
55
|
}
|
|
54
56
|
});
|
|
55
57
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { promptConfirm } from "./prompt-
|
|
7
|
-
import { streamProcess } from "./process-
|
|
1
|
+
import { AbortError, NetworkError, TimeoutError, UnknownError, errorMessage } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { outputFlags, package_default } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { HttpError, USER_AGENT, combineAborts, defineMetabaseCommand, parseJson, throwIfAborted } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem, writeText } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import { promptConfirm } from "./prompt-CFKoys7k.mjs";
|
|
7
|
+
import { streamProcess } from "./process-CM7Uu5q_.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
import { realpathSync } from "node:fs";
|
|
10
10
|
import { compare, valid } from "semver";
|
|
@@ -243,7 +243,7 @@ function safeRealpath(path) {
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
//#endregion
|
|
246
|
-
//#region src/core/
|
|
246
|
+
//#region src/core/semver.ts
|
|
247
247
|
const SEMVER_MESSAGE = "expected semver MAJOR.MINOR.PATCH[-prerelease][+build]";
|
|
248
248
|
const SemverString = z.string().refine((value) => valid(value) !== null, { message: SEMVER_MESSAGE });
|
|
249
249
|
function compareSemver(a, b) {
|
|
@@ -304,6 +304,7 @@ var upgrade_default = defineMetabaseCommand({
|
|
|
304
304
|
name: "upgrade",
|
|
305
305
|
description: "Upgrade the Metabase CLI itself to the latest published release"
|
|
306
306
|
},
|
|
307
|
+
capabilities: null,
|
|
307
308
|
args: {
|
|
308
309
|
...outputFlags,
|
|
309
310
|
check: {
|
|
@@ -396,30 +397,16 @@ function emitStatus(status, install, command, ctx) {
|
|
|
396
397
|
}
|
|
397
398
|
function buildHumanText(status, install, command) {
|
|
398
399
|
if (!status.changeRequired) return `Up to date (${status.currentVersion}).`;
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
const tail = buildHumanTail(install, command);
|
|
402
|
-
return [
|
|
403
|
-
...header,
|
|
404
|
-
"",
|
|
405
|
-
...tail
|
|
406
|
-
].join("\n");
|
|
400
|
+
const headline = status.targetVersion === status.latestVersion ? `Update available: ${status.currentVersion} → ${status.latestVersion}` : `Target ${status.targetVersion} (current ${status.currentVersion}, latest ${status.latestVersion}).`;
|
|
401
|
+
return [headline, ...buildHumanTail(install, command)].join("\n");
|
|
407
402
|
}
|
|
408
403
|
function buildHumanTail(install, command) {
|
|
409
404
|
switch (install.kind) {
|
|
410
|
-
case "npm-global": return [
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
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`];
|
|
405
|
+
case "npm-global": return command === null ? [] : [`Run: ${command.display}`];
|
|
406
|
+
case "npm-local": return command === null ? [] : [`Run in that project: ${command.display}`];
|
|
407
|
+
case "npx": return ["Running via npx — it fetches the latest version on each run, no upgrade needed."];
|
|
408
|
+
case "dev": return [`Running from source at ${install.realPath}. Pull the latest changes and rebuild.`];
|
|
409
|
+
case "unknown": return ["Reinstall with your package manager, e.g. npm install -g @metabase/cli@latest"];
|
|
423
410
|
}
|
|
424
411
|
}
|
|
425
412
|
function formatCommandCell(value) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import "./poll-
|
|
8
|
-
import "./process-
|
|
9
|
-
import { checkDockerReady, requireWorkspaceContainerLocation } from "./docker-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { outputFlags } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand, localUrl } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
7
|
+
import "./poll-4eoh5J0r.mjs";
|
|
8
|
+
import "./process-CM7Uu5q_.mjs";
|
|
9
|
+
import { checkDockerReady, requireWorkspaceContainerLocation } from "./docker-Ds252Mwc.mjs";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/workspace/url.ts
|
|
@@ -29,6 +29,7 @@ var url_default = defineMetabaseCommand({
|
|
|
29
29
|
name: "url",
|
|
30
30
|
description: "Print the local URL the workspace's container is bound to"
|
|
31
31
|
},
|
|
32
|
+
capabilities: null,
|
|
32
33
|
args: {
|
|
33
34
|
...outputFlags,
|
|
34
35
|
id: {
|
|
@@ -47,7 +48,7 @@ var url_default = defineMetabaseCommand({
|
|
|
47
48
|
workspace_id: workspaceId,
|
|
48
49
|
url: localUrl(hostPort)
|
|
49
50
|
};
|
|
50
|
-
|
|
51
|
+
renderSummary(result, urlResultView, result.url, ctx);
|
|
51
52
|
}
|
|
52
53
|
});
|
|
53
54
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { outputFlags } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseInteger } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { writeJson, writeText } from "./render-0_GsapXa.mjs";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
import { randomUUID } from "node:crypto";
|
|
8
8
|
|
|
@@ -12,8 +12,10 @@ const UuidList = z.array(z.string().uuid());
|
|
|
12
12
|
var uuid_default = defineMetabaseCommand({
|
|
13
13
|
meta: {
|
|
14
14
|
name: "uuid",
|
|
15
|
-
description: "Mint UUID v4 strings
|
|
15
|
+
description: "Mint random UUID v4 strings"
|
|
16
16
|
},
|
|
17
|
+
details: "For MBQL `lib/uuid` slots, native template-tag ids, and other UUID fields. Mint fresh values here rather than authoring them by hand — the MBQL 5 schema rejects placeholder strings. See `mb skills get mbql`.",
|
|
18
|
+
capabilities: null,
|
|
17
19
|
args: {
|
|
18
20
|
...outputFlags,
|
|
19
21
|
count: {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConfigError, escapeJsonPointerSegment
|
|
1
|
+
import { ConfigError, escapeJsonPointerSegment } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { isPlainObject } from "./capabilities-7e9MgquN.mjs";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
4
5
|
import addFormats from "ajv-formats";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { writeJson } from "./render-0_GsapXa.mjs";
|
|
3
|
+
import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-dPEOnOf8.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/validate-query.ts
|
|
6
6
|
const skipValidateFlag = { "skip-validate": {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { formatScalar, renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import { FieldValues, fieldValuesView } from "./field-E0IBy4Uw.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
8
|
+
|
|
9
|
+
//#region src/commands/field/values.ts
|
|
10
|
+
var values_default = defineMetabaseCommand({
|
|
11
|
+
meta: {
|
|
12
|
+
name: "values",
|
|
13
|
+
description: "Fetch the cached distinct values for a field (FieldValues list)"
|
|
14
|
+
},
|
|
15
|
+
capabilities: { minVersion: 58 },
|
|
16
|
+
args: {
|
|
17
|
+
...outputFlags,
|
|
18
|
+
...profileFlag,
|
|
19
|
+
...connectionFlags,
|
|
20
|
+
id: {
|
|
21
|
+
type: "positional",
|
|
22
|
+
description: "Field id",
|
|
23
|
+
required: true
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
outputSchema: FieldValues,
|
|
27
|
+
examples: ["mb field values 100", "mb field values 100 --json"],
|
|
28
|
+
async run({ args, ctx, getClient }) {
|
|
29
|
+
const id = parseId(args.id);
|
|
30
|
+
const client = await getClient();
|
|
31
|
+
const values = await client.requestParsed(FieldValues, `/api/field/${id}/values`);
|
|
32
|
+
const fieldId = values.field_id ?? id;
|
|
33
|
+
const count = values.values.length;
|
|
34
|
+
renderSummary(values, fieldValuesView, () => {
|
|
35
|
+
if (count === 0) return `Field ${fieldId} has no cached values.`;
|
|
36
|
+
const more = values.has_more_values === true ? " (more available; rescan for the full set)" : "";
|
|
37
|
+
const header = `Field ${fieldId} has ${count} cached value${count === 1 ? "" : "s"}${more}:`;
|
|
38
|
+
const lines = values.values.map((row) => ` ${formatScalar(row[0])}`);
|
|
39
|
+
return [header, ...lines].join("\n");
|
|
40
|
+
}, ctx);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
//#endregion
|
|
45
|
+
export { values_default as default };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { MetabaseError, NetworkError, TimeoutError, errorMessage } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { HttpError, createClient, probeServer } from "./runtime-Duawf5lE.mjs";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
//#region src/domain/user.ts
|
|
6
|
+
const CurrentUser = z.object({
|
|
7
|
+
id: z.number().int(),
|
|
8
|
+
email: z.email(),
|
|
9
|
+
common_name: z.string(),
|
|
10
|
+
is_superuser: z.boolean()
|
|
11
|
+
}).loose();
|
|
12
|
+
const CurrentUserCompact = CurrentUser.pick({
|
|
13
|
+
id: true,
|
|
14
|
+
email: true,
|
|
15
|
+
common_name: true,
|
|
16
|
+
is_superuser: true
|
|
17
|
+
}).strip();
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/core/auth/verify.ts
|
|
21
|
+
const VERIFY_TIMEOUT_MS = 15e3;
|
|
22
|
+
const USER_PATH = "/api/user/current";
|
|
23
|
+
async function verifyAndProbe(url, apiKey) {
|
|
24
|
+
const client = createClient({
|
|
25
|
+
url,
|
|
26
|
+
apiKey
|
|
27
|
+
});
|
|
28
|
+
const userPromise = client.requestParsed(CurrentUser, USER_PATH, {
|
|
29
|
+
timeoutMs: VERIFY_TIMEOUT_MS,
|
|
30
|
+
retries: 0
|
|
31
|
+
});
|
|
32
|
+
const serverPromise = probeServer(client);
|
|
33
|
+
const [userResult, serverResult] = await Promise.allSettled([userPromise, serverPromise]);
|
|
34
|
+
if (userResult.status === "rejected") return failure(userResult.reason, "user");
|
|
35
|
+
if (serverResult.status === "rejected") return failure(serverResult.reason, "server");
|
|
36
|
+
const probed = {
|
|
37
|
+
id: userResult.value.id,
|
|
38
|
+
name: userResult.value.common_name,
|
|
39
|
+
isAdmin: userResult.value.is_superuser
|
|
40
|
+
};
|
|
41
|
+
return {
|
|
42
|
+
ok: true,
|
|
43
|
+
user: probed,
|
|
44
|
+
server: serverResult.value
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
function failure(error, which) {
|
|
48
|
+
if (error instanceof HttpError) {
|
|
49
|
+
const kind = error.status === 401 || error.status === 403 ? "auth" : "server";
|
|
50
|
+
return {
|
|
51
|
+
ok: false,
|
|
52
|
+
which,
|
|
53
|
+
kind,
|
|
54
|
+
status: error.status,
|
|
55
|
+
message: error.userMessage
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (error instanceof NetworkError || error instanceof TimeoutError) return {
|
|
59
|
+
ok: false,
|
|
60
|
+
which,
|
|
61
|
+
kind: "network",
|
|
62
|
+
message: error.userMessage
|
|
63
|
+
};
|
|
64
|
+
if (error instanceof MetabaseError) return {
|
|
65
|
+
ok: false,
|
|
66
|
+
which,
|
|
67
|
+
kind: "server",
|
|
68
|
+
message: error.userMessage
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
ok: false,
|
|
72
|
+
which,
|
|
73
|
+
kind: "server",
|
|
74
|
+
message: errorMessage(error)
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
export { verifyAndProbe };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { pollUntil } from "./poll-
|
|
2
|
-
import { Workspace } from "./workspace-
|
|
1
|
+
import { pollUntil } from "./poll-4eoh5J0r.mjs";
|
|
2
|
+
import { Workspace } from "./workspace-D8HtUN0y.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 "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
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-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-ZsFeevV2.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Duawf5lE.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderSummary } from "./render-0_GsapXa.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-0_tOPvfI.mjs";
|
|
7
|
+
import { SyncTaskOrIdle, formatSyncTask, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-51WRdugU.mjs";
|
|
8
|
+
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-4eoh5J0r.mjs";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/git-sync/wait.ts
|
|
11
11
|
const WaitResult = SyncTaskOrIdle;
|
|
@@ -14,6 +14,10 @@ var wait_default = defineMetabaseCommand({
|
|
|
14
14
|
name: "wait",
|
|
15
15
|
description: "Poll the current git-sync task until it reaches a terminal status"
|
|
16
16
|
},
|
|
17
|
+
capabilities: {
|
|
18
|
+
minVersion: 60,
|
|
19
|
+
tokenFeature: "remote_sync"
|
|
20
|
+
},
|
|
17
21
|
args: {
|
|
18
22
|
...outputFlags,
|
|
19
23
|
...profileFlag,
|
|
@@ -41,10 +45,10 @@ var wait_default = defineMetabaseCommand({
|
|
|
41
45
|
});
|
|
42
46
|
if (final === null) {
|
|
43
47
|
const idle = { status: "idle" };
|
|
44
|
-
|
|
48
|
+
renderSummary(idle, syncTaskIdleView, "No git-sync task is running.", ctx);
|
|
45
49
|
return;
|
|
46
50
|
}
|
|
47
|
-
|
|
51
|
+
renderSummary(final, syncTaskView, formatSyncTask(final), ctx);
|
|
48
52
|
throwIfFailedTask(final, "task");
|
|
49
53
|
}
|
|
50
54
|
});
|