@metabase/cli 0.1.12 → 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.
Files changed (179) hide show
  1. package/README.md +34 -22
  2. package/dist/{add-collection-DEME4IOy.mjs → add-collection-BQsx2Q-S.mjs} +5 -5
  3. package/dist/add-collection-BiBKEHwz.mjs +10 -0
  4. package/dist/{archive-BtDvBsr8.mjs → archive-BP53zrzs.mjs} +6 -6
  5. package/dist/{archive-Dc-FwNZm.mjs → archive-BS4U2_gi.mjs} +7 -7
  6. package/dist/{archive-DUlrUlok.mjs → archive-BrYMa87Z.mjs} +6 -6
  7. package/dist/{archive-CMeTr8jv.mjs → archive-D7qtYihp.mjs} +6 -6
  8. package/dist/{archive-BFk-oupo.mjs → archive-Dt5zuiwu.mjs} +6 -6
  9. package/dist/{archive-BNioNJtG.mjs → archive-FLrOqODN.mjs} +7 -7
  10. package/dist/{archive-MTTQv3wR.mjs → archive-H8wBIt8q.mjs} +7 -7
  11. package/dist/auth-DWA7DSo9.mjs +19 -0
  12. package/dist/{body-89w3r7In.mjs → body-3vzTm8Jj.mjs} +3 -3
  13. package/dist/{branches-DuVKH8Ye.mjs → branches-Lr1cCUdg.mjs} +6 -6
  14. package/dist/{cancel-BEMQKVuR.mjs → cancel-Br3FHyDR.mjs} +5 -5
  15. package/dist/{cancel-task-D2mSPFXO.mjs → cancel-task-BXgeq3MH.mjs} +6 -6
  16. package/dist/{capabilities-7L9GVMd_.mjs → capabilities-BX1rnVuH.mjs} +2 -14
  17. package/dist/card-DQV8WOIa.mjs +20 -0
  18. package/dist/{card-DnIeMmUn.mjs → card-wCPcuKSi.mjs} +1 -1
  19. package/dist/{cards-L9jksUMD.mjs → cards-D-AkjCxr.mjs} +6 -6
  20. package/dist/cli.mjs +25 -25
  21. package/dist/collection-DIUWkVFY.mjs +20 -0
  22. package/dist/{collection-namespace-w26SavJH.mjs → collection-namespace-BQ_ebqOP.mjs} +2 -2
  23. package/dist/{command-augment-BH9qgQ5u.mjs → command-augment-CAur0XOQ.mjs} +13 -2
  24. package/dist/{create-D6QqOX6u.mjs → create-BpAak62U.mjs} +9 -9
  25. package/dist/{create-Dew3rKsR.mjs → create-C1xYECl-.mjs} +8 -8
  26. package/dist/{create-Cxg_h8Kf.mjs → create-CDL9WHiR.mjs} +10 -10
  27. package/dist/{create-8hMjPz7j.mjs → create-CcZEV9xx.mjs} +8 -8
  28. package/dist/{create-DoeqRVmx.mjs → create-DHUhRzcV.mjs} +11 -11
  29. package/dist/{create-Bu9Jayck.mjs → create-DUdkitlQ.mjs} +12 -12
  30. package/dist/{create-zEq4ZJAT.mjs → create-Dx1SDXyQ.mjs} +8 -8
  31. package/dist/{create-branch-C5P2y8U5.mjs → create-branch-BvZKizC4.mjs} +6 -6
  32. package/dist/{create-C3b3MoIN.mjs → create-ux0yPpq1.mjs} +10 -10
  33. package/dist/{create-DCYc032c.mjs → create-y4j2I1aH.mjs} +11 -11
  34. package/dist/{current-task-uD4QO5bM.mjs → current-task-DaWn0DYt.mjs} +6 -6
  35. package/dist/dashboard-CohHWhkV.mjs +21 -0
  36. package/dist/{database-Dsv4QBs0.mjs → database-BmsxuRmO.mjs} +1 -1
  37. package/dist/db-BD8JZUDw.mjs +22 -0
  38. package/dist/{delete-DGaNAFdQ.mjs → delete-CW3cEHlr.mjs} +7 -7
  39. package/dist/{delete-Bftif2R3.mjs → delete-DFWjBpzl.mjs} +7 -7
  40. package/dist/{delete-runtime-CjFc69tS.mjs → delete-runtime-BhZAAvjc.mjs} +3 -3
  41. package/dist/{delete-table-C0qxP6FE.mjs → delete-table-Wa0yRsnM.mjs} +7 -7
  42. package/dist/{dirty-CZZLpWt1.mjs → dirty-CKcGYIpv.mjs} +6 -6
  43. package/dist/document-CRuag6F5.mjs +19 -0
  44. package/dist/{eid-C8xTmR8e.mjs → eid-m44hs7Ul.mjs} +7 -7
  45. package/dist/{error-BGH4gxGN.mjs → error-DR_i1hxJ.mjs} +40 -5
  46. package/dist/{export-DWdjnBKo.mjs → export-8C4F9pYn.mjs} +8 -8
  47. package/dist/field-CuabjsR7.mjs +18 -0
  48. package/dist/{fields-Cq08PQec.mjs → fields-hXrRjf7e.mjs} +7 -7
  49. package/dist/{get-8nAjRL2H.mjs → get-3zFOkcl_.mjs} +7 -7
  50. package/dist/{get-BaKKF50e.mjs → get-8r-_QuSr.mjs} +6 -6
  51. package/dist/{get-ug26gcOI.mjs → get-9MCrsgTf.mjs} +8 -8
  52. package/dist/{get-Bbij6RjC.mjs → get-BjCQctuS.mjs} +6 -6
  53. package/dist/{get-Bcr_5fAb.mjs → get-BlNLGR-F.mjs} +6 -6
  54. package/dist/{get-Rqz7UHv1.mjs → get-BxgSKzca.mjs} +6 -6
  55. package/dist/{get-f5ENeUNw.mjs → get-C7EKJGTP.mjs} +6 -6
  56. package/dist/{get-DHPN1716.mjs → get-Cit5liJv.mjs} +7 -7
  57. package/dist/{get-DzLAmSKd.mjs → get-CqU4xVSg.mjs} +5 -5
  58. package/dist/{get-B2vGW7Aw.mjs → get-CvLECgtm.mjs} +6 -6
  59. package/dist/{get-DtKv-gl3.mjs → get-D7WUNQYY.mjs} +6 -6
  60. package/dist/{get-7IhxPyE_.mjs → get-DWg3riaY.mjs} +6 -6
  61. package/dist/{get-Cr8oz_jr.mjs → get-cjqlMKF5.mjs} +6 -6
  62. package/dist/{get-run-DhbHXaZE.mjs → get-run-CTDPEDcU.mjs} +6 -6
  63. package/dist/{get-B_BJ10pV.mjs → get-xVPjvf7O.mjs} +6 -6
  64. package/dist/git-sync-CKsGGVOm.mjs +28 -0
  65. package/dist/{has-remote-changes-CTLh3WjZ.mjs → has-remote-changes-DYo4PQfC.mjs} +6 -6
  66. package/dist/{import-XakIQfRp.mjs → import-Cwd-_wYv.mjs} +8 -8
  67. package/dist/{input-BZwm4yby.mjs → input-BXWgdKiS.mjs} +1 -1
  68. package/dist/{is-dirty-DkOOyjsZ.mjs → is-dirty-HynZex-f.mjs} +4 -4
  69. package/dist/is-dirty-Mkgi21bq.mjs +9 -0
  70. package/dist/{items-DC985V8K.mjs → items-D4pSBGxR.mjs} +8 -8
  71. package/dist/{key-y4TtxKwU.mjs → key-C8q5oIr5.mjs} +1 -1
  72. package/dist/{list-CEbMS6g3.mjs → list-B2QX8BZ3.mjs} +5 -5
  73. package/dist/{list-CIEI8XK_.mjs → list-Bqy3rN6k.mjs} +5 -5
  74. package/dist/{list-Df4MhR2A.mjs → list-CI1WQ8U3.mjs} +7 -7
  75. package/dist/{list-xfmTxHNu.mjs → list-Ctze3nfU.mjs} +5 -5
  76. package/dist/{list-Cnb9mQdd.mjs → list-D-Ms9fhd.mjs} +7 -7
  77. package/dist/{list-gy64AAWO.mjs → list-D3BBrpoQ.mjs} +5 -5
  78. package/dist/{list-STlBcPs8.mjs → list-D7o0DOZe.mjs} +5 -5
  79. package/dist/{list-CyIgwqFB.mjs → list-DBjOFesD.mjs} +6 -6
  80. package/dist/{list-B83-hnq5.mjs → list-DMZumpNv.mjs} +5 -5
  81. package/dist/{list-PYNFVJGM.mjs → list-De2qX1w8.mjs} +7 -7
  82. package/dist/{list-CtAFlkLe.mjs → list-ET066OdN.mjs} +5 -5
  83. package/dist/{list-BtNboYpZ.mjs → list-F0BQNbaZ.mjs} +25 -18
  84. package/dist/{list-OGkVAG6b.mjs → list-XgdM17ix.mjs} +6 -6
  85. package/dist/{list-DfPwBQrZ.mjs → list-_xdr1WKh.mjs} +5 -5
  86. package/dist/login-BHDdLJzw.mjs +453 -0
  87. package/dist/{logout-BUgUTFol.mjs → logout-ClizU0OL.mjs} +15 -6
  88. package/dist/{manifest-BPHqF5LY.mjs → manifest-DYeLri80.mjs} +2 -2
  89. package/dist/measure-SmyQt9Lg.mjs +19 -0
  90. package/dist/{metadata-Dwkcsa1c.mjs → metadata-D23RdbEZ.mjs} +8 -8
  91. package/dist/{metadata-B1EmV1l5.mjs → metadata-a_N6Sx30.mjs} +7 -7
  92. package/dist/{parse-enum-Dr7ACrTR.mjs → parse-enum-BatHQ-Gs.mjs} +1 -1
  93. package/dist/{parse-id-sKNP6yu5.mjs → parse-id-B1BlAunl.mjs} +1 -1
  94. package/dist/{parse-ref-BiETXmvm.mjs → parse-ref-CZr1bYIl.mjs} +1 -1
  95. package/dist/{path-BZJR7YLR.mjs → path-FSfPscAQ.mjs} +5 -5
  96. package/dist/{poll-Cyw-dQi4.mjs → poll-Dl5Zv4Ed.mjs} +2 -2
  97. package/dist/{poll-task-BG0oVnfZ.mjs → poll-task-BoRK94WQ.mjs} +2 -2
  98. package/dist/{preflight-BjR63JnX.mjs → preflight-CVlo39xa.mjs} +4 -4
  99. package/dist/process-DsGf7Mg5.mjs +73 -0
  100. package/dist/{prompt-u4WhE4T5.mjs → prompt-Bc_bHSD0.mjs} +13 -3
  101. package/dist/{query-C2xqnz24.mjs → query-CSvpJssD.mjs} +8 -8
  102. package/dist/{query-result-B4kTRid7.mjs → query-result-L5_NrwQR.mjs} +1 -1
  103. package/dist/{query-Dk55Wp2p.mjs → query-yZ9HeaGp.mjs} +12 -12
  104. package/dist/{remove-collection-DbVNWGyb.mjs → remove-collection-CV7ssevw.mjs} +8 -8
  105. package/dist/{render-BQHJhSP1.mjs → render-CkuFkWlQ.mjs} +6 -1
  106. package/dist/{rescan-values-CuLQ9UHP.mjs → rescan-values-CMeOv6yx.mjs} +8 -8
  107. package/dist/{run-PDN33QjN.mjs → run-CIJOYXor.mjs} +8 -8
  108. package/dist/{runs-B9T-7lei.mjs → runs--CzbmfPg.mjs} +7 -7
  109. package/dist/{runtime-DgHh4T6t.mjs → runtime-DJTGfiKO.mjs} +591 -123
  110. package/dist/{schema-tables-DjmNwrlT.mjs → schema-tables-BII9pHR8.mjs} +7 -7
  111. package/dist/{schemas-CWL8gv1C.mjs → schemas-BzxVz71I.mjs} +5 -5
  112. package/dist/{search-D7JzmvfR.mjs → search-CjJZdaM0.mjs} +5 -5
  113. package/dist/segment-dkO4Ualw.mjs +19 -0
  114. package/dist/{set-C0dCLnUA.mjs → set-Ds_brNWu.mjs} +8 -8
  115. package/dist/{setting-Licy7ZSs.mjs → setting-YDJRWd1m.mjs} +3 -3
  116. package/dist/{setup-BL4fqxoU.mjs → setup-DJb-NgSM.mjs} +7 -7
  117. package/dist/{skills-CY_FmaPo.mjs → skills-CJ8g8fhQ.mjs} +1 -1
  118. package/dist/{skills-Cn8FMCxG.mjs → skills-Dn-kn8Wj.mjs} +3 -3
  119. package/dist/snippet-DqTiC73e.mjs +19 -0
  120. package/dist/{stash-SGod4B8-.mjs → stash-DGujowmx.mjs} +8 -8
  121. package/dist/{status-CvUuZVvC.mjs → status-3-Tl07gu.mjs} +14 -6
  122. package/dist/{status-BCb5iCsQ.mjs → status-Cx0TIn1I.mjs} +7 -7
  123. package/dist/{summary-qaTPTLWs.mjs → summary-CT-xFvnX.mjs} +6 -6
  124. package/dist/{sync-schema-CjjAYTbO.mjs → sync-schema-BTF7O3FM.mjs} +10 -10
  125. package/dist/table-DNGPtV4P.mjs +19 -0
  126. package/dist/{table-CkWja2UH.mjs → table-qDD2kApF.mjs} +1 -1
  127. package/dist/transform-DEbvouxo.mjs +24 -0
  128. package/dist/transform-job-Du8npb7F.mjs +19 -0
  129. package/dist/{tree-C0MFcweC.mjs → tree-CLUxXw-Z.mjs} +5 -5
  130. package/dist/{update-DCR0wFNl.mjs → update-6IuvkFCk.mjs} +11 -11
  131. package/dist/{update-CHUUY-IB.mjs → update-BeH_S7h9.mjs} +9 -9
  132. package/dist/{update-BqsGGrzx.mjs → update-BfNmqvuN.mjs} +13 -13
  133. package/dist/{update-BImaz9vj.mjs → update-C_Ui5qPU.mjs} +12 -12
  134. package/dist/{update-CJASCsG4.mjs → update-DD5Q37bz.mjs} +9 -9
  135. package/dist/{update-Dty6LvU2.mjs → update-DdqzxPIr.mjs} +12 -12
  136. package/dist/{update-BTzsE8GU.mjs → update-DpCv5Mdo.mjs} +9 -9
  137. package/dist/{update-BUoWwmQV.mjs → update-I0t_6Mni.mjs} +9 -9
  138. package/dist/{update-vk_M0eOR.mjs → update-Z_LMzsiz.mjs} +11 -11
  139. package/dist/{update-dashcard-BkJaVVvf.mjs → update-dashcard-Bl3wbB8-.mjs} +9 -9
  140. package/dist/{update-qoP7hZTg.mjs → update-tQvEYuzD.mjs} +10 -10
  141. package/dist/{upgrade-TdaiAYbH.mjs → upgrade-r2ZlfstE.mjs} +6 -34
  142. package/dist/{uuid-BeUz8VpP.mjs → uuid-BduDonqb.mjs} +4 -4
  143. package/dist/{validate-B62TRDGV.mjs → validate-VawhJ5Sc.mjs} +2 -2
  144. package/dist/{validate-query-BpiN1CFu.mjs → validate-query-CSV-TTnd.mjs} +3 -3
  145. package/dist/{values-DR-3HcK6.mjs → values-DuNE6Jxc.mjs} +6 -6
  146. package/dist/{verify-D2uBlvmt.mjs → verify-D_yq68-R.mjs} +5 -5
  147. package/dist/{wait-FAnqO-LT.mjs → wait-CoDzO37B.mjs} +7 -7
  148. package/dist/{wait-flags-B5BI_xob.mjs → wait-flags-BxUfF5zy.mjs} +2 -2
  149. package/package.json +1 -1
  150. package/dist/add-collection-BPtBMh8Y.mjs +0 -10
  151. package/dist/auth-CjFnuPe9.mjs +0 -19
  152. package/dist/card-DoDpwR4t.mjs +0 -20
  153. package/dist/collection-CF-1RIPY.mjs +0 -20
  154. package/dist/dashboard-C5zTX345.mjs +0 -21
  155. package/dist/db-4y5Z1CQw.mjs +0 -22
  156. package/dist/document-97l9Non_.mjs +0 -19
  157. package/dist/field-BwUTrelF.mjs +0 -18
  158. package/dist/git-sync-JIMEYW-E.mjs +0 -28
  159. package/dist/is-dirty-4gf8ujws.mjs +0 -9
  160. package/dist/login-C0VFlX8y.mjs +0 -180
  161. package/dist/measure-BmcmxRQ3.mjs +0 -19
  162. package/dist/segment-DrZNuxsM.mjs +0 -19
  163. package/dist/snippet-C5_4nPGj.mjs +0 -19
  164. package/dist/table-DK1B8Hzq.mjs +0 -19
  165. package/dist/transform-Dh5746zH.mjs +0 -24
  166. package/dist/transform-job-D0nRGPYN.mjs +0 -19
  167. /package/dist/{body-flags-D78h_-Ua.mjs → body-flags-D7q87Btw.mjs} +0 -0
  168. /package/dist/{collection-BPTlcFw5.mjs → collection-Deiziuu2.mjs} +0 -0
  169. /package/dist/{dashboard-FY5UzJ_Z.mjs → dashboard-B4bn3z6t.mjs} +0 -0
  170. /package/dist/{document-CcfiiV3b.mjs → document-qfwR0r63.mjs} +0 -0
  171. /package/dist/{field-MGxpNQUH.mjs → field-E0IBy4Uw.mjs} +0 -0
  172. /package/dist/{measure-COGAoZpo.mjs → measure-JJAdFoqK.mjs} +0 -0
  173. /package/dist/{paginate-Dfm9eO9A.mjs → paginate-BexjkjbY.mjs} +0 -0
  174. /package/dist/{revision-message-flag-Bo-Kvv6F.mjs → revision-message-flag-C7zBeWEt.mjs} +0 -0
  175. /package/dist/{segment-d-708KKO.mjs → segment-B9SEv9V_.mjs} +0 -0
  176. /package/dist/{setting-CSJvi1-6.mjs → setting-i0pugNHl.mjs} +0 -0
  177. /package/dist/{snippet-BZvo05ua.mjs → snippet-NNzqlksR.mjs} +0 -0
  178. /package/dist/{transform-job-n8W6tLqF.mjs → transform-job-B9pXBOwr.mjs} +0 -0
  179. /package/dist/{transform--dviwMA1.mjs → transform-qczxOAzn.mjs} +0 -0
@@ -1,14 +1,14 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import "./input-BZwm4yby.mjs";
6
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
7
- import { readBody } from "./body-89w3r7In.mjs";
8
- import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
9
- import "./validate-B62TRDGV.mjs";
10
- import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BpiN1CFu.mjs";
11
- import { Measure, MeasureUpdateInput, measureView } from "./measure-COGAoZpo.mjs";
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-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import "./input-BZwm4yby.mjs";
6
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
7
- import { readBody } from "./body-89w3r7In.mjs";
8
- import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
9
- import { DashboardDetail, Dashcard, DashcardPatchInput, dashcardView } from "./dashboard-FY5UzJ_Z.mjs";
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-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import "./input-BZwm4yby.mjs";
6
- import "./field-MGxpNQUH.mjs";
7
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
8
- import { readBody } from "./body-89w3r7In.mjs";
9
- import { bodyInputFlags } from "./body-flags-D78h_-Ua.mjs";
10
- import { Table, TableUpdateInput, tableView } from "./table-CkWja2UH.mjs";
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, isNotFoundError } from "./command-augment-BH9qgQ5u.mjs";
2
- import { outputFlags, package_default } from "./error-BGH4gxGN.mjs";
3
- import { HttpError, USER_AGENT, combineAborts, defineMetabaseCommand, parseJson, throwIfAborted } from "./runtime-DgHh4T6t.mjs";
4
- import { renderItem, writeText } from "./capabilities-7L9GVMd_.mjs";
5
- import { promptConfirm } from "./prompt-u4WhE4T5.mjs";
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-BH9qgQ5u.mjs";
2
- import { outputFlags } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand, parseInteger } from "./runtime-DgHh4T6t.mjs";
4
- import { writeJson, writeText } from "./capabilities-7L9GVMd_.mjs";
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-BH9qgQ5u.mjs";
2
- import { isPlainObject } from "./capabilities-7L9GVMd_.mjs";
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-BH9qgQ5u.mjs";
2
- import { writeJson } from "./capabilities-7L9GVMd_.mjs";
3
- import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-B62TRDGV.mjs";
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-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { formatScalar, renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { FieldValues, fieldValuesView } from "./field-MGxpNQUH.mjs";
6
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
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-BH9qgQ5u.mjs";
2
- import { HttpError, createClient, probeServer } from "./runtime-DgHh4T6t.mjs";
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, apiKey) {
23
+ async function verifyAndProbe(url, credential, refresh) {
24
24
  const client = createClient({
25
25
  url,
26
- apiKey
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-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { defineMetabaseCommand } from "./runtime-DgHh4T6t.mjs";
4
- import { renderSummary } from "./capabilities-7L9GVMd_.mjs";
5
- import { parseId } from "./parse-id-sKNP6yu5.mjs";
6
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-Cyw-dQi4.mjs";
7
- import { SyncTaskOrIdle, formatSyncTask, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-BG0oVnfZ.mjs";
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-sKNP6yu5.mjs";
2
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-Cyw-dQi4.mjs";
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@metabase/cli",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "description": "Metabase CLI",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -1,10 +0,0 @@
1
- import "./command-augment-BH9qgQ5u.mjs";
2
- import "./error-BGH4gxGN.mjs";
3
- import "./runtime-DgHh4T6t.mjs";
4
- import "./capabilities-7L9GVMd_.mjs";
5
- import "./parse-id-sKNP6yu5.mjs";
6
- import "./poll-Cyw-dQi4.mjs";
7
- import "./poll-task-BG0oVnfZ.mjs";
8
- import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-DEME4IOy.mjs";
9
-
10
- export { add_collection_default as default };
@@ -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-C0VFlX8y.mjs").then((m) => m.default),
12
- status: () => import("./status-CvUuZVvC.mjs").then((m) => m.default),
13
- list: () => import("./list-BtNboYpZ.mjs").then((m) => m.default),
14
- logout: () => import("./logout-BUgUTFol.mjs").then((m) => m.default)
15
- }
16
- });
17
-
18
- //#endregion
19
- export { auth_default as default };
@@ -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-Df4MhR2A.mjs").then((mod) => mod.default),
11
- get: () => import("./get-8nAjRL2H.mjs").then((mod) => mod.default),
12
- query: () => import("./query-C2xqnz24.mjs").then((mod) => mod.default),
13
- create: () => import("./create-DoeqRVmx.mjs").then((mod) => mod.default),
14
- update: () => import("./update-Dty6LvU2.mjs").then((mod) => mod.default),
15
- archive: () => import("./archive-BNioNJtG.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-CyIgwqFB.mjs").then((mod) => mod.default),
11
- get: () => import("./get-Bcr_5fAb.mjs").then((mod) => mod.default),
12
- items: () => import("./items-DC985V8K.mjs").then((mod) => mod.default),
13
- tree: () => import("./tree-C0MFcweC.mjs").then((mod) => mod.default),
14
- create: () => import("./create-D6QqOX6u.mjs").then((mod) => mod.default),
15
- archive: () => import("./archive-BtDvBsr8.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-OGkVAG6b.mjs").then((mod) => mod.default),
11
- get: () => import("./get-B2vGW7Aw.mjs").then((mod) => mod.default),
12
- cards: () => import("./cards-L9jksUMD.mjs").then((mod) => mod.default),
13
- create: () => import("./create-Bu9Jayck.mjs").then((mod) => mod.default),
14
- update: () => import("./update-BqsGGrzx.mjs").then((mod) => mod.default),
15
- "update-dashcard": () => import("./update-dashcard-BkJaVVvf.mjs").then((mod) => mod.default),
16
- archive: () => import("./archive-CMeTr8jv.mjs").then((mod) => mod.default)
17
- }
18
- });
19
-
20
- //#endregion
21
- export { dashboard_default as default };
@@ -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-Cnb9mQdd.mjs").then((m) => m.default),
12
- get: () => import("./get-ug26gcOI.mjs").then((m) => m.default),
13
- metadata: () => import("./metadata-Dwkcsa1c.mjs").then((m) => m.default),
14
- schemas: () => import("./schemas-CWL8gv1C.mjs").then((m) => m.default),
15
- "schema-tables": () => import("./schema-tables-DjmNwrlT.mjs").then((m) => m.default),
16
- "sync-schema": () => import("./sync-schema-CjjAYTbO.mjs").then((m) => m.default),
17
- "rescan-values": () => import("./rescan-values-CuLQ9UHP.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-CtAFlkLe.mjs").then((mod) => mod.default),
11
- get: () => import("./get-B_BJ10pV.mjs").then((mod) => mod.default),
12
- create: () => import("./create-8hMjPz7j.mjs").then((mod) => mod.default),
13
- update: () => import("./update-CHUUY-IB.mjs").then((mod) => mod.default),
14
- archive: () => import("./archive-BFk-oupo.mjs").then((mod) => mod.default)
15
- }
16
- });
17
-
18
- //#endregion
19
- export { document_default as default };
@@ -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-Bbij6RjC.mjs").then((m) => m.default),
11
- values: () => import("./values-DR-3HcK6.mjs").then((m) => m.default),
12
- summary: () => import("./summary-qaTPTLWs.mjs").then((m) => m.default),
13
- update: () => import("./update-BTzsE8GU.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-BCb5iCsQ.mjs").then((mod) => mod.default),
11
- "is-dirty": () => import("./is-dirty-4gf8ujws.mjs").then((mod) => mod.default),
12
- "has-remote-changes": () => import("./has-remote-changes-CTLh3WjZ.mjs").then((mod) => mod.default),
13
- dirty: () => import("./dirty-CZZLpWt1.mjs").then((mod) => mod.default),
14
- "current-task": () => import("./current-task-uD4QO5bM.mjs").then((mod) => mod.default),
15
- "cancel-task": () => import("./cancel-task-D2mSPFXO.mjs").then((mod) => mod.default),
16
- wait: () => import("./wait-FAnqO-LT.mjs").then((mod) => mod.default),
17
- import: () => import("./import-XakIQfRp.mjs").then((mod) => mod.default),
18
- export: () => import("./export-DWdjnBKo.mjs").then((mod) => mod.default),
19
- stash: () => import("./stash-SGod4B8-.mjs").then((mod) => mod.default),
20
- branches: () => import("./branches-DuVKH8Ye.mjs").then((mod) => mod.default),
21
- "create-branch": () => import("./create-branch-C5P2y8U5.mjs").then((mod) => mod.default),
22
- "add-collection": () => import("./add-collection-BPtBMh8Y.mjs").then((mod) => mod.default),
23
- "remove-collection": () => import("./remove-collection-DbVNWGyb.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-BGH4gxGN.mjs";
3
- import "./runtime-DgHh4T6t.mjs";
4
- import "./capabilities-7L9GVMd_.mjs";
5
- import "./poll-Cyw-dQi4.mjs";
6
- import "./poll-task-BG0oVnfZ.mjs";
7
- import { IsDirtyResult, is_dirty_default } from "./is-dirty-DkOOyjsZ.mjs";
8
-
9
- export { is_dirty_default as default };
@@ -1,180 +0,0 @@
1
- import { ConfigError, errorMessage } from "./command-augment-BH9qgQ5u.mjs";
2
- import { connectionFlags, outputFlags, profileFlag } from "./error-BGH4gxGN.mjs";
3
- import { DEFAULT_PROFILE, ParsedVersionSchema, ProbedUser, defineMetabaseCommand, explicitProfileName, keyringFallbackWarning, normalizeUrl, readEnvCredentials, writeProbeFailure, writeProbeResult, writeProfile } from "./runtime-DgHh4T6t.mjs";
4
- import { verifyAndProbe } from "./verify-D2uBlvmt.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-BZwm4yby.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-CIEI8XK_.mjs").then((mod) => mod.default),
11
- get: () => import("./get-DtKv-gl3.mjs").then((mod) => mod.default),
12
- create: () => import("./create-Cxg_h8Kf.mjs").then((mod) => mod.default),
13
- update: () => import("./update-vk_M0eOR.mjs").then((mod) => mod.default),
14
- archive: () => import("./archive-MTTQv3wR.mjs").then((mod) => mod.default)
15
- }
16
- });
17
-
18
- //#endregion
19
- export { measure_default as default };