@metabase/cli 0.3.0 → 0.3.1-alpha.transform-tests.3fbcf8b

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 (198) hide show
  1. package/dist/{add-collection-B3Ty8SzB.mjs → add-collection-C-XJPp3F.mjs} +2 -2
  2. package/dist/{alert-DT-ee7yf.mjs → alert-Klz8Bhst.mjs} +6 -6
  3. package/dist/{alerts-Bf2RH_p_.mjs → alerts-Bp2vByJf.mjs} +3 -3
  4. package/dist/{append-DFzQRPMd.mjs → append-D16_s1HW.mjs} +4 -3
  5. package/dist/{archive-ChORH5JH.mjs → archive-BOJUGwyL.mjs} +2 -2
  6. package/dist/{archive-CwAdlv63.mjs → archive-Bj4MjbJY.mjs} +2 -2
  7. package/dist/{archive-ByvA49Kz.mjs → archive-C9iNjXcI.mjs} +2 -2
  8. package/dist/{archive-Cd29QC0c.mjs → archive-CA-HIfQq.mjs} +2 -2
  9. package/dist/{archive-4tmm946K.mjs → archive-D4nGMs8A.mjs} +2 -2
  10. package/dist/{archive-B6eXiyER.mjs → archive-Dd7ZTibw.mjs} +2 -2
  11. package/dist/{archive-lQqs13Uz.mjs → archive-Q_qUuYh8.mjs} +2 -2
  12. package/dist/{archive-BxNPHxOY.mjs → archive-RzzXt2V0.mjs} +2 -2
  13. package/dist/{archive-C7w49Grr.mjs → archive-lDnTIypd.mjs} +2 -2
  14. package/dist/{archive-gid9Y09v.mjs → archive-nDvHMzTv.mjs} +2 -2
  15. package/dist/{archive-Dr9Xnx_Z.mjs → archive-vzu8ghZZ.mjs} +4 -4
  16. package/dist/{auth-Dltxua89.mjs → auth-kyPQfiND.mjs} +4 -4
  17. package/dist/{body-Cur4NJt9.mjs → body-DxRSAMNC.mjs} +1 -1
  18. package/dist/{branches-DchlyU0i.mjs → branches-QixvzIpl.mjs} +1 -1
  19. package/dist/{cancel-BMQa5R1Z.mjs → cancel-CPStS4zJ.mjs} +2 -2
  20. package/dist/{cancel-task-C5CU1pxU.mjs → cancel-task--cuSISnl.mjs} +1 -1
  21. package/dist/{card-CHI2bmds.mjs → card-p2r_szeS.mjs} +7 -7
  22. package/dist/{cards-SccWvRQD.mjs → cards-CNbV8aGO.mjs} +4 -4
  23. package/dist/cli.mjs +32 -30
  24. package/dist/{client-BqhzKdLM.mjs → client-DynvZqa0.mjs} +98 -10
  25. package/dist/{collection-CY0AB99E.mjs → collection-CAM47Der.mjs} +6 -6
  26. package/dist/{collection-namespace-GwydWBF3.mjs → collection-namespace-CEoQ7G08.mjs} +1 -1
  27. package/dist/content-translation-BrHOrmj9.mjs +5 -0
  28. package/dist/content-translation-CxTabpLF.mjs +12 -0
  29. package/dist/{create-DV-Ln5Mo.mjs → create-BGV7ejai.mjs} +2 -2
  30. package/dist/{create-C79vErX0.mjs → create-BGy4L_yh.mjs} +2 -2
  31. package/dist/{create-DJmXXQoq.mjs → create-BMokmmLp2.mjs} +3 -3
  32. package/dist/{create-CAWytBE5.mjs → create-BTvSwLws.mjs} +2 -2
  33. package/dist/{create-Beh-2uoN.mjs → create-BikaTHCw.mjs} +2 -2
  34. package/dist/{create-zeveFdnd.mjs → create-BsvpUxJq.mjs} +1 -1
  35. package/dist/{create-DF4QtgDL.mjs → create-CEP4Jsrd.mjs} +2 -2
  36. package/dist/{create-i14Wv3Tj.mjs → create-CYhsYOOJ.mjs} +2 -2
  37. package/dist/{create-CD008jdE.mjs → create-CsABLrSI.mjs} +6 -6
  38. package/dist/{create-tQbnuz-I.mjs → create-CtDaASGO.mjs} +2 -2
  39. package/dist/{create-CHQx7jq4.mjs → create-DMLjSEkF.mjs} +2 -2
  40. package/dist/{create-CAQV2g6V.mjs → create-M8qXs24L.mjs} +2 -2
  41. package/dist/{create-BNQ_DytP.mjs → create-U15wd8_9.mjs} +2 -2
  42. package/dist/{create-BOLwWt8Q.mjs → create-UxWtLwXT.mjs} +2 -2
  43. package/dist/{create-CCh_LyW9.mjs → create-WIIp7MVV.mjs} +2 -2
  44. package/dist/{create-branch-CYo6jZth.mjs → create-branch-Bkq9rtf7.mjs} +1 -1
  45. package/dist/create-ku05K1Oj.mjs +34 -0
  46. package/dist/{csv-B2Jgb1GM.mjs → csv-GincCch9.mjs} +4 -3
  47. package/dist/{current-task-MpBFGttd.mjs → current-task-CbnNWQ7H.mjs} +1 -1
  48. package/dist/{dashboard-CsIFFpzK.mjs → dashboard-BlbNszi8.mjs} +1 -1
  49. package/dist/{dashboard-BCpSq_G-.mjs → dashboard-CKUR8ZpQ.mjs} +1 -0
  50. package/dist/{dashboard-BHJBoaG7.mjs → dashboard-ReNaou5J.mjs} +9 -9
  51. package/dist/{db-DsfojyeH.mjs → db-2hSYsqHk.mjs} +6 -6
  52. package/dist/{delete-BApOjQvl.mjs → delete-B2wmUpj_.mjs} +2 -2
  53. package/dist/{delete-DFmX7jTp.mjs → delete-BEPw7WRT.mjs} +2 -2
  54. package/dist/{delete-B8e01xAG.mjs → delete-Bv3_SIqh.mjs} +2 -2
  55. package/dist/{delete-Ob06PPie.mjs → delete-C1YmyeVy.mjs} +2 -2
  56. package/dist/delete-CZqleA9Q.mjs +44 -0
  57. package/dist/{delete-Ck0q4Dzp.mjs → delete-DNsY94Ok.mjs} +2 -2
  58. package/dist/{delete-table-DuyhGrvA.mjs → delete-table-DySwoEaq.mjs} +2 -2
  59. package/dist/{dependencies-Bj3QrGIm.mjs → dependencies-ygT6uMu4.mjs} +2 -2
  60. package/dist/{dirty-DNYoM6Bp.mjs → dirty-BkiHZ8gb.mjs} +1 -1
  61. package/dist/{document-BbskZPTT.mjs → document-DGbDloCb.mjs} +5 -5
  62. package/dist/download-Chr-YNTG.mjs +28 -0
  63. package/dist/{eid-WTZmDdsr.mjs → eid-BvY-YGpN.mjs} +2 -2
  64. package/dist/{events-Bn7jh5lP.mjs → events-B01P0G7C.mjs} +2 -2
  65. package/dist/{export-BjfoZRDJ.mjs → export-CG23iezf.mjs} +2 -2
  66. package/dist/{field-Zau6Hc6X.mjs → field-DikmNcAt.mjs} +4 -4
  67. package/dist/{fields-CBBa-Prp.mjs → fields-C9BF3jHL.mjs} +2 -2
  68. package/dist/{get-ByBOq30r.mjs → get-B3jvGI0b.mjs} +2 -2
  69. package/dist/{get-CvI--9S_.mjs → get-B4GltkXP.mjs} +1 -1
  70. package/dist/get-BHpVRSbm.mjs +32 -0
  71. package/dist/{get-DmpB6J9g.mjs → get-BYSFFlsd.mjs} +2 -2
  72. package/dist/{get-Dn9ZiSZr.mjs → get-Blbcl76m.mjs} +2 -2
  73. package/dist/{get-D_h-G9bn.mjs → get-BtauixMx.mjs} +2 -2
  74. package/dist/{get-CDJFVvhj.mjs → get-Buxkx-RX.mjs} +1 -1
  75. package/dist/{get-C2-Q3iQ5.mjs → get-C1V7vZse.mjs} +2 -2
  76. package/dist/{get-Dmj9Ygz1.mjs → get-C99cjjD0.mjs} +2 -2
  77. package/dist/{get-DRvsATp-.mjs → get-CMMXBVff.mjs} +2 -2
  78. package/dist/{get-CnbUCzDM.mjs → get-CkMLxzVy.mjs} +2 -2
  79. package/dist/{get-Bz99dAxK.mjs → get-DY-e5oP7.mjs} +4 -4
  80. package/dist/{get-DdsoHaKH.mjs → get-DZpRq_Fw.mjs} +2 -2
  81. package/dist/{get-DYO1kywc.mjs → get-DdSB-fpR.mjs} +2 -2
  82. package/dist/{get-CDMGbgrh.mjs → get-DvqYIBp5.mjs} +2 -2
  83. package/dist/{get-DkWO0EI0.mjs → get-FJofgEPB.mjs} +1 -1
  84. package/dist/{get-B_xdF1kq.mjs → get-N5EUCDL0.mjs} +2 -2
  85. package/dist/{get-00lyLv6R.mjs → get-PKhv8WUf.mjs} +2 -2
  86. package/dist/{get-B7sMgsFs.mjs → get-UW0DOjH5.mjs} +2 -2
  87. package/dist/{get-DY03Azx9.mjs → get-gFM8-HHP.mjs} +1 -1
  88. package/dist/{get-run-Cnux9ln0.mjs → get-run-F7ARJeAD.mjs} +2 -2
  89. package/dist/git-sync-IW4T2sKq.mjs +28 -0
  90. package/dist/{has-remote-changes-C684Redh.mjs → has-remote-changes-Bwyp8mc-.mjs} +1 -1
  91. package/dist/{import-Rmmttboo.mjs → import-CPY8aM8d.mjs} +2 -2
  92. package/dist/{is-dirty-DYeJYhBz.mjs → is-dirty-0F_UJY7Q.mjs} +1 -1
  93. package/dist/{items-CQlPXBXE.mjs → items-FUop0zGR.mjs} +1 -1
  94. package/dist/{library-Bsm5KsFF.mjs → library-DpOtb0E0.mjs} +4 -4
  95. package/dist/{list-CQwOgIlj.mjs → list--B2EUWJg.mjs} +1 -1
  96. package/dist/list-B-74c1BD.mjs +35 -0
  97. package/dist/{list-BpFp9Wre.mjs → list-BASNYNJr.mjs} +1 -1
  98. package/dist/{list-CKK-s3Ty.mjs → list-BQaXU1bp.mjs} +1 -1
  99. package/dist/{list-CQDprvW0.mjs → list-BQrk4Ua4.mjs} +3 -3
  100. package/dist/{list-BP3MPq-M.mjs → list-Beoh2AYD.mjs} +1 -1
  101. package/dist/{list-CNUiF8Z7.mjs → list-Bqm0F1Y-.mjs} +1 -1
  102. package/dist/{list-B4hJuMhA.mjs → list-C2qxVTu7.mjs} +1 -1
  103. package/dist/{list-DMKDsBRd.mjs → list-CGkgypYz.mjs} +1 -1
  104. package/dist/{list-UhpKG6_m.mjs → list-CvzWE6CS.mjs} +1 -1
  105. package/dist/{list-C5Zs8nrb.mjs → list-DMlFbccD.mjs} +1 -1
  106. package/dist/{list-B8nAGwP4.mjs → list-DdFViPYS.mjs} +1 -1
  107. package/dist/{list-BtkWNtvY.mjs → list-DfbsmsHv.mjs} +2 -2
  108. package/dist/{list-CMpoc2TN.mjs → list-GyP4b_tU.mjs} +1 -1
  109. package/dist/{list-DF2rvoO1.mjs → list-Uc1OxV36.mjs} +3 -3
  110. package/dist/{list-BzVTHOoH.mjs → list-ba7lI44w.mjs} +1 -1
  111. package/dist/{list-BtmsNOEn.mjs → list-lzIKVtE9.mjs} +1 -1
  112. package/dist/{list-BOET6zhP.mjs → list-rQ-6XSua.mjs} +1 -1
  113. package/dist/{list-DE9FM957.mjs → list-xC99-2X0.mjs} +1 -1
  114. package/dist/{login-CGHeSjlP.mjs → login-D5jt0q9K.mjs} +3 -3
  115. package/dist/{logout-DAxOlbv4.mjs → logout-DViy0VzV.mjs} +1 -1
  116. package/dist/{measure-BsYv0p26.mjs → measure-IPlonpqU.mjs} +5 -5
  117. package/dist/{network-error-CEb9ymDW.mjs → network-error-D6CiOEBw.mjs} +10 -2
  118. package/dist/{parameter-values-CJTdqd8c.mjs → parameter-values-CHyOCxmR.mjs} +2 -2
  119. package/dist/{parse-id-C_jmKFaa.mjs → parse-id-CPINxy7h.mjs} +1 -1
  120. package/dist/{path-B5gHvrYL.mjs → path-bMZzUOVo.mjs} +1 -1
  121. package/dist/{preflight-YpPQo-sa.mjs → preflight-CoF1Em99.mjs} +1 -1
  122. package/dist/{publish-DijrxaCW.mjs → publish-Cs-OUG6n.mjs} +2 -2
  123. package/dist/{query-Dc__-KJH.mjs → query-CEdmSEq8.mjs} +2 -2
  124. package/dist/{query-BbqECzmF.mjs → query-CpD46hL6.mjs} +4 -9
  125. package/dist/{remove-collection-BOnxYvhj.mjs → remove-collection-DynsqkwG.mjs} +2 -2
  126. package/dist/{replace-Cq4CxVa-.mjs → replace-C6YqqCG9.mjs} +4 -3
  127. package/dist/{rescan-values-Dr_j416g.mjs → rescan-values-C6PB02uT.mjs} +2 -2
  128. package/dist/run-C7PXBBEl.mjs +50 -0
  129. package/dist/{run-C3DkS6NP.mjs → run-Cb86sH_c.mjs} +3 -3
  130. package/dist/{run-DdGJ544X.mjs → run-CpmWoOGp.mjs} +2 -2
  131. package/dist/{runs-CUNWiidL.mjs → runs-CCRszsbB.mjs} +2 -2
  132. package/dist/{runtime-DiKyBxOw.mjs → runtime-BMJv4VOi.mjs} +2 -2
  133. package/dist/{schema-tables-CV386fnC.mjs → schema-tables-BQdFNy1B.mjs} +2 -2
  134. package/dist/{schemas-DM-UqZBQ.mjs → schemas-CNAPFh4n.mjs} +2 -2
  135. package/dist/{search-DmGScXs8.mjs → search-BKVV6YtB.mjs} +2 -2
  136. package/dist/{segment-BzUGM2Fr.mjs → segment-CDoZHSYX.mjs} +5 -5
  137. package/dist/{selectors-DGDn0Hto.mjs → selectors-BXbjj36S.mjs} +2 -2
  138. package/dist/{send-CVxxEpDB.mjs → send-D2eXL9lt.mjs} +2 -2
  139. package/dist/{set-active-BD8L1lPX.mjs → set-active-DT61WwV0.mjs} +1 -1
  140. package/dist/{set-DFolTjbd.mjs → set-sHBtSGLi.mjs} +2 -2
  141. package/dist/{setting-DyhaeICs.mjs → setting-dkfKvCxc.mjs} +3 -3
  142. package/dist/{setup-BbDQN8fe.mjs → setup-TOwWatgm.mjs} +2 -2
  143. package/dist/{skills--vK6J-e4.mjs → skills-BcOjZldN.mjs} +3 -3
  144. package/dist/{snippet-DRwKb2x7.mjs → snippet-DMdFqvNq.mjs} +5 -5
  145. package/dist/{stash-D0S4JmAz.mjs → stash-BgWw2lyu.mjs} +2 -2
  146. package/dist/{status-hL1am-HV.mjs → status-B14FO8n7.mjs} +2 -2
  147. package/dist/{status-BhswxJL1.mjs → status-J4pEIm-c.mjs} +1 -1
  148. package/dist/stream-McixcoUl.mjs +7 -0
  149. package/dist/{subscription-_d5fB45F.mjs → subscription-B1uuKxM7.mjs} +5 -5
  150. package/dist/{subscriptions-s4TF6Ax3.mjs → subscriptions-BHIATSN6.mjs} +3 -3
  151. package/dist/{summary-CsPvcUwW.mjs → summary-B1V5TXaZ.mjs} +2 -2
  152. package/dist/{sync-schema-DaZ_MV-u.mjs → sync-schema-D1vX-rpv.mjs} +3 -3
  153. package/dist/{table-DYoC1kPn.mjs → table-CDeO1WbH.mjs} +4 -4
  154. package/dist/{timeline-xlDbEKWg.mjs → timeline-MQFX3Fla.mjs} +7 -7
  155. package/dist/{timeline-event-CNQdCTDg.mjs → timeline-event-oGmne082.mjs} +5 -5
  156. package/dist/transform-CWIqW64R.mjs +28 -0
  157. package/dist/transform-job-DpF2MARE.mjs +22 -0
  158. package/dist/{transform-tag-_tgwlsdB.mjs → transform-tag-Bpj8l5Ci.mjs} +4 -4
  159. package/dist/transform-test-BJOPAwKl.mjs +25 -0
  160. package/dist/transform-test-BhkpwFqD.mjs +16 -0
  161. package/dist/transform-test-Dhcj7u-U.mjs +142 -0
  162. package/dist/{transforms-oU4zizbO.mjs → transforms-K7Y4ON_q.mjs} +2 -2
  163. package/dist/{tree-CH-f3bjP.mjs → tree-CtFtroe4.mjs} +1 -1
  164. package/dist/{unpublish-BUl9RU5C.mjs → unpublish-D7UaaIWA.mjs} +2 -2
  165. package/dist/{update-C4YJQFDS.mjs → update-3ksm443P.mjs} +3 -3
  166. package/dist/{update-BiFDBcEH.mjs → update-B7veBLhx.mjs} +3 -3
  167. package/dist/{update-CmDTljK-.mjs → update-BicO3Lio.mjs} +3 -3
  168. package/dist/{update-CHNSUHK4.mjs → update-BlBEKrNE.mjs} +3 -3
  169. package/dist/{update-tX9mKBN_.mjs → update-BpuZsX9z.mjs} +7 -7
  170. package/dist/{update-CVPAwJaH.mjs → update-BvbPpgOL.mjs} +3 -3
  171. package/dist/{update-BZPllQoR.mjs → update-CGJXd_E3.mjs} +3 -3
  172. package/dist/{update-BCS5FxKr.mjs → update-C_wTtrtX.mjs} +4 -4
  173. package/dist/{update-BzMDeZiU.mjs → update-D9Nfv864.mjs} +3 -3
  174. package/dist/{update-D-NE60AV.mjs → update-DUNJEk8m.mjs} +3 -3
  175. package/dist/{update-cYkvbqK8.mjs → update-HqUKBeM2.mjs} +3 -3
  176. package/dist/{update-CO4m4wH3.mjs → update-MWaDj2VX.mjs} +3 -3
  177. package/dist/{update-bD_Jh5-s.mjs → update-YkB3xWUh.mjs} +3 -3
  178. package/dist/{update-CvOO8TED.mjs → update-bix8NoKq.mjs} +3 -3
  179. package/dist/{update-Nfi44RrE.mjs → update-dRAPKE3c.mjs} +3 -3
  180. package/dist/{update-dashcard-C3TuYO_k.mjs → update-dashcard-BGqKMqQb.mjs} +5 -5
  181. package/dist/update-e4ufwrkF.mjs +41 -0
  182. package/dist/{upgrade-DXMV4AyP.mjs → upgrade-DkQ1wk4z.mjs} +2 -2
  183. package/dist/upload-BfGc-L4t.mjs +42 -0
  184. package/dist/upload-C3z5ZaXA.mjs +24 -0
  185. package/dist/{upload-CH632qW6.mjs → upload-CD555ui1.mjs} +1 -24
  186. package/dist/{upload-Dey_8rLf.mjs → upload-JN6EK96c.mjs} +3 -3
  187. package/dist/{uuid-BJkDWj9p.mjs → uuid-BLBLkWAF.mjs} +1 -1
  188. package/dist/{values-Dxf1JEoA.mjs → values-8CrXBkyg.mjs} +2 -2
  189. package/dist/{verify-K96rItG5.mjs → verify-nNVN-0CR.mjs} +3 -3
  190. package/dist/{wait-DoMDH226.mjs → wait-YrD7UYFF.mjs} +2 -2
  191. package/dist/{wait-flags-DWEF9tX4.mjs → wait-flags-CDtMS8FP.mjs} +1 -1
  192. package/package.json +1 -1
  193. package/skill-data/core/SKILL.md +6 -5
  194. package/skill-data/dashboard/SKILL.md +2 -2
  195. package/skill-data/transform/SKILL.md +55 -1
  196. package/dist/git-sync-MQQYRYLg.mjs +0 -28
  197. package/dist/transform-Bs0EWijQ.mjs +0 -28
  198. package/dist/transform-job-BcLChRup.mjs +0 -22
@@ -0,0 +1,142 @@
1
+ import { z } from "zod";
2
+ //#region ../client/src/domain/transform-test.ts
3
+ const TransformTestTable = z.object({
4
+ schema: z.string().nullable().optional(),
5
+ name: z.string().min(1)
6
+ }).loose();
7
+ const TransformTestColumn = z.object({
8
+ name: z.string().min(1),
9
+ database_type: z.string().min(1).describe("The warehouse's own spelling, e.g. VARCHAR(255)")
10
+ }).loose();
11
+ const TransformTestCell = z.union([
12
+ z.string(),
13
+ z.number(),
14
+ z.boolean(),
15
+ z.null()
16
+ ]);
17
+ const TransformTestRow = z.record(z.string(), TransformTestCell);
18
+ const TransformTestSqlData = z.object({
19
+ format: z.literal("sql"),
20
+ sql: z.string().min(1)
21
+ }).loose();
22
+ const TransformTestRowsData = z.object({
23
+ format: z.literal("rows"),
24
+ columns: z.array(TransformTestColumn).min(1),
25
+ rows: z.array(TransformTestRow)
26
+ }).loose();
27
+ const TransformTestSqlInput = TransformTestSqlData.extend({ table: TransformTestTable });
28
+ const TransformTestRowsInput = TransformTestRowsData.extend({ table: TransformTestTable });
29
+ /** Test data standing in for one table the transform reads. */
30
+ const TransformTestInput = z.discriminatedUnion("format", [TransformTestSqlInput, TransformTestRowsInput]);
31
+ const TransformTestEqualsSql = TransformTestSqlData.extend({
32
+ type: z.literal("equals"),
33
+ name: z.string().min(1)
34
+ });
35
+ const TransformTestEqualsRows = TransformTestRowsData.extend({
36
+ type: z.literal("equals"),
37
+ name: z.string().min(1)
38
+ });
39
+ const TransformTestEmpty = z.object({
40
+ type: z.literal("empty"),
41
+ name: z.string().min(1),
42
+ sql: z.string().min(1)
43
+ }).loose();
44
+ /** One check against the transform's output. Names are unique within a test. */
45
+ const TransformTestExpectation = z.union([
46
+ TransformTestEqualsSql,
47
+ TransformTestEqualsRows,
48
+ TransformTestEmpty
49
+ ]);
50
+ const TransformTest = z.object({
51
+ id: z.number().int(),
52
+ entity_id: z.string().nullable(),
53
+ transform_id: z.number().int(),
54
+ creator_id: z.number().int(),
55
+ name: z.string(),
56
+ description: z.string().nullable(),
57
+ inputs: z.array(TransformTestInput),
58
+ expectations: z.array(TransformTestExpectation),
59
+ created_at: z.string(),
60
+ updated_at: z.string()
61
+ }).loose();
62
+ const TransformTestCompact = TransformTest.pick({
63
+ id: true,
64
+ transform_id: true,
65
+ name: true,
66
+ description: true
67
+ }).strip();
68
+ /**
69
+ * The server closes this map, so an unrecognized key is a 400 there. Refusing it here names the key
70
+ * instead: a body cloned from `get` has to shed `id`, `entity_id`, `creator_id`, `created_at` and
71
+ * `updated_at` before it can be sent back.
72
+ */
73
+ const TransformTestCreateInput = z.object({
74
+ transform_id: z.number().int().positive(),
75
+ name: z.string().min(1),
76
+ description: z.string().nullable().optional(),
77
+ inputs: z.array(TransformTestInput),
78
+ expectations: z.array(TransformTestExpectation)
79
+ }).strict();
80
+ /** Closed for the same reason as [[TransformTestCreateInput]]; every field is optional. */
81
+ const TransformTestUpdateInput = z.object({
82
+ transform_id: z.number().int().positive().optional(),
83
+ name: z.string().min(1).optional(),
84
+ description: z.string().nullable().optional(),
85
+ inputs: z.array(TransformTestInput).optional(),
86
+ expectations: z.array(TransformTestExpectation).optional()
87
+ }).strict();
88
+ /**
89
+ * `error` is one expectation's own failure to run, which leaves the rest of the run reporting; the
90
+ * run as a whole is only `passed` or `failed`.
91
+ */
92
+ const TransformTestStatus = z.enum([
93
+ "passed",
94
+ "failed",
95
+ "error"
96
+ ]);
97
+ const TransformTestResultColumn = z.object({
98
+ name: z.string(),
99
+ database_type: z.string()
100
+ }).loose();
101
+ const TransformTestCellMismatch = z.object({
102
+ column: z.string(),
103
+ expected: TransformTestCell,
104
+ actual: TransformTestCell
105
+ }).loose();
106
+ const TransformTestRowCounts = z.object({
107
+ actual: z.number().int(),
108
+ expected: z.number().int()
109
+ }).loose();
110
+ const TransformTestExpectationError = z.object({
111
+ type: z.string(),
112
+ message: z.string()
113
+ }).loose();
114
+ /**
115
+ * What one expectation found. The keys beyond `name`, `type` and `status` are its type's own:
116
+ * `equals` reports the rows the two sides disagree on, `empty` a sample of the rows its query
117
+ * returned, and both cap what they report, with `truncated` counting what the cap dropped.
118
+ */
119
+ const TransformTestExpectationResult = z.object({
120
+ name: z.string(),
121
+ type: z.enum(["equals", "empty"]),
122
+ status: TransformTestStatus,
123
+ columns: z.array(TransformTestResultColumn).optional(),
124
+ error: TransformTestExpectationError.optional(),
125
+ "row-counts": TransformTestRowCounts.optional(),
126
+ "extra-rows": z.array(TransformTestRow).optional(),
127
+ "missing-rows": z.array(TransformTestRow).optional(),
128
+ "cell-mismatches": z.array(TransformTestCellMismatch).optional(),
129
+ sample: z.array(TransformTestRow).optional(),
130
+ truncated: z.number().int().optional()
131
+ }).loose();
132
+ /**
133
+ * What a run reported. `tables` maps each temp table the run created to the table it stood in for.
134
+ * A run that happened reports `passed` or `failed`; a refusal is an HTTP error rather than a body.
135
+ */
136
+ const TransformTestRunResult = z.object({
137
+ status: TransformTestStatus,
138
+ expectations: z.array(TransformTestExpectationResult),
139
+ tables: z.record(z.string(), z.string())
140
+ }).loose();
141
+ //#endregion
142
+ export { TransformTestUpdateInput as a, TransformTestRunResult as i, TransformTestCompact as n, TransformTestCreateInput as r, TransformTest as t };
@@ -1,6 +1,6 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, N as listFlags, R as listEnvelopeSchema, s as renderList } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
4
  import { n as windowList } from "./window-BkvrP0gB.mjs";
5
5
  import { n as TransformCompact } from "./transform-D3QX0jxA.mjs";
6
6
  import { n as transformView } from "./transform-DoTyyXAu.mjs";
@@ -1,6 +1,6 @@
1
1
  import { i as ConfigError } from "./predicates-Bkm2IoeX.mjs";
2
2
  import { F as outputFlags, I as profileFlag, M as connectionFlags, l as writeJson } from "./cli.mjs";
3
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
4
4
  import { f as CollectionTreeNode } from "./collection-CfulNRBG.mjs";
5
5
  import { z } from "zod";
6
6
  //#region src/commands/collection/tree.ts
@@ -1,6 +1,6 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { n as tableSelectorFlags, t as parseTableSelectors } from "./selectors-DGDn0Hto.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { n as tableSelectorFlags, t as parseTableSelectors } from "./selectors-BXbjj36S.mjs";
4
4
  import { z } from "zod";
5
5
  //#region src/commands/library/unpublish.ts
6
6
  const LibraryUnpublishResult = z.object({
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { o as FieldUpdateInput, t as Field } from "./field-Cr2DPUG9.mjs";
7
7
  import { r as fieldView } from "./field-BPsNa-TO.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { i as TransformTagUpdateInput, t as TransformTag } from "./transform-tag-CcElGp3C.mjs";
7
7
  import { t as transformTagView } from "./transform-tag-Dmb4u3-Q.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { o as TransformJobUpdateInput, t as TransformJob } from "./transform-job-DRrK28IH.mjs";
7
7
  import { t as transformJobView } from "./transform-job-50GZHhKH.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { i as SnippetUpdateInput, t as Snippet } from "./snippet-CyKAgIZl.mjs";
7
7
  import { t as snippetView } from "./snippet-oJLaYW9V.mjs";
@@ -1,18 +1,18 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
- import { i as DashboardDetail, o as DashboardUpdateInput } from "./dashboard-BCpSq_G-.mjs";
7
- import { t as dashboardView } from "./dashboard-CsIFFpzK.mjs";
8
- import { t as preflightDashcardCardReferences } from "./preflight-YpPQo-sa.mjs";
6
+ import { i as DashboardDetail, o as DashboardUpdateInput } from "./dashboard-CKUR8ZpQ.mjs";
7
+ import { t as dashboardView } from "./dashboard-BlbNszi8.mjs";
8
+ import { t as preflightDashcardCardReferences } from "./preflight-CoF1Em99.mjs";
9
9
  //#region src/commands/dashboard/update.ts
10
10
  var update_default = defineMetabaseCommand({
11
11
  meta: {
12
12
  name: "update",
13
13
  description: "Update a dashboard (and optionally its dashcards/tabs) by id"
14
14
  },
15
- details: "Any positive card_id referenced from dashcards is pre-flight-validated (exists and readable, not archived) before the PUT.",
15
+ details: "Every dashcard must include card_id (a card id, or null for a virtual card). Any positive card_id is pre-flight-validated (exists and readable, not archived) before the PUT.",
16
16
  skills: [{
17
17
  skill: "dashboard",
18
18
  purpose: "wiring filters, cross-filtering, click behavior, tabs"
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { i as SegmentUpdateInput, t as Segment } from "./segment-OsrbUDzw.mjs";
7
7
  import { a as preflightMbql5Query, o as skipValidateFlag, r as SEGMENT_DEFINITION_LABELS } from "./validate-query-DaGYSmpQ.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { i as TimelineEvent, s as TimelineEventUpdateInput } from "./timeline-CCSU2qOS.mjs";
7
7
  import { t as timelineEventView } from "./timeline-uDCmwGFT.mjs";
@@ -1,12 +1,12 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { c as TransformUpdateInput, t as Transform } from "./transform-D3QX0jxA.mjs";
7
7
  import { a as preflightMbql5Query, i as TRANSFORM_SOURCE_QUERY_LABELS, o as skipValidateFlag } from "./validate-query-DaGYSmpQ.mjs";
8
8
  import { n as transformView } from "./transform-DoTyyXAu.mjs";
9
- import { t as enrichTransformCollectionError } from "./collection-namespace-GwydWBF3.mjs";
9
+ import { t as enrichTransformCollectionError } from "./collection-namespace-CEoQ7G08.mjs";
10
10
  //#region src/commands/transform/update.ts
11
11
  var update_default = defineMetabaseCommand({
12
12
  meta: {
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { a as PulseUpdateInput, t as Pulse } from "./pulse-BmsDenXm.mjs";
7
7
  import { t as pulseView } from "./pulse-DhG6I9mI.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { i as DocumentUpdateInput, t as Document } from "./document-Cd2mmqCp.mjs";
7
7
  import { t as documentView } from "./document-D6OybtP2.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { c as TimelineUpdateInput, t as Timeline } from "./timeline-CCSU2qOS.mjs";
7
7
  import { n as timelineView } from "./timeline-uDCmwGFT.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { c as CardUpdateInput, t as Card } from "./card-DZxRmver.mjs";
7
7
  import { n as cardView } from "./card-zyUkr2nS.mjs";
@@ -1,10 +1,10 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
2
  import { c as NotificationUpdateInput, n as Notification } from "./notification-DaA4bBHW.mjs";
3
3
  import { t as notificationView } from "./notification-Fcq1fIPw.mjs";
4
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
5
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
5
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
6
6
  import { t as describeAlert } from "./summary-BytbDz6e.mjs";
7
- import { t as readBody } from "./body-Cur4NJt9.mjs";
7
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
8
8
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
9
9
  //#region src/commands/alert/update.ts
10
10
  var update_default = defineMetabaseCommand({
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { a as TableUpdateInput, t as Table } from "./table-CeeTJgQb.mjs";
7
7
  import { t as tableView } from "./table-CsIJNPFf.mjs";
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
6
  import { i as MeasureUpdateInput, t as Measure } from "./measure-CtfjqJFP.mjs";
7
7
  import { a as preflightMbql5Query, n as MEASURE_DEFINITION_LABELS, o as skipValidateFlag } from "./validate-query-DaGYSmpQ.mjs";
@@ -1,10 +1,10 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
4
- import { t as readBody } from "./body-Cur4NJt9.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
5
  import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
- import { l as DashcardPatchInput, s as Dashcard } from "./dashboard-BCpSq_G-.mjs";
7
- import { n as dashcardView } from "./dashboard-CsIFFpzK.mjs";
6
+ import { l as DashcardPatchInput, s as Dashcard } from "./dashboard-CKUR8ZpQ.mjs";
7
+ import { n as dashcardView } from "./dashboard-BlbNszi8.mjs";
8
8
  //#region src/commands/dashboard/update-dashcard.ts
9
9
  var update_dashcard_default = defineMetabaseCommand({
10
10
  meta: {
@@ -0,0 +1,41 @@
1
+ import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
+ import { t as readBody } from "./body-DxRSAMNC.mjs";
5
+ import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
6
+ import { a as TransformTestUpdateInput, t as TransformTest } from "./transform-test-Dhcj7u-U.mjs";
7
+ import { t as transformTestView } from "./transform-test-BJOPAwKl.mjs";
8
+ //#region src/commands/transform-test/update.ts
9
+ var update_default = defineMetabaseCommand({
10
+ meta: {
11
+ name: "update",
12
+ description: "Update a transform test from JSON"
13
+ },
14
+ details: "Only the fields the body carries are patched. `inputs` and `expectations` replace what is stored rather than merging into it. The body is closed: a test read back with `get --full` has to shed `id`, `entity_id`, `creator_id`, `created_at` and `updated_at` before it can be sent.",
15
+ capabilities: { minVersion: 64 },
16
+ args: {
17
+ ...outputFlags,
18
+ ...profileFlag,
19
+ ...connectionFlags,
20
+ ...bodyInputFlags,
21
+ id: {
22
+ type: "positional",
23
+ description: "Transform test id",
24
+ required: true
25
+ }
26
+ },
27
+ inputSchema: TransformTestUpdateInput,
28
+ outputSchema: TransformTest,
29
+ examples: ["cat patch.json | mb transform-test update 1", "mb transform-test update 1 --file patch.json"],
30
+ async run({ args, ctx, getClient }) {
31
+ const id = parseId(args.id);
32
+ const body = await readBody({
33
+ flag: args.body,
34
+ file: args.file
35
+ }, TransformTestUpdateInput);
36
+ const updated = await (await getClient()).transformTest.update(id, body);
37
+ renderSummary(updated, transformTestView, `Updated transform test ${updated.id}.`, ctx);
38
+ }
39
+ });
40
+ //#endregion
41
+ export { update_default as default };
@@ -1,7 +1,7 @@
1
1
  import { f as errorMessage, l as TimeoutError, n as AbortError, s as NetworkError, u as UnknownError } from "./predicates-Bkm2IoeX.mjs";
2
2
  import { A as name, F as outputFlags, h as promptConfirm, j as version, o as renderItem, t as interruptSignal, u as writeText } from "./cli.mjs";
3
- import { t as defineMetabaseCommand, u as USER_AGENT } from "./runtime-DiKyBxOw.mjs";
4
- import { h as parseJson, r as HttpError } from "./network-error-CEb9ymDW.mjs";
3
+ import { t as defineMetabaseCommand, u as USER_AGENT } from "./runtime-BMJv4VOi.mjs";
4
+ import { h as parseJson, r as HttpError } from "./network-error-D6CiOEBw.mjs";
5
5
  import { n as throwIfAborted, t as combineAborts } from "./signal-CMd0EFUa.mjs";
6
6
  import { n as streamProcess } from "./process-DBOOrmET.mjs";
7
7
  import { z } from "zod";
@@ -0,0 +1,42 @@
1
+ import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as ContentTranslationUploadResult } from "./content-translation-BrHOrmj9.mjs";
4
+ import { n as requireUploadFilePath, t as readCsvFile } from "./upload-CD555ui1.mjs";
5
+ //#region src/output/views/content-translation.ts
6
+ const contentTranslationUploadView = {
7
+ compactPick: ContentTranslationUploadResult,
8
+ tableColumns: [{
9
+ key: "success",
10
+ label: "Success"
11
+ }]
12
+ };
13
+ //#endregion
14
+ //#region src/commands/content-translation/upload.ts
15
+ var upload_default = defineMetabaseCommand({
16
+ meta: {
17
+ name: "upload",
18
+ description: "Replace the complete content translation dictionary from CSV"
19
+ },
20
+ details: "Uploads one complete dictionary and replaces every active content translation on the server. Keep the canonical full CSV in version control and download the current dictionary before replacing it. Metabase accepts dictionaries up to 1.5 MiB.",
21
+ capabilities: {
22
+ minVersion: 58,
23
+ tokenFeature: "content_translation"
24
+ },
25
+ args: {
26
+ ...outputFlags,
27
+ ...profileFlag,
28
+ ...connectionFlags,
29
+ file: {
30
+ type: "string",
31
+ description: "Path to the complete translation dictionary CSV"
32
+ }
33
+ },
34
+ outputSchema: ContentTranslationUploadResult,
35
+ examples: ["mb content-translation upload --file translations.csv", "mb content-translation upload --file translations.csv --profile prod --json"],
36
+ async run({ args, ctx, getClient }) {
37
+ const file = await readCsvFile(requireUploadFilePath(args.file));
38
+ renderSummary(await (await getClient()).contentTranslation.upload(file), contentTranslationUploadView, `Replaced the content translation dictionary with "${file.filename}".`, ctx);
39
+ }
40
+ });
41
+ //#endregion
42
+ export { upload_default as default };
@@ -0,0 +1,24 @@
1
+ import { n as UploadUpdateResult, t as UploadResult } from "./upload-DAtxBBms.mjs";
2
+ //#region src/output/views/upload.ts
3
+ const uploadResultView = {
4
+ compactPick: UploadResult,
5
+ tableColumns: [{
6
+ key: "model_id",
7
+ label: "Model ID"
8
+ }, {
9
+ key: "table_id",
10
+ label: "Table ID"
11
+ }]
12
+ };
13
+ const uploadUpdateResultView = {
14
+ compactPick: UploadUpdateResult,
15
+ tableColumns: [{
16
+ key: "table_id",
17
+ label: "Table ID"
18
+ }, {
19
+ key: "action",
20
+ label: "Action"
21
+ }]
22
+ };
23
+ //#endregion
24
+ export { uploadUpdateResultView as n, uploadResultView as t };
@@ -1,30 +1,7 @@
1
1
  import { i as ConfigError, p as isFileNotFoundError } from "./predicates-Bkm2IoeX.mjs";
2
2
  import { n as fileNotFoundError } from "./input-DH9i67x_.mjs";
3
- import { n as UploadUpdateResult, t as UploadResult } from "./upload-DAtxBBms.mjs";
4
3
  import { basename } from "node:path";
5
4
  import { readFile } from "node:fs/promises";
6
- //#region src/output/views/upload.ts
7
- const uploadResultView = {
8
- compactPick: UploadResult,
9
- tableColumns: [{
10
- key: "model_id",
11
- label: "Model ID"
12
- }, {
13
- key: "table_id",
14
- label: "Table ID"
15
- }]
16
- };
17
- const uploadUpdateResultView = {
18
- compactPick: UploadUpdateResult,
19
- tableColumns: [{
20
- key: "table_id",
21
- label: "Table ID"
22
- }, {
23
- key: "action",
24
- label: "Action"
25
- }]
26
- };
27
- //#endregion
28
5
  //#region src/runtime/upload.ts
29
6
  function requireUploadFilePath(file) {
30
7
  if (typeof file !== "string" || file.trim() === "") throw new ConfigError("provide the CSV file to upload with --file <path>");
@@ -43,4 +20,4 @@ async function readCsvFile(path) {
43
20
  }
44
21
  }
45
22
  //#endregion
46
- export { uploadUpdateResultView as i, requireUploadFilePath as n, uploadResultView as r, readCsvFile as t };
23
+ export { requireUploadFilePath as n, readCsvFile as t };
@@ -4,9 +4,9 @@ var upload_default = defineCommandGroup({
4
4
  name: "upload",
5
5
  description: "Upload CSV files into Metabase",
6
6
  subCommands: {
7
- csv: () => import("./csv-B2Jgb1GM.mjs").then((m) => m.default),
8
- append: () => import("./append-DFzQRPMd.mjs").then((m) => m.default),
9
- replace: () => import("./replace-Cq4CxVa-.mjs").then((m) => m.default)
7
+ csv: () => import("./csv-GincCch9.mjs").then((m) => m.default),
8
+ append: () => import("./append-D16_s1HW.mjs").then((m) => m.default),
9
+ replace: () => import("./replace-C6YqqCG9.mjs").then((m) => m.default)
10
10
  }
11
11
  });
12
12
  //#endregion
@@ -1,6 +1,6 @@
1
1
  import { i as ConfigError } from "./predicates-Bkm2IoeX.mjs";
2
2
  import { F as outputFlags, l as writeJson, u as writeText } from "./cli.mjs";
3
- import { R as parseInteger, t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
+ import { R as parseInteger, t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
4
4
  import { z } from "zod";
5
5
  import { randomUUID } from "node:crypto";
6
6
  //#region src/commands/uuid.ts
@@ -1,6 +1,6 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary, f as formatScalar } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
3
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
4
4
  import { s as FieldValues } from "./field-Cr2DPUG9.mjs";
5
5
  import { n as fieldValuesView } from "./field-BPsNa-TO.mjs";
6
6
  //#region src/commands/field/values.ts
@@ -1,7 +1,7 @@
1
- import { n as createClient } from "./client-BqhzKdLM.mjs";
1
+ import { n as createClient } from "./client-DynvZqa0.mjs";
2
2
  import { f as errorMessage, l as TimeoutError, o as MetabaseError, s as NetworkError } from "./predicates-Bkm2IoeX.mjs";
3
- import { F as tryParseTag, I as SessionProperties, u as USER_AGENT } from "./runtime-DiKyBxOw.mjs";
4
- import { r as HttpError } from "./network-error-CEb9ymDW.mjs";
3
+ import { F as tryParseTag, I as SessionProperties, u as USER_AGENT } from "./runtime-BMJv4VOi.mjs";
4
+ import { r as HttpError } from "./network-error-D6CiOEBw.mjs";
5
5
  //#region ../client/src/version/probe.ts
6
6
  const PROBE_PATH = "/api/session/properties";
7
7
  const PROBE_TIMEOUT_MS = 1e4;
@@ -1,7 +1,7 @@
1
1
  import { F as outputFlags, I as profileFlag, M as connectionFlags, c as renderSummary } from "./cli.mjs";
2
- import { t as defineMetabaseCommand } from "./runtime-DiKyBxOw.mjs";
2
+ import { t as defineMetabaseCommand } from "./runtime-BMJv4VOi.mjs";
3
3
  import { n as DEFAULT_TIMEOUT_MS, t as DEFAULT_INTERVAL_MS } from "./poll-75SvT7Zv.mjs";
4
- import { r as parseWaitSchedule } from "./wait-flags-DWEF9tX4.mjs";
4
+ import { r as parseWaitSchedule } from "./wait-flags-CDtMS8FP.mjs";
5
5
  import { c as syncTaskView } from "./git-sync-DxD_ng48.mjs";
6
6
  import { a as throwIfFailedTask, i as taskPollOptions, n as formatSyncTask, r as syncTaskIdleView, t as SyncTaskOrIdle } from "./sync-task-BACcrs0i.mjs";
7
7
  //#region src/commands/git-sync/wait.ts
@@ -1,5 +1,5 @@
1
1
  import { t as interruptSignal } from "./cli.mjs";
2
- import { t as parseId } from "./parse-id-C_jmKFaa.mjs";
2
+ import { t as parseId } from "./parse-id-CPINxy7h.mjs";
3
3
  import { n as DEFAULT_TIMEOUT_MS, t as DEFAULT_INTERVAL_MS } from "./poll-75SvT7Zv.mjs";
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.3.0",
3
+ "version": "0.3.1-alpha.transform-tests.3fbcf8b",
4
4
  "description": "Metabase CLI",
5
5
  "license": "AGPL-3.0",
6
6
  "repository": {