@metabase/cli 0.1.11 → 0.1.13
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 +34 -22
- package/dist/{add-collection-DKULSPwT.mjs → add-collection-BQsx2Q-S.mjs} +5 -5
- package/dist/add-collection-BiBKEHwz.mjs +10 -0
- package/dist/{archive-y-_m3XID.mjs → archive-BP53zrzs.mjs} +6 -6
- package/dist/{archive-BLbaqc-5.mjs → archive-BS4U2_gi.mjs} +7 -7
- package/dist/{archive-BL_0fXhf.mjs → archive-BrYMa87Z.mjs} +6 -6
- package/dist/{archive-ibJVYsBC.mjs → archive-D7qtYihp.mjs} +6 -6
- package/dist/{archive-BLxX3J6I.mjs → archive-Dt5zuiwu.mjs} +6 -6
- package/dist/{archive-BJ6uL3hh.mjs → archive-FLrOqODN.mjs} +7 -7
- package/dist/{archive-DQsV2uwy.mjs → archive-H8wBIt8q.mjs} +7 -7
- package/dist/auth-DWA7DSo9.mjs +19 -0
- package/dist/{body-DCQg78AF.mjs → body-3vzTm8Jj.mjs} +3 -3
- package/dist/{branches-CJVscsZe.mjs → branches-Lr1cCUdg.mjs} +6 -6
- package/dist/{cancel-C8W0sPix.mjs → cancel-Br3FHyDR.mjs} +5 -5
- package/dist/{cancel-task-dDgQDswT.mjs → cancel-task-BXgeq3MH.mjs} +6 -6
- package/dist/{capabilities-7L9GVMd_.mjs → capabilities-BX1rnVuH.mjs} +2 -14
- package/dist/card-DQV8WOIa.mjs +20 -0
- package/dist/{card-DnIeMmUn.mjs → card-wCPcuKSi.mjs} +1 -1
- package/dist/{cards-B7HE8BT6.mjs → cards-D-AkjCxr.mjs} +6 -6
- package/dist/cli.mjs +25 -25
- package/dist/collection-DIUWkVFY.mjs +20 -0
- package/dist/{collection-namespace-CBCApZJf.mjs → collection-namespace-BQ_ebqOP.mjs} +2 -2
- package/dist/{command-augment-BH9qgQ5u.mjs → command-augment-CAur0XOQ.mjs} +13 -2
- package/dist/{create-84jcfY4N.mjs → create-BpAak62U.mjs} +9 -9
- package/dist/{create-VjvMdgM5.mjs → create-C1xYECl-.mjs} +8 -8
- package/dist/{create-vNcD4jfq.mjs → create-CDL9WHiR.mjs} +10 -10
- package/dist/{create-Di9NY7kK.mjs → create-CcZEV9xx.mjs} +8 -8
- package/dist/{create-DN8us8si.mjs → create-DHUhRzcV.mjs} +11 -11
- package/dist/{create-BQA6nM5n.mjs → create-DUdkitlQ.mjs} +12 -12
- package/dist/{create-B6mzc8UK.mjs → create-Dx1SDXyQ.mjs} +8 -8
- package/dist/{create-branch-CCoDX2Qf.mjs → create-branch-BvZKizC4.mjs} +6 -6
- package/dist/{create-BWaBYzhC.mjs → create-ux0yPpq1.mjs} +10 -10
- package/dist/{create-DPASPFGi.mjs → create-y4j2I1aH.mjs} +11 -11
- package/dist/{current-task-QdxA3mSX.mjs → current-task-DaWn0DYt.mjs} +6 -6
- package/dist/dashboard-CohHWhkV.mjs +21 -0
- package/dist/{database-Dsv4QBs0.mjs → database-BmsxuRmO.mjs} +1 -1
- package/dist/db-BD8JZUDw.mjs +22 -0
- package/dist/{delete-CE_Jfjni.mjs → delete-CW3cEHlr.mjs} +7 -7
- package/dist/{delete-ByJ6guaH.mjs → delete-DFWjBpzl.mjs} +7 -7
- package/dist/{delete-runtime-CjFc69tS.mjs → delete-runtime-BhZAAvjc.mjs} +3 -3
- package/dist/{delete-table-D5LDUkOk.mjs → delete-table-Wa0yRsnM.mjs} +7 -7
- package/dist/{dirty-C6yzkIPn.mjs → dirty-CKcGYIpv.mjs} +6 -6
- package/dist/document-CRuag6F5.mjs +19 -0
- package/dist/{eid-ZOyix96k.mjs → eid-m44hs7Ul.mjs} +7 -7
- package/dist/{error-C1bUYXn7.mjs → error-DR_i1hxJ.mjs} +40 -5
- package/dist/{export-BhbBX-pl.mjs → export-8C4F9pYn.mjs} +8 -8
- package/dist/field-CuabjsR7.mjs +18 -0
- package/dist/{fields-CZ6IK8Qf.mjs → fields-hXrRjf7e.mjs} +7 -7
- package/dist/{get-D49EdHgH.mjs → get-3zFOkcl_.mjs} +7 -7
- package/dist/{get-CqKttHWW.mjs → get-8r-_QuSr.mjs} +6 -6
- package/dist/{get-DlzC0xCg.mjs → get-9MCrsgTf.mjs} +8 -8
- package/dist/{get-B03gdAun.mjs → get-BjCQctuS.mjs} +6 -6
- package/dist/{get-C0emTO1r.mjs → get-BlNLGR-F.mjs} +6 -6
- package/dist/{get-9b0ZEWh1.mjs → get-BxgSKzca.mjs} +6 -6
- package/dist/{get-mR01pCNG.mjs → get-C7EKJGTP.mjs} +6 -6
- package/dist/{get-Bbo2Y-aL.mjs → get-Cit5liJv.mjs} +7 -7
- package/dist/{get-BtqQ98nb.mjs → get-CqU4xVSg.mjs} +5 -5
- package/dist/{get-157SWRte.mjs → get-CvLECgtm.mjs} +6 -6
- package/dist/{get-nl41R-2q.mjs → get-D7WUNQYY.mjs} +6 -6
- package/dist/{get-BKWZA_22.mjs → get-DWg3riaY.mjs} +6 -6
- package/dist/{get-DIyv2a7h.mjs → get-cjqlMKF5.mjs} +6 -6
- package/dist/{get-run-_dlMCGp5.mjs → get-run-CTDPEDcU.mjs} +6 -6
- package/dist/{get-DclzgC5G.mjs → get-xVPjvf7O.mjs} +6 -6
- package/dist/git-sync-CKsGGVOm.mjs +28 -0
- package/dist/{has-remote-changes-CToITRyl.mjs → has-remote-changes-DYo4PQfC.mjs} +6 -6
- package/dist/{import-xnYHb4QX.mjs → import-Cwd-_wYv.mjs} +8 -8
- package/dist/{input-xewHccej.mjs → input-BXWgdKiS.mjs} +26 -4
- package/dist/{is-dirty-BHyMmUVV.mjs → is-dirty-HynZex-f.mjs} +4 -4
- package/dist/is-dirty-Mkgi21bq.mjs +9 -0
- package/dist/{items-D3AmbIOO.mjs → items-D4pSBGxR.mjs} +8 -8
- package/dist/{key-y4TtxKwU.mjs → key-C8q5oIr5.mjs} +1 -1
- package/dist/{list-CIu1zfpU.mjs → list-B2QX8BZ3.mjs} +5 -5
- package/dist/{list-D7Np4fwk.mjs → list-Bqy3rN6k.mjs} +5 -5
- package/dist/{list-BhZYkbc9.mjs → list-CI1WQ8U3.mjs} +7 -7
- package/dist/{list-DKPhFATP.mjs → list-Ctze3nfU.mjs} +5 -5
- package/dist/{list-BtTRJyrR.mjs → list-D-Ms9fhd.mjs} +7 -7
- package/dist/{list-BdStkg8G.mjs → list-D3BBrpoQ.mjs} +5 -5
- package/dist/{list-BkzrFyJO.mjs → list-D7o0DOZe.mjs} +5 -5
- package/dist/{list-DSJwMHXB.mjs → list-DBjOFesD.mjs} +6 -6
- package/dist/{list-C5NywUBH.mjs → list-DMZumpNv.mjs} +5 -5
- package/dist/{list-Byn-dRW4.mjs → list-De2qX1w8.mjs} +7 -7
- package/dist/{list-CA6MlByL.mjs → list-ET066OdN.mjs} +5 -5
- package/dist/{list-C_d7ppOJ.mjs → list-F0BQNbaZ.mjs} +25 -18
- package/dist/{list-BHCVZh7Q.mjs → list-XgdM17ix.mjs} +6 -6
- package/dist/{list-5ZZfaOzm.mjs → list-_xdr1WKh.mjs} +5 -5
- package/dist/login-BHDdLJzw.mjs +453 -0
- package/dist/{logout-Bltlsm6u.mjs → logout-ClizU0OL.mjs} +15 -6
- package/dist/{manifest-BPHqF5LY.mjs → manifest-DYeLri80.mjs} +2 -2
- package/dist/measure-SmyQt9Lg.mjs +19 -0
- package/dist/{metadata-BKcyjsoA.mjs → metadata-D23RdbEZ.mjs} +8 -8
- package/dist/{metadata-Bf2TfG8F.mjs → metadata-a_N6Sx30.mjs} +7 -7
- package/dist/{parse-enum-Dr7ACrTR.mjs → parse-enum-BatHQ-Gs.mjs} +1 -1
- package/dist/{parse-id-CWRJlQVK.mjs → parse-id-B1BlAunl.mjs} +1 -1
- package/dist/{parse-ref-BiETXmvm.mjs → parse-ref-CZr1bYIl.mjs} +1 -1
- package/dist/{path-Djw9IARu.mjs → path-FSfPscAQ.mjs} +5 -5
- package/dist/{poll-hJrV0cPm.mjs → poll-Dl5Zv4Ed.mjs} +2 -2
- package/dist/{poll-task-DK6X9Juu.mjs → poll-task-BoRK94WQ.mjs} +2 -2
- package/dist/{preflight-DjSPp3Ct.mjs → preflight-CVlo39xa.mjs} +4 -4
- package/dist/process-DsGf7Mg5.mjs +73 -0
- package/dist/{prompt-u4WhE4T5.mjs → prompt-Bc_bHSD0.mjs} +13 -3
- package/dist/{query-Cc-9oPsW.mjs → query-CSvpJssD.mjs} +8 -8
- package/dist/{query-result-B4kTRid7.mjs → query-result-L5_NrwQR.mjs} +1 -1
- package/dist/{query-Do5n5SZc.mjs → query-yZ9HeaGp.mjs} +12 -12
- package/dist/{remove-collection-DVvnmU06.mjs → remove-collection-CV7ssevw.mjs} +8 -8
- package/dist/{render-BQHJhSP1.mjs → render-CkuFkWlQ.mjs} +6 -1
- package/dist/{rescan-values-CHluR3JC.mjs → rescan-values-CMeOv6yx.mjs} +8 -8
- package/dist/{run-CcJbcaw8.mjs → run-CIJOYXor.mjs} +8 -8
- package/dist/{runs-Dc8qZBhl.mjs → runs--CzbmfPg.mjs} +7 -7
- package/dist/{runtime-jWkzCPlL.mjs → runtime-DJTGfiKO.mjs} +591 -123
- package/dist/{schema-tables-CZ6EMHUZ.mjs → schema-tables-BII9pHR8.mjs} +7 -7
- package/dist/{schemas-Br1cpOZc.mjs → schemas-BzxVz71I.mjs} +5 -5
- package/dist/{search-DB2joPgt.mjs → search-CjJZdaM0.mjs} +5 -5
- package/dist/segment-dkO4Ualw.mjs +19 -0
- package/dist/{set-BRhVzEWd.mjs → set-Ds_brNWu.mjs} +8 -8
- package/dist/{setting-CuxO4T1n.mjs → setting-YDJRWd1m.mjs} +3 -3
- package/dist/{setup-Bn4jwxdl.mjs → setup-DJb-NgSM.mjs} +7 -7
- package/dist/{skills-CY_FmaPo.mjs → skills-CJ8g8fhQ.mjs} +1 -1
- package/dist/{skills-Db1r65S5.mjs → skills-Dn-kn8Wj.mjs} +3 -3
- package/dist/snippet-DqTiC73e.mjs +19 -0
- package/dist/{stash-Dp2JFgmp.mjs → stash-DGujowmx.mjs} +8 -8
- package/dist/{status-BxGBwALE.mjs → status-3-Tl07gu.mjs} +14 -6
- package/dist/{status-j09luNai.mjs → status-Cx0TIn1I.mjs} +7 -7
- package/dist/{summary-DVrj7DSa.mjs → summary-CT-xFvnX.mjs} +6 -6
- package/dist/{sync-schema-BVHvjzGX.mjs → sync-schema-BTF7O3FM.mjs} +10 -10
- package/dist/table-DNGPtV4P.mjs +19 -0
- package/dist/{table-CkWja2UH.mjs → table-qDD2kApF.mjs} +1 -1
- package/dist/transform-DEbvouxo.mjs +24 -0
- package/dist/transform-job-Du8npb7F.mjs +19 -0
- package/dist/{tree-BEPw6xbY.mjs → tree-CLUxXw-Z.mjs} +5 -5
- package/dist/{update-CAoOJRwz.mjs → update-6IuvkFCk.mjs} +11 -11
- package/dist/{update-DiG6SSGm.mjs → update-BeH_S7h9.mjs} +9 -9
- package/dist/{update-Bd0ASKUG.mjs → update-BfNmqvuN.mjs} +13 -13
- package/dist/{update-B5VBJFU9.mjs → update-C_Ui5qPU.mjs} +12 -12
- package/dist/{update-BXaT0Faw.mjs → update-DD5Q37bz.mjs} +9 -9
- package/dist/{update-DzKPxRBE.mjs → update-DdqzxPIr.mjs} +12 -12
- package/dist/{update-fVqLtZ_t.mjs → update-DpCv5Mdo.mjs} +9 -9
- package/dist/{update-C5vlBTII.mjs → update-I0t_6Mni.mjs} +9 -9
- package/dist/{update-C875_WGf.mjs → update-Z_LMzsiz.mjs} +11 -11
- package/dist/{update-dashcard-7bZtw04E.mjs → update-dashcard-Bl3wbB8-.mjs} +9 -9
- package/dist/{update-Bn5wUyTQ.mjs → update-tQvEYuzD.mjs} +10 -10
- package/dist/{upgrade-DdCxE9Ml.mjs → upgrade-r2ZlfstE.mjs} +6 -34
- package/dist/{uuid-DywghRXO.mjs → uuid-BduDonqb.mjs} +4 -4
- package/dist/{validate-B62TRDGV.mjs → validate-VawhJ5Sc.mjs} +2 -2
- package/dist/{validate-query-BpiN1CFu.mjs → validate-query-CSV-TTnd.mjs} +3 -3
- package/dist/{values-DSul3siC.mjs → values-DuNE6Jxc.mjs} +6 -6
- package/dist/{verify-DzDyKXOa.mjs → verify-D_yq68-R.mjs} +5 -5
- package/dist/{wait-CacFZI5Y.mjs → wait-CoDzO37B.mjs} +7 -7
- package/dist/{wait-flags-DV419apK.mjs → wait-flags-BxUfF5zy.mjs} +2 -2
- package/package.json +1 -1
- package/dist/add-collection-DyEe_xRO.mjs +0 -10
- package/dist/auth-BKaQjcmP.mjs +0 -19
- package/dist/card-CGBvUmCW.mjs +0 -20
- package/dist/collection-Ch7pPKHD.mjs +0 -20
- package/dist/dashboard-BDb2krMr.mjs +0 -21
- package/dist/db-CoVdkdVm.mjs +0 -22
- package/dist/document-BA2S1ev3.mjs +0 -19
- package/dist/field-B5bptFqL.mjs +0 -18
- package/dist/git-sync-DqJmONiB.mjs +0 -28
- package/dist/is-dirty-BvA3yzRc.mjs +0 -9
- package/dist/login-jWvDDvEm.mjs +0 -180
- package/dist/measure-DBX4k13t.mjs +0 -19
- package/dist/segment-BWcyA1P-.mjs +0 -19
- package/dist/snippet-C9UM6NwC.mjs +0 -19
- package/dist/table-DYI8K12W.mjs +0 -19
- package/dist/transform-CvbMbJtI.mjs +0 -24
- package/dist/transform-job-CtzgvccZ.mjs +0 -19
- /package/dist/{body-flags-D78h_-Ua.mjs → body-flags-D7q87Btw.mjs} +0 -0
- /package/dist/{collection-BPTlcFw5.mjs → collection-Deiziuu2.mjs} +0 -0
- /package/dist/{dashboard-FY5UzJ_Z.mjs → dashboard-B4bn3z6t.mjs} +0 -0
- /package/dist/{document-CcfiiV3b.mjs → document-qfwR0r63.mjs} +0 -0
- /package/dist/{field-MGxpNQUH.mjs → field-E0IBy4Uw.mjs} +0 -0
- /package/dist/{measure-COGAoZpo.mjs → measure-JJAdFoqK.mjs} +0 -0
- /package/dist/{paginate-Dfm9eO9A.mjs → paginate-BexjkjbY.mjs} +0 -0
- /package/dist/{revision-message-flag-Bo-Kvv6F.mjs → revision-message-flag-C7zBeWEt.mjs} +0 -0
- /package/dist/{segment-d-708KKO.mjs → segment-B9SEv9V_.mjs} +0 -0
- /package/dist/{setting-CSJvi1-6.mjs → setting-i0pugNHl.mjs} +0 -0
- /package/dist/{snippet-BZvo05ua.mjs → snippet-NNzqlksR.mjs} +0 -0
- /package/dist/{transform-job-n8W6tLqF.mjs → transform-job-B9pXBOwr.mjs} +0 -0
- /package/dist/{transform--dviwMA1.mjs → transform-qczxOAzn.mjs} +0 -0
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import "./input-
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import "./validate-
|
|
10
|
-
import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-
|
|
11
|
-
import { Measure, MeasureUpdateInput, measureView } from "./measure-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import "./input-BXWgdKiS.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-B1BlAunl.mjs";
|
|
7
|
+
import { readBody } from "./body-3vzTm8Jj.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import "./validate-VawhJ5Sc.mjs";
|
|
10
|
+
import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-CSV-TTnd.mjs";
|
|
11
|
+
import { Measure, MeasureUpdateInput, measureView } from "./measure-JJAdFoqK.mjs";
|
|
12
12
|
|
|
13
13
|
//#region src/commands/measure/update.ts
|
|
14
14
|
var update_default = defineMetabaseCommand({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ConfigError } from "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import "./input-
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
7
|
-
import { readBody } from "./body-
|
|
8
|
-
import { bodyInputFlags } from "./body-flags-
|
|
9
|
-
import { DashboardDetail, Dashcard, DashcardPatchInput, dashcardView } from "./dashboard-
|
|
1
|
+
import { ConfigError } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import "./input-BXWgdKiS.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-B1BlAunl.mjs";
|
|
7
|
+
import { readBody } from "./body-3vzTm8Jj.mjs";
|
|
8
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
9
|
+
import { DashboardDetail, Dashcard, DashcardPatchInput, dashcardView } from "./dashboard-B4bn3z6t.mjs";
|
|
10
10
|
|
|
11
11
|
//#region src/commands/dashboard/update-dashcard.ts
|
|
12
12
|
var update_dashcard_default = defineMetabaseCommand({
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import "./input-
|
|
6
|
-
import "./field-
|
|
7
|
-
import { parseId } from "./parse-id-
|
|
8
|
-
import { readBody } from "./body-
|
|
9
|
-
import { bodyInputFlags } from "./body-flags-
|
|
10
|
-
import { Table, TableUpdateInput, tableView } from "./table-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import "./input-BXWgdKiS.mjs";
|
|
6
|
+
import "./field-E0IBy4Uw.mjs";
|
|
7
|
+
import { parseId } from "./parse-id-B1BlAunl.mjs";
|
|
8
|
+
import { readBody } from "./body-3vzTm8Jj.mjs";
|
|
9
|
+
import { bodyInputFlags } from "./body-flags-D7q87Btw.mjs";
|
|
10
|
+
import { Table, TableUpdateInput, tableView } from "./table-qDD2kApF.mjs";
|
|
11
11
|
|
|
12
12
|
//#region src/commands/table/update.ts
|
|
13
13
|
var update_default = defineMetabaseCommand({
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { AbortError, NetworkError, TimeoutError, UnknownError, errorMessage
|
|
2
|
-
import { outputFlags, package_default } from "./error-
|
|
3
|
-
import { HttpError, USER_AGENT, combineAborts, defineMetabaseCommand, parseJson, throwIfAborted } from "./runtime-
|
|
4
|
-
import { renderItem, writeText } from "./capabilities-
|
|
5
|
-
import { promptConfirm } from "./prompt-
|
|
1
|
+
import { AbortError, NetworkError, TimeoutError, UnknownError, errorMessage } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { outputFlags, package_default } from "./error-DR_i1hxJ.mjs";
|
|
3
|
+
import { HttpError, USER_AGENT, combineAborts, defineMetabaseCommand, parseJson, throwIfAborted } from "./runtime-DJTGfiKO.mjs";
|
|
4
|
+
import { renderItem, writeText } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { promptConfirm } from "./prompt-Bc_bHSD0.mjs";
|
|
6
|
+
import { streamProcess } from "./process-DsGf7Mg5.mjs";
|
|
6
7
|
import { z } from "zod";
|
|
7
8
|
import { realpathSync } from "node:fs";
|
|
8
9
|
import { compare, valid } from "semver";
|
|
9
|
-
import { spawn } from "node:child_process";
|
|
10
10
|
|
|
11
11
|
//#region src/core/http/npm-registry.ts
|
|
12
12
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org";
|
|
@@ -249,34 +249,6 @@ function compareSemver(a, b) {
|
|
|
249
249
|
return compare(a, b);
|
|
250
250
|
}
|
|
251
251
|
|
|
252
|
-
//#endregion
|
|
253
|
-
//#region src/runtime/process.ts
|
|
254
|
-
var ProcessNotFoundError = class extends Error {
|
|
255
|
-
command;
|
|
256
|
-
constructor(command) {
|
|
257
|
-
super(`command not found: ${command}`);
|
|
258
|
-
this.name = "ProcessNotFoundError";
|
|
259
|
-
this.command = command;
|
|
260
|
-
}
|
|
261
|
-
};
|
|
262
|
-
const stdoutDecoder = new TextDecoder("utf-8");
|
|
263
|
-
function streamProcess(command, args, options = {}) {
|
|
264
|
-
return new Promise((resolve, reject) => {
|
|
265
|
-
const child = spawn(command, args, {
|
|
266
|
-
stdio: "inherit",
|
|
267
|
-
...options.shell === true ? { shell: true } : {}
|
|
268
|
-
});
|
|
269
|
-
child.on("error", (error) => {
|
|
270
|
-
if (isNotFoundError(error)) {
|
|
271
|
-
reject(new ProcessNotFoundError(command));
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
reject(error);
|
|
275
|
-
});
|
|
276
|
-
child.on("close", (code) => resolve(code));
|
|
277
|
-
});
|
|
278
|
-
}
|
|
279
|
-
|
|
280
252
|
//#endregion
|
|
281
253
|
//#region src/commands/upgrade.ts
|
|
282
254
|
const UpgradeCommandSchema = z.object({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ConfigError } from "./command-augment-
|
|
2
|
-
import { outputFlags } from "./error-
|
|
3
|
-
import { defineMetabaseCommand, parseInteger } from "./runtime-
|
|
4
|
-
import { writeJson, writeText } from "./capabilities-
|
|
1
|
+
import { ConfigError } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { outputFlags } from "./error-DR_i1hxJ.mjs";
|
|
3
|
+
import { defineMetabaseCommand, parseInteger } from "./runtime-DJTGfiKO.mjs";
|
|
4
|
+
import { writeJson, writeText } from "./capabilities-BX1rnVuH.mjs";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ConfigError, escapeJsonPointerSegment } from "./command-augment-
|
|
2
|
-
import { isPlainObject } from "./capabilities-
|
|
1
|
+
import { ConfigError, escapeJsonPointerSegment } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { isPlainObject } from "./capabilities-BX1rnVuH.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
import Ajv2020 from "ajv/dist/2020.js";
|
|
5
5
|
import addFormats from "ajv-formats";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ConfigError } from "./command-augment-
|
|
2
|
-
import { writeJson } from "./capabilities-
|
|
3
|
-
import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-
|
|
1
|
+
import { ConfigError } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { writeJson } from "./capabilities-BX1rnVuH.mjs";
|
|
3
|
+
import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-VawhJ5Sc.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/commands/validate-query.ts
|
|
6
6
|
const skipValidateFlag = { "skip-validate": {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { formatScalar, renderSummary } from "./capabilities-
|
|
5
|
-
import { FieldValues, fieldValuesView } from "./field-
|
|
6
|
-
import { parseId } from "./parse-id-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
|
|
4
|
+
import { formatScalar, renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { FieldValues, fieldValuesView } from "./field-E0IBy4Uw.mjs";
|
|
6
|
+
import { parseId } from "./parse-id-B1BlAunl.mjs";
|
|
7
7
|
|
|
8
8
|
//#region src/commands/field/values.ts
|
|
9
9
|
var values_default = defineMetabaseCommand({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MetabaseError, NetworkError, TimeoutError, errorMessage } from "./command-augment-
|
|
2
|
-
import { HttpError, createClient, probeServer } from "./runtime-
|
|
1
|
+
import { MetabaseError, NetworkError, TimeoutError, errorMessage } from "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { HttpError, createClient, probeServer } from "./runtime-DJTGfiKO.mjs";
|
|
3
3
|
import { z } from "zod";
|
|
4
4
|
|
|
5
5
|
//#region src/domain/user.ts
|
|
@@ -20,11 +20,11 @@ const CurrentUserCompact = CurrentUser.pick({
|
|
|
20
20
|
//#region src/core/auth/verify.ts
|
|
21
21
|
const VERIFY_TIMEOUT_MS = 15e3;
|
|
22
22
|
const USER_PATH = "/api/user/current";
|
|
23
|
-
async function verifyAndProbe(url,
|
|
23
|
+
async function verifyAndProbe(url, credential, refresh) {
|
|
24
24
|
const client = createClient({
|
|
25
25
|
url,
|
|
26
|
-
|
|
27
|
-
});
|
|
26
|
+
credential
|
|
27
|
+
}, refresh === void 0 ? {} : { refreshCredential: refresh });
|
|
28
28
|
const userPromise = client.requestParsed(CurrentUser, USER_PATH, {
|
|
29
29
|
timeoutMs: VERIFY_TIMEOUT_MS,
|
|
30
30
|
retries: 0
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import "./command-augment-
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-
|
|
3
|
-
import { defineMetabaseCommand } from "./runtime-
|
|
4
|
-
import { renderSummary } from "./capabilities-
|
|
5
|
-
import { parseId } from "./parse-id-
|
|
6
|
-
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-
|
|
7
|
-
import { SyncTaskOrIdle, formatSyncTask, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-
|
|
1
|
+
import "./command-augment-CAur0XOQ.mjs";
|
|
2
|
+
import { connectionFlags, outputFlags, profileFlag } from "./error-DR_i1hxJ.mjs";
|
|
3
|
+
import { defineMetabaseCommand } from "./runtime-DJTGfiKO.mjs";
|
|
4
|
+
import { renderSummary } from "./capabilities-BX1rnVuH.mjs";
|
|
5
|
+
import { parseId } from "./parse-id-B1BlAunl.mjs";
|
|
6
|
+
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-Dl5Zv4Ed.mjs";
|
|
7
|
+
import { SyncTaskOrIdle, formatSyncTask, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-BoRK94WQ.mjs";
|
|
8
8
|
|
|
9
9
|
//#region src/commands/git-sync/wait.ts
|
|
10
10
|
const WaitResult = SyncTaskOrIdle;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { parseId } from "./parse-id-
|
|
2
|
-
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-
|
|
1
|
+
import { parseId } from "./parse-id-B1BlAunl.mjs";
|
|
2
|
+
import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-Dl5Zv4Ed.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/commands/wait-flags.ts
|
|
5
5
|
const waitScheduleFlags = {
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import "./error-C1bUYXn7.mjs";
|
|
3
|
-
import "./runtime-jWkzCPlL.mjs";
|
|
4
|
-
import "./capabilities-7L9GVMd_.mjs";
|
|
5
|
-
import "./parse-id-CWRJlQVK.mjs";
|
|
6
|
-
import "./poll-hJrV0cPm.mjs";
|
|
7
|
-
import "./poll-task-DK6X9Juu.mjs";
|
|
8
|
-
import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-DKULSPwT.mjs";
|
|
9
|
-
|
|
10
|
-
export { add_collection_default as default };
|
package/dist/auth-BKaQjcmP.mjs
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/auth/index.ts
|
|
4
|
-
var auth_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "auth",
|
|
7
|
-
description: "Authenticate against a Metabase instance"
|
|
8
|
-
},
|
|
9
|
-
default: "login",
|
|
10
|
-
subCommands: {
|
|
11
|
-
login: () => import("./login-jWvDDvEm.mjs").then((m) => m.default),
|
|
12
|
-
status: () => import("./status-BxGBwALE.mjs").then((m) => m.default),
|
|
13
|
-
list: () => import("./list-C_d7ppOJ.mjs").then((m) => m.default),
|
|
14
|
-
logout: () => import("./logout-Bltlsm6u.mjs").then((m) => m.default)
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { auth_default as default };
|
package/dist/card-CGBvUmCW.mjs
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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-BhZYkbc9.mjs").then((mod) => mod.default),
|
|
11
|
-
get: () => import("./get-D49EdHgH.mjs").then((mod) => mod.default),
|
|
12
|
-
query: () => import("./query-Cc-9oPsW.mjs").then((mod) => mod.default),
|
|
13
|
-
create: () => import("./create-DN8us8si.mjs").then((mod) => mod.default),
|
|
14
|
-
update: () => import("./update-DzKPxRBE.mjs").then((mod) => mod.default),
|
|
15
|
-
archive: () => import("./archive-BJ6uL3hh.mjs").then((mod) => mod.default)
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { card_default as default };
|
|
@@ -1,20 +0,0 @@
|
|
|
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-DSJwMHXB.mjs").then((mod) => mod.default),
|
|
11
|
-
get: () => import("./get-C0emTO1r.mjs").then((mod) => mod.default),
|
|
12
|
-
items: () => import("./items-D3AmbIOO.mjs").then((mod) => mod.default),
|
|
13
|
-
tree: () => import("./tree-BEPw6xbY.mjs").then((mod) => mod.default),
|
|
14
|
-
create: () => import("./create-84jcfY4N.mjs").then((mod) => mod.default),
|
|
15
|
-
archive: () => import("./archive-y-_m3XID.mjs").then((mod) => mod.default)
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
//#endregion
|
|
20
|
-
export { collection_default as default };
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/dashboard/index.ts
|
|
4
|
-
var dashboard_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "dashboard",
|
|
7
|
-
description: "Manage Metabase dashboards"
|
|
8
|
-
},
|
|
9
|
-
subCommands: {
|
|
10
|
-
list: () => import("./list-BHCVZh7Q.mjs").then((mod) => mod.default),
|
|
11
|
-
get: () => import("./get-157SWRte.mjs").then((mod) => mod.default),
|
|
12
|
-
cards: () => import("./cards-B7HE8BT6.mjs").then((mod) => mod.default),
|
|
13
|
-
create: () => import("./create-BQA6nM5n.mjs").then((mod) => mod.default),
|
|
14
|
-
update: () => import("./update-Bd0ASKUG.mjs").then((mod) => mod.default),
|
|
15
|
-
"update-dashcard": () => import("./update-dashcard-7bZtw04E.mjs").then((mod) => mod.default),
|
|
16
|
-
archive: () => import("./archive-ibJVYsBC.mjs").then((mod) => mod.default)
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
//#endregion
|
|
21
|
-
export { dashboard_default as default };
|
package/dist/db-CoVdkdVm.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/db/index.ts
|
|
4
|
-
var db_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "db",
|
|
7
|
-
description: "Inspect and sync Metabase databases",
|
|
8
|
-
alias: "database"
|
|
9
|
-
},
|
|
10
|
-
subCommands: {
|
|
11
|
-
list: () => import("./list-BtTRJyrR.mjs").then((m) => m.default),
|
|
12
|
-
get: () => import("./get-DlzC0xCg.mjs").then((m) => m.default),
|
|
13
|
-
metadata: () => import("./metadata-BKcyjsoA.mjs").then((m) => m.default),
|
|
14
|
-
schemas: () => import("./schemas-Br1cpOZc.mjs").then((m) => m.default),
|
|
15
|
-
"schema-tables": () => import("./schema-tables-CZ6EMHUZ.mjs").then((m) => m.default),
|
|
16
|
-
"sync-schema": () => import("./sync-schema-BVHvjzGX.mjs").then((m) => m.default),
|
|
17
|
-
"rescan-values": () => import("./rescan-values-CHluR3JC.mjs").then((m) => m.default)
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
//#endregion
|
|
22
|
-
export { db_default as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/document/index.ts
|
|
4
|
-
var document_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "document",
|
|
7
|
-
description: "Manage Metabase documents"
|
|
8
|
-
},
|
|
9
|
-
subCommands: {
|
|
10
|
-
list: () => import("./list-CA6MlByL.mjs").then((mod) => mod.default),
|
|
11
|
-
get: () => import("./get-DclzgC5G.mjs").then((mod) => mod.default),
|
|
12
|
-
create: () => import("./create-Di9NY7kK.mjs").then((mod) => mod.default),
|
|
13
|
-
update: () => import("./update-DiG6SSGm.mjs").then((mod) => mod.default),
|
|
14
|
-
archive: () => import("./archive-BLxX3J6I.mjs").then((mod) => mod.default)
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { document_default as default };
|
package/dist/field-B5bptFqL.mjs
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/field/index.ts
|
|
4
|
-
var field_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "field",
|
|
7
|
-
description: "Manage Metabase fields"
|
|
8
|
-
},
|
|
9
|
-
subCommands: {
|
|
10
|
-
get: () => import("./get-B03gdAun.mjs").then((m) => m.default),
|
|
11
|
-
values: () => import("./values-DSul3siC.mjs").then((m) => m.default),
|
|
12
|
-
summary: () => import("./summary-DVrj7DSa.mjs").then((m) => m.default),
|
|
13
|
-
update: () => import("./update-fVqLtZ_t.mjs").then((m) => m.default)
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
export { field_default as default };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/git-sync/index.ts
|
|
4
|
-
var git_sync_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "git-sync",
|
|
7
|
-
description: "Sync Metabase content with a git remote"
|
|
8
|
-
},
|
|
9
|
-
subCommands: {
|
|
10
|
-
status: () => import("./status-j09luNai.mjs").then((mod) => mod.default),
|
|
11
|
-
"is-dirty": () => import("./is-dirty-BvA3yzRc.mjs").then((mod) => mod.default),
|
|
12
|
-
"has-remote-changes": () => import("./has-remote-changes-CToITRyl.mjs").then((mod) => mod.default),
|
|
13
|
-
dirty: () => import("./dirty-C6yzkIPn.mjs").then((mod) => mod.default),
|
|
14
|
-
"current-task": () => import("./current-task-QdxA3mSX.mjs").then((mod) => mod.default),
|
|
15
|
-
"cancel-task": () => import("./cancel-task-dDgQDswT.mjs").then((mod) => mod.default),
|
|
16
|
-
wait: () => import("./wait-CacFZI5Y.mjs").then((mod) => mod.default),
|
|
17
|
-
import: () => import("./import-xnYHb4QX.mjs").then((mod) => mod.default),
|
|
18
|
-
export: () => import("./export-BhbBX-pl.mjs").then((mod) => mod.default),
|
|
19
|
-
stash: () => import("./stash-Dp2JFgmp.mjs").then((mod) => mod.default),
|
|
20
|
-
branches: () => import("./branches-CJVscsZe.mjs").then((mod) => mod.default),
|
|
21
|
-
"create-branch": () => import("./create-branch-CCoDX2Qf.mjs").then((mod) => mod.default),
|
|
22
|
-
"add-collection": () => import("./add-collection-DyEe_xRO.mjs").then((mod) => mod.default),
|
|
23
|
-
"remove-collection": () => import("./remove-collection-DVvnmU06.mjs").then((mod) => mod.default)
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
export { git_sync_default as default };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import "./error-C1bUYXn7.mjs";
|
|
3
|
-
import "./runtime-jWkzCPlL.mjs";
|
|
4
|
-
import "./capabilities-7L9GVMd_.mjs";
|
|
5
|
-
import "./poll-hJrV0cPm.mjs";
|
|
6
|
-
import "./poll-task-DK6X9Juu.mjs";
|
|
7
|
-
import { IsDirtyResult, is_dirty_default } from "./is-dirty-BHyMmUVV.mjs";
|
|
8
|
-
|
|
9
|
-
export { is_dirty_default as default };
|
package/dist/login-jWvDDvEm.mjs
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import { ConfigError, errorMessage } from "./command-augment-BH9qgQ5u.mjs";
|
|
2
|
-
import { connectionFlags, outputFlags, profileFlag } from "./error-C1bUYXn7.mjs";
|
|
3
|
-
import { DEFAULT_PROFILE, ParsedVersionSchema, ProbedUser, defineMetabaseCommand, explicitProfileName, keyringFallbackWarning, normalizeUrl, readEnvCredentials, writeProbeFailure, writeProbeResult, writeProfile } from "./runtime-jWkzCPlL.mjs";
|
|
4
|
-
import { verifyAndProbe } from "./verify-DzDyKXOa.mjs";
|
|
5
|
-
import { renderSummary, warn } from "./capabilities-7L9GVMd_.mjs";
|
|
6
|
-
import { EMPTY_CELL, renderUserName, renderUserRole, renderVersionTag } from "./render-BQHJhSP1.mjs";
|
|
7
|
-
import { promptPassword, promptText } from "./prompt-u4WhE4T5.mjs";
|
|
8
|
-
import { readInput } from "./input-xewHccej.mjs";
|
|
9
|
-
import { z } from "zod";
|
|
10
|
-
|
|
11
|
-
//#region src/commands/auth/login.ts
|
|
12
|
-
const LoginResult = z.object({
|
|
13
|
-
profile: z.string(),
|
|
14
|
-
url: z.string(),
|
|
15
|
-
authenticated: z.boolean(),
|
|
16
|
-
user: ProbedUser.nullable(),
|
|
17
|
-
version: ParsedVersionSchema.nullable()
|
|
18
|
-
});
|
|
19
|
-
const loginView = {
|
|
20
|
-
compactPick: LoginResult,
|
|
21
|
-
tableColumns: [
|
|
22
|
-
{
|
|
23
|
-
key: "profile",
|
|
24
|
-
label: "Profile"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
key: "url",
|
|
28
|
-
label: "Metabase URL"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
key: "authenticated",
|
|
32
|
-
label: "Authenticated",
|
|
33
|
-
format: (value) => value === true ? "credentials verified" : "saved without verification"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
key: "user",
|
|
37
|
-
label: "Logged in as",
|
|
38
|
-
format: (value) => renderUserName(value)
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
key: "user",
|
|
42
|
-
label: "Role",
|
|
43
|
-
format: (value) => renderUserRole(value)
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
key: "version",
|
|
47
|
-
label: "Version",
|
|
48
|
-
format: (value) => renderVersionTag(value)
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
};
|
|
52
|
-
var login_default = defineMetabaseCommand({
|
|
53
|
-
meta: {
|
|
54
|
-
name: "login",
|
|
55
|
-
description: "Set Metabase credentials for a profile"
|
|
56
|
-
},
|
|
57
|
-
details: "API-key auth only. The key is read from --api-key, $METABASE_API_KEY, or piped stdin (first non-empty wins); the URL from --url or $METABASE_URL. Both are prompted when stdin is a TTY.",
|
|
58
|
-
capabilities: { minVersion: 58 },
|
|
59
|
-
args: {
|
|
60
|
-
...outputFlags,
|
|
61
|
-
...profileFlag,
|
|
62
|
-
...connectionFlags,
|
|
63
|
-
"skip-verify": {
|
|
64
|
-
type: "boolean",
|
|
65
|
-
default: false,
|
|
66
|
-
description: "Save without contacting the server"
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
outputSchema: LoginResult,
|
|
70
|
-
examples: [
|
|
71
|
-
"mb auth login --url https://metabase.example.com < key.txt",
|
|
72
|
-
"echo $METABASE_API_KEY | mb auth login --url https://metabase.example.com",
|
|
73
|
-
"mb auth login --profile staging --url https://staging.example.com"
|
|
74
|
-
],
|
|
75
|
-
async run({ args, ctx }) {
|
|
76
|
-
const profileName = await resolveLoginProfile(args.profile);
|
|
77
|
-
const env = readEnvCredentials();
|
|
78
|
-
if (args.apiKey) warn("warning: --api-key is visible in shell history and process listings — pipe the key on stdin or set METABASE_API_KEY instead");
|
|
79
|
-
const url = await resolveUrl(args.url, env.url);
|
|
80
|
-
const apiKey = await resolveApiKey(args.apiKey, env.apiKey);
|
|
81
|
-
if (args["skip-verify"]) {
|
|
82
|
-
const location$1 = await writeProfile({
|
|
83
|
-
url,
|
|
84
|
-
apiKey
|
|
85
|
-
}, profileName);
|
|
86
|
-
if (location$1.backend === "file") warn(keyringFallbackWarning(location$1));
|
|
87
|
-
renderSummary({
|
|
88
|
-
profile: profileName,
|
|
89
|
-
url,
|
|
90
|
-
authenticated: false,
|
|
91
|
-
user: null,
|
|
92
|
-
version: null
|
|
93
|
-
}, loginView, `Saved credentials for profile "${profileName}" (${url}) without verifying.`, ctx);
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const result = await verifyAndProbe(url, apiKey);
|
|
97
|
-
if (!result.ok) {
|
|
98
|
-
await writeProbeFailure(profileName, {
|
|
99
|
-
kind: result.kind,
|
|
100
|
-
reason: result.message
|
|
101
|
-
});
|
|
102
|
-
throw new ConfigError(formatVerifyFailureMessage(profileName, result));
|
|
103
|
-
}
|
|
104
|
-
const location = await writeProfile({
|
|
105
|
-
url,
|
|
106
|
-
apiKey
|
|
107
|
-
}, profileName);
|
|
108
|
-
if (location.backend === "file") warn(keyringFallbackWarning(location));
|
|
109
|
-
await writeProbeResult(profileName, {
|
|
110
|
-
user: result.user,
|
|
111
|
-
server: result.server
|
|
112
|
-
});
|
|
113
|
-
const who = renderUserName(result.user);
|
|
114
|
-
const role = renderUserRole(result.user);
|
|
115
|
-
const versionTag = renderVersionTag(result.server.version);
|
|
116
|
-
const serverClause = versionTag === EMPTY_CELL ? "" : ` Server ${versionTag}.`;
|
|
117
|
-
renderSummary({
|
|
118
|
-
profile: profileName,
|
|
119
|
-
url,
|
|
120
|
-
authenticated: true,
|
|
121
|
-
user: result.user,
|
|
122
|
-
version: result.server.version
|
|
123
|
-
}, loginView, `Logged in to ${url} as ${who} (${role}). Saved to profile "${profileName}".${serverClause}`, ctx);
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
function formatVerifyFailureMessage(profileName, failure) {
|
|
127
|
-
const which = failure.which === "user" ? "/api/user/current" : "/api/session/properties";
|
|
128
|
-
return `verification failed (${which}): ${failure.message} — credentials were not saved for profile "${profileName}"`;
|
|
129
|
-
}
|
|
130
|
-
async function resolveLoginProfile(flagProfile) {
|
|
131
|
-
const explicit = explicitProfileName(flagProfile);
|
|
132
|
-
if (explicit !== null) return explicit;
|
|
133
|
-
if (!process.stdin.isTTY) return DEFAULT_PROFILE;
|
|
134
|
-
const entered = (await promptText({
|
|
135
|
-
message: "Profile name",
|
|
136
|
-
placeholder: DEFAULT_PROFILE,
|
|
137
|
-
defaultValue: DEFAULT_PROFILE
|
|
138
|
-
})).trim();
|
|
139
|
-
return entered === "" ? DEFAULT_PROFILE : entered;
|
|
140
|
-
}
|
|
141
|
-
async function resolveUrl(flagUrl, envUrl) {
|
|
142
|
-
if (flagUrl) return normalizeUrl(flagUrl);
|
|
143
|
-
if (envUrl) return normalizeUrl(envUrl);
|
|
144
|
-
return promptForUrl();
|
|
145
|
-
}
|
|
146
|
-
async function resolveApiKey(flagKey, envKey) {
|
|
147
|
-
if (flagKey) return flagKey;
|
|
148
|
-
const piped = (await readInput({ required: false })).trim();
|
|
149
|
-
if (piped) return piped;
|
|
150
|
-
if (envKey) return envKey;
|
|
151
|
-
return promptForApiKey();
|
|
152
|
-
}
|
|
153
|
-
async function promptForUrl() {
|
|
154
|
-
if (!process.stdin.isTTY) throw new ConfigError("--url is required when stdin is not a TTY (cannot prompt interactively)");
|
|
155
|
-
const value = await promptText({
|
|
156
|
-
message: "Metabase URL",
|
|
157
|
-
placeholder: "https://metabase.example.com",
|
|
158
|
-
validate(input) {
|
|
159
|
-
if (!input) return "URL is required";
|
|
160
|
-
try {
|
|
161
|
-
normalizeUrl(input);
|
|
162
|
-
} catch (error) {
|
|
163
|
-
return errorMessage(error);
|
|
164
|
-
}
|
|
165
|
-
return void 0;
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
return normalizeUrl(value);
|
|
169
|
-
}
|
|
170
|
-
async function promptForApiKey() {
|
|
171
|
-
if (!process.stdin.isTTY) throw new ConfigError("--api-key, piped stdin, or METABASE_API_KEY required when stdin is not a TTY");
|
|
172
|
-
return promptPassword({
|
|
173
|
-
message: "API key",
|
|
174
|
-
mask: "•",
|
|
175
|
-
validate: (input) => input ? void 0 : "API key is required"
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
//#endregion
|
|
180
|
-
export { login_default as default };
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { defineCommand } from "citty";
|
|
2
|
-
|
|
3
|
-
//#region src/commands/measure/index.ts
|
|
4
|
-
var measure_default = defineCommand({
|
|
5
|
-
meta: {
|
|
6
|
-
name: "measure",
|
|
7
|
-
description: "Manage Metabase measures"
|
|
8
|
-
},
|
|
9
|
-
subCommands: {
|
|
10
|
-
list: () => import("./list-D7Np4fwk.mjs").then((mod) => mod.default),
|
|
11
|
-
get: () => import("./get-nl41R-2q.mjs").then((mod) => mod.default),
|
|
12
|
-
create: () => import("./create-vNcD4jfq.mjs").then((mod) => mod.default),
|
|
13
|
-
update: () => import("./update-C875_WGf.mjs").then((mod) => mod.default),
|
|
14
|
-
archive: () => import("./archive-DQsV2uwy.mjs").then((mod) => mod.default)
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
//#endregion
|
|
19
|
-
export { measure_default as default };
|