@metabase/cli 0.1.4 → 0.1.6
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 +147 -101
- package/dist/{add-collection-CffaBB-Y.mjs → add-collection-BU8r3r2M.mjs} +9 -4
- package/dist/add-collection-C0w6ACQF.mjs +11 -0
- package/dist/{archive-uJrslh9r.mjs → archive-BNinrUak.mjs} +9 -8
- package/dist/{archive-GdGm7l2e.mjs → archive-C1enZgKV.mjs} +8 -7
- package/dist/archive-CDA0KxL8.mjs +40 -0
- package/dist/{archive-BAcEXbT9.mjs → archive-CRhiBpPJ.mjs} +9 -8
- package/dist/{archive-B_B3MQp0.mjs → archive-DMPS8Kih.mjs} +9 -8
- package/dist/archive-lWgqiFAt.mjs +40 -0
- package/dist/auth-CzXb_zB2.mjs +19 -0
- package/dist/{body-D6dHGjMT.mjs → body-DjdFxjpg.mjs} +4 -4
- package/dist/{branches-Bpe40fEd.mjs → branches-B1WRfG7-.mjs} +11 -7
- package/dist/{cancel-BWTY6oYI.mjs → cancel-Dl_Ho056.mjs} +7 -6
- package/dist/{cancel-task--BfiAXfS.mjs → cancel-task-CdigdCaO.mjs} +11 -7
- package/dist/capabilities-7e9MgquN.mjs +29 -0
- package/dist/card-DP4rfoOi.mjs +21 -0
- package/dist/{card-CQxvHeyP.mjs → card-DlCAaAPq.mjs} +1 -1
- package/dist/{cards-CVlFJxYh.mjs → cards-BGiJS675.mjs} +8 -7
- package/dist/cli.mjs +267 -44
- package/dist/collection-tY18ezvn.mjs +21 -0
- package/dist/{predicates-CGO17Q15.mjs → command-augment-BH9qgQ5u.mjs} +66 -14
- package/dist/create-BNiva__H.mjs +52 -0
- package/dist/{create-izE3EKCt.mjs → create-BTcpaop_.mjs} +9 -8
- package/dist/{create-BykvNpSA.mjs → create-BYlIju0b.mjs} +14 -12
- package/dist/{create-Bu-YhIDL.mjs → create-Be_0Vier.mjs} +10 -9
- package/dist/{create-DYoc9IXW.mjs → create-CHF313Qg.mjs} +13 -9
- package/dist/{create-Cz3_Wxdt.mjs → create-CwGtmwqm.mjs} +14 -12
- package/dist/{create-DP8RrLDi.mjs → create-CzzrbL0u.mjs} +10 -9
- package/dist/{create-BzElku2l.mjs → create-DGth_uOp.mjs} +14 -12
- package/dist/{create-branch-B49UQyCK.mjs → create-branch-DKZkoQ64.mjs} +11 -7
- package/dist/{create-DQVdMT2Y.mjs → create-dhxPxfF3.mjs} +16 -14
- package/dist/{credentials-xKSoP6eh.mjs → credentials-dzeq7ckm.mjs} +12 -10
- package/dist/{current-task-DweHmjlk.mjs → current-task-CCRzm0_7.mjs} +11 -7
- package/dist/dashboard-ChM_Tu0l.mjs +22 -0
- package/dist/{dashboard-CnMD04PQ.mjs → dashboard-FY5UzJ_Z.mjs} +2 -1
- package/dist/{database-BNlvldUL.mjs → database-CIXwHKjK.mjs} +3 -3
- package/dist/{database-vvig8k4x.mjs → database-lH-B3G1I.mjs} +1 -1
- package/dist/db-DrQn_i3W.mjs +22 -0
- package/dist/{remove-B3ZEqBF7.mjs → delete-CM3jnAeQ.mjs} +21 -20
- package/dist/{delete-DojHmKeM.mjs → delete-Dimc-2y8.mjs} +9 -8
- package/dist/{delete-DIz9Tgz5.mjs → delete-ZjnV35OJ.mjs} +9 -8
- package/dist/{delete-runtime-BkAdygbs.mjs → delete-runtime-B6RQo_pw.mjs} +5 -3
- package/dist/{delete-table-DjN8E3sd.mjs → delete-table-agZJpivt.mjs} +9 -8
- package/dist/{deprovision-_HDcBApz.mjs → deprovision-CwxcIT3k.mjs} +16 -12
- package/dist/{dirty-Co8V0SZ3.mjs → dirty-D4d0yHqj.mjs} +11 -7
- package/dist/{docker-D9sC_37H.mjs → docker-Oq80q3tu.mjs} +4 -4
- package/dist/{translate-CG_Ka0dO.mjs → eid-BXzaQh0o.mjs} +37 -22
- package/dist/error-C9S6PN3-.mjs +190 -0
- package/dist/{export-CVMFxoo1.mjs → export-DTygoXBP.mjs} +17 -16
- package/dist/field-Z6Pcxf4n.mjs +19 -0
- package/dist/{fields-Coha7vKv.mjs → fields-CoQi99gv.mjs} +9 -8
- package/dist/{get-DXv2FkA7.mjs → get-Bzys7vgp.mjs} +8 -7
- package/dist/{get-bNtA7vWe.mjs → get-C2p383Qc.mjs} +8 -7
- package/dist/{get-Br6WayZv.mjs → get-C3HdQ91a.mjs} +8 -7
- package/dist/{get-BOtKerj8.mjs → get-CP3Z3NiH.mjs} +9 -8
- package/dist/{get-BSKoL8ek.mjs → get-C_w1kvN3.mjs} +9 -8
- package/dist/{get-Be6EFh94.mjs → get-CzuzeKSe.mjs} +10 -9
- package/dist/{get-BVTz9B_H.mjs → get-D3SbEQSE.mjs} +10 -9
- package/dist/get-DFxZXaKz.mjs +79 -0
- package/dist/{get-DZrV7v9d.mjs → get-DQTZG_NP.mjs} +8 -7
- package/dist/{get-CJwzbVjc.mjs → get-DSWFjy7O.mjs} +8 -7
- package/dist/{get-BxzCKVC6.mjs → get-Ddr0XLh7.mjs} +8 -7
- package/dist/{get-AOvWo48B.mjs → get-Hc93A0Yz.mjs} +8 -7
- package/dist/{get-C_6K7MSW.mjs → get-lb7q3JYs.mjs} +7 -6
- package/dist/get-run-B7sKdaDU.mjs +38 -0
- package/dist/git-sync-CiGAad76.mjs +28 -0
- package/dist/{has-remote-changes-D6xgsuUr.mjs → has-remote-changes-BY10-nnE.mjs} +11 -7
- package/dist/{import-Dv0ORSNw.mjs → import-CiMz4Wz-.mjs} +17 -16
- package/dist/{input-BQ-BZA8h.mjs → input-cMSEqISy.mjs} +7 -4
- package/dist/{is-dirty-WNi8a6O9.mjs → is-dirty-BZOaryxT.mjs} +9 -4
- package/dist/is-dirty-Ume4oV0j.mjs +10 -0
- package/dist/{items-CTcAMknV.mjs → items-BWfvkY-J.mjs} +9 -8
- package/dist/key-C2XG394c.mjs +17 -0
- package/dist/license-Dxarh-gG.mjs +17 -0
- package/dist/{list-FXuSCYpa.mjs → list--OYdUTtu.mjs} +7 -6
- package/dist/{list-8oVMvlLV.mjs → list-2j7GsXsl.mjs} +7 -6
- package/dist/{list-xQmtQPSl.mjs → list-BI4zr8LW.mjs} +10 -8
- package/dist/{list-DhWG5jiW.mjs → list-Brgh-Z2v.mjs} +8 -6
- package/dist/{list-DSs0Q78i.mjs → list-C3hfovHv.mjs} +7 -6
- package/dist/{list-DvUjMQze.mjs → list-CL7eCOQE.mjs} +7 -6
- package/dist/list-Clz5igWg.mjs +44 -0
- package/dist/list-D4sFiqX8.mjs +173 -0
- package/dist/{list-BxdXvGTK.mjs → list-DXH7TlkU.mjs} +9 -7
- package/dist/{list-CocYwmnI.mjs → list-DZ8fNUoQ.mjs} +9 -8
- package/dist/{list-DjhZU-FY.mjs → list-SOG0whQ-.mjs} +7 -6
- package/dist/{list-DI7K3K6k.mjs → list-d58BprgJ.mjs} +7 -6
- package/dist/{list-NiwCL_1X.mjs → list-sD5N3fGk.mjs} +9 -8
- package/dist/{list-CbJeP0Z6.mjs → list-zSO0DMw-.mjs} +10 -6
- package/dist/{login-SXsSH0I1.mjs → login-Bm2AnCez.mjs} +65 -80
- package/dist/{logout-bgOXjxbN.mjs → logout-BlyRJODO.mjs} +8 -7
- package/dist/{logs-BnwVbFuD.mjs → logs-CywPikkL.mjs} +9 -8
- package/dist/{manifest-CGM7XNLC.mjs → manifest-BBR46KFM.mjs} +15 -15
- package/dist/measure-C44EK_xt.mjs +20 -0
- package/dist/{measure-BEQfnLdN.mjs → measure-ClESGxIb.mjs} +2 -2
- package/dist/{metadata-Bu2HOmuX.mjs → metadata-B8ZSF9LA.mjs} +10 -9
- package/dist/{metadata-B0WZT3Yb.mjs → metadata-DqiI2q9q.mjs} +9 -8
- package/dist/parse-enum-CrEWOhuY.mjs +11 -0
- package/dist/{parse-id-B3B-0hUA.mjs → parse-id-lk_K-CEF.mjs} +1 -1
- package/dist/{parse-ref-D1yeDOn8.mjs → parse-ref-BiETXmvm.mjs} +1 -1
- package/dist/{parse-schemas-DgtVLikM.mjs → parse-schemas-BqUdWUwq.mjs} +2 -2
- package/dist/path-AEtZ3mBq.mjs +58 -0
- package/dist/{poll-BCnrcUVf.mjs → poll-DHKDpCiq.mjs} +2 -2
- package/dist/{poll-task-0b1V6G-8.mjs → poll-task-Cooi0lQV.mjs} +3 -20
- package/dist/{preflight-5ACaYnDp.mjs → preflight-aXV5LyDs.mjs} +4 -4
- package/dist/{process-FjsqDwKo.mjs → process-C7V8LJ-j.mjs} +1 -1
- package/dist/{prompt-DgDNy_Pc.mjs → prompt-CFKoys7k.mjs} +3 -1
- package/dist/{provision-29Zt62Ft.mjs → provision-UWcNDoDe.mjs} +29 -24
- package/dist/{ps-BMFiRCi4.mjs → ps-CJU0EbrC.mjs} +5 -3
- package/dist/ps-DEroLgbI.mjs +11 -0
- package/dist/{query-DxA353Hy.mjs → query-AaKzYnTY.mjs} +9 -8
- package/dist/{query-aba8MEe_.mjs → query-BlsVNZpD.mjs} +15 -13
- package/dist/{remove-BfgU_CQi.mjs → remove-BFWun0e8.mjs} +9 -8
- package/dist/{remove-collection-Brv72xUe.mjs → remove-collection-CoCmrrQs.mjs} +13 -9
- package/dist/{render-DuoDUTVL.mjs → render-CfznwleY.mjs} +15 -17
- package/dist/render-OQn3iRsI.mjs +32 -0
- package/dist/{rescan-values-DIAdjoq7.mjs → rescan-values-C0FDsjT7.mjs} +10 -9
- package/dist/{run-CgXRo0hD.mjs → run-B4Wn43zm.mjs} +10 -9
- package/dist/{runs-DtLRw6xg.mjs → runs-Bbaszr18.mjs} +9 -8
- package/dist/{runtime-Br8L4NPm.mjs → runtime-Dmv5VtUK.mjs} +657 -428
- package/dist/{schema-tables-DiKMY6lx.mjs → schema-tables-CaWinbuK.mjs} +9 -8
- package/dist/{schemas-Bvr8cOzo.mjs → schemas-DUgGpAyB.mjs} +7 -6
- package/dist/{search-BT_TCcTd.mjs → search-BLrBXLUk.mjs} +12 -16
- package/dist/segment-B3Uwwcsm.mjs +20 -0
- package/dist/{set-DtG0KH6P.mjs → set-B8cUbRLD.mjs} +13 -12
- package/dist/{set-CAIkXlPy.mjs → set-DfGsta5O.mjs} +11 -10
- package/dist/{setting-BDOi5fk_.mjs → setting-D2p2MA7f.mjs} +3 -3
- package/dist/{setup-LjTvvlJy.mjs → setup-C9ikBRw_.mjs} +9 -8
- package/dist/skills-CUHIcQS6.mjs +18 -0
- package/dist/skills-CiN1OQ8W.mjs +191 -0
- package/dist/snippet-B7D0uWlz.mjs +20 -0
- package/dist/{start-CXKt0Q7A.mjs → start-3PX3ahjT.mjs} +68 -36
- package/dist/{stash-dRw1UEwg.mjs → stash-EIDcSvpF.mjs} +17 -16
- package/dist/{status-C2niMfrQ.mjs → status-95ElRAu9.mjs} +12 -8
- package/dist/status-B0_MiZEf.mjs +100 -0
- package/dist/status-CEplmC44.mjs +34 -0
- package/dist/{stop-BdedYfwU.mjs → stop-CQ0XGrN8.mjs} +11 -10
- package/dist/{summary-BPDA4K99.mjs → summary-C12LiEuJ.mjs} +8 -7
- package/dist/{sync-schema-D95LLRpf.mjs → sync-schema-Ba8M3DiX.mjs} +10 -9
- package/dist/{table-B-PYcgGb.mjs → table-C7a5V6Zn.mjs} +1 -1
- package/dist/table-e6h8SLVX.mjs +20 -0
- package/dist/transform-BMYh1lsC.mjs +25 -0
- package/dist/transform-job-Cm7z5TfH.mjs +20 -0
- package/dist/{transform-job-Csr86muI.mjs → transform-job-DeTDPMxt.mjs} +1 -1
- package/dist/{tree-DazZT7dR.mjs → tree-Des2ZG9d.mjs} +6 -5
- package/dist/{update-DE6kjV-f.mjs → update-Bx54nWEI.mjs} +17 -15
- package/dist/{update-bW-i6gjZ.mjs → update-CyIZdbIQ.mjs} +11 -10
- package/dist/{update-djgvzO3K.mjs → update-DBi5U8zb.mjs} +16 -14
- package/dist/{update-CJSDB6S8.mjs → update-DHZubok3.mjs} +18 -14
- package/dist/{update-BBfvArCx.mjs → update-DSgceARZ.mjs} +11 -10
- package/dist/{update-DSWZSfpw.mjs → update-DzAN4SPj.mjs} +15 -13
- package/dist/{update-WyRKlQPh.mjs → update-F6DmZncY.mjs} +11 -10
- package/dist/{update-DTIWJxob.mjs → update-_QfgNa53.mjs} +12 -11
- package/dist/{update-dashcard-BhD5x__K.mjs → update-dashcard-wpSjv4M7.mjs} +11 -10
- package/dist/{update-9kVyE3BJ.mjs → update-mYVnoYNV.mjs} +15 -13
- package/dist/{update-659eQR1L.mjs → update-njHe3j-s.mjs} +15 -13
- package/dist/{upgrade-D58rvXHM.mjs → upgrade-iAuvhX-W.mjs} +9 -8
- package/dist/{url-DKkSu2D8.mjs → url-DWaT6WIZ.mjs} +11 -10
- package/dist/{uuid-BF20B59s.mjs → uuid-CMKnS8-z.mjs} +8 -6
- package/dist/{validate-CB0bu50i.mjs → validate-dPEOnOf8.mjs} +2 -1
- package/dist/{validate-query-CavIA0Q2.mjs → validate-query-Cw6WE5Y8.mjs} +3 -3
- package/dist/{values-DyjmpcbT.mjs → values-BfSTAbzc.mjs} +8 -7
- package/dist/verify-D5YtTqqp.mjs +79 -0
- package/dist/{wait-CeUPCgdc.mjs → wait-8yV9_WIo.mjs} +2 -2
- package/dist/{wait-DhkTaV6E.mjs → wait-Bv3Tsnv4.mjs} +12 -8
- package/dist/{wait-flags-BR-yqe7y.mjs → wait-flags-Dzq9BGQY.mjs} +20 -9
- package/dist/workspace-CKLZrR7l.mjs +26 -0
- package/dist/{workspace-credentials-Cctumbru.mjs → workspace-credentials-BXpABsNZ.mjs} +2 -41
- package/dist/yaml-YTQiYJ9s.mjs +43 -0
- package/package.json +6 -2
- package/skill-data/core/SKILL.md +177 -0
- package/skill-data/git-sync/SKILL.md +196 -0
- package/skill-data/mbql/SKILL.md +156 -0
- package/skill-data/mbql/references/operators.md +253 -0
- package/skill-data/transform/SKILL.md +197 -0
- package/skill-data/viz/SKILL.md +137 -0
- package/skill-data/viz/references/settings.md +312 -0
- package/skill-data/workspace/SKILL.md +390 -0
- package/skills/metabase-cli/SKILL.md +21 -0
- package/dist/add-collection-CPL1njYZ.mjs +0 -11
- package/dist/api-key-9p1UPnXn.mjs +0 -13
- package/dist/auth-N4w5xtwW.mjs +0 -19
- package/dist/card-4rZRb5bc.mjs +0 -20
- package/dist/collection-Cp_B02I4.mjs +0 -19
- package/dist/command-augment-D9pI9Vbh.mjs +0 -11
- package/dist/create-doyv3SxU.mjs +0 -50
- package/dist/create-ov-De5dO.mjs +0 -125
- package/dist/dashboard-BYBiA-IG.mjs +0 -20
- package/dist/db-CObVU22j.mjs +0 -22
- package/dist/eid-Cr5r-t9B.mjs +0 -13
- package/dist/field-CbljasCH.mjs +0 -18
- package/dist/flag-pair-Fmcdkrfx.mjs +0 -17
- package/dist/get-run-CSrXHDGS.mjs +0 -36
- package/dist/git-sync-BGkS8o5b.mjs +0 -28
- package/dist/is-dirty-BOZ4xz92.mjs +0 -10
- package/dist/key-CCJdVWKc.mjs +0 -12
- package/dist/license-DLLTpFvP.mjs +0 -17
- package/dist/list-BNzdnE1c.mjs +0 -55
- package/dist/measure-B54VtKym.mjs +0 -19
- package/dist/package-D-aVYFKM.mjs +0 -80
- package/dist/ps-C5FOLwL2.mjs +0 -11
- package/dist/segment-C2ui5dSd.mjs +0 -19
- package/dist/snippet-BcgVYsoR.mjs +0 -19
- package/dist/status-BEONmJWv.mjs +0 -32
- package/dist/status-BWep0PFe.mjs +0 -56
- package/dist/table-lCNGbvej.mjs +0 -19
- package/dist/transform-BGAm1s4f.mjs +0 -24
- package/dist/transform-job-cNTJ30pm.mjs +0 -19
- package/dist/workspace-DtcBldk0.mjs +0 -24
- /package/dist/{body-flags-BK7J6Daz.mjs → body-flags-D7q87Btw.mjs} +0 -0
- /package/dist/{field-B3gvaqpK.mjs → field-yomXlkvl.mjs} +0 -0
- /package/dist/{paginate-CTSfuYiF.mjs → paginate-Dfm9eO9A.mjs} +0 -0
- /package/dist/{revision-message-flag-oyq2xrDU.mjs → revision-message-flag-WmsIzUOM.mjs} +0 -0
- /package/dist/{segment-BMrUBz94.mjs → segment-Be2v4ilr.mjs} +0 -0
- /package/dist/{setting-CTaAeMci.mjs → setting-oL97SNeO.mjs} +0 -0
- /package/dist/{snippet-Dw0Sjzkr.mjs → snippet-COggaWxx.mjs} +0 -0
- /package/dist/{transform-IEX4Mx3X.mjs → transform-GTW3G-01.mjs} +0 -0
- /package/dist/{workspace-C5q4nbpY.mjs → workspace-BBXJczJK.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, WorkspaceProvisionInput, workspaceView } from "./workspace-
|
|
13
|
-
import { waitForDatabaseProvisioned } from "./wait-
|
|
14
|
-
import { parseSchemasCsv } from "./parse-schemas-
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem } from "./render-CfznwleY.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
8
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
10
|
+
import "./poll-DHKDpCiq.mjs";
|
|
11
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-Dzq9BGQY.mjs";
|
|
12
|
+
import { Workspace, WorkspaceProvisionInput, workspaceView } from "./workspace-BBXJczJK.mjs";
|
|
13
|
+
import { waitForDatabaseProvisioned } from "./wait-8yV9_WIo.mjs";
|
|
14
|
+
import { parseSchemasCsv } from "./parse-schemas-BqUdWUwq.mjs";
|
|
15
15
|
|
|
16
16
|
//#region src/commands/workspace/database/provision.ts
|
|
17
17
|
var provision_default = defineMetabaseCommand({
|
|
@@ -19,16 +19,16 @@ var provision_default = defineMetabaseCommand({
|
|
|
19
19
|
name: "provision",
|
|
20
20
|
description: "Provision a database into a workspace"
|
|
21
21
|
},
|
|
22
|
+
capabilities: {
|
|
23
|
+
minVersion: 62,
|
|
24
|
+
tokenFeature: "workspaces"
|
|
25
|
+
},
|
|
22
26
|
args: {
|
|
23
27
|
...outputFlags,
|
|
24
28
|
...profileFlag,
|
|
25
29
|
...connectionFlags,
|
|
26
30
|
...bodyInputFlags,
|
|
27
31
|
...waitFlags,
|
|
28
|
-
"database-id": {
|
|
29
|
-
type: "string",
|
|
30
|
-
description: "Database id (alternative to --body / --file)"
|
|
31
|
-
},
|
|
32
32
|
schemas: {
|
|
33
33
|
type: "string",
|
|
34
34
|
description: "Comma-separated input schemas (alternative to --body / --file)"
|
|
@@ -37,23 +37,28 @@ var provision_default = defineMetabaseCommand({
|
|
|
37
37
|
type: "positional",
|
|
38
38
|
description: "Workspace id",
|
|
39
39
|
required: true
|
|
40
|
+
},
|
|
41
|
+
"db-id": {
|
|
42
|
+
type: "positional",
|
|
43
|
+
description: "Database id (alternative to --body / --file)",
|
|
44
|
+
required: false
|
|
40
45
|
}
|
|
41
46
|
},
|
|
42
47
|
outputSchema: Workspace,
|
|
43
48
|
examples: [
|
|
44
|
-
"mb workspace database provision 1
|
|
45
|
-
"mb workspace database provision 1
|
|
49
|
+
"mb workspace database provision 1 5 --schemas analytics,github",
|
|
50
|
+
"mb workspace database provision 1 5 --schemas analytics --wait",
|
|
46
51
|
"mb workspace database provision 1 --file provision.json"
|
|
47
52
|
],
|
|
48
53
|
async run({ args, ctx, getClient }) {
|
|
49
54
|
const workspaceId = parseId(args.id);
|
|
50
|
-
const
|
|
55
|
+
const databaseIdArg = args["db-id"];
|
|
51
56
|
const schemasFlag = args.schemas;
|
|
52
57
|
const wait = parseWaitFlags(args);
|
|
53
58
|
let body;
|
|
54
|
-
if (
|
|
55
|
-
const databaseId = parseId(
|
|
56
|
-
if (schemasFlag === void 0 || schemasFlag === "") throw new ConfigError("--schemas is required when
|
|
59
|
+
if (databaseIdArg !== void 0 && databaseIdArg !== "") {
|
|
60
|
+
const databaseId = parseId(databaseIdArg, "db-id");
|
|
61
|
+
if (schemasFlag === void 0 || schemasFlag === "") throw new ConfigError("--schemas is required when providing a db-id");
|
|
57
62
|
const input_schemas = parseSchemasCsv(schemasFlag);
|
|
58
63
|
body = WorkspaceProvisionInput.parse({
|
|
59
64
|
database_id: databaseId,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { defineMetabaseCommand,
|
|
3
|
-
import {
|
|
1
|
+
import { listEnvelopeSchema, outputFlags, wrapList } from "./error-C9S6PN3-.mjs";
|
|
2
|
+
import { defineMetabaseCommand, localUrl } from "./runtime-Dmv5VtUK.mjs";
|
|
3
|
+
import { renderList } from "./render-CfznwleY.mjs";
|
|
4
|
+
import { CONTAINER_STATES, checkDockerReady, listWorkspaceContainers } from "./docker-Oq80q3tu.mjs";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
|
|
6
7
|
//#region src/commands/workspace/ps.ts
|
|
@@ -51,6 +52,7 @@ var ps_default = defineMetabaseCommand({
|
|
|
51
52
|
name: "ps",
|
|
52
53
|
description: "List workspaces with a local container (running or stopped)"
|
|
53
54
|
},
|
|
55
|
+
capabilities: null,
|
|
54
56
|
args: { ...outputFlags },
|
|
55
57
|
outputSchema: LocalWorkspaceListEnvelope,
|
|
56
58
|
examples: ["mb workspace ps", "mb workspace ps --json"],
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import "./error-C9S6PN3-.mjs";
|
|
3
|
+
import "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import "./render-CfznwleY.mjs";
|
|
6
|
+
import "./poll-DHKDpCiq.mjs";
|
|
7
|
+
import "./process-C7V8LJ-j.mjs";
|
|
8
|
+
import "./docker-Oq80q3tu.mjs";
|
|
9
|
+
import { LocalWorkspace, LocalWorkspaceCompact, LocalWorkspaceListEnvelope, LocalWorkspaceState, localWorkspaceView, ps_default } from "./ps-CJU0EbrC.mjs";
|
|
10
|
+
|
|
11
|
+
export { ps_default as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseJson } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem } from "./render-CfznwleY.mjs";
|
|
6
|
+
import "./field-yomXlkvl.mjs";
|
|
7
|
+
import { CardQueryResult, cardQueryView } from "./card-DlCAaAPq.mjs";
|
|
8
|
+
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
9
9
|
import { z } from "zod";
|
|
10
10
|
import { Writable } from "node:stream";
|
|
11
11
|
|
|
@@ -27,6 +27,7 @@ var query_default = defineMetabaseCommand({
|
|
|
27
27
|
name: "query",
|
|
28
28
|
description: "Run a saved card and return results (json envelope, or stream CSV/JSON/XLSX via --export-format)"
|
|
29
29
|
},
|
|
30
|
+
capabilities: { minVersion: 58 },
|
|
30
31
|
args: {
|
|
31
32
|
...outputFlags,
|
|
32
33
|
...profileFlag,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
import "./
|
|
10
|
-
import {
|
|
11
|
-
import { assertNotLegacyEnvelopeWrappingMbql5, getQuerySchemaBundle, isMbql5Query, validateQuery } from "./validate-
|
|
12
|
-
import { skipValidateFlag } from "./validate-query-
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem, writeJson } from "./render-CfznwleY.mjs";
|
|
6
|
+
import "./input-cMSEqISy.mjs";
|
|
7
|
+
import "./field-yomXlkvl.mjs";
|
|
8
|
+
import { CardQueryResult, cardQueryView } from "./card-DlCAaAPq.mjs";
|
|
9
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
10
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
11
|
+
import { assertNotLegacyEnvelopeWrappingMbql5, getQuerySchemaBundle, isMbql5Query, validateQuery } from "./validate-dPEOnOf8.mjs";
|
|
12
|
+
import { skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
13
13
|
import { z } from "zod";
|
|
14
14
|
|
|
15
15
|
//#region src/commands/query.ts
|
|
@@ -18,8 +18,10 @@ const QUERY_ENDPOINT = "/api/dataset";
|
|
|
18
18
|
var query_default = defineMetabaseCommand({
|
|
19
19
|
meta: {
|
|
20
20
|
name: "query",
|
|
21
|
-
description: "Run an
|
|
21
|
+
description: "Run an ad-hoc MBQL or native query"
|
|
22
22
|
},
|
|
23
|
+
details: "Reads a JSON query body from --body, --file, or stdin and runs it. MBQL 5 is Metabase's structured query format, shaped {\"lib/type\":\"mbql/query\", \"database\": <id>, \"stages\": [...]}; it is checked against a bundled JSON Schema before sending — --print-schema prints that schema, and --dry-run reports any errors as {ok, errors:[{path, message}]} and exits 2 without sending. Legacy MBQL 4 and native-SQL bodies are not checked and run as-is. Run `mb skills get mbql` for the body shape, clause rules, and the iterate-with-dry-run loop.",
|
|
24
|
+
capabilities: { minVersion: 58 },
|
|
23
25
|
args: {
|
|
24
26
|
...outputFlags,
|
|
25
27
|
...profileFlag,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { promptConfirm } from "./prompt-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { outputFlags } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { clearLicense, defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem } from "./render-CfznwleY.mjs";
|
|
6
|
+
import { promptConfirm } from "./prompt-CFKoys7k.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
|
|
9
|
-
//#region src/commands/license/remove.ts
|
|
9
|
+
//#region src/commands/workspace/license/remove.ts
|
|
10
10
|
const LicenseRemoveResult = z.object({
|
|
11
11
|
removed: z.boolean(),
|
|
12
12
|
aborted: z.boolean()
|
|
@@ -26,6 +26,7 @@ var remove_default = defineMetabaseCommand({
|
|
|
26
26
|
name: "remove",
|
|
27
27
|
description: "Remove the stored license token"
|
|
28
28
|
},
|
|
29
|
+
capabilities: null,
|
|
29
30
|
args: {
|
|
30
31
|
...outputFlags,
|
|
31
32
|
yes: {
|
|
@@ -35,7 +36,7 @@ var remove_default = defineMetabaseCommand({
|
|
|
35
36
|
}
|
|
36
37
|
},
|
|
37
38
|
outputSchema: LicenseRemoveResult,
|
|
38
|
-
examples: ["mb license remove --yes"],
|
|
39
|
+
examples: ["mb workspace license remove --yes"],
|
|
39
40
|
async run({ args, ctx }) {
|
|
40
41
|
if (!args.yes && process.stdin.isTTY === true) {
|
|
41
42
|
const ok = await promptConfirm({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import "./poll-task-
|
|
8
|
-
import "./poll-
|
|
9
|
-
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem } from "./render-CfznwleY.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
7
|
+
import "./poll-task-Cooi0lQV.mjs";
|
|
8
|
+
import "./poll-DHKDpCiq.mjs";
|
|
9
|
+
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-BU8r3r2M.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/git-sync/remove-collection.ts
|
|
12
12
|
var remove_collection_default = defineMetabaseCommand({
|
|
@@ -14,6 +14,10 @@ var remove_collection_default = defineMetabaseCommand({
|
|
|
14
14
|
name: "remove-collection",
|
|
15
15
|
description: "Unmark a collection as git-synced; cascades to descendants by location prefix"
|
|
16
16
|
},
|
|
17
|
+
capabilities: {
|
|
18
|
+
minVersion: 60,
|
|
19
|
+
tokenFeature: "remote_sync"
|
|
20
|
+
},
|
|
17
21
|
args: {
|
|
18
22
|
...outputFlags,
|
|
19
23
|
...profileFlag,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ConfigError
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { isPlainObject, itemOversizeMessage, listTruncationNotice, warn } from "./capabilities-7e9MgquN.mjs";
|
|
2
3
|
import Table from "cli-table3";
|
|
3
4
|
|
|
4
5
|
//#region src/output/cap.ts
|
|
@@ -30,18 +31,6 @@ function jsonByteLength(value) {
|
|
|
30
31
|
return Buffer.byteLength(JSON.stringify(value), "utf8");
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
//#endregion
|
|
34
|
-
//#region src/output/notice.ts
|
|
35
|
-
function warn(message) {
|
|
36
|
-
process.stderr.write(message + "\n");
|
|
37
|
-
}
|
|
38
|
-
function listTruncationNotice(bytes) {
|
|
39
|
-
return `… cut at ${bytes} bytes; rerun with --max-bytes 0`;
|
|
40
|
-
}
|
|
41
|
-
function itemOversizeNotice(bytes) {
|
|
42
|
-
return `… item is ${bytes} bytes (exceeds --max-bytes); narrow with --fields, or pass --max-bytes 0`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
34
|
//#endregion
|
|
46
35
|
//#region src/output/projection.ts
|
|
47
36
|
function applyProjection(value, view, full, fields) {
|
|
@@ -125,8 +114,17 @@ function writeText(text) {
|
|
|
125
114
|
function renderItem(item, view, opts) {
|
|
126
115
|
const projected = applyProjection(item, view, opts.full, opts.fields);
|
|
127
116
|
const body = renderItemBody(item, view, projected, opts) + "\n";
|
|
117
|
+
assertItemWithinMaxBytes(body, opts.maxBytes);
|
|
118
|
+
process.stdout.write(body);
|
|
119
|
+
}
|
|
120
|
+
function renderScalar(item, view, scalarText, opts) {
|
|
121
|
+
if (opts.format === "json" || opts.fields !== void 0 || opts.full) {
|
|
122
|
+
renderItem(item, view, opts);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
const body = scalarText + "\n";
|
|
126
|
+
assertItemWithinMaxBytes(body, opts.maxBytes);
|
|
128
127
|
process.stdout.write(body);
|
|
129
|
-
emitItemOversizeNotice(body, opts.maxBytes);
|
|
130
128
|
}
|
|
131
129
|
function renderList(envelope, view, opts) {
|
|
132
130
|
if (opts.format === "json" || opts.fields !== void 0) {
|
|
@@ -171,12 +169,12 @@ function renderKeyValueLines(pairs) {
|
|
|
171
169
|
const padding = Math.max(...pairs.map(([label]) => label.length));
|
|
172
170
|
return pairs.map(([label, value]) => `${label.padEnd(padding)} ${value}`).join("\n");
|
|
173
171
|
}
|
|
174
|
-
function
|
|
172
|
+
function assertItemWithinMaxBytes(body, maxBytes) {
|
|
175
173
|
if (maxBytes <= 0) return;
|
|
176
174
|
const bytes = Buffer.byteLength(body, "utf8");
|
|
177
175
|
if (bytes <= maxBytes) return;
|
|
178
|
-
|
|
176
|
+
throw new ConfigError(itemOversizeMessage(bytes, maxBytes));
|
|
179
177
|
}
|
|
180
178
|
|
|
181
179
|
//#endregion
|
|
182
|
-
export { renderItem, renderList,
|
|
180
|
+
export { formatScalar, renderItem, renderList, renderScalar, writeJson, writeText };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
//#region src/commands/auth/render.ts
|
|
2
|
+
const EMPTY_CELL = "—";
|
|
3
|
+
function pickProperty(value, key) {
|
|
4
|
+
if (typeof value !== "object" || value === null || !(key in value)) return void 0;
|
|
5
|
+
const inner = Reflect.get(value, key);
|
|
6
|
+
return inner;
|
|
7
|
+
}
|
|
8
|
+
function pickString(value, key) {
|
|
9
|
+
const inner = pickProperty(value, key);
|
|
10
|
+
return typeof inner === "string" ? inner : null;
|
|
11
|
+
}
|
|
12
|
+
function pickBoolean(value, key) {
|
|
13
|
+
const inner = pickProperty(value, key);
|
|
14
|
+
return typeof inner === "boolean" ? inner : null;
|
|
15
|
+
}
|
|
16
|
+
function renderUserName(value) {
|
|
17
|
+
return pickString(value, "name") ?? EMPTY_CELL;
|
|
18
|
+
}
|
|
19
|
+
function renderUserRole(value) {
|
|
20
|
+
const isAdmin = pickBoolean(value, "isAdmin");
|
|
21
|
+
if (isAdmin === null) return EMPTY_CELL;
|
|
22
|
+
return isAdmin ? "Admin" : "User";
|
|
23
|
+
}
|
|
24
|
+
function renderVersionTag(value) {
|
|
25
|
+
return pickString(value, "tag") ?? EMPTY_CELL;
|
|
26
|
+
}
|
|
27
|
+
function renderTimestamp(value) {
|
|
28
|
+
return typeof value === "string" ? value : EMPTY_CELL;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { renderTimestamp, renderUserName, renderUserRole, renderVersionTag };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import "./table-
|
|
9
|
-
import { DatabaseSyncResult, databaseSyncResultView } from "./database-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem } from "./render-CfznwleY.mjs";
|
|
6
|
+
import "./field-yomXlkvl.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
8
|
+
import "./table-C7a5V6Zn.mjs";
|
|
9
|
+
import { DatabaseSyncResult, databaseSyncResultView } from "./database-lH-B3G1I.mjs";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/db/rescan-values.ts
|
|
@@ -16,6 +16,7 @@ var rescan_values_default = defineMetabaseCommand({
|
|
|
16
16
|
name: "rescan-values",
|
|
17
17
|
description: "Trigger a rescan of cached field values for a database"
|
|
18
18
|
},
|
|
19
|
+
capabilities: { minVersion: 58 },
|
|
19
20
|
args: {
|
|
20
21
|
...outputFlags,
|
|
21
22
|
...profileFlag,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import { pollUntil } from "./poll-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderItem } from "./render-CfznwleY.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
7
|
+
import { pollUntil } from "./poll-DHKDpCiq.mjs";
|
|
8
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-Dzq9BGQY.mjs";
|
|
9
|
+
import { TransformRun } from "./transform-GTW3G-01.mjs";
|
|
10
10
|
import { z } from "zod";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/transform/run.ts
|
|
@@ -45,6 +45,7 @@ var run_default = defineMetabaseCommand({
|
|
|
45
45
|
name: "run",
|
|
46
46
|
description: "Trigger a transform run by id"
|
|
47
47
|
},
|
|
48
|
+
capabilities: { minVersion: 59 },
|
|
48
49
|
args: {
|
|
49
50
|
...outputFlags,
|
|
50
51
|
...profileFlag,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import { collectPaginated } from "./paginate-
|
|
8
|
-
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-Dmv5VtUK.mjs";
|
|
4
|
+
import "./capabilities-7e9MgquN.mjs";
|
|
5
|
+
import { renderList } from "./render-CfznwleY.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
7
|
+
import { collectPaginated } from "./paginate-Dfm9eO9A.mjs";
|
|
8
|
+
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-GTW3G-01.mjs";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/transform/runs.ts
|
|
11
11
|
const TransformRunListEnvelope = listEnvelopeSchema(TransformRunCompact);
|
|
@@ -14,6 +14,7 @@ var runs_default = defineMetabaseCommand({
|
|
|
14
14
|
name: "runs",
|
|
15
15
|
description: "List recent transform runs"
|
|
16
16
|
},
|
|
17
|
+
capabilities: { minVersion: 59 },
|
|
17
18
|
args: {
|
|
18
19
|
...outputFlags,
|
|
19
20
|
...profileFlag,
|