@metabase/cli 0.2.1-alpha.bcm-ghy-4075-spawn-default-profile.eb120d1 → 0.2.1-alpha.trust-system-ca.541e4e0

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 (200) hide show
  1. package/README.md +8 -69
  2. package/dist/{add-collection-CLXfrgp4.mjs → add-collection-BZAVH5Wk.mjs} +4 -4
  3. package/dist/add-collection-DByJYvGO.mjs +9 -0
  4. package/dist/{append-DMcxP1LM.mjs → append-Cak5jykn.mjs} +5 -5
  5. package/dist/{archive-DErhQn8A.mjs → archive-BIEnBoE8.mjs} +4 -4
  6. package/dist/{archive-BwIZzWGe.mjs → archive-BMbx6lt8.mjs} +3 -3
  7. package/dist/{archive-h-3H5b4K.mjs → archive-BVY_jD_g.mjs} +5 -5
  8. package/dist/{archive-4WqMsPWB.mjs → archive-CPgWNCG3.mjs} +4 -4
  9. package/dist/{archive-Q1387APe.mjs → archive-CaKhG58H.mjs} +3 -3
  10. package/dist/{archive-BggM_AuL.mjs → archive-CjnCAM61.mjs} +5 -5
  11. package/dist/{archive-DTnz1suV.mjs → archive-CytCvQpn.mjs} +4 -4
  12. package/dist/{archive-BmhehbS0.mjs → archive-DfbI8DRB.mjs} +3 -3
  13. package/dist/{archive-5inmbMDL.mjs → archive-op9pJRpg.mjs} +3 -3
  14. package/dist/{auth-DzCAiArV.mjs → auth-XfuGXI2K.mjs} +4 -4
  15. package/dist/{body-5snfmiwR.mjs → body-BW_CiL1d.mjs} +3 -3
  16. package/dist/{branches-PL170CYS.mjs → branches-gVRwKne4.mjs} +4 -4
  17. package/dist/{cancel-EFKcF5J_.mjs → cancel-CBOJSslz.mjs} +3 -3
  18. package/dist/{cancel-task-mFFx0d5m.mjs → cancel-task-Djancczz.mjs} +4 -4
  19. package/dist/{capabilities-CiaAfUgX.mjs → capabilities-CSjeWyLV.mjs} +1 -1
  20. package/dist/{card-BsfdXK0O.mjs → card-B_kiDDil.mjs} +6 -6
  21. package/dist/{cards-BI7zKb9M.mjs → cards-23FtfL4S.mjs} +3 -3
  22. package/dist/cli.mjs +41 -29
  23. package/dist/{collection-2h_by9Ue.mjs → collection-DNzM3u7n.mjs} +6 -6
  24. package/dist/{collection-namespace-uNA5WhLB.mjs → collection-namespace-w1y5D0Uh.mjs} +2 -2
  25. package/dist/{create-BLD0YniB.mjs → create-BRK8TBzp.mjs} +3 -3
  26. package/dist/{create-CU3bYpsT.mjs → create-BkvdOecg.mjs} +5 -5
  27. package/dist/{create-FuZa4j1N.mjs → create-CGsTL5aE.mjs} +5 -5
  28. package/dist/{create-CQ32FwVe.mjs → create-C_fyIHZU.mjs} +5 -5
  29. package/dist/{create-xPfmI1Tu.mjs → create-CnT-L03B.mjs} +7 -7
  30. package/dist/{create-CBKT7SE_.mjs → create-CnqGhtuF.mjs} +4 -4
  31. package/dist/{create-VrSowEbj.mjs → create-CvptjYVb.mjs} +6 -6
  32. package/dist/{create-DAH24ltu.mjs → create-DZBtbGqj.mjs} +5 -5
  33. package/dist/{create-KveE3j3p.mjs → create-D_eiLBqR.mjs} +8 -8
  34. package/dist/{create-BxCsAdqc.mjs → create-DbHIjWio.mjs} +5 -5
  35. package/dist/{create-BpizGzgQ.mjs → create-VA58AF6A.mjs} +5 -5
  36. package/dist/{create-branch-CP1Y4_El.mjs → create-branch-BtqOfSRb.mjs} +4 -4
  37. package/dist/{create-acWKw4Y1.mjs → create-ldvT5L0W.mjs} +6 -6
  38. package/dist/{create-DutkaD7P.mjs → create-q2QqkwEN.mjs} +7 -7
  39. package/dist/{csv-CZyYi0vi.mjs → csv-C3O1wTQ8.mjs} +5 -5
  40. package/dist/{current-task-BR4koo9z.mjs → current-task-CZsZPe0o.mjs} +4 -4
  41. package/dist/{dashboard-ARgJfamb.mjs → dashboard-kb1oz7Z3.mjs} +8 -8
  42. package/dist/{db-dbnxMPSR.mjs → db-CHnqeJCo.mjs} +6 -6
  43. package/dist/{delete-BpL3vaaT.mjs → delete-BmT5C6eK.mjs} +5 -5
  44. package/dist/{delete-DCDFLHFa.mjs → delete-DgI03U43.mjs} +5 -5
  45. package/dist/{delete-P2Qlsr_s.mjs → delete-Dkfu4e5K.mjs} +5 -5
  46. package/dist/{delete-C5DqDwev.mjs → delete-JeRzVISE.mjs} +5 -5
  47. package/dist/{delete-ea_ns1uM.mjs → delete-cF97pfFX.mjs} +5 -5
  48. package/dist/{delete-runtime-DdBn6poA.mjs → delete-runtime-DiqKOEqi.mjs} +2 -2
  49. package/dist/{delete-table-tM048btr.mjs → delete-table-dnQs_Twm.mjs} +5 -5
  50. package/dist/{dependencies-DdOTClO2.mjs → dependencies-BsMwFSxP.mjs} +4 -4
  51. package/dist/{dirty-CEQYmhNF.mjs → dirty-CN6sGKX3.mjs} +4 -4
  52. package/dist/{document-DR1FLOn9.mjs → document-Y_DZNi4D.mjs} +5 -5
  53. package/dist/{eid-CtKGjAkz.mjs → eid-60sCZhQV.mjs} +4 -4
  54. package/dist/{events-C26DZ6yZ.mjs → events-CSZEAgs0.mjs} +4 -4
  55. package/dist/{export-CippuWZJ.mjs → export-CAxUJer6.mjs} +8 -5
  56. package/dist/{field-CXDndCbB.mjs → field-DAB2gImv.mjs} +4 -4
  57. package/dist/{fields-Xm_HVNcX.mjs → fields-CLWtUlpR.mjs} +3 -3
  58. package/dist/{get-DTkvGu_J.mjs → get-B22wjDxr.mjs} +3 -3
  59. package/dist/{get-B90bXbpw.mjs → get-BIHtWl2x.mjs} +4 -4
  60. package/dist/{get-BQz45IBF.mjs → get-BNBRMNtC.mjs} +3 -3
  61. package/dist/{get-B0cq1uGy.mjs → get-B_EinsrO.mjs} +4 -4
  62. package/dist/{get-CjZWjRa5.mjs → get-B_QKP1vR.mjs} +4 -4
  63. package/dist/{get-D5crrFSf.mjs → get-CKnHNxak.mjs} +3 -3
  64. package/dist/{get-Bj66bcuU.mjs → get-CRXEqpar.mjs} +4 -4
  65. package/dist/{get-BrKqMM1d.mjs → get-Ca30K5_W.mjs} +4 -4
  66. package/dist/{get-Ihx_XaaI.mjs → get-CaosV7j8.mjs} +3 -3
  67. package/dist/{get-CwGqARAf.mjs → get-Csa7Dz36.mjs} +3 -3
  68. package/dist/{get-BQBu2c94.mjs → get-Ct5TnofS.mjs} +3 -3
  69. package/dist/{get-z0BKkiRX.mjs → get-DTjeTNGb.mjs} +4 -4
  70. package/dist/{get-BSfKWZNJ.mjs → get-DU8V-7S2.mjs} +4 -4
  71. package/dist/{get-DYuJVlP-.mjs → get-DxAx-2C0.mjs} +4 -4
  72. package/dist/{get-FIE88hj9.mjs → get-H3X5e5-Y.mjs} +3 -3
  73. package/dist/{get-DX2fp6BB.mjs → get-L8c_h5EP.mjs} +3 -3
  74. package/dist/{get-3O7hv4zv.mjs → get-fGOQA0GF.mjs} +3 -3
  75. package/dist/{get-run-lVwhQVFx.mjs → get-run-DqwPQRMJ.mjs} +4 -4
  76. package/dist/git-sync-BhhdNjq5.mjs +31 -0
  77. package/dist/{has-remote-changes-DHrYSnTg.mjs → has-remote-changes-D0ZIBHSk.mjs} +4 -4
  78. package/dist/{import-BU40xXSF.mjs → import-BcIcDPl9.mjs} +6 -6
  79. package/dist/{input-BGyHn0Kr.mjs → input-D2-H-QKX.mjs} +1 -1
  80. package/dist/{is-dirty-BPluqPPP.mjs → is-dirty-B87YMLV2.mjs} +3 -3
  81. package/dist/is-dirty-CXTS25Tk.mjs +8 -0
  82. package/dist/{items-BZpYkImP.mjs → items-DrP1b4Qj.mjs} +4 -4
  83. package/dist/{key-B8UAsQmB.mjs → key-GP1gxZZD.mjs} +1 -1
  84. package/dist/{library-BGWDIfEM.mjs → library-bUBWlweP.mjs} +4 -4
  85. package/dist/{list-Ov6bYzT9.mjs → list-B-_PTqKw.mjs} +3 -3
  86. package/dist/{list-M_1sdYNH.mjs → list-B8212eUr.mjs} +3 -3
  87. package/dist/{list-Be8xMtS3.mjs → list-B8zgT05M.mjs} +3 -3
  88. package/dist/{list-CoqHnusK.mjs → list-BhCahBEO.mjs} +3 -3
  89. package/dist/{list-CjBPVJqd.mjs → list-CWQYaCp8.mjs} +3 -3
  90. package/dist/{list-BCeZlfpQ.mjs → list-Cbhx7N_t.mjs} +3 -3
  91. package/dist/{list-B7Ihu6XI.mjs → list-CoXeBm66.mjs} +3 -3
  92. package/dist/{list-CvaoHnl-.mjs → list-D1pHJX7w.mjs} +3 -3
  93. package/dist/{list-Bct00qku.mjs → list-DCl7zHCp.mjs} +2 -2
  94. package/dist/{list-DmopauvJ.mjs → list-DhT42e0q.mjs} +2 -2
  95. package/dist/{list-wxIVl45_.mjs → list-F_hMRbsa.mjs} +3 -3
  96. package/dist/{list-sn9M7QQX.mjs → list-GeqRHx8g.mjs} +3 -3
  97. package/dist/{list-SfpASSFx.mjs → list-MPePXEWe.mjs} +3 -3
  98. package/dist/{list-DamRE5Ds.mjs → list-TJjExx6e.mjs} +3 -3
  99. package/dist/{list-B037kJtH.mjs → list-TQghfc-u.mjs} +3 -3
  100. package/dist/{list-fPfgG0PY.mjs → list-TibX1b8i.mjs} +3 -3
  101. package/dist/{login-CRlmR4op.mjs → login-C5Ug3BVC.mjs} +19 -59
  102. package/dist/{logout-DSZEUxSQ.mjs → logout-B_N1N2DV.mjs} +4 -4
  103. package/dist/{measure-Ka0n3426.mjs → measure-D9rKeA6Z.mjs} +5 -5
  104. package/dist/{parameter-values-CwW8Xes7.mjs → parameter-values-ZXKECrJk.mjs} +3 -3
  105. package/dist/{parse-enum-ooCsJWn6.mjs → parse-enum-D5h-JePs.mjs} +1 -1
  106. package/dist/parse-id-ySsF4nA3.mjs +12 -0
  107. package/dist/{parse-ref-j4lxaQmd.mjs → parse-ref-Ds8VxdKb.mjs} +1 -1
  108. package/dist/{path-CVmg-bmf.mjs → path-C6ucgeYs.mjs} +3 -3
  109. package/dist/{poll-CuTlWBwI.mjs → poll-CgzD9_RH.mjs} +2 -2
  110. package/dist/{poll-task-DhsYs8Hx.mjs → poll-task-DF9xJl13.mjs} +2 -2
  111. package/dist/{preflight-D3VgjEg7.mjs → preflight-Co2grgX_.mjs} +2 -2
  112. package/dist/{process-7c8BcQEi.mjs → process-jjR_DX5G.mjs} +1 -1
  113. package/dist/{prompt-jQnNKtlx.mjs → prompt-BSqji7Fo.mjs} +1 -1
  114. package/dist/{publish-DFTCsjHU.mjs → publish-F-QbufXr.mjs} +8 -8
  115. package/dist/{query-CPq-dhFV.mjs → query-DGBzATpV.mjs} +7 -7
  116. package/dist/{query-Dfx69iJ4.mjs → query-DX4r0-uz.mjs} +4 -4
  117. package/dist/{query-result-Cg7odyR_.mjs → query-result-D5J3Dlpn.mjs} +1 -1
  118. package/dist/{remove-collection-DUAMhx5L.mjs → remove-collection-C-msSyas.mjs} +6 -6
  119. package/dist/{replace-DZWd6avZ.mjs → replace-xlQv9yl_.mjs} +5 -5
  120. package/dist/{requests-DYrDe-D0.mjs → requests-COuEPJxE.mjs} +2 -2
  121. package/dist/{rescan-values-DZSnEFA0.mjs → rescan-values-BC2SVtY6.mjs} +3 -3
  122. package/dist/{run-ryZ4sXK5.mjs → run-Cg6k3kHo.mjs} +6 -6
  123. package/dist/{run-B2b3Bjmv.mjs → run-opQkYIaT.mjs} +3 -3
  124. package/dist/{runs-F82HVSie.mjs → runs-Cbqm1HYG.mjs} +4 -4
  125. package/dist/{runtime-C6ASrgVA.mjs → runtime-MGH96fhp.mjs} +1056 -1092
  126. package/dist/{schema-tables-CCOKb715.mjs → schema-tables-8FjtkFIt.mjs} +3 -3
  127. package/dist/{schemas-LtVrNECH.mjs → schemas-L9kMsEJL.mjs} +3 -3
  128. package/dist/{search-9GSZHgJQ.mjs → search-Csbb-u-_.mjs} +3 -3
  129. package/dist/{segment-C40bORNZ.mjs → segment-DCeafJwX.mjs} +5 -5
  130. package/dist/{selectors-B2nDmrIV.mjs → selectors-D34gXjQa.mjs} +3 -3
  131. package/dist/{set-C57KDMGM.mjs → set-CfwncOI_.mjs} +6 -6
  132. package/dist/{set-active-BDHGHtj2.mjs → set-active-gP4mjVDY.mjs} +3 -3
  133. package/dist/{setting-zrJwy48C.mjs → setting-D5Y9sJha.mjs} +3 -3
  134. package/dist/{setup-Doq8atTG.mjs → setup-D9HNfS7W.mjs} +4 -4
  135. package/dist/{skills-yuzH_o8s.mjs → skills-DvSQOPWg.mjs} +3 -3
  136. package/dist/{skills-y-KsUqT9.mjs → skills-aRQfUvCq.mjs} +1 -1
  137. package/dist/{snippet-ScFM8re8.mjs → snippet-CwRiMCfE.mjs} +5 -5
  138. package/dist/{stash-D_u6z4q6.mjs → stash-C_k1uZlf.mjs} +6 -6
  139. package/dist/{status-CDPhDX5I.mjs → status-BsEPyknG.mjs} +6 -6
  140. package/dist/{status--Dm2Jv6k.mjs → status-D1vtL5eW.mjs} +3 -3
  141. package/dist/{summary-C9a2cBTE.mjs → summary-h20AjhcO.mjs} +3 -3
  142. package/dist/{sync-schema-CDIWNCGI.mjs → sync-schema-D67cYLhd.mjs} +5 -5
  143. package/dist/{sync-scope-DW2QpGwv.mjs → sync-scope-CKx6xeF6.mjs} +3 -3
  144. package/dist/{table-BKehBm_E.mjs → table-CmKFWPvJ.mjs} +4 -4
  145. package/dist/{timeline-n3Nw9Egt.mjs → timeline-1ZphX3zj.mjs} +7 -7
  146. package/dist/{timeline-event-CLWMxvE0.mjs → timeline-event-C6aKZ4EO.mjs} +5 -5
  147. package/dist/transform-CvsBOTqB.mjs +31 -0
  148. package/dist/transform-job-D_8Kp772.mjs +25 -0
  149. package/dist/{transform-tag-Bkyasy_s.mjs → transform-tag-DhDnvbmq.mjs} +4 -4
  150. package/dist/{transforms-w2a5qsjJ.mjs → transforms-BQkmsPUR.mjs} +4 -4
  151. package/dist/{tree-JZC6vD9q.mjs → tree-CtufTBZY.mjs} +2 -2
  152. package/dist/{unpublish-BsfIH46y.mjs → unpublish-CnLXPYR8.mjs} +4 -4
  153. package/dist/{update-Cg09lBb5.mjs → update-BC-MLtiG.mjs} +9 -9
  154. package/dist/{update-B8hn6VxO.mjs → update-BZxLyBVm.mjs} +8 -8
  155. package/dist/{update-DSlSr7Ky.mjs → update-C4P_YtGW.mjs} +6 -6
  156. package/dist/{update-BSNK36fk.mjs → update-CE-Z6E8V.mjs} +7 -7
  157. package/dist/{update-D01S8hnw.mjs → update-CqQj32ol.mjs} +6 -6
  158. package/dist/{update-BTFj6WHo.mjs → update-D6blsNGY.mjs} +6 -6
  159. package/dist/{update-CXKWHOIN.mjs → update-DcYwxb-R.mjs} +5 -5
  160. package/dist/{update-bFNKpay8.mjs → update-DmQJqGvX.mjs} +6 -6
  161. package/dist/{update-WLb9099y.mjs → update-DshCe-bl.mjs} +8 -8
  162. package/dist/{update-BfIGjAVA.mjs → update-Dt9-3Tqf.mjs} +5 -5
  163. package/dist/{update-DKQjMsuE.mjs → update-QNuvGuS3.mjs} +5 -5
  164. package/dist/{update-C1_aIL6X.mjs → update-bz-FKwuR.mjs} +7 -7
  165. package/dist/{update-QaBVvlz9.mjs → update-dJ2mlCXm.mjs} +6 -6
  166. package/dist/{update-dashcard-CKZC7scy.mjs → update-dashcard-CQP-qd6a.mjs} +5 -5
  167. package/dist/{upgrade-DkK1ZbEY.mjs → upgrade--_g3bacj.mjs} +4 -4
  168. package/dist/{upload-DOMoaR9f.mjs → upload-BOFc_eZD.mjs} +3 -3
  169. package/dist/{uuid-DDbLKnbe.mjs → uuid-DBKkosBq.mjs} +2 -2
  170. package/dist/{validate-DqQ7DQnP.mjs → validate-Bpqt3ntH.mjs} +1 -1
  171. package/dist/{validate-query-BYG7lyaY.mjs → validate-query-tECK019A.mjs} +2 -2
  172. package/dist/{values-Bc99Kkuv.mjs → values-BAhMnVh6.mjs} +3 -3
  173. package/dist/{verify-WvMbaT8W.mjs → verify-RLb2DoOX.mjs} +2 -2
  174. package/dist/{wait-DmgEPnHW.mjs → wait-BJ_87Yz0.mjs} +5 -5
  175. package/dist/{wait-flags-BpzyrpAL.mjs → wait-flags-DEn-3mjb.mjs} +2 -2
  176. package/package.json +1 -1
  177. package/dist/add-collection-CCpC-GUz.mjs +0 -9
  178. package/dist/create-BP8EIWrP.mjs +0 -161
  179. package/dist/destroy-B51EPvOJ.mjs +0 -168
  180. package/dist/export-Cy2DFtR2.mjs +0 -10
  181. package/dist/get-BdNC8WM8.mjs +0 -38
  182. package/dist/git-sync-CmB4YBmS.mjs +0 -31
  183. package/dist/is-dirty-DOy1TRcf.mjs +0 -8
  184. package/dist/list-lsPeumLP.mjs +0 -34
  185. package/dist/parse-id-xS1tWJAq.mjs +0 -18
  186. package/dist/profile-name-CZ1-Vtrh.mjs +0 -7
  187. package/dist/transform-CrOOqKen.mjs +0 -31
  188. package/dist/transform-job-J-E0Mec7.mjs +0 -25
  189. package/dist/workspace-BgH_4xFO.mjs +0 -75
  190. package/dist/workspace-LFtHxcw9.mjs +0 -19
  191. /package/dist/{measure-C3G1srWb.mjs → measure-ByY4U3ZK.mjs} +0 -0
  192. /package/dist/{resolve-BTZuO3Yq.mjs → resolve-8iT-dXgX.mjs} +0 -0
  193. /package/dist/{revision-message-flag-CHrJgFFx.mjs → revision-message-flag-vt_V8ACy.mjs} +0 -0
  194. /package/dist/{segment-CxRYEXeO.mjs → segment-eeGhLo7_.mjs} +0 -0
  195. /package/dist/{setting-m46MUtW5.mjs → setting-DADuiF5W.mjs} +0 -0
  196. /package/dist/{snippet-C8PVaPY9.mjs → snippet-CdjEhVCT.mjs} +0 -0
  197. /package/dist/{timeline-DEaiuB5V.mjs → timeline-2ShuGr4f.mjs} +0 -0
  198. /package/dist/{transform-DP6J2ber.mjs → transform-DNSMm1dV.mjs} +0 -0
  199. /package/dist/{transform-job-B5x8aYfV.mjs → transform-job-CvE0MBBo.mjs} +0 -0
  200. /package/dist/{transform-tag-BRwfWeHf.mjs → transform-tag-xdxjlDcD.mjs} +0 -0
@@ -1,11 +1,11 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
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 { readBody } from "./body-5snfmiwR.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import "./input-D2-H-QKX.mjs";
5
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
6
+ import { readBody } from "./body-BW_CiL1d.mjs";
7
7
  import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
8
- import { TransformTag, TransformTagUpdateInput, transformTagView } from "./transform-tag-BRwfWeHf.mjs";
8
+ import { TransformTag, TransformTagUpdateInput, transformTagView } from "./transform-tag-xdxjlDcD.mjs";
9
9
 
10
10
  //#region src/commands/transform-tag/update.ts
11
11
  var update_default = defineMetabaseCommand({
@@ -1,13 +1,13 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
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 { readBody } from "./body-5snfmiwR.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import "./input-D2-H-QKX.mjs";
5
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
6
+ import { readBody } from "./body-BW_CiL1d.mjs";
7
7
  import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
8
- import "./validate-DqQ7DQnP.mjs";
9
- import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BYG7lyaY.mjs";
10
- import { Measure, MeasureUpdateInput, measureView } from "./measure-C3G1srWb.mjs";
8
+ import "./validate-Bpqt3ntH.mjs";
9
+ import { MEASURE_DEFINITION_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-tECK019A.mjs";
10
+ import { Measure, MeasureUpdateInput, measureView } from "./measure-ByY4U3ZK.mjs";
11
11
 
12
12
  //#region src/commands/measure/update.ts
13
13
  var update_default = defineMetabaseCommand({
@@ -1,10 +1,10 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
4
- import "./input-BGyHn0Kr.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import "./input-D2-H-QKX.mjs";
5
5
  import { Field, FieldUpdateInput, fieldView } from "./field-DsXTeqBy.mjs";
6
- import { parseId } from "./parse-id-xS1tWJAq.mjs";
7
- import { readBody } from "./body-5snfmiwR.mjs";
6
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
7
+ import { readBody } from "./body-BW_CiL1d.mjs";
8
8
  import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
9
9
 
10
10
  //#region src/commands/field/update.ts
@@ -1,9 +1,9 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
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 { readBody } from "./body-5snfmiwR.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import "./input-D2-H-QKX.mjs";
5
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
6
+ import { readBody } from "./body-BW_CiL1d.mjs";
7
7
  import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
8
8
  import { Document, DocumentUpdateInput, documentView } from "./document-D4zB-5a0.mjs";
9
9
 
@@ -1,16 +1,16 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
4
- import "./input-BGyHn0Kr.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import "./input-D2-H-QKX.mjs";
5
5
  import "./embedding-CKdw8q7p.mjs";
6
6
  import "./field-DsXTeqBy.mjs";
7
7
  import "./parameter-BZ6y-Gfs.mjs";
8
8
  import { Card, CardUpdateInput, cardView } from "./card-B8G5jQQT.mjs";
9
- import { parseId } from "./parse-id-xS1tWJAq.mjs";
10
- import { readBody } from "./body-5snfmiwR.mjs";
9
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
10
+ import { readBody } from "./body-BW_CiL1d.mjs";
11
11
  import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
12
- import "./validate-DqQ7DQnP.mjs";
13
- import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-BYG7lyaY.mjs";
12
+ import "./validate-Bpqt3ntH.mjs";
13
+ import { CARD_DATASET_QUERY_LABELS, preflightMbql5Query, skipValidateFlag } from "./validate-query-tECK019A.mjs";
14
14
 
15
15
  //#region src/commands/card/update.ts
16
16
  var update_default = defineMetabaseCommand({
@@ -1,11 +1,11 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
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 { readBody } from "./body-5snfmiwR.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import "./input-D2-H-QKX.mjs";
5
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
6
+ import { readBody } from "./body-BW_CiL1d.mjs";
7
7
  import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
8
- import { TransformJob, TransformJobUpdateInput, transformJobView } from "./transform-job-B5x8aYfV.mjs";
8
+ import { TransformJob, TransformJobUpdateInput, transformJobView } from "./transform-job-CvE0MBBo.mjs";
9
9
 
10
10
  //#region src/commands/transform-job/update.ts
11
11
  var update_default = defineMetabaseCommand({
@@ -1,11 +1,11 @@
1
- import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { ConfigError, connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
4
- import "./input-BGyHn0Kr.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import "./input-D2-H-QKX.mjs";
5
5
  import "./embedding-CKdw8q7p.mjs";
6
6
  import "./parameter-BZ6y-Gfs.mjs";
7
- import { parseId } from "./parse-id-xS1tWJAq.mjs";
8
- import { readBody } from "./body-5snfmiwR.mjs";
7
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
8
+ import { readBody } from "./body-BW_CiL1d.mjs";
9
9
  import { bodyInputFlags } from "./body-flags-CgHgJBRC.mjs";
10
10
  import { DashboardDetail, Dashcard, DashcardPatchInput, dashcardView } from "./dashboard-BLihjDXg.mjs";
11
11
 
@@ -1,8 +1,8 @@
1
- import { AbortError, NetworkError, TimeoutError, UnknownError, errorMessage, outputFlags, package_default, renderItem, writeText } from "./capabilities-CiaAfUgX.mjs";
1
+ import { AbortError, NetworkError, TimeoutError, UnknownError, errorMessage, outputFlags, package_default, renderItem, writeText } from "./capabilities-CSjeWyLV.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { HttpError, USER_AGENT, combineAborts, defineMetabaseCommand, parseJson, throwIfAborted } from "./runtime-C6ASrgVA.mjs";
4
- import { promptConfirm } from "./prompt-jQnNKtlx.mjs";
5
- import { streamProcess } from "./process-7c8BcQEi.mjs";
3
+ import { HttpError, USER_AGENT, combineAborts, defineMetabaseCommand, parseJson, throwIfAborted } from "./runtime-MGH96fhp.mjs";
4
+ import { promptConfirm } from "./prompt-BSqji7Fo.mjs";
5
+ import { streamProcess } from "./process-jjR_DX5G.mjs";
6
6
  import { z } from "zod";
7
7
  import { realpathSync } from "node:fs";
8
8
  import { compare, valid } from "semver";
@@ -6,9 +6,9 @@ var upload_default = defineCommandGroup({
6
6
  name: "upload",
7
7
  description: "Upload CSV files into Metabase",
8
8
  subCommands: {
9
- csv: () => import("./csv-CZyYi0vi.mjs").then((m) => m.default),
10
- append: () => import("./append-DMcxP1LM.mjs").then((m) => m.default),
11
- replace: () => import("./replace-DZWd6avZ.mjs").then((m) => m.default)
9
+ csv: () => import("./csv-C3O1wTQ8.mjs").then((m) => m.default),
10
+ append: () => import("./append-Cak5jykn.mjs").then((m) => m.default),
11
+ replace: () => import("./replace-xlQv9yl_.mjs").then((m) => m.default)
12
12
  }
13
13
  });
14
14
 
@@ -1,6 +1,6 @@
1
- import { ConfigError, outputFlags, writeJson, writeText } from "./capabilities-CiaAfUgX.mjs";
1
+ import { ConfigError, outputFlags, writeJson, writeText } from "./capabilities-CSjeWyLV.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { defineMetabaseCommand, parseInteger } from "./runtime-C6ASrgVA.mjs";
3
+ import { defineMetabaseCommand, parseInteger } from "./runtime-MGH96fhp.mjs";
4
4
  import { z } from "zod";
5
5
  import { randomUUID } from "node:crypto";
6
6
 
@@ -1,4 +1,4 @@
1
- import { ConfigError, escapeJsonPointerSegment, isPlainObject } from "./capabilities-CiaAfUgX.mjs";
1
+ import { ConfigError, escapeJsonPointerSegment, isPlainObject } from "./capabilities-CSjeWyLV.mjs";
2
2
  import { z } from "zod";
3
3
  import Ajv2020 from "ajv/dist/2020.js";
4
4
  import addFormats from "ajv-formats";
@@ -1,5 +1,5 @@
1
- import { ConfigError, writeJson } from "./capabilities-CiaAfUgX.mjs";
2
- import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-DqQ7DQnP.mjs";
1
+ import { ConfigError, writeJson } from "./capabilities-CSjeWyLV.mjs";
2
+ import { assertNotLegacyEnvelopeWrappingMbql5, isMbql5Query, validateQuery } from "./validate-Bpqt3ntH.mjs";
3
3
 
4
4
  //#region src/commands/validate-query.ts
5
5
  const skipValidateFlag = { "skip-validate": {
@@ -1,8 +1,8 @@
1
- import { connectionFlags, formatScalar, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, formatScalar, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
4
  import { FieldValues, fieldValuesView } from "./field-DsXTeqBy.mjs";
5
- import { parseId } from "./parse-id-xS1tWJAq.mjs";
5
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
6
6
 
7
7
  //#region src/commands/field/values.ts
8
8
  var values_default = defineMetabaseCommand({
@@ -1,5 +1,5 @@
1
- import { MetabaseError, NetworkError, TimeoutError, errorMessage } from "./capabilities-CiaAfUgX.mjs";
2
- import { HttpError, createClient, probeServer } from "./runtime-C6ASrgVA.mjs";
1
+ import { MetabaseError, NetworkError, TimeoutError, errorMessage } from "./capabilities-CSjeWyLV.mjs";
2
+ import { HttpError, createClient, probeServer } from "./runtime-MGH96fhp.mjs";
3
3
  import { z } from "zod";
4
4
 
5
5
  //#region src/domain/user.ts
@@ -1,9 +1,9 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CiaAfUgX.mjs";
1
+ import { connectionFlags, outputFlags, profileFlag, renderSummary } from "./capabilities-CSjeWyLV.mjs";
2
2
  import "./command-augment-D9pI9Vbh.mjs";
3
- import { defineMetabaseCommand } from "./runtime-C6ASrgVA.mjs";
4
- import { parseId } from "./parse-id-xS1tWJAq.mjs";
5
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-CuTlWBwI.mjs";
6
- import { SyncTaskOrIdle, formatSyncTask, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-DhsYs8Hx.mjs";
3
+ import { defineMetabaseCommand } from "./runtime-MGH96fhp.mjs";
4
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
5
+ import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-CgzD9_RH.mjs";
6
+ import { SyncTaskOrIdle, formatSyncTask, pollSyncTask, syncTaskIdleView, syncTaskView, throwIfFailedTask } from "./poll-task-DF9xJl13.mjs";
7
7
 
8
8
  //#region src/commands/git-sync/wait.ts
9
9
  const WaitResult = SyncTaskOrIdle;
@@ -1,5 +1,5 @@
1
- import { parseId } from "./parse-id-xS1tWJAq.mjs";
2
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-CuTlWBwI.mjs";
1
+ import { parseId } from "./parse-id-ySsF4nA3.mjs";
2
+ import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-CgzD9_RH.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.2.1-alpha.bcm-ghy-4075-spawn-default-profile.eb120d1",
3
+ "version": "0.2.1-alpha.trust-system-ca.541e4e0",
4
4
  "description": "Metabase CLI",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {
@@ -1,9 +0,0 @@
1
- import "./capabilities-CiaAfUgX.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import "./runtime-C6ASrgVA.mjs";
4
- import "./parse-id-xS1tWJAq.mjs";
5
- import "./poll-CuTlWBwI.mjs";
6
- import "./poll-task-DhsYs8Hx.mjs";
7
- import { SyncSettingsUpdateResult, add_collection_default, setCollectionRemoteSynced, syncSettingsUpdateView } from "./add-collection-CLXfrgp4.mjs";
8
-
9
- export { add_collection_default as default };
@@ -1,161 +0,0 @@
1
- import { ConfigError, ENV_API_KEY, connectionFlags, errorMessage, outputFlags, profileFlag, renderSummary, warn } from "./capabilities-CiaAfUgX.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { WORKSPACE_MANAGER_SCOPE, clearProfile, defineMetabaseCommand, keyringFallbackWarning, listProfileRecords, normalizeUrl, readEnvCredentials, readProfileCredential, resolveRecordCredential, revokeOAuthCredential, setDefaultProfile, writeProfile } from "./runtime-C6ASrgVA.mjs";
4
- import { promptConfirm } from "./prompt-jQnNKtlx.mjs";
5
- import { parseIdCsv } from "./parse-id-xS1tWJAq.mjs";
6
- import { Workspace, workspaceView } from "./workspace-BgH_4xFO.mjs";
7
- import { workspaceProfileName } from "./profile-name-CZ1-Vtrh.mjs";
8
- import { z } from "zod";
9
-
10
- //#region src/core/auth/stale-credentials.ts
11
- function findStaleParentCredentials(records, targetUrl, currentProfile) {
12
- const target = normalizeUrl(targetUrl);
13
- const stale = [];
14
- for (const record of records) {
15
- if (record.name === currentProfile || normalizeUrl(record.url) !== target) continue;
16
- const resolved = resolveRecordCredential(record);
17
- if (resolved === null) continue;
18
- if (resolved.credential.kind === "apiKey") stale.push({
19
- profile: record.name,
20
- kind: "apiKey"
21
- });
22
- else if (resolved.credential.scope !== WORKSPACE_MANAGER_SCOPE) stale.push({
23
- profile: record.name,
24
- kind: "oauth",
25
- scope: resolved.credential.scope
26
- });
27
- }
28
- return stale;
29
- }
30
- function describeStaleCredential(credential) {
31
- const detail = credential.kind === "apiKey" ? "api key" : credential.scope;
32
- return `${credential.profile} (${detail})`;
33
- }
34
-
35
- //#endregion
36
- //#region src/commands/workspace/credential-sweep.ts
37
- const keepExistingAuthFlag = { keepExistingAuth: {
38
- type: "boolean",
39
- description: "Proceed despite broader same-server credentials in the profile store (interactive only)",
40
- alias: "keep-existing-auth",
41
- default: false
42
- } };
43
- async function enforceCredentialSweep(input) {
44
- const records = await listProfileRecords();
45
- const stale = findStaleParentCredentials(records, input.url, input.profile);
46
- if (stale.length === 0) return;
47
- const listing = stale.map(describeStaleCredential).join(", ");
48
- const interactive = process.stdin.isTTY === true;
49
- if (input.keepExistingAuth) {
50
- if (!interactive) throw new ConfigError("--keep-existing-auth requires an interactive terminal; refusing to proceed with broader credentials in a non-interactive context");
51
- warn(`proceeding with broader credentials left in the profile store: ${listing}`);
52
- return;
53
- }
54
- if (!interactive) throw new ConfigError(`refusing to ${input.action}: broader credentials for this server exist in the profile store (${listing}) — revoke them with \`mb auth logout --profile <name>\` first; a human can override with --keep-existing-auth`);
55
- const ok = await promptConfirm({
56
- message: `Broader credentials for this server exist (${listing}). Revoke them before continuing?`,
57
- initialValue: true
58
- });
59
- if (!ok) throw new ConfigError(`aborted: revoke the broader credentials (${listing}) with \`mb auth logout --profile <name>\` or pass --keep-existing-auth`);
60
- for (const credential of stale) await revokeStaleCredential(credential);
61
- }
62
- async function revokeStaleCredential(stale) {
63
- const resolved = await readProfileCredential(stale.profile);
64
- await clearProfile(stale.profile);
65
- if (resolved === null || resolved.credential.kind !== "oauth") {
66
- warn(`cleared profile "${stale.profile}"; its API key is still active server-side — delete it in Admin settings → Authentication → API keys`);
67
- return;
68
- }
69
- try {
70
- const revoked = await revokeOAuthCredential(resolved.url, resolved.credential);
71
- if (!revoked) warn(`cleared profile "${stale.profile}", but the server advertises no revocation endpoint; its tokens remain valid until they expire`);
72
- } catch (error) {
73
- warn(`cleared profile "${stale.profile}", but revoking server-side failed: ${errorMessage(error)}`);
74
- }
75
- }
76
-
77
- //#endregion
78
- //#region src/commands/workspace/create.ts
79
- const SpawnedWorkspace = Workspace.extend({
80
- url: z.string().optional(),
81
- api_key: z.string().optional()
82
- });
83
- var create_default = defineMetabaseCommand({
84
- meta: {
85
- name: "create",
86
- description: "Create and provision a workspace"
87
- },
88
- details: "Attaches the given databases and provisions warehouse isolation (a temporary schema + user per database) before returning. Each database must be eligible for workspaces; provisioning is blocking, so the response carries the final per-database status. Before creating, the profile store is swept for broader same-server credentials (any API key, any OAuth grant wider than mb:workspace-manager): interactive runs offer to revoke them, non-interactive runs refuse — --keep-existing-auth is the human-only override. With --spawn the parent also asks its instance manager to spawn a workspace Metabase; the returned credential is saved to the ws-<id> profile (never printed) and made the default, so bare `mb` targets the new workspace.",
89
- capabilities: {
90
- minVersion: 62,
91
- tokenFeature: "workspaces"
92
- },
93
- args: {
94
- ...outputFlags,
95
- ...profileFlag,
96
- ...connectionFlags,
97
- ...keepExistingAuthFlag,
98
- name: {
99
- type: "string",
100
- description: "Workspace name",
101
- required: true
102
- },
103
- "database-ids": {
104
- type: "string",
105
- description: "Database ids to attach, comma separated",
106
- required: true
107
- },
108
- spawn: {
109
- type: "boolean",
110
- description: "Spawn a workspace instance and save its credential as the default profile (key is never printed)",
111
- default: false
112
- }
113
- },
114
- outputSchema: Workspace,
115
- examples: [
116
- "mb workspace create --name ws-reports --database-ids 1",
117
- "mb workspace create --name ws-etl --database-ids 1,2 --json",
118
- "mb workspace create --name transform-work --database-ids 1 --spawn"
119
- ],
120
- async run({ args, ctx, getClient, getResolvedConfig }) {
121
- const databaseIds = parseIdCsv(args["database-ids"], "database id");
122
- if (args.spawn) assertNoApiKeyEnvShadow();
123
- const resolved = await getResolvedConfig();
124
- await enforceCredentialSweep({
125
- url: resolved.url,
126
- profile: resolved.profile,
127
- keepExistingAuth: args.keepExistingAuth === true,
128
- action: "create a workspace"
129
- });
130
- const client = await getClient();
131
- const created = await client.requestParsed(SpawnedWorkspace, "/api/ee/workspace-manager/", {
132
- method: "POST",
133
- body: {
134
- name: args.name,
135
- database_ids: databaseIds,
136
- spawn_instance: args.spawn ? true : void 0
137
- }
138
- });
139
- if (args.spawn) await saveSpawnedCredential(created);
140
- const workspace = { ...created };
141
- delete workspace.api_key;
142
- renderSummary(workspace, workspaceView, `Created workspace ${created.id} "${created.name}".`, ctx);
143
- }
144
- });
145
- function assertNoApiKeyEnvShadow() {
146
- if (readEnvCredentials().apiKey !== null) throw new ConfigError(`--spawn saves the workspace credential as the default profile, but ${ENV_API_KEY} is set and would shadow it — unset ${ENV_API_KEY} first`);
147
- }
148
- async function saveSpawnedCredential(created) {
149
- if (created.url === void 0 || created.api_key === void 0) throw new Error("the server did not return a spawned instance (no url/api_key in the create response) — this Metabase may not support spawn_instance");
150
- const profileName = workspaceProfileName(created.id);
151
- const location = await writeProfile({
152
- url: normalizeUrl(created.url),
153
- apiKey: created.api_key
154
- }, profileName);
155
- if (location.backend === "file") warn(keyringFallbackWarning(location));
156
- await setDefaultProfile(profileName);
157
- warn(`saved workspace credential to profile "${profileName}" and made it the default — bare \`mb\` now targets ${created.url}`);
158
- }
159
-
160
- //#endregion
161
- export { create_default as default };
@@ -1,168 +0,0 @@
1
- import { ConfigError, connectionFlags, errorMessage, outputFlags, profileFlag, renderSummary, warn } from "./capabilities-CiaAfUgX.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import { clearProfile, createClient, defineMetabaseCommand, readProfileCredential } from "./runtime-C6ASrgVA.mjs";
4
- import { promptConfirm } from "./prompt-jQnNKtlx.mjs";
5
- import { parseId } from "./parse-id-xS1tWJAq.mjs";
6
- import { DEFAULT_INTERVAL_MS, DEFAULT_TIMEOUT_MS } from "./poll-CuTlWBwI.mjs";
7
- import "./wait-flags-BpzyrpAL.mjs";
8
- import { REMOTE_SYNC_PATHS, pollSyncTask, throwIfFailedTask } from "./poll-task-DhsYs8Hx.mjs";
9
- import { SyncExportKickoff } from "./export-CippuWZJ.mjs";
10
- import { IsDirtyResult } from "./is-dirty-BPluqPPP.mjs";
11
- import { workspaceProfileName } from "./profile-name-CZ1-Vtrh.mjs";
12
- import { z } from "zod";
13
-
14
- //#region src/commands/workspace/destroy.ts
15
- const WorkspaceOrphanedResource = z.object({
16
- workspace_database_id: z.number().int(),
17
- database_id: z.number().int(),
18
- driver: z.string(),
19
- schema: z.string(),
20
- user: z.string(),
21
- reason: z.string().nullable().optional()
22
- }).loose();
23
- const WorkspaceDeleteResponse = z.object({
24
- id: z.number().int(),
25
- deleted: z.boolean(),
26
- message: z.string().optional(),
27
- orphaned_resources: z.array(WorkspaceOrphanedResource).optional()
28
- }).loose();
29
- const WorkspaceDestroyResult = WorkspaceDeleteResponse.extend({ aborted: z.boolean() });
30
- const workspaceDestroyView = {
31
- compactPick: WorkspaceDestroyResult,
32
- tableColumns: [
33
- {
34
- key: "id",
35
- label: "ID"
36
- },
37
- {
38
- key: "deleted",
39
- label: "Destroyed"
40
- },
41
- {
42
- key: "aborted",
43
- label: "Aborted"
44
- },
45
- {
46
- key: "message",
47
- label: "Message"
48
- }
49
- ]
50
- };
51
- var destroy_default = defineMetabaseCommand({
52
- meta: {
53
- name: "destroy",
54
- description: "Destroy a workspace and its warehouse isolation"
55
- },
56
- details: "Destroy is the only irreversible moment, so it closes the work-loss window first: when a local profile named ws-<id> exists, the child is checked for unsynced work and a dirty workspace is auto-exported to its target branch before anything is torn down (--discard skips the check and the export). Then each provisioned database's warehouse isolation (temporary schema + user) is dropped and the workspace removed; the matching local profile is dropped on success. Refuses with a 409 while any database is still provisioning/deprovisioning unless --ignore-pending is passed, which removes the workspace records and leaves those warehouse objects behind. If the warehouse was unreachable, the result lists the leftover schema/user objects under orphaned_resources.",
57
- capabilities: {
58
- minVersion: 62,
59
- tokenFeature: "workspaces"
60
- },
61
- args: {
62
- ...outputFlags,
63
- ...profileFlag,
64
- ...connectionFlags,
65
- yes: {
66
- type: "boolean",
67
- description: "Skip confirmation",
68
- default: false
69
- },
70
- discard: {
71
- type: "boolean",
72
- description: "Destroy without exporting unsynced work (skips the is-dirty check)",
73
- default: false
74
- },
75
- "ignore-pending": {
76
- type: "boolean",
77
- description: "Remove workspace records even while databases are provisioning/deprovisioning",
78
- default: false
79
- },
80
- id: {
81
- type: "positional",
82
- description: "Workspace id",
83
- required: true
84
- }
85
- },
86
- outputSchema: WorkspaceDestroyResult,
87
- examples: [
88
- "mb workspace destroy 1 --yes",
89
- "mb workspace destroy 1 --yes --discard",
90
- "mb workspace destroy 1 --yes --ignore-pending"
91
- ],
92
- async run({ args, ctx, getClient }) {
93
- const id = parseId(args.id);
94
- if (!args.yes) {
95
- if (process.stdin.isTTY !== true) throw new ConfigError(`refusing to destroy workspace ${id} without confirmation — pass --yes to proceed non-interactively`);
96
- const ok = await promptConfirm({
97
- message: `Destroy workspace ${id}? Its warehouse isolation (schema + user) is dropped.`,
98
- initialValue: false
99
- });
100
- if (!ok) {
101
- renderSummary({
102
- id,
103
- deleted: false,
104
- aborted: true
105
- }, workspaceDestroyView, `Aborted; workspace ${id} was not destroyed.`, ctx);
106
- return;
107
- }
108
- }
109
- const client = await getClient();
110
- const profileName = workspaceProfileName(id);
111
- const hasProfile = await guardUnsyncedWork(profileName, args.discard);
112
- const response = await client.requestParsed(WorkspaceDeleteResponse, `/api/ee/workspace-manager/${id}`, {
113
- method: "DELETE",
114
- query: { "ignore-pending": args["ignore-pending"] ? true : void 0 }
115
- });
116
- if (response.deleted && hasProfile) {
117
- await clearProfile(profileName);
118
- warn(`dropped profile "${profileName}"`);
119
- }
120
- renderSummary({
121
- ...response,
122
- aborted: false
123
- }, workspaceDestroyView, response.message ?? `Destroyed workspace ${id}.`, ctx);
124
- }
125
- });
126
- async function guardUnsyncedWork(profileName, discard) {
127
- const resolved = await readProfileCredential(profileName);
128
- if (resolved === null) {
129
- warn(`no local profile "${profileName}" for this workspace — skipping the unsynced-work check`);
130
- return false;
131
- }
132
- if (discard) {
133
- warn("--discard given — skipping the unsynced-work check");
134
- return true;
135
- }
136
- const child = createClient({
137
- url: resolved.url,
138
- credential: resolved.credential
139
- });
140
- const dirty = await checkIsDirty(child, profileName);
141
- if (!dirty) return true;
142
- warn("workspace has unsynced work — exporting to the target branch before destroy");
143
- await exportUnsyncedWork(child);
144
- return true;
145
- }
146
- async function checkIsDirty(child, profileName) {
147
- try {
148
- const result = await child.requestParsed(IsDirtyResult, REMOTE_SYNC_PATHS.isDirty);
149
- return result.is_dirty;
150
- } catch (error) {
151
- throw new ConfigError(`could not check workspace profile "${profileName}" for unsynced work: ${errorMessage(error)} — pass --discard to destroy anyway`);
152
- }
153
- }
154
- async function exportUnsyncedWork(child) {
155
- const kickoff = await child.requestParsed(SyncExportKickoff, REMOTE_SYNC_PATHS.export, {
156
- method: "POST",
157
- body: {}
158
- });
159
- const final = await pollSyncTask(child, {
160
- intervalMs: DEFAULT_INTERVAL_MS,
161
- timeoutMs: DEFAULT_TIMEOUT_MS
162
- });
163
- throwIfFailedTask(final, "export");
164
- warn(`export task #${kickoff.task_id} completed; unsynced work is saved`);
165
- }
166
-
167
- //#endregion
168
- export { destroy_default as default };
@@ -1,10 +0,0 @@
1
- import "./capabilities-CiaAfUgX.mjs";
2
- import "./command-augment-D9pI9Vbh.mjs";
3
- import "./runtime-C6ASrgVA.mjs";
4
- import "./parse-id-xS1tWJAq.mjs";
5
- import "./poll-CuTlWBwI.mjs";
6
- import "./wait-flags-BpzyrpAL.mjs";
7
- import "./poll-task-DhsYs8Hx.mjs";
8
- import { SyncExportKickoff, SyncExportResult, export_default } from "./export-CippuWZJ.mjs";
9
-
10
- export { export_default as default };
@@ -1,38 +0,0 @@
1
- import { connectionFlags, outputFlags, profileFlag, renderItem } 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 { Workspace, workspaceView } from "./workspace-BgH_4xFO.mjs";
6
-
7
- //#region src/commands/workspace/get.ts
8
- var get_default = defineMetabaseCommand({
9
- meta: {
10
- name: "get",
11
- description: "Get a workspace by id"
12
- },
13
- capabilities: {
14
- minVersion: 62,
15
- tokenFeature: "workspaces"
16
- },
17
- args: {
18
- ...outputFlags,
19
- ...profileFlag,
20
- ...connectionFlags,
21
- id: {
22
- type: "positional",
23
- description: "Workspace id",
24
- required: true
25
- }
26
- },
27
- outputSchema: Workspace,
28
- examples: ["mb workspace get 1", "mb workspace get 1 --json"],
29
- async run({ args, ctx, getClient }) {
30
- const id = parseId(args.id);
31
- const client = await getClient();
32
- const workspace = await client.requestParsed(Workspace, `/api/ee/workspace-manager/${id}`);
33
- renderItem(workspace, workspaceView, ctx);
34
- }
35
- });
36
-
37
- //#endregion
38
- export { get_default as default };