@metabase/cli 0.1.6 → 0.1.8-alpha.cleanup-workspaces.75fe1d5
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 +1 -1
- package/README.md +16 -238
- package/dist/add-collection-BGifL-7Y.mjs +10 -0
- package/dist/{add-collection-BU8r3r2M.mjs → add-collection-C5ijC4e-.mjs} +8 -6
- package/dist/{archive-BNinrUak.mjs → archive-2GZVq0n2.mjs} +7 -8
- package/dist/{archive-lWgqiFAt.mjs → archive-C5pXDf6a.mjs} +5 -6
- package/dist/{archive-C1enZgKV.mjs → archive-CTEybKPq.mjs} +6 -7
- package/dist/{archive-DMPS8Kih.mjs → archive-DEtOH_jf.mjs} +5 -6
- package/dist/{archive-CDA0KxL8.mjs → archive-DTrn90If.mjs} +5 -6
- package/dist/{archive-CRhiBpPJ.mjs → archive-nqKJOyOt.mjs} +5 -6
- package/dist/auth-Divr9vkY.mjs +19 -0
- package/dist/{body-DjdFxjpg.mjs → body-BMyDvOjf.mjs} +2 -2
- package/dist/{branches-B1WRfG7-.mjs → branches-B7Zf-nxr.mjs} +5 -6
- package/dist/{cancel-Dl_Ho056.mjs → cancel-WwjcCE2R.mjs} +6 -7
- package/dist/{cancel-task-CdigdCaO.mjs → cancel-task-E4cCeJTc.mjs} +6 -7
- package/dist/{render-CfznwleY.mjs → capabilities-Dj3NgPHg.mjs} +66 -10
- package/dist/card-BHAcovSB.mjs +20 -0
- package/dist/{card-DlCAaAPq.mjs → card-BtPiKjbB.mjs} +1 -1
- package/dist/{cards-BGiJS675.mjs → cards-BW0Spirk.mjs} +4 -5
- package/dist/cli.mjs +23 -24
- package/dist/collection-DZx-vWb2.mjs +20 -0
- package/dist/{create-BNiva__H.mjs → create-BV_VpyyI.mjs} +11 -12
- package/dist/{create-BTcpaop_.mjs → create-B_Ysb6Ex.mjs} +7 -8
- package/dist/{create-BYlIju0b.mjs → create-BgeD2GMZ.mjs} +10 -11
- package/dist/{create-DGth_uOp.mjs → create-Bxkik5Fs.mjs} +9 -10
- package/dist/{create-CzzrbL0u.mjs → create-CZfHpi_I.mjs} +8 -9
- package/dist/{create-Be_0Vier.mjs → create-CbwFOL9h.mjs} +8 -9
- package/dist/{create-dhxPxfF3.mjs → create-CbyY4xTG.mjs} +12 -13
- package/dist/{create-CwGtmwqm.mjs → create-HCCdsuZR.mjs} +9 -10
- package/dist/{create-branch-DKZkoQ64.mjs → create-branch-BNRq3tO2.mjs} +6 -7
- package/dist/{current-task-CCRzm0_7.mjs → current-task-ZvTjL4hP.mjs} +7 -8
- package/dist/dashboard-DCWGcx3e.mjs +21 -0
- package/dist/{database-lH-B3G1I.mjs → database-_Td7rG4o.mjs} +1 -1
- package/dist/db-bD6fwLwc.mjs +22 -0
- package/dist/{delete-ZjnV35OJ.mjs → delete-D5-ITH10.mjs} +8 -7
- package/dist/{delete-Dimc-2y8.mjs → delete-DvmHTMwf.mjs} +8 -7
- package/dist/{delete-runtime-B6RQo_pw.mjs → delete-runtime-Bo7v-0au.mjs} +6 -6
- package/dist/{delete-table-agZJpivt.mjs → delete-table-DjmO5Qe4.mjs} +8 -7
- package/dist/{dirty-D4d0yHqj.mjs → dirty-BJgU1SGQ.mjs} +5 -6
- package/dist/{eid-BXzaQh0o.mjs → eid-pqSVgO2g.mjs} +12 -8
- package/dist/{error-C9S6PN3-.mjs → error-Br6irjpM.mjs} +3 -2
- package/dist/{export-DTygoXBP.mjs → export-gVXTOxC2.mjs} +10 -10
- package/dist/field-BFWc8q2W.mjs +18 -0
- package/dist/{field-yomXlkvl.mjs → field-MGxpNQUH.mjs} +12 -3
- package/dist/{fields-CoQi99gv.mjs → fields-DK2TYRK2.mjs} +6 -7
- package/dist/{get-DQTZG_NP.mjs → get-BjArD6Er.mjs} +4 -5
- package/dist/{get-C3HdQ91a.mjs → get-C1RSXOhf.mjs} +5 -6
- package/dist/{get-DSWFjy7O.mjs → get-C3RI_hKG.mjs} +4 -5
- package/dist/{get-C_w1kvN3.mjs → get-C7UEEICF.mjs} +6 -7
- package/dist/{get-Bzys7vgp.mjs → get-D-3tOuWQ.mjs} +4 -5
- package/dist/{get-Hc93A0Yz.mjs → get-DDF7_apz.mjs} +5 -6
- package/dist/{get-D3SbEQSE.mjs → get-DYgLtHb8.mjs} +4 -5
- package/dist/{get-CP3Z3NiH.mjs → get-DnK3WGDH.mjs} +6 -7
- package/dist/{get-C2p383Qc.mjs → get-DnyZMx-0.mjs} +5 -6
- package/dist/{get-DFxZXaKz.mjs → get-DtG5ytvs.mjs} +5 -7
- package/dist/{get-CzuzeKSe.mjs → get-Dy4NedW5.mjs} +7 -8
- package/dist/{get-Ddr0XLh7.mjs → get-_JI4GiPa.mjs} +5 -6
- package/dist/{get-run-B7sKdaDU.mjs → get-run-CZwIo5QR.mjs} +5 -6
- package/dist/{get-lb7q3JYs.mjs → get-xo5_PD1n.mjs} +3 -4
- package/dist/git-sync-Ch00miSa.mjs +28 -0
- package/dist/{has-remote-changes-BY10-nnE.mjs → has-remote-changes-tuuoPdHV.mjs} +7 -7
- package/dist/{import-CiMz4Wz-.mjs → import-BOzyRPTk.mjs} +11 -10
- package/dist/{is-dirty-BZOaryxT.mjs → is-dirty-BXN1F9yR.mjs} +5 -5
- package/dist/is-dirty-Bc1UHnBU.mjs +9 -0
- package/dist/{items-BWfvkY-J.mjs → items-CC4sSWv7.mjs} +4 -5
- package/dist/{list-SOG0whQ-.mjs → list-BUpOvQsd.mjs} +3 -4
- package/dist/{list-Clz5igWg.mjs → list-BlMpI88r.mjs} +4 -6
- package/dist/{list-2j7GsXsl.mjs → list-BqTdYtOW.mjs} +3 -4
- package/dist/{list-C3hfovHv.mjs → list-BvTuDJZp.mjs} +4 -5
- package/dist/{list-DZ8fNUoQ.mjs → list-C48ZZLM5.mjs} +6 -7
- package/dist/{list-BI4zr8LW.mjs → list-CJe45jFT.mjs} +6 -7
- package/dist/{list-D4sFiqX8.mjs → list-CMoG5_mh.mjs} +5 -6
- package/dist/{list-d58BprgJ.mjs → list-CkI3hESA.mjs} +4 -5
- package/dist/{list-sD5N3fGk.mjs → list-CybLzPZw.mjs} +6 -7
- package/dist/{list-CL7eCOQE.mjs → list-DLhU81LP.mjs} +3 -4
- package/dist/{list-Brgh-Z2v.mjs → list-Ddyb5T-7.mjs} +4 -5
- package/dist/{list-DXH7TlkU.mjs → list-tveV3LKh.mjs} +4 -5
- package/dist/{list--OYdUTtu.mjs → list-u7cmunGG.mjs} +4 -5
- package/dist/{login-Bm2AnCez.mjs → login-Bfsf6jLq.mjs} +17 -14
- package/dist/{logout-BlyRJODO.mjs → logout-BCsE_1Yg.mjs} +9 -9
- package/dist/{manifest-BBR46KFM.mjs → manifest-B_OfG-Ss.mjs} +1 -2
- package/dist/measure-D_eiCKq9.mjs +19 -0
- package/dist/{metadata-B8ZSF9LA.mjs → metadata-Cbqx1-yW.mjs} +7 -8
- package/dist/{metadata-DqiI2q9q.mjs → metadata-CzbGy4b-.mjs} +6 -7
- package/dist/{parse-id-lk_K-CEF.mjs → parse-id-DBwNYb4Y.mjs} +1 -1
- package/dist/{path-AEtZ3mBq.mjs → path-DJ-DfUGC.mjs} +4 -6
- package/dist/{poll-DHKDpCiq.mjs → poll-DWkVceIk.mjs} +1 -1
- package/dist/{poll-task-Cooi0lQV.mjs → poll-task-DOvUDrgL.mjs} +19 -3
- package/dist/{preflight-aXV5LyDs.mjs → preflight-D-l6sLCX.mjs} +3 -3
- package/dist/{query-AaKzYnTY.mjs → query--05TZxmk.mjs} +9 -8
- package/dist/{query-BlsVNZpD.mjs → query-BbbDpt3u.mjs} +12 -12
- package/dist/query-result-PoQE05Pe.mjs +19 -0
- package/dist/{remove-collection-CoCmrrQs.mjs → remove-collection-Dco3yXa-.mjs} +10 -9
- package/dist/{render-OQn3iRsI.mjs → render-BQHJhSP1.mjs} +1 -1
- package/dist/{rescan-values-C0FDsjT7.mjs → rescan-values-B1vE6I62.mjs} +9 -10
- package/dist/{run-B4Wn43zm.mjs → run-CWb_yZbK.mjs} +14 -14
- package/dist/{runs-Bbaszr18.mjs → runs-BLwEO5sW.mjs} +5 -6
- package/dist/{runtime-Dmv5VtUK.mjs → runtime-DKLBPRhd.mjs} +16 -87
- package/dist/{schema-tables-CaWinbuK.mjs → schema-tables-D1qE25GS.mjs} +6 -7
- package/dist/{schemas-DUgGpAyB.mjs → schemas-CFuYnQDg.mjs} +4 -5
- package/dist/{search-BLrBXLUk.mjs → search-CF4A051Z.mjs} +4 -5
- package/dist/segment-BP_vDpYM.mjs +19 -0
- package/dist/{set-DfGsta5O.mjs → set-BJ8Rs-vI.mjs} +7 -7
- package/dist/setting-EYI0HqTq.mjs +17 -0
- package/dist/{setup-C9ikBRw_.mjs → setup-DI6EGOdH.mjs} +7 -8
- package/dist/{skills-CiN1OQ8W.mjs → skills-BDPVoBWU.mjs} +33 -2
- package/dist/{skills-CUHIcQS6.mjs → skills-CRECMGAo.mjs} +3 -3
- package/dist/snippet-BwK58D1F.mjs +19 -0
- package/dist/{stash-EIDcSvpF.mjs → stash-BpPS0uG8.mjs} +11 -10
- package/dist/{status-95ElRAu9.mjs → status-BqFA7Tqr.mjs} +10 -8
- package/dist/{status-B0_MiZEf.mjs → status-CU5LYX0i.mjs} +4 -5
- package/dist/{summary-C12LiEuJ.mjs → summary-CraRyIM_.mjs} +5 -6
- package/dist/{sync-schema-Ba8M3DiX.mjs → sync-schema-DkfwPESH.mjs} +9 -10
- package/dist/table-CJMN6ql8.mjs +19 -0
- package/dist/{table-C7a5V6Zn.mjs → table-CkWja2UH.mjs} +1 -1
- package/dist/transform-BqV5ssDN.mjs +24 -0
- package/dist/transform-job-DvdOLV9b.mjs +19 -0
- package/dist/{tree-Des2ZG9d.mjs → tree-Bd1i-Y4U.mjs} +3 -4
- package/dist/{update-DzAN4SPj.mjs → update-BLZHmA0X.mjs} +10 -11
- package/dist/{update-CyIZdbIQ.mjs → update-BncGqeWt.mjs} +9 -10
- package/dist/{update-DSgceARZ.mjs → update-C4f-8fsU.mjs} +9 -10
- package/dist/{update-njHe3j-s.mjs → update-CgpgyDjd.mjs} +10 -11
- package/dist/{update-DBi5U8zb.mjs → update-CsYa--Eb.mjs} +12 -13
- package/dist/{update-mYVnoYNV.mjs → update-DA9aPhRr.mjs} +11 -12
- package/dist/{update-_QfgNa53.mjs → update-DtO-1_tj.mjs} +10 -11
- package/dist/{update-Bx54nWEI.mjs → update-IPsv9Pj0.mjs} +12 -13
- package/dist/{update-F6DmZncY.mjs → update-OZoOTnlY.mjs} +9 -10
- package/dist/{update-dashcard-wpSjv4M7.mjs → update-dashcard-D0VAwfNO.mjs} +8 -9
- package/dist/{upgrade-iAuvhX-W.mjs → upgrade-Bb_q7hJ7.mjs} +41 -28
- package/dist/{uuid-CMKnS8-z.mjs → uuid-DTdRruiz.mjs} +3 -4
- package/dist/{validate-dPEOnOf8.mjs → validate-CqVB_3_p.mjs} +1 -1
- package/dist/{validate-query-Cw6WE5Y8.mjs → validate-query-BUTNK00f.mjs} +2 -2
- package/dist/values-Bpt6obVW.mjs +44 -0
- package/dist/{verify-D5YtTqqp.mjs → verify-COt2q73-.mjs} +1 -1
- package/dist/{wait-Bv3Tsnv4.mjs → wait-DoKPlspq.mjs} +8 -9
- package/dist/{wait-flags-Dzq9BGQY.mjs → wait-flags-D1jNm0JK.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +15 -28
- package/skill-data/git-sync/SKILL.md +8 -63
- package/skill-data/mbql/SKILL.md +2 -0
- package/skill-data/transform/SKILL.md +16 -6
- package/skill-data/visualization/SKILL.md +158 -0
- package/skill-data/visualization/references/settings.md +414 -0
- package/skills/metabase-cli/SKILL.md +1 -1
- package/dist/add-collection-C0w6ACQF.mjs +0 -11
- package/dist/auth-CzXb_zB2.mjs +0 -19
- package/dist/capabilities-7e9MgquN.mjs +0 -29
- package/dist/card-DP4rfoOi.mjs +0 -21
- package/dist/collection-tY18ezvn.mjs +0 -21
- package/dist/create-CHF313Qg.mjs +0 -52
- package/dist/credentials-dzeq7ckm.mjs +0 -88
- package/dist/dashboard-ChM_Tu0l.mjs +0 -22
- package/dist/database-CIXwHKjK.mjs +0 -17
- package/dist/db-DrQn_i3W.mjs +0 -22
- package/dist/delete-CM3jnAeQ.mjs +0 -100
- package/dist/deprovision-CwxcIT3k.mjs +0 -65
- package/dist/docker-Oq80q3tu.mjs +0 -515
- package/dist/field-Z6Pcxf4n.mjs +0 -19
- package/dist/git-sync-CiGAad76.mjs +0 -28
- package/dist/is-dirty-Ume4oV0j.mjs +0 -10
- package/dist/license-Dxarh-gG.mjs +0 -17
- package/dist/list-zSO0DMw-.mjs +0 -36
- package/dist/logs-CywPikkL.mjs +0 -60
- package/dist/measure-C44EK_xt.mjs +0 -20
- package/dist/parse-schemas-BqUdWUwq.mjs +0 -12
- package/dist/process-C7V8LJ-j.mjs +0 -105
- package/dist/provision-UWcNDoDe.mjs +0 -82
- package/dist/ps-CJU0EbrC.mjs +0 -80
- package/dist/ps-DEroLgbI.mjs +0 -11
- package/dist/remove-BFWun0e8.mjs +0 -63
- package/dist/segment-B3Uwwcsm.mjs +0 -20
- package/dist/set-B8cUbRLD.mjs +0 -68
- package/dist/setting-D2p2MA7f.mjs +0 -18
- package/dist/snippet-B7D0uWlz.mjs +0 -20
- package/dist/start-3PX3ahjT.mjs +0 -413
- package/dist/status-CEplmC44.mjs +0 -34
- package/dist/stop-CQ0XGrN8.mjs +0 -83
- package/dist/table-e6h8SLVX.mjs +0 -20
- package/dist/transform-BMYh1lsC.mjs +0 -25
- package/dist/transform-job-Cm7z5TfH.mjs +0 -20
- package/dist/update-DHZubok3.mjs +0 -77
- package/dist/url-DWaT6WIZ.mjs +0 -56
- package/dist/values-BfSTAbzc.mjs +0 -37
- package/dist/wait-8yV9_WIo.mjs +0 -19
- package/dist/workspace-BBXJczJK.mjs +0 -72
- package/dist/workspace-CKLZrR7l.mjs +0 -26
- package/dist/workspace-credentials-BXpABsNZ.mjs +0 -100
- package/dist/yaml-YTQiYJ9s.mjs +0 -43
- package/skill-data/viz/SKILL.md +0 -137
- package/skill-data/viz/references/settings.md +0 -312
- package/skill-data/workspace/SKILL.md +0 -390
- /package/dist/{body-flags-D7q87Btw.mjs → body-flags-D78h_-Ua.mjs} +0 -0
- /package/dist/{input-cMSEqISy.mjs → input-xewHccej.mjs} +0 -0
- /package/dist/{parse-enum-CrEWOhuY.mjs → parse-enum-Dr7ACrTR.mjs} +0 -0
- /package/dist/{prompt-CFKoys7k.mjs → prompt-u4WhE4T5.mjs} +0 -0
- /package/dist/{snippet-COggaWxx.mjs → snippet-xh42tYly.mjs} +0 -0
- /package/dist/{transform-GTW3G-01.mjs → transform-DyJb0bV0.mjs} +0 -0
- /package/dist/{transform-job-DeTDPMxt.mjs → transform-job-DpDGoqQt.mjs} +0 -0
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { z } from "zod";
|
|
3
3
|
import Table from "cli-table3";
|
|
4
4
|
|
|
5
|
+
//#region src/runtime/predicates.ts
|
|
6
|
+
function isPlainObject(value) {
|
|
7
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/output/notice.ts
|
|
12
|
+
function warn(message) {
|
|
13
|
+
process.stderr.write(message + "\n");
|
|
14
|
+
}
|
|
15
|
+
function listTruncationNotice(bytes) {
|
|
16
|
+
return `… cut at ${bytes} bytes; rerun with --max-bytes 0`;
|
|
17
|
+
}
|
|
18
|
+
function itemOversizeMessage(bytes, maxBytes) {
|
|
19
|
+
return `output is ${bytes} bytes, over the ${maxBytes}-byte --max-bytes cap; narrow with --fields, or pass --max-bytes 0 to disable`;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
5
23
|
//#region src/output/cap.ts
|
|
6
24
|
function capListEnvelope(envelope, maxBytes) {
|
|
7
25
|
if (maxBytes <= 0) return envelope;
|
|
@@ -81,17 +99,33 @@ function setPath(target, parts, value) {
|
|
|
81
99
|
|
|
82
100
|
//#endregion
|
|
83
101
|
//#region src/output/table.ts
|
|
102
|
+
const PLAIN_TABLE_STYLE = {
|
|
103
|
+
head: [],
|
|
104
|
+
border: []
|
|
105
|
+
};
|
|
84
106
|
function renderTable(rows, columns) {
|
|
85
107
|
const head = columns.map((column) => column.label ?? column.key);
|
|
86
108
|
const widths = columns.map((column) => column.width ?? null);
|
|
87
109
|
const hasWidth = widths.some((width) => width !== null);
|
|
88
110
|
const table = new Table(hasWidth ? {
|
|
89
111
|
head,
|
|
90
|
-
colWidths: widths
|
|
91
|
-
|
|
112
|
+
colWidths: widths,
|
|
113
|
+
style: PLAIN_TABLE_STYLE
|
|
114
|
+
} : {
|
|
115
|
+
head,
|
|
116
|
+
style: PLAIN_TABLE_STYLE
|
|
117
|
+
});
|
|
92
118
|
for (const row of rows) table.push(columns.map((column) => formatCell(row, column)));
|
|
93
119
|
return table.toString();
|
|
94
120
|
}
|
|
121
|
+
function renderRows(head, rows) {
|
|
122
|
+
const table = new Table({
|
|
123
|
+
head: [...head],
|
|
124
|
+
style: PLAIN_TABLE_STYLE
|
|
125
|
+
});
|
|
126
|
+
for (const row of rows) table.push([...row]);
|
|
127
|
+
return table.toString();
|
|
128
|
+
}
|
|
95
129
|
function formatCell(row, column) {
|
|
96
130
|
const value = row[column.key];
|
|
97
131
|
if (column.format !== void 0) return column.format(value);
|
|
@@ -117,17 +151,17 @@ function renderItem(item, view, opts) {
|
|
|
117
151
|
assertItemWithinMaxBytes(body, opts.maxBytes);
|
|
118
152
|
process.stdout.write(body);
|
|
119
153
|
}
|
|
120
|
-
function
|
|
154
|
+
function renderSummary(item, view, summaryText, opts) {
|
|
121
155
|
if (opts.format === "json" || opts.fields !== void 0 || opts.full) {
|
|
122
156
|
renderItem(item, view, opts);
|
|
123
157
|
return;
|
|
124
158
|
}
|
|
125
|
-
const body =
|
|
159
|
+
const body = (typeof summaryText === "function" ? summaryText() : summaryText) + "\n";
|
|
126
160
|
assertItemWithinMaxBytes(body, opts.maxBytes);
|
|
127
161
|
process.stdout.write(body);
|
|
128
162
|
}
|
|
129
163
|
function renderList(envelope, view, opts) {
|
|
130
|
-
if (opts.format === "json"
|
|
164
|
+
if (opts.format === "json") {
|
|
131
165
|
renderJsonEnvelope(envelope, view, opts);
|
|
132
166
|
return;
|
|
133
167
|
}
|
|
@@ -135,10 +169,24 @@ function renderList(envelope, view, opts) {
|
|
|
135
169
|
process.stdout.write("(no results)\n");
|
|
136
170
|
return;
|
|
137
171
|
}
|
|
172
|
+
if (opts.fields !== void 0) {
|
|
173
|
+
renderProjectedTable(envelope, view, opts.fields, opts.maxBytes);
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
138
176
|
const capped = capListEnvelope(envelope, opts.maxBytes);
|
|
139
177
|
process.stdout.write(renderTable(capped.data, view.tableColumns) + "\n");
|
|
140
178
|
if (capped.truncated !== void 0) warn(listTruncationNotice(capped.truncated.bytes));
|
|
141
179
|
}
|
|
180
|
+
function renderProjectedTable(envelope, view, fields, maxBytes) {
|
|
181
|
+
const projectedItems = envelope.data.map((item) => applyProjection(item, view, false, fields));
|
|
182
|
+
const capped = capListEnvelope({
|
|
183
|
+
...envelope,
|
|
184
|
+
data: projectedItems
|
|
185
|
+
}, maxBytes);
|
|
186
|
+
const rows = capped.data.map((item) => fields.map((path) => formatScalar(pickPath(item, path.split(".")))));
|
|
187
|
+
process.stdout.write(renderRows(fields, rows) + "\n");
|
|
188
|
+
if (capped.truncated !== void 0) warn(listTruncationNotice(capped.truncated.bytes));
|
|
189
|
+
}
|
|
142
190
|
function renderJsonEnvelope(envelope, view, opts) {
|
|
143
191
|
const projectedItems = envelope.data.map((item) => applyProjection(item, view, opts.full, opts.fields));
|
|
144
192
|
const projectedEnvelope = {
|
|
@@ -150,9 +198,9 @@ function renderJsonEnvelope(envelope, view, opts) {
|
|
|
150
198
|
if (capped.truncated !== void 0) warn(listTruncationNotice(capped.truncated.bytes));
|
|
151
199
|
}
|
|
152
200
|
function renderItemBody(item, view, projected, opts) {
|
|
153
|
-
if (opts.format === "json"
|
|
154
|
-
if (
|
|
155
|
-
return renderKeyValueLines(
|
|
201
|
+
if (opts.format === "json") return JSON.stringify(projected, null, 2);
|
|
202
|
+
if (opts.fields !== void 0 || opts.full) return renderKeyValueLines(objectPairs(projected));
|
|
203
|
+
return renderKeyValueLines(columnPairs(item, view.tableColumns));
|
|
156
204
|
}
|
|
157
205
|
function columnPairs(item, columns) {
|
|
158
206
|
return columns.map((column) => [column.label ?? column.key, formatCell(item, column)]);
|
|
@@ -177,4 +225,12 @@ function assertItemWithinMaxBytes(body, maxBytes) {
|
|
|
177
225
|
}
|
|
178
226
|
|
|
179
227
|
//#endregion
|
|
180
|
-
|
|
228
|
+
//#region src/runtime/capabilities.ts
|
|
229
|
+
const Capabilities = z.object({
|
|
230
|
+
minVersion: z.number(),
|
|
231
|
+
tokenFeature: z.string().optional()
|
|
232
|
+
});
|
|
233
|
+
const BASELINE_CAPABILITIES = Object.freeze({ minVersion: 58 });
|
|
234
|
+
|
|
235
|
+
//#endregion
|
|
236
|
+
export { BASELINE_CAPABILITIES, Capabilities, formatScalar, isPlainObject, renderItem, renderList, renderRows, renderSummary, warn, writeJson, writeText };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/card/index.ts
|
|
4
|
+
var card_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "card",
|
|
7
|
+
description: "Manage Metabase cards (questions, models, metrics)"
|
|
8
|
+
},
|
|
9
|
+
subCommands: {
|
|
10
|
+
list: () => import("./list-CJe45jFT.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-DnK3WGDH.mjs").then((mod) => mod.default),
|
|
12
|
+
query: () => import("./query--05TZxmk.mjs").then((mod) => mod.default),
|
|
13
|
+
create: () => import("./create-BV_VpyyI.mjs").then((mod) => mod.default),
|
|
14
|
+
update: () => import("./update-CsYa--Eb.mjs").then((mod) => mod.default),
|
|
15
|
+
archive: () => import("./archive-2GZVq0n2.mjs").then((mod) => mod.default)
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { card_default as default };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderList } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DBwNYb4Y.mjs";
|
|
7
6
|
import { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-FY5UzJ_Z.mjs";
|
|
8
7
|
|
|
9
8
|
//#region src/commands/dashboard/cards.ts
|
package/dist/cli.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { ConfigError, flagConsumesValue, getMetabaseAugment, normalizeFlag, resolveCitty, toAliasArray } from "./command-augment-BH9qgQ5u.mjs";
|
|
3
|
-
import { connectionFlags, outputFlags, package_default, profileFlag, reportError } from "./error-
|
|
3
|
+
import { connectionFlags, outputFlags, package_default, profileFlag, reportError } from "./error-Br6irjpM.mjs";
|
|
4
4
|
import { defineCommand, renderUsage, runMain } from "citty";
|
|
5
5
|
|
|
6
6
|
//#region src/commands/global-flags.ts
|
|
@@ -58,29 +58,28 @@ const main = defineCommand({
|
|
|
58
58
|
description: package_default.description
|
|
59
59
|
},
|
|
60
60
|
subCommands: {
|
|
61
|
-
auth: () => import("./auth-
|
|
62
|
-
db: () => import("./db-
|
|
63
|
-
table: () => import("./table-
|
|
64
|
-
field: () => import("./field-
|
|
65
|
-
card: () => import("./card-
|
|
66
|
-
dashboard: () => import("./dashboard-
|
|
67
|
-
collection: () => import("./collection-
|
|
68
|
-
transform: () => import("./transform-
|
|
69
|
-
"transform-job": () => import("./transform-job-
|
|
70
|
-
setting: () => import("./setting-
|
|
71
|
-
search: () => import("./search-
|
|
72
|
-
"git-sync": () => import("./git-sync-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
__manifest: () => import("./manifest-BBR46KFM.mjs").then((mod) => mod.createManifestCommand(main))
|
|
61
|
+
auth: () => import("./auth-Divr9vkY.mjs").then((mod) => mod.default),
|
|
62
|
+
db: () => import("./db-bD6fwLwc.mjs").then((mod) => mod.default),
|
|
63
|
+
table: () => import("./table-CJMN6ql8.mjs").then((mod) => mod.default),
|
|
64
|
+
field: () => import("./field-BFWc8q2W.mjs").then((mod) => mod.default),
|
|
65
|
+
card: () => import("./card-BHAcovSB.mjs").then((mod) => mod.default),
|
|
66
|
+
dashboard: () => import("./dashboard-DCWGcx3e.mjs").then((mod) => mod.default),
|
|
67
|
+
collection: () => import("./collection-DZx-vWb2.mjs").then((mod) => mod.default),
|
|
68
|
+
transform: () => import("./transform-BqV5ssDN.mjs").then((mod) => mod.default),
|
|
69
|
+
"transform-job": () => import("./transform-job-DvdOLV9b.mjs").then((mod) => mod.default),
|
|
70
|
+
setting: () => import("./setting-EYI0HqTq.mjs").then((mod) => mod.default),
|
|
71
|
+
search: () => import("./search-CF4A051Z.mjs").then((mod) => mod.default),
|
|
72
|
+
"git-sync": () => import("./git-sync-Ch00miSa.mjs").then((mod) => mod.default),
|
|
73
|
+
setup: () => import("./setup-DI6EGOdH.mjs").then((mod) => mod.default),
|
|
74
|
+
snippet: () => import("./snippet-BwK58D1F.mjs").then((mod) => mod.default),
|
|
75
|
+
segment: () => import("./segment-BP_vDpYM.mjs").then((mod) => mod.default),
|
|
76
|
+
measure: () => import("./measure-D_eiCKq9.mjs").then((mod) => mod.default),
|
|
77
|
+
eid: () => import("./eid-pqSVgO2g.mjs").then((mod) => mod.default),
|
|
78
|
+
query: () => import("./query-BbbDpt3u.mjs").then((mod) => mod.default),
|
|
79
|
+
uuid: () => import("./uuid-DTdRruiz.mjs").then((mod) => mod.default),
|
|
80
|
+
upgrade: () => import("./upgrade-Bb_q7hJ7.mjs").then((mod) => mod.default),
|
|
81
|
+
skills: () => import("./skills-CRECMGAo.mjs").then((mod) => mod.default),
|
|
82
|
+
__manifest: () => import("./manifest-B_OfG-Ss.mjs").then((mod) => mod.createManifestCommand(main))
|
|
84
83
|
}
|
|
85
84
|
});
|
|
86
85
|
var main_default = main;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/collection/index.ts
|
|
4
|
+
var collection_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "collection",
|
|
7
|
+
description: "Manage Metabase collections"
|
|
8
|
+
},
|
|
9
|
+
subCommands: {
|
|
10
|
+
list: () => import("./list-Ddyb5T-7.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-xo5_PD1n.mjs").then((mod) => mod.default),
|
|
12
|
+
items: () => import("./items-CC4sSWv7.mjs").then((mod) => mod.default),
|
|
13
|
+
tree: () => import("./tree-Bd1i-Y4U.mjs").then((mod) => mod.default),
|
|
14
|
+
create: () => import("./create-B_Ysb6Ex.mjs").then((mod) => mod.default),
|
|
15
|
+
archive: () => import("./archive-C5pXDf6a.mjs").then((mod) => mod.default)
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { collection_default as default };
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import "./validate-
|
|
12
|
-
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import "./field-MGxpNQUH.mjs";
|
|
7
|
+
import { Card, CardCreateInput, cardView } from "./card-BtPiKjbB.mjs";
|
|
8
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
10
|
+
import "./validate-CqVB_3_p.mjs";
|
|
11
|
+
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BUTNK00f.mjs";
|
|
13
12
|
|
|
14
13
|
//#region src/commands/card/create.ts
|
|
15
14
|
var create_default = defineMetabaseCommand({
|
|
@@ -44,7 +43,7 @@ var create_default = defineMetabaseCommand({
|
|
|
44
43
|
method: "POST",
|
|
45
44
|
body
|
|
46
45
|
});
|
|
47
|
-
|
|
46
|
+
renderSummary(created, cardView, `Created card ${created.id} "${created.name}".`, ctx);
|
|
48
47
|
}
|
|
49
48
|
});
|
|
50
49
|
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
9
8
|
import { Collection, CollectionCreateInput, collectionView } from "./collection-B3sPXRLs.mjs";
|
|
10
9
|
|
|
11
10
|
//#region src/commands/collection/create.ts
|
|
@@ -37,7 +36,7 @@ var create_default = defineMetabaseCommand({
|
|
|
37
36
|
method: "POST",
|
|
38
37
|
body
|
|
39
38
|
});
|
|
40
|
-
|
|
39
|
+
renderSummary(created, collectionView, `Created collection ${created.id} "${created.name}".`, ctx);
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
42
|
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import "./validate-
|
|
10
|
-
import {
|
|
11
|
-
import { Transform, TransformCreateInput, transformView } from "./transform-GTW3G-01.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import "./validate-CqVB_3_p.mjs";
|
|
9
|
+
import { TRANSFORM_SOURCE_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BUTNK00f.mjs";
|
|
10
|
+
import { Transform, TransformCreateInput, transformView } from "./transform-DyJb0bV0.mjs";
|
|
12
11
|
|
|
13
12
|
//#region src/commands/transform/create.ts
|
|
14
13
|
var create_default = defineMetabaseCommand({
|
|
@@ -42,7 +41,7 @@ var create_default = defineMetabaseCommand({
|
|
|
42
41
|
method: "POST",
|
|
43
42
|
body
|
|
44
43
|
});
|
|
45
|
-
|
|
44
|
+
renderSummary(created, transformView, `Created transform ${created.id} "${created.name}".`, ctx);
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import "./validate-
|
|
10
|
-
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import "./validate-CqVB_3_p.mjs";
|
|
9
|
+
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BUTNK00f.mjs";
|
|
11
10
|
import { Segment, SegmentCreateInput, segmentView } from "./segment-Be2v4ilr.mjs";
|
|
12
11
|
|
|
13
12
|
//#region src/commands/segment/create.ts
|
|
@@ -42,7 +41,7 @@ var create_default = defineMetabaseCommand({
|
|
|
42
41
|
method: "POST",
|
|
43
42
|
body
|
|
44
43
|
});
|
|
45
|
-
|
|
44
|
+
renderSummary(created, segmentView, `Created segment ${created.id} "${created.name}".`, ctx);
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-DeTDPMxt.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-DpDGoqQt.mjs";
|
|
10
9
|
|
|
11
10
|
//#region src/commands/transform-job/create.ts
|
|
12
11
|
var create_default = defineMetabaseCommand({
|
|
@@ -37,7 +36,7 @@ var create_default = defineMetabaseCommand({
|
|
|
37
36
|
method: "POST",
|
|
38
37
|
body
|
|
39
38
|
});
|
|
40
|
-
|
|
39
|
+
renderSummary(created, transformJobView, `Created transform job ${created.id} "${created.name}".`, ctx);
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
42
|
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { Snippet, SnippetCreateInput, snippetView } from "./snippet-COggaWxx.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import { Snippet, SnippetCreateInput, snippetView } from "./snippet-xh42tYly.mjs";
|
|
10
9
|
|
|
11
10
|
//#region src/commands/snippet/create.ts
|
|
12
11
|
var create_default = defineMetabaseCommand({
|
|
@@ -37,7 +36,7 @@ var create_default = defineMetabaseCommand({
|
|
|
37
36
|
method: "POST",
|
|
38
37
|
body
|
|
39
38
|
});
|
|
40
|
-
|
|
39
|
+
renderSummary(created, snippetView, `Created snippet ${created.id} "${created.name}".`, ctx);
|
|
41
40
|
}
|
|
42
41
|
});
|
|
43
42
|
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import "./validate-dPEOnOf8.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import "./field-MGxpNQUH.mjs";
|
|
7
|
+
import "./card-BtPiKjbB.mjs";
|
|
8
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
10
|
+
import "./validate-CqVB_3_p.mjs";
|
|
12
11
|
import { Dashboard, DashboardCreateInput, DashboardDetail, dashboardView } from "./dashboard-FY5UzJ_Z.mjs";
|
|
13
|
-
import { preflightDashcardCardReferences, wrapChainedDashboardWriteError } from "./preflight-
|
|
12
|
+
import { preflightDashcardCardReferences, wrapChainedDashboardWriteError } from "./preflight-D-l6sLCX.mjs";
|
|
14
13
|
|
|
15
14
|
//#region src/commands/dashboard/create.ts
|
|
16
15
|
var create_default = defineMetabaseCommand({
|
|
@@ -46,7 +45,7 @@ var create_default = defineMetabaseCommand({
|
|
|
46
45
|
body: createOnly
|
|
47
46
|
});
|
|
48
47
|
if (dashcards === void 0 && tabs === void 0) {
|
|
49
|
-
|
|
48
|
+
renderSummary(created, dashboardView, `Created dashboard ${created.id} "${created.name}".`, ctx);
|
|
50
49
|
return;
|
|
51
50
|
}
|
|
52
51
|
try {
|
|
@@ -57,7 +56,7 @@ var create_default = defineMetabaseCommand({
|
|
|
57
56
|
tabs
|
|
58
57
|
}
|
|
59
58
|
});
|
|
60
|
-
|
|
59
|
+
renderSummary(updated, dashboardView, `Created dashboard ${updated.id} "${updated.name}".`, ctx);
|
|
61
60
|
} catch (error) {
|
|
62
61
|
throw wrapChainedDashboardWriteError(error, created.id);
|
|
63
62
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import "./validate-
|
|
10
|
-
import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-Cw6WE5Y8.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import "./validate-CqVB_3_p.mjs";
|
|
9
|
+
import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BUTNK00f.mjs";
|
|
11
10
|
import { Measure, MeasureCreateInput, measureView } from "./measure-ClESGxIb.mjs";
|
|
12
11
|
|
|
13
12
|
//#region src/commands/measure/create.ts
|
|
@@ -42,7 +41,7 @@ var create_default = defineMetabaseCommand({
|
|
|
42
41
|
method: "POST",
|
|
43
42
|
body
|
|
44
43
|
});
|
|
45
|
-
|
|
44
|
+
renderSummary(created, measureView, `Created measure ${created.id} "${created.name}".`, ctx);
|
|
46
45
|
}
|
|
47
46
|
});
|
|
48
47
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./poll-DHKDpCiq.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import { REMOTE_SYNC_PATHS } from "./poll-task-DOvUDrgL.mjs";
|
|
6
|
+
import "./poll-DWkVceIk.mjs";
|
|
8
7
|
import { z } from "zod";
|
|
9
8
|
|
|
10
9
|
//#region src/commands/git-sync/create-branch.ts
|
|
@@ -51,7 +50,7 @@ var create_branch_default = defineMetabaseCommand({
|
|
|
51
50
|
method: "POST",
|
|
52
51
|
body: { name }
|
|
53
52
|
});
|
|
54
|
-
|
|
53
|
+
renderSummary(result, createBranchView, `Created branch "${name}" and switched git-sync to it.`, ctx);
|
|
55
54
|
}
|
|
56
55
|
});
|
|
57
56
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import "./poll-DHKDpCiq.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import { SyncTaskOrIdle, fetchCurrentTask, formatSyncTask, syncTaskIdleView, syncTaskView } from "./poll-task-DOvUDrgL.mjs";
|
|
6
|
+
import "./poll-DWkVceIk.mjs";
|
|
8
7
|
|
|
9
8
|
//#region src/commands/git-sync/current-task.ts
|
|
10
9
|
const CurrentTaskResult = SyncTaskOrIdle;
|
|
@@ -29,10 +28,10 @@ var current_task_default = defineMetabaseCommand({
|
|
|
29
28
|
const task = await fetchCurrentTask(client);
|
|
30
29
|
if (task === null) {
|
|
31
30
|
const idle = { status: "idle" };
|
|
32
|
-
|
|
31
|
+
renderSummary(idle, syncTaskIdleView, "No git-sync task is running.", ctx);
|
|
33
32
|
return;
|
|
34
33
|
}
|
|
35
|
-
|
|
34
|
+
renderSummary(task, syncTaskView, formatSyncTask(task), ctx);
|
|
36
35
|
}
|
|
37
36
|
});
|
|
38
37
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/dashboard/index.ts
|
|
4
|
+
var dashboard_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "dashboard",
|
|
7
|
+
description: "Manage Metabase dashboards"
|
|
8
|
+
},
|
|
9
|
+
subCommands: {
|
|
10
|
+
list: () => import("./list-tveV3LKh.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-C3RI_hKG.mjs").then((mod) => mod.default),
|
|
12
|
+
cards: () => import("./cards-BW0Spirk.mjs").then((mod) => mod.default),
|
|
13
|
+
create: () => import("./create-CbyY4xTG.mjs").then((mod) => mod.default),
|
|
14
|
+
update: () => import("./update-IPsv9Pj0.mjs").then((mod) => mod.default),
|
|
15
|
+
"update-dashcard": () => import("./update-dashcard-D0VAwfNO.mjs").then((mod) => mod.default),
|
|
16
|
+
archive: () => import("./archive-DTrn90If.mjs").then((mod) => mod.default)
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { dashboard_default as default };
|
|
@@ -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-C48ZZLM5.mjs").then((m) => m.default),
|
|
12
|
+
get: () => import("./get-Dy4NedW5.mjs").then((m) => m.default),
|
|
13
|
+
metadata: () => import("./metadata-Cbqx1-yW.mjs").then((m) => m.default),
|
|
14
|
+
schemas: () => import("./schemas-CFuYnQDg.mjs").then((m) => m.default),
|
|
15
|
+
"schema-tables": () => import("./schema-tables-D1qE25GS.mjs").then((m) => m.default),
|
|
16
|
+
"sync-schema": () => import("./sync-schema-DkfwPESH.mjs").then((m) => m.default),
|
|
17
|
+
"rescan-values": () => import("./rescan-values-B1vE6I62.mjs").then((m) => m.default)
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { db_default as default };
|