@metabase/cli 0.1.8 → 0.1.10
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 +89 -236
- package/dist/add-collection-D9wXgmRj.mjs +10 -0
- package/dist/{add-collection-CwrbKmC1.mjs → add-collection-DUqTrC5T.mjs} +5 -5
- package/dist/{archive-DqUtqRut.mjs → archive-0krZxAXq.mjs} +5 -6
- package/dist/{archive-ZnnJc2iT.mjs → archive-44EWiXud.mjs} +6 -7
- package/dist/{archive-BpKZsGAm.mjs → archive-B59Y7ajB.mjs} +6 -7
- package/dist/{archive-BO3DOWI4.mjs → archive-BEIyIsin.mjs} +5 -6
- package/dist/{archive-BzvqQd34.mjs → archive-BZfpjMir.mjs} +5 -6
- package/dist/{archive-BAjGIzhn.mjs → archive-DtE2H4A6.mjs} +6 -7
- package/dist/archive-_GMNY8wH.mjs +39 -0
- package/dist/auth-cFC5m69m.mjs +19 -0
- package/dist/{body-DDYKoyMt.mjs → body-BdRyuvU4.mjs} +2 -2
- package/dist/{branches-DjiGsjAz.mjs → branches-Jpv-FNds.mjs} +5 -6
- package/dist/{cancel-BwtDQ2MR.mjs → cancel-ChC4lFd4.mjs} +4 -5
- package/dist/{cancel-task-uJp18RvR.mjs → cancel-task-DyhIkNaL.mjs} +5 -6
- package/dist/{render-0_GsapXa.mjs → capabilities-7L9GVMd_.mjs} +45 -4
- package/dist/card-ClvGX6dQ.mjs +20 -0
- package/dist/{card-ezYiriML.mjs → card-DnIeMmUn.mjs} +18 -2
- package/dist/{cards-z68PANDD.mjs → cards-O-nKkQKP.mjs} +5 -6
- package/dist/cli.mjs +24 -34
- package/dist/{collection-Bcy8cWYH.mjs → collection-BPTlcFw5.mjs} +8 -2
- package/dist/collection-DjvowSJC.mjs +20 -0
- package/dist/collection-namespace-7724zUMx.mjs +12 -0
- package/dist/{create-BzK59YlR.mjs → create-B4f4Pldw.mjs} +11 -12
- package/dist/{create-4EAGYVyp.mjs → create-BbF9zVFP.mjs} +12 -10
- package/dist/{create-Dd_Gyg_F.mjs → create-BnFHcnlL.mjs} +7 -8
- package/dist/{create-GVfCQU3B.mjs → create-BuKx7kw6.mjs} +7 -8
- package/dist/{create-CQ4Vg4Ge.mjs → create-BxRsXQrm.mjs} +9 -10
- package/dist/{create-7JOWFxqu.mjs → create-CvYKJOcE.mjs} +10 -11
- package/dist/create-D45uFXlo.mjs +44 -0
- package/dist/create-DS52EhPd.mjs +52 -0
- package/dist/{create-DHWfmO2L.mjs → create-DeZ2x2Db.mjs} +9 -10
- package/dist/{create-branch-CdWGiREu.mjs → create-branch-KOWUIE72.mjs} +5 -6
- package/dist/{current-task-nPs-iCLi.mjs → current-task-ClcWPPMc.mjs} +5 -6
- package/dist/dashboard-BFeURTOw.mjs +21 -0
- package/dist/{database-BXiue1in.mjs → database-Dsv4QBs0.mjs} +20 -10
- package/dist/db-CSH1kwQr.mjs +22 -0
- package/dist/{delete-CJqLgr6w.mjs → delete-CX2VUA5R.mjs} +6 -7
- package/dist/{delete-Do1agSiL.mjs → delete-D68oS73R.mjs} +6 -7
- package/dist/{delete-runtime-uuYbd4k2.mjs → delete-runtime-CjFc69tS.mjs} +2 -2
- package/dist/{delete-table-ZiJDpMFT.mjs → delete-table-DLvL9mDA.mjs} +6 -7
- package/dist/{dirty-BnTG7w7v.mjs → dirty-1OrXpc7E.mjs} +5 -6
- package/dist/document-CcfiiV3b.mjs +100 -0
- package/dist/document-KdT_Xj6r.mjs +19 -0
- package/dist/{eid-CwQ_smOD.mjs → eid-CzLhHZMW.mjs} +6 -7
- package/dist/{error-CTVL5CdB.mjs → error-BWXBhqLW.mjs} +1 -1
- package/dist/{export-DR2cC4rL.mjs → export-B5z8w-xo.mjs} +7 -8
- package/dist/field-CTFnZI8G.mjs +18 -0
- package/dist/{fields-Ck31lDz9.mjs → fields-sC7pzmPX.mjs} +6 -7
- package/dist/{get-pO0wiy1e.mjs → get-4GEDd9YN.mjs} +5 -6
- package/dist/get-BC60bhel.mjs +36 -0
- package/dist/{get-CyG_P55z.mjs → get-BYw3xS0X.mjs} +6 -7
- package/dist/{get-C71ypFQk.mjs → get-Bo1FGyFs.mjs} +5 -6
- package/dist/{get-BNKsNCcx.mjs → get-ByZ4HR2T.mjs} +5 -6
- package/dist/{get-DxqzDKKK.mjs → get-C6n86-dS.mjs} +5 -6
- package/dist/{get-DyArILlF.mjs → get-CHb6J908.mjs} +5 -6
- package/dist/{get-F338MOK-.mjs → get-DLwb_gUh.mjs} +5 -6
- package/dist/{get-CICzGFSW.mjs → get-DTHLETau.mjs} +6 -7
- package/dist/{get-BFJ3VBPa.mjs → get-Dl62Fy6Y.mjs} +5 -6
- package/dist/{get-BZiu-u-9.mjs → get-Fn9WkNhS.mjs} +7 -8
- package/dist/{get-GWRprk7k.mjs → get-ZesERdyk.mjs} +5 -7
- package/dist/{get-BPOd0Rm8.mjs → get-lcX52Skc.mjs} +5 -6
- package/dist/{get-DauAF3sm.mjs → get-reSMTfQi.mjs} +5 -6
- package/dist/{get-run-DhM_PyVy.mjs → get-run-CpCbHJad.mjs} +5 -6
- package/dist/git-sync-C2vib8rx.mjs +28 -0
- package/dist/{has-remote-changes-Ca0exJmb.mjs → has-remote-changes-CPz_-uxd.mjs} +5 -6
- package/dist/{import-DjclIzGP.mjs → import-DaWgprK6.mjs} +7 -8
- package/dist/is-dirty-Bb0Rtj7x.mjs +9 -0
- package/dist/{is-dirty-Cke0a1ie.mjs → is-dirty-DZlI7lQx.mjs} +4 -4
- package/dist/{items-BSpapmCU.mjs → items-hgbRYsYD.mjs} +7 -8
- package/dist/{list-BI1PfPjn.mjs → list-36H-dvJZ.mjs} +5 -6
- package/dist/list-B9J3ujwn.mjs +32 -0
- package/dist/{list-BRXGDSMo.mjs → list-BGerkRHH.mjs} +5 -6
- package/dist/{list-CEE9yKNp.mjs → list-BWv5y307.mjs} +4 -5
- package/dist/{list-V5IuMr_5.mjs → list-BgHESP7b.mjs} +4 -5
- package/dist/{list-DWWGcUTg.mjs → list-CCZnH2-Z.mjs} +5 -7
- package/dist/{list-Fjjtpghb.mjs → list-CGdOC9zX.mjs} +6 -7
- package/dist/{list-DmO4ADQq.mjs → list-CKeVS1IZ.mjs} +4 -5
- package/dist/{list-D1qhCQn0.mjs → list-Cd2nOCAx.mjs} +6 -7
- package/dist/{list-fIV-P6wP.mjs → list-D9EuxFHO.mjs} +4 -5
- package/dist/{list-Br77Mw6U.mjs → list-DBlsRSpZ.mjs} +5 -6
- package/dist/{list-bVlCwg8g.mjs → list-DO8T-nmF.mjs} +4 -5
- package/dist/{list-Brt4oKO7.mjs → list-DOVX3vCb.mjs} +6 -7
- package/dist/{list-DUyWON1F.mjs → list-kath_2cX.mjs} +4 -5
- package/dist/{login-BJGhZLgZ.mjs → login-BzrAGJfu.mjs} +9 -10
- package/dist/{logout-BAGLqtnV.mjs → logout-CKBiltoS.mjs} +4 -5
- package/dist/{manifest-BNh0Lw6p.mjs → manifest-BPHqF5LY.mjs} +1 -2
- package/dist/measure-Dw1QpRZa.mjs +19 -0
- package/dist/{metadata-B-GOcWqL.mjs → metadata-BcGcUEVJ.mjs} +6 -7
- package/dist/{metadata-DJAdsOoh.mjs → metadata-BjOrKtnv.mjs} +7 -8
- package/dist/{parse-id-D1LTTt9L.mjs → parse-id--iVTCKSo.mjs} +1 -1
- package/dist/{path-D5kX-msX.mjs → path-LgGU6Bd0.mjs} +4 -6
- package/dist/{poll-DxpnK1wW.mjs → poll-BucRFJT-.mjs} +1 -1
- package/dist/{poll-task-D8mG49IN.mjs → poll-task-DTzKB3T3.mjs} +2 -2
- package/dist/{preflight-Df_FqJ6o.mjs → preflight-CzqVX0PP.mjs} +3 -3
- package/dist/{query-zWFRDH3T.mjs → query-BVZkK6Qk.mjs} +7 -8
- package/dist/{query-OIuumiXN.mjs → query-DG_jygDF.mjs} +11 -12
- package/dist/{query-result-ABPLz6I4.mjs → query-result-B4kTRid7.mjs} +1 -1
- package/dist/{remove-collection-BxmiXWKz.mjs → remove-collection-HdeAfLyi.mjs} +7 -8
- package/dist/{rescan-values-M7g81KIl.mjs → rescan-values-hWubCruZ.mjs} +8 -11
- package/dist/run-C1-lDmQF.mjs +136 -0
- package/dist/{runs-CqfJIuh_.mjs → runs-Q6DYQyqj.mjs} +6 -7
- package/dist/{runtime-B40L_bj8.mjs → runtime-colqvhLf.mjs} +11 -78
- package/dist/{schema-tables-CjBRF0_0.mjs → schema-tables-BEastV_8.mjs} +6 -7
- package/dist/{schemas-GIIbek2O.mjs → schemas-CgawwI_k.mjs} +4 -5
- package/dist/{search-h78uOYec.mjs → search-BWo7xSPP.mjs} +4 -5
- package/dist/segment-DMuYvFjg.mjs +19 -0
- package/dist/{set-BRDxcLcQ.mjs → set-7Nm2ZTb_.mjs} +7 -8
- package/dist/{setting-mKzZJpQY.mjs → setting-DSGXJehQ.mjs} +3 -3
- package/dist/{setup-WTIT2WbM.mjs → setup-aJLGLrIT.mjs} +6 -7
- package/dist/{skills-BkregMyb.mjs → skills-CY_FmaPo.mjs} +33 -2
- package/dist/skills-Q2AFsYvc.mjs +18 -0
- package/dist/snippet-Df2TrP7-.mjs +19 -0
- package/dist/{stash-DxoAJzcK.mjs → stash-DPQ0c-Cd.mjs} +7 -8
- package/dist/{status-B1dc3bbQ.mjs → status-CvAATvV0.mjs} +4 -5
- package/dist/{status-D0Ukfodl.mjs → status-CvKPrV5X.mjs} +6 -7
- package/dist/{summary-3qOMUcEX.mjs → summary-CeOnoOq2.mjs} +5 -6
- package/dist/sync-schema-aOPBc3CY.mjs +55 -0
- package/dist/{table-qDD2kApF.mjs → table-CkWja2UH.mjs} +1 -1
- package/dist/table-pK4OkVtL.mjs +19 -0
- package/dist/{transform-BKahefz_.mjs → transform--dviwMA1.mjs} +1 -0
- package/dist/transform-D60veFH8.mjs +24 -0
- package/dist/transform-job-DXt5LsrY.mjs +19 -0
- package/dist/{tree-DsnIPFyE.mjs → tree-MOQOBeAP.mjs} +4 -5
- package/dist/update-57uxZWcR.mjs +52 -0
- package/dist/{update-CLsqoEJ8.mjs → update-B6mg3AZD.mjs} +8 -9
- package/dist/{update-CZEd_Eej.mjs → update-BD9xkglP.mjs} +9 -10
- package/dist/{update-BEtl9LpG.mjs → update-BRrnfG0q.mjs} +8 -9
- package/dist/{update-DPouQi4U.mjs → update-BWyCK8QV.mjs} +13 -11
- package/dist/{update-DWn-nLPo.mjs → update-Bj9s0ri8.mjs} +8 -9
- package/dist/{update-BsgHRoZ8.mjs → update-BkMWBzvk.mjs} +11 -12
- package/dist/{update-Baya6OkO.mjs → update-CitS-QRN.mjs} +12 -13
- package/dist/{update-BRLcnSwK.mjs → update-DfNKr_vS.mjs} +10 -11
- package/dist/{update-UaPqSfPN.mjs → update-Dri4Zg2H.mjs} +10 -11
- package/dist/{update-dashcard-DK9X91ha.mjs → update-dashcard-D_-ura3Y.mjs} +8 -9
- package/dist/{upgrade-UqdvTikR.mjs → upgrade-CFkZ4USY.mjs} +34 -7
- package/dist/{uuid-BWCaWG4O.mjs → uuid-DpinhSxA.mjs} +3 -4
- package/dist/{validate-dPEOnOf8.mjs → validate-B62TRDGV.mjs} +1 -1
- package/dist/{validate-query-CYvOP8Ld.mjs → validate-query-BpiN1CFu.mjs} +2 -2
- package/dist/{values-D_wycrcr.mjs → values-BSS4DRxk.mjs} +5 -6
- package/dist/{verify-D7hb6VMy.mjs → verify-B_A7v8TY.mjs} +1 -1
- package/dist/{wait-B5IpNFCG.mjs → wait-D3iSnjMM.mjs} +6 -7
- package/dist/{wait-flags-CNIeSq0_.mjs → wait-flags-_LnHOeBA.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +19 -32
- package/skill-data/document/SKILL.md +162 -0
- package/skill-data/git-sync/SKILL.md +8 -63
- package/skill-data/mbql/SKILL.md +95 -28
- package/skill-data/mbql/references/operators.md +13 -13
- package/skill-data/transform/SKILL.md +18 -7
- package/skills/metabase-cli/SKILL.md +1 -1
- package/dist/add-collection-DxtuNxeP.mjs +0 -11
- package/dist/auth-B9B4pUaH.mjs +0 -19
- package/dist/capabilities-7e9MgquN.mjs +0 -29
- package/dist/card-D54unw6r.mjs +0 -20
- package/dist/collection-B5kIKRTL.mjs +0 -20
- package/dist/create-6XE7GYxk.mjs +0 -45
- package/dist/create-C8gA-XP2.mjs +0 -54
- package/dist/credentials-CFA9iGZG.mjs +0 -88
- package/dist/dashboard-lw6IFfOs.mjs +0 -21
- package/dist/database-BPT6BrmF.mjs +0 -17
- package/dist/db-CBCj8sBg.mjs +0 -22
- package/dist/delete-CiV6f69N.mjs +0 -104
- package/dist/deprovision-C-qEnh-P.mjs +0 -67
- package/dist/docker-B-QQWThD.mjs +0 -515
- package/dist/field-DJmQ2pul.mjs +0 -18
- package/dist/git-sync-rmjYOGFK.mjs +0 -28
- package/dist/is-dirty-DFGgGLDi.mjs +0 -10
- package/dist/license-j0tDQLKI.mjs +0 -17
- package/dist/list-evetBTcH.mjs +0 -36
- package/dist/logs-jx5b_YDk.mjs +0 -60
- package/dist/measure-BfgxqewH.mjs +0 -19
- package/dist/parse-schemas-DDK9nXuh.mjs +0 -12
- package/dist/process-CM7Uu5q_.mjs +0 -105
- package/dist/provision-BJd6zO1D.mjs +0 -83
- package/dist/ps-CpyHEvv7.mjs +0 -11
- package/dist/ps-dEqRGeB3.mjs +0 -80
- package/dist/remove-BNQ1c6hB.mjs +0 -64
- package/dist/run-DTsx8bLb.mjs +0 -96
- package/dist/segment-CoElN2b-.mjs +0 -19
- package/dist/set-Dclba9xF.mjs +0 -68
- package/dist/skills-tMYd5d9v.mjs +0 -18
- package/dist/snippet-B84H3tfp.mjs +0 -19
- package/dist/start-B7ByBicB.mjs +0 -414
- package/dist/status-DAzD1Cn_.mjs +0 -34
- package/dist/stop-Cvexagxh.mjs +0 -87
- package/dist/sync-schema-CrmVX1cy.mjs +0 -44
- package/dist/table-B0fRQv91.mjs +0 -19
- package/dist/transform-K_kp6Rdm.mjs +0 -24
- package/dist/transform-job-CuNN8zgv.mjs +0 -19
- package/dist/update-hiJdbbsb.mjs +0 -78
- package/dist/url-LMJZRDv4.mjs +0 -56
- package/dist/wait-DHjXk3jD.mjs +0 -19
- package/dist/workspace-Bt8n3ojY.mjs +0 -25
- package/dist/workspace-D8HtUN0y.mjs +0 -72
- package/dist/workspace-credentials-8CBMQJFz.mjs +0 -100
- package/dist/yaml-Gv6wRFMF.mjs +0 -43
- package/skill-data/workspace/SKILL.md +0 -390
- /package/dist/{body-flags-D7q87Btw.mjs → body-flags-D78h_-Ua.mjs} +0 -0
- /package/dist/{dashboard-B4bn3z6t.mjs → dashboard-FY5UzJ_Z.mjs} +0 -0
- /package/dist/{field-E0IBy4Uw.mjs → field-MGxpNQUH.mjs} +0 -0
- /package/dist/{input-cMSEqISy.mjs → input-xewHccej.mjs} +0 -0
- /package/dist/{key-vkNkH82H.mjs → key-y4TtxKwU.mjs} +0 -0
- /package/dist/{measure-Bt3InQsA.mjs → measure-COGAoZpo.mjs} +0 -0
- /package/dist/{paginate-BexjkjbY.mjs → paginate-Dfm9eO9A.mjs} +0 -0
- /package/dist/{parse-enum-CrEWOhuY.mjs → parse-enum-Dr7ACrTR.mjs} +0 -0
- /package/dist/{parse-ref-DKag6a6I.mjs → parse-ref-BiETXmvm.mjs} +0 -0
- /package/dist/{prompt-CFKoys7k.mjs → prompt-u4WhE4T5.mjs} +0 -0
- /package/dist/{render-khznBlla.mjs → render-BQHJhSP1.mjs} +0 -0
- /package/dist/{revision-message-flag-DY29-cgz.mjs → revision-message-flag-Bo-Kvv6F.mjs} +0 -0
- /package/dist/{segment-DhBmcr_E.mjs → segment-d-708KKO.mjs} +0 -0
- /package/dist/{setting-BzCng1Ub.mjs → setting-CSJvi1-6.mjs} +0 -0
- /package/dist/{snippet-bi_0XbNT.mjs → snippet-BZvo05ua.mjs} +0 -0
- /package/dist/{transform-job-DjhoJbiV.mjs → transform-job-n8W6tLqF.mjs} +0 -0
|
@@ -1,10 +1,9 @@
|
|
|
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 { REMOTE_SYNC_PATHS } from "./poll-task-
|
|
7
|
-
import "./poll-DxpnK1wW.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderList } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./poll-BucRFJT-.mjs";
|
|
6
|
+
import { REMOTE_SYNC_PATHS } from "./poll-task-DTzKB3T3.mjs";
|
|
8
7
|
import { z } from "zod";
|
|
9
8
|
|
|
10
9
|
//#region src/commands/git-sync/branches.ts
|
|
@@ -1,9 +1,8 @@
|
|
|
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 { parseId } from "./parse-id-D1LTTt9L.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import { parseId } from "./parse-id--iVTCKSo.mjs";
|
|
7
6
|
import { z } from "zod";
|
|
8
7
|
|
|
9
8
|
//#region src/commands/transform/cancel.ts
|
|
@@ -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 { REMOTE_SYNC_PATHS, SyncTask, syncTaskView } from "./poll-task-
|
|
7
|
-
import "./poll-DxpnK1wW.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./poll-BucRFJT-.mjs";
|
|
6
|
+
import { REMOTE_SYNC_PATHS, SyncTask, syncTaskView } from "./poll-task-DTzKB3T3.mjs";
|
|
8
7
|
|
|
9
8
|
//#region src/commands/git-sync/cancel-task.ts
|
|
10
9
|
var cancel_task_default = defineMetabaseCommand({
|
|
@@ -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;
|
|
@@ -160,7 +178,7 @@ function renderList(envelope, view, opts) {
|
|
|
160
178
|
if (capped.truncated !== void 0) warn(listTruncationNotice(capped.truncated.bytes));
|
|
161
179
|
}
|
|
162
180
|
function renderProjectedTable(envelope, view, fields, maxBytes) {
|
|
163
|
-
const projectedItems = envelope.data
|
|
181
|
+
const projectedItems = projectListItems(envelope.data, view, false, fields);
|
|
164
182
|
const capped = capListEnvelope({
|
|
165
183
|
...envelope,
|
|
166
184
|
data: projectedItems
|
|
@@ -169,8 +187,23 @@ function renderProjectedTable(envelope, view, fields, maxBytes) {
|
|
|
169
187
|
process.stdout.write(renderRows(fields, rows) + "\n");
|
|
170
188
|
if (capped.truncated !== void 0) warn(listTruncationNotice(capped.truncated.bytes));
|
|
171
189
|
}
|
|
190
|
+
function projectListItems(items, view, full, fields) {
|
|
191
|
+
try {
|
|
192
|
+
return items.map((item) => applyProjection(item, view, full, fields));
|
|
193
|
+
} catch (error) {
|
|
194
|
+
throw enrichListFieldPathError(error, fields);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function enrichListFieldPathError(error, fields) {
|
|
198
|
+
if (fields === void 0 || !(error instanceof ConfigError) || !error.message.startsWith("unknown field path")) return error;
|
|
199
|
+
const prefix = "data.";
|
|
200
|
+
const culprit = fields.find((field) => field === "data" || field.startsWith(prefix));
|
|
201
|
+
if (culprit === void 0) return error;
|
|
202
|
+
const suggestion = culprit.startsWith(prefix) ? culprit.slice(prefix.length) : "<field>";
|
|
203
|
+
return new ConfigError(`${error.message} — on list commands --fields paths are relative to each item in \`data\`, not the envelope. Drop the \`data.\` prefix (e.g. use \`${suggestion}\` instead of \`${culprit}\`).`);
|
|
204
|
+
}
|
|
172
205
|
function renderJsonEnvelope(envelope, view, opts) {
|
|
173
|
-
const projectedItems = envelope.data
|
|
206
|
+
const projectedItems = projectListItems(envelope.data, view, opts.full, opts.fields);
|
|
174
207
|
const projectedEnvelope = {
|
|
175
208
|
...envelope,
|
|
176
209
|
data: projectedItems
|
|
@@ -207,4 +240,12 @@ function assertItemWithinMaxBytes(body, maxBytes) {
|
|
|
207
240
|
}
|
|
208
241
|
|
|
209
242
|
//#endregion
|
|
210
|
-
|
|
243
|
+
//#region src/runtime/capabilities.ts
|
|
244
|
+
const Capabilities = z.object({
|
|
245
|
+
minVersion: z.number(),
|
|
246
|
+
tokenFeature: z.string().optional()
|
|
247
|
+
});
|
|
248
|
+
const BASELINE_CAPABILITIES = Object.freeze({ minVersion: 58 });
|
|
249
|
+
|
|
250
|
+
//#endregion
|
|
251
|
+
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-CGdOC9zX.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-BYw3xS0X.mjs").then((mod) => mod.default),
|
|
12
|
+
query: () => import("./query-BVZkK6Qk.mjs").then((mod) => mod.default),
|
|
13
|
+
create: () => import("./create-CvYKJOcE.mjs").then((mod) => mod.default),
|
|
14
|
+
update: () => import("./update-BkMWBzvk.mjs").then((mod) => mod.default),
|
|
15
|
+
archive: () => import("./archive-44EWiXud.mjs").then((mod) => mod.default)
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { card_default as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FieldBaseType, FieldSemanticType } from "./field-
|
|
1
|
+
import { FieldBaseType, FieldSemanticType } from "./field-MGxpNQUH.mjs";
|
|
2
2
|
import { z } from "zod";
|
|
3
3
|
|
|
4
4
|
//#region src/domain/card.ts
|
|
@@ -120,8 +120,24 @@ const CardQueryResult = z.object({
|
|
|
120
120
|
error: z.string().nullable().optional(),
|
|
121
121
|
error_type: z.string().nullable().optional()
|
|
122
122
|
}).loose();
|
|
123
|
+
const QueryColumnCompact = QueryColumn.pick({
|
|
124
|
+
name: true,
|
|
125
|
+
display_name: true,
|
|
126
|
+
base_type: true,
|
|
127
|
+
semantic_type: true
|
|
128
|
+
}).strip();
|
|
129
|
+
const CardQueryDataCompact = z.object({
|
|
130
|
+
rows: z.array(z.unknown()),
|
|
131
|
+
cols: z.array(QueryColumnCompact)
|
|
132
|
+
}).strip();
|
|
133
|
+
const CardQueryResultCompact = CardQueryResult.pick({
|
|
134
|
+
status: true,
|
|
135
|
+
row_count: true,
|
|
136
|
+
error: true,
|
|
137
|
+
error_type: true
|
|
138
|
+
}).strip().extend({ data: CardQueryDataCompact.optional() });
|
|
123
139
|
const cardQueryView = {
|
|
124
|
-
compactPick:
|
|
140
|
+
compactPick: CardQueryResultCompact,
|
|
125
141
|
tableColumns: [{
|
|
126
142
|
key: "status",
|
|
127
143
|
label: "Status"
|
|
@@ -1,10 +1,9 @@
|
|
|
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 { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-B4bn3z6t.mjs";
|
|
2
|
+
import { connectionFlags, listEnvelopeSchema, outputFlags, profileFlag, wrapList } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderList } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import { parseId } from "./parse-id--iVTCKSo.mjs";
|
|
6
|
+
import { DashboardDetail, DashcardCompact, dashcardView } from "./dashboard-FY5UzJ_Z.mjs";
|
|
8
7
|
|
|
9
8
|
//#region src/commands/dashboard/cards.ts
|
|
10
9
|
const DashcardListEnvelope = listEnvelopeSchema(DashcardCompact);
|
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-BWXBhqLW.mjs";
|
|
4
4
|
import { defineCommand, renderUsage, runMain } from "citty";
|
|
5
5
|
|
|
6
6
|
//#region src/commands/global-flags.ts
|
|
@@ -58,29 +58,29 @@ 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
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
setup: () => import("./setup-
|
|
75
|
-
snippet: () => import("./snippet-
|
|
76
|
-
segment: () => import("./segment-
|
|
77
|
-
measure: () => import("./measure-
|
|
78
|
-
eid: () => import("./eid-
|
|
79
|
-
query: () => import("./query-
|
|
80
|
-
uuid: () => import("./uuid-
|
|
81
|
-
upgrade: () => import("./upgrade-
|
|
82
|
-
skills: () => import("./skills-
|
|
83
|
-
__manifest: () => import("./manifest-
|
|
61
|
+
auth: () => import("./auth-cFC5m69m.mjs").then((mod) => mod.default),
|
|
62
|
+
db: () => import("./db-CSH1kwQr.mjs").then((mod) => mod.default),
|
|
63
|
+
table: () => import("./table-pK4OkVtL.mjs").then((mod) => mod.default),
|
|
64
|
+
field: () => import("./field-CTFnZI8G.mjs").then((mod) => mod.default),
|
|
65
|
+
card: () => import("./card-ClvGX6dQ.mjs").then((mod) => mod.default),
|
|
66
|
+
dashboard: () => import("./dashboard-BFeURTOw.mjs").then((mod) => mod.default),
|
|
67
|
+
collection: () => import("./collection-DjvowSJC.mjs").then((mod) => mod.default),
|
|
68
|
+
document: () => import("./document-KdT_Xj6r.mjs").then((mod) => mod.default),
|
|
69
|
+
transform: () => import("./transform-D60veFH8.mjs").then((mod) => mod.default),
|
|
70
|
+
"transform-job": () => import("./transform-job-DXt5LsrY.mjs").then((mod) => mod.default),
|
|
71
|
+
setting: () => import("./setting-DSGXJehQ.mjs").then((mod) => mod.default),
|
|
72
|
+
search: () => import("./search-BWo7xSPP.mjs").then((mod) => mod.default),
|
|
73
|
+
"git-sync": () => import("./git-sync-C2vib8rx.mjs").then((mod) => mod.default),
|
|
74
|
+
setup: () => import("./setup-aJLGLrIT.mjs").then((mod) => mod.default),
|
|
75
|
+
snippet: () => import("./snippet-Df2TrP7-.mjs").then((mod) => mod.default),
|
|
76
|
+
segment: () => import("./segment-DMuYvFjg.mjs").then((mod) => mod.default),
|
|
77
|
+
measure: () => import("./measure-Dw1QpRZa.mjs").then((mod) => mod.default),
|
|
78
|
+
eid: () => import("./eid-CzLhHZMW.mjs").then((mod) => mod.default),
|
|
79
|
+
query: () => import("./query-DG_jygDF.mjs").then((mod) => mod.default),
|
|
80
|
+
uuid: () => import("./uuid-DpinhSxA.mjs").then((mod) => mod.default),
|
|
81
|
+
upgrade: () => import("./upgrade-CFkZ4USY.mjs").then((mod) => mod.default),
|
|
82
|
+
skills: () => import("./skills-Q2AFsYvc.mjs").then((mod) => mod.default),
|
|
83
|
+
__manifest: () => import("./manifest-BPHqF5LY.mjs").then((mod) => mod.createManifestCommand(main))
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
var main_default = main;
|
|
@@ -97,7 +97,6 @@ const OPTIONS_HEADER = "OPTIONS";
|
|
|
97
97
|
const LINE_PREFIX = " ";
|
|
98
98
|
const COLUMN_GAP = " ";
|
|
99
99
|
const COMMAND_PLACEHOLDER = "<command> [options]";
|
|
100
|
-
const MANIFEST_COMMAND = "__manifest";
|
|
101
100
|
const CLI_NAME = "mb";
|
|
102
101
|
const HELP_FLAG_SPEC = "-h, --help";
|
|
103
102
|
const HELP_FLAG_DESCRIPTION = "Show help for this command";
|
|
@@ -111,7 +110,6 @@ async function showUsage(cmd, parent, breadcrumb) {
|
|
|
111
110
|
const cittyName = parentMeta?.name ? `${parentMeta.name} ${cmdName}` : cmdName;
|
|
112
111
|
const hasSubCommands = Boolean(cmd.subCommands);
|
|
113
112
|
const isRoot = parent === void 0 && hasSubCommands;
|
|
114
|
-
const isManifest = cmdName === MANIFEST_COMMAND;
|
|
115
113
|
const augment = getMetabaseAugment(cmd);
|
|
116
114
|
const details = augment?.details ?? null;
|
|
117
115
|
const examples = augment?.examples ?? [];
|
|
@@ -124,7 +122,6 @@ async function showUsage(cmd, parent, breadcrumb) {
|
|
|
124
122
|
const sections = [body];
|
|
125
123
|
if (examples.length > 0) sections.push(renderExamples(examples));
|
|
126
124
|
if (isRoot) sections.push(GETTING_STARTED_HINT);
|
|
127
|
-
if (!isManifest) sections.push(renderSchemaHint());
|
|
128
125
|
process.stdout.write(sections.join("\n\n") + "\n");
|
|
129
126
|
}
|
|
130
127
|
function transformBody(lines, rewrite) {
|
|
@@ -193,13 +190,6 @@ function renderExamples(examples) {
|
|
|
193
190
|
...examples.map((example) => `${LINE_PREFIX}${example}`)
|
|
194
191
|
].join("\n");
|
|
195
192
|
}
|
|
196
|
-
function renderSchemaHint() {
|
|
197
|
-
return [
|
|
198
|
-
"SCHEMA",
|
|
199
|
-
"",
|
|
200
|
-
`${LINE_PREFIX}${CLI_NAME} ${MANIFEST_COMMAND} # machine-readable command manifest (flags, output, examples)`
|
|
201
|
-
].join("\n");
|
|
202
|
-
}
|
|
203
193
|
async function walkCommandPath(root, rawArgs) {
|
|
204
194
|
const rootMeta = await resolveCitty(root.meta);
|
|
205
195
|
const segments = rootMeta?.name === void 0 ? [] : [rootMeta.name];
|
|
@@ -11,7 +11,13 @@ const CollectionType = z.enum([
|
|
|
11
11
|
"library-metrics",
|
|
12
12
|
"tenant-specific-root-collection"
|
|
13
13
|
]);
|
|
14
|
-
const CollectionNamespace = z.
|
|
14
|
+
const CollectionNamespace = z.enum([
|
|
15
|
+
"transforms",
|
|
16
|
+
"snippets",
|
|
17
|
+
"analytics",
|
|
18
|
+
"shared-tenant-collection",
|
|
19
|
+
"tenant-specific"
|
|
20
|
+
]);
|
|
15
21
|
const COLLECTION_ITEM_FILTER_MODELS = [
|
|
16
22
|
"card",
|
|
17
23
|
"dataset",
|
|
@@ -160,4 +166,4 @@ const CollectionCreateInput = z.object({
|
|
|
160
166
|
}).loose();
|
|
161
167
|
|
|
162
168
|
//#endregion
|
|
163
|
-
export { COLLECTION_ITEM_FILTER_MODELS, COLLECTION_PINNED_STATES, Collection, CollectionCompact, CollectionCreateInput, CollectionItem, CollectionItemCompact, CollectionItemFilterModel, CollectionPinnedState, CollectionTreeNode, collectionItemView, collectionView };
|
|
169
|
+
export { COLLECTION_ITEM_FILTER_MODELS, COLLECTION_PINNED_STATES, Collection, CollectionCompact, CollectionCreateInput, CollectionItem, CollectionItemCompact, CollectionItemFilterModel, CollectionNamespace, CollectionPinnedState, CollectionTreeNode, collectionItemView, collectionView };
|
|
@@ -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-36H-dvJZ.mjs").then((mod) => mod.default),
|
|
11
|
+
get: () => import("./get-reSMTfQi.mjs").then((mod) => mod.default),
|
|
12
|
+
items: () => import("./items-hgbRYsYD.mjs").then((mod) => mod.default),
|
|
13
|
+
tree: () => import("./tree-MOQOBeAP.mjs").then((mod) => mod.default),
|
|
14
|
+
create: () => import("./create-DS52EhPd.mjs").then((mod) => mod.default),
|
|
15
|
+
archive: () => import("./archive-BZfpjMir.mjs").then((mod) => mod.default)
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
export { collection_default as default };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ConfigError } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { HttpError } from "./runtime-colqvhLf.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/transform/collection-namespace.ts
|
|
5
|
+
const TRANSFORMS_NAMESPACE_HINT = "transforms can only be filed in a :transforms-namespace collection. Create one with `mb collection create --body '{\"name\":\"…\"}' --namespace transforms` and pass its id as collection_id, or omit collection_id to leave the transform uncollected.";
|
|
6
|
+
function enrichTransformCollectionError(error) {
|
|
7
|
+
if (error instanceof HttpError && error.status === 400 && /:transforms namespace/i.test(error.message)) return new ConfigError(`${error.message} — ${TRANSFORMS_NAMESPACE_HINT}`);
|
|
8
|
+
return error;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
export { enrichTransformCollectionError };
|
|
@@ -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 "./
|
|
12
|
-
import {
|
|
13
|
-
import { preflightDashcardCardReferences, wrapChainedDashboardWriteError } from "./preflight-Df_FqJ6o.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import "./field-MGxpNQUH.mjs";
|
|
7
|
+
import "./card-DnIeMmUn.mjs";
|
|
8
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
10
|
+
import "./validate-B62TRDGV.mjs";
|
|
11
|
+
import { Dashboard, DashboardCreateInput, DashboardDetail, dashboardView } from "./dashboard-FY5UzJ_Z.mjs";
|
|
12
|
+
import { preflightDashcardCardReferences, wrapChainedDashboardWriteError } from "./preflight-CzqVX0PP.mjs";
|
|
14
13
|
|
|
15
14
|
//#region src/commands/dashboard/create.ts
|
|
16
15
|
var create_default = defineMetabaseCommand({
|
|
@@ -1,14 +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 "./validate-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import "./validate-B62TRDGV.mjs";
|
|
9
|
+
import { TRANSFORM_SOURCE_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BpiN1CFu.mjs";
|
|
10
|
+
import { Transform, TransformCreateInput, transformView } from "./transform--dviwMA1.mjs";
|
|
11
|
+
import { enrichTransformCollectionError } from "./collection-namespace-7724zUMx.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/transform/create.ts
|
|
14
14
|
var create_default = defineMetabaseCommand({
|
|
@@ -41,6 +41,8 @@ var create_default = defineMetabaseCommand({
|
|
|
41
41
|
const created = await client.requestParsed(Transform, "/api/transform", {
|
|
42
42
|
method: "POST",
|
|
43
43
|
body
|
|
44
|
+
}).catch((error) => {
|
|
45
|
+
throw enrichTransformCollectionError(error);
|
|
44
46
|
});
|
|
45
47
|
renderSummary(created, transformView, `Created transform ${created.id} "${created.name}".`, ctx);
|
|
46
48
|
}
|
|
@@ -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-DjhoJbiV.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import { TransformJob, TransformJobCreateInput, transformJobView } from "./transform-job-n8W6tLqF.mjs";
|
|
10
9
|
|
|
11
10
|
//#region src/commands/transform-job/create.ts
|
|
12
11
|
var create_default = defineMetabaseCommand({
|
|
@@ -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-bi_0XbNT.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import { Snippet, SnippetCreateInput, snippetView } from "./snippet-BZvo05ua.mjs";
|
|
10
9
|
|
|
11
10
|
//#region src/commands/snippet/create.ts
|
|
12
11
|
var create_default = defineMetabaseCommand({
|
|
@@ -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 { Segment, SegmentCreateInput, segmentView } from "./segment-DhBmcr_E.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import "./validate-B62TRDGV.mjs";
|
|
9
|
+
import { SEGMENT_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BpiN1CFu.mjs";
|
|
10
|
+
import { Segment, SegmentCreateInput, segmentView } from "./segment-d-708KKO.mjs";
|
|
12
11
|
|
|
13
12
|
//#region src/commands/segment/create.ts
|
|
14
13
|
var create_default = defineMetabaseCommand({
|
|
@@ -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-CYvOP8Ld.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import "./field-MGxpNQUH.mjs";
|
|
7
|
+
import { Card, CardCreateInput, cardView } from "./card-DnIeMmUn.mjs";
|
|
8
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
10
|
+
import "./validate-B62TRDGV.mjs";
|
|
11
|
+
import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BpiN1CFu.mjs";
|
|
13
12
|
|
|
14
13
|
//#region src/commands/card/create.ts
|
|
15
14
|
var create_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import { Document, DocumentCreateInput, documentView } from "./document-CcfiiV3b.mjs";
|
|
9
|
+
|
|
10
|
+
//#region src/commands/document/create.ts
|
|
11
|
+
var create_default = defineMetabaseCommand({
|
|
12
|
+
meta: {
|
|
13
|
+
name: "create",
|
|
14
|
+
description: "Create a document"
|
|
15
|
+
},
|
|
16
|
+
capabilities: { minVersion: 58 },
|
|
17
|
+
args: {
|
|
18
|
+
...outputFlags,
|
|
19
|
+
...profileFlag,
|
|
20
|
+
...connectionFlags,
|
|
21
|
+
...bodyInputFlags
|
|
22
|
+
},
|
|
23
|
+
outputSchema: Document,
|
|
24
|
+
examples: [
|
|
25
|
+
"cat doc.json | mb document create",
|
|
26
|
+
"mb document create --file doc.json",
|
|
27
|
+
"mb document create --body '{\"name\":\"Notes\",\"document\":{\"type\":\"doc\",\"content\":[]}}'"
|
|
28
|
+
],
|
|
29
|
+
async run({ args, ctx, getClient }) {
|
|
30
|
+
const body = await readBody({
|
|
31
|
+
flag: args.body,
|
|
32
|
+
file: args.file
|
|
33
|
+
}, DocumentCreateInput);
|
|
34
|
+
const client = await getClient();
|
|
35
|
+
const created = await client.requestParsed(Document, "/api/document", {
|
|
36
|
+
method: "POST",
|
|
37
|
+
body
|
|
38
|
+
});
|
|
39
|
+
renderSummary(created, documentView, `Created document ${created.id} "${created.name}".`, ctx);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { create_default as default };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-BWXBhqLW.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-colqvhLf.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
|
|
5
|
+
import "./input-xewHccej.mjs";
|
|
6
|
+
import { readBody } from "./body-BdRyuvU4.mjs";
|
|
7
|
+
import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
|
|
8
|
+
import { parseEnumFlag } from "./parse-enum-Dr7ACrTR.mjs";
|
|
9
|
+
import { Collection, CollectionCreateInput, CollectionNamespace, collectionView } from "./collection-BPTlcFw5.mjs";
|
|
10
|
+
|
|
11
|
+
//#region src/commands/collection/create.ts
|
|
12
|
+
var create_default = defineMetabaseCommand({
|
|
13
|
+
meta: {
|
|
14
|
+
name: "create",
|
|
15
|
+
description: "Create a collection from a JSON spec"
|
|
16
|
+
},
|
|
17
|
+
details: "Body keys: `name` (required), `description`, `parent_id`, `authority_level`, `namespace`. Most collections use the default namespace (omit it). Pass `namespace: \"transforms\"` (or `--namespace transforms`) to create the kind of collection a transform's `collection_id` can point at — a regular collection is rejected there.",
|
|
18
|
+
capabilities: { minVersion: 58 },
|
|
19
|
+
args: {
|
|
20
|
+
...outputFlags,
|
|
21
|
+
...profileFlag,
|
|
22
|
+
...connectionFlags,
|
|
23
|
+
...bodyInputFlags,
|
|
24
|
+
namespace: {
|
|
25
|
+
type: "string",
|
|
26
|
+
description: `Collection namespace: ${CollectionNamespace.options.join("|")} (omit for a normal collection)`
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
outputSchema: Collection,
|
|
30
|
+
examples: [
|
|
31
|
+
"cat collection.json | mb collection create",
|
|
32
|
+
"mb collection create --file collection.json",
|
|
33
|
+
"mb collection create --body '{\"name\":\"My Collection\",\"parent_id\":4}'",
|
|
34
|
+
"mb collection create --body '{\"name\":\"ETL\"}' --namespace transforms"
|
|
35
|
+
],
|
|
36
|
+
async run({ args, ctx, getClient }) {
|
|
37
|
+
const body = await readBody({
|
|
38
|
+
flag: args.body,
|
|
39
|
+
file: args.file
|
|
40
|
+
}, CollectionCreateInput);
|
|
41
|
+
if (typeof args.namespace === "string" && args.namespace !== "") body.namespace = parseEnumFlag(args.namespace, CollectionNamespace, "namespace");
|
|
42
|
+
const client = await getClient();
|
|
43
|
+
const created = await client.requestParsed(Collection, "/api/collection", {
|
|
44
|
+
method: "POST",
|
|
45
|
+
body
|
|
46
|
+
});
|
|
47
|
+
renderSummary(created, collectionView, `Created collection ${created.id} "${created.name}".`, ctx);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { create_default as default };
|