@metabase/cli 0.5.0 → 0.5.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-COtKcy6Y.mjs → add-collection-C0BQHjJd.mjs} +5 -5
- package/dist/{alert-DMlSjPEv.mjs → alert-mXHOt00T.mjs} +7 -7
- package/dist/{alerts-s3al16NZ.mjs → alerts-CyB1Z7AU.mjs} +6 -6
- package/dist/{append-CbGmdeLw.mjs → append-DeHhUAeY.mjs} +4 -4
- package/dist/{archive-DvbaSglr.mjs → archive-B1MA5MZp.mjs} +5 -5
- package/dist/{archive-CnDriekB.mjs → archive-Bi-Sfq5T.mjs} +5 -5
- package/dist/{archive-BFmx4B91.mjs → archive-CCKxZEuq.mjs} +5 -5
- package/dist/{archive-BZCYIBhQ.mjs → archive-CDSAXKKB.mjs} +5 -5
- package/dist/{archive-5EY9UJU_.mjs → archive-CfNLlebd.mjs} +6 -6
- package/dist/archive-CjVd1fJ5.mjs +32 -0
- package/dist/{archive-Ce4eArrs.mjs → archive-CpvpGZlz.mjs} +3 -3
- package/dist/{archive-DDO2XX0E.mjs → archive-DRMXvkiI.mjs} +4 -4
- package/dist/{archive-a05W75XH.mjs → archive-DfDqPgtk.mjs} +3 -3
- package/dist/{archive-DzSdJVqE.mjs → archive-DpgtAdEa.mjs} +5 -5
- package/dist/{archive-C_UHeanE.mjs → archive-HCVTRXI2.mjs} +3 -3
- package/dist/{archive-DW7x0IFB.mjs → archive-qy0CFo1s2.mjs} +5 -5
- package/dist/{auth-DOz7KW5E.mjs → auth-_cdypXeX.mjs} +5 -5
- package/dist/{body-Di7940x_.mjs → body-C0VnEiRV.mjs} +2 -2
- package/dist/{branch-flag-CfJ8vwgu.mjs → branch-flag-CPTQ4wXp.mjs} +1 -1
- package/dist/{branches-BC-vlk6i.mjs → branches-C7mNYAky.mjs} +3 -3
- package/dist/{breaking-ByrjsFjq.mjs → breaking-BindR3ZW.mjs} +6 -6
- package/dist/{broken-DLSk1T88.mjs → broken-SoXfkx7d.mjs} +8 -8
- package/dist/{bulk-discard-values-VKGj8c7z.mjs → bulk-discard-values-D_d5_1w5.mjs} +5 -5
- package/dist/{bulk-edit-CpuleeCQ.mjs → bulk-edit-Cce05vb_.mjs} +5 -5
- package/dist/{bulk-rescan-values-DeGwiqLS.mjs → bulk-rescan-values-DIQN4VT_.mjs} +5 -5
- package/dist/{bulk-sync-schema-BKVhauW1.mjs → bulk-sync-schema-DLWf5dCl.mjs} +5 -5
- package/dist/{cancel-qKj45001.mjs → cancel-rnd6UI-6.mjs} +3 -3
- package/dist/{cancel-task-nmBBd1Ky.mjs → cancel-task-acq1GT6Z.mjs} +4 -4
- package/dist/{card-DSrgU7lT.mjs → card-3NmUiU5F.mjs} +1 -1
- package/dist/card-BnL92zoT.mjs +25 -0
- package/dist/{card-Bv4ZN0oV.mjs → card-QR3zEu6E.mjs} +39 -26
- package/dist/{cards-Bq73s48q.mjs → cards-DmzPtx81.mjs} +6 -6
- package/dist/cli.mjs +200 -49
- package/dist/{client-BmURNkkW.mjs → client-D-Aw6JLk.mjs} +202 -618
- package/dist/{collection-C03LXnCT.mjs → collection-D5vt2IJ_.mjs} +1 -1
- package/dist/{collection-zrZoJfgR.mjs → collection-DNmFKALA.mjs} +12 -3
- package/dist/collection-DRHGwFSL.mjs +21 -0
- package/dist/{collection-namespace-DaDzK31i.mjs → collection-namespace-Dl8_7xII.mjs} +1 -1
- package/dist/{content-translation-BlG41YrA.mjs → content-translation-DxT1OMnP.mjs} +3 -3
- package/dist/{copy-DTiYs_a2.mjs → copy-BTdTiDQo.mjs} +6 -6
- package/dist/{copy-DOKlVa7H.mjs → copy-CyFf3e2Y.mjs} +6 -6
- package/dist/{copy-flags-BhGWC5kS.mjs → copy-flags-CTM91pxH.mjs} +2 -2
- package/dist/{create-DraZzrLO.mjs → create-B3QZpifA.mjs} +7 -7
- package/dist/{create-B5BwdPwT.mjs → create-B6dABrs7.mjs} +6 -6
- package/dist/create-BH6zpwKD.mjs +34 -0
- package/dist/{create-BpwZJZxb.mjs → create-Bg3WTMMU.mjs} +5 -5
- package/dist/{create-JaFhqysM.mjs → create-BwIOlpLc.mjs} +5 -5
- package/dist/{create-BKKNIe93.mjs → create-C3rabvE_.mjs} +5 -5
- package/dist/{create-Duj_2YIF.mjs → create-Ce5YVusp.mjs} +4 -4
- package/dist/create-Ch-NbeMr.mjs +48 -0
- package/dist/{create-Cob0gLsA.mjs → create-CuJJd7Rh.mjs} +5 -5
- package/dist/{create-1rLk8b5q.mjs → create-D6NLpIzV.mjs} +3 -3
- package/dist/{create-B1bX6ngX.mjs → create-DeCPAYJi.mjs} +4 -4
- package/dist/{create-d0trLAzB.mjs → create-DeiBnRRz.mjs} +6 -6
- package/dist/{create-C0kz0oYc.mjs → create-DiG165B2.mjs} +5 -5
- package/dist/{create-B1QDNU1x.mjs → create-Dn8V5siS.mjs} +6 -6
- package/dist/{create-BXX_n64u.mjs → create-DsCydgm22.mjs} +5 -5
- package/dist/{create-vOw8gmBU.mjs → create-GU8_GNbN.mjs} +3 -3
- package/dist/{create-branch-B5jB4tKk.mjs → create-branch-C4Ql9G2g.mjs} +4 -4
- package/dist/{create-DUytP2Y1.mjs → create-qtTB8rIE.mjs} +4 -4
- package/dist/{create-DPggIXfn.mjs → create-roJbQOmm.mjs} +4 -4
- package/dist/{csv-DfExp9H_.mjs → csv-DmuyyLdz.mjs} +4 -4
- package/dist/{current-task-CbXIH_RA.mjs → current-task-C2PPBVVv.mjs} +4 -4
- package/dist/dashboard-Bq1pae4N.mjs +35 -0
- package/dist/{dashboard-Phz3XpRM.mjs → dashboard-Chjy5GKR.mjs} +52 -5
- package/dist/{dashboard-XSTr9QCr.mjs → dashboard-D5E3fMKh.mjs} +1 -1
- package/dist/data-action-BZ2PvlaP.mjs +24 -0
- package/dist/data-action-DZxVB_hD.mjs +85 -0
- package/dist/data-action-R9qxJDPA.mjs +40 -0
- package/dist/{database-BdKkae1m.mjs → database-CxykzTAA.mjs} +14 -3
- package/dist/{database-DoNoZ8Yc.mjs → database-D8XzgJEz.mjs} +19 -2
- package/dist/{dataset-DZgJm5hP.mjs → dataset-DIQLAp2P.mjs} +5 -4
- package/dist/db-BgKKN1-4.mjs +25 -0
- package/dist/{delete-DJ7SNXiH.mjs → delete-5ZOvFr-7.mjs} +4 -4
- package/dist/delete-B3aylPHD.mjs +44 -0
- package/dist/{delete-hwPqKXeY.mjs → delete-CH32Ew4m.mjs} +4 -4
- package/dist/{delete-D0xFMRRq.mjs → delete-CS6hsBnd.mjs} +4 -4
- package/dist/{delete-hcw_4pBG.mjs → delete-DeqGTuwO.mjs} +4 -4
- package/dist/{delete-9xHRd2CG.mjs → delete-DiZg2wit.mjs} +4 -4
- package/dist/delete-DtIbkF42.mjs +44 -0
- package/dist/{delete-B4BfGfiJ.mjs → delete-_XC6R-Jn.mjs} +4 -4
- package/dist/{delete-runtime-DkgYUQ_n.mjs → delete-runtime-DRGveT8H.mjs} +1 -1
- package/dist/{delete-table-DhTMft7u.mjs → delete-table-BEuMlqw1.mjs} +4 -4
- package/dist/{dependencies-B8H2gA04.mjs → dependencies-DD48u9i3.mjs} +5 -5
- package/dist/dependency-6kfpR8Ga.mjs +15 -0
- package/dist/{dependency-tQBxYjFX.mjs → dependency-CaC6XuTY.mjs} +2 -2
- package/dist/{dependency-Dc33mjgd.mjs → dependency-Dxvb2Znu.mjs} +2 -2
- package/dist/{dependents-B2GcS5kB.mjs → dependents-ByfHs8pO.mjs} +9 -9
- package/dist/{dirty-Cz2rUd6S.mjs → dirty-DsrGfLit.mjs} +5 -5
- package/dist/{discard-values-QWuWGaVK.mjs → discard-values-BfpwwC62.mjs} +5 -5
- package/dist/document-C0mZEg5w.mjs +20 -0
- package/dist/{document-wfWbV0B_.mjs → document-DVIu3Vj4.mjs} +1 -1
- package/dist/{document-BDobDiap.mjs → document-UMG6me2P.mjs} +1 -1
- package/dist/{download-Dw15fUMy.mjs → download-kpgGtfpw.mjs} +2 -2
- package/dist/{eid-Ex4G-ZlN.mjs → eid-Tp-ACZ4O.mjs} +4 -5
- package/dist/{eid-translation-zEHtr5Oc.mjs → eid-translation-Ba92VOHe.mjs} +1 -0
- package/dist/{entity-DBKPaMr5.mjs → entity-DjDkaMkB.mjs} +2 -2
- package/dist/{entry-flags-DgY3IXFe.mjs → entry-flags-nhBrUS6p.mjs} +4 -4
- package/dist/{events-BibJ4ya0.mjs → events-Dm9-ofXu.mjs} +6 -6
- package/dist/execute-BL0dAlrp.mjs +45 -0
- package/dist/{export-U8MdaatW.mjs → export-CIW-dHft.mjs} +24 -12
- package/dist/{export-flags-BrfeyE8D.mjs → export-flags-CpukgETM.mjs} +14 -6
- package/dist/{export-preflight-A28L45au.mjs → export-preflight-BMlz3Hp9.mjs} +5 -5
- package/dist/field-BUkyWiWk.mjs +21 -0
- package/dist/{field-wmN6raOG.mjs → field-BVz4AS3f.mjs} +1 -1
- package/dist/{field-5nivEfd6.mjs → field-DoWQUl7V.mjs} +58 -45
- package/dist/{fields-i1TFa_th.mjs → fields-CcerFaiu.mjs} +6 -6
- package/dist/{filter-flags-Bm3vuSM-.mjs → filter-flags-DhE4olyf.mjs} +5 -4
- package/dist/{fks-Dcfn3-73.mjs → fks-CYfBesHV.mjs} +6 -6
- package/dist/{get-D0NZ0ZO1.mjs → get--E7UvR-v.mjs} +5 -5
- package/dist/{get-Dz3dNirC.mjs → get-B0RQPTV-2.mjs} +5 -5
- package/dist/{get-CCLWWqTD.mjs → get-BFloqjrN.mjs} +4 -4
- package/dist/{get-B4_3DID6.mjs → get-BLnQ2aut.mjs} +5 -5
- package/dist/{get-DqYn9mez.mjs → get-BaiyMem3.mjs} +4 -4
- package/dist/{get-CobILQ_7.mjs → get-Be7yjY9v.mjs} +6 -6
- package/dist/get-BvEHWLGL.mjs +32 -0
- package/dist/get-CEJE9Rmp.mjs +31 -0
- package/dist/{get-EKBYludD.mjs → get-CRfrkxqc.mjs} +3 -3
- package/dist/{get-DPZUIPjv.mjs → get-CZgAr8rM.mjs} +5 -5
- package/dist/{get-BKDTRMNU.mjs → get-Cj3-w_Nu.mjs} +5 -5
- package/dist/{get-BCdtCwaG.mjs → get-CmxYFUuR.mjs} +3 -3
- package/dist/{get-Cwj1Q-at.mjs → get-DHSuVxrH.mjs} +5 -5
- package/dist/{get-C3ojRVJ_.mjs → get-DKbGKa6F.mjs} +4 -4
- package/dist/{get-HFQSttF3.mjs → get-DRhcS76J.mjs} +5 -5
- package/dist/{get-BiPSePQc.mjs → get-Dp45rXRS.mjs} +3 -3
- package/dist/{get-DUwX-RU82.mjs → get-HzDQViDP2.mjs} +5 -5
- package/dist/{get-CcwRn8Y2.mjs → get-LRTRu85E.mjs} +5 -5
- package/dist/{get-IjoHBExI.mjs → get-RCDF-hEq.mjs} +5 -5
- package/dist/{get-CVpIQb8v.mjs → get-eNRULmE5.mjs} +5 -5
- package/dist/{get-hAoJtVCK.mjs → get-p2sZvp7v.mjs} +3 -3
- package/dist/{get-run-B2SnsZSY.mjs → get-run-C3AHKn3-.mjs} +4 -4
- package/dist/git-sync-CNTB5jvI.mjs +29 -0
- package/dist/{git-sync-Ch1V1fEK.mjs → git-sync-D1aKczo6.mjs} +15 -8
- package/dist/{git-sync-COokpYgc.mjs → git-sync-DP4wQFzm.mjs} +18 -1
- package/dist/glossary-B9Eo4hXc.mjs +14 -0
- package/dist/{glossary-wnuxoE_I.mjs → glossary-BkGmCI4X.mjs} +1 -1
- package/dist/{glossary-6LLpItof.mjs → glossary-QN-hHfOT.mjs} +1 -1
- package/dist/{graph-CHlfxVy1.mjs → graph-BGOYocJc.mjs} +6 -6
- package/dist/{group-B3X3LTcU.mjs → group-81zoQcEP.mjs} +1 -1
- package/dist/{has-remote-changes-DCMpqGgE.mjs → has-remote-changes-DxsRvZsw.mjs} +4 -4
- package/dist/{import-C7MZhKo6.mjs → import-izn2_OsW.mjs} +7 -7
- package/dist/{is-dirty-DpLyHebS.mjs → is-dirty-DHYYRl6Y.mjs} +2 -2
- package/dist/{items-1ME_eg27.mjs → items-mIoZBqUc.mjs} +6 -6
- package/dist/{key-DMtgTOwN.mjs → key-BYEv4Wgq.mjs} +2 -2
- package/dist/{library-D2ogEIfI.mjs → library-5I0TlXmf.mjs} +5 -5
- package/dist/{library-fWEv38OB.mjs → library-DKIqzyUk.mjs} +2 -2
- package/dist/{library-CP-9yepy.mjs → library-wUiD2jbw.mjs} +1 -1
- package/dist/{list-BUwDGyIu.mjs → list-B6TYzXyW.mjs} +5 -5
- package/dist/{list-Ud7F0XdU.mjs → list-B8FPpgct.mjs} +3 -3
- package/dist/{list-B0h-j1E7.mjs → list-BEBAq1xc.mjs} +5 -5
- package/dist/{list-OXiXtdiM.mjs → list-BKhJfFyB.mjs} +5 -5
- package/dist/{list-STy8UHs2.mjs → list-BxIulkp3.mjs} +6 -6
- package/dist/{list-CQi3AgS5.mjs → list-C-f-G-cC.mjs} +5 -5
- package/dist/{list-dCi6OaIE.mjs → list-C1dEh2yq.mjs} +6 -6
- package/dist/{list-DkCadZ2E.mjs → list-C3CXHKTW.mjs} +5 -5
- package/dist/{list-LMlJ4uAY.mjs → list-C6roDyBd.mjs} +6 -6
- package/dist/{list-CJ5FyCnL.mjs → list-CT7AOXTS.mjs} +4 -4
- package/dist/{list-BUZ91ctZ.mjs → list-CTlIVHeG.mjs} +5 -5
- package/dist/list-CmOTwt_z.mjs +35 -0
- package/dist/list-CpxEOoqw.mjs +48 -0
- package/dist/{list-DzP7YXdZ.mjs → list-CuEPFHrk.mjs} +3 -3
- package/dist/{list-DBAEy3Rx.mjs → list-D8jiz8YP.mjs} +3 -3
- package/dist/{list-NINy7ybI.mjs → list-DV4wojtv.mjs} +4 -4
- package/dist/{list-BXcDPU5d.mjs → list-DVnPzc5m.mjs} +6 -6
- package/dist/list-NeImhwLD.mjs +28 -0
- package/dist/{list-CVh8DHOO.mjs → list-OWPg67JC.mjs} +5 -5
- package/dist/{list-C9996vbS.mjs → list-O_nmgwSj.mjs} +3 -3
- package/dist/{list-C1oEpUZG.mjs → list-jT5ndEGr.mjs} +3 -3
- package/dist/{login-BMON3Fft.mjs → login-DOW1mr40.mjs} +15 -8
- package/dist/{logout-Cx934GzW.mjs → logout-BQ8wywf7.mjs} +2 -2
- package/dist/{measure-CUqJtDNm.mjs → measure-Bz-bGn-Z.mjs} +6 -6
- package/dist/{moderation-review-BdqEH6N1.mjs → moderation-review-Bf9bPNQI.mjs} +1 -1
- package/dist/{notification-CCZ9mrOw.mjs → notification-W2SVssyY.mjs} +1 -1
- package/dist/{parameter-Celg0wZa.mjs → parameter-DvRQMKd2.mjs} +6 -6
- package/dist/{parameter-values-DCrU02Az.mjs → parameter-values-B7rr6fcy.mjs} +21 -7
- package/dist/{parse-enum-Do5Cptbv.mjs → parse-enum-DAcTzG1q.mjs} +1 -1
- package/dist/{parse-id-oCbmouCn.mjs → parse-id-5BZGQ9Vd.mjs} +1 -1
- package/dist/{parse-ref-Df8gusl4.mjs → parse-ref-ByXc-pls.mjs} +1 -1
- package/dist/{parse-text-CVrP7GmZ.mjs → parse-text-FgX60vIg.mjs} +1 -1
- package/dist/{path-DTuSDGd6.mjs → path-CHQguAPa.mjs} +4 -4
- package/dist/{poll-BKo5dK0l.mjs → poll-CgtcJopL.mjs} +2 -2
- package/dist/{preflight-UeYuGDPr.mjs → preflight-ChTKhB8Y.mjs} +2 -2
- package/dist/{process-BpmZXbcw.mjs → process-aqXm5QgC.mjs} +1 -1
- package/dist/{publish-D3GwLC-K.mjs → publish-CaoFOucS.mjs} +4 -4
- package/dist/{pulse-Dz0ocv0l.mjs → pulse-CC81N2_0.mjs} +1 -1
- package/dist/{pulse-DzVPfb5J.mjs → pulse-JPrq6NFP.mjs} +2 -2
- package/dist/{query-Ct697cY-.mjs → query-0u1WR1bV.mjs} +13 -12
- package/dist/query-BKtMP5eH.mjs +13 -0
- package/dist/{query-B1Cp9EO6.mjs → query-CzDBwAZD.mjs} +17 -7
- package/dist/{remapping-RsoPWE7c.mjs → remapping-CodmT28F.mjs} +5 -5
- package/dist/{remove-collection-BJo3Wd9K.mjs → remove-collection-DfUsf6Dd.mjs} +5 -5
- package/dist/{render-C_ev6qoW.mjs → render-DP6UoZNT.mjs} +2 -2
- package/dist/{replace-BSAGp3cR.mjs → replace-qWiUOgmn.mjs} +4 -4
- package/dist/{requirement-check-T3bjQ0Mr.mjs → requirement-check-sfmyH2PH.mjs} +2 -2
- package/dist/{rescan-values-rpro4Kw2.mjs → rescan-values-BcrhdSj_.mjs} +5 -5
- package/dist/{rescan-values-CE62_2dc.mjs → rescan-values-BuDmeda3.mjs} +5 -5
- package/dist/{run-BI1QO9Kn.mjs → run-BBRnFayr.mjs} +7 -7
- package/dist/{run-B3BRodEp.mjs → run-BG_5lR0x.mjs} +4 -4
- package/dist/run-DXXD-CnS.mjs +63 -0
- package/dist/{runs-CUseZezf.mjs → runs-CovgMSwy.mjs} +5 -5
- package/dist/{runtime-C5Ha6Ou8.mjs → runtime-Cmes70jO.mjs} +63 -80
- package/dist/{schema-tables-C7YkyRh0.mjs → schema-tables-CjKl8jr5.mjs} +6 -6
- package/dist/{schemas-Bj5sJ9uB.mjs → schemas-CAGvBAD_.mjs} +4 -4
- package/dist/{search-BAXg-EJw.mjs → search-1et9tv_s.mjs} +22 -4
- package/dist/{search-BsAwK7Rk.mjs → search-DFU6FHRd.mjs} +6 -6
- package/dist/{search-CB1A4HWx.mjs → search-OpYS2Ub4.mjs} +21 -6
- package/dist/{segment-BEjaeLc5.mjs → segment-D-SKpFzF.mjs} +6 -6
- package/dist/{send-Dfh8d1gG.mjs → send-DNu83_3E.mjs} +3 -3
- package/dist/{set-DA8dKyzi.mjs → set-CGYZcLVo.mjs} +4 -4
- package/dist/{set-active-AyjKtBD-.mjs → set-active-32IaLx1O.mjs} +4 -4
- package/dist/set-data-actions-DRhgAfhE.mjs +46 -0
- package/dist/{set-sensitivity-D0613dHA.mjs → set-sensitivity-D_i3XEe8.mjs} +6 -6
- package/dist/{setting-B-bxCkC0.mjs → setting-BBn9Lv9J.mjs} +4 -4
- package/dist/{setup-Bvvqlz9d.mjs → setup-8d7Uplhy.mjs} +3 -3
- package/dist/{signal-Dm4N0Bcc.mjs → signal-D8MH3LMN.mjs} +1 -1
- package/dist/{skill-list-DkuCf0k4.mjs → skill-list-D2FhhYS3.mjs} +1 -1
- package/dist/{skills-DlDCTGVE.mjs → skills-BZGd_9d3.mjs} +2 -2
- package/dist/{skills-DxrO7HUz.mjs → skills-BeIDC-_H.mjs} +3 -3
- package/dist/snippet-CpZ5cJ_y.mjs +19 -0
- package/dist/{stash-j9JPv3ns.mjs → stash-Dyc1xZ8u.mjs} +6 -6
- package/dist/{status-DcbvbRc5.mjs → status-CQZwl1PX.mjs} +3 -3
- package/dist/{status-DxNcrfnI.mjs → status-lCN8unWe.mjs} +37 -16
- package/dist/{subscription-CSR2t-xK.mjs → subscription-CEFxmtGH.mjs} +6 -6
- package/dist/{subscriptions--0YvW40u.mjs → subscriptions-AU14uznL.mjs} +6 -6
- package/dist/{summary-Dslv78-r.mjs → summary-Do9IBOQM.mjs} +5 -5
- package/dist/{sync-schema-Dgij5ICd.mjs → sync-schema-B3nyoKZl.mjs} +5 -5
- package/dist/{sync-schema-BSJiokQf.mjs → sync-schema-_gw9RQyF.mjs} +6 -6
- package/dist/{sync-task-a1zyF1Qb.mjs → sync-task-DNKG9Bk4.mjs} +4 -3
- package/dist/{table-Uvu1roSx.mjs → table-BDsqRU7a.mjs} +3 -3
- package/dist/{table-zAdW5_3H.mjs → table-CF7zW9cI.mjs} +33 -20
- package/dist/table-Cb_Uvw8m.mjs +26 -0
- package/dist/{table-selector-flags-B9OiA3Z1.mjs → table-selector-flags-CHfrVpYQ.mjs} +3 -3
- package/dist/{text-821Rn8M9.mjs → text-C2VwKF9D.mjs} +1 -1
- package/dist/{timeline-uDCmwGFT.mjs → timeline-BgWz8DYK.mjs} +1 -1
- package/dist/{timeline-CCSU2qOS.mjs → timeline-DcsCXNUt.mjs} +5 -1
- package/dist/{timeline-event-CSzx8EDP.mjs → timeline-event-B-nGnoVL.mjs} +6 -6
- package/dist/timeline-x0s_3sfc.mjs +21 -0
- package/dist/{transform-BKX6tl3i.mjs → transform-CWGJB8N_.mjs} +1 -1
- package/dist/{transform-job-AaMZRxAq.mjs → transform-job-BBZ5L46v.mjs} +1 -1
- package/dist/{transform-job-CCguL6LP.mjs → transform-job-ClX8e5iO.mjs} +2 -1
- package/dist/transform-job-Dlx2c6II.mjs +22 -0
- package/dist/transform-kP11Mv9_.mjs +28 -0
- package/dist/{transform-tag-DHg7j15d.mjs → transform-tag-dKCqQPTd.mjs} +5 -5
- package/dist/transform-test-Bexa_K89.mjs +173 -0
- package/dist/transform-test-C49ZTK7M.mjs +32 -0
- package/dist/transform-test-jFuzVhlT.mjs +16 -0
- package/dist/{transforms-DwxPfMiG.mjs → transforms-DRAws1f4.mjs} +5 -5
- package/dist/transport-Ck4anhoc.mjs +416 -0
- package/dist/{tree-COFmA20J.mjs → tree-Ddsj298M.mjs} +3 -3
- package/dist/{unpublish-BQClh4U7.mjs → unpublish-BMfjQ8UV.mjs} +3 -3
- package/dist/{unreferenced-DKc0zZDl.mjs → unreferenced-DRQrvH5r.mjs} +6 -6
- package/dist/{update-CMRWXoZ2.mjs → update-0AoF6QJ_.mjs} +4 -4
- package/dist/{update-BVFfoopT.mjs → update-6sfqiInZ.mjs} +5 -5
- package/dist/{update-MxvqmZ3z.mjs → update-8eXJso_l.mjs} +6 -6
- package/dist/{update-BNwjjMk6.mjs → update-BCC1Igr2.mjs} +5 -5
- package/dist/{update-CFfr1ZdL.mjs → update-BIL0JPqm.mjs} +4 -4
- package/dist/{update-BVMgrMy7.mjs → update-BQLTaw3z.mjs} +6 -6
- package/dist/{update-CPmPnEvm.mjs → update-Bpsdi6kM.mjs} +6 -6
- package/dist/{update-kM3TDlEp.mjs → update-BtfUX9CN.mjs} +8 -8
- package/dist/{update-myfBF5qV.mjs → update-C19B1Sry.mjs} +6 -6
- package/dist/{update-Ca8LSZer.mjs → update-C1VwtJWu.mjs} +5 -5
- package/dist/update-C1x90FSH.mjs +52 -0
- package/dist/{update-C9HK3i8s.mjs → update-CGpiLu7N.mjs} +8 -8
- package/dist/{update-Dwr3n7_n.mjs → update-CnxzmPRG.mjs} +7 -7
- package/dist/update-D1aKeWfo.mjs +41 -0
- package/dist/{update-Bgy2amR0.mjs → update-DlFHoUxe.mjs} +6 -6
- package/dist/{update-DJwu8UT2.mjs → update-DpP1EEC0.mjs} +6 -6
- package/dist/{update-B-wcIl8T.mjs → update-DrT10fxQ.mjs} +6 -6
- package/dist/{update-B8jQTspb.mjs → update-_hHnM1Hx.mjs} +7 -8
- package/dist/{update-dashcard-C8QN2Qcu.mjs → update-dashcard-CDI0Tnxy.mjs} +7 -7
- package/dist/{update-BBLbEPEP.mjs → update-pXVhyiFo.mjs} +6 -6
- package/dist/{upgrade-BBOEVIRa.mjs → upgrade-Cfouv1Ii.mjs} +4 -4
- package/dist/upload-Cqv-In6j.mjs +13 -0
- package/dist/{upload-CoBd4qBp.mjs → upload-DIEcI5iM.mjs} +3 -3
- package/dist/{upload-CxpXpjCf.mjs → upload-DnLXgUA-.mjs} +3 -3
- package/dist/{uuid-DW30GY7B.mjs → uuid-D0sH5txV.mjs} +2 -2
- package/dist/{validate-n85yMraN.mjs → validate-BQ7vI8_x.mjs} +1 -1
- package/dist/{validate-query-BwXvFFYi.mjs → validate-query-YtH3d5BP.mjs} +7 -3
- package/dist/{values-B6eFE4K5.mjs → values-BFPO6y5o.mjs} +5 -5
- package/dist/{verify-DnU-wXIs.mjs → verify-7fW020r_.mjs} +3 -3
- package/dist/{verify-BSq7x66g.mjs → verify-C-StvB4f.mjs} +5 -5
- package/dist/{verify-Dp8tUbP3.mjs → verify-CuGs0X3C.mjs} +5 -5
- package/dist/{verify-flags-CMpRkMPa.mjs → verify-flags-DEVMB9w0.mjs} +1 -1
- package/dist/{wait-D6Tw4ZxO.mjs → wait-Cvt8xO0h.mjs} +6 -6
- package/dist/{wait-flags-BRUzMI6S.mjs → wait-flags-BnZ-dfE2.mjs} +2 -2
- package/dist/{window-BqMFpWMh.mjs → window-CfK_j6m1.mjs} +1 -1
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +11 -5
- package/skill-data/data-action/SKILL.md +136 -0
- package/skill-data/git-sync/SKILL.md +3 -3
- package/skill-data/native-sql/SKILL.md +1 -1
- package/skill-data/transform/SKILL.md +64 -2
- package/skill-data/transform-test-plan/SKILL.md +82 -0
- package/skill-data/transform-test-plan/references/checklist.md +32 -0
- package/skill-data/transform-test-plan/references/checks.md +156 -0
- package/dist/card-Buc-X4Mh.mjs +0 -25
- package/dist/collection-D-sS0AFw.mjs +0 -21
- package/dist/dashboard-DH_soSQp.mjs +0 -35
- package/dist/db-C82M3Gpg.mjs +0 -24
- package/dist/dependency-CLznxtLE.mjs +0 -15
- package/dist/document-WhSEyI-3.mjs +0 -20
- package/dist/embedding-i-KqpefC.mjs +0 -9
- package/dist/field-qF1KRJYB.mjs +0 -21
- package/dist/git-sync-BlgB_-8-.mjs +0 -29
- package/dist/glossary-BvVxqjxJ.mjs +0 -14
- package/dist/input-sRdxNc3T.mjs +0 -61
- package/dist/list-BoVeF8QA.mjs +0 -38
- package/dist/snippet-B7Kau5U8.mjs +0 -19
- package/dist/table-qjgz2eek.mjs +0 -26
- package/dist/timeline-CNkrY3e3.mjs +0 -21
- package/dist/transform-Y86R7_2F.mjs +0 -28
- package/dist/transform-job-Cg_1jzWI.mjs +0 -22
- package/dist/upload-fcim1xtK.mjs +0 -13
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Dt as PartialWriteError, Ft as isNonInterruptFailure, Mt as errorMessage, Nt as formatZodIssue, Ot as ResponseShapeError, P as CapabilityError, Q as parseJsonOrPlain, St as ConfigError, W as HttpError, Y as isPlainObject, kt as TimeoutError, n as isMethodKey, r as methodRequirements, wt as InternalError } from "./cli.mjs";
|
|
2
2
|
import { n as Notification, r as NotificationCardPayload, t as CARD_PAYLOAD_TYPE } from "./notification-DaA4bBHW.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { n as
|
|
5
|
-
import { n as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { t as
|
|
3
|
+
import { V as profileFromProperties, tt as SessionProperties } from "./runtime-Cmes70jO.mjs";
|
|
4
|
+
import { n as featureFailures, r as supersedingFeature, t as checkFeatures } from "./requirement-check-sfmyH2PH.mjs";
|
|
5
|
+
import { n as createTransport } from "./transport-Ck4anhoc.mjs";
|
|
6
|
+
import { i as CardDetail, o as CardQueryResult, t as Card } from "./card-QR3zEu6E.mjs";
|
|
7
|
+
import { f as FieldWithDataSensitivity, g as fieldRemappedValueSchema, h as fieldDetailSchema, n as FieldBaseType, o as FieldSearchMatches, s as FieldSemanticType, u as FieldValues } from "./field-DoWQUl7V.mjs";
|
|
8
|
+
import { r as ModerationReviewCreateInput, t as ModerationReview } from "./moderation-review-Bf9bPNQI.mjs";
|
|
9
|
+
import { a as TemporalUnit, r as ParameterValues } from "./parameter-DvRQMKd2.mjs";
|
|
10
|
+
import { r as PivotExportFormat, t as DatasetQuery } from "./query-BKtMP5eH.mjs";
|
|
11
|
+
import { b as TableVisibilityType, p as TableQueryMetadata, s as TableDataLayerTier, t as Table, u as TableForeignKey, v as TableSelectors } from "./table-CF7zW9cI.mjs";
|
|
12
|
+
import { c as DatabaseWithSettings, t as Database } from "./database-CxykzTAA.mjs";
|
|
11
13
|
import { t as Snippet } from "./snippet-CyKAgIZl.mjs";
|
|
12
|
-
import { r as QueryMetadata, t as CompiledQuery } from "./dataset-
|
|
13
|
-
import { c as CollectionItem, m as CollectionTreeNode, r as Collection } from "./collection-
|
|
14
|
+
import { r as QueryMetadata, t as CompiledQuery } from "./dataset-DIQLAp2P.mjs";
|
|
15
|
+
import { c as CollectionItem, m as CollectionTreeNode, r as Collection } from "./collection-DNmFKALA.mjs";
|
|
14
16
|
import { t as ContentTranslationUploadResult } from "./content-translation-BrHOrmj9.mjs";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { t as
|
|
22
|
-
import {
|
|
17
|
+
import { o as DashboardDetail, r as DashboardCopy, t as Dashboard, u as Dashcard } from "./dashboard-Chjy5GKR.mjs";
|
|
18
|
+
import { a as DataActionExecuteResult, s as dataActionSchema } from "./data-action-DZxVB_hD.mjs";
|
|
19
|
+
import { r as pollUntil } from "./poll-CgtcJopL.mjs";
|
|
20
|
+
import { i as DependencyEntity, s as DependencyGraph, t as BreakingSource, u as DependencyNode } from "./dependency-CaC6XuTY.mjs";
|
|
21
|
+
import { t as Document } from "./document-UMG6me2P.mjs";
|
|
22
|
+
import { i as EidTranslateResult } from "./eid-translation-Ba92VOHe.mjs";
|
|
23
|
+
import { a as SyncExportPreflight, f as SyncTask, g as isSyncTaskTerminal, l as SyncRemoteChanges, n as SyncBranchCreated, r as SyncDirtyItem, t as RemoteSyncState, u as SyncSettingsUpdateResult } from "./git-sync-DP4wQFzm.mjs";
|
|
24
|
+
import { t as Glossary } from "./glossary-QN-hHfOT.mjs";
|
|
25
|
+
import { a as libraryWireSchema, i as LibraryPublishTablesInput, n as LibraryCollectionInfo, o as toLibrary } from "./library-DKIqzyUk.mjs";
|
|
23
26
|
import { t as Measure } from "./measure-CtfjqJFP.mjs";
|
|
24
|
-
import {
|
|
25
|
-
import { t as Pulse } from "./pulse-Dz0ocv0l.mjs";
|
|
27
|
+
import { t as Pulse } from "./pulse-CC81N2_0.mjs";
|
|
26
28
|
import { a as TransformDagTransform, d as TransformTarget, g as transformRowSchema, h as transformDetailSchema, i as TransformDagRunResult, l as TransformRunSummary, m as isTransformRunTerminal, o as TransformRun, p as isTransformRunFailed, u as TransformSourceTableEntry } from "./transform-DiW7bREn.mjs";
|
|
27
|
-
import { r as SearchResult } from "./search-
|
|
29
|
+
import { r as SearchResult } from "./search-1et9tv_s.mjs";
|
|
28
30
|
import { t as Segment } from "./segment-OsrbUDzw.mjs";
|
|
29
31
|
import { t as Setting } from "./setting-DTiLCW8g.mjs";
|
|
30
32
|
import { n as SetupResult } from "./setup-CO7QV-ao.mjs";
|
|
31
|
-
import { i as TimelineEvent, t as Timeline } from "./timeline-
|
|
32
|
-
import { c as transformJobSchema, n as TransformJobActiveResult, s as transformJobRunResultSchema } from "./transform-job-
|
|
33
|
+
import { i as TimelineEvent, t as Timeline } from "./timeline-DcsCXNUt.mjs";
|
|
34
|
+
import { c as transformJobSchema, n as TransformJobActiveResult, s as transformJobRunResultSchema } from "./transform-job-ClX8e5iO.mjs";
|
|
33
35
|
import { t as TransformTag } from "./transform-tag-CcElGp3C.mjs";
|
|
36
|
+
import { i as TransformTestRunResult, t as TransformTest } from "./transform-test-Bexa_K89.mjs";
|
|
34
37
|
import { t as UploadResult } from "./upload-DAtxBBms.mjs";
|
|
35
38
|
import { z } from "zod";
|
|
36
|
-
import { setTimeout } from "node:timers/promises";
|
|
37
39
|
//#region \0rolldown/runtime.js
|
|
38
40
|
var __defProp = Object.defineProperty;
|
|
39
41
|
var __exportAll = (all, no_symbols) => {
|
|
@@ -46,416 +48,6 @@ var __exportAll = (all, no_symbols) => {
|
|
|
46
48
|
return target;
|
|
47
49
|
};
|
|
48
50
|
//#endregion
|
|
49
|
-
//#region ../client/src/http/response-shape.ts
|
|
50
|
-
async function parseJsonResponse(text, schema, context) {
|
|
51
|
-
try {
|
|
52
|
-
return parseJson(text, schema, { source: context.url });
|
|
53
|
-
} catch (error) {
|
|
54
|
-
if (error instanceof ValidationError) throw ResponseShapeError.fromZodIssues({
|
|
55
|
-
kind: "zod",
|
|
56
|
-
method: context.method,
|
|
57
|
-
url: context.url,
|
|
58
|
-
status: context.status,
|
|
59
|
-
zodIssues: error.developerDetail.zodIssues,
|
|
60
|
-
serverTag: await context.getServerTag(),
|
|
61
|
-
serverSkew: context.serverSkew
|
|
62
|
-
});
|
|
63
|
-
throw error;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
//#endregion
|
|
67
|
-
//#region ../client/src/http/retry.ts
|
|
68
|
-
const BASE_DELAY_MS = 250;
|
|
69
|
-
const MAX_DELAY_MS = 8e3;
|
|
70
|
-
const MS_PER_SECOND = 1e3;
|
|
71
|
-
function backoffDelay({ attempt, retryAfterHeader }) {
|
|
72
|
-
const fromHeader = parseRetryAfter(retryAfterHeader);
|
|
73
|
-
if (fromHeader !== null) return fromHeader;
|
|
74
|
-
return Math.min(MAX_DELAY_MS, BASE_DELAY_MS * 2 ** attempt);
|
|
75
|
-
}
|
|
76
|
-
function parseRetryAfter(header) {
|
|
77
|
-
if (!header) return null;
|
|
78
|
-
const numeric = Number(header);
|
|
79
|
-
if (Number.isFinite(numeric) && numeric >= 0) return Math.round(numeric * MS_PER_SECOND);
|
|
80
|
-
const dateMs = Date.parse(header);
|
|
81
|
-
if (Number.isFinite(dateMs)) return Math.max(0, dateMs - Date.now());
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
function sleep(ms, signal) {
|
|
85
|
-
return setTimeout(ms, void 0, { signal });
|
|
86
|
-
}
|
|
87
|
-
async function runWithRetries(attempt, signal) {
|
|
88
|
-
let attemptIndex = 0;
|
|
89
|
-
while (true) {
|
|
90
|
-
const outcome = await attempt(attemptIndex);
|
|
91
|
-
if (outcome.kind === "success") return outcome.response;
|
|
92
|
-
await sleep(outcome.delayMs, signal);
|
|
93
|
-
attemptIndex += 1;
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
const DEFAULT_TIMEOUT_MS = 3e4;
|
|
97
|
-
const OCTET_STREAM_CONTENT_TYPE = "application/octet-stream";
|
|
98
|
-
const TEXT_CONTENT_TYPE_PREFIX = "text/";
|
|
99
|
-
const ERROR_BODY_BYTE_CAP = 64 * 1024;
|
|
100
|
-
const IDEMPOTENT_METHODS = /* @__PURE__ */ new Set([
|
|
101
|
-
"GET",
|
|
102
|
-
"HEAD",
|
|
103
|
-
"OPTIONS"
|
|
104
|
-
]);
|
|
105
|
-
function createTransport(config, options) {
|
|
106
|
-
const baseUrl = normalizeUrl(config.url);
|
|
107
|
-
assertCredentialHeaderSafe(config.credential);
|
|
108
|
-
const fetchImpl = options.fetchImpl ?? globalThis.fetch.bind(globalThis);
|
|
109
|
-
let inForce = options.server ?? null;
|
|
110
|
-
let newest = null;
|
|
111
|
-
let probesStarted = 0;
|
|
112
|
-
let applied = null;
|
|
113
|
-
const inFlight = /* @__PURE__ */ new Set();
|
|
114
|
-
const getServerTag = options.getServerTag ?? (async () => tagOf(inForce));
|
|
115
|
-
const refreshCredential = options.refreshCredential;
|
|
116
|
-
let credential = config.credential;
|
|
117
|
-
const knownSecrets = new Set(credentialSecrets(credential));
|
|
118
|
-
const redactionContext = { knownSecrets };
|
|
119
|
-
let refreshInFlight = null;
|
|
120
|
-
function tryRefreshCredential() {
|
|
121
|
-
const refresh = refreshCredential;
|
|
122
|
-
if (credential.kind !== "oauth" || refresh === void 0) return Promise.resolve(false);
|
|
123
|
-
refreshInFlight ??= refreshOnce(refresh).finally(() => {
|
|
124
|
-
refreshInFlight = null;
|
|
125
|
-
});
|
|
126
|
-
return refreshInFlight;
|
|
127
|
-
}
|
|
128
|
-
async function refreshOnce(refresh) {
|
|
129
|
-
const next = await refresh();
|
|
130
|
-
if (next === null) return false;
|
|
131
|
-
credential = next;
|
|
132
|
-
for (const secret of credentialSecrets(next)) knownSecrets.add(secret);
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
async function attemptOnce(prepared, attempt) {
|
|
136
|
-
const hasRetriesLeft = attempt < prepared.retries;
|
|
137
|
-
const timeoutSignal = AbortSignal.timeout(prepared.timeoutMs);
|
|
138
|
-
const combined = combineAborts(timeoutSignal, prepared.cancelSignal);
|
|
139
|
-
let response;
|
|
140
|
-
try {
|
|
141
|
-
response = await fetchImpl(prepared.url, {
|
|
142
|
-
method: prepared.method,
|
|
143
|
-
headers: prepared.headers,
|
|
144
|
-
body: prepared.body,
|
|
145
|
-
signal: combined
|
|
146
|
-
});
|
|
147
|
-
} catch (error) {
|
|
148
|
-
throwIfAborted(prepared.cancelSignal);
|
|
149
|
-
const isStaleSocketFirstTry = attempt === 0 && isConnectionClosed(error);
|
|
150
|
-
if (prepared.idempotent && (hasRetriesLeft || isStaleSocketFirstTry)) return {
|
|
151
|
-
kind: "retry",
|
|
152
|
-
delayMs: backoffDelay({ attempt })
|
|
153
|
-
};
|
|
154
|
-
if (timeoutSignal.aborted) throw new TimeoutError(`Request timed out after ${prepared.timeoutMs}ms`, {
|
|
155
|
-
kind: "http",
|
|
156
|
-
method: prepared.method,
|
|
157
|
-
url: prepared.url,
|
|
158
|
-
timeoutMs: prepared.timeoutMs
|
|
159
|
-
});
|
|
160
|
-
throw buildNetworkError(error, prepared.method, prepared.url);
|
|
161
|
-
}
|
|
162
|
-
const canRetryStatus = hasRetriesLeft && prepared.idempotent;
|
|
163
|
-
if (!response.ok && isRetryableStatus(response.status) && canRetryStatus) {
|
|
164
|
-
const retryAfter = response.headers.get("Retry-After");
|
|
165
|
-
response.body?.cancel().catch(() => void 0);
|
|
166
|
-
return {
|
|
167
|
-
kind: "retry",
|
|
168
|
-
delayMs: backoffDelay({
|
|
169
|
-
attempt,
|
|
170
|
-
retryAfterHeader: retryAfter
|
|
171
|
-
})
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
if (!response.ok) {
|
|
175
|
-
const rawBody = await readBodyForError(response);
|
|
176
|
-
const serverTag = await getServerTag();
|
|
177
|
-
throw new HttpError({
|
|
178
|
-
status: response.status,
|
|
179
|
-
statusText: response.statusText,
|
|
180
|
-
method: prepared.method,
|
|
181
|
-
url: prepared.url,
|
|
182
|
-
responseHeaders: response.headers,
|
|
183
|
-
rawBody,
|
|
184
|
-
serverTag,
|
|
185
|
-
redactionContext
|
|
186
|
-
});
|
|
187
|
-
}
|
|
188
|
-
assertContentType(response, prepared);
|
|
189
|
-
return {
|
|
190
|
-
kind: "success",
|
|
191
|
-
response
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
async function executeRaw(prepared) {
|
|
195
|
-
try {
|
|
196
|
-
return await runWithRetries((attempt) => attemptOnce(prepared, attempt), prepared.cancelSignal);
|
|
197
|
-
} catch (error) {
|
|
198
|
-
throwIfAborted(prepared.cancelSignal);
|
|
199
|
-
throw error;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
async function executeWithAuthRefresh(path, opts) {
|
|
203
|
-
const prepared = prepare(path, opts);
|
|
204
|
-
try {
|
|
205
|
-
return {
|
|
206
|
-
response: await executeRaw(prepared),
|
|
207
|
-
prepared
|
|
208
|
-
};
|
|
209
|
-
} catch (error) {
|
|
210
|
-
if (error instanceof HttpError && error.status === 401) {
|
|
211
|
-
if (await tryRefreshCredential()) {
|
|
212
|
-
const retried = prepare(path, opts);
|
|
213
|
-
return {
|
|
214
|
-
response: await executeRaw(retried),
|
|
215
|
-
prepared: retried
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
throw error;
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
function prepare(path, opts = {}) {
|
|
223
|
-
const method = opts.method ?? "GET";
|
|
224
|
-
const expectContentType = opts.expectContentType ?? "json";
|
|
225
|
-
const url = buildUrl(baseUrl, path, opts.query);
|
|
226
|
-
const headers = new Headers();
|
|
227
|
-
const auth = credentialAuthHeader(credential);
|
|
228
|
-
headers.set(auth.name, auth.value);
|
|
229
|
-
headers.set("accept", acceptHeader(expectContentType));
|
|
230
|
-
headers.set("user-agent", options.userAgent);
|
|
231
|
-
let body = null;
|
|
232
|
-
if (opts.body !== void 0 && opts.body !== null) if (typeof opts.body === "string" || opts.body instanceof URLSearchParams) body = opts.body;
|
|
233
|
-
else if (opts.body instanceof FormData || opts.body instanceof ReadableStream) body = opts.body;
|
|
234
|
-
else if (opts.body instanceof Uint8Array) {
|
|
235
|
-
body = opts.body;
|
|
236
|
-
headers.set("content-type", OCTET_STREAM_CONTENT_TYPE);
|
|
237
|
-
} else {
|
|
238
|
-
body = JSON.stringify(opts.body);
|
|
239
|
-
headers.set("content-type", JSON_CONTENT_TYPE);
|
|
240
|
-
}
|
|
241
|
-
return {
|
|
242
|
-
url,
|
|
243
|
-
method,
|
|
244
|
-
headers,
|
|
245
|
-
body,
|
|
246
|
-
expectContentType,
|
|
247
|
-
retries: opts.retries ?? 3,
|
|
248
|
-
idempotent: opts.idempotent ?? IDEMPOTENT_METHODS.has(method),
|
|
249
|
-
timeoutMs: opts.timeoutMs ?? DEFAULT_TIMEOUT_MS,
|
|
250
|
-
cancelSignal: combineAborts(opts.signal, options.signal)
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
async function readJson(path, opts = {}) {
|
|
254
|
-
const chosenFor = inForce;
|
|
255
|
-
const { response, prepared } = await executeWithAuthRefresh(path, {
|
|
256
|
-
...opts,
|
|
257
|
-
expectContentType: "json"
|
|
258
|
-
});
|
|
259
|
-
return {
|
|
260
|
-
text: await response.text(),
|
|
261
|
-
context: {
|
|
262
|
-
method: prepared.method,
|
|
263
|
-
url: prepared.url,
|
|
264
|
-
status: response.status,
|
|
265
|
-
...namingOf(chosenFor)
|
|
266
|
-
}
|
|
267
|
-
};
|
|
268
|
-
}
|
|
269
|
-
function namingOf(profile) {
|
|
270
|
-
if (profile === null) return {
|
|
271
|
-
getServerTag,
|
|
272
|
-
serverSkew: null
|
|
273
|
-
};
|
|
274
|
-
return {
|
|
275
|
-
getServerTag: async () => profile.version.tag,
|
|
276
|
-
serverSkew: profile.skew
|
|
277
|
-
};
|
|
278
|
-
}
|
|
279
|
-
async function runProbe(order, budget) {
|
|
280
|
-
const read = await readJson(PROBE_PATH, probeBudget(budget));
|
|
281
|
-
const properties = await parseJsonResponse(read.text, SessionProperties, read.context);
|
|
282
|
-
const info = serverInfoFromProperties(properties);
|
|
283
|
-
const profile = createServerProfile(info);
|
|
284
|
-
if (applied === null || applied.order < order) {
|
|
285
|
-
options.onServerProbed?.(info, profile);
|
|
286
|
-
applied = {
|
|
287
|
-
order,
|
|
288
|
-
profile
|
|
289
|
-
};
|
|
290
|
-
inForce = profile;
|
|
291
|
-
}
|
|
292
|
-
return {
|
|
293
|
-
properties,
|
|
294
|
-
profile,
|
|
295
|
-
read
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
function startProbe(budget) {
|
|
299
|
-
probesStarted += 1;
|
|
300
|
-
const probed = runProbe(probesStarted, budget);
|
|
301
|
-
newest = probed;
|
|
302
|
-
inFlight.add(probed);
|
|
303
|
-
probed.then(() => {
|
|
304
|
-
inFlight.delete(probed);
|
|
305
|
-
}, () => {
|
|
306
|
-
inFlight.delete(probed);
|
|
307
|
-
if (newest === probed) newest = null;
|
|
308
|
-
});
|
|
309
|
-
return probed;
|
|
310
|
-
}
|
|
311
|
-
function appliedProfile() {
|
|
312
|
-
return applied === null ? null : applied.profile;
|
|
313
|
-
}
|
|
314
|
-
function verifying() {
|
|
315
|
-
const settled = appliedProfile();
|
|
316
|
-
if (newest === null && settled !== null) return Promise.resolve(settled);
|
|
317
|
-
return (newest ?? startProbe({})).then((probed) => probed.profile, fallBackTo(appliedProfile));
|
|
318
|
-
}
|
|
319
|
-
function profileInForce() {
|
|
320
|
-
const current = inForce;
|
|
321
|
-
if (current === null) return verifying();
|
|
322
|
-
if (newest === null) return Promise.resolve(current);
|
|
323
|
-
return newest.then((probed) => probed.profile, fallBackTo(() => inForce));
|
|
324
|
-
}
|
|
325
|
-
async function server(wait = {}) {
|
|
326
|
-
throwIfAborted(wait.signal);
|
|
327
|
-
return untilAborted(profileInForce(), wait.signal);
|
|
328
|
-
}
|
|
329
|
-
async function verifiedServer(wait = {}) {
|
|
330
|
-
throwIfAborted(wait.signal);
|
|
331
|
-
return untilAborted(verifying(), wait.signal);
|
|
332
|
-
}
|
|
333
|
-
async function probe(reader, read = {}) {
|
|
334
|
-
const { signal, ...budget } = read;
|
|
335
|
-
throwIfAborted(signal);
|
|
336
|
-
const probed = await untilAborted(startProbe(budget), signal);
|
|
337
|
-
const context = {
|
|
338
|
-
...probed.read.context,
|
|
339
|
-
...namingOf(probed.profile)
|
|
340
|
-
};
|
|
341
|
-
return parseJsonResponse(probed.read.text, reader, context);
|
|
342
|
-
}
|
|
343
|
-
async function probesSettled() {
|
|
344
|
-
while (inFlight.size > 0) await Promise.allSettled(inFlight);
|
|
345
|
-
}
|
|
346
|
-
async function requireFeatures(features, wait = {}) {
|
|
347
|
-
if (features.length === 0) return;
|
|
348
|
-
const profile = await preflightServer(wait);
|
|
349
|
-
if (profile === null) return;
|
|
350
|
-
for (const failure of featureFailures(features, profile)) refuseBeforeSending(new CapabilityError(failure));
|
|
351
|
-
}
|
|
352
|
-
async function preflightServer(wait = {}) {
|
|
353
|
-
try {
|
|
354
|
-
return await verifiedServer(wait);
|
|
355
|
-
} catch (error) {
|
|
356
|
-
if (!isNonInterruptFailure(error)) throw error;
|
|
357
|
-
skipOrThrow({
|
|
358
|
-
kind: "unverified",
|
|
359
|
-
failure: error
|
|
360
|
-
});
|
|
361
|
-
return null;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function refuseBeforeSending(refusal) {
|
|
365
|
-
skipOrThrow({
|
|
366
|
-
kind: "refused",
|
|
367
|
-
refusal
|
|
368
|
-
});
|
|
369
|
-
}
|
|
370
|
-
function skipOrThrow(skipped) {
|
|
371
|
-
const hook = options.onPreflightSkipped;
|
|
372
|
-
if (hook === void 0) throw skippedError(skipped);
|
|
373
|
-
hook(skipped);
|
|
374
|
-
}
|
|
375
|
-
return {
|
|
376
|
-
server,
|
|
377
|
-
verifiedServer,
|
|
378
|
-
probe,
|
|
379
|
-
requireFeatures,
|
|
380
|
-
preflightServer,
|
|
381
|
-
refuseBeforeSending,
|
|
382
|
-
probesSettled,
|
|
383
|
-
async requestRaw(path, opts) {
|
|
384
|
-
return (await executeWithAuthRefresh(path, opts ?? {})).response;
|
|
385
|
-
},
|
|
386
|
-
async requestParsed(schema, path, opts) {
|
|
387
|
-
const read = await readJson(path, opts);
|
|
388
|
-
return parseJsonResponse(read.text, schema, read.context);
|
|
389
|
-
},
|
|
390
|
-
async requestStream(path, opts) {
|
|
391
|
-
const { response, prepared } = await executeWithAuthRefresh(path, {
|
|
392
|
-
...opts,
|
|
393
|
-
expectContentType: opts?.expectContentType ?? "binary"
|
|
394
|
-
});
|
|
395
|
-
if (!response.body) throw new NetworkError("Response had no body to stream", {
|
|
396
|
-
method: prepared.method,
|
|
397
|
-
url: prepared.url,
|
|
398
|
-
cause: "missing body"
|
|
399
|
-
});
|
|
400
|
-
return response.body;
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
}
|
|
404
|
-
function skippedError(skipped) {
|
|
405
|
-
return skipped.kind === "refused" ? skipped.refusal : skipped.failure;
|
|
406
|
-
}
|
|
407
|
-
function fallBackTo(fallback) {
|
|
408
|
-
return (error) => {
|
|
409
|
-
const profile = fallback();
|
|
410
|
-
if (profile !== null && isNonInterruptFailure(error)) return profile;
|
|
411
|
-
throw error;
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
function tagOf(profile) {
|
|
415
|
-
return profile === null ? null : profile.version.tag;
|
|
416
|
-
}
|
|
417
|
-
function buildUrl(baseUrl, path, query) {
|
|
418
|
-
const normalizedPath = path.startsWith("/") ? path : `/${path}`;
|
|
419
|
-
const target = new URL(baseUrl + normalizedPath);
|
|
420
|
-
if (query) for (const [key, value] of Object.entries(query)) {
|
|
421
|
-
if (value === void 0) continue;
|
|
422
|
-
if (Array.isArray(value)) for (const entry of value) target.searchParams.append(key, String(entry));
|
|
423
|
-
else target.searchParams.append(key, String(value));
|
|
424
|
-
}
|
|
425
|
-
return target.toString();
|
|
426
|
-
}
|
|
427
|
-
function acceptHeader(expected) {
|
|
428
|
-
if (expected === "json") return JSON_CONTENT_TYPE;
|
|
429
|
-
if (expected === "text") return "text/*";
|
|
430
|
-
return "*/*";
|
|
431
|
-
}
|
|
432
|
-
function assertContentType(response, prepared) {
|
|
433
|
-
if (prepared.expectContentType === "binary") return;
|
|
434
|
-
const contentType = response.headers.get("content-type");
|
|
435
|
-
if (contentType === null) throwContentTypeMismatch(response, prepared, prepared.expectContentType);
|
|
436
|
-
if (prepared.expectContentType === "json" && !contentType.includes("application/json")) throwContentTypeMismatch(response, prepared, "json");
|
|
437
|
-
if (prepared.expectContentType === "text" && !contentType.startsWith(TEXT_CONTENT_TYPE_PREFIX)) throwContentTypeMismatch(response, prepared, "text");
|
|
438
|
-
}
|
|
439
|
-
function throwContentTypeMismatch(response, prepared, expected) {
|
|
440
|
-
const actual = response.headers.get("content-type") ?? "no content-type";
|
|
441
|
-
throw new HttpError({
|
|
442
|
-
status: response.status,
|
|
443
|
-
statusText: response.statusText,
|
|
444
|
-
method: prepared.method,
|
|
445
|
-
url: prepared.url,
|
|
446
|
-
responseHeaders: response.headers,
|
|
447
|
-
rawBody: null,
|
|
448
|
-
overrideUserMessage: `Expected ${expected} response but got ${actual}`
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
|
-
async function readBodyForError(response) {
|
|
452
|
-
try {
|
|
453
|
-
return Buffer.from(await response.arrayBuffer()).subarray(0, ERROR_BODY_BYTE_CAP).toString("utf8");
|
|
454
|
-
} catch (error) {
|
|
455
|
-
return `[body read failed: ${errorMessage(error)}]`;
|
|
456
|
-
}
|
|
457
|
-
}
|
|
458
|
-
//#endregion
|
|
459
51
|
//#region ../client/src/resources/pivot-export.ts
|
|
460
52
|
const PivotedExportsProperty = SessionProperties.extend({ "enable-pivoted-exports": z.boolean() });
|
|
461
53
|
/**
|
|
@@ -485,11 +77,11 @@ function cardResource(transport) {
|
|
|
485
77
|
}
|
|
486
78
|
/** Get one card by id. */
|
|
487
79
|
async function get(id, options = {}) {
|
|
488
|
-
return transport.requestParsed(
|
|
80
|
+
return transport.requestParsed(CardDetail, `/api/card/${id}`, { ...options });
|
|
489
81
|
}
|
|
490
82
|
/** Create a card — a question, a model, or a metric — from a full card body. */
|
|
491
83
|
async function create(params, options = {}) {
|
|
492
|
-
return transport.requestParsed(
|
|
84
|
+
return transport.requestParsed(CardDetail, "/api/card", {
|
|
493
85
|
...options,
|
|
494
86
|
method: "POST",
|
|
495
87
|
body: params
|
|
@@ -497,7 +89,7 @@ function cardResource(transport) {
|
|
|
497
89
|
}
|
|
498
90
|
/** Update a card by id, patching only the fields the body carries. */
|
|
499
91
|
async function update(id, params, options = {}) {
|
|
500
|
-
return transport.requestParsed(
|
|
92
|
+
return transport.requestParsed(CardDetail, `/api/card/${id}`, {
|
|
501
93
|
...options,
|
|
502
94
|
method: "PUT",
|
|
503
95
|
body: params
|
|
@@ -507,12 +99,20 @@ function cardResource(transport) {
|
|
|
507
99
|
async function archive(id, options = {}) {
|
|
508
100
|
return update(id, { archived: true }, options);
|
|
509
101
|
}
|
|
510
|
-
/**
|
|
102
|
+
/**
|
|
103
|
+
* Run the query associated with a Card and return the query result envelope. A result served
|
|
104
|
+
* from the cache carries the time it was computed in `cached`; `ignore_cache` runs the query
|
|
105
|
+
* against the database instead. The rows stop at the server's row limit for an API run, which
|
|
106
|
+
* `rows_truncated` carries when it cut them; `exportQuery` runs under the larger download limit.
|
|
107
|
+
*/
|
|
511
108
|
async function query(id, params, options = {}) {
|
|
512
109
|
return transport.requestParsed(CardQueryResult, `/api/card/${id}/query`, {
|
|
513
110
|
...options,
|
|
514
111
|
method: "POST",
|
|
515
|
-
body: {
|
|
112
|
+
body: {
|
|
113
|
+
parameters: params.parameters,
|
|
114
|
+
ignore_cache: params.ignore_cache
|
|
115
|
+
}
|
|
516
116
|
});
|
|
517
117
|
}
|
|
518
118
|
/**
|
|
@@ -625,13 +225,17 @@ async function listCollectionsAs(transport, schema, options = {}) {
|
|
|
625
225
|
function collectionResource(transport) {
|
|
626
226
|
/**
|
|
627
227
|
* List collections. `filter` picks a server-side preset: everything, archived, or personal. Every
|
|
628
|
-
* preset includes the Library collections that match it.
|
|
228
|
+
* preset includes the Library collections that match it. `namespace` lists that namespace's
|
|
229
|
+
* collections, with its root, instead of the default namespace's.
|
|
629
230
|
*/
|
|
630
231
|
async function list(params = {}, options = {}) {
|
|
631
232
|
return {
|
|
632
233
|
data: await transport.requestParsed(CollectionApiList, "/api/collection", {
|
|
633
234
|
...options,
|
|
634
|
-
query:
|
|
235
|
+
query: {
|
|
236
|
+
...COLLECTION_LIST_QUERY[params.filter ?? DEFAULT_LIST_FILTER],
|
|
237
|
+
namespace: params.namespace
|
|
238
|
+
}
|
|
635
239
|
}),
|
|
636
240
|
total: null
|
|
637
241
|
};
|
|
@@ -887,15 +491,26 @@ function dashboardResource(transport) {
|
|
|
887
491
|
}
|
|
888
492
|
/**
|
|
889
493
|
* Update a dashboard by id, patching only the fields the body carries. `dashcards` and `tabs` are
|
|
890
|
-
* full replacements: whatever the
|
|
494
|
+
* full replacements: whatever the arrays omit is deleted from the dashboard. A body with
|
|
495
|
+
* `dashcards` and no `tabs` key keeps the current tabs, read first: the server takes the missing
|
|
496
|
+
* key for an empty list and deletes every tab, or fails on a dashcard that still names one.
|
|
891
497
|
*/
|
|
892
498
|
async function update(id, params, options = {}) {
|
|
499
|
+
const body = await withCurrentTabs(id, params, options);
|
|
893
500
|
return transport.requestParsed(DashboardDetail, `/api/dashboard/${id}`, {
|
|
894
501
|
...options,
|
|
895
502
|
method: "PUT",
|
|
896
|
-
body
|
|
503
|
+
body
|
|
897
504
|
});
|
|
898
505
|
}
|
|
506
|
+
async function withCurrentTabs(id, params, options) {
|
|
507
|
+
if (params.dashcards === void 0 || params.tabs !== void 0) return params;
|
|
508
|
+
const current = await get(id, options);
|
|
509
|
+
return {
|
|
510
|
+
...params,
|
|
511
|
+
tabs: tabWrites(current.tabs)
|
|
512
|
+
};
|
|
513
|
+
}
|
|
899
514
|
/**
|
|
900
515
|
* Copy a dashboard, with its tabs and dashcards, into `collection_id` (root when absent). A deep
|
|
901
516
|
* copy duplicates its questions and metrics and references its models. With `is_deep_copy`
|
|
@@ -928,7 +543,7 @@ function dashboardResource(transport) {
|
|
|
928
543
|
/**
|
|
929
544
|
* Patch one dashcard on a dashboard. Metabase exposes no dashcard endpoint and its dashboard PUT
|
|
930
545
|
* is a full replace of `dashcards`, so the patch is read-modify-written over the dashboard as it
|
|
931
|
-
* currently stands.
|
|
546
|
+
* currently stands, its tabs sent back unchanged.
|
|
932
547
|
*/
|
|
933
548
|
async function updateDashcard(dashboardId, dashcardId, params, options = {}) {
|
|
934
549
|
const dashboard = await get(dashboardId, options);
|
|
@@ -938,7 +553,10 @@ function dashboardResource(transport) {
|
|
|
938
553
|
...target,
|
|
939
554
|
...params
|
|
940
555
|
});
|
|
941
|
-
const refreshed = (await update(dashboardId, {
|
|
556
|
+
const refreshed = (await update(dashboardId, {
|
|
557
|
+
dashcards: dashboard.dashcards.map((dashcard) => stripEntityId(dashcard.id === dashcardId ? patched : dashcard)),
|
|
558
|
+
tabs: tabWrites(dashboard.tabs)
|
|
559
|
+
}, options)).dashcards.find((dashcard) => dashcard.id === dashcardId);
|
|
942
560
|
if (refreshed === void 0) throw new Error(`PUT /api/dashboard/${dashboardId}: dashcard ${dashcardId} missing from response`);
|
|
943
561
|
return refreshed;
|
|
944
562
|
}
|
|
@@ -977,17 +595,26 @@ function dashboardResource(transport) {
|
|
|
977
595
|
}
|
|
978
596
|
/**
|
|
979
597
|
* Fetch the selectable values for a dashboard parameter, through the chain-filter value endpoint.
|
|
598
|
+
* `constraints` sets other parameters' values, which narrow the values of a parameter linked to
|
|
599
|
+
* them.
|
|
980
600
|
*/
|
|
981
|
-
async function parameterValues(dashboardId, parameterId, options = {}) {
|
|
982
|
-
return transport.requestParsed(ParameterValues, `/api/dashboard/${dashboardId}/params/${encodeURIComponent(parameterId)}/values`, {
|
|
601
|
+
async function parameterValues(dashboardId, parameterId, constraints = {}, options = {}) {
|
|
602
|
+
return transport.requestParsed(ParameterValues, `/api/dashboard/${dashboardId}/params/${encodeURIComponent(parameterId)}/values`, {
|
|
603
|
+
...options,
|
|
604
|
+
query: constraints
|
|
605
|
+
});
|
|
983
606
|
}
|
|
984
607
|
/**
|
|
985
608
|
* Search a dashboard parameter's selectable values: the server returns only values containing the
|
|
986
|
-
* substring, capped at the first 1000 matches.
|
|
609
|
+
* substring, capped at the first 1000 matches. `constraints` narrows them as `parameterValues`
|
|
610
|
+
* does.
|
|
987
611
|
*/
|
|
988
|
-
async function searchParameterValues(dashboardId, parameterId, query, options = {}) {
|
|
612
|
+
async function searchParameterValues(dashboardId, parameterId, query, constraints = {}, options = {}) {
|
|
989
613
|
const parameter = encodeURIComponent(parameterId);
|
|
990
|
-
return transport.requestParsed(ParameterValues, `/api/dashboard/${dashboardId}/params/${parameter}/search/${encodeURIComponent(query)}`, {
|
|
614
|
+
return transport.requestParsed(ParameterValues, `/api/dashboard/${dashboardId}/params/${parameter}/search/${encodeURIComponent(query)}`, {
|
|
615
|
+
...options,
|
|
616
|
+
query: constraints
|
|
617
|
+
});
|
|
991
618
|
}
|
|
992
619
|
return {
|
|
993
620
|
list,
|
|
@@ -1025,6 +652,12 @@ function groupByCardId(references) {
|
|
|
1025
652
|
}
|
|
1026
653
|
return grouped;
|
|
1027
654
|
}
|
|
655
|
+
function tabWrites(tabs) {
|
|
656
|
+
return tabs.map(({ id, name }) => ({
|
|
657
|
+
id,
|
|
658
|
+
name
|
|
659
|
+
}));
|
|
660
|
+
}
|
|
1028
661
|
function stripEntityId(dashcard) {
|
|
1029
662
|
const { entity_id: _entity_id, id, size_x, size_y, row, col, ...rest } = dashcard;
|
|
1030
663
|
return {
|
|
@@ -1037,6 +670,81 @@ function stripEntityId(dashcard) {
|
|
|
1037
670
|
};
|
|
1038
671
|
}
|
|
1039
672
|
//#endregion
|
|
673
|
+
//#region ../client/src/resources/data-action.ts
|
|
674
|
+
function collectionFeatures(params) {
|
|
675
|
+
return params.collection_id === void 0 ? [] : [{
|
|
676
|
+
feature: "dataActionCollections",
|
|
677
|
+
fields: ["collection_id"]
|
|
678
|
+
}];
|
|
679
|
+
}
|
|
680
|
+
function dataActionResource(transport) {
|
|
681
|
+
const { explain } = explainer(transport, "dataAction");
|
|
682
|
+
async function readSchema(options) {
|
|
683
|
+
const { features } = await transport.server(options);
|
|
684
|
+
return dataActionSchema(features);
|
|
685
|
+
}
|
|
686
|
+
/** List the unarchived data actions the caller can see. `GET /api/action` answers a bare array. */
|
|
687
|
+
async function list(options = {}) {
|
|
688
|
+
const schema = await readSchema(options);
|
|
689
|
+
return {
|
|
690
|
+
data: await transport.requestParsed(z.array(schema), "/api/action", { ...options }),
|
|
691
|
+
total: null
|
|
692
|
+
};
|
|
693
|
+
}
|
|
694
|
+
/** Get one unarchived data action by id. */
|
|
695
|
+
async function get(id, options = {}) {
|
|
696
|
+
const schema = await readSchema(options);
|
|
697
|
+
return transport.requestParsed(schema, `/api/action/${id}`, { ...options });
|
|
698
|
+
}
|
|
699
|
+
/** Create a data action — a parameterized native query that writes to a database — in a collection. */
|
|
700
|
+
async function create(params, options = {}) {
|
|
701
|
+
const schema = await readSchema(options);
|
|
702
|
+
return transport.requestParsed(schema, "/api/action", {
|
|
703
|
+
...options,
|
|
704
|
+
method: "POST",
|
|
705
|
+
body: params
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
/** Update a data action by id, patching only the fields the body carries. */
|
|
709
|
+
async function update(id, params, options = {}) {
|
|
710
|
+
const schema = await readSchema(options);
|
|
711
|
+
return transport.requestParsed(schema, `/api/action/${id}`, {
|
|
712
|
+
...options,
|
|
713
|
+
method: "PUT",
|
|
714
|
+
body: params
|
|
715
|
+
});
|
|
716
|
+
}
|
|
717
|
+
/** Archive (soft-delete) a data action by id. Metabase models this as an update, not its own endpoint. */
|
|
718
|
+
async function archive(id, options = {}) {
|
|
719
|
+
return update(id, { archived: true }, options);
|
|
720
|
+
}
|
|
721
|
+
/** Delete a data action by id, removing it and the dashboard buttons that run it. */
|
|
722
|
+
async function remove(id, options = {}) {
|
|
723
|
+
await transport.requestRaw(`/api/action/${id}`, {
|
|
724
|
+
...options,
|
|
725
|
+
method: "DELETE",
|
|
726
|
+
expectContentType: "binary"
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
/** Execute a data action by id with parameter values keyed by parameter id. */
|
|
730
|
+
async function execute(id, params, options = {}) {
|
|
731
|
+
return transport.requestParsed(DataActionExecuteResult, `/api/action/${id}/execute`, {
|
|
732
|
+
...options,
|
|
733
|
+
method: "POST",
|
|
734
|
+
body: params
|
|
735
|
+
});
|
|
736
|
+
}
|
|
737
|
+
return {
|
|
738
|
+
list,
|
|
739
|
+
get,
|
|
740
|
+
create: explain("create", create),
|
|
741
|
+
update: explain("update", update, (_id, params) => collectionFeatures(params)),
|
|
742
|
+
archive,
|
|
743
|
+
delete: remove,
|
|
744
|
+
execute
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
//#endregion
|
|
1040
748
|
//#region ../client/src/resources/database.ts
|
|
1041
749
|
const DatabaseApiList = z.object({
|
|
1042
750
|
data: z.array(Database),
|
|
@@ -1068,6 +776,14 @@ function databaseResource(transport) {
|
|
|
1068
776
|
query: { include: params.include }
|
|
1069
777
|
});
|
|
1070
778
|
}
|
|
779
|
+
/** Update a database's settings by id; the server merges them into the ones it holds. */
|
|
780
|
+
async function update(id, params, options = {}) {
|
|
781
|
+
return transport.requestParsed(DatabaseWithSettings, `/api/database/${id}`, {
|
|
782
|
+
...options,
|
|
783
|
+
method: "PUT",
|
|
784
|
+
body: params
|
|
785
|
+
});
|
|
786
|
+
}
|
|
1071
787
|
/** List the schema names in a database. */
|
|
1072
788
|
async function schemas(id, options = {}) {
|
|
1073
789
|
return {
|
|
@@ -1119,6 +835,7 @@ function databaseResource(transport) {
|
|
|
1119
835
|
return {
|
|
1120
836
|
list,
|
|
1121
837
|
get,
|
|
838
|
+
update,
|
|
1122
839
|
schemas,
|
|
1123
840
|
schemaTables,
|
|
1124
841
|
syncSchema,
|
|
@@ -1618,6 +1335,11 @@ const RemoteSyncBranchProperty = SessionProperties.extend({ "remote-sync-branch"
|
|
|
1618
1335
|
const RemoteSyncUrlProperty = SessionProperties.extend({ "remote-sync-url": z.string().nullable().optional() });
|
|
1619
1336
|
const BRANCH_UNREADABLE_MESSAGE = "the remote-sync-branch setting is not readable: only admins see it, and a server without remote sync has none";
|
|
1620
1337
|
const BRANCH_UNSET_MESSAGE = "git-sync tracks no branch: the remote-sync-branch setting is unset";
|
|
1338
|
+
const RemoteSyncStateProperty = RemoteSyncBranchProperty.extend({
|
|
1339
|
+
"remote-sync-enabled": z.boolean().optional(),
|
|
1340
|
+
"remote-sync-type": RemoteSyncState.shape.sync_type.optional()
|
|
1341
|
+
});
|
|
1342
|
+
const REMOTE_SYNC_STATE_ABSENT_MESSAGE = "the remote-sync-enabled and remote-sync-type settings are absent: the server has no remote-sync module";
|
|
1621
1343
|
function isRemoteUnreadable(error) {
|
|
1622
1344
|
if (!(error instanceof HttpError)) return false;
|
|
1623
1345
|
return error.status === 403 || error.status === 404;
|
|
@@ -1734,13 +1456,14 @@ function gitSyncResource(transport) {
|
|
|
1734
1456
|
merge: params.merge
|
|
1735
1457
|
}
|
|
1736
1458
|
});
|
|
1737
|
-
|
|
1459
|
+
const accepted = {
|
|
1738
1460
|
message: started.message,
|
|
1739
|
-
task_id: started.task_id
|
|
1461
|
+
task_id: started.task_id,
|
|
1462
|
+
branch: branchName ?? null
|
|
1740
1463
|
};
|
|
1464
|
+
if (params.wait === void 0) return accepted;
|
|
1741
1465
|
return {
|
|
1742
|
-
|
|
1743
|
-
task_id: started.task_id,
|
|
1466
|
+
...accepted,
|
|
1744
1467
|
final: await settle(params.wait, options)
|
|
1745
1468
|
};
|
|
1746
1469
|
}
|
|
@@ -1860,6 +1583,24 @@ function gitSyncResource(transport) {
|
|
|
1860
1583
|
return tracked;
|
|
1861
1584
|
}
|
|
1862
1585
|
/**
|
|
1586
|
+
* Whether a remote is configured, through the settings or the environment, the direction the
|
|
1587
|
+
* instance syncs in, which is `read-only` until an admin sets it, and the branch it tracks, all
|
|
1588
|
+
* from one read. The remote's URL is visible to admins only and absent when the environment sets
|
|
1589
|
+
* it, so `configured` is read from its own setting. Refused like `branch` when the caller may not
|
|
1590
|
+
* read the branch, and on a server without the remote-sync module.
|
|
1591
|
+
*/
|
|
1592
|
+
function remote(properties) {
|
|
1593
|
+
const tracked = branch(properties);
|
|
1594
|
+
const configured = properties["remote-sync-enabled"];
|
|
1595
|
+
const syncType = properties["remote-sync-type"];
|
|
1596
|
+
if (configured === void 0 || syncType === void 0) throw new ConfigError(REMOTE_SYNC_STATE_ABSENT_MESSAGE);
|
|
1597
|
+
return {
|
|
1598
|
+
configured,
|
|
1599
|
+
sync_type: syncType,
|
|
1600
|
+
branch: tracked
|
|
1601
|
+
};
|
|
1602
|
+
}
|
|
1603
|
+
/**
|
|
1863
1604
|
* The branch git-sync tracks, refused when none is configured, the server has no remote sync, or
|
|
1864
1605
|
* the caller may not read it.
|
|
1865
1606
|
*/
|
|
@@ -1897,6 +1638,7 @@ function gitSyncResource(transport) {
|
|
|
1897
1638
|
syncedCollections: refuse("syncedCollections", syncedCollections),
|
|
1898
1639
|
remoteUrl,
|
|
1899
1640
|
branch: refuseAfterReading("branch", RemoteSyncBranchProperty, branch),
|
|
1641
|
+
remote: refuseAfterReading("remote", RemoteSyncStateProperty, remote),
|
|
1900
1642
|
trackedBranch: refuseAfterReading("trackedBranch", RemoteSyncBranchProperty, trackedBranch),
|
|
1901
1643
|
waitForTask: explain("waitForTask", waitForTask)
|
|
1902
1644
|
};
|
|
@@ -2708,7 +2450,8 @@ const RevisionEntity = z.enum([
|
|
|
2708
2450
|
"document",
|
|
2709
2451
|
"measure",
|
|
2710
2452
|
"segment",
|
|
2711
|
-
"transform"
|
|
2453
|
+
"transform",
|
|
2454
|
+
"transform-test"
|
|
2712
2455
|
]);
|
|
2713
2456
|
const RevisionUser = z.object({
|
|
2714
2457
|
id: z.number().int(),
|
|
@@ -2772,7 +2515,8 @@ const RevisionApiRevert = z.union([Revision.transform((revision) => ({
|
|
|
2772
2515
|
}))]);
|
|
2773
2516
|
const ENTITY_FEATURES = {
|
|
2774
2517
|
measure: "measures",
|
|
2775
|
-
transform: "transforms"
|
|
2518
|
+
transform: "transforms",
|
|
2519
|
+
"transform-test": "transformTests"
|
|
2776
2520
|
};
|
|
2777
2521
|
function entityFeatures(entity) {
|
|
2778
2522
|
const feature = ENTITY_FEATURES[entity];
|
|
@@ -4060,167 +3804,6 @@ function transformTagResource(transport) {
|
|
|
4060
3804
|
};
|
|
4061
3805
|
}
|
|
4062
3806
|
//#endregion
|
|
4063
|
-
//#region ../client/src/domain/transform-test.ts
|
|
4064
|
-
const TransformTestTable = z.object({
|
|
4065
|
-
schema: z.string().min(1).nullable().optional(),
|
|
4066
|
-
name: z.string().min(1)
|
|
4067
|
-
}).loose();
|
|
4068
|
-
const TransformTestColumn = z.object({
|
|
4069
|
-
name: z.string().min(1),
|
|
4070
|
-
cast_type: z.string().min(1)
|
|
4071
|
-
}).loose();
|
|
4072
|
-
const TransformTestCell = z.union([
|
|
4073
|
-
z.boolean(),
|
|
4074
|
-
z.number(),
|
|
4075
|
-
z.string(),
|
|
4076
|
-
z.null()
|
|
4077
|
-
]);
|
|
4078
|
-
const TransformTestRow = z.record(z.string(), TransformTestCell);
|
|
4079
|
-
const TransformTestSqlInput = z.object({
|
|
4080
|
-
table: TransformTestTable,
|
|
4081
|
-
format: z.literal("sql"),
|
|
4082
|
-
sql: z.string().min(1)
|
|
4083
|
-
}).loose();
|
|
4084
|
-
const TransformTestRowsInput = z.object({
|
|
4085
|
-
table: TransformTestTable,
|
|
4086
|
-
format: z.literal("rows"),
|
|
4087
|
-
columns: z.array(TransformTestColumn).min(1),
|
|
4088
|
-
rows: z.array(TransformTestRow)
|
|
4089
|
-
}).loose();
|
|
4090
|
-
const TransformTestInput = z.discriminatedUnion("format", [TransformTestSqlInput, TransformTestRowsInput]);
|
|
4091
|
-
const TransformTestEqualsSqlExpectation = z.object({
|
|
4092
|
-
type: z.literal("equals"),
|
|
4093
|
-
name: z.string().min(1),
|
|
4094
|
-
format: z.literal("sql"),
|
|
4095
|
-
sql: z.string().min(1)
|
|
4096
|
-
}).loose();
|
|
4097
|
-
const TransformTestEqualsRowsExpectation = z.object({
|
|
4098
|
-
type: z.literal("equals"),
|
|
4099
|
-
name: z.string().min(1),
|
|
4100
|
-
format: z.literal("rows"),
|
|
4101
|
-
columns: z.array(TransformTestColumn).min(1),
|
|
4102
|
-
rows: z.array(TransformTestRow)
|
|
4103
|
-
}).loose();
|
|
4104
|
-
const TransformTestEqualsExpectation = z.discriminatedUnion("format", [TransformTestEqualsSqlExpectation, TransformTestEqualsRowsExpectation]);
|
|
4105
|
-
const TransformTestEmptyExpectation = z.object({
|
|
4106
|
-
type: z.literal("empty"),
|
|
4107
|
-
name: z.string().min(1),
|
|
4108
|
-
sql: z.string().min(1)
|
|
4109
|
-
}).loose();
|
|
4110
|
-
const TransformTestExpectation = z.discriminatedUnion("type", [TransformTestEqualsExpectation, TransformTestEmptyExpectation]);
|
|
4111
|
-
const TransformTest = z.object({
|
|
4112
|
-
id: z.number().int(),
|
|
4113
|
-
entity_id: z.string(),
|
|
4114
|
-
transform_id: z.number().int(),
|
|
4115
|
-
creator_id: z.number().int(),
|
|
4116
|
-
name: z.string(),
|
|
4117
|
-
description: z.string().nullable(),
|
|
4118
|
-
inputs: z.array(TransformTestInput),
|
|
4119
|
-
expectations: z.array(TransformTestExpectation),
|
|
4120
|
-
created_at: z.string(),
|
|
4121
|
-
updated_at: z.string()
|
|
4122
|
-
}).loose();
|
|
4123
|
-
TransformTest.pick({
|
|
4124
|
-
id: true,
|
|
4125
|
-
transform_id: true,
|
|
4126
|
-
name: true,
|
|
4127
|
-
description: true
|
|
4128
|
-
}).strip();
|
|
4129
|
-
z.object({
|
|
4130
|
-
transform_id: z.number().int().positive(),
|
|
4131
|
-
name: z.string().min(1),
|
|
4132
|
-
description: z.string().nullable().optional(),
|
|
4133
|
-
inputs: z.array(TransformTestInput),
|
|
4134
|
-
expectations: z.array(TransformTestExpectation)
|
|
4135
|
-
}).loose();
|
|
4136
|
-
z.object({
|
|
4137
|
-
transform_id: z.number().int().positive().optional(),
|
|
4138
|
-
name: z.string().min(1).optional(),
|
|
4139
|
-
description: z.string().nullable().optional(),
|
|
4140
|
-
inputs: z.array(TransformTestInput).optional(),
|
|
4141
|
-
expectations: z.array(TransformTestExpectation).optional()
|
|
4142
|
-
}).loose();
|
|
4143
|
-
const TransformTestResultColumn = z.object({
|
|
4144
|
-
name: z.string(),
|
|
4145
|
-
database_type: z.string()
|
|
4146
|
-
}).loose();
|
|
4147
|
-
const TransformTestExpectationError = z.object({
|
|
4148
|
-
type: z.string(),
|
|
4149
|
-
message: z.string()
|
|
4150
|
-
}).loose();
|
|
4151
|
-
const TransformTestCellMismatch = z.object({
|
|
4152
|
-
column: z.string(),
|
|
4153
|
-
expected: TransformTestCell,
|
|
4154
|
-
actual: TransformTestCell
|
|
4155
|
-
}).loose();
|
|
4156
|
-
const TransformTestRowCounts = z.object({
|
|
4157
|
-
actual: z.number().int(),
|
|
4158
|
-
expected: z.number().int()
|
|
4159
|
-
}).loose();
|
|
4160
|
-
const TransformTestEqualsFindings = z.object({
|
|
4161
|
-
name: z.string(),
|
|
4162
|
-
type: z.literal("equals"),
|
|
4163
|
-
status: z.enum(["passed", "failed"]),
|
|
4164
|
-
columns: z.array(TransformTestResultColumn),
|
|
4165
|
-
"row-counts": TransformTestRowCounts,
|
|
4166
|
-
"extra-rows": z.array(TransformTestRow),
|
|
4167
|
-
"missing-rows": z.array(TransformTestRow),
|
|
4168
|
-
"cell-mismatches": z.array(TransformTestCellMismatch),
|
|
4169
|
-
truncated: z.number().int()
|
|
4170
|
-
}).loose();
|
|
4171
|
-
const TransformTestEqualsError = z.object({
|
|
4172
|
-
name: z.string(),
|
|
4173
|
-
type: z.literal("equals"),
|
|
4174
|
-
status: z.literal("error"),
|
|
4175
|
-
error: TransformTestExpectationError
|
|
4176
|
-
}).loose();
|
|
4177
|
-
const TransformTestEqualsResult = z.discriminatedUnion("status", [TransformTestEqualsFindings, TransformTestEqualsError]);
|
|
4178
|
-
const TransformTestEmptyPassed = z.object({
|
|
4179
|
-
name: z.string(),
|
|
4180
|
-
type: z.literal("empty"),
|
|
4181
|
-
status: z.literal("passed")
|
|
4182
|
-
}).loose();
|
|
4183
|
-
const TransformTestEmptyFailed = z.object({
|
|
4184
|
-
name: z.string(),
|
|
4185
|
-
type: z.literal("empty"),
|
|
4186
|
-
status: z.literal("failed"),
|
|
4187
|
-
columns: z.array(TransformTestResultColumn),
|
|
4188
|
-
sample: z.array(TransformTestRow),
|
|
4189
|
-
truncated: z.number().int()
|
|
4190
|
-
}).loose();
|
|
4191
|
-
const TransformTestEmptyError = z.object({
|
|
4192
|
-
name: z.string(),
|
|
4193
|
-
type: z.literal("empty"),
|
|
4194
|
-
status: z.literal("error"),
|
|
4195
|
-
error: TransformTestExpectationError
|
|
4196
|
-
}).loose();
|
|
4197
|
-
const TransformTestEmptyResult = z.discriminatedUnion("status", [
|
|
4198
|
-
TransformTestEmptyPassed,
|
|
4199
|
-
TransformTestEmptyFailed,
|
|
4200
|
-
TransformTestEmptyError
|
|
4201
|
-
]);
|
|
4202
|
-
const TransformTestExpectationResult = z.discriminatedUnion("type", [TransformTestEqualsResult, TransformTestEmptyResult]);
|
|
4203
|
-
const TransformTestRunResult = z.object({
|
|
4204
|
-
status: z.enum(["passed", "failed"]),
|
|
4205
|
-
expectations: z.array(TransformTestExpectationResult),
|
|
4206
|
-
tables: z.record(z.string(), z.string())
|
|
4207
|
-
}).loose();
|
|
4208
|
-
z.enum([
|
|
4209
|
-
"transform-test.unknown-column",
|
|
4210
|
-
"transform-test.ambiguous-column",
|
|
4211
|
-
"transform-test.missing-inputs",
|
|
4212
|
-
"transform-test.unused-inputs",
|
|
4213
|
-
"transform-test.duplicate-input-table",
|
|
4214
|
-
"transform-test.unparseable-source",
|
|
4215
|
-
"transform-test.unremapped-reference",
|
|
4216
|
-
"transform-test.unsupported-transform",
|
|
4217
|
-
"transform-test.unsupported-driver",
|
|
4218
|
-
"transform-test.transform-failed",
|
|
4219
|
-
"transform-test.setup-failed",
|
|
4220
|
-
"transform-test.expectation-failed",
|
|
4221
|
-
"transform-test.unsupported-format"
|
|
4222
|
-
]);
|
|
4223
|
-
//#endregion
|
|
4224
3807
|
//#region ../client/src/resources/transform-test.ts
|
|
4225
3808
|
const TransformTestApiList = z.array(TransformTest);
|
|
4226
3809
|
function transformTestResource(transport) {
|
|
@@ -4368,6 +3951,7 @@ function createClient(config, options) {
|
|
|
4368
3951
|
collection: collectionResource(transport),
|
|
4369
3952
|
contentTranslation: contentTranslationResource(transport),
|
|
4370
3953
|
dashboard: dashboardResource(transport),
|
|
3954
|
+
dataAction: dataActionResource(transport),
|
|
4371
3955
|
database: databaseResource(transport),
|
|
4372
3956
|
dataset: datasetResource(transport),
|
|
4373
3957
|
dependency: dependencyResource(transport),
|