@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,6 +1,31 @@
|
|
|
1
1
|
import { ZodError, core } from "zod";
|
|
2
2
|
import { isCancel } from "@clack/prompts";
|
|
3
3
|
|
|
4
|
+
//#region src/runtime/citty.ts
|
|
5
|
+
async function resolveCitty(value) {
|
|
6
|
+
if (value === void 0) return void 0;
|
|
7
|
+
if (typeof value === "function") return value();
|
|
8
|
+
return value;
|
|
9
|
+
}
|
|
10
|
+
function toAliasArray(alias) {
|
|
11
|
+
if (alias === void 0) return [];
|
|
12
|
+
return Array.isArray(alias) ? alias : [alias];
|
|
13
|
+
}
|
|
14
|
+
function normalizeFlag(value) {
|
|
15
|
+
return value.replace(/^-+/, "").replace(/-/g, "").toLowerCase();
|
|
16
|
+
}
|
|
17
|
+
function flagConsumesValue(token, argsDef) {
|
|
18
|
+
if (token.includes("=")) return false;
|
|
19
|
+
const name = normalizeFlag(token);
|
|
20
|
+
for (const [key, def] of Object.entries(argsDef)) {
|
|
21
|
+
if (def.type !== "string" && def.type !== "enum") continue;
|
|
22
|
+
if (normalizeFlag(key) === name) return true;
|
|
23
|
+
if (toAliasArray(def.alias).some((alias) => normalizeFlag(alias) === name)) return true;
|
|
24
|
+
}
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
4
29
|
//#region src/core/json-pointer.ts
|
|
5
30
|
function escapeJsonPointerSegment(key) {
|
|
6
31
|
if (typeof key === "number") return String(key);
|
|
@@ -51,23 +76,46 @@ var ValidationError = class extends MetabaseError {
|
|
|
51
76
|
get userMessage() {
|
|
52
77
|
const issues = this.developerDetail.zodIssues;
|
|
53
78
|
if (issues.length === 0) return this.message;
|
|
54
|
-
return `${this.message}\n${
|
|
79
|
+
return `${this.message}\n${formatIssueLines(issues, VALIDATION_ISSUE_FORMAT)}`;
|
|
55
80
|
}
|
|
56
81
|
};
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
82
|
+
const VALIDATION_MAX_ISSUES = 10;
|
|
83
|
+
const RESPONSE_SHAPE_MAX_ISSUES = 5;
|
|
84
|
+
const VALIDATION_ISSUE_FORMAT = {
|
|
85
|
+
max: VALIDATION_MAX_ISSUES,
|
|
86
|
+
formatIssue: (issue) => `${formatZodIssuePointer(issue.path)}: ${issue.message}`
|
|
87
|
+
};
|
|
88
|
+
const RESPONSE_SHAPE_ISSUE_FORMAT = {
|
|
89
|
+
max: RESPONSE_SHAPE_MAX_ISSUES,
|
|
90
|
+
formatIssue: formatZodIssue
|
|
91
|
+
};
|
|
92
|
+
function formatIssueLines(issues, format) {
|
|
93
|
+
const head = issues.slice(0, format.max).map(format.formatIssue);
|
|
94
|
+
const overflow = issues.length - format.max;
|
|
95
|
+
if (overflow > 0) head.push(`... and ${overflow} more`);
|
|
96
|
+
return head.map((line) => ` ${line}`).join("\n");
|
|
66
97
|
}
|
|
67
98
|
function formatZodIssuePointer(path) {
|
|
68
99
|
if (path.length === 0) return "/";
|
|
69
100
|
return path.map((key) => `/${escapeJsonPointerSegment(key)}`).join("");
|
|
70
101
|
}
|
|
102
|
+
const RESPONSE_SHAPE_LEAD_UNKNOWN_VERSION = "Metabase returned unexpected response shape";
|
|
103
|
+
var ResponseShapeError = class extends MetabaseError {
|
|
104
|
+
category = "response-shape";
|
|
105
|
+
isRetryable = false;
|
|
106
|
+
exitCode = 1;
|
|
107
|
+
developerDetail;
|
|
108
|
+
constructor(developerDetail) {
|
|
109
|
+
super(formatResponseShapeMessage(developerDetail.zodIssues, developerDetail.serverTag));
|
|
110
|
+
this.name = "ResponseShapeError";
|
|
111
|
+
this.developerDetail = developerDetail;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
function formatResponseShapeMessage(issues, serverTag) {
|
|
115
|
+
const lead = serverTag === null ? RESPONSE_SHAPE_LEAD_UNKNOWN_VERSION : `On Metabase ${serverTag} the response shape was unexpected`;
|
|
116
|
+
if (issues.length === 0) return lead;
|
|
117
|
+
return `${lead}:\n${formatIssueLines(issues, RESPONSE_SHAPE_ISSUE_FORMAT)}`;
|
|
118
|
+
}
|
|
71
119
|
var ConfigError = class extends MetabaseError {
|
|
72
120
|
category = "config";
|
|
73
121
|
isRetryable = false;
|
|
@@ -144,10 +192,14 @@ function errorMessage(value) {
|
|
|
144
192
|
}
|
|
145
193
|
|
|
146
194
|
//#endregion
|
|
147
|
-
//#region src/runtime/
|
|
148
|
-
|
|
149
|
-
|
|
195
|
+
//#region src/runtime/command-augment.ts
|
|
196
|
+
const augments = new WeakMap();
|
|
197
|
+
function setMetabaseAugment(cmd, augment) {
|
|
198
|
+
augments.set(cmd, augment);
|
|
199
|
+
}
|
|
200
|
+
function getMetabaseAugment(cmd) {
|
|
201
|
+
return augments.get(cmd) ?? null;
|
|
150
202
|
}
|
|
151
203
|
|
|
152
204
|
//#endregion
|
|
153
|
-
export { AbortError, ChainedRequestError, ConfigError, MetabaseError, NetworkError, TimeoutError, UnknownError, VERBOSE_ENV, ValidationError, errorMessage, escapeJsonPointerSegment, isNotFoundError,
|
|
205
|
+
export { AbortError, ChainedRequestError, ConfigError, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, UnknownError, VERBOSE_ENV, ValidationError, errorMessage, escapeJsonPointerSegment, flagConsumesValue, getMetabaseAugment, isNotFoundError, normalizeFlag, resolveCitty, setMetabaseAugment, toAliasArray, toMetabaseError };
|
|
@@ -0,0 +1,52 @@
|
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import "./field-yomXlkvl.mjs";
|
|
8
|
+
import { Card, CardCreateInput, cardView } from "./card-DlCAaAPq.mjs";
|
|
9
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
10
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
11
|
+
import "./validate-dPEOnOf8.mjs";
|
|
12
|
+
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
13
|
+
|
|
14
|
+
//#region src/commands/card/create.ts
|
|
15
|
+
var create_default = defineMetabaseCommand({
|
|
16
|
+
meta: {
|
|
17
|
+
name: "create",
|
|
18
|
+
description: "Create a card (question, model, or metric) from JSON"
|
|
19
|
+
},
|
|
20
|
+
details: "The JSON body needs `name`, `display` (the visualization — e.g. table, bar, scalar), `dataset_query` (the query powering the card), and `visualization_settings` (`{}` is fine). When `dataset_query` is an MBQL 5 query it is checked against a bundled JSON Schema before sending — fix the reported errors, or pass --skip-validate to send anyway. Native-SQL and legacy queries are sent unchecked. See `mb skills get mbql`.",
|
|
21
|
+
capabilities: { minVersion: 58 },
|
|
22
|
+
args: {
|
|
23
|
+
...outputFlags,
|
|
24
|
+
...profileFlag,
|
|
25
|
+
...connectionFlags,
|
|
26
|
+
...bodyInputFlags,
|
|
27
|
+
...skipValidateFlag
|
|
28
|
+
},
|
|
29
|
+
outputSchema: Card,
|
|
30
|
+
examples: [
|
|
31
|
+
"cat card.json | mb card create",
|
|
32
|
+
"mb card create --file card.json",
|
|
33
|
+
"mb card create --body '{\"name\":\"x\",\"display\":\"table\",\"dataset_query\":{...},\"visualization_settings\":{}}'",
|
|
34
|
+
"mb card create --file card.json --skip-validate"
|
|
35
|
+
],
|
|
36
|
+
async run({ args, ctx, getClient }) {
|
|
37
|
+
const body = await readBody({
|
|
38
|
+
flag: args.body,
|
|
39
|
+
file: args.file
|
|
40
|
+
}, CardCreateInput);
|
|
41
|
+
preflightMbql5Query(body.dataset_query, CARD_DATASET_QUERY_LABELS, { skip: args["skip-validate"] === true });
|
|
42
|
+
const client = await getClient();
|
|
43
|
+
const created = await client.requestParsed(Card, "/api/card", {
|
|
44
|
+
method: "POST",
|
|
45
|
+
body
|
|
46
|
+
});
|
|
47
|
+
renderItem(created, cardView, ctx);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { create_default as default };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
9
|
import { Collection, CollectionCreateInput, collectionView } from "./collection-B3sPXRLs.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/collection/create.ts
|
|
@@ -14,6 +14,7 @@ var create_default = defineMetabaseCommand({
|
|
|
14
14
|
name: "create",
|
|
15
15
|
description: "Create a collection from a JSON spec"
|
|
16
16
|
},
|
|
17
|
+
capabilities: { minVersion: 58 },
|
|
17
18
|
args: {
|
|
18
19
|
...outputFlags,
|
|
19
20
|
...profileFlag,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import "./validate-
|
|
10
|
-
import { TRANSFORM_SOURCE_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-
|
|
11
|
-
import { Transform, TransformCreateInput, transformView } from "./transform-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import "./validate-dPEOnOf8.mjs";
|
|
10
|
+
import { TRANSFORM_SOURCE_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
11
|
+
import { Transform, TransformCreateInput, transformView } from "./transform-GTW3G-01.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/transform/create.ts
|
|
14
14
|
var create_default = defineMetabaseCommand({
|
|
15
15
|
meta: {
|
|
16
16
|
name: "create",
|
|
17
|
-
description: "Create a transform
|
|
17
|
+
description: "Create a transform from JSON"
|
|
18
18
|
},
|
|
19
|
+
details: "The JSON body needs a `name`, a `source` (the query to run — native SQL or MBQL — under `source.query`), and a `target` (the warehouse table to write, with `database`/`schema`/`name`). When `source.query` 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`.",
|
|
20
|
+
capabilities: { minVersion: 59 },
|
|
19
21
|
args: {
|
|
20
22
|
...outputFlags,
|
|
21
23
|
...profileFlag,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import { Snippet, SnippetCreateInput, snippetView } from "./snippet-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import { Snippet, SnippetCreateInput, snippetView } from "./snippet-COggaWxx.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/snippet/create.ts
|
|
12
12
|
var create_default = defineMetabaseCommand({
|
|
@@ -14,6 +14,7 @@ var create_default = defineMetabaseCommand({
|
|
|
14
14
|
name: "create",
|
|
15
15
|
description: "Create a native query snippet from a JSON spec"
|
|
16
16
|
},
|
|
17
|
+
capabilities: { minVersion: 58 },
|
|
17
18
|
args: {
|
|
18
19
|
...outputFlags,
|
|
19
20
|
...profileFlag,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import { Workspace, WorkspaceCreateInput, workspaceView } from "./workspace-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import { Workspace, WorkspaceCreateInput, workspaceView } from "./workspace-BBXJczJK.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/workspace/create.ts
|
|
12
12
|
var create_default = defineMetabaseCommand({
|
|
@@ -14,6 +14,10 @@ var create_default = defineMetabaseCommand({
|
|
|
14
14
|
name: "create",
|
|
15
15
|
description: "Create a workspace"
|
|
16
16
|
},
|
|
17
|
+
capabilities: {
|
|
18
|
+
minVersion: 62,
|
|
19
|
+
tokenFeature: "workspaces"
|
|
20
|
+
},
|
|
17
21
|
args: {
|
|
18
22
|
...outputFlags,
|
|
19
23
|
...profileFlag,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import "./validate-
|
|
10
|
-
import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-
|
|
11
|
-
import { Measure, MeasureCreateInput, measureView } from "./measure-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import "./validate-dPEOnOf8.mjs";
|
|
10
|
+
import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
11
|
+
import { Measure, MeasureCreateInput, measureView } from "./measure-ClESGxIb.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/measure/create.ts
|
|
14
14
|
var create_default = defineMetabaseCommand({
|
|
15
15
|
meta: {
|
|
16
16
|
name: "create",
|
|
17
|
-
description: "Create a measure
|
|
17
|
+
description: "Create a measure (saved aggregation) from JSON"
|
|
18
18
|
},
|
|
19
|
+
details: "A measure is a reusable, saved aggregation tied to a table. The JSON body needs `name`, `table_id`, and a `definition` (an MBQL query holding exactly one aggregation). An MBQL 5 `definition` is checked against a bundled JSON Schema before sending; pass --skip-validate to bypass. See `mb skills get mbql`.",
|
|
20
|
+
capabilities: { minVersion: 59 },
|
|
19
21
|
args: {
|
|
20
22
|
...outputFlags,
|
|
21
23
|
...profileFlag,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-DeTDPMxt.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/transform-job/create.ts
|
|
12
12
|
var create_default = defineMetabaseCommand({
|
|
@@ -14,6 +14,7 @@ var create_default = defineMetabaseCommand({
|
|
|
14
14
|
name: "create",
|
|
15
15
|
description: "Create a transform job"
|
|
16
16
|
},
|
|
17
|
+
capabilities: { minVersion: 59 },
|
|
17
18
|
args: {
|
|
18
19
|
...outputFlags,
|
|
19
20
|
...profileFlag,
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import "./validate-
|
|
10
|
-
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-
|
|
11
|
-
import { Segment, SegmentCreateInput, segmentView } from "./segment-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import "./validate-dPEOnOf8.mjs";
|
|
10
|
+
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
11
|
+
import { Segment, SegmentCreateInput, segmentView } from "./segment-Be2v4ilr.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/segment/create.ts
|
|
14
14
|
var create_default = defineMetabaseCommand({
|
|
15
15
|
meta: {
|
|
16
16
|
name: "create",
|
|
17
|
-
description: "Create a segment
|
|
17
|
+
description: "Create a segment (saved filter) from JSON"
|
|
18
18
|
},
|
|
19
|
+
details: "A segment is a reusable, saved row filter tied to a table. The JSON body needs `name`, `table_id`, and a `definition` (an MBQL query holding the filter). An MBQL 5 `definition` is checked against a bundled JSON Schema before sending; pass --skip-validate to bypass. See `mb skills get mbql`.",
|
|
20
|
+
capabilities: { minVersion: 58 },
|
|
19
21
|
args: {
|
|
20
22
|
...outputFlags,
|
|
21
23
|
...profileFlag,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import { REMOTE_SYNC_PATHS } from "./poll-task-
|
|
7
|
-
import "./poll-
|
|
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 { REMOTE_SYNC_PATHS } from "./poll-task-Cooi0lQV.mjs";
|
|
7
|
+
import "./poll-DHKDpCiq.mjs";
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
10
|
//#region src/commands/git-sync/create-branch.ts
|
|
@@ -27,6 +27,10 @@ var create_branch_default = defineMetabaseCommand({
|
|
|
27
27
|
name: "create-branch",
|
|
28
28
|
description: "Create a new branch on the git remote and switch git-sync to it"
|
|
29
29
|
},
|
|
30
|
+
capabilities: {
|
|
31
|
+
minVersion: 60,
|
|
32
|
+
tokenFeature: "remote_sync"
|
|
33
|
+
},
|
|
30
34
|
args: {
|
|
31
35
|
...outputFlags,
|
|
32
36
|
...profileFlag,
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
11
|
-
import "./validate-
|
|
12
|
-
import { Dashboard, DashboardCreateInput, DashboardDetail, dashboardView } from "./dashboard-
|
|
13
|
-
import { preflightDashcardCardReferences, wrapChainedDashboardWriteError } from "./preflight-
|
|
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 "./input-cMSEqISy.mjs";
|
|
7
|
+
import "./field-yomXlkvl.mjs";
|
|
8
|
+
import "./card-DlCAaAPq.mjs";
|
|
9
|
+
import { readBody } from "./body-DjdFxjpg.mjs";
|
|
10
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
11
|
+
import "./validate-dPEOnOf8.mjs";
|
|
12
|
+
import { Dashboard, DashboardCreateInput, DashboardDetail, dashboardView } from "./dashboard-FY5UzJ_Z.mjs";
|
|
13
|
+
import { preflightDashcardCardReferences, wrapChainedDashboardWriteError } from "./preflight-aXV5LyDs.mjs";
|
|
14
14
|
|
|
15
15
|
//#region src/commands/dashboard/create.ts
|
|
16
16
|
var create_default = defineMetabaseCommand({
|
|
17
17
|
meta: {
|
|
18
18
|
name: "create",
|
|
19
|
-
description: "Create a dashboard from
|
|
19
|
+
description: "Create a dashboard from JSON"
|
|
20
20
|
},
|
|
21
|
+
details: "Any positive card_id referenced from dashcards is pre-flight-validated (exists and readable, not archived) before the dashboard is created.",
|
|
22
|
+
capabilities: { minVersion: 58 },
|
|
21
23
|
args: {
|
|
22
24
|
...outputFlags,
|
|
23
25
|
...profileFlag,
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import "./poll-
|
|
8
|
-
import "./
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { outputFlags } from "./error-C9S6PN3-.mjs";
|
|
3
|
+
import { defineMetabaseCommand, localUrl, parseJson } 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-DHKDpCiq.mjs";
|
|
8
|
+
import "./yaml-YTQiYJ9s.mjs";
|
|
9
|
+
import "./process-C7V8LJ-j.mjs";
|
|
10
|
+
import { checkDockerReady, readContainerCredentialsFile, requireWorkspaceContainerLocation } from "./docker-Oq80q3tu.mjs";
|
|
11
|
+
import { WorkspaceCredentials } from "./workspace-credentials-BXpABsNZ.mjs";
|
|
11
12
|
import { z } from "zod";
|
|
12
13
|
|
|
13
14
|
//#region src/commands/workspace/credentials.ts
|
|
@@ -54,6 +55,7 @@ var credentials_default = defineMetabaseCommand({
|
|
|
54
55
|
name: "credentials",
|
|
55
56
|
description: "Read the workspace child instance's admin credentials (email + password + API key) from the running container"
|
|
56
57
|
},
|
|
58
|
+
capabilities: null,
|
|
57
59
|
args: {
|
|
58
60
|
...outputFlags,
|
|
59
61
|
id: {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import "./
|
|
3
|
-
import {
|
|
4
|
-
import "./
|
|
5
|
-
import {
|
|
6
|
-
import { SyncTaskOrIdle, fetchCurrentTask, syncTaskIdleView, syncTaskView } from "./poll-task-
|
|
7
|
-
import "./poll-
|
|
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 { SyncTaskOrIdle, fetchCurrentTask, syncTaskIdleView, syncTaskView } from "./poll-task-Cooi0lQV.mjs";
|
|
7
|
+
import "./poll-DHKDpCiq.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/commands/git-sync/current-task.ts
|
|
10
10
|
const CurrentTaskResult = SyncTaskOrIdle;
|
|
@@ -13,6 +13,10 @@ var current_task_default = defineMetabaseCommand({
|
|
|
13
13
|
name: "current-task",
|
|
14
14
|
description: "Get the most recent git-sync task (or idle if none)"
|
|
15
15
|
},
|
|
16
|
+
capabilities: {
|
|
17
|
+
minVersion: 60,
|
|
18
|
+
tokenFeature: "remote_sync"
|
|
19
|
+
},
|
|
16
20
|
args: {
|
|
17
21
|
...outputFlags,
|
|
18
22
|
...profileFlag,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/dashboard/index.ts
|
|
4
|
+
var dashboard_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "dashboard",
|
|
7
|
+
alias: "dashboards",
|
|
8
|
+
description: "Manage Metabase dashboards"
|
|
9
|
+
},
|
|
10
|
+
subCommands: {
|
|
11
|
+
list: () => import("./list-DXH7TlkU.mjs").then((mod) => mod.default),
|
|
12
|
+
get: () => import("./get-DSWFjy7O.mjs").then((mod) => mod.default),
|
|
13
|
+
cards: () => import("./cards-BGiJS675.mjs").then((mod) => mod.default),
|
|
14
|
+
create: () => import("./create-dhxPxfF3.mjs").then((mod) => mod.default),
|
|
15
|
+
update: () => import("./update-Bx54nWEI.mjs").then((mod) => mod.default),
|
|
16
|
+
"update-dashcard": () => import("./update-dashcard-wpSjv4M7.mjs").then((mod) => mod.default),
|
|
17
|
+
archive: () => import("./archive-CDA0KxL8.mjs").then((mod) => mod.default)
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { dashboard_default as default };
|
|
@@ -156,7 +156,8 @@ const DashcardPatchInput = z.object({
|
|
|
156
156
|
dashboard_tab_id: z.number().int().nullable().optional(),
|
|
157
157
|
parameter_mappings: z.array(z.unknown()).optional(),
|
|
158
158
|
inline_parameters: z.array(z.string()).optional(),
|
|
159
|
-
visualization_settings: z.unknown().optional()
|
|
159
|
+
visualization_settings: z.unknown().optional(),
|
|
160
|
+
series: z.array(z.unknown()).optional()
|
|
160
161
|
}).strict().refine((value) => Object.keys(value).length > 0, { message: "patch must contain at least one field" });
|
|
161
162
|
|
|
162
163
|
//#endregion
|
|
@@ -7,9 +7,9 @@ var database_default = defineCommand({
|
|
|
7
7
|
description: "Manage databases provisioned to a workspace"
|
|
8
8
|
},
|
|
9
9
|
subCommands: {
|
|
10
|
-
provision: () => import("./provision-
|
|
11
|
-
update: () => import("./update-
|
|
12
|
-
deprovision: () => import("./deprovision-
|
|
10
|
+
provision: () => import("./provision-UWcNDoDe.mjs").then((mod) => mod.default),
|
|
11
|
+
update: () => import("./update-DHZubok3.mjs").then((mod) => mod.default),
|
|
12
|
+
deprovision: () => import("./deprovision-CwxcIT3k.mjs").then((mod) => mod.default)
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/db/index.ts
|
|
4
|
+
var db_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "db",
|
|
7
|
+
description: "Inspect and sync Metabase databases",
|
|
8
|
+
alias: "database"
|
|
9
|
+
},
|
|
10
|
+
subCommands: {
|
|
11
|
+
list: () => import("./list-DZ8fNUoQ.mjs").then((m) => m.default),
|
|
12
|
+
get: () => import("./get-CzuzeKSe.mjs").then((m) => m.default),
|
|
13
|
+
metadata: () => import("./metadata-B8ZSF9LA.mjs").then((m) => m.default),
|
|
14
|
+
schemas: () => import("./schemas-DUgGpAyB.mjs").then((m) => m.default),
|
|
15
|
+
"schema-tables": () => import("./schema-tables-CaWinbuK.mjs").then((m) => m.default),
|
|
16
|
+
"sync-schema": () => import("./sync-schema-Ba8M3DiX.mjs").then((m) => m.default),
|
|
17
|
+
"rescan-values": () => import("./rescan-values-C0FDsjT7.mjs").then((m) => m.default)
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { db_default as default };
|