@metabase/cli 0.1.18 → 0.2.1-alpha.bcm-ghy-4075-spawn-default-profile.eb120d1
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/README.md +283 -45
- package/dist/add-collection-CCpC-GUz.mjs +9 -0
- package/dist/{add-collection-CRZAFCZy.mjs → add-collection-CLXfrgp4.mjs} +4 -5
- package/dist/append-DMcxP1LM.mjs +42 -0
- package/dist/archive-4WqMsPWB.mjs +38 -0
- package/dist/{archive-De4yVEV8.mjs → archive-5inmbMDL.mjs} +5 -7
- package/dist/{archive-3mEhK9_H.mjs → archive-BggM_AuL.mjs} +5 -7
- package/dist/{archive-Z8ZM-ilB.mjs → archive-BmhehbS0.mjs} +8 -9
- package/dist/{archive-d74nDcp4.mjs → archive-BwIZzWGe.mjs} +5 -7
- package/dist/{archive-CFHYRF65.mjs → archive-DErhQn8A.mjs} +5 -7
- package/dist/archive-DTnz1suV.mjs +38 -0
- package/dist/{archive-C3RWdM-2.mjs → archive-Q1387APe.mjs} +7 -8
- package/dist/{archive-errg-EKw.mjs → archive-h-3H5b4K.mjs} +5 -7
- package/dist/auth-DzCAiArV.mjs +22 -0
- package/dist/{body-BS2s2zDl.mjs → body-5snfmiwR.mjs} +3 -3
- package/dist/{branches-mcyT7wI-.mjs → branches-PL170CYS.mjs} +5 -7
- package/dist/{cancel-B2l-i2NS.mjs → cancel-EFKcF5J_.mjs} +4 -6
- package/dist/{cancel-task-CugcIeIi.mjs → cancel-task-mFFx0d5m.mjs} +5 -7
- package/dist/capabilities-CiaAfUgX.mjs +684 -0
- package/dist/{card-DEmcRlNO.mjs → card-B8G5jQQT.mjs} +24 -18
- package/dist/card-BsfdXK0O.mjs +26 -0
- package/dist/{cards-BGkz5BeZ.mjs → cards-BI7zKb9M.mjs} +7 -8
- package/dist/cli.mjs +178 -29
- package/dist/collection-2h_by9Ue.mjs +23 -0
- package/dist/{collection-DrLpA1SO.mjs → collection-C52Ndi_O.mjs} +5 -3
- package/dist/{collection-namespace-BP_LJrAD.mjs → collection-namespace-uNA5WhLB.mjs} +2 -2
- package/dist/{create-Cztp5kES.mjs → create-BLD0YniB.mjs} +6 -7
- package/dist/create-BP8EIWrP.mjs +161 -0
- package/dist/{create-CkRFKtFG.mjs → create-BpizGzgQ.mjs} +8 -9
- package/dist/create-BxCsAdqc.mjs +45 -0
- package/dist/{create-DzyMvAVy.mjs → create-CBKT7SE_.mjs} +8 -9
- package/dist/{create-D8KA4zJA.mjs → create-CQ32FwVe.mjs} +11 -11
- package/dist/{create-YfGzANNB.mjs → create-CU3bYpsT.mjs} +8 -9
- package/dist/create-DAH24ltu.mjs +45 -0
- package/dist/{create-BOmmMSjF.mjs → create-DutkaD7P.mjs} +11 -12
- package/dist/{create-B4HAEEE0.mjs → create-FuZa4j1N.mjs} +8 -9
- package/dist/{create-wpvDXSSY.mjs → create-KveE3j3p.mjs} +12 -13
- package/dist/{create-DhrftYre.mjs → create-VrSowEbj.mjs} +14 -14
- package/dist/{create-CD9Rp8qs.mjs → create-acWKw4Y1.mjs} +14 -14
- package/dist/{create-branch-DsoMfx_2.mjs → create-branch-CP1Y4_El.mjs} +5 -7
- package/dist/{create-kWzqvTGR.mjs → create-xPfmI1Tu.mjs} +11 -12
- package/dist/csv-CZyYi0vi.mjs +58 -0
- package/dist/{current-task-WuKPZpZ6.mjs → current-task-BR4koo9z.mjs} +5 -7
- package/dist/dashboard-ARgJfamb.mjs +35 -0
- package/dist/{dashboard-DOplbKyQ.mjs → dashboard-BLihjDXg.mjs} +35 -15
- package/dist/{database-D9fftP-i.mjs → database-BOqzcexD.mjs} +2 -2
- package/dist/db-dbnxMPSR.mjs +27 -0
- package/dist/{delete-Buai0_e_.mjs → delete-BpL3vaaT.mjs} +6 -8
- package/dist/{delete-BCitmugk.mjs → delete-C5DqDwev.mjs} +6 -8
- package/dist/delete-DCDFLHFa.mjs +49 -0
- package/dist/delete-P2Qlsr_s.mjs +49 -0
- package/dist/{delete-CmGh0jo1.mjs → delete-ea_ns1uM.mjs} +6 -8
- package/dist/{delete-runtime-B0ha5QR4.mjs → delete-runtime-DdBn6poA.mjs} +2 -3
- package/dist/{delete-table-BOkYxdjA.mjs → delete-table-tM048btr.mjs} +6 -8
- package/dist/{dependencies-XZrEvHUA.mjs → dependencies-DdOTClO2.mjs} +5 -7
- package/dist/destroy-B51EPvOJ.mjs +168 -0
- package/dist/{dirty-B-5NDbG9.mjs → dirty-CEQYmhNF.mjs} +5 -7
- package/dist/{document-1W7NRaO_.mjs → document-D4zB-5a0.mjs} +20 -4
- package/dist/document-DR1FLOn9.mjs +22 -0
- package/dist/{eid-BCuJRv7a.mjs → eid-CtKGjAkz.mjs} +10 -11
- package/dist/embedding-CKdw8q7p.mjs +11 -0
- package/dist/events-C26DZ6yZ.mjs +44 -0
- package/dist/{export-Dod2gdyE.mjs → export-CippuWZJ.mjs} +5 -10
- package/dist/export-Cy2DFtR2.mjs +10 -0
- package/dist/field-CXDndCbB.mjs +21 -0
- package/dist/{field-CMY_LWUe.mjs → field-DsXTeqBy.mjs} +6 -4
- package/dist/{fields-B0yttrzR.mjs → fields-Xm_HVNcX.mjs} +6 -8
- package/dist/get-3O7hv4zv.mjs +67 -0
- package/dist/{get-D-pNrQGA.mjs → get-B0cq1uGy.mjs} +5 -7
- package/dist/{get-k6M5nGMC.mjs → get-B90bXbpw.mjs} +5 -7
- package/dist/{get-D7QMqPOK.mjs → get-BQBu2c94.mjs} +5 -7
- package/dist/{get-CfeYa0v5.mjs → get-BQz45IBF.mjs} +6 -7
- package/dist/get-BSfKWZNJ.mjs +35 -0
- package/dist/get-BdNC8WM8.mjs +38 -0
- package/dist/{get-DBY5esTW.mjs → get-Bj66bcuU.mjs} +5 -7
- package/dist/{get-BpZ81hX8.mjs → get-BrKqMM1d.mjs} +5 -7
- package/dist/{get-9p0Gt1c7.mjs → get-CjZWjRa5.mjs} +5 -7
- package/dist/{get-DISgP66L.mjs → get-CwGqARAf.mjs} +16 -9
- package/dist/{get-BkGh9BPd.mjs → get-D5crrFSf.mjs} +5 -7
- package/dist/{get-Dz7fcqoG.mjs → get-DTkvGu_J.mjs} +8 -9
- package/dist/{get-u5Uq9vms.mjs → get-DX2fp6BB.mjs} +4 -6
- package/dist/get-DYuJVlP-.mjs +35 -0
- package/dist/{get-DJ8huA8y.mjs → get-FIE88hj9.mjs} +7 -8
- package/dist/{get-B0OsW6jk.mjs → get-Ihx_XaaI.mjs} +5 -7
- package/dist/{get-run-DQJVpDw1.mjs → get-run-lVwhQVFx.mjs} +5 -7
- package/dist/{get-CbpHt4Hs.mjs → get-z0BKkiRX.mjs} +4 -6
- package/dist/git-sync-CmB4YBmS.mjs +31 -0
- package/dist/{group-BNE_RiH5.mjs → group-CILtQqCL.mjs} +2 -1
- package/dist/{has-remote-changes-DvQBXudi.mjs → has-remote-changes-DHrYSnTg.mjs} +5 -7
- package/dist/{import-PGS8-DwE.mjs → import-BU40xXSF.mjs} +7 -9
- package/dist/{input-7Sj85_K7.mjs → input-BGyHn0Kr.mjs} +6 -3
- package/dist/{is-dirty-DyEVFQVJ.mjs → is-dirty-BPluqPPP.mjs} +3 -4
- package/dist/is-dirty-DOy1TRcf.mjs +8 -0
- package/dist/{items-CkFEy2Du.mjs → items-BZpYkImP.mjs} +6 -8
- package/dist/{key-bltP32Pm.mjs → key-B8UAsQmB.mjs} +1 -1
- package/dist/{library-1AAVbk-K.mjs → library-BGWDIfEM.mjs} +6 -6
- package/dist/list-B037kJtH.mjs +39 -0
- package/dist/{list-82NkvRpI.mjs → list-B7Ihu6XI.mjs} +7 -8
- package/dist/{list-pQ22nXhQ.mjs → list-BCeZlfpQ.mjs} +4 -6
- package/dist/{list-CKzpoTgP.mjs → list-Bct00qku.mjs} +6 -8
- package/dist/{list-D-rgDFa5.mjs → list-Be8xMtS3.mjs} +8 -9
- package/dist/{list-Bb8YRON_.mjs → list-CjBPVJqd.mjs} +4 -6
- package/dist/{list-BCYTTCFD.mjs → list-CoqHnusK.mjs} +4 -6
- package/dist/{list-B9wXg3qi.mjs → list-CvaoHnl-.mjs} +3 -5
- package/dist/{list-BVzu2RIZ.mjs → list-DamRE5Ds.mjs} +4 -6
- package/dist/{list-BWAYDSbQ.mjs → list-DmopauvJ.mjs} +4 -6
- package/dist/{list-CJx5q-Yn.mjs → list-M_1sdYNH.mjs} +6 -8
- package/dist/{list-CK0p7vvK.mjs → list-Ov6bYzT9.mjs} +7 -8
- package/dist/{list-Sgo3RfDY.mjs → list-SfpASSFx.mjs} +4 -6
- package/dist/{list-BBxRjuMn.mjs → list-fPfgG0PY.mjs} +4 -6
- package/dist/list-lsPeumLP.mjs +34 -0
- package/dist/{list-BY4S32Lg.mjs → list-sn9M7QQX.mjs} +4 -6
- package/dist/{list-CjF12k1G.mjs → list-wxIVl45_.mjs} +5 -7
- package/dist/listing-wFZuS5li.mjs +10 -0
- package/dist/{login-C6ZAnGHz.mjs → login-CRlmR4op.mjs} +61 -23
- package/dist/{logout-CWjyY3Y8.mjs → logout-DSZEUxSQ.mjs} +5 -7
- package/dist/{measure-DoJvtCaA.mjs → measure-C3G1srWb.mjs} +5 -4
- package/dist/measure-Ka0n3426.mjs +25 -0
- package/dist/{parameter-values-DmDOuE-j.mjs → parameter-values-CwW8Xes7.mjs} +5 -7
- package/dist/{parse-enum-BL9i_brN.mjs → parse-enum-ooCsJWn6.mjs} +1 -1
- package/dist/parse-id-xS1tWJAq.mjs +18 -0
- package/dist/{parse-ref-CB_KvF9h.mjs → parse-ref-j4lxaQmd.mjs} +1 -1
- package/dist/{path-D8IJ4YrW.mjs → path-CVmg-bmf.mjs} +4 -6
- package/dist/{poll-hgnrHBoh.mjs → poll-CuTlWBwI.mjs} +2 -2
- package/dist/{poll-task-NQNLT_aA.mjs → poll-task-DhsYs8Hx.mjs} +2 -2
- package/dist/{preflight-DvaPQHHf.mjs → preflight-D3VgjEg7.mjs} +4 -5
- package/dist/{process-j8UHMHc2.mjs → process-7c8BcQEi.mjs} +1 -1
- package/dist/profile-name-CZ1-Vtrh.mjs +7 -0
- package/dist/{prompt-C85xd9HR.mjs → prompt-jQnNKtlx.mjs} +1 -1
- package/dist/{publish-BntmFR6g.mjs → publish-DFTCsjHU.mjs} +13 -10
- package/dist/{query-DSKQZu91.mjs → query-CPq-dhFV.mjs} +15 -15
- package/dist/{query-BQfgKV68.mjs → query-Dfx69iJ4.mjs} +9 -10
- package/dist/{query-result-D6mfoVfQ.mjs → query-result-Cg7odyR_.mjs} +1 -1
- package/dist/{remove-collection-BguaI3-6.mjs → remove-collection-DUAMhx5L.mjs} +7 -9
- package/dist/replace-DZWd6avZ.mjs +42 -0
- package/dist/requests-DYrDe-D0.mjs +96 -0
- package/dist/{rescan-values-DjD6IW3J.mjs → rescan-values-DZSnEFA0.mjs} +7 -9
- package/dist/{resolve-Dj2MTBkn.mjs → resolve-BTZuO3Yq.mjs} +22 -15
- package/dist/{run-Bp1yxkBN.mjs → run-B2b3Bjmv.mjs} +4 -6
- package/dist/{run-RQfQj7Rk.mjs → run-ryZ4sXK5.mjs} +7 -9
- package/dist/{runs-CSsatfWb.mjs → runs-F82HVSie.mjs} +5 -7
- package/dist/{runtime-oxjmrYoP.mjs → runtime-C6ASrgVA.mjs} +944 -909
- package/dist/{schema-tables-5I5pCxHl.mjs → schema-tables-CCOKb715.mjs} +6 -8
- package/dist/{schemas-CfzFCfBt.mjs → schemas-LtVrNECH.mjs} +4 -6
- package/dist/{search-Vo-BqliA.mjs → search-9GSZHgJQ.mjs} +4 -6
- package/dist/segment-C40bORNZ.mjs +25 -0
- package/dist/{segment-TXktTCfU.mjs → segment-CxRYEXeO.mjs} +6 -5
- package/dist/{selectors-DBnJsKlW.mjs → selectors-B2nDmrIV.mjs} +3 -3
- package/dist/{set-1Vh0AF-T.mjs → set-C57KDMGM.mjs} +9 -9
- package/dist/{set-active-C0mUZlNN.mjs → set-active-BDHGHtj2.mjs} +4 -6
- package/dist/setting-zrJwy48C.mjs +20 -0
- package/dist/{setup-CzYFvFK5.mjs → setup-Doq8atTG.mjs} +11 -12
- package/dist/{skills-B6gfH0iR.mjs → skills-y-KsUqT9.mjs} +1 -1
- package/dist/{skills-CR2xyV33.mjs → skills-yuzH_o8s.mjs} +3 -3
- package/dist/{snippet-CtA2Pkoa.mjs → snippet-C8PVaPY9.mjs} +7 -4
- package/dist/snippet-ScFM8re8.mjs +22 -0
- package/dist/{stash-CQHXwBu_.mjs → stash-D_u6z4q6.mjs} +7 -9
- package/dist/{status-C_7aqTvB.mjs → status--Dm2Jv6k.mjs} +5 -7
- package/dist/{status-DXQkM18v.mjs → status-CDPhDX5I.mjs} +27 -13
- package/dist/{summary-1aNpQc8j.mjs → summary-C9a2cBTE.mjs} +5 -7
- package/dist/{sync-schema-BqLp5uTS.mjs → sync-schema-CDIWNCGI.mjs} +9 -11
- package/dist/sync-scope-DW2QpGwv.mjs +55 -0
- package/dist/{table-DE3i82T_.mjs → table-3onHpwcb.mjs} +16 -4
- package/dist/table-BKehBm_E.mjs +21 -0
- package/dist/timeline-DEaiuB5V.mjs +157 -0
- package/dist/timeline-event-CLWMxvE0.mjs +22 -0
- package/dist/timeline-n3Nw9Egt.mjs +24 -0
- package/dist/transform-CrOOqKen.mjs +31 -0
- package/dist/{transform-DEF38FWe.mjs → transform-DP6J2ber.mjs} +31 -5
- package/dist/transform-job-J-E0Mec7.mjs +25 -0
- package/dist/transform-tag-Bkyasy_s.mjs +21 -0
- package/dist/{transforms-BelyllUL.mjs → transforms-w2a5qsjJ.mjs} +5 -7
- package/dist/{tree-YvmwGql7.mjs → tree-JZC6vD9q.mjs} +4 -6
- package/dist/{unpublish-CHjGLMu9.mjs → unpublish-BsfIH46y.mjs} +5 -7
- package/dist/{update-D7vc8GBF.mjs → update-B8hn6VxO.mjs} +12 -13
- package/dist/{update-BKhekuqr.mjs → update-BSNK36fk.mjs} +15 -15
- package/dist/update-BTFj6WHo.mjs +52 -0
- package/dist/{update-BACl_bJS.mjs → update-BfIGjAVA.mjs} +9 -10
- package/dist/{update-CrRz47aj.mjs → update-C1_aIL6X.mjs} +15 -15
- package/dist/{update-K-jjQ0Aw.mjs → update-CXKWHOIN.mjs} +10 -11
- package/dist/{update-BnHYSu96.mjs → update-Cg09lBb5.mjs} +13 -14
- package/dist/update-D01S8hnw.mjs +52 -0
- package/dist/{update-txUfAJxy.mjs → update-DKQjMsuE.mjs} +9 -10
- package/dist/{update-Zz01Woxj.mjs → update-DSlSr7Ky.mjs} +9 -10
- package/dist/{update-C9fndCqb.mjs → update-QaBVvlz9.mjs} +9 -10
- package/dist/{update-BGMJTpA6.mjs → update-WLb9099y.mjs} +12 -13
- package/dist/{update-BWlN3QDo.mjs → update-bFNKpay8.mjs} +9 -10
- package/dist/{update-dashcard-Dvth-yLC.mjs → update-dashcard-CKZC7scy.mjs} +11 -11
- package/dist/{upgrade-DsXlfPef.mjs → upgrade-DkK1ZbEY.mjs} +5 -7
- package/dist/upload-DOMoaR9f.mjs +16 -0
- package/dist/{uuid-ByJmWV7b.mjs → uuid-DDbLKnbe.mjs} +3 -5
- package/dist/{validate-BqNW4Sk1.mjs → validate-DqQ7DQnP.mjs} +1 -2
- package/dist/{validate-query-CcZVKYPV.mjs → validate-query-BYG7lyaY.mjs} +2 -3
- package/dist/{values-CIjJI4sz.mjs → values-Bc99Kkuv.mjs} +5 -7
- package/dist/{verify-Jsuc2dat.mjs → verify-WvMbaT8W.mjs} +2 -2
- package/dist/{wait-5ltTFvSa.mjs → wait-DmgEPnHW.mjs} +6 -8
- package/dist/{wait-flags-D6kd_G7c.mjs → wait-flags-BpzyrpAL.mjs} +2 -2
- package/dist/workspace-BgH_4xFO.mjs +75 -0
- package/dist/workspace-LFtHxcw9.mjs +19 -0
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +31 -23
- package/skill-data/dashboard/SKILL.md +26 -3
- package/skill-data/data-workflow/SKILL.md +17 -15
- package/skill-data/git-sync/SKILL.md +20 -5
- package/skill-data/visualization/SKILL.md +1 -0
- package/dist/add-collection-DbalcC3_.mjs +0 -11
- package/dist/auth--PWX0oj5.mjs +0 -22
- package/dist/capabilities-N0jo5U7S.mjs +0 -239
- package/dist/card-D07WYCQY.mjs +0 -26
- package/dist/collection-Dss2qSEF.mjs +0 -23
- package/dist/dashboard-Crh4v6Fq.mjs +0 -35
- package/dist/db-BCAURQei.mjs +0 -28
- package/dist/document-upxL2nKH.mjs +0 -22
- package/dist/error-BaBm-UrT.mjs +0 -227
- package/dist/field-CloFa1oe.mjs +0 -21
- package/dist/get-B8tugTku.mjs +0 -50
- package/dist/git-sync-C9m-OHac.mjs +0 -31
- package/dist/is-dirty-DpyKeGAJ.mjs +0 -10
- package/dist/manifest-BVf8P4bl.mjs +0 -126
- package/dist/measure-Cbly1r0E.mjs +0 -25
- package/dist/metadata-CW5Lfw5d.mjs +0 -39
- package/dist/metadata-aQAqseCm.mjs +0 -38
- package/dist/notice-DyVl5aYB.mjs +0 -206
- package/dist/parse-id-DlXnOcmP.mjs +0 -12
- package/dist/segment-BuN_IoM8.mjs +0 -25
- package/dist/setting-BbdKR-lO.mjs +0 -20
- package/dist/snippet-Bzo2U9Fv.mjs +0 -22
- package/dist/table-BwGOz97O.mjs +0 -22
- package/dist/transform-B65ZD9-e.mjs +0 -31
- package/dist/transform-job-BWVKXSV6.mjs +0 -25
- package/dist/transform-tag-C4qvmicL.mjs +0 -21
- /package/dist/{body-flags-DWTTxJpP.mjs → body-flags-CgHgJBRC.mjs} +0 -0
- /package/dist/{command-augment-DdZIfx1V.mjs → command-augment-D9pI9Vbh.mjs} +0 -0
- /package/dist/{parameter-CiJ4CwWE.mjs → parameter-BZ6y-Gfs.mjs} +0 -0
- /package/dist/{render-BTKnWL0d.mjs → render-CkuFkWlQ.mjs} +0 -0
- /package/dist/{transform-job-CtixL4An.mjs → transform-job-B5x8aYfV.mjs} +0 -0
- /package/dist/{transform-tag-rsIrckCM.mjs → transform-tag-BRwfWeHf.mjs} +0 -0
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { ConfigError, errorMessage, warn } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { openBrowser } from "./process-j8UHMHc2.mjs";
|
|
10
|
-
import { readInput } from "./input-7Sj85_K7.mjs";
|
|
1
|
+
import { ConfigError, connectionFlags, errorMessage, outputFlags, profileFlag, renderSummary, warn } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { DEFAULT_PROFILE, OAUTH_SCOPE, ParsedVersionSchema, ProbedUser, WORKSPACE_MANAGER_SCOPE, consumeKeychainResidualWarning, consumeKeyringDowngradeWarning, defineMetabaseCommand, discoverMetadata, exchangeCode, explicitProfileName, keyringFallbackWarning, normalizeUrl, oauthCredentialFromTokens, readEnvCredentials, registerClient, revokeOAuthCredential, tryDiscoverMetadata, writeOAuthProfile, writeProbeFailure, writeProbeResult, writeProfile } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import { verifyAndProbe } from "./verify-WvMbaT8W.mjs";
|
|
5
|
+
import { EMPTY_CELL, renderUserName, renderUserRole, renderVersionTag } from "./render-CkuFkWlQ.mjs";
|
|
6
|
+
import { promptPassword, promptSelect, promptText } from "./prompt-jQnNKtlx.mjs";
|
|
7
|
+
import { openBrowser } from "./process-7c8BcQEi.mjs";
|
|
8
|
+
import { readInput } from "./input-BGyHn0Kr.mjs";
|
|
11
9
|
import { z } from "zod";
|
|
12
10
|
import { createServer } from "node:http";
|
|
13
11
|
import { createHash, randomBytes } from "node:crypto";
|
|
@@ -148,23 +146,25 @@ function buildAuthorizeUrl(authorizationEndpoint, params) {
|
|
|
148
146
|
const separator = authorizationEndpoint.includes("?") ? "&" : "?";
|
|
149
147
|
return `${authorizationEndpoint}${separator}${new URLSearchParams(params).toString()}`;
|
|
150
148
|
}
|
|
151
|
-
async function resolveClientId(registrationEndpoint, redirectUri, provided) {
|
|
149
|
+
async function resolveClientId(registrationEndpoint, redirectUri, provided, scope) {
|
|
152
150
|
if (provided !== void 0) return provided;
|
|
153
151
|
if (registrationEndpoint === void 0) throw new ConfigError("this Metabase has dynamic client registration disabled; pass --client-id with a pre-registered native client");
|
|
154
152
|
const registered = await registerClient({
|
|
155
153
|
registrationEndpoint,
|
|
156
154
|
redirectUri,
|
|
157
|
-
clientName: CLIENT_NAME
|
|
155
|
+
clientName: CLIENT_NAME,
|
|
156
|
+
scope
|
|
158
157
|
});
|
|
159
158
|
return registered.client_id;
|
|
160
159
|
}
|
|
161
160
|
async function oauthLogin(input, deps) {
|
|
162
|
-
const
|
|
161
|
+
const scope = input.scope ?? OAUTH_SCOPE;
|
|
162
|
+
const metadata = input.metadata ?? await discoverMetadata(input.baseUrl, scope);
|
|
163
163
|
const pkce = generatePkce();
|
|
164
164
|
const state = randomState();
|
|
165
165
|
const server = await startCallbackServer(state, input.timeoutMs);
|
|
166
166
|
try {
|
|
167
|
-
const clientId = await resolveClientId(metadata.registration_endpoint, server.redirectUri, input.clientId);
|
|
167
|
+
const clientId = await resolveClientId(metadata.registration_endpoint, server.redirectUri, input.clientId, scope);
|
|
168
168
|
const authorizeUrl = buildAuthorizeUrl(metadata.authorization_endpoint, {
|
|
169
169
|
response_type: "code",
|
|
170
170
|
client_id: clientId,
|
|
@@ -172,7 +172,7 @@ async function oauthLogin(input, deps) {
|
|
|
172
172
|
code_challenge: pkce.challenge,
|
|
173
173
|
code_challenge_method: "S256",
|
|
174
174
|
state,
|
|
175
|
-
scope
|
|
175
|
+
scope
|
|
176
176
|
});
|
|
177
177
|
const opened = await deps.openBrowser(authorizeUrl);
|
|
178
178
|
deps.onAuthorizeUrl(authorizeUrl, opened);
|
|
@@ -185,7 +185,7 @@ async function oauthLogin(input, deps) {
|
|
|
185
185
|
codeVerifier: pkce.verifier
|
|
186
186
|
});
|
|
187
187
|
if (tokens.refresh_token === void 0) throw new ConfigError("token endpoint did not return a refresh token");
|
|
188
|
-
return oauthCredentialFromTokens(tokens, tokens.refresh_token, clientId, deps.now());
|
|
188
|
+
return oauthCredentialFromTokens(tokens, tokens.refresh_token, clientId, scope, deps.now());
|
|
189
189
|
} finally {
|
|
190
190
|
server.close();
|
|
191
191
|
}
|
|
@@ -198,7 +198,8 @@ const LoginResult = z.object({
|
|
|
198
198
|
url: z.string(),
|
|
199
199
|
authenticated: z.boolean(),
|
|
200
200
|
user: ProbedUser.nullable(),
|
|
201
|
-
version: ParsedVersionSchema.nullable()
|
|
201
|
+
version: ParsedVersionSchema.nullable(),
|
|
202
|
+
scope: z.string().nullable()
|
|
202
203
|
});
|
|
203
204
|
const loginView = {
|
|
204
205
|
compactPick: LoginResult,
|
|
@@ -230,6 +231,11 @@ const loginView = {
|
|
|
230
231
|
key: "version",
|
|
231
232
|
label: "Version",
|
|
232
233
|
format: (value) => renderVersionTag(value)
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
key: "scope",
|
|
237
|
+
label: "Scope",
|
|
238
|
+
format: (value) => typeof value === "string" ? value : EMPTY_CELL
|
|
233
239
|
}
|
|
234
240
|
]
|
|
235
241
|
};
|
|
@@ -253,19 +259,42 @@ var login_default = defineMetabaseCommand({
|
|
|
253
259
|
type: "boolean",
|
|
254
260
|
default: false,
|
|
255
261
|
description: "Save without contacting the server"
|
|
262
|
+
},
|
|
263
|
+
workspace: {
|
|
264
|
+
type: "boolean",
|
|
265
|
+
default: false,
|
|
266
|
+
description: "Request a workspace-manager-scoped login (workspace CRUD only, browser OAuth required)"
|
|
256
267
|
}
|
|
257
268
|
},
|
|
258
269
|
outputSchema: LoginResult,
|
|
259
270
|
examples: [
|
|
260
271
|
"mb auth login --url https://metabase.example.com",
|
|
261
272
|
"echo $MB_API_KEY | mb auth login --url https://metabase.example.com",
|
|
262
|
-
"mb auth login --profile staging --url https://staging.example.com"
|
|
273
|
+
"mb auth login --profile staging --url https://staging.example.com",
|
|
274
|
+
"mb auth login --workspace --profile parent --url https://metabase.example.com"
|
|
263
275
|
],
|
|
264
276
|
async run({ args, ctx }) {
|
|
265
277
|
const profileName = await resolveLoginProfile(args.profile);
|
|
266
278
|
const env = readEnvCredentials();
|
|
267
279
|
if (args.apiKey) warn("warning: --api-key is visible in shell history and process listings — pipe the key on stdin or set MB_API_KEY instead");
|
|
268
280
|
const url = await resolveUrl(args.url, env.url);
|
|
281
|
+
if (args.workspace) {
|
|
282
|
+
assertWorkspaceLoginPossible(args.apiKey, env.apiKey);
|
|
283
|
+
const metadata$1 = await probeOAuthSupport(url, WORKSPACE_MANAGER_SCOPE);
|
|
284
|
+
if (metadata$1 === null) throw new ConfigError(`this Metabase does not support workspace-scoped login (no ${WORKSPACE_MANAGER_SCOPE} scope advertised)`);
|
|
285
|
+
const credential$1 = await oauthLogin({
|
|
286
|
+
baseUrl: url,
|
|
287
|
+
metadata: metadata$1,
|
|
288
|
+
scope: WORKSPACE_MANAGER_SCOPE,
|
|
289
|
+
...args.clientId !== void 0 && { clientId: args.clientId }
|
|
290
|
+
}, {
|
|
291
|
+
openBrowser,
|
|
292
|
+
onAuthorizeUrl: announceAuthorizeUrl,
|
|
293
|
+
now: () => Date.now()
|
|
294
|
+
});
|
|
295
|
+
await completeLogin(profileName, url, credential$1, args["skip-verify"], ctx, () => writeOAuthProfile(url, credential$1, profileName));
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
269
298
|
const apiKey = await nonInteractiveApiKey(args.apiKey, env.apiKey);
|
|
270
299
|
if (apiKey !== null) {
|
|
271
300
|
await completeLogin(profileName, url, {
|
|
@@ -303,9 +332,14 @@ var login_default = defineMetabaseCommand({
|
|
|
303
332
|
await completeLogin(profileName, url, credential, args["skip-verify"], ctx, () => writeOAuthProfile(url, credential, profileName));
|
|
304
333
|
}
|
|
305
334
|
});
|
|
306
|
-
|
|
335
|
+
function assertWorkspaceLoginPossible(flagKey, envKey) {
|
|
336
|
+
if (flagKey !== void 0) throw new ConfigError("--workspace login is browser-OAuth only; an API key cannot carry a scope — omit --api-key");
|
|
337
|
+
if (envKey !== null) throw new ConfigError("--workspace login is browser-OAuth only; unset MB_API_KEY so it cannot shadow the scoped login");
|
|
338
|
+
if (!process.stdin.isTTY) throw new ConfigError("--workspace login opens a browser and requires a TTY");
|
|
339
|
+
}
|
|
340
|
+
async function probeOAuthSupport(url, requiredScope) {
|
|
307
341
|
try {
|
|
308
|
-
return await tryDiscoverMetadata(url);
|
|
342
|
+
return await tryDiscoverMetadata(url, requiredScope);
|
|
309
343
|
} catch (error) {
|
|
310
344
|
if (error instanceof ConfigError) throw error;
|
|
311
345
|
throw new ConfigError(`could not reach ${url}: ${errorMessage(error)}`);
|
|
@@ -340,6 +374,7 @@ async function promptForApiKey() {
|
|
|
340
374
|
});
|
|
341
375
|
}
|
|
342
376
|
async function completeLogin(profileName, url, credential, skipVerify, ctx, persist) {
|
|
377
|
+
const scope = credential.kind === "oauth" ? credential.scope : null;
|
|
343
378
|
if (skipVerify) {
|
|
344
379
|
await persistWithWarning(persist);
|
|
345
380
|
renderSummary({
|
|
@@ -347,7 +382,8 @@ async function completeLogin(profileName, url, credential, skipVerify, ctx, pers
|
|
|
347
382
|
url,
|
|
348
383
|
authenticated: false,
|
|
349
384
|
user: null,
|
|
350
|
-
version: null
|
|
385
|
+
version: null,
|
|
386
|
+
scope
|
|
351
387
|
}, loginView, `Saved credentials for profile "${profileName}" (${url}) without verifying.`, ctx);
|
|
352
388
|
return;
|
|
353
389
|
}
|
|
@@ -369,13 +405,15 @@ async function completeLogin(profileName, url, credential, skipVerify, ctx, pers
|
|
|
369
405
|
const role = renderUserRole(result.user);
|
|
370
406
|
const versionTag = renderVersionTag(result.server.version);
|
|
371
407
|
const serverClause = versionTag === EMPTY_CELL ? "" : ` Server ${versionTag}.`;
|
|
408
|
+
const scopeClause = scope === null || scope === OAUTH_SCOPE ? "" : ` Scope: ${scope}.`;
|
|
372
409
|
renderSummary({
|
|
373
410
|
profile: profileName,
|
|
374
411
|
url,
|
|
375
412
|
authenticated: true,
|
|
376
413
|
user: result.user,
|
|
377
|
-
version: result.server.version
|
|
378
|
-
|
|
414
|
+
version: result.server.version,
|
|
415
|
+
scope
|
|
416
|
+
}, loginView, `Logged in to ${url} as ${who} (${role}). Saved to profile "${profileName}".${serverClause}${scopeClause}`, ctx);
|
|
379
417
|
}
|
|
380
418
|
async function revokeUnsavedOAuthCredential(url, credential) {
|
|
381
419
|
if (credential.kind !== "oauth") return;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import { errorMessage, warn } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { renderSummary } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
-
import { promptConfirm } from "./prompt-C85xd9HR.mjs";
|
|
1
|
+
import { errorMessage, outputFlags, profileFlag, renderSummary, warn } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { clearProfile, consumeKeychainResidualWarning, defineMetabaseCommand, readProfileCredential, resolveActiveProfileName, revokeOAuthCredential } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import { promptConfirm } from "./prompt-jQnNKtlx.mjs";
|
|
7
5
|
import { z } from "zod";
|
|
8
6
|
|
|
9
7
|
//#region src/commands/auth/logout.ts
|
|
@@ -47,7 +45,7 @@ var logout_default = defineMetabaseCommand({
|
|
|
47
45
|
outputSchema: LogoutResult,
|
|
48
46
|
examples: ["mb auth logout --yes", "mb auth logout --profile staging --yes"],
|
|
49
47
|
async run({ args, ctx }) {
|
|
50
|
-
const profileName =
|
|
48
|
+
const profileName = await resolveActiveProfileName(args.profile);
|
|
51
49
|
if (!args.yes && process.stdin.isTTY === true) {
|
|
52
50
|
const ok = await promptConfirm({
|
|
53
51
|
message: `Clear stored credentials for profile "${profileName}"?`,
|
|
@@ -49,17 +49,18 @@ const measureView = {
|
|
|
49
49
|
}
|
|
50
50
|
]
|
|
51
51
|
};
|
|
52
|
+
const MeasureDefinition = z.record(z.string(), z.unknown()).describe("MBQL query holding exactly one aggregation — full MBQL 5 schema: mb query --print-schema");
|
|
52
53
|
const MeasureCreateInput = z.object({
|
|
53
54
|
name: z.string().min(1),
|
|
54
55
|
table_id: z.number().int().positive(),
|
|
55
|
-
definition:
|
|
56
|
+
definition: MeasureDefinition,
|
|
56
57
|
description: z.string().nullable().optional()
|
|
57
58
|
}).loose();
|
|
58
59
|
const MeasureUpdateInput = z.object({
|
|
59
|
-
name: z.string().min(1).optional(),
|
|
60
|
-
definition:
|
|
60
|
+
name: z.string().min(1).nullable().optional(),
|
|
61
|
+
definition: MeasureDefinition.nullable().optional(),
|
|
61
62
|
revision_message: z.string().min(1),
|
|
62
|
-
archived: z.boolean().optional(),
|
|
63
|
+
archived: z.boolean().nullable().optional(),
|
|
63
64
|
description: z.string().nullable().optional()
|
|
64
65
|
}).loose();
|
|
65
66
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
2
|
+
import { defineCommandGroup } from "./group-CILtQqCL.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/measure/index.ts
|
|
5
|
+
var measure_default = defineCommandGroup({
|
|
6
|
+
name: "measure",
|
|
7
|
+
description: "Manage Metabase measures",
|
|
8
|
+
skills: [{
|
|
9
|
+
skill: "mbql",
|
|
10
|
+
purpose: "the definition aggregation"
|
|
11
|
+
}, {
|
|
12
|
+
skill: "data-workflow",
|
|
13
|
+
purpose: "define reusable measures"
|
|
14
|
+
}],
|
|
15
|
+
subCommands: {
|
|
16
|
+
list: () => import("./list-BCeZlfpQ.mjs").then((mod) => mod.default),
|
|
17
|
+
get: () => import("./get-CjZWjRa5.mjs").then((mod) => mod.default),
|
|
18
|
+
create: () => import("./create-DutkaD7P.mjs").then((mod) => mod.default),
|
|
19
|
+
update: () => import("./update-WLb9099y.mjs").then((mod) => mod.default),
|
|
20
|
+
archive: () => import("./archive-h-3H5b4K.mjs").then((mod) => mod.default)
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { measure_default as default };
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ParameterValues, parameterValuesView } from "./parameter-CiJ4CwWE.mjs";
|
|
7
|
-
import { parseId } from "./parse-id-DlXnOcmP.mjs";
|
|
1
|
+
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import { ParameterValues, parameterValuesView } from "./parameter-BZ6y-Gfs.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
8
6
|
|
|
9
7
|
//#region src/commands/dashboard/parameter-values.ts
|
|
10
8
|
var parameter_values_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ConfigError } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import { parseCsv, parseInteger } from "./runtime-C6ASrgVA.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/commands/parse-id.ts
|
|
5
|
+
function parseId(value, name = "id") {
|
|
6
|
+
return parseInteger(value, {
|
|
7
|
+
name,
|
|
8
|
+
min: 1
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function parseIdCsv(value, name) {
|
|
12
|
+
const ids = parseCsv(value).map((part) => parseId(part, name));
|
|
13
|
+
if (ids.length === 0) throw new ConfigError(`expected at least one ${name} (comma separated)`);
|
|
14
|
+
return ids;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
export { parseId, parseIdCsv };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import { renderList } from "./capabilities-N0jo5U7S.mjs";
|
|
6
|
-
import { findSkillByName, loadAllSkills, loadVisibleSkills } from "./skills-B6gfH0iR.mjs";
|
|
1
|
+
import { listEnvelopeSchema, outputFlags, renderList, wrapList } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import { findSkillByName, loadAllSkills, loadVisibleSkills } from "./skills-y-KsUqT9.mjs";
|
|
7
5
|
import { z } from "zod";
|
|
8
6
|
|
|
9
7
|
//#region src/commands/skills/path.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TimeoutError } from "./
|
|
2
|
-
import { combineAborts, throwIfAborted } from "./runtime-
|
|
1
|
+
import { TimeoutError } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import { combineAborts, throwIfAborted } from "./runtime-C6ASrgVA.mjs";
|
|
3
3
|
import { setTimeout } from "node:timers/promises";
|
|
4
4
|
|
|
5
5
|
//#region src/runtime/poll.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseJsonOrPlain } from "./runtime-
|
|
2
|
-
import { pollUntil } from "./poll-
|
|
1
|
+
import { parseJsonOrPlain } from "./runtime-C6ASrgVA.mjs";
|
|
2
|
+
import { pollUntil } from "./poll-CuTlWBwI.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/domain/git-sync.ts
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ChainedRequestError, ConfigError, MetabaseError } from "./
|
|
2
|
-
import { HttpError } from "./runtime-
|
|
3
|
-
import {
|
|
4
|
-
import { Card } from "./card-DEmcRlNO.mjs";
|
|
1
|
+
import { ChainedRequestError, ConfigError, MetabaseError, writeJson } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import { HttpError } from "./runtime-C6ASrgVA.mjs";
|
|
3
|
+
import { Card } from "./card-B8G5jQQT.mjs";
|
|
5
4
|
import { z } from "zod";
|
|
6
5
|
|
|
7
6
|
//#region src/commands/dashboard/preflight.ts
|
|
8
7
|
const PreflightDashcard = z.looseObject({ card_id: z.number().int().nullable().optional() });
|
|
9
8
|
function collectDashcardCardReferences(dashcards) {
|
|
10
|
-
if (dashcards === void 0) return [];
|
|
9
|
+
if (dashcards === void 0 || dashcards === null) return [];
|
|
11
10
|
const refs = [];
|
|
12
11
|
dashcards.forEach((dashcard, index) => {
|
|
13
12
|
const parsed = PreflightDashcard.safeParse(dashcard);
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import "./
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./parse-id-xS1tWJAq.mjs";
|
|
5
|
+
import { Collection, CollectionCompact } from "./collection-C52Ndi_O.mjs";
|
|
6
|
+
import "./listing-wFZuS5li.mjs";
|
|
7
|
+
import "./poll-CuTlWBwI.mjs";
|
|
8
|
+
import "./poll-task-DhsYs8Hx.mjs";
|
|
9
|
+
import { warnIfOutsideSyncScope } from "./sync-scope-DW2QpGwv.mjs";
|
|
10
|
+
import { ensureLibraryDataCollectionId } from "./resolve-BTZuO3Yq.mjs";
|
|
11
|
+
import { parseTableSelectors, tableSelectorFlags } from "./selectors-B2nDmrIV.mjs";
|
|
10
12
|
import { z } from "zod";
|
|
11
13
|
|
|
12
14
|
//#region src/commands/library/publish.ts
|
|
@@ -25,7 +27,7 @@ var publish_default = defineMetabaseCommand({
|
|
|
25
27
|
name: "publish",
|
|
26
28
|
description: "Publish tables (and their upstream dependencies) to the Library Data collection"
|
|
27
29
|
},
|
|
28
|
-
details: "Sets each selected table and every upstream table it depends on into the Library Data collection, so they appear first in data pickers and rank up in search. The Library Data collection is resolved automatically (and the Library is created if it doesn't exist yet). Select with --table-ids, --db-ids, or --schemas (each schema id is \"<db-id>:<schema>\", e.g. 1:public); the filters are combined.",
|
|
30
|
+
details: "Sets each selected table and every upstream table it depends on into the Library Data collection, so they appear first in data pickers and rank up in search. The Library Data collection is resolved automatically (and the Library is created if it doesn't exist yet). Select with --table-ids, --db-ids, or --schemas (each schema id is \"<db-id>:<schema>\", e.g. 1:public); the filters are combined. Publishing does not add the Library Data collection to the git-sync scope — on an instance with remote sync configured, run `mb git-sync add-collection <collection-id>` so exports carry the published tables' metadata.",
|
|
29
31
|
capabilities: {
|
|
30
32
|
minVersion: 59,
|
|
31
33
|
tokenFeature: "library"
|
|
@@ -55,6 +57,7 @@ var publish_default = defineMetabaseCommand({
|
|
|
55
57
|
body
|
|
56
58
|
});
|
|
57
59
|
renderSummary(result, libraryPublishResultView, summaryLine(result), ctx);
|
|
60
|
+
await warnIfOutsideSyncScope(client, result.target_collection);
|
|
58
61
|
}
|
|
59
62
|
});
|
|
60
63
|
function summaryLine(result) {
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { formatQueryResult } from "./query-result-D6mfoVfQ.mjs";
|
|
1
|
+
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary, writeJson } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./input-BGyHn0Kr.mjs";
|
|
5
|
+
import "./embedding-CKdw8q7p.mjs";
|
|
6
|
+
import "./field-DsXTeqBy.mjs";
|
|
7
|
+
import "./parameter-BZ6y-Gfs.mjs";
|
|
8
|
+
import { CardQueryResult, cardQueryView } from "./card-B8G5jQQT.mjs";
|
|
9
|
+
import { readBody } from "./body-5snfmiwR.mjs";
|
|
10
|
+
import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
|
|
11
|
+
import { assertNotLegacyEnvelopeWrappingMbql5, getQuerySchemaBundle, isMbql5Query, validateQuery } from "./validate-DqQ7DQnP.mjs";
|
|
12
|
+
import { skipValidateFlag } from "./validate-query-BYG7lyaY.mjs";
|
|
13
|
+
import { formatQueryResult } from "./query-result-Cg7odyR_.mjs";
|
|
15
14
|
import { z } from "zod";
|
|
16
15
|
|
|
17
16
|
//#region src/commands/query.ts
|
|
18
|
-
const QueryBody = z.unknown();
|
|
17
|
+
const QueryBody = z.unknown().describe("MBQL 5, legacy MBQL, or native query body — full MBQL 5 schema: mb query --print-schema");
|
|
19
18
|
const QUERY_ENDPOINT = "/api/dataset";
|
|
20
19
|
var query_default = defineMetabaseCommand({
|
|
21
20
|
meta: {
|
|
@@ -43,6 +42,7 @@ var query_default = defineMetabaseCommand({
|
|
|
43
42
|
},
|
|
44
43
|
...skipValidateFlag
|
|
45
44
|
},
|
|
45
|
+
inputSchema: QueryBody,
|
|
46
46
|
outputSchema: CardQueryResult,
|
|
47
47
|
examples: [
|
|
48
48
|
"mb query --print-schema",
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { ConfigError } from "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import "./
|
|
7
|
-
import "./
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { formatQueryResult } from "./query-result-D6mfoVfQ.mjs";
|
|
1
|
+
import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseJson } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./embedding-CKdw8q7p.mjs";
|
|
5
|
+
import "./field-DsXTeqBy.mjs";
|
|
6
|
+
import "./parameter-BZ6y-Gfs.mjs";
|
|
7
|
+
import { CardQueryResult, cardQueryView } from "./card-B8G5jQQT.mjs";
|
|
8
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
9
|
+
import { formatQueryResult } from "./query-result-Cg7odyR_.mjs";
|
|
11
10
|
import { z } from "zod";
|
|
12
11
|
import { Writable } from "node:stream";
|
|
13
12
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import
|
|
3
|
-
import "./
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import "./
|
|
8
|
-
import "./poll-task-NQNLT_aA.mjs";
|
|
9
|
-
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-CRZAFCZy.mjs";
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
5
|
+
import "./poll-CuTlWBwI.mjs";
|
|
6
|
+
import "./poll-task-DhsYs8Hx.mjs";
|
|
7
|
+
import { SyncSettingsUpdateResult, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-CLXfrgp4.mjs";
|
|
10
8
|
|
|
11
9
|
//#region src/commands/git-sync/remove-collection.ts
|
|
12
10
|
var remove_collection_default = defineMetabaseCommand({
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
|
|
2
|
+
import "./command-augment-D9pI9Vbh.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
|
|
4
|
+
import "./input-BGyHn0Kr.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-xS1tWJAq.mjs";
|
|
6
|
+
import { UploadUpdateResult, readCsvFile, requireUploadFilePath, updateTableFromCsv, uploadUpdateResultView } from "./requests-DYrDe-D0.mjs";
|
|
7
|
+
|
|
8
|
+
//#region src/commands/upload/replace.ts
|
|
9
|
+
var replace_default = defineMetabaseCommand({
|
|
10
|
+
meta: {
|
|
11
|
+
name: "replace",
|
|
12
|
+
description: "Replace an existing uploaded table's rows with a CSV file"
|
|
13
|
+
},
|
|
14
|
+
details: "Replaces the contents of the table with the given id with the rows of the CSV. The table must have been created by a CSV upload and the CSV columns must match.",
|
|
15
|
+
capabilities: { minVersion: 58 },
|
|
16
|
+
args: {
|
|
17
|
+
...outputFlags,
|
|
18
|
+
...profileFlag,
|
|
19
|
+
...connectionFlags,
|
|
20
|
+
file: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "Path to the CSV/TSV file to upload"
|
|
23
|
+
},
|
|
24
|
+
id: {
|
|
25
|
+
type: "positional",
|
|
26
|
+
description: "Target table id",
|
|
27
|
+
required: true
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
outputSchema: UploadUpdateResult,
|
|
31
|
+
examples: ["mb upload replace 42 --file rows.csv", "mb upload replace 42 --file rows.csv --json"],
|
|
32
|
+
async run({ args, ctx, getClient }) {
|
|
33
|
+
const id = parseId(args.id);
|
|
34
|
+
const file = await readCsvFile(requireUploadFilePath(args.file));
|
|
35
|
+
const client = await getClient();
|
|
36
|
+
const result = await updateTableFromCsv(client, id, "replace", file);
|
|
37
|
+
renderSummary(result, uploadUpdateResultView, `Replaced table ${id} with "${file.filename}".`, ctx);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
//#endregion
|
|
42
|
+
export { replace_default as default };
|