@metabase/cli 0.5.17 → 0.5.18-alpha.feat-client-metadata-sync.62991f3
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-C7MKpQ_s.mjs → add-collection-Doz6PLRH.mjs} +5 -5
- package/dist/{alert-5KJl2LGw.mjs → alert-KXCBQPec.mjs} +7 -7
- package/dist/{alerts-VdBqaRBN.mjs → alerts-IRJ8Bs4f.mjs} +4 -4
- package/dist/api-key-DwO3gJVG.mjs +13 -0
- package/dist/{append-CKR_78Hr.mjs → append-BOaxY3KO.mjs} +4 -4
- package/dist/{archive-BaNVn1zm.mjs → archive-AWp23053.mjs} +5 -5
- package/dist/{archive-C_t5LBQX.mjs → archive-BByEUxxf.mjs} +3 -3
- package/dist/{archive-b2ZdURU-.mjs → archive-BOxAT6AC.mjs} +3 -3
- package/dist/{archive-BuGuzMOF.mjs → archive-Bluuyn_Z.mjs} +3 -3
- package/dist/{archive-fxJhlFeE.mjs → archive-CFeW8_Rg.mjs} +5 -5
- package/dist/{archive-hBsJNt9B.mjs → archive-CR7f_0zD.mjs} +5 -5
- package/dist/{archive-Lv8i5kbZ.mjs → archive-Cwj84MfH.mjs} +3 -3
- package/dist/{archive-BO1Lhbhj.mjs → archive-DEvmGuyO.mjs} +3 -3
- package/dist/{archive-yzyLfcKv.mjs → archive-DKlVwGEZ.mjs} +3 -3
- package/dist/{archive-DMGJ8d64.mjs → archive-Dk5KLoVp.mjs} +3 -3
- package/dist/{archive-PyBRVjY2.mjs → archive-m-RJDTpD.mjs} +3 -3
- package/dist/{archive-A-q9e46B.mjs → archive-nSlbpXP1.mjs} +3 -3
- package/dist/{auth-zQZU0h1l.mjs → auth-CHfMrcwa.mjs} +5 -5
- package/dist/{branch-flag-ClXFjNvx.mjs → branch-flag-kZkAZcPJ.mjs} +1 -1
- package/dist/{branches-BNuxljRy.mjs → branches-CLvL_FiU.mjs} +2 -2
- package/dist/{breaking-B2p2TbDM.mjs → breaking-Bg3r03p7.mjs} +5 -5
- package/dist/{broken-DhnT5VzF.mjs → broken-g3-Q_xdj.mjs} +7 -7
- package/dist/{bulk-discard-values-KzDA_90h.mjs → bulk-discard-values-DjOjvHrC.mjs} +4 -4
- package/dist/{bulk-edit-BlnQtpvj.mjs → bulk-edit-v2AXm4th.mjs} +3 -3
- package/dist/{bulk-rescan-values-D9JN-CFA.mjs → bulk-rescan-values-h9jHle8d.mjs} +3 -3
- package/dist/{bulk-sync-schema-k_J9jizj.mjs → bulk-sync-schema-BJ8eKbDD.mjs} +3 -3
- package/dist/{cancel-hoChHxqA.mjs → cancel-BJW1b1dQ.mjs} +3 -3
- package/dist/{cancel-task-GA9Szh_n.mjs → cancel-task-BSsXIuk5.mjs} +4 -4
- package/dist/card-CTcJ_LgJ.mjs +25 -0
- package/dist/{cards-e5n3QAov.mjs → cards-BdMeVR2l.mjs} +5 -5
- package/dist/{ci-D8Q5uinJ.mjs → ci-CCOLa8t6.mjs} +2 -2
- package/dist/cli.mjs +287 -143
- package/dist/{client-CjR4yUXv.mjs → client-R2arAHr6.mjs} +719 -53
- package/dist/{collection-UBLWQLeo.mjs → collection-875u7UiH.mjs} +11 -2
- package/dist/collection-BoW0udvl.mjs +21 -0
- package/dist/{collection-T1vdKXLp.mjs → collection-CcagB_dn.mjs} +1 -1
- package/dist/{collection-namespace-D5df5a3W.mjs → collection-namespace-BHGpFZ3M.mjs} +2 -2
- package/dist/{content-translation-DGVLulsm.mjs → content-translation-daNV6kg_.mjs} +3 -3
- package/dist/{copy-D5Xwxf8O.mjs → copy-B7hI6eEN.mjs} +6 -6
- package/dist/{copy-flags-4FH-1Kli.mjs → copy-flags-Dqt64LEy.mjs} +2 -2
- package/dist/{copy-BXIL7wYk.mjs → copy-gwGJ_cUf.mjs} +6 -6
- package/dist/{create-BNXNJK2B.mjs → create-3Q9RNSbB.mjs} +5 -5
- package/dist/{create-heJR0nJH.mjs → create-B1T7TFyI.mjs} +4 -4
- package/dist/{create-se8RRWKu.mjs → create-B76IZr9s.mjs} +2 -2
- package/dist/{create-BYln360V.mjs → create-BEFc-O32.mjs} +3 -3
- package/dist/{create-B27Y2Agn.mjs → create-BEfNv4Zk.mjs} +2 -2
- package/dist/{create-DEkqfDmi.mjs → create-Bk7P-Yvj.mjs} +2 -2
- package/dist/{create-045KXNCm.mjs → create-BqlMVJec.mjs} +3 -3
- package/dist/{create-BE5VOx07.mjs → create-C4ShLNVR.mjs} +4 -4
- package/dist/{create-DU8dvDn6.mjs → create-CPWSr9G8.mjs} +2 -2
- package/dist/{create-BjhYTFJK.mjs → create-D7S_3xBQ.mjs} +2 -2
- package/dist/{create-CYVv0RkU.mjs → create-D8JTA7Le.mjs} +3 -3
- package/dist/{create-CfZWHNIu.mjs → create-DIJbmtVz.mjs} +2 -2
- package/dist/{create-BB2ZM7fL.mjs → create-DS333bp7.mjs} +2 -2
- package/dist/{create-LRsr3Uhf.mjs → create-DU1_aqM7.mjs} +5 -5
- package/dist/{create-C3cxBLip.mjs → create-DWyXT1EG.mjs} +5 -5
- package/dist/{create-BbnQQMIq.mjs → create-DrkPIVT_.mjs} +3 -3
- package/dist/{create-Cq0fW-no.mjs → create-DsoRQiay.mjs} +2 -2
- package/dist/{create-CYQD_XGH.mjs → create-Dyy8tlwX.mjs} +2 -2
- package/dist/{create-CMTpjoqJ2.mjs → create-EWOrQZPK2.mjs} +4 -4
- package/dist/{create-branch-BuXhvXjm.mjs → create-branch-DTWUrXt3.mjs} +5 -5
- package/dist/{csv-qx4IBp-p.mjs → csv-CoFZAUyP.mjs} +4 -4
- package/dist/{current-task-q6-QEL9Q.mjs → current-task-BliWyqRF.mjs} +4 -4
- package/dist/{dashboard-BpgLh8jq.mjs → dashboard-CLvvUUuF.mjs} +1 -1
- package/dist/{dashboard-CYgXhTBr.mjs → dashboard-D5BJZS3L.mjs} +1 -1
- package/dist/dashboard-k8J-xTya.mjs +35 -0
- package/dist/data-action-BnMNuKXF.mjs +24 -0
- package/dist/{data-app-B0t_SbO4.mjs → data-app-BPXbRiCS.mjs} +9 -9
- package/dist/{data-app-project-BMwuM3sR.mjs → data-app-project-iHL0cw4l.mjs} +4 -4
- package/dist/{database-C5ucihp3.mjs → database-BSETP2o-.mjs} +9 -2
- package/dist/{database-u_spHEa0.mjs → database-CCUXiXH_.mjs} +1 -1
- package/dist/{dataset-LJxNN6p5.mjs → dataset-a7Q_ocDR.mjs} +1 -1
- package/dist/{db-DTFpgPBk.mjs → db-B6CsAcGO.mjs} +8 -8
- package/dist/{delete-DjSFVFV7.mjs → delete-0KysyosT.mjs} +4 -4
- package/dist/{delete-Bw-UTJI7.mjs → delete-B0TejNG6.mjs} +4 -4
- package/dist/{delete-DVCNhz5n.mjs → delete-B63B0rxQ.mjs} +4 -4
- package/dist/{delete-BSlCKzBz.mjs → delete-BriGYfKX.mjs} +4 -4
- package/dist/{delete-CEqsZehc.mjs → delete-CSyFTd4O.mjs} +4 -4
- package/dist/{delete-gIdO570b.mjs → delete-Cg9p34Yn.mjs} +4 -4
- package/dist/{delete-Ct_dN7dm.mjs → delete-LjyoDT6v.mjs} +4 -4
- package/dist/{delete-Dmqrn_0-.mjs → delete-PsBn88HY.mjs} +4 -4
- package/dist/{delete-runtime-DL_-4ffZ.mjs → delete-runtime-Cxw6w3Jg.mjs} +1 -1
- package/dist/{delete-table-BhhP3-_p.mjs → delete-table-BEIEST8c.mjs} +4 -4
- package/dist/{delete-DMZCewEx.mjs → delete-yd9PVA42.mjs} +4 -4
- package/dist/{dependencies-DR_Bckq3.mjs → dependencies-C02UtWit.mjs} +3 -3
- package/dist/{dependency-MDyiJVQD.mjs → dependency-00_O1kxU.mjs} +1 -1
- package/dist/{dependency-DipNC15K.mjs → dependency-C4b_A3_L.mjs} +1 -1
- package/dist/dependency-OJt6j8Rz.mjs +15 -0
- package/dist/{dependents-DTa2DZ0A.mjs → dependents-Qw95Lz7J.mjs} +8 -8
- package/dist/{dirty-Dm1ZYpS7.mjs → dirty-Dl8l5Mnu.mjs} +4 -4
- package/dist/{discard-values-DRp7IqaQ.mjs → discard-values-CKJygmD3.mjs} +4 -4
- package/dist/document-CQZu5_6u.mjs +20 -0
- package/dist/{document-BcmSU5nG.mjs → document-PQg8DshK.mjs} +1 -1
- package/dist/{document-Bt-UgIBR.mjs → document-ks1uxhBt.mjs} +1 -1
- package/dist/{download-B5QADTKg.mjs → download-RZGQ0A_4.mjs} +2 -2
- package/dist/{eid-CEQZn7Ru.mjs → eid-DoSokRfL.mjs} +3 -3
- package/dist/{embedding-sdk-DioW9wdh.mjs → embedding-sdk-CPTZWbYX.mjs} +2 -2
- package/dist/{entity-CrmOaQ4E.mjs → entity-DBcuKQtX.mjs} +2 -2
- package/dist/{entry-flags-COaiQvXt.mjs → entry-flags-BUH3oq0_.mjs} +3 -3
- package/dist/{events-B4KDnJnZ.mjs → events-CqWx6kBk.mjs} +3 -3
- package/dist/{execute-B_grmyLF.mjs → execute-DCm75Gqp.mjs} +3 -3
- package/dist/{export-flags-eZeWPfeZ.mjs → export-flags-BbmWODey.mjs} +2 -2
- package/dist/{export-V1W9sn5C.mjs → export-j3vseqNf.mjs} +8 -8
- package/dist/{export-preflight-B2tvCt3v.mjs → export-preflight-CqQsoC7D.mjs} +5 -5
- package/dist/field-948ZmNyj.mjs +21 -0
- package/dist/{fields-R5D83pgR.mjs → fields-C2WLR9MI.mjs} +3 -3
- package/dist/{filter-flags-DjUePmM2.mjs → filter-flags-_Ettwj6g.mjs} +3 -3
- package/dist/{fks-B5VpYMev.mjs → fks-D6GyKGkJ.mjs} +3 -3
- package/dist/{generate-actions-O49UqjD3.mjs → generate-actions-DMohJdAR.mjs} +4 -4
- package/dist/{generate-queries-CCxaX_ce.mjs → generate-queries-BiAWtnNs.mjs} +4 -4
- package/dist/{generate-schema-Cbzw8S8T.mjs → generate-schema-bwXvJxoS.mjs} +4 -4
- package/dist/{get-BL7E_E2I.mjs → get-BXOsrbcJ.mjs} +5 -5
- package/dist/{get-C2g5h7yv.mjs → get-B_HF1fHz.mjs} +3 -3
- package/dist/{get-J019yh0K.mjs → get-BmB1rqbP.mjs} +3 -3
- package/dist/{get-CiHEY6YW.mjs → get-BsoZT5pD.mjs} +5 -5
- package/dist/{get-D-xmiRx5.mjs → get-Bzjyouf4.mjs} +3 -3
- package/dist/{get-D1EPFO5_.mjs → get-C1alPE6n.mjs} +3 -3
- package/dist/{get-DXjWWEWG.mjs → get-Ck-puGo7.mjs} +3 -3
- package/dist/{get-DTH_ZiwE.mjs → get-CpnKcGtI.mjs} +10 -5
- package/dist/{get-CPRkpfky.mjs → get-Cw6X-P3f.mjs} +5 -5
- package/dist/{get-DrCrl-ZN.mjs → get-CwFh-1_4.mjs} +5 -5
- package/dist/{get-H3X0ASHs.mjs → get-D2vxwt2k.mjs} +4 -4
- package/dist/{get-C7LFdtZL.mjs → get-DFxYnuY6.mjs} +3 -3
- package/dist/{get-BIX5uHft.mjs → get-DKM1Mjnv.mjs} +3 -3
- package/dist/{get-r_UoDqgf.mjs → get-DOsJ5lp5.mjs} +3 -3
- package/dist/{get-BsptQrzr.mjs → get-D_pWd9vx.mjs} +3 -3
- package/dist/{get-DWYhIlSs.mjs → get-DjN2OViL.mjs} +3 -3
- package/dist/{get-DqKsf4N-.mjs → get-DkAxTwr8.mjs} +3 -3
- package/dist/{get-Cib9UKz1.mjs → get-Dxa_nUE1.mjs} +3 -3
- package/dist/{get-BpGJSf8d.mjs → get-ES76HUol.mjs} +3 -3
- package/dist/{get-Dmxkihcr.mjs → get-N_Wg4ldh.mjs} +3 -3
- package/dist/{get-B_gS_XuD.mjs → get-kWurOLei.mjs} +3 -3
- package/dist/{get-Cd0QEjSh.mjs → get-lPjKko1Q.mjs} +3 -3
- package/dist/{get-run-BvzAhPi0.mjs → get-run-DhsmP0M6.mjs} +3 -3
- package/dist/{git-sync-D1aKczo6.mjs → git-sync-C0yHY3bG.mjs} +1 -1
- package/dist/git-sync-CfDVrtF4.mjs +399 -0
- package/dist/git-sync-DcLtMt7N.mjs +29 -0
- package/dist/glossary-BsgGg0tt.mjs +14 -0
- package/dist/{glossary-B1jwt25B.mjs → glossary-CnSPXHAd.mjs} +1 -1
- package/dist/{glossary--NSqIGy5.mjs → glossary-z3Nvbo2P.mjs} +1 -1
- package/dist/{graph-BOLRH-lU.mjs → graph-BVZozlPV.mjs} +6 -6
- package/dist/{group-DxaqX3Gg.mjs → group-DgqrMOKr.mjs} +1 -1
- package/dist/{has-remote-changes-CTrRo6EC.mjs → has-remote-changes-8aIYOtVz.mjs} +4 -4
- package/dist/{import-CsIkDnWQ.mjs → import-Bw9dpjTW.mjs} +8 -8
- package/dist/{is-dirty-CUToDpA1.mjs → is-dirty-C0-cuqId.mjs} +2 -2
- package/dist/{items-D9kxySKc.mjs → items-BiDYYKJl.mjs} +5 -5
- package/dist/{key-BPgr-uOm.mjs → key-DoqP1glp.mjs} +1 -1
- package/dist/{library-D2iGUx8x.mjs → library-B3gEYmUY.mjs} +5 -5
- package/dist/{library-9_e7RoW3.mjs → library-DlJjXXJT.mjs} +1 -1
- package/dist/{library-DpX_-UCK.mjs → library-DrbHqj17.mjs} +1 -1
- package/dist/{list-zImE-jdb.mjs → list-2fl3drTC.mjs} +2 -2
- package/dist/{list-C1X5JuzO.mjs → list-4dUPjyxu.mjs} +4 -4
- package/dist/{list-BIsh7CS4.mjs → list-7Aj5tI5u.mjs} +2 -2
- package/dist/{list-Y9W9n4rh.mjs → list-9nZjLEIs.mjs} +2 -2
- package/dist/{list-Bg-NYdYo.mjs → list-B1RWs_PU.mjs} +5 -5
- package/dist/{list-D76iHfwo.mjs → list-B27aC0K3.mjs} +5 -5
- package/dist/{list-YyWMvzzr.mjs → list-BHkfeSDZ.mjs} +4 -4
- package/dist/{list-gRSH0USz.mjs → list-BVEdcxMI.mjs} +2 -2
- package/dist/{list-ChATvCZv.mjs → list-CE86V6d7.mjs} +2 -2
- package/dist/{list-BSm3_is3.mjs → list-CI8ExOTr.mjs} +2 -2
- package/dist/{list-Cm0Qbs19.mjs → list-CKvwdWyA.mjs} +3 -3
- package/dist/{list-CRV4Fon9.mjs → list-CUVdAYLL.mjs} +2 -2
- package/dist/{list-CLK0ceIQ.mjs → list-CWmwMYdt.mjs} +2 -2
- package/dist/{list-CVq_OaRN.mjs → list-Ce9Rc88u.mjs} +2 -2
- package/dist/{list-nU9V7QAo.mjs → list-CqY1JdcJ.mjs} +2 -2
- package/dist/{list-D5FJ09yJ.mjs → list-Dhf1r1QA.mjs} +4 -4
- package/dist/{list-CYWzH6SZ.mjs → list-DpmjZh6O.mjs} +5 -5
- package/dist/{list-BmGs9ZA6.mjs → list-DpydX0Uj.mjs} +2 -2
- package/dist/{list-CzWbo_oA.mjs → list-DuMunh02.mjs} +2 -2
- package/dist/{list-DbLN30Iz.mjs → list-R5lP6AyK.mjs} +3 -3
- package/dist/{list-CLkY7s9r.mjs → list-Ul2HPe_m.mjs} +2 -2
- package/dist/{list-4Zir7Qa4.mjs → list-V9RzDHhV.mjs} +3 -3
- package/dist/{list-BAHaze-O.mjs → list-l7Vc9ygq.mjs} +3 -3
- package/dist/{login-8xVwIW-u.mjs → login-ZtnOTT3E.mjs} +6 -6
- package/dist/{logout-DxTMO924.mjs → logout-Rh-ziYoe.mjs} +3 -3
- package/dist/{measure-C4S2coO7.mjs → measure-D3BIENeY.mjs} +6 -6
- package/dist/{nano-id-C37LSdu-.mjs → nano-id-zMAia6PY.mjs} +3 -3
- package/dist/{parameter-values-C4lSrNn_.mjs → parameter-values-B2prOWpE.mjs} +5 -5
- package/dist/{parse-enum-Dh_pkHdD.mjs → parse-enum-Dm1BvZRN.mjs} +1 -1
- package/dist/{parse-id-DKKwr4c8.mjs → parse-id-uHxfeU_J.mjs} +1 -1
- package/dist/{parse-ref-01NRD9cO.mjs → parse-ref-CN-6HBFM.mjs} +1 -1
- package/dist/{parse-text-Bnmhu9uL.mjs → parse-text-C3VlFRgF.mjs} +1 -1
- package/dist/{path-BImEWndG.mjs → path-ClSZc9kq.mjs} +3 -3
- package/dist/poll-DZQmd1FY.mjs +73 -0
- package/dist/{predicates-RLoSqLcT.mjs → predicates-DQA0AsBx.mjs} +5 -1
- package/dist/{preflight-DxI4O7fK.mjs → preflight-CeXhEJfq.mjs} +3 -3
- package/dist/{process-BzhbQ7c6.mjs → process-DZcS6SKr.mjs} +1 -1
- package/dist/{publish-cJHKIiBC.mjs → publish-C88wsv8X.mjs} +5 -5
- package/dist/{query-VCxGhfTT.mjs → query-Dwbz3jIa.mjs} +8 -8
- package/dist/{query-BdyzoLZW.mjs → query-s4jHL2vO.mjs} +5 -5
- package/dist/{registry-flag-pFusSlf8.mjs → registry-flag-Cd9xHDG8.mjs} +3 -3
- package/dist/{remapping-D1Sa-xfO.mjs → remapping-DZrDEflG.mjs} +4 -4
- package/dist/{remove-collection-D-VC2Gw0.mjs → remove-collection-DkX956WQ.mjs} +5 -5
- package/dist/{render-Bmgfe3yb.mjs → render-DeextbV-.mjs} +2 -2
- package/dist/{replace-CEopwhIh.mjs → replace-BZq_g2N0.mjs} +4 -4
- package/dist/{requirement-check-B87F9671.mjs → requirement-check-C2UgVxhH.mjs} +10 -2
- package/dist/{rescan-values-CF-Dl6sN.mjs → rescan-values-B4PdHlFa.mjs} +3 -3
- package/dist/{rescan-values-DQDupjHI.mjs → rescan-values-D_GA2O5A.mjs} +5 -5
- package/dist/{run-DH72xxih.mjs → run-BG_0T7sd.mjs} +5 -5
- package/dist/{run-Bu7XLdUh.mjs → run-BMpyVzbj.mjs} +5 -5
- package/dist/{run-BAupv3WM.mjs → run-C8Bs9M59.mjs} +5 -5
- package/dist/{run-C3M2E0GK.mjs → run-DtiVvZs8.mjs} +3 -3
- package/dist/{runs-Sv7RD4Fq.mjs → runs-BtZd7MEt.mjs} +3 -3
- package/dist/{runtime-C604gE-r.mjs → runtime-DnT_GZj6.mjs} +68 -24
- package/dist/{scaffold-CmA20NoK.mjs → scaffold-BVdaXbAI.mjs} +7 -7
- package/dist/{schema-BWYgM6R4.mjs → schema-C_uv_vXv.mjs} +7 -7
- package/dist/{schema-tables-C9Sp4VWC.mjs → schema-tables-D5r7epWd.mjs} +3 -3
- package/dist/{schemas-Nk7rDuaw.mjs → schemas-BVvaNoDo.mjs} +3 -3
- package/dist/{sdk-version-Dk1-ILRc.mjs → sdk-version-DvJ3DbJv.mjs} +4 -4
- package/dist/{search-DYrl0gT0.mjs → search-Bey6E0ey.mjs} +5 -5
- package/dist/{search-b1w3LK09.mjs → search-OYNHHFVz.mjs} +5 -5
- package/dist/{segment-Bqtp0kFB.mjs → segment-DDher6hs.mjs} +6 -6
- package/dist/{send-ColF6-hL.mjs → send-CX6Uy9Jo.mjs} +3 -3
- package/dist/{set-DSXN4cLO.mjs → set-_Krhwwam.mjs} +3 -3
- package/dist/{set-active-BHCwRaZI.mjs → set-active-BgNHIC-K.mjs} +3 -3
- package/dist/{set-data-actions-B8QMEILh.mjs → set-data-actions-BMx-lvZg.mjs} +6 -6
- package/dist/{set-enabled-DgBE9cdW.mjs → set-enabled-yF4Wdb9w.mjs} +4 -4
- package/dist/{set-sensitivity-DZXMFyj1.mjs → set-sensitivity-B5yxGBSE.mjs} +4 -4
- package/dist/{setting-DdB-4mgj.mjs → setting-BnSt79in.mjs} +4 -4
- package/dist/{setup-8Kdv5hzG.mjs → setup-RR2vntYf.mjs} +2 -2
- package/dist/{skills-BVGZUFdg.mjs → skills-BmJKA9uZ.mjs} +4 -4
- package/dist/{skills-Gq6uSx2f.mjs → skills-RUaHyN6K.mjs} +3 -3
- package/dist/{slug-DciR6pKq.mjs → slug-DhT4O0Aa.mjs} +1 -1
- package/dist/snippet-COQDlcqA.mjs +19 -0
- package/dist/{stash-D7vPehrB.mjs → stash-HeuKiJRc.mjs} +7 -7
- package/dist/{status-BXv6DNe1.mjs → status-BXCtZluh.mjs} +3 -3
- package/dist/{status-MYpQhWUe.mjs → status-CVHLup7u.mjs} +5 -5
- package/dist/{subscription-BRGXG394.mjs → subscription-RUoqDWFg.mjs} +6 -6
- package/dist/{subscriptions-IGAziZPm.mjs → subscriptions-ll79tLnb.mjs} +4 -4
- package/dist/{summary-nrM5fHQ2.mjs → summary-CdnAvL_h.mjs} +3 -3
- package/dist/{sync-schema-Dz9wQd4G.mjs → sync-schema-COlp5kuP.mjs} +3 -3
- package/dist/{sync-schema-clOXGTeH.mjs → sync-schema-h3ONaYxj.mjs} +6 -6
- package/dist/{sync-task-Fo5vCyyW.mjs → sync-task-DPFDTvEe.mjs} +2 -2
- package/dist/table-CpryeXWm.mjs +26 -0
- package/dist/{table-selector-flags-D7rbRFD9.mjs → table-selector-flags-Cc2k6S0Z.mjs} +3 -3
- package/dist/{text-oFZn63P5.mjs → text-D1q1NlLJ.mjs} +1 -1
- package/dist/timeline-UvUcwMoj.mjs +21 -0
- package/dist/{timeline-event-zTlg0l93.mjs → timeline-event-BRvZjAEZ.mjs} +6 -6
- package/dist/transform-DJNByVrL.mjs +28 -0
- package/dist/transform-job-BmcWt0U9.mjs +22 -0
- package/dist/{transform-tag-BAACrCIl.mjs → transform-tag-B74RPJNJ.mjs} +5 -5
- package/dist/transform-test-D370AR0u.mjs +16 -0
- package/dist/{transforms-DJcALLGn.mjs → transforms-DVthwji8.mjs} +3 -3
- package/dist/{transport-DfIZveGA.mjs → transport-B9h9dznf.mjs} +118 -47
- package/dist/{tree-BJBeUJ9Y.mjs → tree-BTrA5iO3.mjs} +4 -4
- package/dist/{unpublish-DD84rHRH.mjs → unpublish-Bs7XK_hT.mjs} +3 -3
- package/dist/{unreferenced-TWCy-s5F.mjs → unreferenced-DvYxEkUg.mjs} +5 -5
- package/dist/{update-Bnak2DVK.mjs → update-2YyZln-M.mjs} +3 -3
- package/dist/{update-N-EjTy_6.mjs → update-AcnX00Mq.mjs} +4 -4
- package/dist/{update-BBkKvDBy.mjs → update-B3KC7vjf.mjs} +4 -4
- package/dist/{update-rBhrk13R.mjs → update-BLcSWwWy.mjs} +6 -6
- package/dist/{update-DZQ5ZEpV.mjs → update-BQtntlWV.mjs} +7 -7
- package/dist/{update-DBseT7BB.mjs → update-BrZAPNEP.mjs} +3 -3
- package/dist/{update-CFJR92_j2.mjs → update-C7aimtdU2.mjs} +3 -3
- package/dist/{update-BboO0IUv.mjs → update-CNzHKoxd.mjs} +3 -3
- package/dist/{update-JFFsF7kU.mjs → update-CU34-yKe.mjs} +3 -3
- package/dist/{update-GqB2gxF-.mjs → update-CXJ9X8tY.mjs} +3 -3
- package/dist/{update-De-fdx1H.mjs → update-Cx3O3DeP.mjs} +4 -4
- package/dist/{update-CuAoB110.mjs → update-DId8Ndo6.mjs} +6 -6
- package/dist/{update-COzu9X6G.mjs → update-DWUPWA2L.mjs} +3 -3
- package/dist/{update-Bu_yvXLE.mjs → update-DpBltpvj.mjs} +4 -4
- package/dist/{update-YH57RzrK.mjs → update-W-fwBlt_.mjs} +5 -5
- package/dist/{update-BhQa3TdY.mjs → update-c-kCEJ3y.mjs} +3 -3
- package/dist/{update-dashcard-DZtQUBVb.mjs → update-dashcard-CPdKAfVc.mjs} +5 -5
- package/dist/{update-B4DzHQ-j.mjs → update-rUWFU9M1.mjs} +3 -3
- package/dist/{update-ByN7IFld.mjs → update-tycBoZZw.mjs} +3 -3
- package/dist/{update-cvdd5OIM.mjs → update-vlwPkxCD.mjs} +5 -5
- package/dist/{upgrade-q-QAg5hL.mjs → upgrade-BRcOX0B3.mjs} +5 -5
- package/dist/{upload-CHzuTcgy.mjs → upload-BvPo6_ac.mjs} +2 -2
- package/dist/{upload-CSFjeAL6.mjs → upload-CUHHv2ra.mjs} +3 -3
- package/dist/upload-DfRSacr-.mjs +13 -0
- package/dist/{uuid-BNhr57o_.mjs → uuid-BZ7lmz8t.mjs} +3 -3
- package/dist/{validate-xmlIkST4.mjs → validate-CvcqIGsS.mjs} +1 -1
- package/dist/{validate-query-DuK8pUmu.mjs → validate-query-D1LLmD9e.mjs} +2 -2
- package/dist/{values-BB4cTLim.mjs → values-weHme-sq.mjs} +3 -3
- package/dist/{verify-C85vwjR-.mjs → verify-8edn9BHQ.mjs} +3 -3
- package/dist/{verify-DLn_hvyT.mjs → verify-BTA5ndic.mjs} +3 -3
- package/dist/{verify-mWoejtbQ.mjs → verify-CRE149Gu.mjs} +4 -4
- package/dist/{wait-jszi7SI3.mjs → wait-CgXeIPZ3.mjs} +6 -6
- package/dist/{wait-flags-BhjQdHSI.mjs → wait-flags-E45sKLtp.mjs} +2 -2
- package/dist/{yaml-CP5VvAqK.mjs → yaml-DKHMM0Qk.mjs} +1 -1
- package/package.json +1 -1
- package/skill-data/core/SKILL.md +4 -1
- package/skill-data/data-app/SKILL.md +13 -3
- package/skill-data/data-app-actions/SKILL.md +1 -1
- package/skill-data/data-app-data/SKILL.md +2 -2
- package/skill-data/data-app-migration/SKILL.md +131 -0
- package/skill-data/data-app-migration/references/change.md +9 -0
- package/skill-data/data-app-migration/references/checkpoints.md +50 -0
- package/skill-data/data-app-migration/references/connect.md +29 -0
- package/skill-data/data-app-migration/references/handoff.md +29 -0
- package/skill-data/data-app-migration/references/mapping.md +125 -0
- package/skill-data/data-app-migration/references/parity.md +61 -0
- package/skill-data/data-app-migration/references/probe.md +107 -0
- package/skill-data/data-app-migration/references/records.md +42 -0
- package/skill-data/data-app-migration/references/spec.md +96 -0
- package/skill-data/data-app-testing/SKILL.md +1 -0
- package/skill-data/data-app-ui/SKILL.md +5 -3
- package/skill-data/data-workflow/references/building-clean-tables.md +2 -2
- package/skill-data/git-sync/SKILL.md +1 -1
- package/skill-data/visualization/references/settings.md +8 -5
- package/skills/metabase-cli/SKILL.md +7 -1
- package/dist/api-key-DDTTiZ-V.mjs +0 -13
- package/dist/card-CdVs1A7F.mjs +0 -25
- package/dist/collection-cuOHmg2x.mjs +0 -21
- package/dist/dashboard-DmzHMDNg.mjs +0 -35
- package/dist/data-action-xlWNyd_-.mjs +0 -24
- package/dist/dependency-Dr2i_220.mjs +0 -15
- package/dist/document-DISJSlag.mjs +0 -20
- package/dist/field-B2aEEVh7.mjs +0 -21
- package/dist/git-sync-BkLMpMFt.mjs +0 -29
- package/dist/git-sync-DP4wQFzm.mjs +0 -147
- package/dist/glossary-BKuLoz_5.mjs +0 -14
- package/dist/poll-DS8mUoSP.mjs +0 -46
- package/dist/snippet-RZ0EXUu6.mjs +0 -19
- package/dist/table-BZ3Gr7mc.mjs +0 -26
- package/dist/timeline-Bc7qsC-f.mjs +0 -21
- package/dist/transform-BeTeVVwe.mjs +0 -28
- package/dist/transform-job-B58u8FZl.mjs +0 -22
- package/dist/transform-test-DxNtkPnU.mjs +0 -16
- package/dist/upload-CtLEKvL6.mjs +0 -13
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { R as CapabilityError,
|
|
1
|
+
import { _ as errorMessage, b as isNonInterruptFailure, f as PartialWriteError, i as isThenable, l as InternalError, m as TimeoutError, p as ResponseShapeError, r as isPlainObject, s as ConfigError, v as formatZodIssue } from "./predicates-DQA0AsBx.mjs";
|
|
2
|
+
import { R as CapabilityError, X as HttpError, Z as SyncRefusedError, at as parseJsonOrPlain, i as methodRequirements, nt as errorBodyJson, ot as parseJsonResult, r as isMethodKey, tt as topLevelField } from "./cli.mjs";
|
|
3
3
|
import { i as NotificationCardPayload, n as CARD_PAYLOAD_TYPE, r as Notification, t as AnyNotification } from "./notification-B5yMuPmo.mjs";
|
|
4
|
-
import { H as profileFromProperties, st as SessionProperties } from "./runtime-
|
|
4
|
+
import { H as profileFromProperties, W as combineAborts, ct as sessionSettingsSchema, st as SessionProperties } from "./runtime-DnT_GZj6.mjs";
|
|
5
5
|
import { i as CreatedApiKey, t as ApiKey } from "./api-key-DbsqHlN6.mjs";
|
|
6
|
-
import { n as featureFailures, r as supersedingFeature, t as checkFeatures } from "./requirement-check-
|
|
7
|
-
import { n as createTransport } from "./transport-
|
|
6
|
+
import { n as featureFailures, r as supersedingFeature, t as checkFeatures } from "./requirement-check-C2UgVxhH.mjs";
|
|
7
|
+
import { n as createTransport } from "./transport-B9h9dznf.mjs";
|
|
8
8
|
import { i as CardDetail, o as CardQueryResult, t as Card } from "./card-BJRZ5D5Q.mjs";
|
|
9
9
|
import { t as gateInput } from "./input-gate-registry-Dh8QjKgW.mjs";
|
|
10
10
|
import { _ as fieldRemappedValueSchema, c as FieldSemanticType, d as FieldValues, g as fieldDetailSchema, p as FieldWithDataSensitivity, r as FieldBaseType, s as FieldSearchMatches, t as DATA_SENSITIVITY_GATE } from "./field-C2qOViFZ.mjs";
|
|
@@ -12,21 +12,21 @@ import { r as ModerationReviewCreateInput, t as ModerationReview } from "./moder
|
|
|
12
12
|
import { i as ParameterValues, o as TemporalUnit } from "./parameter-Bucz3cLJ.mjs";
|
|
13
13
|
import { r as PivotExportFormat, t as DatasetQuery } from "./query-BKtMP5eH.mjs";
|
|
14
14
|
import { S as TableSelectors, _ as TableQueryMetadata, a as Table, d as TableDataLayerTier, m as TableForeignKey, n as DATA_LAYER_MEDALLION_GATE, r as DATA_LAYER_TIER_GATE, t as DATA_AUTHORITY_WITHDRAWAL_GATE, w as TableVisibilityType } from "./table-hgrX1i-R.mjs";
|
|
15
|
-
import { c as DatabaseWithSettings, t as Database } from "./database-
|
|
15
|
+
import { c as DatabaseWithSettings, t as Database } from "./database-BSETP2o-.mjs";
|
|
16
16
|
import { t as Snippet } from "./snippet-CyKAgIZl.mjs";
|
|
17
|
-
import { r as QueryMetadata, t as CompiledQuery } from "./dataset-
|
|
18
|
-
import { c as CollectionItem,
|
|
17
|
+
import { r as QueryMetadata, t as CompiledQuery } from "./dataset-a7Q_ocDR.mjs";
|
|
18
|
+
import { c as CollectionItem, h as CollectionTreeNode, m as CollectionSummary, r as Collection } from "./collection-875u7UiH.mjs";
|
|
19
19
|
import { t as ContentTranslationUploadResult } from "./content-translation-BrHOrmj9.mjs";
|
|
20
|
-
import { a as DashboardCreateInput, f as Dashcard, g as dashboardDetailSchema, r as DashboardCopy, t as Dashboard } from "./dashboard-
|
|
20
|
+
import { a as DashboardCreateInput, f as Dashcard, g as dashboardDetailSchema, r as DashboardCopy, t as Dashboard } from "./dashboard-D5BJZS3L.mjs";
|
|
21
21
|
import { l as dataActionSchema, n as DATA_ACTION_TABLE_GATE, s as DataActionExecuteResult, t as DATA_ACTION_COLLECTION_GATE } from "./data-action-DAw6WRTH.mjs";
|
|
22
22
|
import { a as DataAppEntry, n as DataApp, o as DataAppGeneratedFiles, t as DATA_APP_EDITING_GATE } from "./data-app-C7LHb5xd.mjs";
|
|
23
|
-
import {
|
|
24
|
-
import { i as DependencyEntity, s as DependencyGraph, t as BreakingSource, u as DependencyNode } from "./dependency-
|
|
25
|
-
import { t as Document } from "./document-
|
|
23
|
+
import { a as pollWithin, i as pollUntil, o as startDeadline, r as checkSchedule } from "./poll-DZQmd1FY.mjs";
|
|
24
|
+
import { i as DependencyEntity, s as DependencyGraph, t as BreakingSource, u as DependencyNode } from "./dependency-00_O1kxU.mjs";
|
|
25
|
+
import { t as Document } from "./document-ks1uxhBt.mjs";
|
|
26
26
|
import { i as EidTranslateResult } from "./eid-translation-Ba92VOHe.mjs";
|
|
27
|
-
import {
|
|
28
|
-
import { t as Glossary } from "./glossary-
|
|
29
|
-
import { a as libraryWireSchema, i as LibraryPublishTablesInput, n as LibraryCollectionInfo, o as toLibrary } from "./library-
|
|
27
|
+
import { _ as syncDirtyItemSchema, a as SyncExportPreflight, b as syncUnsyncedDependencySchema, g as isSyncTaskTerminal, n as SyncBranchCreated, r as SyncConnectionTested, t as RemoteSyncState, u as SyncSettingsUpdateResult, v as syncRemoteChangesSchema, y as syncTaskSchema } from "./git-sync-CfDVrtF4.mjs";
|
|
28
|
+
import { t as Glossary } from "./glossary-CnSPXHAd.mjs";
|
|
29
|
+
import { a as libraryWireSchema, i as LibraryPublishTablesInput, n as LibraryCollectionInfo, o as toLibrary } from "./library-DlJjXXJT.mjs";
|
|
30
30
|
import { t as Measure } from "./measure-BMWrX1ca.mjs";
|
|
31
31
|
import { o as SUBSCRIPTION_FILTERS_GATE, t as Pulse } from "./pulse-B2AmIWsO.mjs";
|
|
32
32
|
import { _ as transformRowSchema, a as TransformDagTransform, d as TransformTarget, g as transformDetailSchema, h as keyedByAlias, i as TransformDagRunResult, l as TransformRunSummary, m as isTransformRunTerminal, o as TransformRun, p as isTransformRunFailed, u as TransformSourceTableEntryInput, v as transformSourceBody } from "./transform-B62craFM.mjs";
|
|
@@ -306,8 +306,8 @@ function callRequirement(key, parameters, args) {
|
|
|
306
306
|
* The error a call failed with, as a `CapabilityError` carrying the server's answer when the server
|
|
307
307
|
* refused it for lacking one of the features `call` needs, and unchanged otherwise. The server's own
|
|
308
308
|
* refusal is the verdict; the profile only names what was missing. The explaining probe is bounded
|
|
309
|
-
* by its own timeout and the client's signal; the error stands when the probe fails
|
|
310
|
-
* interrupt surfaces as one.
|
|
309
|
+
* by its own timeout and the client's signal; the error stands when the probe fails or the client's
|
|
310
|
+
* guard refuses it, and an interrupt surfaces as one.
|
|
311
311
|
*/
|
|
312
312
|
async function explainRefusal(transport, call, error) {
|
|
313
313
|
if (!mayBeRefusal(call, error)) return error;
|
|
@@ -315,7 +315,7 @@ async function explainRefusal(transport, call, error) {
|
|
|
315
315
|
try {
|
|
316
316
|
profile = await transport.verifiedServer();
|
|
317
317
|
} catch (probeError) {
|
|
318
|
-
if (isNonInterruptFailure(probeError)) return error;
|
|
318
|
+
if (isNonInterruptFailure(probeError) || transport.refusedByGuard(probeError)) return error;
|
|
319
319
|
throw probeError;
|
|
320
320
|
}
|
|
321
321
|
const failure = explainedFailure(call, profile, error);
|
|
@@ -353,10 +353,6 @@ function pointsElsewhere(call, profile, refusal) {
|
|
|
353
353
|
function rejectedFields(refusal) {
|
|
354
354
|
return [refusal.fieldErrors, refusal.specificFieldErrors].flatMap((errors) => errors === null ? [] : Object.keys(errors).map(topLevelField));
|
|
355
355
|
}
|
|
356
|
-
function topLevelField(path) {
|
|
357
|
-
const end = path.indexOf(".");
|
|
358
|
-
return end === -1 ? path : path.slice(0, end);
|
|
359
|
-
}
|
|
360
356
|
//#endregion
|
|
361
357
|
//#region ../client/src/resources/collection.ts
|
|
362
358
|
const CollectionApiList = z.array(Collection);
|
|
@@ -421,6 +417,24 @@ function collectionResource(transport) {
|
|
|
421
417
|
total: null
|
|
422
418
|
};
|
|
423
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* List the collections the caller can read, the Library and its children among them, as
|
|
422
|
+
* `CollectionSummary`, which reads no enum, so a collection of a type or namespace this client
|
|
423
|
+
* does not know fails nothing. `archived` lists the archived collections instead of the live
|
|
424
|
+
* ones, which also leaves out the root collection.
|
|
425
|
+
*/
|
|
426
|
+
async function summaries(params = {}, options = {}) {
|
|
427
|
+
return {
|
|
428
|
+
data: await transport.requestParsed(z.array(CollectionSummary), "/api/collection", {
|
|
429
|
+
...options,
|
|
430
|
+
query: {
|
|
431
|
+
archived: params.archived,
|
|
432
|
+
...INCLUDE_LIBRARY
|
|
433
|
+
}
|
|
434
|
+
}),
|
|
435
|
+
total: null
|
|
436
|
+
};
|
|
437
|
+
}
|
|
424
438
|
/** Get one collection by id, entity id, or the `root`/`trash` alias. */
|
|
425
439
|
async function get(ref, options = {}) {
|
|
426
440
|
return transport.requestParsed(Collection, `/api/collection/${refPath(ref)}`, { ...options });
|
|
@@ -483,6 +497,7 @@ function collectionResource(transport) {
|
|
|
483
497
|
}
|
|
484
498
|
return {
|
|
485
499
|
list,
|
|
500
|
+
summaries,
|
|
486
501
|
get,
|
|
487
502
|
create,
|
|
488
503
|
update,
|
|
@@ -998,6 +1013,7 @@ function databaseResource(transport) {
|
|
|
998
1013
|
* pass `wait` to poll the database until it reports its initial sync complete.
|
|
999
1014
|
*/
|
|
1000
1015
|
async function syncSchema(id, params = {}, options = {}) {
|
|
1016
|
+
checkSchedule(params.wait);
|
|
1001
1017
|
const ack = await transport.requestParsed(DatabaseTaskAck, `/api/database/${id}/sync_schema`, {
|
|
1002
1018
|
...options,
|
|
1003
1019
|
method: "POST"
|
|
@@ -1010,7 +1026,10 @@ function databaseResource(transport) {
|
|
|
1010
1026
|
const database = await pollUntil(async (signal) => transport.requestParsed(Database, `/api/database/${id}`, {
|
|
1011
1027
|
...options,
|
|
1012
1028
|
signal
|
|
1013
|
-
}), (candidate) => candidate.initial_sync_status === SYNC_COMPLETE,
|
|
1029
|
+
}), (candidate) => candidate.initial_sync_status === SYNC_COMPLETE, {
|
|
1030
|
+
...wait,
|
|
1031
|
+
signal: combineAborts(wait.signal, options.signal, transport.signal)
|
|
1032
|
+
});
|
|
1014
1033
|
return {
|
|
1015
1034
|
id,
|
|
1016
1035
|
status: ack.status,
|
|
@@ -1515,7 +1534,6 @@ const SyncScopeCollection = Collection.pick({
|
|
|
1515
1534
|
is_remote_synced: true
|
|
1516
1535
|
}).strip();
|
|
1517
1536
|
const SyncDirtyFlag = z.object({ is_dirty: z.boolean() });
|
|
1518
|
-
const SyncDirtyList = z.object({ dirty: z.array(SyncDirtyItem) });
|
|
1519
1537
|
const SyncBranchList = z.object({ items: z.array(z.string()) });
|
|
1520
1538
|
const SyncImportStarted = z.object({
|
|
1521
1539
|
status: z.literal("success"),
|
|
@@ -1532,6 +1550,15 @@ const SyncStashStarted = z.object({
|
|
|
1532
1550
|
task_id: z.number().int().positive()
|
|
1533
1551
|
});
|
|
1534
1552
|
const RemoteSyncSetting = z.string().nullable();
|
|
1553
|
+
const DirtyRefusalBody = z.object({ conflicts: z.literal(true) });
|
|
1554
|
+
const UnsyncedDependenciesBody = z.object({
|
|
1555
|
+
"error-code": z.literal("unsynced-dependencies"),
|
|
1556
|
+
unsynced_dependencies: z.array(syncUnsyncedDependencySchema)
|
|
1557
|
+
});
|
|
1558
|
+
const BranchMismatchBody = z.object({
|
|
1559
|
+
branch_mismatch: z.literal(true),
|
|
1560
|
+
current_branch: z.string().nullable()
|
|
1561
|
+
});
|
|
1535
1562
|
const RemoteSyncBranchProperty = SessionProperties.extend({ "remote-sync-branch": z.string().nullable().optional() });
|
|
1536
1563
|
const RemoteSyncUrlProperty = SessionProperties.extend({ "remote-sync-url": z.string().nullable().optional() });
|
|
1537
1564
|
const BRANCH_UNREADABLE_MESSAGE = "the remote-sync-branch setting is not readable: only admins see it, and a server without remote sync has none";
|
|
@@ -1547,13 +1574,64 @@ function isRemoteUnreadable(error) {
|
|
|
1547
1574
|
}
|
|
1548
1575
|
function gitSyncResource(transport) {
|
|
1549
1576
|
const { explain, refuse, refuseAfterReading } = explainer(transport, "gitSync");
|
|
1577
|
+
async function readingRefusal(request, call, options) {
|
|
1578
|
+
try {
|
|
1579
|
+
return await request;
|
|
1580
|
+
} catch (error) {
|
|
1581
|
+
if (!(error instanceof HttpError)) throw error;
|
|
1582
|
+
const refusal = await refusalOf(error, call, options);
|
|
1583
|
+
throw refusal === null ? error : new SyncRefusedError(error, refusal);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
async function refusalOf(error, call, options) {
|
|
1587
|
+
const body = errorBodyJson(error);
|
|
1588
|
+
if (error.status === 409) {
|
|
1589
|
+
const mismatch = BranchMismatchBody.safeParse(body);
|
|
1590
|
+
return mismatch.success ? {
|
|
1591
|
+
kind: "branch-mismatch",
|
|
1592
|
+
current_branch: mismatch.data.current_branch
|
|
1593
|
+
} : null;
|
|
1594
|
+
}
|
|
1595
|
+
if (error.status !== 400) return null;
|
|
1596
|
+
const unsynced = UnsyncedDependenciesBody.safeParse(body);
|
|
1597
|
+
if (unsynced.success) return {
|
|
1598
|
+
kind: "unsynced-dependencies",
|
|
1599
|
+
unsynced_dependencies: unsynced.data.unsynced_dependencies
|
|
1600
|
+
};
|
|
1601
|
+
if (call !== "import") return null;
|
|
1602
|
+
return DirtyRefusalBody.safeParse(body).success ? dirtyRefusal(body, options) : null;
|
|
1603
|
+
}
|
|
1604
|
+
async function dirtyRefusal(body, options) {
|
|
1605
|
+
let features;
|
|
1606
|
+
try {
|
|
1607
|
+
features = (await transport.server(options)).features;
|
|
1608
|
+
} catch (failure) {
|
|
1609
|
+
if (isNonInterruptFailure(failure) || transport.refusedByGuard(failure)) return null;
|
|
1610
|
+
throw failure;
|
|
1611
|
+
}
|
|
1612
|
+
if (!features.remoteSyncImportNamesDirtyObjects) return {
|
|
1613
|
+
kind: "dirty",
|
|
1614
|
+
dirty_objects: null
|
|
1615
|
+
};
|
|
1616
|
+
const read = z.object({ dirty_objects: z.array(syncDirtyItemSchema(features)) }).safeParse(body);
|
|
1617
|
+
return read.success ? {
|
|
1618
|
+
kind: "dirty",
|
|
1619
|
+
dirty_objects: read.data.dirty_objects
|
|
1620
|
+
} : null;
|
|
1621
|
+
}
|
|
1550
1622
|
/** Get the running or most recently finished sync task, or null when the server has none. */
|
|
1551
1623
|
async function currentTask(options = {}) {
|
|
1552
|
-
|
|
1624
|
+
const { features } = await transport.server(options);
|
|
1625
|
+
return fetchOptionalParsed(transport, "/api/ee/remote-sync/current-task", syncTaskSchema(features), options);
|
|
1553
1626
|
}
|
|
1554
|
-
/**
|
|
1627
|
+
/**
|
|
1628
|
+
* Request cancellation of the running sync task, and answer it in the state that left it. Some
|
|
1629
|
+
* servers end the task at once; others mark it `cancelled` and leave it `running` until its
|
|
1630
|
+
* worker next reports, so a caller that needs it ended waits for the task.
|
|
1631
|
+
*/
|
|
1555
1632
|
async function cancelTask(options = {}) {
|
|
1556
|
-
|
|
1633
|
+
const { features } = await transport.server(options);
|
|
1634
|
+
return transport.requestParsed(syncTaskSchema(features), "/api/ee/remote-sync/current-task/cancel", {
|
|
1557
1635
|
...options,
|
|
1558
1636
|
method: "POST"
|
|
1559
1637
|
});
|
|
@@ -1564,17 +1642,21 @@ function gitSyncResource(transport) {
|
|
|
1564
1642
|
}
|
|
1565
1643
|
/** List the objects whose local state differs from the remote. */
|
|
1566
1644
|
async function dirty(options = {}) {
|
|
1645
|
+
const { features } = await transport.server(options);
|
|
1646
|
+
const list = z.object({ dirty: z.array(syncDirtyItemSchema(features)) });
|
|
1567
1647
|
return {
|
|
1568
|
-
data: (await transport.requestParsed(
|
|
1648
|
+
data: (await transport.requestParsed(list, "/api/ee/remote-sync/dirty", options)).dirty,
|
|
1569
1649
|
total: null
|
|
1570
1650
|
};
|
|
1571
1651
|
}
|
|
1572
1652
|
/**
|
|
1573
|
-
* Compare the tracked remote branch against what Metabase last
|
|
1574
|
-
* comparison
|
|
1653
|
+
* Compare the tracked remote branch against what Metabase last synced. A server with
|
|
1654
|
+
* `remoteSyncChangesCache` caches the comparison, and `force-refresh` re-reads the remote instead;
|
|
1655
|
+
* one without it reads the remote on every call and drops the key, so every answer is fresh.
|
|
1575
1656
|
*/
|
|
1576
1657
|
async function hasRemoteChanges(params = {}, options = {}) {
|
|
1577
|
-
|
|
1658
|
+
const { features } = await transport.server(options);
|
|
1659
|
+
return transport.requestParsed(syncRemoteChangesSchema(features), "/api/ee/remote-sync/has-remote-changes", {
|
|
1578
1660
|
...options,
|
|
1579
1661
|
query: { "force-refresh": params["force-refresh"] }
|
|
1580
1662
|
});
|
|
@@ -1592,9 +1674,10 @@ function gitSyncResource(transport) {
|
|
|
1592
1674
|
* instance.
|
|
1593
1675
|
*/
|
|
1594
1676
|
async function importFromRemote(params = {}, options = {}) {
|
|
1677
|
+
checkSchedule(params.wait);
|
|
1595
1678
|
const expectedBranch = await expectedBranchFor(params.expected_branch, options);
|
|
1596
1679
|
await requireMerge(params.merge, options);
|
|
1597
|
-
const started = await transport.requestParsed(SyncImportStarted, "/api/ee/remote-sync/import", {
|
|
1680
|
+
const started = await readingRefusal(transport.requestParsed(SyncImportStarted, "/api/ee/remote-sync/import", {
|
|
1598
1681
|
...options,
|
|
1599
1682
|
method: "POST",
|
|
1600
1683
|
body: {
|
|
@@ -1603,7 +1686,7 @@ function gitSyncResource(transport) {
|
|
|
1603
1686
|
merge: params.merge,
|
|
1604
1687
|
expected_branch: expectedBranch
|
|
1605
1688
|
}
|
|
1606
|
-
});
|
|
1689
|
+
}), "import", options);
|
|
1607
1690
|
const message = started.message ?? null;
|
|
1608
1691
|
if (params.wait === void 0 || started.task_id === null) return {
|
|
1609
1692
|
message,
|
|
@@ -1645,9 +1728,10 @@ function gitSyncResource(transport) {
|
|
|
1645
1728
|
* changes in by a three-way merge instead, and `force` overwrites them.
|
|
1646
1729
|
*/
|
|
1647
1730
|
async function exportToRemote(params = {}, options = {}) {
|
|
1731
|
+
checkSchedule(params.wait);
|
|
1648
1732
|
const branchName = await exportBranchFor(params.branch, options);
|
|
1649
1733
|
await requireMerge(params.merge, options);
|
|
1650
|
-
const started = await transport.requestParsed(SyncExportStarted, "/api/ee/remote-sync/export", {
|
|
1734
|
+
const started = await readingRefusal(transport.requestParsed(SyncExportStarted, "/api/ee/remote-sync/export", {
|
|
1651
1735
|
...options,
|
|
1652
1736
|
method: "POST",
|
|
1653
1737
|
body: {
|
|
@@ -1656,7 +1740,7 @@ function gitSyncResource(transport) {
|
|
|
1656
1740
|
force: params.force,
|
|
1657
1741
|
merge: params.merge
|
|
1658
1742
|
}
|
|
1659
|
-
});
|
|
1743
|
+
}), "export", options);
|
|
1660
1744
|
const accepted = {
|
|
1661
1745
|
message: started.message,
|
|
1662
1746
|
task_id: started.task_id,
|
|
@@ -1675,16 +1759,17 @@ function gitSyncResource(transport) {
|
|
|
1675
1759
|
* otherwise.
|
|
1676
1760
|
*/
|
|
1677
1761
|
async function exportPreflight(params, options = {}) {
|
|
1678
|
-
return transport.requestParsed(SyncExportPreflight, "/api/ee/remote-sync/export-preflight", {
|
|
1762
|
+
return readingRefusal(transport.requestParsed(SyncExportPreflight, "/api/ee/remote-sync/export-preflight", {
|
|
1679
1763
|
...options,
|
|
1680
1764
|
query: { branch: params.branch }
|
|
1681
|
-
});
|
|
1765
|
+
}), "export", options);
|
|
1682
1766
|
}
|
|
1683
1767
|
/**
|
|
1684
1768
|
* Export Metabase's current content to a branch the remote does not have yet. The endpoint
|
|
1685
1769
|
* queues a task and returns at once; pass `wait` to poll that task to a terminal status.
|
|
1686
1770
|
*/
|
|
1687
1771
|
async function stash(params, options = {}) {
|
|
1772
|
+
checkSchedule(params.wait);
|
|
1688
1773
|
const started = await transport.requestParsed(SyncStashStarted, "/api/ee/remote-sync/stash", {
|
|
1689
1774
|
...options,
|
|
1690
1775
|
method: "POST",
|
|
@@ -1712,7 +1797,11 @@ function gitSyncResource(transport) {
|
|
|
1712
1797
|
total: null
|
|
1713
1798
|
};
|
|
1714
1799
|
}
|
|
1715
|
-
/**
|
|
1800
|
+
/**
|
|
1801
|
+
* Create a branch on the remote and point git-sync at it. Metabase 58 to 65 route it; a server
|
|
1802
|
+
* from v66 does not, and answers an `HttpError` of kind `route-missing`. There `stash` makes a
|
|
1803
|
+
* branch, holding Metabase's content.
|
|
1804
|
+
*/
|
|
1716
1805
|
async function createBranch(params, options = {}) {
|
|
1717
1806
|
return transport.requestParsed(SyncBranchCreated, "/api/ee/remote-sync/create-branch", {
|
|
1718
1807
|
...options,
|
|
@@ -1721,6 +1810,18 @@ function gitSyncResource(transport) {
|
|
|
1721
1810
|
});
|
|
1722
1811
|
}
|
|
1723
1812
|
/**
|
|
1813
|
+
* Check that the remote answers to the saved URL and token, or to those given, without saving
|
|
1814
|
+
* them. Admin only. A remote that cannot be reached, a URL the server does not take, or a remote
|
|
1815
|
+
* that is not set up is refused with 400, carrying the server's reason.
|
|
1816
|
+
*/
|
|
1817
|
+
async function testConnection(params = {}, options = {}) {
|
|
1818
|
+
return transport.requestParsed(SyncConnectionTested, "/api/ee/remote-sync/test-connection", {
|
|
1819
|
+
...options,
|
|
1820
|
+
method: "POST",
|
|
1821
|
+
body: params
|
|
1822
|
+
});
|
|
1823
|
+
}
|
|
1824
|
+
/**
|
|
1724
1825
|
* Mark one collection as git-synced, or unmark it. The server cascades the flag to descendants
|
|
1725
1826
|
* by location prefix, and may queue an import task to bring the instance in line with the
|
|
1726
1827
|
* remote. A server without `remoteSyncCollectionsOnlyUpdate` validates every settings update as
|
|
@@ -1730,11 +1831,11 @@ function gitSyncResource(transport) {
|
|
|
1730
1831
|
* settings that are already empty.
|
|
1731
1832
|
*/
|
|
1732
1833
|
async function setCollectionSynced(collectionId, synced, options = {}) {
|
|
1733
|
-
return transport.requestParsed(SyncSettingsUpdateResult, "/api/ee/remote-sync/settings", {
|
|
1834
|
+
return readingRefusal(transport.requestParsed(SyncSettingsUpdateResult, "/api/ee/remote-sync/settings", {
|
|
1734
1835
|
...options,
|
|
1735
1836
|
method: "PUT",
|
|
1736
1837
|
body: await settingsUpdateBody({ [collectionId]: synced }, options)
|
|
1737
|
-
});
|
|
1838
|
+
}), "settings", options);
|
|
1738
1839
|
}
|
|
1739
1840
|
async function settingsUpdateBody(collections, options) {
|
|
1740
1841
|
const { features } = await transport.server(options);
|
|
@@ -1756,6 +1857,27 @@ function gitSyncResource(transport) {
|
|
|
1756
1857
|
"remote-sync-token": token
|
|
1757
1858
|
};
|
|
1758
1859
|
}
|
|
1860
|
+
/**
|
|
1861
|
+
* Configure the remote, the sync direction, the tracked branch, whether remote changes are
|
|
1862
|
+
* imported on their own, whether transforms are synced, and which collections are synced; a key
|
|
1863
|
+
* left out keeps its value. Admin only. A blank URL clears the remote. Send `remote-sync-url`
|
|
1864
|
+
* with the token, the direction or the branch: most servers check such an update against the URL
|
|
1865
|
+
* it carries and refuse it with 400 without one, and a server without
|
|
1866
|
+
* `remoteSyncCollectionsOnlyUpdate` checks every update that way. A read-write instance that
|
|
1867
|
+
* tracks a branch may refuse another `remote-sync-branch` with 400, leaving the switch to an
|
|
1868
|
+
* import of that branch. The server refuses with 400 while a sync task runs; one without
|
|
1869
|
+
* `remoteSyncCollectionsOnlyUpdate` saves the settings first and refuses only the import it would
|
|
1870
|
+
* start. On an instance left read-only the update starts an import, whose task id the answer
|
|
1871
|
+
* carries.
|
|
1872
|
+
*/
|
|
1873
|
+
async function updateSettings(params, options = {}) {
|
|
1874
|
+
if (params["remote-sync-transforms"] !== void 0) await transport.requireFeatures(["remoteSyncTransformsSetting"], options);
|
|
1875
|
+
return readingRefusal(transport.requestParsed(SyncSettingsUpdateResult, "/api/ee/remote-sync/settings", {
|
|
1876
|
+
...options,
|
|
1877
|
+
method: "PUT",
|
|
1878
|
+
body: params
|
|
1879
|
+
}), "settings", options);
|
|
1880
|
+
}
|
|
1759
1881
|
/** The collections currently in git-sync's scope. */
|
|
1760
1882
|
async function syncedCollections(options = {}) {
|
|
1761
1883
|
return {
|
|
@@ -1821,7 +1943,10 @@ function gitSyncResource(transport) {
|
|
|
1821
1943
|
return pollUntil(async (signal) => currentTask({
|
|
1822
1944
|
...options,
|
|
1823
1945
|
signal
|
|
1824
|
-
}), (task) => task === null || isSyncTaskTerminal(task.status),
|
|
1946
|
+
}), (task) => task === null || isSyncTaskTerminal(task.status), {
|
|
1947
|
+
...wait,
|
|
1948
|
+
signal: combineAborts(wait.signal, options.signal, transport.signal)
|
|
1949
|
+
});
|
|
1825
1950
|
}
|
|
1826
1951
|
return {
|
|
1827
1952
|
currentTask: explain("currentTask", currentTask),
|
|
@@ -1835,7 +1960,9 @@ function gitSyncResource(transport) {
|
|
|
1835
1960
|
stash: explain("stash", stash),
|
|
1836
1961
|
branches: explain("branches", branches),
|
|
1837
1962
|
createBranch: explain("createBranch", createBranch),
|
|
1963
|
+
testConnection: explain("testConnection", testConnection),
|
|
1838
1964
|
setCollectionSynced: explain("setCollectionSynced", setCollectionSynced),
|
|
1965
|
+
updateSettings: explain("updateSettings", updateSettings),
|
|
1839
1966
|
syncedCollections: refuse("syncedCollections", syncedCollections),
|
|
1840
1967
|
remoteUrl,
|
|
1841
1968
|
branch: refuseAfterReading("branch", RemoteSyncBranchProperty, branch),
|
|
@@ -1906,6 +2033,41 @@ function glossaryResource(transport) {
|
|
|
1906
2033
|
};
|
|
1907
2034
|
}
|
|
1908
2035
|
//#endregion
|
|
2036
|
+
//#region ../client/src/domain/health.ts
|
|
2037
|
+
const Health = z.object({
|
|
2038
|
+
status: z.string(),
|
|
2039
|
+
progress: z.number().min(0).max(1).optional()
|
|
2040
|
+
}).loose();
|
|
2041
|
+
Health.pick({
|
|
2042
|
+
status: true,
|
|
2043
|
+
progress: true
|
|
2044
|
+
}).strip();
|
|
2045
|
+
//#endregion
|
|
2046
|
+
//#region ../client/src/resources/health.ts
|
|
2047
|
+
function healthResource(transport) {
|
|
2048
|
+
/**
|
|
2049
|
+
* Check whether the server is up: `ok` once it has booted and reaches its app database, else
|
|
2050
|
+
* `initializing` with its `progress`, or why the app database is out of reach. Needs no
|
|
2051
|
+
* credential. Answers without retrying unless `retries` is set.
|
|
2052
|
+
*/
|
|
2053
|
+
async function get(options = {}) {
|
|
2054
|
+
try {
|
|
2055
|
+
return await transport.requestParsed(Health, "/api/health", {
|
|
2056
|
+
...options,
|
|
2057
|
+
retries: options.retries ?? 0
|
|
2058
|
+
});
|
|
2059
|
+
} catch (error) {
|
|
2060
|
+
if (!(error instanceof HttpError) || error.status !== 503) throw error;
|
|
2061
|
+
const { body } = error.developerDetail;
|
|
2062
|
+
if (body === null) throw error;
|
|
2063
|
+
const health = parseJsonResult(body, Health);
|
|
2064
|
+
if (!health.ok) throw error;
|
|
2065
|
+
return health.value;
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
return { get };
|
|
2069
|
+
}
|
|
2070
|
+
//#endregion
|
|
1909
2071
|
//#region ../client/src/resources/library.ts
|
|
1910
2072
|
const LIBRARY_ROOT_PATH = "/api/ee/library/";
|
|
1911
2073
|
const PUBLISH_TABLES_PATH = "/api/ee/data-studio/table/publish-tables";
|
|
@@ -2041,6 +2203,78 @@ function measureResource(transport) {
|
|
|
2041
2203
|
};
|
|
2042
2204
|
}
|
|
2043
2205
|
//#endregion
|
|
2206
|
+
//#region ../client/src/domain/metadata-sync.ts
|
|
2207
|
+
const MetadataSyncCursor = z.json();
|
|
2208
|
+
const MetadataSyncRequest = z.object({
|
|
2209
|
+
database: z.string(),
|
|
2210
|
+
engine: z.string(),
|
|
2211
|
+
after: MetadataSyncCursor.nullable().optional()
|
|
2212
|
+
}).loose();
|
|
2213
|
+
z.object({
|
|
2214
|
+
database_id: z.number().int(),
|
|
2215
|
+
after: MetadataSyncCursor.nullable().optional()
|
|
2216
|
+
}).strict();
|
|
2217
|
+
const MetadataSyncAnswer = z.object({
|
|
2218
|
+
format_version: z.number().int(),
|
|
2219
|
+
database: z.string(),
|
|
2220
|
+
engine: z.string(),
|
|
2221
|
+
batches: z.array(z.object({ type: z.string() }).loose()),
|
|
2222
|
+
next: MetadataSyncCursor.nullable().optional()
|
|
2223
|
+
}).loose();
|
|
2224
|
+
z.object({
|
|
2225
|
+
database_id: z.number().int(),
|
|
2226
|
+
response: MetadataSyncAnswer
|
|
2227
|
+
}).strict();
|
|
2228
|
+
const MetadataSyncApplied = z.object({
|
|
2229
|
+
next: MetadataSyncCursor.nullable().optional(),
|
|
2230
|
+
counts: z.record(z.string(), z.number().int())
|
|
2231
|
+
}).loose();
|
|
2232
|
+
//#endregion
|
|
2233
|
+
//#region ../client/src/resources/metadata-sync.ts
|
|
2234
|
+
function metadataSyncResource(transport) {
|
|
2235
|
+
const { explain } = explainer(transport, "metadataSync");
|
|
2236
|
+
/**
|
|
2237
|
+
* The request that asks the sender for the next page of the metadata of one of this server's
|
|
2238
|
+
* Databases, from the cursor `after`. The caller keeps the Database from syncing until the seed
|
|
2239
|
+
* ends, for example with `disable-auto-sync`. Superusers only.
|
|
2240
|
+
*/
|
|
2241
|
+
async function request(params, options = {}) {
|
|
2242
|
+
return transport.requestParsed(MetadataSyncRequest, "/api/warehouse/metadata/request", {
|
|
2243
|
+
...options,
|
|
2244
|
+
method: "POST",
|
|
2245
|
+
body: params
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2248
|
+
/**
|
|
2249
|
+
* The next page of the warehouse metadata of the Database a request names, as the sender holds
|
|
2250
|
+
* it, with the cursor of the page after it in `next`. Superusers only.
|
|
2251
|
+
*/
|
|
2252
|
+
async function changes(params, options = {}) {
|
|
2253
|
+
return transport.requestParsed(MetadataSyncAnswer, "/api/warehouse/metadata/changes", {
|
|
2254
|
+
...options,
|
|
2255
|
+
method: "POST",
|
|
2256
|
+
body: params
|
|
2257
|
+
});
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Apply the sender's answer to a Database of this server that has no Tables, in one transaction,
|
|
2261
|
+
* so a refused answer writes nothing and can be sent again. `next` is the cursor of the next
|
|
2262
|
+
* request, absent after the last answer. Superusers only.
|
|
2263
|
+
*/
|
|
2264
|
+
async function apply(params, options = {}) {
|
|
2265
|
+
return transport.requestParsed(MetadataSyncApplied, "/api/warehouse/metadata/apply", {
|
|
2266
|
+
...options,
|
|
2267
|
+
method: "POST",
|
|
2268
|
+
body: params
|
|
2269
|
+
});
|
|
2270
|
+
}
|
|
2271
|
+
return {
|
|
2272
|
+
request: explain("request", request),
|
|
2273
|
+
changes: explain("changes", changes),
|
|
2274
|
+
apply: explain("apply", apply)
|
|
2275
|
+
};
|
|
2276
|
+
}
|
|
2277
|
+
//#endregion
|
|
2044
2278
|
//#region ../client/src/domain/metric.ts
|
|
2045
2279
|
const ClauseOptions = z.object({}).loose();
|
|
2046
2280
|
const MetricLeafType = z.enum(["metric", "measure"]);
|
|
@@ -2364,6 +2598,17 @@ const PermissionsGraph = z.object({
|
|
|
2364
2598
|
revision: z.number().int().nonnegative(),
|
|
2365
2599
|
groups: z.record(z.string(), z.record(z.string(), DatabasePermissions))
|
|
2366
2600
|
}).loose();
|
|
2601
|
+
const PermissionGroup = z.object({
|
|
2602
|
+
id: z.number().int(),
|
|
2603
|
+
name: z.string(),
|
|
2604
|
+
magic_group_type: z.string().nullable(),
|
|
2605
|
+
member_count: z.number().int().nonnegative()
|
|
2606
|
+
}).loose();
|
|
2607
|
+
PermissionGroup.pick({
|
|
2608
|
+
id: true,
|
|
2609
|
+
name: true,
|
|
2610
|
+
magic_group_type: true
|
|
2611
|
+
}).strip();
|
|
2367
2612
|
//#endregion
|
|
2368
2613
|
//#region ../client/src/resources/permission.ts
|
|
2369
2614
|
function permissionResource(transport) {
|
|
@@ -2387,10 +2632,22 @@ function permissionResource(transport) {
|
|
|
2387
2632
|
async function groupGraph(id, options = {}) {
|
|
2388
2633
|
return transport.requestParsed(PermissionsGraph, `/api/permissions/graph/group/${id}`, { ...options });
|
|
2389
2634
|
}
|
|
2635
|
+
/**
|
|
2636
|
+
* List the permission groups, each with its member count. Needs an admin, the settings
|
|
2637
|
+
* application permission, or a group manager, who sees only the groups they manage.
|
|
2638
|
+
* `GET /api/permissions/group` answers a bare array.
|
|
2639
|
+
*/
|
|
2640
|
+
async function groups(options = {}) {
|
|
2641
|
+
return {
|
|
2642
|
+
data: await transport.requestParsed(z.array(PermissionGroup), "/api/permissions/group", { ...options }),
|
|
2643
|
+
total: null
|
|
2644
|
+
};
|
|
2645
|
+
}
|
|
2390
2646
|
return {
|
|
2391
2647
|
graph,
|
|
2392
2648
|
databaseGraph,
|
|
2393
|
-
groupGraph
|
|
2649
|
+
groupGraph,
|
|
2650
|
+
groups
|
|
2394
2651
|
};
|
|
2395
2652
|
}
|
|
2396
2653
|
//#endregion
|
|
@@ -2886,8 +3143,21 @@ function segmentResource(transport) {
|
|
|
2886
3143
|
archive
|
|
2887
3144
|
};
|
|
2888
3145
|
}
|
|
3146
|
+
z.object({
|
|
3147
|
+
username: z.string().min(1),
|
|
3148
|
+
password: z.string().min(1)
|
|
3149
|
+
}).strict();
|
|
3150
|
+
const Session = z.object({ id: z.string() }).loose();
|
|
3151
|
+
Session.pick({ id: true }).strip();
|
|
2889
3152
|
//#endregion
|
|
2890
3153
|
//#region ../client/src/resources/session.ts
|
|
3154
|
+
const SessionSettingsRead = SessionProperties.transform((properties, ctx) => {
|
|
3155
|
+
const { features } = profileFromProperties(properties);
|
|
3156
|
+
const parsed = sessionSettingsSchema(features).safeParse(properties);
|
|
3157
|
+
if (parsed.success) return parsed.data;
|
|
3158
|
+
for (const issue of parsed.error.issues) ctx.addIssue({ ...issue });
|
|
3159
|
+
return z.NEVER;
|
|
3160
|
+
});
|
|
2891
3161
|
function sessionResource(transport) {
|
|
2892
3162
|
/**
|
|
2893
3163
|
* Get the session properties: the settings the caller may read, among them the server's version
|
|
@@ -2896,7 +3166,32 @@ function sessionResource(transport) {
|
|
|
2896
3166
|
async function properties(options = {}) {
|
|
2897
3167
|
return transport.probe(SessionProperties, options);
|
|
2898
3168
|
}
|
|
2899
|
-
|
|
3169
|
+
/**
|
|
3170
|
+
* Get the settings a bootstrap reads from the session properties: the setup state, the site name,
|
|
3171
|
+
* the AI and MCP switches and remote sync, parsed by the shape of the server that answers. Read
|
|
3172
|
+
* afresh, never from a profile handed in.
|
|
3173
|
+
*/
|
|
3174
|
+
async function settings(options = {}) {
|
|
3175
|
+
return transport.probe(SessionSettingsRead, options);
|
|
3176
|
+
}
|
|
3177
|
+
/**
|
|
3178
|
+
* Log in with a username and password, answering the new session's id. A wrong password answers
|
|
3179
|
+
* 401. An account with a second factor is answered with a challenge rather than a session, and
|
|
3180
|
+
* one without where the instance requires a second factor with an enrollment; this method
|
|
3181
|
+
* reports either as a `ResponseShapeError`.
|
|
3182
|
+
*/
|
|
3183
|
+
async function create(params, options = {}) {
|
|
3184
|
+
return transport.requestParsed(Session, "/api/session", {
|
|
3185
|
+
...options,
|
|
3186
|
+
method: "POST",
|
|
3187
|
+
body: params
|
|
3188
|
+
});
|
|
3189
|
+
}
|
|
3190
|
+
return {
|
|
3191
|
+
properties,
|
|
3192
|
+
settings,
|
|
3193
|
+
create
|
|
3194
|
+
};
|
|
2900
3195
|
}
|
|
2901
3196
|
//#endregion
|
|
2902
3197
|
//#region ../client/src/resources/setting.ts
|
|
@@ -3265,6 +3560,101 @@ function describeCollectionAnswer(answered) {
|
|
|
3265
3560
|
return `the table stays in collection ${answered.value}`;
|
|
3266
3561
|
}
|
|
3267
3562
|
//#endregion
|
|
3563
|
+
//#region ../client/src/domain/task.ts
|
|
3564
|
+
const TaskRunType = z.enum([
|
|
3565
|
+
"subscription",
|
|
3566
|
+
"alert",
|
|
3567
|
+
"sync",
|
|
3568
|
+
"fingerprint"
|
|
3569
|
+
]);
|
|
3570
|
+
const TaskRunEntityType = z.enum([
|
|
3571
|
+
"database",
|
|
3572
|
+
"card",
|
|
3573
|
+
"dashboard"
|
|
3574
|
+
]);
|
|
3575
|
+
const TaskRunStatus = z.enum([
|
|
3576
|
+
"started",
|
|
3577
|
+
"success",
|
|
3578
|
+
"failed",
|
|
3579
|
+
"abandoned"
|
|
3580
|
+
]);
|
|
3581
|
+
const TaskRun = z.object({
|
|
3582
|
+
id: z.number().int(),
|
|
3583
|
+
run_type: TaskRunType,
|
|
3584
|
+
entity_type: TaskRunEntityType,
|
|
3585
|
+
entity_id: z.number().int(),
|
|
3586
|
+
started_at: z.string(),
|
|
3587
|
+
ended_at: z.string().nullable(),
|
|
3588
|
+
status: TaskRunStatus,
|
|
3589
|
+
entity_name: z.string().nullable(),
|
|
3590
|
+
task_count: z.number().int(),
|
|
3591
|
+
success_count: z.number().int(),
|
|
3592
|
+
failed_count: z.number().int()
|
|
3593
|
+
}).loose();
|
|
3594
|
+
TaskRun.pick({
|
|
3595
|
+
id: true,
|
|
3596
|
+
run_type: true,
|
|
3597
|
+
entity_type: true,
|
|
3598
|
+
entity_id: true,
|
|
3599
|
+
status: true,
|
|
3600
|
+
started_at: true,
|
|
3601
|
+
ended_at: true
|
|
3602
|
+
}).strip();
|
|
3603
|
+
const TaskHistoryStatus = z.enum([
|
|
3604
|
+
"started",
|
|
3605
|
+
"success",
|
|
3606
|
+
"failed",
|
|
3607
|
+
"unknown"
|
|
3608
|
+
]);
|
|
3609
|
+
const TaskHistoryDetails = z.object({ message: z.string().nullable().optional() }).loose();
|
|
3610
|
+
const TaskHistory = z.object({
|
|
3611
|
+
id: z.number().int(),
|
|
3612
|
+
task: z.string(),
|
|
3613
|
+
db_id: z.number().int().nullable(),
|
|
3614
|
+
started_at: z.string(),
|
|
3615
|
+
ended_at: z.string().nullable(),
|
|
3616
|
+
duration: z.number().int().nullable(),
|
|
3617
|
+
status: TaskHistoryStatus,
|
|
3618
|
+
task_details: TaskHistoryDetails.nullable()
|
|
3619
|
+
}).loose();
|
|
3620
|
+
const TaskRunWithTasks = TaskRun.extend({ tasks: z.array(TaskHistory) });
|
|
3621
|
+
//#endregion
|
|
3622
|
+
//#region ../client/src/resources/task.ts
|
|
3623
|
+
function taskResource(transport) {
|
|
3624
|
+
const { explain, explainWalk } = explainer(transport, "task");
|
|
3625
|
+
/**
|
|
3626
|
+
* Walk the background-job runs, such as database syncs and subscription sends, newest first,
|
|
3627
|
+
* each with the name of the entity it ran against and a count of its tasks. Needs the monitoring
|
|
3628
|
+
* application permission.
|
|
3629
|
+
*/
|
|
3630
|
+
async function* runPages(params = {}, options = {}) {
|
|
3631
|
+
yield* paginatePages(transport, "/api/task/runs", TaskRun, {
|
|
3632
|
+
query: {
|
|
3633
|
+
"run-type": params["run-type"],
|
|
3634
|
+
"entity-type": params["entity-type"],
|
|
3635
|
+
"entity-id": params["entity-id"],
|
|
3636
|
+
status: params.status,
|
|
3637
|
+
"started-at": params["started-at"]
|
|
3638
|
+
},
|
|
3639
|
+
...options.offset !== void 0 && { offset: options.offset },
|
|
3640
|
+
...options.max !== void 0 && { max: options.max },
|
|
3641
|
+
...options.pageSize !== void 0 && { pageSize: options.pageSize },
|
|
3642
|
+
...options.signal !== void 0 && { signal: options.signal }
|
|
3643
|
+
});
|
|
3644
|
+
}
|
|
3645
|
+
/**
|
|
3646
|
+
* Get a single task run with all its child tasks, oldest first. Needs the monitoring application
|
|
3647
|
+
* permission.
|
|
3648
|
+
*/
|
|
3649
|
+
async function run(id, options = {}) {
|
|
3650
|
+
return transport.requestParsed(TaskRunWithTasks, `/api/task/runs/${id}`, options);
|
|
3651
|
+
}
|
|
3652
|
+
return {
|
|
3653
|
+
runPages: explainWalk("runPages", runPages),
|
|
3654
|
+
run: explain("run", run)
|
|
3655
|
+
};
|
|
3656
|
+
}
|
|
3657
|
+
//#endregion
|
|
3268
3658
|
//#region ../client/src/resources/timeline-event.ts
|
|
3269
3659
|
function timelineEventResource(transport) {
|
|
3270
3660
|
/** Get one timeline event by id. */
|
|
@@ -3964,21 +4354,24 @@ function transformResource(transport) {
|
|
|
3964
4354
|
/**
|
|
3965
4355
|
* Start a run of a transform by id. The server queues the run and answers at once; `wait` polls
|
|
3966
4356
|
* it to a terminal status, and `syncTarget` follows that with the output table's registration.
|
|
3967
|
-
*
|
|
4357
|
+
* Both waits share the one deadline `wait.timeoutMs` sets, or none when it is `null`. A server
|
|
4358
|
+
* that answers no run id started nothing, and there is then nothing to poll.
|
|
3968
4359
|
*/
|
|
3969
4360
|
async function run(id, params = {}, options = {}) {
|
|
4361
|
+
const requested = params.syncTarget === true ? params.wait ?? {} : params.wait;
|
|
4362
|
+
const deadline = requested === void 0 ? null : startDeadline(requested);
|
|
3970
4363
|
const kickoff = await transport.requestParsed(TransformRunKickoff, `/api/transform/${id}/run`, {
|
|
3971
4364
|
...options,
|
|
3972
4365
|
method: "POST"
|
|
3973
4366
|
});
|
|
3974
|
-
|
|
3975
|
-
if (schedule === void 0 || kickoff.run_id === null) return {
|
|
4367
|
+
if (requested === void 0 || kickoff.run_id === null) return {
|
|
3976
4368
|
message: kickoff.message,
|
|
3977
4369
|
run_id: kickoff.run_id,
|
|
3978
4370
|
final: null
|
|
3979
4371
|
};
|
|
4372
|
+
const schedule = callWait(requested, options);
|
|
3980
4373
|
const runId = kickoff.run_id;
|
|
3981
|
-
const final = await
|
|
4374
|
+
const final = await pollWithin(deadline, async (signal) => getRun(runId, {
|
|
3982
4375
|
...options,
|
|
3983
4376
|
signal
|
|
3984
4377
|
}), (candidate) => isTransformRunTerminal(candidate.status), schedule);
|
|
@@ -3987,7 +4380,7 @@ function transformResource(transport) {
|
|
|
3987
4380
|
run_id: runId,
|
|
3988
4381
|
final
|
|
3989
4382
|
};
|
|
3990
|
-
const targetTableId = isTransformRunFailed(final.status) ? null : await awaitTargetTableId(id, schedule, options);
|
|
4383
|
+
const targetTableId = isTransformRunFailed(final.status) ? null : await awaitTargetTableId(id, deadline, schedule, options);
|
|
3991
4384
|
return {
|
|
3992
4385
|
message: kickoff.message,
|
|
3993
4386
|
run_id: runId,
|
|
@@ -3995,9 +4388,9 @@ function transformResource(transport) {
|
|
|
3995
4388
|
target_table_id: targetTableId
|
|
3996
4389
|
};
|
|
3997
4390
|
}
|
|
3998
|
-
async function awaitTargetTableId(id, wait, options) {
|
|
4391
|
+
async function awaitTargetTableId(id, deadline, wait, options) {
|
|
3999
4392
|
try {
|
|
4000
|
-
return (await
|
|
4393
|
+
return (await pollWithin(deadline, async (signal) => get(id, {
|
|
4001
4394
|
...options,
|
|
4002
4395
|
signal
|
|
4003
4396
|
}), (transform) => transform.target_table_id !== null, wait)).target_table_id;
|
|
@@ -4006,6 +4399,12 @@ function transformResource(transport) {
|
|
|
4006
4399
|
throw error;
|
|
4007
4400
|
}
|
|
4008
4401
|
}
|
|
4402
|
+
function callWait(wait, options) {
|
|
4403
|
+
return {
|
|
4404
|
+
...wait,
|
|
4405
|
+
signal: combineAborts(wait.signal, options.signal, transport.signal)
|
|
4406
|
+
};
|
|
4407
|
+
}
|
|
4009
4408
|
return {
|
|
4010
4409
|
list: explain("list", list),
|
|
4011
4410
|
get: explain("get", get),
|
|
@@ -4196,20 +4595,217 @@ CurrentUser.pick({
|
|
|
4196
4595
|
common_name: true,
|
|
4197
4596
|
is_superuser: true
|
|
4198
4597
|
}).strip();
|
|
4598
|
+
const User = z.object({
|
|
4599
|
+
id: z.number().int(),
|
|
4600
|
+
email: z.string(),
|
|
4601
|
+
first_name: z.string().nullable(),
|
|
4602
|
+
last_name: z.string().nullable(),
|
|
4603
|
+
common_name: z.string(),
|
|
4604
|
+
is_superuser: z.boolean().optional(),
|
|
4605
|
+
is_active: z.boolean().optional()
|
|
4606
|
+
}).loose();
|
|
4607
|
+
User.pick({
|
|
4608
|
+
id: true,
|
|
4609
|
+
email: true,
|
|
4610
|
+
common_name: true,
|
|
4611
|
+
is_superuser: true
|
|
4612
|
+
}).strip();
|
|
4613
|
+
z.enum([
|
|
4614
|
+
"active",
|
|
4615
|
+
"deactivated",
|
|
4616
|
+
"all"
|
|
4617
|
+
]);
|
|
4618
|
+
z.object({
|
|
4619
|
+
first_name: z.string().min(1).nullable().optional(),
|
|
4620
|
+
last_name: z.string().min(1).nullable().optional(),
|
|
4621
|
+
email: z.string(),
|
|
4622
|
+
password: z.string().min(1).nullable().optional()
|
|
4623
|
+
}).strict();
|
|
4199
4624
|
//#endregion
|
|
4200
4625
|
//#region ../client/src/resources/user.ts
|
|
4626
|
+
const UserList = z.object({
|
|
4627
|
+
data: z.array(User),
|
|
4628
|
+
total: z.number().int().nonnegative()
|
|
4629
|
+
});
|
|
4201
4630
|
function userResource(transport) {
|
|
4202
4631
|
/** Get the user the request's credentials authenticate as. */
|
|
4203
4632
|
async function current(options = {}) {
|
|
4204
4633
|
return transport.requestParsed(CurrentUser, "/api/user/current", { ...options });
|
|
4205
4634
|
}
|
|
4206
|
-
|
|
4635
|
+
/**
|
|
4636
|
+
* List the users, ordered by first name. Needs an admin, a data analyst or a group manager, who
|
|
4637
|
+
* sees the members of the groups they manage; a sandboxed user sees only themselves. Which
|
|
4638
|
+
* columns each user carries depends on the caller, as `User` says.
|
|
4639
|
+
*/
|
|
4640
|
+
async function list(params = {}, options = {}) {
|
|
4641
|
+
const response = await transport.requestParsed(UserList, "/api/user", {
|
|
4642
|
+
...options,
|
|
4643
|
+
query: {
|
|
4644
|
+
status: params.status,
|
|
4645
|
+
query: params.query,
|
|
4646
|
+
group_id: params.group_id
|
|
4647
|
+
}
|
|
4648
|
+
});
|
|
4649
|
+
return {
|
|
4650
|
+
data: response.data,
|
|
4651
|
+
total: response.total
|
|
4652
|
+
};
|
|
4653
|
+
}
|
|
4654
|
+
/**
|
|
4655
|
+
* Create a user and send the invite. Admin only. Without a password the account gets a random
|
|
4656
|
+
* one, so it can sign in only through the invite. A taken email answers 400 naming `email`.
|
|
4657
|
+
*/
|
|
4658
|
+
async function create(params, options = {}) {
|
|
4659
|
+
return transport.requestParsed(User, "/api/user", {
|
|
4660
|
+
...options,
|
|
4661
|
+
method: "POST",
|
|
4662
|
+
body: params
|
|
4663
|
+
});
|
|
4664
|
+
}
|
|
4665
|
+
return {
|
|
4666
|
+
current,
|
|
4667
|
+
list,
|
|
4668
|
+
create
|
|
4669
|
+
};
|
|
4670
|
+
}
|
|
4671
|
+
//#endregion
|
|
4672
|
+
//#region ../client/src/domain/workspace-instance.ts
|
|
4673
|
+
const WorkspaceInstanceOutput = z.object({
|
|
4674
|
+
db: z.string().nullable().optional(),
|
|
4675
|
+
schema: z.string().nullable().optional()
|
|
4676
|
+
}).loose();
|
|
4677
|
+
const WorkspaceInstanceDatabase = z.object({
|
|
4678
|
+
input_schemas: z.array(z.string()),
|
|
4679
|
+
output: WorkspaceInstanceOutput
|
|
4680
|
+
}).loose();
|
|
4681
|
+
const WorkspaceInstance = z.object({
|
|
4682
|
+
name: z.string(),
|
|
4683
|
+
databases: z.record(z.string(), WorkspaceInstanceDatabase),
|
|
4684
|
+
can_write: z.boolean()
|
|
4685
|
+
}).loose();
|
|
4686
|
+
WorkspaceInstance.pick({
|
|
4687
|
+
name: true,
|
|
4688
|
+
can_write: true
|
|
4689
|
+
}).strip();
|
|
4690
|
+
//#endregion
|
|
4691
|
+
//#region ../client/src/resources/workspace-instance.ts
|
|
4692
|
+
const WorkspaceInstanceEnvelope = z.object({ data: WorkspaceInstance.nullable() }).loose();
|
|
4693
|
+
function workspaceInstanceResource(transport) {
|
|
4694
|
+
const { explain } = explainer(transport, "workspaceInstance");
|
|
4695
|
+
/**
|
|
4696
|
+
* The workspace loaded on this instance, from its `config.yml` at boot or set at runtime; admins
|
|
4697
|
+
* only. `null` when none is loaded, as on a manager-only instance. `can_write` is `false` when
|
|
4698
|
+
* deployment config set the workspace, which then cannot be changed at runtime.
|
|
4699
|
+
*/
|
|
4700
|
+
async function current(options = {}) {
|
|
4701
|
+
return (await transport.requestParsed(WorkspaceInstanceEnvelope, "/api/ee/workspace-instance/current", { ...options })).data;
|
|
4702
|
+
}
|
|
4703
|
+
return { current: explain("current", current) };
|
|
4704
|
+
}
|
|
4705
|
+
//#endregion
|
|
4706
|
+
//#region ../client/src/domain/workspace.ts
|
|
4707
|
+
const WorkspaceDatabaseStatus = z.enum([
|
|
4708
|
+
"unprovisioned",
|
|
4709
|
+
"provisioning",
|
|
4710
|
+
"provisioned",
|
|
4711
|
+
"deprovisioning"
|
|
4712
|
+
]);
|
|
4713
|
+
const WorkspaceDatabase = z.object({
|
|
4714
|
+
database_id: z.number().int(),
|
|
4715
|
+
input_schemas: z.array(z.string()),
|
|
4716
|
+
output_namespace: z.string(),
|
|
4717
|
+
status: WorkspaceDatabaseStatus
|
|
4718
|
+
}).loose();
|
|
4719
|
+
const WorkspaceDatabaseCompact = WorkspaceDatabase.pick({
|
|
4720
|
+
database_id: true,
|
|
4721
|
+
status: true
|
|
4722
|
+
}).strip();
|
|
4723
|
+
const WorkspaceCreator = z.object({
|
|
4724
|
+
id: z.number().int(),
|
|
4725
|
+
first_name: z.string().nullable(),
|
|
4726
|
+
last_name: z.string().nullable(),
|
|
4727
|
+
email: z.string(),
|
|
4728
|
+
common_name: z.string().nullable().optional()
|
|
4729
|
+
}).loose();
|
|
4730
|
+
const Workspace = z.object({
|
|
4731
|
+
id: z.number().int().positive(),
|
|
4732
|
+
name: z.string(),
|
|
4733
|
+
creator: WorkspaceCreator.nullable(),
|
|
4734
|
+
created_at: z.string(),
|
|
4735
|
+
updated_at: z.string(),
|
|
4736
|
+
databases: z.array(WorkspaceDatabase).optional()
|
|
4737
|
+
}).loose();
|
|
4738
|
+
Workspace.pick({
|
|
4739
|
+
id: true,
|
|
4740
|
+
name: true
|
|
4741
|
+
}).strip().extend({ databases: z.array(WorkspaceDatabaseCompact).optional() });
|
|
4742
|
+
z.object({
|
|
4743
|
+
name: z.string().min(1),
|
|
4744
|
+
database_ids: z.array(z.number().int().positive()).min(1)
|
|
4745
|
+
}).strict();
|
|
4746
|
+
//#endregion
|
|
4747
|
+
//#region ../client/src/resources/workspace-manager.ts
|
|
4748
|
+
const WORKSPACE_MANAGER_PATH = "/api/ee/workspace-manager";
|
|
4749
|
+
function workspaceManagerResource(transport) {
|
|
4750
|
+
const { explain } = explainer(transport, "workspaceManager");
|
|
4751
|
+
/** List all workspaces, each with its databases; admins only. `GET /api/ee/workspace-manager` answers a bare array. */
|
|
4752
|
+
async function list(options = {}) {
|
|
4753
|
+
return {
|
|
4754
|
+
data: await transport.requestParsed(z.array(Workspace), WORKSPACE_MANAGER_PATH, { ...options }),
|
|
4755
|
+
total: null
|
|
4756
|
+
};
|
|
4757
|
+
}
|
|
4758
|
+
/** Get a single workspace by id. */
|
|
4759
|
+
async function get(id, options = {}) {
|
|
4760
|
+
return transport.requestParsed(Workspace, `${WORKSPACE_MANAGER_PATH}/${id}`, { ...options });
|
|
4761
|
+
}
|
|
4762
|
+
/**
|
|
4763
|
+
* Create a workspace attached to the given databases, each of which must be eligible for
|
|
4764
|
+
* workspaces, and provision it. The server provisions every database before it answers, so the
|
|
4765
|
+
* caller sets a `timeoutMs` long enough for that. A provisioning failure whose cleanup also fails
|
|
4766
|
+
* answers the workspace with its databases `unprovisioned`, to be torn down by a delete.
|
|
4767
|
+
*/
|
|
4768
|
+
async function create(params, options = {}) {
|
|
4769
|
+
return transport.requestParsed(Workspace, WORKSPACE_MANAGER_PATH, {
|
|
4770
|
+
...options,
|
|
4771
|
+
method: "POST",
|
|
4772
|
+
body: params
|
|
4773
|
+
});
|
|
4774
|
+
}
|
|
4775
|
+
/**
|
|
4776
|
+
* Delete a workspace, tearing down every database's warehouse isolation first. When any teardown
|
|
4777
|
+
* fails the workspace is kept with the failed databases, so the delete can be retried.
|
|
4778
|
+
*/
|
|
4779
|
+
async function remove(id, options = {}) {
|
|
4780
|
+
await transport.requestRaw(`${WORKSPACE_MANAGER_PATH}/${id}`, {
|
|
4781
|
+
...options,
|
|
4782
|
+
method: "DELETE",
|
|
4783
|
+
expectContentType: "binary"
|
|
4784
|
+
});
|
|
4785
|
+
}
|
|
4786
|
+
/**
|
|
4787
|
+
* The workspace's developer-instance config, the YAML a Metabase boots from. It holds the
|
|
4788
|
+
* workspace's warehouse login. The server refuses with 409 while any of its databases is not
|
|
4789
|
+
* `provisioned`.
|
|
4790
|
+
*/
|
|
4791
|
+
async function config(id, options = {}) {
|
|
4792
|
+
return (await transport.requestRaw(`${WORKSPACE_MANAGER_PATH}/${id}/config`, {
|
|
4793
|
+
...options,
|
|
4794
|
+
expectContentType: "binary"
|
|
4795
|
+
})).text();
|
|
4796
|
+
}
|
|
4797
|
+
return {
|
|
4798
|
+
list: explain("list", list),
|
|
4799
|
+
get: explain("get", get),
|
|
4800
|
+
create: explain("create", create),
|
|
4801
|
+
delete: explain("delete", remove),
|
|
4802
|
+
config: explain("config", config)
|
|
4803
|
+
};
|
|
4207
4804
|
}
|
|
4208
4805
|
//#endregion
|
|
4209
4806
|
//#region ../client/src/client.ts
|
|
4210
4807
|
var client_exports = /* @__PURE__ */ __exportAll({ createClient: () => createClient });
|
|
4211
|
-
function
|
|
4212
|
-
const transport = createTransport(config, options);
|
|
4808
|
+
function surfaceOn(transport) {
|
|
4213
4809
|
return {
|
|
4214
4810
|
apiKey: apiKeyResource(transport),
|
|
4215
4811
|
card: cardResource(transport),
|
|
@@ -4227,8 +4823,10 @@ function createClient(config, options) {
|
|
|
4227
4823
|
field: fieldResource(transport),
|
|
4228
4824
|
gitSync: gitSyncResource(transport),
|
|
4229
4825
|
glossary: glossaryResource(transport),
|
|
4826
|
+
health: healthResource(transport),
|
|
4230
4827
|
library: libraryResource(transport),
|
|
4231
4828
|
measure: measureResource(transport),
|
|
4829
|
+
metadataSync: metadataSyncResource(transport),
|
|
4232
4830
|
metric: metricResource(transport),
|
|
4233
4831
|
moderationReview: moderationReviewResource(transport),
|
|
4234
4832
|
notification: notificationResource(transport),
|
|
@@ -4243,6 +4841,7 @@ function createClient(config, options) {
|
|
|
4243
4841
|
setup: setupResource(transport),
|
|
4244
4842
|
snippet: snippetResource(transport),
|
|
4245
4843
|
table: tableResource(transport),
|
|
4844
|
+
task: taskResource(transport),
|
|
4246
4845
|
timeline: timelineResource(transport),
|
|
4247
4846
|
timelineEvent: timelineEventResource(transport),
|
|
4248
4847
|
transform: transformResource(transport),
|
|
@@ -4254,6 +4853,8 @@ function createClient(config, options) {
|
|
|
4254
4853
|
transformTest: transformTestResource(transport),
|
|
4255
4854
|
upload: uploadResource(transport),
|
|
4256
4855
|
user: userResource(transport),
|
|
4856
|
+
workspaceInstance: workspaceInstanceResource(transport),
|
|
4857
|
+
workspaceManager: workspaceManagerResource(transport),
|
|
4257
4858
|
server: transport.server,
|
|
4258
4859
|
verifiedServer: transport.verifiedServer,
|
|
4259
4860
|
probesSettled: transport.probesSettled,
|
|
@@ -4262,5 +4863,70 @@ function createClient(config, options) {
|
|
|
4262
4863
|
requestStream: transport.requestStream
|
|
4263
4864
|
};
|
|
4264
4865
|
}
|
|
4866
|
+
function createClient(config, options) {
|
|
4867
|
+
const observers = options.onError === void 0 ? [] : [options.onError];
|
|
4868
|
+
return clientOn(createTransport(config, options), observers);
|
|
4869
|
+
}
|
|
4870
|
+
function clientOn(transport, observers) {
|
|
4871
|
+
const client = {
|
|
4872
|
+
...surfaceOn(transport),
|
|
4873
|
+
with: (derived) => {
|
|
4874
|
+
const inherited = derived.onError === void 0 ? observers : [derived.onError, ...observers];
|
|
4875
|
+
return clientOn(transport.with(derived), inherited);
|
|
4876
|
+
}
|
|
4877
|
+
};
|
|
4878
|
+
return observers.length === 0 ? client : observed(client, observers);
|
|
4879
|
+
}
|
|
4880
|
+
function observed(surface, observers) {
|
|
4881
|
+
const namespaces = /* @__PURE__ */ new Map();
|
|
4882
|
+
return new Proxy(surface, { get(target, property, receiver) {
|
|
4883
|
+
const value = Reflect.get(target, property, receiver);
|
|
4884
|
+
if (typeof value === "function") return (...args) => observedCall(() => Reflect.apply(value, target, args), observers);
|
|
4885
|
+
if (typeof value !== "object" || value === null) return value;
|
|
4886
|
+
const known = namespaces.get(property);
|
|
4887
|
+
if (known !== void 0) return known;
|
|
4888
|
+
const namespace = observed(value, observers);
|
|
4889
|
+
namespaces.set(property, namespace);
|
|
4890
|
+
return namespace;
|
|
4891
|
+
} });
|
|
4892
|
+
}
|
|
4893
|
+
function observedCall(call, observers) {
|
|
4894
|
+
let result;
|
|
4895
|
+
try {
|
|
4896
|
+
result = call();
|
|
4897
|
+
} catch (error) {
|
|
4898
|
+
throw shown(error, observers);
|
|
4899
|
+
}
|
|
4900
|
+
if (result instanceof Promise) return result.catch((error) => {
|
|
4901
|
+
throw shown(error, observers);
|
|
4902
|
+
});
|
|
4903
|
+
if (isAsyncIterable(result)) return observedWalk(result, observers);
|
|
4904
|
+
return result;
|
|
4905
|
+
}
|
|
4906
|
+
async function* observedWalk(walk, observers) {
|
|
4907
|
+
try {
|
|
4908
|
+
yield* walk;
|
|
4909
|
+
} catch (error) {
|
|
4910
|
+
throw shown(error, observers);
|
|
4911
|
+
}
|
|
4912
|
+
}
|
|
4913
|
+
function shown(error, observers) {
|
|
4914
|
+
let first = null;
|
|
4915
|
+
for (const observer of observers) try {
|
|
4916
|
+
showTo(observer, error);
|
|
4917
|
+
} catch (thrown) {
|
|
4918
|
+
first ??= { thrown };
|
|
4919
|
+
}
|
|
4920
|
+
return first === null ? error : first.thrown;
|
|
4921
|
+
}
|
|
4922
|
+
function showTo(observer, error) {
|
|
4923
|
+
const answer = observer(error);
|
|
4924
|
+
if (!isThenable(answer)) return;
|
|
4925
|
+
Promise.resolve(answer).catch(() => void 0);
|
|
4926
|
+
throw new ConfigError("An error observer answered a promise. An observer runs synchronously and is not awaited.");
|
|
4927
|
+
}
|
|
4928
|
+
function isAsyncIterable(value) {
|
|
4929
|
+
return typeof value === "object" && value !== null && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function";
|
|
4930
|
+
}
|
|
4265
4931
|
//#endregion
|
|
4266
4932
|
export { createClient as n, client_exports as t };
|