@metabase/cli 0.3.2-alpha.fix-transform-test-ee-path.8ac2a7a → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-collection-B_-eMU_k.mjs → add-collection-BjVAdZ1n.mjs} +2 -2
- package/dist/{alert-Dalin_DD.mjs → alert-DCLhfwdv.mjs} +6 -6
- package/dist/{alerts-DpBgrjPI.mjs → alerts-DRin_wt2.mjs} +3 -3
- package/dist/{append-C1JNVALm.mjs → append-DQ9rPJHZ.mjs} +3 -3
- package/dist/{archive-DA3OiLEE.mjs → archive-1YVo-Wsu.mjs} +2 -2
- package/dist/{archive-BkITQyWW.mjs → archive-BPCgmLcV.mjs} +2 -2
- package/dist/{archive-DVHxeDKS.mjs → archive-BVRKE9Ev.mjs} +2 -2
- package/dist/{archive-CISXgZAI.mjs → archive-BzVxRqpL.mjs} +2 -2
- package/dist/{archive-cAdUa1-2.mjs → archive-COFQAHAL.mjs} +2 -2
- package/dist/{archive-CicPYX27.mjs → archive-D3yPvUtz.mjs} +2 -2
- package/dist/{archive-B51prFgS.mjs → archive-D6xzHaM3.mjs} +2 -2
- package/dist/{archive-52ZHbFDm2.mjs → archive-HeRygdKz2.mjs} +2 -2
- package/dist/{archive-CdKf_Eqq.mjs → archive-_c-ISZmi.mjs} +2 -2
- package/dist/{archive-DckxlWBt.mjs → archive-o5cWV3vZ.mjs} +2 -2
- package/dist/{archive-CwITzj_j.mjs → archive-xcgoVPwv.mjs} +2 -2
- package/dist/{auth-A96JOCQx.mjs → auth-DJn5T6zA.mjs} +4 -4
- package/dist/{body-CshgcV6U.mjs → body-Cu94pH4P.mjs} +2 -2
- package/dist/{branches-CbcwWYL9.mjs → branches-CUyPxeeW.mjs} +1 -1
- package/dist/{cancel-DpDcVY7M.mjs → cancel-BNuVls58.mjs} +2 -2
- package/dist/{cancel-task-B4RDvIYb.mjs → cancel-task-DUmlQQpi.mjs} +1 -1
- package/dist/{card-CefVYtF7.mjs → card-ByOzVxpI.mjs} +7 -7
- package/dist/{cards-BC0JX8Yg.mjs → cards-_gbvw3wp.mjs} +2 -2
- package/dist/cli.mjs +32 -43
- package/dist/{client-ClL6gf7G.mjs → client-BnK0evYf.mjs} +474 -5
- package/dist/{collection-Be5AHVWP.mjs → collection-BGbW7u_Q.mjs} +6 -6
- package/dist/{collection-namespace-Dv0l-V9K.mjs → collection-namespace-DM90lA8C.mjs} +1 -1
- package/dist/{content-translation-BXIXL4eW.mjs → content-translation-CqB3peU9.mjs} +2 -2
- package/dist/{create-YetX69Re.mjs → create-B48rmY8v.mjs} +2 -2
- package/dist/{create-B9qXQ_wV.mjs → create-B7S5fCkD.mjs} +2 -2
- package/dist/{create-Dhai9zAt.mjs → create-BIUVvIGH.mjs} +2 -2
- package/dist/{create-kZIIEN2Y.mjs → create-BMKuihoI.mjs} +3 -3
- package/dist/{create--fiwuTWc.mjs → create-BSvTs-EV.mjs} +2 -2
- package/dist/{create-Bryrkb9g.mjs → create-CUHpxANR.mjs} +2 -2
- package/dist/{create-BcsVwXgS2.mjs → create-Cm9Z-rfe2.mjs} +2 -2
- package/dist/{create-BbjSOTN-.mjs → create-CnJKj9Nl.mjs} +3 -3
- package/dist/{create-DWFJdyIr.mjs → create-CwXUMOMd.mjs} +2 -2
- package/dist/{create-Za1EskpV.mjs → create-D4Y69cDF.mjs} +3 -3
- package/dist/{create-DmN2gFc4.mjs → create-DMVw9nrZ.mjs} +2 -2
- package/dist/{create-D--Z1S3p2.mjs → create-DNx9TGHs.mjs} +4 -4
- package/dist/{create-BVNhtAgF.mjs → create-DVo8-IzZ.mjs} +3 -3
- package/dist/{create-NCKHHdov.mjs → create-IFjwHs0G.mjs} +1 -1
- package/dist/{create-branch-CseVn3lp.mjs → create-branch-Cw-uXows.mjs} +1 -1
- package/dist/{create-CHr8MPPq.mjs → create-va8bByVt.mjs} +2 -2
- package/dist/{csv-DNzesu8y.mjs → csv-CaKx1oFZ.mjs} +3 -3
- package/dist/{current-task-DRTKZcP9.mjs → current-task-lGh69Z1i.mjs} +2 -2
- package/dist/{dashboard-CMw13KXM.mjs → dashboard-Bzjz2v6u.mjs} +9 -9
- package/dist/{db-BDijt81U.mjs → db-BRHPjshe.mjs} +6 -6
- package/dist/{delete--15it-A8.mjs → delete-BxBadE3q.mjs} +2 -2
- package/dist/{delete-BxjJ66BS.mjs → delete-CQWCfqHf.mjs} +2 -2
- package/dist/{delete-wFsy80db.mjs → delete-Ci0aDYpf.mjs} +2 -2
- package/dist/{delete-Dc8E5YwZ.mjs → delete-DMETa-37.mjs} +2 -2
- package/dist/{delete-BudvZkvK.mjs → delete-G6EiGn2Q.mjs} +2 -2
- package/dist/{delete-table-5AQpn8OB.mjs → delete-table-N4rZtt1T.mjs} +2 -2
- package/dist/{dependencies-C1ogC3BV.mjs → dependencies-edN0P1SS.mjs} +2 -2
- package/dist/{dirty-CSLDYO-K.mjs → dirty-U51bMoCP.mjs} +1 -1
- package/dist/{document-BGzVip5_.mjs → document-DqJ7Cysa.mjs} +5 -5
- package/dist/{download-Ddap1OAo.mjs → download-BJA6k-e6.mjs} +1 -1
- package/dist/{eid-HnrWhPoe.mjs → eid-BtlRU1E0.mjs} +2 -2
- package/dist/{events-CXqetjcS.mjs → events-B5rnOo-L.mjs} +2 -2
- package/dist/{export-IFZdgYZ2.mjs → export-DO2josC0.mjs} +3 -3
- package/dist/{field-BJ6HoLRd.mjs → field-CHZByaXa.mjs} +4 -4
- package/dist/{fields-DxHxuxwO.mjs → fields-zQ6O_W_H.mjs} +2 -2
- package/dist/{get-CDnmpfHQ.mjs → get-93wuhTn2.mjs} +1 -1
- package/dist/{get-eJilYnHk.mjs → get-BDrmBZ1z.mjs} +2 -2
- package/dist/{get-BF2vdF3W.mjs → get-BLcS4il2.mjs} +2 -2
- package/dist/{get-BcoJ9Aha.mjs → get-BLjcCXp8.mjs} +2 -2
- package/dist/{get-C_tdSMwW2.mjs → get-BSoMWp4t2.mjs} +2 -2
- package/dist/{get-BGLvyOO3.mjs → get-CG6G-mzV.mjs} +2 -2
- package/dist/{get-CE9_4Q7E.mjs → get-CTp5l7aU.mjs} +1 -1
- package/dist/{get-DW7mCaGe.mjs → get-CeSQptdl.mjs} +2 -2
- package/dist/{get-DmKtPNOy.mjs → get-CekXFP3x.mjs} +2 -2
- package/dist/{get-B2pj2q3X.mjs → get-Cf6a4fFN.mjs} +2 -2
- package/dist/{get-b0CoPz5B.mjs → get-CwiJWeH4.mjs} +2 -2
- package/dist/{get-H6kInHIx.mjs → get-DC_huYD8.mjs} +3 -3
- package/dist/{get-BiPclcIP.mjs → get-DXwlZjw0.mjs} +2 -2
- package/dist/{get-DjlQhgD4.mjs → get-Dg-S07ri.mjs} +2 -2
- package/dist/{get-Dtre5jzh.mjs → get-DhpMuTSt.mjs} +1 -1
- package/dist/{get-D_x-ENFe.mjs → get-EFsmL4le.mjs} +2 -2
- package/dist/{get-C3cuZNeW.mjs → get-is8x5f2n.mjs} +2 -2
- package/dist/{get-run-BE1HtJDW.mjs → get-run-DwY4sFGy.mjs} +2 -2
- package/dist/{get-CxUQyhte.mjs → get-xPv7e5Ez.mjs} +2 -2
- package/dist/{get-jofVjU6e.mjs → get-yHIEezeG.mjs} +2 -2
- package/dist/git-sync-NhfLSZA6.mjs +28 -0
- package/dist/{has-remote-changes-Cj1KhBOT.mjs → has-remote-changes-DE2_14FK.mjs} +1 -1
- package/dist/{import-DLb9VN4l.mjs → import-Cs7wk058.mjs} +3 -3
- package/dist/{input-D5tQEfqN.mjs → input-DEvkIjGr.mjs} +1 -1
- package/dist/{is-dirty-BxtgV2xF.mjs → is-dirty-XqDfqXGi.mjs} +1 -1
- package/dist/{items-DLUYc5-z.mjs → items-BloAjPwA.mjs} +1 -1
- package/dist/{library-BNSxXOpc.mjs → library-Dgq_5BFh.mjs} +4 -4
- package/dist/{list-CERbeLbQ.mjs → list-3ErmGdY0.mjs} +1 -1
- package/dist/{list-CBLxhaNZ.mjs → list-BZnf3RmA.mjs} +1 -1
- package/dist/{list-Sd7jGZoX.mjs → list-BfLo1xI8.mjs} +1 -1
- package/dist/{list-CzRzCbCY.mjs → list-Bzm5mXRo.mjs} +1 -1
- package/dist/{list-CX9qZ-bx.mjs → list-CUJ1wem9.mjs} +1 -1
- package/dist/{list-COLpwXW4.mjs → list-CUXlZiS1.mjs} +1 -1
- package/dist/{list-BUz6KOfw.mjs → list-CZCaqPoo.mjs} +1 -1
- package/dist/{list-M8J10Ozk.mjs → list-CghNKfYJ.mjs} +1 -1
- package/dist/{list-jhQSgh6i.mjs → list-D04uiS3F.mjs} +1 -1
- package/dist/{list-cIMww2Me.mjs → list-D9d5ocYi.mjs} +3 -3
- package/dist/{list-B1soS8QW.mjs → list-DboUvg-Y.mjs} +1 -1
- package/dist/{list-D-SyhKFw.mjs → list-DgteFn01.mjs} +2 -2
- package/dist/{list-BcP1DTJH.mjs → list-DuJezLm_.mjs} +1 -1
- package/dist/{list-Dat8QNcf.mjs → list-VzrtA9lt.mjs} +1 -1
- package/dist/{list-CQbiSx26.mjs → list-f8Csdjyc.mjs} +1 -1
- package/dist/{list-C5mS_ehX.mjs → list-sdCIS2Df.mjs} +3 -3
- package/dist/{list-CehE6KBV.mjs → list-vsXIMssK.mjs} +1 -1
- package/dist/{list-BQnOEB3W.mjs → list-yV6CyPzn.mjs} +1 -1
- package/dist/{login-BfLqBfCd.mjs → login-Vw51Gts5.mjs} +6 -6
- package/dist/{logout-BpRXB3Ze.mjs → logout-BDIqoVhv.mjs} +2 -2
- package/dist/{measure-Ds8O5Evr.mjs → measure-LY9Tp9QZ.mjs} +5 -5
- package/dist/{parameter-values-DhrkLXoN.mjs → parameter-values-DWjmO7Ai.mjs} +2 -2
- package/dist/{parse-id-DtM6q9HU.mjs → parse-id-whJX4DAb.mjs} +1 -1
- package/dist/{path-_GHFrTLx.mjs → path-BUUAGYO5.mjs} +2 -2
- package/dist/{poll-KLl4Eq8Y.mjs → poll-CZeXepUQ.mjs} +2 -2
- package/dist/{preflight-BpYtF0IU.mjs → preflight-DcULqq8E.mjs} +3 -3
- package/dist/{process-CLtOWKBn.mjs → process-CTrfxxaC.mjs} +1 -1
- package/dist/{publish-D-7Zlmuk.mjs → publish-qVFmJQ1E.mjs} +3 -3
- package/dist/{query-CxESKMve.mjs → query-BPtIy79s.mjs} +4 -4
- package/dist/{query-B1CZztxs.mjs → query-Cq1lmqL5.mjs} +2 -2
- package/dist/{remove-collection-C4saCFxz.mjs → remove-collection-DBqh2Lqm.mjs} +2 -2
- package/dist/{render-6O_eF-P1.mjs → render-Gx1hR7IF.mjs} +2 -2
- package/dist/{replace-BuR4f2Ai.mjs → replace-CujInVY9.mjs} +3 -3
- package/dist/{rescan-values-CNOiiWQ5.mjs → rescan-values-HypqBCSK.mjs} +2 -2
- package/dist/{run-DijA_BXt.mjs → run-DEkQSOQa.mjs} +2 -2
- package/dist/{run-QEUbWNm7.mjs → run-b3jyF29q.mjs} +7 -7
- package/dist/{runs-BSlhVeDO.mjs → runs-GHqHLGy4.mjs} +2 -2
- package/dist/{runtime-Dtb93zKy.mjs → runtime-nCPku2nN.mjs} +2 -2
- package/dist/{schema-tables-BE3rEb6I.mjs → schema-tables-B5L05Y1L.mjs} +2 -2
- package/dist/{schemas-yDjBiwlH.mjs → schemas-Clx26p_4.mjs} +2 -2
- package/dist/{search-CR_xNArA.mjs → search-DxiuY5EV.mjs} +2 -2
- package/dist/{segment-Cm6zQjJW.mjs → segment-DiRJcbam.mjs} +5 -5
- package/dist/{selectors-C-vgMcGK.mjs → selectors-rEFuyXPZ.mjs} +2 -2
- package/dist/{send-kC8oerkT.mjs → send-DIHkDNBN.mjs} +2 -2
- package/dist/{set-tFhPkxrL.mjs → set-D77qUZML.mjs} +2 -2
- package/dist/{set-active-lDKhAlij.mjs → set-active-DCdFgD0O.mjs} +1 -1
- package/dist/{setting-DrJXCaFE.mjs → setting-DR9bj232.mjs} +3 -3
- package/dist/{setup-BWY9M0iR.mjs → setup-DGa2LLEp.mjs} +2 -2
- package/dist/{signal-Csom0mt5.mjs → signal-k7cm5N6h.mjs} +1 -1
- package/dist/{skill-list-CCes8pKe.mjs → skill-list-DAvGGHzS.mjs} +1 -1
- package/dist/{skills-DPRN2384.mjs → skills-CCn7cyMP.mjs} +3 -3
- package/dist/{skills-DE9ej5Rg.mjs → skills-CqtNuSXM.mjs} +2 -2
- package/dist/{snippet-DWHTSo9c.mjs → snippet-g9JTDxqu.mjs} +5 -5
- package/dist/{stash-C9oDvQ9P.mjs → stash-BTtsV0AG.mjs} +3 -3
- package/dist/{status-CkpujA26.mjs → status-CW7Dt-nV.mjs} +2 -2
- package/dist/{status-DSdXmNC3.mjs → status-XgSS3StV.mjs} +2 -2
- package/dist/{subscription-DKOKoHRG.mjs → subscription-CofRU47d.mjs} +5 -5
- package/dist/{subscriptions-C5SyJL4B.mjs → subscriptions-DCuuPF6U.mjs} +3 -3
- package/dist/{summary-DTPgXsc0.mjs → summary-uGlgKE3C.mjs} +2 -2
- package/dist/{sync-schema-DKKkNSR7.mjs → sync-schema-Cu9rD3eH.mjs} +3 -3
- package/dist/{sync-task-BtDnTXCP.mjs → sync-task-BXeWuARG.mjs} +1 -2
- package/dist/{table-I8NXSdUC.mjs → table-Di-EY7pg.mjs} +4 -4
- package/dist/{timeline-B_ESH-6W.mjs → timeline-D7EsWZm6.mjs} +7 -7
- package/dist/{timeline-event-n4Lzet7l.mjs → timeline-event-D-h0A_oh.mjs} +5 -5
- package/dist/transform-8XK1LIgC.mjs +28 -0
- package/dist/transform-job-CTizQkWy.mjs +22 -0
- package/dist/{transform-tag-D6NXqWaX.mjs → transform-tag-BLp_p9J-.mjs} +4 -4
- package/dist/{transforms-O4NtXqFz.mjs → transforms-n2IwEcbU.mjs} +2 -2
- package/dist/{tree-CuyF116R.mjs → tree-cqxiDh2b.mjs} +1 -1
- package/dist/{unpublish-DvWefKJi.mjs → unpublish-DVQCAa3g.mjs} +2 -2
- package/dist/{update-DOdcflLH.mjs → update-B7CikkI0.mjs} +4 -4
- package/dist/{update-BB6Go_RX.mjs → update-C05J2nZ2.mjs} +3 -3
- package/dist/{update-CGJvIS-l.mjs → update-CAsqNhDC.mjs} +3 -3
- package/dist/{update-7oKvP1HC.mjs → update-CKDRuduL.mjs} +4 -4
- package/dist/{update-xEegxIyH.mjs → update-ChpOukqq.mjs} +3 -3
- package/dist/{update-DXmZuJho.mjs → update-CnkPYL2i.mjs} +3 -3
- package/dist/{update-DV54H3L5.mjs → update-D4ggtuG4.mjs} +5 -5
- package/dist/{update-H_fdjugs.mjs → update-D9H6Lh5U.mjs} +3 -3
- package/dist/{update-76nzOc71.mjs → update-DFdBeJwc.mjs} +3 -3
- package/dist/{update-2KIpYgyj.mjs → update-DKO9HF1f.mjs} +3 -3
- package/dist/{update-D7dG7H-z.mjs → update-DScUzKLI.mjs} +4 -4
- package/dist/{update-To6A1Ugu.mjs → update-DffrdV4b.mjs} +3 -3
- package/dist/{update-Bah7N8QX.mjs → update-NGq0yXZk.mjs} +4 -4
- package/dist/{update-dashcard-DjT5QOkL.mjs → update-dashcard-DvPqLJ3N.mjs} +3 -3
- package/dist/{update-AJ2JmwDl.mjs → update-oQeQyqKO.mjs} +3 -3
- package/dist/{update-DmgRIp7o.mjs → update-rFRPLlb6.mjs} +3 -3
- package/dist/{upgrade-CuJx9fX4.mjs → upgrade-BRgw0fvn.mjs} +4 -4
- package/dist/{upload-CboARPZm.mjs → upload-BrfbcbBW.mjs} +2 -2
- package/dist/{upload-DOO94rCQ.mjs → upload-Do2PBSeH.mjs} +2 -2
- package/dist/{upload-2YFFBSln.mjs → upload-VXBFKzLT.mjs} +3 -3
- package/dist/{uuid-InwZlrpQ.mjs → uuid-B4eij1d7.mjs} +1 -1
- package/dist/{validate-query-B90KYPQr.mjs → validate-query-D6_ad-Gi.mjs} +1 -1
- package/dist/{validate-D6-Vg_kn.mjs → validate-xR_MHBNR.mjs} +1 -1
- package/dist/{values-CsZLk1Ls.mjs → values-xgOftPq5.mjs} +2 -2
- package/dist/{verify-DrGjZwBM.mjs → verify-DTOA_wVM.mjs} +3 -3
- package/dist/{wait-BmzdarP9.mjs → wait-BjeFgR13.mjs} +4 -4
- package/dist/{wait-flags-CiJGrTCT.mjs → wait-flags-BCeCnaz3.mjs} +2 -2
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +8 -14
- package/skill-data/transform/SKILL.md +1 -63
- package/dist/create-DiJ8bUb-.mjs +0 -34
- package/dist/delete-Bsdwqh7H.mjs +0 -44
- package/dist/get-i0KInCw9.mjs +0 -32
- package/dist/git-sync-xKC1sqC4.mjs +0 -28
- package/dist/list-Cuhf2lKL.mjs +0 -35
- package/dist/run-FmRruANb.mjs +0 -64
- package/dist/transform-BNuNiH9d.mjs +0 -28
- package/dist/transform-job-B7yc6dfH.mjs +0 -22
- package/dist/transform-test-BjjCQ2xm.mjs +0 -169
- package/dist/transform-test-C1Oqtfb-.mjs +0 -16
- package/dist/transform-test-gzDcbypy.mjs +0 -25
- package/dist/transport-CyVo29u7.mjs +0 -313
- package/dist/update-l3PyNQKG.mjs +0 -41
- package/skill-data/transform-test-plan/SKILL.md +0 -171
- package/skill-data/transform-test-plan/references/checklist.md +0 -81
- package/skill-data/transform-test-plan/references/checks.md +0 -263
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
//#region ../client/src/domain/transform-test.ts
|
|
3
|
-
const TransformTestTable = z.object({
|
|
4
|
-
schema: z.string().min(1).nullable().optional(),
|
|
5
|
-
name: z.string().min(1)
|
|
6
|
-
}).loose();
|
|
7
|
-
const TransformTestColumn = z.object({
|
|
8
|
-
name: z.string().min(1),
|
|
9
|
-
cast_type: z.string().min(1)
|
|
10
|
-
}).loose();
|
|
11
|
-
const TransformTestCell = z.union([
|
|
12
|
-
z.boolean(),
|
|
13
|
-
z.number(),
|
|
14
|
-
z.string(),
|
|
15
|
-
z.null()
|
|
16
|
-
]);
|
|
17
|
-
const TransformTestRow = z.record(z.string(), TransformTestCell);
|
|
18
|
-
const TransformTestSqlInput = z.object({
|
|
19
|
-
table: TransformTestTable,
|
|
20
|
-
format: z.literal("sql"),
|
|
21
|
-
sql: z.string().min(1)
|
|
22
|
-
}).loose();
|
|
23
|
-
const TransformTestRowsInput = z.object({
|
|
24
|
-
table: TransformTestTable,
|
|
25
|
-
format: z.literal("rows"),
|
|
26
|
-
columns: z.array(TransformTestColumn).min(1),
|
|
27
|
-
rows: z.array(TransformTestRow)
|
|
28
|
-
}).loose();
|
|
29
|
-
const TransformTestInput = z.discriminatedUnion("format", [TransformTestSqlInput, TransformTestRowsInput]);
|
|
30
|
-
const TransformTestEqualsSqlExpectation = z.object({
|
|
31
|
-
type: z.literal("equals"),
|
|
32
|
-
name: z.string().min(1),
|
|
33
|
-
format: z.literal("sql"),
|
|
34
|
-
sql: z.string().min(1)
|
|
35
|
-
}).loose();
|
|
36
|
-
const TransformTestEqualsRowsExpectation = z.object({
|
|
37
|
-
type: z.literal("equals"),
|
|
38
|
-
name: z.string().min(1),
|
|
39
|
-
format: z.literal("rows"),
|
|
40
|
-
columns: z.array(TransformTestColumn).min(1),
|
|
41
|
-
rows: z.array(TransformTestRow)
|
|
42
|
-
}).loose();
|
|
43
|
-
const TransformTestEqualsExpectation = z.discriminatedUnion("format", [TransformTestEqualsSqlExpectation, TransformTestEqualsRowsExpectation]);
|
|
44
|
-
const TransformTestEmptyExpectation = z.object({
|
|
45
|
-
type: z.literal("empty"),
|
|
46
|
-
name: z.string().min(1),
|
|
47
|
-
sql: z.string().min(1)
|
|
48
|
-
}).loose();
|
|
49
|
-
const TransformTestExpectation = z.discriminatedUnion("type", [TransformTestEqualsExpectation, TransformTestEmptyExpectation]);
|
|
50
|
-
const TransformTest = z.object({
|
|
51
|
-
id: z.number().int(),
|
|
52
|
-
entity_id: z.string(),
|
|
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
|
-
const TransformTestResultColumn = z.object({
|
|
89
|
-
name: z.string(),
|
|
90
|
-
database_type: z.string()
|
|
91
|
-
}).loose();
|
|
92
|
-
const TransformTestExpectationError = z.object({
|
|
93
|
-
type: z.string(),
|
|
94
|
-
message: z.string()
|
|
95
|
-
}).loose();
|
|
96
|
-
const TransformTestCellMismatch = z.object({
|
|
97
|
-
column: z.string(),
|
|
98
|
-
expected: TransformTestCell,
|
|
99
|
-
actual: TransformTestCell
|
|
100
|
-
}).loose();
|
|
101
|
-
const TransformTestRowCounts = z.object({
|
|
102
|
-
actual: z.number().int(),
|
|
103
|
-
expected: z.number().int()
|
|
104
|
-
}).loose();
|
|
105
|
-
const TransformTestEqualsFindings = z.object({
|
|
106
|
-
name: z.string(),
|
|
107
|
-
type: z.literal("equals"),
|
|
108
|
-
status: z.enum(["passed", "failed"]),
|
|
109
|
-
columns: z.array(TransformTestResultColumn),
|
|
110
|
-
"row-counts": TransformTestRowCounts,
|
|
111
|
-
"extra-rows": z.array(TransformTestRow),
|
|
112
|
-
"missing-rows": z.array(TransformTestRow),
|
|
113
|
-
"cell-mismatches": z.array(TransformTestCellMismatch),
|
|
114
|
-
truncated: z.number().int()
|
|
115
|
-
}).loose();
|
|
116
|
-
const TransformTestEqualsError = z.object({
|
|
117
|
-
name: z.string(),
|
|
118
|
-
type: z.literal("equals"),
|
|
119
|
-
status: z.literal("error"),
|
|
120
|
-
error: TransformTestExpectationError
|
|
121
|
-
}).loose();
|
|
122
|
-
const TransformTestEqualsResult = z.discriminatedUnion("status", [TransformTestEqualsFindings, TransformTestEqualsError]);
|
|
123
|
-
const TransformTestEmptyPassed = z.object({
|
|
124
|
-
name: z.string(),
|
|
125
|
-
type: z.literal("empty"),
|
|
126
|
-
status: z.literal("passed")
|
|
127
|
-
}).loose();
|
|
128
|
-
const TransformTestEmptyFailed = z.object({
|
|
129
|
-
name: z.string(),
|
|
130
|
-
type: z.literal("empty"),
|
|
131
|
-
status: z.literal("failed"),
|
|
132
|
-
columns: z.array(TransformTestResultColumn),
|
|
133
|
-
sample: z.array(TransformTestRow),
|
|
134
|
-
truncated: z.number().int()
|
|
135
|
-
}).loose();
|
|
136
|
-
const TransformTestEmptyError = z.object({
|
|
137
|
-
name: z.string(),
|
|
138
|
-
type: z.literal("empty"),
|
|
139
|
-
status: z.literal("error"),
|
|
140
|
-
error: TransformTestExpectationError
|
|
141
|
-
}).loose();
|
|
142
|
-
const TransformTestEmptyResult = z.discriminatedUnion("status", [
|
|
143
|
-
TransformTestEmptyPassed,
|
|
144
|
-
TransformTestEmptyFailed,
|
|
145
|
-
TransformTestEmptyError
|
|
146
|
-
]);
|
|
147
|
-
const TransformTestExpectationResult = z.discriminatedUnion("type", [TransformTestEqualsResult, TransformTestEmptyResult]);
|
|
148
|
-
const TransformTestRunResult = z.object({
|
|
149
|
-
status: z.enum(["passed", "failed"]),
|
|
150
|
-
expectations: z.array(TransformTestExpectationResult),
|
|
151
|
-
tables: z.record(z.string(), z.string())
|
|
152
|
-
}).loose();
|
|
153
|
-
z.enum([
|
|
154
|
-
"transform-test.unknown-column",
|
|
155
|
-
"transform-test.ambiguous-column",
|
|
156
|
-
"transform-test.missing-inputs",
|
|
157
|
-
"transform-test.unused-inputs",
|
|
158
|
-
"transform-test.duplicate-input-table",
|
|
159
|
-
"transform-test.unparseable-source",
|
|
160
|
-
"transform-test.unremapped-reference",
|
|
161
|
-
"transform-test.unsupported-transform",
|
|
162
|
-
"transform-test.unsupported-driver",
|
|
163
|
-
"transform-test.transform-failed",
|
|
164
|
-
"transform-test.setup-failed",
|
|
165
|
-
"transform-test.expectation-failed",
|
|
166
|
-
"transform-test.unsupported-format"
|
|
167
|
-
]);
|
|
168
|
-
//#endregion
|
|
169
|
-
export { TransformTestUpdateInput as a, TransformTestRunResult as i, TransformTestCompact as n, TransformTestCreateInput as r, TransformTest as t };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { t as defineCommandGroup } from "./group-YQQ5GIcP.mjs";
|
|
2
|
-
//#region src/commands/transform-test/index.ts
|
|
3
|
-
var transform_test_default = defineCommandGroup({
|
|
4
|
-
name: "transform-test",
|
|
5
|
-
description: "Manage transform tests — fixtures and expectations run against temp tables",
|
|
6
|
-
subCommands: {
|
|
7
|
-
list: () => import("./list-Cuhf2lKL.mjs").then((mod) => mod.default),
|
|
8
|
-
get: () => import("./get-i0KInCw9.mjs").then((mod) => mod.default),
|
|
9
|
-
create: () => import("./create-DiJ8bUb-.mjs").then((mod) => mod.default),
|
|
10
|
-
update: () => import("./update-l3PyNQKG.mjs").then((mod) => mod.default),
|
|
11
|
-
delete: () => import("./delete-Bsdwqh7H.mjs").then((mod) => mod.default),
|
|
12
|
-
run: () => import("./run-FmRruANb.mjs").then((mod) => mod.default)
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
//#endregion
|
|
16
|
-
export { transform_test_default as default };
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { n as TransformTestCompact } from "./transform-test-BjjCQ2xm.mjs";
|
|
2
|
-
//#region src/output/views/transform-test.ts
|
|
3
|
-
const transformTestView = {
|
|
4
|
-
compactPick: TransformTestCompact,
|
|
5
|
-
tableColumns: [
|
|
6
|
-
{
|
|
7
|
-
key: "id",
|
|
8
|
-
label: "ID"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
key: "transform_id",
|
|
12
|
-
label: "Transform"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
key: "name",
|
|
16
|
-
label: "Name"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
key: "description",
|
|
20
|
-
label: "Description"
|
|
21
|
-
}
|
|
22
|
-
]
|
|
23
|
-
};
|
|
24
|
-
//#endregion
|
|
25
|
-
export { transformTestView as t };
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
import { it as TimeoutError, n as methodRequirements, nt as NetworkError, ot as ValidationError, rt as ResponseShapeError, st as errorMessage } from "./cli.mjs";
|
|
2
|
-
import { $ as createServerProfile, B as JSON_CONTENT_TYPE, F as buildNetworkError, G as credentialSecrets, I as isConnectionClosed, J as normalizeUrl, L as HttpError, U as assertCredentialHeaderSafe, V as parseJson, W as credentialAuthHeader, Z as checkFeatures, et as probeServer, tt as CapabilityError, z as isRetryableStatus } from "./runtime-Dtb93zKy.mjs";
|
|
3
|
-
import { n as throwIfAborted, r as untilAborted, t as combineAborts } from "./signal-Csom0mt5.mjs";
|
|
4
|
-
import { setTimeout } from "node:timers/promises";
|
|
5
|
-
//#region ../client/src/http/response-shape.ts
|
|
6
|
-
async function parseJsonResponse(text, schema, context) {
|
|
7
|
-
try {
|
|
8
|
-
return parseJson(text, schema, { source: context.url });
|
|
9
|
-
} catch (error) {
|
|
10
|
-
if (error instanceof ValidationError) throw ResponseShapeError.fromZodIssues({
|
|
11
|
-
kind: "zod",
|
|
12
|
-
method: context.method,
|
|
13
|
-
url: context.url,
|
|
14
|
-
status: context.status,
|
|
15
|
-
zodIssues: error.developerDetail.zodIssues,
|
|
16
|
-
serverTag: await context.getServerTag(),
|
|
17
|
-
serverSkew: context.serverSkew
|
|
18
|
-
});
|
|
19
|
-
throw error;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
//#endregion
|
|
23
|
-
//#region ../client/src/http/retry.ts
|
|
24
|
-
const BASE_DELAY_MS = 250;
|
|
25
|
-
const MAX_DELAY_MS = 8e3;
|
|
26
|
-
const MS_PER_SECOND = 1e3;
|
|
27
|
-
function backoffDelay({ attempt, retryAfterHeader }) {
|
|
28
|
-
const fromHeader = parseRetryAfter(retryAfterHeader);
|
|
29
|
-
if (fromHeader !== null) return fromHeader;
|
|
30
|
-
return Math.min(MAX_DELAY_MS, BASE_DELAY_MS * 2 ** attempt);
|
|
31
|
-
}
|
|
32
|
-
function parseRetryAfter(header) {
|
|
33
|
-
if (!header) return null;
|
|
34
|
-
const numeric = Number(header);
|
|
35
|
-
if (Number.isFinite(numeric) && numeric >= 0) return Math.round(numeric * MS_PER_SECOND);
|
|
36
|
-
const dateMs = Date.parse(header);
|
|
37
|
-
if (Number.isFinite(dateMs)) return Math.max(0, dateMs - Date.now());
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
function sleep(ms, signal) {
|
|
41
|
-
return setTimeout(ms, void 0, { signal });
|
|
42
|
-
}
|
|
43
|
-
async function runWithRetries(attempt, signal) {
|
|
44
|
-
let attemptIndex = 0;
|
|
45
|
-
while (true) {
|
|
46
|
-
const outcome = await attempt(attemptIndex);
|
|
47
|
-
if (outcome.kind === "success") return outcome.response;
|
|
48
|
-
await sleep(outcome.delayMs, signal);
|
|
49
|
-
attemptIndex += 1;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region ../client/src/http/transport.ts
|
|
54
|
-
const UNAUTHORIZED_STATUS = 401;
|
|
55
|
-
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
56
|
-
const OCTET_STREAM_CONTENT_TYPE = "application/octet-stream";
|
|
57
|
-
const TEXT_CONTENT_TYPE_PREFIX = "text/";
|
|
58
|
-
const ERROR_BODY_BYTE_CAP = 64 * 1024;
|
|
59
|
-
const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set([
|
|
60
|
-
"GET",
|
|
61
|
-
"HEAD",
|
|
62
|
-
"OPTIONS"
|
|
63
|
-
]);
|
|
64
|
-
function createTransport(config, options) {
|
|
65
|
-
const baseUrl = normalizeUrl(config.url);
|
|
66
|
-
assertCredentialHeaderSafe(config.credential);
|
|
67
|
-
const fetchImpl = options.fetchImpl ?? globalThis.fetch.bind(globalThis);
|
|
68
|
-
let settledProfile = options.server ?? null;
|
|
69
|
-
const getServerTag = options.getServerTag ?? (async () => tagOf(settledProfile));
|
|
70
|
-
const serverSkew = () => settledProfile === null ? null : settledProfile.skew;
|
|
71
|
-
const refreshCredential = options.refreshCredential;
|
|
72
|
-
let credential = config.credential;
|
|
73
|
-
const knownSecrets = new Set(credentialSecrets(credential));
|
|
74
|
-
const redactionContext = { knownSecrets };
|
|
75
|
-
let refreshInFlight = null;
|
|
76
|
-
function tryRefreshCredential() {
|
|
77
|
-
const refresh = refreshCredential;
|
|
78
|
-
if (credential.kind !== "oauth" || refresh === void 0) return Promise.resolve(false);
|
|
79
|
-
refreshInFlight ??= refreshOnce(refresh).finally(() => {
|
|
80
|
-
refreshInFlight = null;
|
|
81
|
-
});
|
|
82
|
-
return refreshInFlight;
|
|
83
|
-
}
|
|
84
|
-
async function refreshOnce(refresh) {
|
|
85
|
-
const next = await refresh();
|
|
86
|
-
if (next === null) return false;
|
|
87
|
-
credential = next;
|
|
88
|
-
for (const secret of credentialSecrets(next)) knownSecrets.add(secret);
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
async function attemptOnce(prepared, attempt) {
|
|
92
|
-
const hasRetriesLeft = attempt < prepared.retries;
|
|
93
|
-
const timeoutSignal = AbortSignal.timeout(prepared.timeoutMs);
|
|
94
|
-
const combined = combineAborts(timeoutSignal, prepared.cancelSignal);
|
|
95
|
-
let response;
|
|
96
|
-
try {
|
|
97
|
-
response = await fetchImpl(prepared.url, {
|
|
98
|
-
method: prepared.method,
|
|
99
|
-
headers: prepared.headers,
|
|
100
|
-
body: prepared.body,
|
|
101
|
-
signal: combined
|
|
102
|
-
});
|
|
103
|
-
} catch (error) {
|
|
104
|
-
throwIfAborted(prepared.cancelSignal);
|
|
105
|
-
const isStaleSocketFirstTry = attempt === 0 && isConnectionClosed(error);
|
|
106
|
-
if (prepared.idempotent && (hasRetriesLeft || isStaleSocketFirstTry)) return {
|
|
107
|
-
kind: "retry",
|
|
108
|
-
delayMs: backoffDelay({ attempt })
|
|
109
|
-
};
|
|
110
|
-
if (timeoutSignal.aborted) throw new TimeoutError(`Request timed out after ${prepared.timeoutMs}ms`, {
|
|
111
|
-
kind: "http",
|
|
112
|
-
method: prepared.method,
|
|
113
|
-
url: prepared.url,
|
|
114
|
-
timeoutMs: prepared.timeoutMs
|
|
115
|
-
});
|
|
116
|
-
throw buildNetworkError(error, prepared.method, prepared.url);
|
|
117
|
-
}
|
|
118
|
-
const canRetryStatus = hasRetriesLeft && prepared.idempotent;
|
|
119
|
-
if (!response.ok && isRetryableStatus(response.status) && canRetryStatus) {
|
|
120
|
-
const retryAfter = response.headers.get("Retry-After");
|
|
121
|
-
response.body?.cancel().catch(() => void 0);
|
|
122
|
-
return {
|
|
123
|
-
kind: "retry",
|
|
124
|
-
delayMs: backoffDelay({
|
|
125
|
-
attempt,
|
|
126
|
-
retryAfterHeader: retryAfter
|
|
127
|
-
})
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
if (!response.ok) {
|
|
131
|
-
const rawBody = await readBodyForError(response);
|
|
132
|
-
const serverTag = await getServerTag();
|
|
133
|
-
throw new HttpError({
|
|
134
|
-
status: response.status,
|
|
135
|
-
statusText: response.statusText,
|
|
136
|
-
method: prepared.method,
|
|
137
|
-
url: prepared.url,
|
|
138
|
-
responseHeaders: response.headers,
|
|
139
|
-
rawBody,
|
|
140
|
-
serverTag,
|
|
141
|
-
redactionContext
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
assertContentType(response, prepared);
|
|
145
|
-
return {
|
|
146
|
-
kind: "success",
|
|
147
|
-
response
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
async function executeRaw(prepared) {
|
|
151
|
-
try {
|
|
152
|
-
return await runWithRetries((attempt) => attemptOnce(prepared, attempt), prepared.cancelSignal);
|
|
153
|
-
} catch (error) {
|
|
154
|
-
throwIfAborted(prepared.cancelSignal);
|
|
155
|
-
throw error;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
async function executeWithAuthRefresh(path, opts) {
|
|
159
|
-
const prepared = prepare(path, opts);
|
|
160
|
-
try {
|
|
161
|
-
return {
|
|
162
|
-
response: await executeRaw(prepared),
|
|
163
|
-
prepared
|
|
164
|
-
};
|
|
165
|
-
} catch (error) {
|
|
166
|
-
if (error instanceof HttpError && error.status === UNAUTHORIZED_STATUS) {
|
|
167
|
-
if (await tryRefreshCredential()) {
|
|
168
|
-
const retried = prepare(path, opts);
|
|
169
|
-
return {
|
|
170
|
-
response: await executeRaw(retried),
|
|
171
|
-
prepared: retried
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
throw error;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
function prepare(path, opts = {}) {
|
|
179
|
-
const method = opts.method ?? "GET";
|
|
180
|
-
const expectContentType = opts.expectContentType ?? "json";
|
|
181
|
-
const url = buildUrl(baseUrl, path, opts.query);
|
|
182
|
-
const headers = new Headers();
|
|
183
|
-
const auth = credentialAuthHeader(credential);
|
|
184
|
-
headers.set(auth.name, auth.value);
|
|
185
|
-
headers.set("accept", acceptHeader(expectContentType));
|
|
186
|
-
headers.set("user-agent", options.userAgent);
|
|
187
|
-
let body = null;
|
|
188
|
-
if (opts.body !== void 0 && opts.body !== null) if (typeof opts.body === "string" || opts.body instanceof URLSearchParams) body = opts.body;
|
|
189
|
-
else if (opts.body instanceof FormData || opts.body instanceof ReadableStream) body = opts.body;
|
|
190
|
-
else if (opts.body instanceof Uint8Array) {
|
|
191
|
-
body = opts.body;
|
|
192
|
-
headers.set("content-type", OCTET_STREAM_CONTENT_TYPE);
|
|
193
|
-
} else {
|
|
194
|
-
body = JSON.stringify(opts.body);
|
|
195
|
-
headers.set("content-type", JSON_CONTENT_TYPE);
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
url,
|
|
199
|
-
method,
|
|
200
|
-
headers,
|
|
201
|
-
body,
|
|
202
|
-
expectContentType,
|
|
203
|
-
retries: opts.retries ?? 3,
|
|
204
|
-
idempotent: opts.idempotent ?? IDEMPOTENT_METHODS.has(method),
|
|
205
|
-
timeoutMs: opts.timeoutMs ?? 3e4,
|
|
206
|
-
cancelSignal: combineAborts(opts.signal, options.signal)
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
let serverProfile = options.server === void 0 ? null : Promise.resolve(options.server);
|
|
210
|
-
async function server(wait = {}) {
|
|
211
|
-
throwIfAborted(wait.signal);
|
|
212
|
-
if (serverProfile === null) {
|
|
213
|
-
const probe = probeServer(transport).then((info) => {
|
|
214
|
-
settledProfile = createServerProfile(info);
|
|
215
|
-
return settledProfile;
|
|
216
|
-
});
|
|
217
|
-
probe.catch(() => {
|
|
218
|
-
serverProfile = null;
|
|
219
|
-
});
|
|
220
|
-
serverProfile = probe;
|
|
221
|
-
}
|
|
222
|
-
return untilAborted(serverProfile, wait.signal);
|
|
223
|
-
}
|
|
224
|
-
const enforceRequirements = options.enforceRequirements ?? true;
|
|
225
|
-
async function requireFeatures(features, wait = {}) {
|
|
226
|
-
if (!enforceRequirements || features.length === 0) return;
|
|
227
|
-
const failure = checkFeatures(features, await server(wait));
|
|
228
|
-
if (failure !== null) throw new CapabilityError(failure);
|
|
229
|
-
}
|
|
230
|
-
async function requireMethod(key, wait = {}) {
|
|
231
|
-
return requireFeatures(methodRequirements(key), wait);
|
|
232
|
-
}
|
|
233
|
-
const transport = {
|
|
234
|
-
server,
|
|
235
|
-
require: requireMethod,
|
|
236
|
-
requireFeatures,
|
|
237
|
-
async requestRaw(path, opts) {
|
|
238
|
-
return (await executeWithAuthRefresh(path, opts ?? {})).response;
|
|
239
|
-
},
|
|
240
|
-
async requestParsed(schema, path, opts) {
|
|
241
|
-
const { response, prepared } = await executeWithAuthRefresh(path, {
|
|
242
|
-
...opts,
|
|
243
|
-
expectContentType: "json"
|
|
244
|
-
});
|
|
245
|
-
return parseJsonResponse(await response.text(), schema, {
|
|
246
|
-
method: prepared.method,
|
|
247
|
-
url: prepared.url,
|
|
248
|
-
status: response.status,
|
|
249
|
-
getServerTag,
|
|
250
|
-
serverSkew: serverSkew()
|
|
251
|
-
});
|
|
252
|
-
},
|
|
253
|
-
async requestStream(path, opts) {
|
|
254
|
-
const { response, prepared } = await executeWithAuthRefresh(path, {
|
|
255
|
-
...opts,
|
|
256
|
-
expectContentType: opts?.expectContentType ?? "binary"
|
|
257
|
-
});
|
|
258
|
-
if (!response.body) throw new NetworkError("Response had no body to stream", {
|
|
259
|
-
method: prepared.method,
|
|
260
|
-
url: prepared.url,
|
|
261
|
-
cause: "missing body"
|
|
262
|
-
});
|
|
263
|
-
return response.body;
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
return transport;
|
|
267
|
-
}
|
|
268
|
-
function tagOf(profile) {
|
|
269
|
-
return profile === null ? null : profile.version.tag;
|
|
270
|
-
}
|
|
271
|
-
function buildUrl(baseUrl, path, query) {
|
|
272
|
-
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
273
|
-
const target = new URL(baseUrl + normalizedPath);
|
|
274
|
-
if (query) for (const [key, value] of Object.entries(query)) {
|
|
275
|
-
if (value === void 0) continue;
|
|
276
|
-
if (Array.isArray(value)) for (const entry of value) target.searchParams.append(key, String(entry));
|
|
277
|
-
else target.searchParams.append(key, String(value));
|
|
278
|
-
}
|
|
279
|
-
return target.toString();
|
|
280
|
-
}
|
|
281
|
-
function acceptHeader(expected) {
|
|
282
|
-
if (expected === "json") return JSON_CONTENT_TYPE;
|
|
283
|
-
if (expected === "text") return "text/*";
|
|
284
|
-
return "*/*";
|
|
285
|
-
}
|
|
286
|
-
function assertContentType(response, prepared) {
|
|
287
|
-
if (prepared.expectContentType === "binary") return;
|
|
288
|
-
const contentType = response.headers.get("content-type");
|
|
289
|
-
if (contentType === null) throwContentTypeMismatch(response, prepared, prepared.expectContentType);
|
|
290
|
-
if (prepared.expectContentType === "json" && !contentType.includes("application/json")) throwContentTypeMismatch(response, prepared, "json");
|
|
291
|
-
if (prepared.expectContentType === "text" && !contentType.startsWith(TEXT_CONTENT_TYPE_PREFIX)) throwContentTypeMismatch(response, prepared, "text");
|
|
292
|
-
}
|
|
293
|
-
function throwContentTypeMismatch(response, prepared, expected) {
|
|
294
|
-
const actual = response.headers.get("content-type") ?? "no content-type";
|
|
295
|
-
throw new HttpError({
|
|
296
|
-
status: response.status,
|
|
297
|
-
statusText: response.statusText,
|
|
298
|
-
method: prepared.method,
|
|
299
|
-
url: prepared.url,
|
|
300
|
-
responseHeaders: response.headers,
|
|
301
|
-
rawBody: null,
|
|
302
|
-
overrideUserMessage: `Expected ${expected} response but got ${actual}`
|
|
303
|
-
});
|
|
304
|
-
}
|
|
305
|
-
async function readBodyForError(response) {
|
|
306
|
-
try {
|
|
307
|
-
return Buffer.from(await response.arrayBuffer()).subarray(0, ERROR_BODY_BYTE_CAP).toString("utf8");
|
|
308
|
-
} catch (error) {
|
|
309
|
-
return `[body read failed: ${errorMessage(error)}]`;
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
//#endregion
|
|
313
|
-
export { createTransport as n, DEFAULT_TIMEOUT_MS as t };
|
package/dist/update-l3PyNQKG.mjs
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { H as outputFlags, U as profileFlag, p as renderSummary, z as connectionFlags } from "./cli.mjs";
|
|
2
|
-
import { t as defineMetabaseCommand } from "./runtime-Dtb93zKy.mjs";
|
|
3
|
-
import { t as parseId } from "./parse-id-DtM6q9HU.mjs";
|
|
4
|
-
import { t as readBody } from "./body-CshgcV6U.mjs";
|
|
5
|
-
import { t as bodyInputFlags } from "./body-flags-AqKpN01Y.mjs";
|
|
6
|
-
import { a as TransformTestUpdateInput, t as TransformTest } from "./transform-test-BjjCQ2xm.mjs";
|
|
7
|
-
import { t as transformTestView } from "./transform-test-gzDcbypy.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 at every level: 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
|
-
requires: ["transformTest.update"],
|
|
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 };
|