@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
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { formatScalar, renderRows } from "./capabilities-Dj3NgPHg.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/output/query-result.ts
|
|
4
|
+
function formatQueryResult(result) {
|
|
5
|
+
if (result.status !== "completed" || result.data === void 0) {
|
|
6
|
+
const hasError = typeof result.error === "string" && result.error !== "";
|
|
7
|
+
const detail = hasError ? `: ${result.error}` : "";
|
|
8
|
+
return `Query ${result.status}${detail}`;
|
|
9
|
+
}
|
|
10
|
+
const head = result.data.cols.map((col) => col.display_name ?? col.name);
|
|
11
|
+
const rowCount = result.row_count ?? result.data.rows.length;
|
|
12
|
+
const summary = `${rowCount} row${rowCount === 1 ? "" : "s"}.`;
|
|
13
|
+
if (result.data.rows.length === 0) return summary;
|
|
14
|
+
const rows = result.data.rows.map((row) => Array.isArray(row) ? row.map((cell) => formatScalar(cell)) : [formatScalar(row)]);
|
|
15
|
+
return `${renderRows(head, rows)}\n${summary}`;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { formatQueryResult };
|
|
@@ -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 "./poll-
|
|
8
|
-
import "./
|
|
9
|
-
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-BU8r3r2M.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 { parseId } from "./parse-id-DBwNYb4Y.mjs";
|
|
6
|
+
import "./poll-task-DOvUDrgL.mjs";
|
|
7
|
+
import "./poll-DWkVceIk.mjs";
|
|
8
|
+
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-C5ijC4e-.mjs";
|
|
10
9
|
|
|
11
10
|
//#region src/commands/git-sync/remove-collection.ts
|
|
12
11
|
var remove_collection_default = defineMetabaseCommand({
|
|
@@ -34,7 +33,9 @@ var remove_collection_default = defineMetabaseCommand({
|
|
|
34
33
|
const collectionId = parseId(args.id, "id");
|
|
35
34
|
const client = await getClient();
|
|
36
35
|
const result = await setCollectionRemoteSynced(client, collectionId, false);
|
|
37
|
-
|
|
36
|
+
const taskPart = result.task_id !== void 0 ? ` (task #${result.task_id})` : "";
|
|
37
|
+
const message = result.success ? `Collection ${collectionId} is no longer git-synced${taskPart}.` : `Could not update git-sync setting for collection ${collectionId}.`;
|
|
38
|
+
renderSummary(result, syncSettingsUpdateView, message, ctx);
|
|
38
39
|
}
|
|
39
40
|
});
|
|
40
41
|
|
|
@@ -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 { DatabaseSyncResult, databaseSyncResultView } from "./database-lH-B3G1I.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 "./field-MGxpNQUH.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-DBwNYb4Y.mjs";
|
|
7
|
+
import "./table-CkWja2UH.mjs";
|
|
8
|
+
import { DatabaseSyncResult, databaseSyncResultView } from "./database-_Td7rG4o.mjs";
|
|
10
9
|
import { z } from "zod";
|
|
11
10
|
|
|
12
11
|
//#region src/commands/db/rescan-values.ts
|
|
@@ -33,10 +32,10 @@ var rescan_values_default = defineMetabaseCommand({
|
|
|
33
32
|
const id = parseId(args.id);
|
|
34
33
|
const client = await getClient();
|
|
35
34
|
const response = await client.requestParsed(RescanValuesApiResponse, `/api/database/${id}/rescan_values`, { method: "POST" });
|
|
36
|
-
|
|
35
|
+
renderSummary({
|
|
37
36
|
id,
|
|
38
37
|
status: response.status
|
|
39
|
-
}, databaseSyncResultView, ctx);
|
|
38
|
+
}, databaseSyncResultView, `Field-values rescan queued for database ${id}.`, ctx);
|
|
40
39
|
}
|
|
41
40
|
});
|
|
42
41
|
|
|
@@ -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 { TransformRun } 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 { parseId } from "./parse-id-DBwNYb4Y.mjs";
|
|
6
|
+
import { pollUntil } from "./poll-DWkVceIk.mjs";
|
|
7
|
+
import { parseWaitFlags, waitFlags } from "./wait-flags-D1jNm0JK.mjs";
|
|
8
|
+
import { TransformRun } from "./transform-DyJb0bV0.mjs";
|
|
10
9
|
import { z } from "zod";
|
|
11
10
|
|
|
12
11
|
//#region src/commands/transform/run.ts
|
|
@@ -65,28 +64,29 @@ var run_default = defineMetabaseCommand({
|
|
|
65
64
|
const client = await getClient();
|
|
66
65
|
const kickoff = await client.requestParsed(TransformRunKickoff, `/api/transform/${id}/run`, { method: "POST" });
|
|
67
66
|
if (!wait.enabled) {
|
|
68
|
-
|
|
67
|
+
const started = kickoff.run_id === null ? kickoff.message : `Started run ${kickoff.run_id} for transform ${id}.`;
|
|
68
|
+
renderSummary({
|
|
69
69
|
message: kickoff.message,
|
|
70
70
|
run_id: kickoff.run_id,
|
|
71
71
|
final: null
|
|
72
|
-
}, transformRunResultView, ctx);
|
|
72
|
+
}, transformRunResultView, started, ctx);
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
if (kickoff.run_id === null) {
|
|
76
|
-
|
|
76
|
+
renderSummary({
|
|
77
77
|
message: kickoff.message,
|
|
78
78
|
run_id: null,
|
|
79
79
|
final: null
|
|
80
|
-
}, transformRunResultView, ctx);
|
|
80
|
+
}, transformRunResultView, kickoff.message, ctx);
|
|
81
81
|
throw new Error(`transform run did not start: ${kickoff.message}`);
|
|
82
82
|
}
|
|
83
83
|
const runId = kickoff.run_id;
|
|
84
84
|
const final = await pollUntil(async () => client.requestParsed(TransformRun, `/api/transform/run/${runId}`), (run) => RUN_TERMINAL_STATUSES.has(run.status), wait.schedule);
|
|
85
|
-
|
|
85
|
+
renderSummary({
|
|
86
86
|
message: kickoff.message,
|
|
87
87
|
run_id: runId,
|
|
88
88
|
final
|
|
89
|
-
}, transformRunResultView, ctx);
|
|
89
|
+
}, transformRunResultView, `Run ${runId} of transform ${id} ${final.status}.`, ctx);
|
|
90
90
|
if (RUN_FAILURE_STATUSES.has(final.status)) throw new Error(`transform run ${runId} ${final.status}`);
|
|
91
91
|
}
|
|
92
92
|
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag } 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 } 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 { collectPaginated } from "./paginate-Dfm9eO9A.mjs";
|
|
8
|
-
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-
|
|
7
|
+
import { TransformRun, TransformRunCompact, transformRunView } from "./transform-DyJb0bV0.mjs";
|
|
9
8
|
|
|
10
9
|
//#region src/commands/transform/runs.ts
|
|
11
10
|
const TransformRunListEnvelope = listEnvelopeSchema(TransformRunCompact);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AbortError, ConfigError, MetabaseError, NetworkError, ResponseShapeError, TimeoutError, ValidationError, errorMessage, flagConsumesValue, isNotFoundError, normalizeFlag, setMetabaseAugment, toAliasArray } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { DEFAULT_MAX_BYTES, package_default, reportError } from "./error-
|
|
3
|
-
import { BASELINE_CAPABILITIES, isPlainObject, warn } from "./capabilities-
|
|
2
|
+
import { DEFAULT_MAX_BYTES, package_default, reportError } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { BASELINE_CAPABILITIES, isPlainObject, warn } from "./capabilities-Dj3NgPHg.mjs";
|
|
4
4
|
import { defineCommand } from "citty";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { promises } from "node:fs";
|
|
@@ -124,10 +124,7 @@ const ProfileRecord = z.object({
|
|
|
124
124
|
lastProbe: ProfileLastProbe.nullable(),
|
|
125
125
|
lastFailure: ProfileLastFailure.nullable()
|
|
126
126
|
});
|
|
127
|
-
const ProfilesFile = z.object({
|
|
128
|
-
profiles: z.array(ProfileRecord),
|
|
129
|
-
license: z.string().nullable()
|
|
130
|
-
});
|
|
127
|
+
const ProfilesFile = z.object({ profiles: z.array(ProfileRecord) });
|
|
131
128
|
|
|
132
129
|
//#endregion
|
|
133
130
|
//#region src/core/auth/storage.ts
|
|
@@ -139,10 +136,7 @@ const PROFILES_FILE_MODE = 384;
|
|
|
139
136
|
const PROFILES_DIR_MODE = 448;
|
|
140
137
|
const DEFAULT_PROFILE = "default";
|
|
141
138
|
const LEGACY_STORAGE_NOTICE = "Old profile storage detected and ignored; re-run `mb auth login` for each profile.";
|
|
142
|
-
const account = {
|
|
143
|
-
profileApiKey: (profile) => `profile:${profile}:apiKey`,
|
|
144
|
-
license: "license"
|
|
145
|
-
};
|
|
139
|
+
const account = { profileApiKey: (profile) => `profile:${profile}:apiKey` };
|
|
146
140
|
let legacyWarningPending = false;
|
|
147
141
|
function profilesFilePath() {
|
|
148
142
|
return join(configDir(), PROFILES_FILE);
|
|
@@ -188,10 +182,7 @@ async function readProfilesFile() {
|
|
|
188
182
|
} catch (error) {
|
|
189
183
|
if (isNotFoundError(error)) {
|
|
190
184
|
await detectLegacyArtifacts();
|
|
191
|
-
return {
|
|
192
|
-
profiles: [],
|
|
193
|
-
license: null
|
|
194
|
-
};
|
|
185
|
+
return { profiles: [] };
|
|
195
186
|
}
|
|
196
187
|
throw error;
|
|
197
188
|
}
|
|
@@ -199,10 +190,7 @@ async function readProfilesFile() {
|
|
|
199
190
|
if (parsed.ok) return parsed.value;
|
|
200
191
|
if (parsed.error instanceof ValidationError) {
|
|
201
192
|
legacyWarningPending = true;
|
|
202
|
-
return {
|
|
203
|
-
profiles: [],
|
|
204
|
-
license: null
|
|
205
|
-
};
|
|
193
|
+
return { profiles: [] };
|
|
206
194
|
}
|
|
207
195
|
throw parsed.error;
|
|
208
196
|
}
|
|
@@ -222,7 +210,7 @@ async function fileExists(path) {
|
|
|
222
210
|
}
|
|
223
211
|
async function writeProfilesFile(file) {
|
|
224
212
|
const path = profilesFilePath();
|
|
225
|
-
if (file.profiles.length === 0
|
|
213
|
+
if (file.profiles.length === 0) {
|
|
226
214
|
await promises.unlink(path).catch(() => void 0);
|
|
227
215
|
await cleanupLegacyFiles();
|
|
228
216
|
return;
|
|
@@ -249,9 +237,9 @@ function fileLocation(key) {
|
|
|
249
237
|
reason: keyringEnabled() ? "unavailable" : "disabled"
|
|
250
238
|
};
|
|
251
239
|
}
|
|
252
|
-
function keyringFallbackWarning(location
|
|
240
|
+
function keyringFallbackWarning(location) {
|
|
253
241
|
const cause = location.reason === "disabled" ? "OS keychain disabled via METABASE_CLI_DISABLE_KEYRING" : "OS keychain unavailable";
|
|
254
|
-
return `warning: ${cause};
|
|
242
|
+
return `warning: ${cause}; credentials stored as plaintext at ${location.path}`;
|
|
255
243
|
}
|
|
256
244
|
async function persistApiKey(name, apiKey) {
|
|
257
245
|
const key = account.profileApiKey(name);
|
|
@@ -360,42 +348,6 @@ async function clearProfile(name = DEFAULT_PROFILE) {
|
|
|
360
348
|
});
|
|
361
349
|
return true;
|
|
362
350
|
}
|
|
363
|
-
async function readLicense() {
|
|
364
|
-
const fromKeyring = tryReadKeyring(account.license);
|
|
365
|
-
if (typeof fromKeyring === "string") return fromKeyring;
|
|
366
|
-
const file = await readProfilesFile();
|
|
367
|
-
return file.license;
|
|
368
|
-
}
|
|
369
|
-
async function writeLicense(token) {
|
|
370
|
-
const key = account.license;
|
|
371
|
-
const file = await readProfilesFile();
|
|
372
|
-
if (trySetKeyring(key, token)) {
|
|
373
|
-
if (file.license !== null) await writeProfilesFile({
|
|
374
|
-
...file,
|
|
375
|
-
license: null
|
|
376
|
-
});
|
|
377
|
-
return {
|
|
378
|
-
backend: "keyring",
|
|
379
|
-
service: KEYRING_SERVICE,
|
|
380
|
-
account: key
|
|
381
|
-
};
|
|
382
|
-
}
|
|
383
|
-
await writeProfilesFile({
|
|
384
|
-
...file,
|
|
385
|
-
license: token
|
|
386
|
-
});
|
|
387
|
-
return fileLocation(key);
|
|
388
|
-
}
|
|
389
|
-
async function clearLicense() {
|
|
390
|
-
const removedFromKeyring = tryRemoveKeyring(account.license);
|
|
391
|
-
const file = await readProfilesFile();
|
|
392
|
-
const hadInline = file.license !== null;
|
|
393
|
-
if (hadInline) await writeProfilesFile({
|
|
394
|
-
...file,
|
|
395
|
-
license: null
|
|
396
|
-
});
|
|
397
|
-
return removedFromKeyring === true || hadInline;
|
|
398
|
-
}
|
|
399
351
|
|
|
400
352
|
//#endregion
|
|
401
353
|
//#region src/runtime/signal.ts
|
|
@@ -885,10 +837,6 @@ async function readBodyForError(response) {
|
|
|
885
837
|
//#region src/core/version/probe.ts
|
|
886
838
|
const PROBE_PATH = "/api/session/properties";
|
|
887
839
|
const PROBE_TIMEOUT_MS = 1e4;
|
|
888
|
-
const EMPTY_SERVER_INFO = Object.freeze({
|
|
889
|
-
version: null,
|
|
890
|
-
tokenFeatures: null
|
|
891
|
-
});
|
|
892
840
|
async function probeServer(client, opts = {}) {
|
|
893
841
|
const properties = await client.requestParsed(SessionProperties, PROBE_PATH, {
|
|
894
842
|
timeoutMs: PROBE_TIMEOUT_MS,
|
|
@@ -914,16 +862,12 @@ function originOnly(input) {
|
|
|
914
862
|
parsed.password = "";
|
|
915
863
|
return parsed.origin;
|
|
916
864
|
}
|
|
917
|
-
function localUrl(port) {
|
|
918
|
-
return `http://localhost:${port}`;
|
|
919
|
-
}
|
|
920
865
|
|
|
921
866
|
//#endregion
|
|
922
867
|
//#region src/core/config.ts
|
|
923
868
|
const ENV_URL = "METABASE_URL";
|
|
924
869
|
const ENV_API_KEY = "METABASE_API_KEY";
|
|
925
870
|
const ENV_PROFILE = "METABASE_PROFILE";
|
|
926
|
-
const ENV_LICENSE_TOKEN = "METABASE_LICENSE_TOKEN";
|
|
927
871
|
const ENV_SKIP_PREFLIGHT = "METABASE_CLI_SKIP_PREFLIGHT";
|
|
928
872
|
function isPreflightSkipped() {
|
|
929
873
|
return process.env[ENV_SKIP_PREFLIGHT] === "1";
|
|
@@ -940,9 +884,6 @@ function readEnvCredentials() {
|
|
|
940
884
|
apiKey: process.env[ENV_API_KEY] ?? null
|
|
941
885
|
};
|
|
942
886
|
}
|
|
943
|
-
function readEnvLicenseToken() {
|
|
944
|
-
return process.env[ENV_LICENSE_TOKEN] ?? null;
|
|
945
|
-
}
|
|
946
887
|
async function resolveConfig(flags) {
|
|
947
888
|
const profile = resolveProfileName(flags.profile);
|
|
948
889
|
const env = readEnvCredentials();
|
|
@@ -963,14 +904,6 @@ async function resolveConfig(flags) {
|
|
|
963
904
|
source: urlField.source === keyField.source ? urlField.source : "mixed"
|
|
964
905
|
};
|
|
965
906
|
}
|
|
966
|
-
async function resolveLicenseToken(flags) {
|
|
967
|
-
const flag = flags.token;
|
|
968
|
-
const env = readEnvLicenseToken();
|
|
969
|
-
const stored = !flag && !env ? await readLicense() : null;
|
|
970
|
-
const value = flag ?? env ?? stored;
|
|
971
|
-
if (!value) throw new ConfigError(`No license token. Pass --token, set ${ENV_LICENSE_TOKEN}, or store one with \`mb workspace license set\`.`);
|
|
972
|
-
return value;
|
|
973
|
-
}
|
|
974
907
|
async function failureHintForProfile(profile) {
|
|
975
908
|
const record = await readProfileRecord(profile);
|
|
976
909
|
if (record === null || record.lastFailure === null) return "";
|
|
@@ -1088,10 +1021,6 @@ function parseInteger(value, options) {
|
|
|
1088
1021
|
if (parsed < options.min) throw new ConfigError(`invalid ${options.name}: ${parsed} (must be ≥ ${options.min})`);
|
|
1089
1022
|
return parsed;
|
|
1090
1023
|
}
|
|
1091
|
-
function parseOptionalInteger(value, options) {
|
|
1092
|
-
if (value === void 0 || value === "") return null;
|
|
1093
|
-
return parseInteger(value, options);
|
|
1094
|
-
}
|
|
1095
1024
|
|
|
1096
1025
|
//#endregion
|
|
1097
1026
|
//#region src/commands/context.ts
|
|
@@ -1252,20 +1181,20 @@ async function loadServerInfo(getResolvedConfig) {
|
|
|
1252
1181
|
};
|
|
1253
1182
|
}
|
|
1254
1183
|
const NO_OP_ENFORCER = async () => {};
|
|
1255
|
-
const
|
|
1184
|
+
const NO_PROBE_DATA_WARNING = "Could not detect Metabase server version. Proceeding without preflight check; failures may produce confusing errors. Run `mb auth list` (or `mb auth login`) to populate the version cache.";
|
|
1256
1185
|
function createPreflightEnforcer(required, getServerInfo, skip) {
|
|
1257
1186
|
if (required === null || skip || isPreflightSkipped() || isBaseline(required)) return NO_OP_ENFORCER;
|
|
1258
1187
|
let done = false;
|
|
1259
1188
|
return async () => {
|
|
1260
1189
|
if (done) return;
|
|
1261
1190
|
done = true;
|
|
1262
|
-
const info = await getServerInfo()
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
if (failure.reason === "unknown-version") {
|
|
1266
|
-
warn(failure.detail + PROBE_HINT);
|
|
1191
|
+
const info = await getServerInfo();
|
|
1192
|
+
if (info === null) {
|
|
1193
|
+
warn(NO_PROBE_DATA_WARNING);
|
|
1267
1194
|
return;
|
|
1268
1195
|
}
|
|
1196
|
+
const failure = checkCapabilities(info, required);
|
|
1197
|
+
if (failure === null || failure.reason === "unknown-version") return;
|
|
1269
1198
|
throw new CapabilityError(failure);
|
|
1270
1199
|
};
|
|
1271
1200
|
}
|
|
@@ -1294,4 +1223,4 @@ function buildConfigFlags(ctx) {
|
|
|
1294
1223
|
}
|
|
1295
1224
|
|
|
1296
1225
|
//#endregion
|
|
1297
|
-
export { DEFAULT_PROFILE, HttpError, ParsedVersionSchema, ProbedUser, ProfileLastFailure, TokenFeatures, USER_AGENT,
|
|
1226
|
+
export { DEFAULT_PROFILE, HttpError, ParsedVersionSchema, ProbedUser, ProfileLastFailure, TokenFeatures, USER_AGENT, clearProfile, combineAborts, createClient, defineMetabaseCommand, explicitProfileName, keyringFallbackWarning, listProfileRecords, normalizeUrl, originOnly, parseCsv, parseEnum, parseEnumCsv, parseInteger, parseJson, parseJsonOrPlain, probeServer, readEnvCredentials, readProfile, readProfileRecord, resolveProfileName, throwIfAborted, writeProbeFailure, writeProbeResult, writeProfile };
|
|
@@ -1,11 +1,10 @@
|
|
|
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 "./
|
|
7
|
-
import {
|
|
8
|
-
import { Table, TableCompact, tableView } from "./table-C7a5V6Zn.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 "./field-MGxpNQUH.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-DBwNYb4Y.mjs";
|
|
7
|
+
import { Table, TableCompact, tableView } from "./table-CkWja2UH.mjs";
|
|
9
8
|
import { z } from "zod";
|
|
10
9
|
|
|
11
10
|
//#region src/commands/db/schema-tables.ts
|
|
@@ -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 { z } from "zod";
|
|
8
7
|
|
|
9
8
|
//#region src/commands/db/schemas.ts
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand, parseEnumCsv } from "./runtime-
|
|
4
|
-
import "./capabilities-
|
|
5
|
-
import {
|
|
6
|
-
import { parseId } from "./parse-id-lk_K-CEF.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseEnumCsv } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { renderList } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-DBwNYb4Y.mjs";
|
|
7
6
|
import { z } from "zod";
|
|
8
7
|
|
|
9
8
|
//#region src/domain/search.ts
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/segment/index.ts
|
|
4
|
+
var segment_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "segment",
|
|
7
|
+
description: "Manage Metabase segments"
|
|
8
|
+
},
|
|
9
|
+
subCommands: {
|
|
10
|
+
list: () => import("./list-BUpOvQsd.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-D-3tOuWQ.mjs").then((mod) => mod.default),
|
|
12
|
+
create: () => import("./create-Bxkik5Fs.mjs").then((mod) => mod.default),
|
|
13
|
+
update: () => import("./update-CgpgyDjd.mjs").then((mod) => mod.default),
|
|
14
|
+
archive: () => import("./archive-DEtOH_jf.mjs").then((mod) => mod.default)
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { segment_default as default };
|
|
@@ -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 { readBody } from "./body-DjdFxjpg.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-Br6irjpM.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DKLBPRhd.mjs";
|
|
4
|
+
import { formatScalar, renderSummary } from "./capabilities-Dj3NgPHg.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BMyDvOjf.mjs";
|
|
8
7
|
import { SettingValue, settingValueView } from "./setting-oL97SNeO.mjs";
|
|
9
8
|
import { parseSettingKey, rethrowSettingError } from "./key-C2XG394c.mjs";
|
|
10
9
|
import { z } from "zod";
|
|
@@ -60,7 +59,8 @@ var set_default = defineMetabaseCommand({
|
|
|
60
59
|
key,
|
|
61
60
|
value
|
|
62
61
|
};
|
|
63
|
-
|
|
62
|
+
const message = value === null ? `Cleared "${key}".` : `Set "${key}" to ${formatScalar(value)}.`;
|
|
63
|
+
renderSummary(item, settingValueView, message, ctx);
|
|
64
64
|
}
|
|
65
65
|
});
|
|
66
66
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/setting/index.ts
|
|
4
|
+
var setting_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "setting",
|
|
7
|
+
description: "Inspect and update Metabase settings"
|
|
8
|
+
},
|
|
9
|
+
subCommands: {
|
|
10
|
+
list: () => import("./list-BqTdYtOW.mjs").then((m) => m.default),
|
|
11
|
+
get: () => import("./get-DYgLtHb8.mjs").then((m) => m.default),
|
|
12
|
+
set: () => import("./set-BJ8Rs-vI.mjs").then((m) => m.default)
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { setting_default as default };
|
|
@@ -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 { z } from "zod";
|
|
10
9
|
|
|
11
10
|
//#region src/domain/setup.ts
|
|
@@ -64,7 +63,7 @@ var setup_default = defineMetabaseCommand({
|
|
|
64
63
|
method: "POST",
|
|
65
64
|
body
|
|
66
65
|
});
|
|
67
|
-
|
|
66
|
+
renderSummary(result, setupResultView, "Metabase setup complete.", ctx);
|
|
68
67
|
}
|
|
69
68
|
});
|
|
70
69
|
|
|
@@ -1,10 +1,41 @@
|
|
|
1
|
-
import { ConfigError, isNotFoundError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { parseYamlResult } from "./yaml-YTQiYJ9s.mjs";
|
|
1
|
+
import { ConfigError, ValidationError, errorMessage, isNotFoundError } from "./command-augment-BH9qgQ5u.mjs";
|
|
3
2
|
import { z } from "zod";
|
|
4
3
|
import { closeSync, openSync, readFileSync, readSync, readdirSync, statSync } from "node:fs";
|
|
5
4
|
import { dirname, join, resolve } from "node:path";
|
|
6
5
|
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { YAMLParseError, parse } from "yaml";
|
|
7
7
|
|
|
8
|
+
//#region src/runtime/yaml.ts
|
|
9
|
+
function parseYamlResult(input, schema, opts = {}) {
|
|
10
|
+
const sourcePrefix = opts.source ? `${opts.source}: ` : "";
|
|
11
|
+
let raw;
|
|
12
|
+
try {
|
|
13
|
+
raw = parse(input);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
if (error instanceof YAMLParseError) return {
|
|
16
|
+
ok: false,
|
|
17
|
+
error: new ConfigError(`${sourcePrefix}invalid YAML: ${error.message}`)
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
ok: false,
|
|
21
|
+
error: new ConfigError(`${sourcePrefix}invalid YAML: ${errorMessage(error)}`)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const parsed = schema.safeParse(raw);
|
|
25
|
+
if (!parsed.success) return {
|
|
26
|
+
ok: false,
|
|
27
|
+
error: new ValidationError(`${sourcePrefix}value did not match expected schema`, {
|
|
28
|
+
source: opts.source ?? "<input>",
|
|
29
|
+
zodIssues: parsed.error.issues
|
|
30
|
+
})
|
|
31
|
+
};
|
|
32
|
+
return {
|
|
33
|
+
ok: true,
|
|
34
|
+
value: parsed.data
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
8
39
|
//#region src/core/skills.ts
|
|
9
40
|
const Frontmatter = z.object({
|
|
10
41
|
name: z.string().min(1),
|
|
@@ -8,9 +8,9 @@ var skills_default = defineCommand({
|
|
|
8
8
|
},
|
|
9
9
|
default: "list",
|
|
10
10
|
subCommands: {
|
|
11
|
-
list: () => import("./list-
|
|
12
|
-
get: () => import("./get-
|
|
13
|
-
path: () => import("./path-
|
|
11
|
+
list: () => import("./list-BlMpI88r.mjs").then((m) => m.default),
|
|
12
|
+
get: () => import("./get-DtG5ytvs.mjs").then((m) => m.default),
|
|
13
|
+
path: () => import("./path-DJ-DfUGC.mjs").then((m) => m.default)
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { defineCommand } from "citty";
|
|
2
|
+
|
|
3
|
+
//#region src/commands/snippet/index.ts
|
|
4
|
+
var snippet_default = defineCommand({
|
|
5
|
+
meta: {
|
|
6
|
+
name: "snippet",
|
|
7
|
+
description: "Manage Metabase native query snippets"
|
|
8
|
+
},
|
|
9
|
+
subCommands: {
|
|
10
|
+
list: () => import("./list-u7cmunGG.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-_JI4GiPa.mjs").then((mod) => mod.default),
|
|
12
|
+
create: () => import("./create-CbwFOL9h.mjs").then((mod) => mod.default),
|
|
13
|
+
update: () => import("./update-OZoOTnlY.mjs").then((mod) => mod.default),
|
|
14
|
+
archive: () => import("./archive-CTEybKPq.mjs").then((mod) => mod.default)
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
export { snippet_default as default };
|
|
@@ -1,12 +1,11 @@
|
|
|
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
|
|
8
|
-
import "./
|
|
9
|
-
import { gitSyncWaitFlags, parseWaitFlags } from "./wait-flags-Dzq9BGQY.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 "./parse-id-DBwNYb4Y.mjs";
|
|
6
|
+
import { REMOTE_SYNC_PATHS, SyncTask, formatSyncTask, pollSyncTask, throwIfFailedTask } from "./poll-task-DOvUDrgL.mjs";
|
|
7
|
+
import "./poll-DWkVceIk.mjs";
|
|
8
|
+
import { gitSyncWaitFlags, parseWaitFlags } from "./wait-flags-D1jNm0JK.mjs";
|
|
10
9
|
import { z } from "zod";
|
|
11
10
|
|
|
12
11
|
//#region src/commands/git-sync/stash.ts
|
|
@@ -89,7 +88,7 @@ var stash_default = defineMetabaseCommand({
|
|
|
89
88
|
message: kickoff.message,
|
|
90
89
|
task_id: kickoff.task_id
|
|
91
90
|
};
|
|
92
|
-
|
|
91
|
+
renderSummary(result$1, syncStashView, `Started stash to branch "${newBranch}" (task #${kickoff.task_id}).`, ctx);
|
|
93
92
|
return;
|
|
94
93
|
}
|
|
95
94
|
const final = await pollSyncTask(client, wait.schedule);
|
|
@@ -99,7 +98,9 @@ var stash_default = defineMetabaseCommand({
|
|
|
99
98
|
task_id: kickoff.task_id,
|
|
100
99
|
final
|
|
101
100
|
};
|
|
102
|
-
|
|
101
|
+
const succeeded = final === null || final.status === "successful";
|
|
102
|
+
const text = succeeded ? `Stashed Metabase state to branch "${newBranch}" (task #${kickoff.task_id}).` : formatSyncTask(final);
|
|
103
|
+
renderSummary(result, syncStashView, text, ctx);
|
|
103
104
|
throwIfFailedTask(final, "stash");
|
|
104
105
|
}
|
|
105
106
|
});
|