@metabase/cli 0.5.15 → 0.5.17-alpha.verification.b5c6485
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-D30qU1SE.mjs → add-collection-Bj9NfvnN.mjs} +5 -5
- package/dist/{alert-CLy5NRg3.mjs → alert-CMshuKkD.mjs} +7 -7
- package/dist/{alerts-BXHkWivX.mjs → alerts-DNfvRAHF.mjs} +4 -4
- package/dist/api-key-AnD8WQtk.mjs +13 -0
- package/dist/{append-D4bPgSGU.mjs → append-B6NKVXmC.mjs} +4 -4
- package/dist/{archive-YhW3w3Jq.mjs → archive-BHwRFiIp.mjs} +3 -3
- package/dist/{archive-BFQabWYH.mjs → archive-BigVLFhO.mjs} +5 -5
- package/dist/{archive-DAqrebLd.mjs → archive-BymwF3JK.mjs} +3 -3
- package/dist/{archive-Cpw0tq5x.mjs → archive-CnScSiQl.mjs} +3 -3
- package/dist/{archive-B2LAkxKw.mjs → archive-CsxKuct2.mjs} +3 -3
- package/dist/{archive-_e3nTRpx.mjs → archive-DASCU44R.mjs} +3 -3
- package/dist/{archive-CDp0guZf.mjs → archive-DFSuRpQU.mjs} +5 -5
- package/dist/{archive-BydHBM_q.mjs → archive-DQL3uq3S.mjs} +3 -3
- package/dist/{archive-urzxJxg_.mjs → archive-DXD8E-tc.mjs} +5 -5
- package/dist/{archive-BTDpsE0C.mjs → archive-fDo0iMXZ.mjs} +3 -3
- package/dist/{archive-BXvrDuC2.mjs → archive-wKfb5LNv.mjs} +3 -3
- package/dist/{archive-DRfXwyO7.mjs → archive-xGLFsqVv.mjs} +3 -3
- package/dist/{auth-Bc3Qjv44.mjs → auth-CNDQbQXF.mjs} +5 -5
- package/dist/{branch-flag-BvIdNB5z.mjs → branch-flag-kZkAZcPJ.mjs} +1 -1
- package/dist/{branches-Cd7GQlg9.mjs → branches-CcDKZnBq.mjs} +2 -2
- package/dist/{breaking-D0rIFrsv.mjs → breaking-BEwEGyrk.mjs} +5 -5
- package/dist/{broken-DGlqpHN0.mjs → broken-Bx2JFtDZ.mjs} +7 -7
- package/dist/{bulk-discard-values-B7i0i4oO.mjs → bulk-discard-values-BQzOIue5.mjs} +4 -4
- package/dist/{bulk-edit-BZWCA8Qg.mjs → bulk-edit-DGx6in-k.mjs} +3 -3
- package/dist/{bulk-rescan-values-D2QEoPKP.mjs → bulk-rescan-values-DGlGDhXf.mjs} +3 -3
- package/dist/{bulk-sync-schema-CIJ6mtAm.mjs → bulk-sync-schema-BttWpXxE.mjs} +3 -3
- package/dist/{cancel-Dj3QbuvX.mjs → cancel-DdhLoGp1.mjs} +3 -3
- package/dist/{cancel-task-D1zqwZQ-.mjs → cancel-task-D28bHXK_.mjs} +4 -4
- package/dist/card-Jy0kBLqO.mjs +25 -0
- package/dist/{cards-B3jsUhZo.mjs → cards-BXiY52Nm.mjs} +5 -5
- package/dist/{ci-CiOiwYSt.mjs → ci-D97nJ6-1.mjs} +2 -2
- package/dist/cli.mjs +205 -101
- package/dist/{client-DwXumdNR.mjs → client-C3lyoltK.mjs} +696 -52
- package/dist/{collection-Cz2qLX2m.mjs → collection-875u7UiH.mjs} +11 -2
- package/dist/{collection-Bf3lv-zo.mjs → collection-CcagB_dn.mjs} +1 -1
- package/dist/collection-CsWEl350.mjs +21 -0
- package/dist/{collection-namespace-lQLOPUbc.mjs → collection-namespace-BHGpFZ3M.mjs} +2 -2
- package/dist/{content-translation-QrjT3ghj.mjs → content-translation-C8Z06-vg.mjs} +3 -3
- package/dist/{copy-DtswBE5q.mjs → copy-FIxCe679.mjs} +6 -6
- package/dist/{copy-1idMeMJY.mjs → copy-UIDZe3Qc.mjs} +6 -6
- package/dist/{copy-flags-Bgy3sSFg.mjs → copy-flags-D_lqBhi8.mjs} +2 -2
- package/dist/{create-CdU7On_U.mjs → create-0UemhsxL.mjs} +2 -2
- package/dist/{create-CFMSVtSo.mjs → create-3fsDGV9E.mjs} +2 -2
- package/dist/{create-G9H_AOv02.mjs → create-Au6xqgIO2.mjs} +4 -4
- package/dist/{create-oIakxZ9t.mjs → create-BI-do2mK.mjs} +2 -2
- package/dist/{create-DGaRjgUc.mjs → create-BabzAD_X.mjs} +2 -2
- package/dist/{create-Cvg0l8m6.mjs → create-Bpwl2GQ3.mjs} +5 -5
- package/dist/{create-Bu90-9QW.mjs → create-Buvd5NBb.mjs} +2 -2
- package/dist/{create-xEauTQSJ.mjs → create-C3JXunBQ.mjs} +2 -2
- package/dist/{create-Cszxr6lW.mjs → create-CUUp0UyT.mjs} +4 -4
- package/dist/{create-B2F2hF7l.mjs → create-CazoyArr.mjs} +3 -3
- package/dist/{create-BRnGJcO6.mjs → create-D-2RdE2_.mjs} +3 -3
- package/dist/{create-CnmJvRXS.mjs → create-DJjRunsw.mjs} +3 -3
- package/dist/{create-BV-SrbXX.mjs → create-DaE_oGxs.mjs} +3 -3
- package/dist/{create-DpsgXiEm.mjs → create-DoVQrBJ4.mjs} +2 -2
- package/dist/{create-CbVaoxSD.mjs → create-DwY140oE.mjs} +2 -2
- package/dist/{create-CKv0cyLY.mjs → create-bksqNBGg.mjs} +2 -2
- package/dist/{create-branch-CmODdn50.mjs → create-branch-Dwdy7irk.mjs} +5 -5
- package/dist/{create-DQcgy5Q0.mjs → create-gMYMUL7t.mjs} +5 -5
- package/dist/{create-ClVfLAft.mjs → create-hvtusQEZ.mjs} +5 -5
- package/dist/{create-D68hHtdo.mjs → create-lu1w-Hbw.mjs} +4 -4
- package/dist/{csv-DNmc_fOK.mjs → csv-DsE_ndhE.mjs} +4 -4
- package/dist/{current-task-CeRGE__b.mjs → current-task-DRNyn9QX.mjs} +4 -4
- package/dist/{dashboard-Bx2sYijR.mjs → dashboard-CLvvUUuF.mjs} +1 -1
- package/dist/{dashboard-Cwsf-e9T.mjs → dashboard-D5BJZS3L.mjs} +1 -1
- package/dist/dashboard-DvoGk7ty.mjs +35 -0
- package/dist/data-action-KdcOST0y.mjs +24 -0
- package/dist/{data-app-BuLvZSDE.mjs → data-app-BMfcgWaI.mjs} +9 -9
- package/dist/{data-app-CH_n_hm5.mjs → data-app-C7LHb5xd.mjs} +34 -9
- package/dist/{data-app-project-CBUfgpZ5.mjs → data-app-project-BBWM7Zdk.mjs} +5 -5
- package/dist/{data-app-DtoVnXLK.mjs → data-app-s9hkfhiu.mjs} +1 -1
- 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-BP4PwmIE.mjs → db-C-UN7Mw7.mjs} +8 -8
- package/dist/{delete-DmGBSj78.mjs → delete-B5RQJybZ.mjs} +4 -4
- package/dist/{delete-93l-tXV3.mjs → delete-BxHxz81i.mjs} +4 -4
- package/dist/{delete-qmBCJgJq.mjs → delete-BycN1h3j.mjs} +4 -4
- package/dist/{delete-BGCbgtRr.mjs → delete-CEjfhdrB.mjs} +4 -4
- package/dist/{delete-BZCd5BYo.mjs → delete-Cnv4Bp9r.mjs} +4 -4
- package/dist/{delete-D7ZYt-k5.mjs → delete-DOStUKHR.mjs} +4 -4
- package/dist/{delete-BGQnoAzv.mjs → delete-DtZUEUck.mjs} +4 -4
- package/dist/{delete-BVFSQmcO.mjs → delete-RhO0HMY8.mjs} +4 -4
- package/dist/{delete-runtime-Bxy6qAqZ.mjs → delete-runtime-Cxw6w3Jg.mjs} +1 -1
- package/dist/{delete-table-BfIsHNcl.mjs → delete-table-BkrSMJ6s.mjs} +4 -4
- package/dist/{delete-0bKnNWSH.mjs → delete-woVgrl8z.mjs} +4 -4
- package/dist/{dependencies-zN9W9GvR.mjs → dependencies-DlrwzY_z.mjs} +3 -3
- package/dist/{dependency-C1DExO6k.mjs → dependency-00_O1kxU.mjs} +1 -1
- package/dist/{dependency-DdeyH8m5.mjs → dependency-C4b_A3_L.mjs} +1 -1
- package/dist/dependency-I9bjDqIy.mjs +15 -0
- package/dist/{dependents-BB_HFnA9.mjs → dependents-DyiLbk63.mjs} +8 -8
- package/dist/{dirty-Bs9W2YxG.mjs → dirty-CnlYt6E6.mjs} +4 -4
- package/dist/{discard-values-73ICAtjS.mjs → discard-values-4FiVdoR1.mjs} +4 -4
- package/dist/document-CPA4VsKw.mjs +20 -0
- package/dist/{document-lS1XZEF3.mjs → document-PQg8DshK.mjs} +1 -1
- package/dist/{document-BHOQq2T_.mjs → document-ks1uxhBt.mjs} +1 -1
- package/dist/{download-Ere1aYpA.mjs → download-CsrJ5AtI.mjs} +2 -2
- package/dist/{eid-CjxnfzhJ.mjs → eid-Da_G_-sZ.mjs} +3 -3
- package/dist/{embedding-sdk-Cc-Gkx8f.mjs → embedding-sdk-u_7nTdoy.mjs} +2 -2
- package/dist/{entity-DICgy4Bl.mjs → entity-DBcuKQtX.mjs} +2 -2
- package/dist/{entry-flags-BWU67tHw.mjs → entry-flags-D7BhJxIr.mjs} +3 -3
- package/dist/{events-C7xDXMQ9.mjs → events-CnJ7Rwtn.mjs} +3 -3
- package/dist/{execute-Dp7vtu2S.mjs → execute-CWdVreci.mjs} +3 -3
- package/dist/{export-BiiLymvS.mjs → export-T7nyfMGZ.mjs} +8 -8
- package/dist/{export-flags-DkbYlWlE.mjs → export-flags-BbmWODey.mjs} +2 -2
- package/dist/{export-preflight-DkmL9u_D.mjs → export-preflight-BltqMU8P.mjs} +5 -5
- package/dist/field-DquBSVH3.mjs +21 -0
- package/dist/{fields-zT_fZ8pO.mjs → fields-D6L8qD0M.mjs} +3 -3
- package/dist/{filter-flags-B5jGUuHb.mjs → filter-flags-BEdazLt3.mjs} +3 -3
- package/dist/{fks-2Z8u2dFl.mjs → fks-B5_IvC2f.mjs} +3 -3
- package/dist/{generate-actions-BqgmvBsA.mjs → generate-actions-CFJ_ghia.mjs} +5 -5
- package/dist/{generate-queries-sM3huG_U.mjs → generate-queries-DTkjAUEC.mjs} +5 -5
- package/dist/{generate-schema-wCEAbSYP.mjs → generate-schema-z8tuKZdY.mjs} +5 -5
- package/dist/{get-CHj0XgI-.mjs → get-4Polb4EY.mjs} +3 -3
- package/dist/{get-Dw_du_8L.mjs → get-7aQ6kB1P.mjs} +5 -5
- package/dist/{get-c5DGCNxp.mjs → get-B4xNfH3p.mjs} +5 -5
- package/dist/{get-B156kyb9.mjs → get-BFdBm5Yv.mjs} +3 -3
- package/dist/{get-Bxac5l00.mjs → get-BGnE-1e0.mjs} +3 -3
- package/dist/{get-D4MRNMNY.mjs → get-BQvkMnCE.mjs} +5 -5
- package/dist/{get-B6TK1fZd.mjs → get-BRjcNZro.mjs} +5 -5
- package/dist/{get-WD9J1FNF.mjs → get-BZpdNUMg.mjs} +3 -3
- package/dist/{get-DhOAEGeW.mjs → get-BoYBPOre.mjs} +3 -3
- package/dist/{get-CY6kB39r.mjs → get-BzHlTaIt.mjs} +3 -3
- package/dist/{get-B7BIVai8.mjs → get-CCODVqkM.mjs} +4 -4
- package/dist/{get-BouNHlLd.mjs → get-CPJ79uJS.mjs} +3 -3
- package/dist/{get-C-NMvcFz.mjs → get-CPTbKAkr.mjs} +3 -3
- package/dist/{get-FlSUxV6s.mjs → get-CmAfytZm.mjs} +4 -4
- package/dist/{get-aG_7tCJo.mjs → get-Co_dWeNO.mjs} +3 -3
- package/dist/{get-DVVhS9Kf.mjs → get-D83daNye.mjs} +3 -3
- package/dist/{get-5cOq5EcT.mjs → get-DRTQCy8i.mjs} +3 -3
- package/dist/{get-DaEGdDym.mjs → get-DWxbhLGD.mjs} +3 -3
- package/dist/{get-BEFSN-Sr.mjs → get-DZ0Y723i.mjs} +3 -3
- package/dist/{get-Bd5YzOcp.mjs → get-Ia79m3fd.mjs} +5 -5
- package/dist/{get-y1uuW6GG.mjs → get-NFhCBU6R.mjs} +3 -3
- package/dist/{get-BB1mvjVS.mjs → get-rSBE94TP.mjs} +3 -3
- package/dist/{get-run-Ca7sbGMY.mjs → get-run-DlpRMIC1.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-u9IUnjvH.mjs +29 -0
- package/dist/glossary-CVhKIwOq.mjs +14 -0
- package/dist/{glossary-iPIWrEbP.mjs → glossary-CnSPXHAd.mjs} +1 -1
- package/dist/{glossary-CQRW3Z4d.mjs → glossary-z3Nvbo2P.mjs} +1 -1
- package/dist/{graph-BwXxctfj.mjs → graph-CDzK39x5.mjs} +6 -6
- package/dist/{group-DxaqX3Gg.mjs → group-W6sZ0eWr.mjs} +1 -1
- package/dist/{has-remote-changes-CLA9S2kF.mjs → has-remote-changes-DAI22ieL.mjs} +4 -4
- package/dist/{import-Bim6i-3J.mjs → import-CvBhorpj.mjs} +8 -8
- package/dist/{is-dirty-BrhDkUzh.mjs → is-dirty-C35y7-Gk.mjs} +2 -2
- package/dist/{items-axsdskw6.mjs → items-BPeXkhSe.mjs} +5 -5
- package/dist/{key-DLrpCgdZ.mjs → key-DoqP1glp.mjs} +1 -1
- package/dist/{library-DmyueN_O.mjs → library-C1RMcmjm.mjs} +5 -5
- package/dist/{library-C4g9pdiS.mjs → library-DlJjXXJT.mjs} +1 -1
- package/dist/{library-BprxuqZl.mjs → library-DrbHqj17.mjs} +1 -1
- package/dist/{list-B851zTKo.mjs → list--qtST6Mu.mjs} +2 -2
- package/dist/{list-CNV_y-Vx.mjs → list-BFAc6oZu.mjs} +2 -2
- package/dist/{list-DJo16bF-.mjs → list-BMOhV_vf.mjs} +2 -2
- package/dist/{list-BgBhF6kO.mjs → list-BTKVHUkk.mjs} +5 -5
- package/dist/{list-BTs8ltN5.mjs → list-BTbH-TVK.mjs} +5 -5
- package/dist/{list-DpcOQVod.mjs → list-BYsQb175.mjs} +2 -2
- package/dist/{list-Cux2Dsd0.mjs → list-BaM9JWY2.mjs} +3 -3
- package/dist/{list-DSi-mIBN.mjs → list-Bjmqnc1r.mjs} +5 -5
- package/dist/{list-CLXnnYz7.mjs → list-BxUbbCRa.mjs} +2 -2
- package/dist/{list-_bJjT0S4.mjs → list-CZnf165W.mjs} +4 -4
- package/dist/{list-CqzSOPH6.mjs → list-DCTZ3KMG.mjs} +3 -3
- package/dist/{list-C12cW2CF.mjs → list-DeEkR_mM.mjs} +2 -2
- package/dist/{list-DniqxiYI.mjs → list-Dfl-nxFI.mjs} +3 -3
- package/dist/{list-MINOMgkB.mjs → list-Du0jDR1s.mjs} +4 -4
- package/dist/{list-D8mIbusJ.mjs → list-DuS4ayN2.mjs} +2 -2
- package/dist/{list-C1SDAIKE.mjs → list-OpPH1899.mjs} +2 -2
- package/dist/{list-ClaF-Fwk.mjs → list-Pse7z6Mw.mjs} +2 -2
- package/dist/{list-CGyNegj7.mjs → list-h1LmXpNZ.mjs} +4 -4
- package/dist/{list-C8opANLO.mjs → list-hwcNqDVu.mjs} +2 -2
- package/dist/{list-POxpQRgZ.mjs → list-ksxQw-0v.mjs} +5 -5
- package/dist/{list-CgX01wHI.mjs → list-rI68Y9Gz.mjs} +2 -2
- package/dist/{list-ak2IGFtQ.mjs → list-sdqp8e2x.mjs} +3 -3
- package/dist/{list-D1_LVvLi.mjs → list-uQmmcjXD.mjs} +2 -2
- package/dist/{login-BWfrq2LK.mjs → login-KFeoZ4cp.mjs} +6 -6
- package/dist/{logout-CX0GARVR.mjs → logout-ByJEvueB.mjs} +3 -3
- package/dist/{measure-Cvxdzlm1.mjs → measure-BJPVfAaG.mjs} +6 -6
- package/dist/{nano-id-DifMRIlA.mjs → nano-id-CZiRB0W_.mjs} +3 -3
- package/dist/{parameter-values-DJSnuW1D.mjs → parameter-values-B5s2INem.mjs} +5 -5
- package/dist/{parse-enum-CEXPuN9H.mjs → parse-enum-Dm1BvZRN.mjs} +1 -1
- package/dist/{parse-id-DKKwr4c8.mjs → parse-id-DSHwgzAA.mjs} +1 -1
- package/dist/{parse-ref-D28NvwpR.mjs → parse-ref-CN-6HBFM.mjs} +1 -1
- package/dist/{parse-text-C4LYzIFa.mjs → parse-text-C3VlFRgF.mjs} +1 -1
- package/dist/{path-CGH5ES93.mjs → path-DO6KvEqL.mjs} +3 -3
- package/dist/poll-1TEUi8qv.mjs +73 -0
- package/dist/{predicates-0C0TsWcJ.mjs → predicates-DQA0AsBx.mjs} +6 -2
- package/dist/{preflight-Beuxqhhf.mjs → preflight-CeXhEJfq.mjs} +3 -3
- package/dist/{process-ByKCTa6A.mjs → process-DZcS6SKr.mjs} +1 -1
- package/dist/{publish-D2sQCtDQ.mjs → publish-VqKsiioy.mjs} +5 -5
- package/dist/{query-WFOI9dQf.mjs → query-CfOj4dF5.mjs} +8 -8
- package/dist/{query-CxSlyYGh.mjs → query-D0iAwWIe.mjs} +5 -5
- package/dist/{registry-flag-DtolFl_A.mjs → registry-flag-CFPEqyNd.mjs} +3 -3
- package/dist/{remapping-DJsuXGL7.mjs → remapping-CepD_wm5.mjs} +4 -4
- package/dist/{remove-collection-BuoLzowy.mjs → remove-collection-Dyu-svGv.mjs} +5 -5
- package/dist/{render-DBx_RBQ7.mjs → render-Ck41d-L0.mjs} +2 -2
- package/dist/{replace-CC9K7tx8.mjs → replace-BSPrhltr.mjs} +4 -4
- package/dist/{requirement-check-B5HACpdc.mjs → requirement-check-CoX3mEdF.mjs} +10 -2
- package/dist/{rescan-values-CxAXiVWY.mjs → rescan-values-Cc952DEH.mjs} +3 -3
- package/dist/{rescan-values-J4mGOOrz.mjs → rescan-values-MLAz1ZbW.mjs} +5 -5
- package/dist/{run-C4QNKj9r.mjs → run-BIpGmnHS.mjs} +5 -5
- package/dist/{run-mnUtIfoN.mjs → run-CHMiJcwC.mjs} +3 -3
- package/dist/{run-DNTFr5N5.mjs → run-Cc2HW3ZI.mjs} +5 -5
- package/dist/{run-aGwA-Ga5.mjs → run-D4uxDLy7.mjs} +5 -5
- package/dist/{runs-Dt7cDHNe.mjs → runs-DUFlS3Z-.mjs} +3 -3
- package/dist/{runtime-BfdLxXUk.mjs → runtime-Hl006cLS.mjs} +68 -24
- package/dist/{scaffold-CRRhUGc0.mjs → scaffold-DtcfaLeA.mjs} +7 -7
- package/dist/{schema-B_K5xJbB.mjs → schema-6P82WjNJ.mjs} +7 -7
- package/dist/{schema-tables-Bdd6SLy2.mjs → schema-tables-DkDCq2GB.mjs} +3 -3
- package/dist/{schemas-k5bsd2El.mjs → schemas-BdcK4Qcy.mjs} +3 -3
- package/dist/{sdk-version-GkD_HErG.mjs → sdk-version-DH2fl10p.mjs} +4 -4
- package/dist/{search-DSA871U2.mjs → search-COpkYln7.mjs} +5 -5
- package/dist/{search-DWWDcNe9.mjs → search-kIoBsgMB.mjs} +5 -5
- package/dist/{segment-SzvnqP_t.mjs → segment-X6wjQqtj.mjs} +6 -6
- package/dist/{send-B3K4VGVD.mjs → send-B6n4B-Mb.mjs} +3 -3
- package/dist/{set-FVFddT0W.mjs → set-CYRe1u4c.mjs} +3 -3
- package/dist/{set-active-BaAWHrp7.mjs → set-active-RoXnJkfD.mjs} +3 -3
- package/dist/{set-data-actions-BPXU-tp0.mjs → set-data-actions-CRFOH_li.mjs} +6 -6
- package/dist/{set-enabled-CtbvYqUq.mjs → set-enabled-DfaCOQig.mjs} +6 -6
- package/dist/{set-sensitivity-M455fd_0.mjs → set-sensitivity-BRvy0pfV.mjs} +4 -4
- package/dist/{setting-CJIzc0BO.mjs → setting-DWdtp4lv.mjs} +4 -4
- package/dist/{setup-C3D0RKE5.mjs → setup-DpHz8tm9.mjs} +2 -2
- package/dist/{skills-hvbn-X5h.mjs → skills-313T3aGC.mjs} +4 -4
- package/dist/{skills-Ce2Q39eD.mjs → skills-DuP1RI1W.mjs} +3 -3
- package/dist/{slug-yZyojN0G.mjs → slug-DhT4O0Aa.mjs} +2 -2
- package/dist/snippet-uDlfAY2R.mjs +19 -0
- package/dist/{stash-BokRFGY-.mjs → stash-DJ1nYTJS.mjs} +7 -7
- package/dist/{status-Ct4UVTsB.mjs → status-DuRBpGQa.mjs} +3 -3
- package/dist/{status-Cr59wDI2.mjs → status-HUitbwTc.mjs} +5 -5
- package/dist/{subscription-CshptrPA.mjs → subscription-C_BRMkcY.mjs} +6 -6
- package/dist/{subscriptions-ClzNmBKd.mjs → subscriptions-D2sw0LRD.mjs} +4 -4
- package/dist/{summary-CcMkx7ej.mjs → summary-C4v7PVFE.mjs} +3 -3
- package/dist/{sync-schema-1tyJKchq.mjs → sync-schema-47WF7nm6.mjs} +6 -6
- package/dist/{sync-schema-Cwk5lM2l.mjs → sync-schema-CQS8hn4e.mjs} +3 -3
- package/dist/{sync-task-Gf86CU9l.mjs → sync-task-DPFDTvEe.mjs} +2 -2
- package/dist/table-Bo663yFg.mjs +26 -0
- package/dist/{table-selector-flags-FNPxRc9B.mjs → table-selector-flags-BiFCN3f-.mjs} +3 -3
- package/dist/{text-8nOxfC17.mjs → text-D1q1NlLJ.mjs} +1 -1
- package/dist/timeline-Qg-9RjSW.mjs +21 -0
- package/dist/{timeline-event-CeZqu0DS.mjs → timeline-event-Bia426Y4.mjs} +6 -6
- package/dist/transform-Catz8GdK.mjs +28 -0
- package/dist/transform-job-BcaheBK9.mjs +22 -0
- package/dist/{transform-tag-B4E2LC6U.mjs → transform-tag-aP0kvj5-.mjs} +5 -5
- package/dist/transform-test-UNNeneMm.mjs +16 -0
- package/dist/{transforms-v8NNflqZ.mjs → transforms-BpykgvzU.mjs} +3 -3
- package/dist/{transport-D2LCl_-b.mjs → transport-I0zuxki5.mjs} +118 -47
- package/dist/{tree-DHs_Yyuz.mjs → tree-DZ3YLCje.mjs} +4 -4
- package/dist/{unpublish-CBd6I4C3.mjs → unpublish-BH-8N8S9.mjs} +3 -3
- package/dist/{unreferenced-CTobwcbA.mjs → unreferenced-BGIPLLRG.mjs} +5 -5
- package/dist/{update-jdK7Q9uh.mjs → update-9WG4Ks__.mjs} +6 -6
- package/dist/{update-Ca4nMy7s.mjs → update-BHAILm8s.mjs} +3 -3
- package/dist/{update-DOddcPXO.mjs → update-BdvA1vcE.mjs} +3 -3
- package/dist/{update-D72rctnn.mjs → update-BlvNFo81.mjs} +3 -3
- package/dist/{update-DFV5fZQM.mjs → update-Bq22f7Zx.mjs} +3 -3
- package/dist/{update-DB21OTwa.mjs → update-CFZsL4Ic.mjs} +4 -4
- package/dist/{update-sKj5vBPy2.mjs → update-CGJmAKuC2.mjs} +3 -3
- package/dist/{update-VHk9PEG2.mjs → update-ChMYUZQ8.mjs} +3 -3
- package/dist/{update-Bw76FuPn.mjs → update-CnDoasSQ.mjs} +5 -5
- package/dist/{update-CCgOlOIN.mjs → update-DEDzv1mA.mjs} +7 -7
- package/dist/{update-DIUSVQG8.mjs → update-DFBfTmhv.mjs} +4 -4
- package/dist/{update-CWYKMp-Z.mjs → update-DSPTxIe4.mjs} +5 -5
- package/dist/{update-bvc5BgYW.mjs → update-DTNccf-s.mjs} +3 -3
- package/dist/{update-BoQc4Len.mjs → update-DTPwJ5xA.mjs} +6 -6
- package/dist/{update-C66SoTv3.mjs → update-DWbleEvw.mjs} +4 -4
- package/dist/{update-Bi83FT9A.mjs → update-Dnw9fBei.mjs} +3 -3
- package/dist/{update-CnULVMlb.mjs → update-Dv4Y0Jyp.mjs} +3 -3
- package/dist/{update-B1ujNpCL.mjs → update-Dyqk-Vqe.mjs} +4 -4
- package/dist/{update-dashcard-8ij_Tfj9.mjs → update-dashcard-DJGaybcJ.mjs} +5 -5
- package/dist/{update-B8njG36r.mjs → update-t5WIAXSK.mjs} +3 -3
- package/dist/{upgrade-CmeauE1i.mjs → upgrade-DGkndHKX.mjs} +5 -5
- package/dist/upload-51B4fVXD.mjs +13 -0
- package/dist/{upload-CAuuaKcD.mjs → upload-CnDHOsWN.mjs} +2 -2
- package/dist/{upload-C58DcljS.mjs → upload-CqTI_tAv.mjs} +3 -3
- package/dist/{uuid-vTjs6nvk.mjs → uuid-C_Tp0KDF.mjs} +3 -3
- package/dist/{validate-moGYlHxB.mjs → validate-CvcqIGsS.mjs} +1 -1
- package/dist/{validate-query-37KgmRbb.mjs → validate-query-D1LLmD9e.mjs} +2 -2
- package/dist/{values-DQra68x0.mjs → values-DgFZCjtq.mjs} +3 -3
- package/dist/{verify-CcTb76ts.mjs → verify-64UZkL-F.mjs} +3 -3
- package/dist/{verify-4pSA8T52.mjs → verify-CpfETbmC.mjs} +3 -3
- package/dist/{verify-Bxl60AsK.mjs → verify-DVKZxlxc.mjs} +4 -4
- package/dist/{wait-C5yiD8Tp.mjs → wait-DwbaWN87.mjs} +6 -6
- package/dist/{wait-flags-BolvOyUM.mjs → wait-flags-BlkgkiZz.mjs} +2 -2
- package/dist/{yaml-BtI8iDba.mjs → yaml-DKHMM0Qk.mjs} +1 -1
- package/package.json +1 -1
- package/skill-data/data-app/SKILL.md +4 -3
- package/dist/api-key-Ddgq2HPa.mjs +0 -13
- package/dist/card--OaYEFcp.mjs +0 -25
- package/dist/collection-BrK_6EeL.mjs +0 -21
- package/dist/dashboard-CGWYcude.mjs +0 -35
- package/dist/data-action-D82pi-Zx.mjs +0 -24
- package/dist/dependency-b2Cdsah6.mjs +0 -15
- package/dist/document-DB8MgIEA.mjs +0 -20
- package/dist/field-D6IWy2eH.mjs +0 -21
- package/dist/git-sync-C1c21Iat.mjs +0 -29
- package/dist/git-sync-DP4wQFzm.mjs +0 -147
- package/dist/glossary-BNp_owdV.mjs +0 -14
- package/dist/poll-BkowLQhl.mjs +0 -46
- package/dist/snippet-C105Zsr8.mjs +0 -19
- package/dist/table-Cw_xk0Rm.mjs +0 -26
- package/dist/timeline-yi9v6mmm.mjs +0 -21
- package/dist/transform-Buya2Otq.mjs +0 -28
- package/dist/transform-job-Dsd-7pJe.mjs +0 -22
- package/dist/transform-test-CT8eHSuK.mjs +0 -16
- package/dist/upload-BB24kAkh.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 parseJsonResult, i as methodRequirements, it as parseJsonOrPlain, r as isMethodKey, tt as errorBodyJson } 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-Hl006cLS.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-CoX3mEdF.mjs";
|
|
7
|
+
import { n as createTransport } from "./transport-I0zuxki5.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
|
-
import { a as
|
|
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-
|
|
22
|
+
import { a as DataAppEntry, n as DataApp, o as DataAppGeneratedFiles, t as DATA_APP_EDITING_GATE } from "./data-app-C7LHb5xd.mjs";
|
|
23
|
+
import { a as pollWithin, i as pollUntil, o as startDeadline, r as checkSchedule } from "./poll-1TEUi8qv.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);
|
|
@@ -421,6 +421,24 @@ function collectionResource(transport) {
|
|
|
421
421
|
total: null
|
|
422
422
|
};
|
|
423
423
|
}
|
|
424
|
+
/**
|
|
425
|
+
* List the collections the caller can read, the Library and its children among them, as
|
|
426
|
+
* `CollectionSummary`, which reads no enum, so a collection of a type or namespace this client
|
|
427
|
+
* does not know fails nothing. `archived` lists the archived collections instead of the live
|
|
428
|
+
* ones, which also leaves out the root collection.
|
|
429
|
+
*/
|
|
430
|
+
async function summaries(params = {}, options = {}) {
|
|
431
|
+
return {
|
|
432
|
+
data: await transport.requestParsed(z.array(CollectionSummary), "/api/collection", {
|
|
433
|
+
...options,
|
|
434
|
+
query: {
|
|
435
|
+
archived: params.archived,
|
|
436
|
+
...INCLUDE_LIBRARY
|
|
437
|
+
}
|
|
438
|
+
}),
|
|
439
|
+
total: null
|
|
440
|
+
};
|
|
441
|
+
}
|
|
424
442
|
/** Get one collection by id, entity id, or the `root`/`trash` alias. */
|
|
425
443
|
async function get(ref, options = {}) {
|
|
426
444
|
return transport.requestParsed(Collection, `/api/collection/${refPath(ref)}`, { ...options });
|
|
@@ -483,6 +501,7 @@ function collectionResource(transport) {
|
|
|
483
501
|
}
|
|
484
502
|
return {
|
|
485
503
|
list,
|
|
504
|
+
summaries,
|
|
486
505
|
get,
|
|
487
506
|
create,
|
|
488
507
|
update,
|
|
@@ -851,18 +870,61 @@ function dataAppResource(transport) {
|
|
|
851
870
|
total: null
|
|
852
871
|
};
|
|
853
872
|
}
|
|
854
|
-
/** Get one data app by slug; admins read disabled apps too. */
|
|
873
|
+
/** Get one data app by its slug; admins read disabled apps too. */
|
|
855
874
|
async function get(slug, options = {}) {
|
|
856
875
|
return transport.requestParsed(DataAppEntry, appPath(slug), { ...options });
|
|
857
876
|
}
|
|
858
|
-
/**
|
|
877
|
+
/** Create a data app with its resource collection and an empty bundle; it is enabled unless the body says otherwise. */
|
|
878
|
+
async function create(params, options = {}) {
|
|
879
|
+
return transport.requestParsed(DataApp, DATA_APPS_PATH, {
|
|
880
|
+
...options,
|
|
881
|
+
method: "POST",
|
|
882
|
+
body: params
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Update a data app's manifest fields, or enable or disable it. A server without `dataAppEditing`
|
|
887
|
+
* takes `enabled` alone and strips the rest, so a manifest field is refused there before the wire.
|
|
888
|
+
*/
|
|
859
889
|
async function update(slug, params, options = {}) {
|
|
890
|
+
const editsManifest = [
|
|
891
|
+
"name",
|
|
892
|
+
"description",
|
|
893
|
+
"version",
|
|
894
|
+
"bundle_path",
|
|
895
|
+
"allowed_hosts"
|
|
896
|
+
].some((key) => gateTriggered(DATA_APP_EDITING_GATE, params[key]));
|
|
897
|
+
await transport.requireFeatures(editsManifest ? [DATA_APP_EDITING_GATE.feature] : [], options);
|
|
860
898
|
return transport.requestParsed(DataApp, appPath(slug), {
|
|
861
899
|
...options,
|
|
862
900
|
method: "PUT",
|
|
863
901
|
body: params
|
|
864
902
|
});
|
|
865
903
|
}
|
|
904
|
+
/** Replace a data app's bundle with the text of a built bundle. */
|
|
905
|
+
async function updateBundle(slug, bundle, options = {}) {
|
|
906
|
+
return transport.requestParsed(DataApp, `${appPath(slug)}/bundle`, {
|
|
907
|
+
...options,
|
|
908
|
+
method: "PUT",
|
|
909
|
+
body: { bundle }
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
/** Read a data app's bundle, the text of its built JavaScript; admins read a disabled app's too. */
|
|
913
|
+
async function getBundle(slug, options = {}) {
|
|
914
|
+
return (await transport.requestRaw(`${appPath(slug)}/bundle`, {
|
|
915
|
+
...options,
|
|
916
|
+
method: "GET",
|
|
917
|
+
expectContentType: "binary"
|
|
918
|
+
})).text();
|
|
919
|
+
}
|
|
920
|
+
/** Delete a data app with its bundle, its collection and the grants on it. */
|
|
921
|
+
async function remove(slug, options = {}) {
|
|
922
|
+
await transport.requestRaw(appPath(slug), {
|
|
923
|
+
...options,
|
|
924
|
+
method: "DELETE",
|
|
925
|
+
expectContentType: "binary"
|
|
926
|
+
});
|
|
927
|
+
}
|
|
866
928
|
/** An app's `src/metabase.schema.ts`: the Library's published tables, with their fields, segments and measures, and the Library's metrics. */
|
|
867
929
|
async function generateSchema(options = {}) {
|
|
868
930
|
return transport.requestParsed(DataAppGeneratedFiles, `${DATA_APPS_PATH}/generate/schema`, { ...options });
|
|
@@ -886,7 +948,11 @@ function dataAppResource(transport) {
|
|
|
886
948
|
return {
|
|
887
949
|
list: explain("list", list),
|
|
888
950
|
get: explain("get", get),
|
|
951
|
+
create: explain("create", create),
|
|
889
952
|
update: explain("update", update),
|
|
953
|
+
getBundle: explain("getBundle", getBundle),
|
|
954
|
+
updateBundle: explain("updateBundle", updateBundle),
|
|
955
|
+
delete: explain("delete", remove),
|
|
890
956
|
generateSchema: explain("generateSchema", generateSchema),
|
|
891
957
|
generateQueries: explain("generateQueries", generateQueries),
|
|
892
958
|
generateActions: explain("generateActions", generateActions)
|
|
@@ -951,6 +1017,7 @@ function databaseResource(transport) {
|
|
|
951
1017
|
* pass `wait` to poll the database until it reports its initial sync complete.
|
|
952
1018
|
*/
|
|
953
1019
|
async function syncSchema(id, params = {}, options = {}) {
|
|
1020
|
+
checkSchedule(params.wait);
|
|
954
1021
|
const ack = await transport.requestParsed(DatabaseTaskAck, `/api/database/${id}/sync_schema`, {
|
|
955
1022
|
...options,
|
|
956
1023
|
method: "POST"
|
|
@@ -963,7 +1030,10 @@ function databaseResource(transport) {
|
|
|
963
1030
|
const database = await pollUntil(async (signal) => transport.requestParsed(Database, `/api/database/${id}`, {
|
|
964
1031
|
...options,
|
|
965
1032
|
signal
|
|
966
|
-
}), (candidate) => candidate.initial_sync_status === SYNC_COMPLETE,
|
|
1033
|
+
}), (candidate) => candidate.initial_sync_status === SYNC_COMPLETE, {
|
|
1034
|
+
...wait,
|
|
1035
|
+
signal: combineAborts(wait.signal, options.signal, transport.signal)
|
|
1036
|
+
});
|
|
967
1037
|
return {
|
|
968
1038
|
id,
|
|
969
1039
|
status: ack.status,
|
|
@@ -1468,7 +1538,6 @@ const SyncScopeCollection = Collection.pick({
|
|
|
1468
1538
|
is_remote_synced: true
|
|
1469
1539
|
}).strip();
|
|
1470
1540
|
const SyncDirtyFlag = z.object({ is_dirty: z.boolean() });
|
|
1471
|
-
const SyncDirtyList = z.object({ dirty: z.array(SyncDirtyItem) });
|
|
1472
1541
|
const SyncBranchList = z.object({ items: z.array(z.string()) });
|
|
1473
1542
|
const SyncImportStarted = z.object({
|
|
1474
1543
|
status: z.literal("success"),
|
|
@@ -1485,6 +1554,15 @@ const SyncStashStarted = z.object({
|
|
|
1485
1554
|
task_id: z.number().int().positive()
|
|
1486
1555
|
});
|
|
1487
1556
|
const RemoteSyncSetting = z.string().nullable();
|
|
1557
|
+
const DirtyRefusalBody = z.object({ conflicts: z.literal(true) });
|
|
1558
|
+
const UnsyncedDependenciesBody = z.object({
|
|
1559
|
+
"error-code": z.literal("unsynced-dependencies"),
|
|
1560
|
+
unsynced_dependencies: z.array(syncUnsyncedDependencySchema)
|
|
1561
|
+
});
|
|
1562
|
+
const BranchMismatchBody = z.object({
|
|
1563
|
+
branch_mismatch: z.literal(true),
|
|
1564
|
+
current_branch: z.string().nullable()
|
|
1565
|
+
});
|
|
1488
1566
|
const RemoteSyncBranchProperty = SessionProperties.extend({ "remote-sync-branch": z.string().nullable().optional() });
|
|
1489
1567
|
const RemoteSyncUrlProperty = SessionProperties.extend({ "remote-sync-url": z.string().nullable().optional() });
|
|
1490
1568
|
const BRANCH_UNREADABLE_MESSAGE = "the remote-sync-branch setting is not readable: only admins see it, and a server without remote sync has none";
|
|
@@ -1500,13 +1578,64 @@ function isRemoteUnreadable(error) {
|
|
|
1500
1578
|
}
|
|
1501
1579
|
function gitSyncResource(transport) {
|
|
1502
1580
|
const { explain, refuse, refuseAfterReading } = explainer(transport, "gitSync");
|
|
1581
|
+
async function readingRefusal(request, call, options) {
|
|
1582
|
+
try {
|
|
1583
|
+
return await request;
|
|
1584
|
+
} catch (error) {
|
|
1585
|
+
if (!(error instanceof HttpError)) throw error;
|
|
1586
|
+
const refusal = await refusalOf(error, call, options);
|
|
1587
|
+
throw refusal === null ? error : new SyncRefusedError(error, refusal);
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
async function refusalOf(error, call, options) {
|
|
1591
|
+
const body = errorBodyJson(error);
|
|
1592
|
+
if (error.status === 409) {
|
|
1593
|
+
const mismatch = BranchMismatchBody.safeParse(body);
|
|
1594
|
+
return mismatch.success ? {
|
|
1595
|
+
kind: "branch-mismatch",
|
|
1596
|
+
current_branch: mismatch.data.current_branch
|
|
1597
|
+
} : null;
|
|
1598
|
+
}
|
|
1599
|
+
if (error.status !== 400) return null;
|
|
1600
|
+
const unsynced = UnsyncedDependenciesBody.safeParse(body);
|
|
1601
|
+
if (unsynced.success) return {
|
|
1602
|
+
kind: "unsynced-dependencies",
|
|
1603
|
+
unsynced_dependencies: unsynced.data.unsynced_dependencies
|
|
1604
|
+
};
|
|
1605
|
+
if (call !== "import") return null;
|
|
1606
|
+
return DirtyRefusalBody.safeParse(body).success ? dirtyRefusal(body, options) : null;
|
|
1607
|
+
}
|
|
1608
|
+
async function dirtyRefusal(body, options) {
|
|
1609
|
+
let features;
|
|
1610
|
+
try {
|
|
1611
|
+
features = (await transport.server(options)).features;
|
|
1612
|
+
} catch (failure) {
|
|
1613
|
+
if (isNonInterruptFailure(failure) || transport.refusedByGuard(failure)) return null;
|
|
1614
|
+
throw failure;
|
|
1615
|
+
}
|
|
1616
|
+
if (!features.remoteSyncImportNamesDirtyObjects) return {
|
|
1617
|
+
kind: "dirty",
|
|
1618
|
+
dirty_objects: null
|
|
1619
|
+
};
|
|
1620
|
+
const read = z.object({ dirty_objects: z.array(syncDirtyItemSchema(features)) }).safeParse(body);
|
|
1621
|
+
return read.success ? {
|
|
1622
|
+
kind: "dirty",
|
|
1623
|
+
dirty_objects: read.data.dirty_objects
|
|
1624
|
+
} : null;
|
|
1625
|
+
}
|
|
1503
1626
|
/** Get the running or most recently finished sync task, or null when the server has none. */
|
|
1504
1627
|
async function currentTask(options = {}) {
|
|
1505
|
-
|
|
1628
|
+
const { features } = await transport.server(options);
|
|
1629
|
+
return fetchOptionalParsed(transport, "/api/ee/remote-sync/current-task", syncTaskSchema(features), options);
|
|
1506
1630
|
}
|
|
1507
|
-
/**
|
|
1631
|
+
/**
|
|
1632
|
+
* Request cancellation of the running sync task, and answer it in the state that left it. Some
|
|
1633
|
+
* servers end the task at once; others mark it `cancelled` and leave it `running` until its
|
|
1634
|
+
* worker next reports, so a caller that needs it ended waits for the task.
|
|
1635
|
+
*/
|
|
1508
1636
|
async function cancelTask(options = {}) {
|
|
1509
|
-
|
|
1637
|
+
const { features } = await transport.server(options);
|
|
1638
|
+
return transport.requestParsed(syncTaskSchema(features), "/api/ee/remote-sync/current-task/cancel", {
|
|
1510
1639
|
...options,
|
|
1511
1640
|
method: "POST"
|
|
1512
1641
|
});
|
|
@@ -1517,17 +1646,21 @@ function gitSyncResource(transport) {
|
|
|
1517
1646
|
}
|
|
1518
1647
|
/** List the objects whose local state differs from the remote. */
|
|
1519
1648
|
async function dirty(options = {}) {
|
|
1649
|
+
const { features } = await transport.server(options);
|
|
1650
|
+
const list = z.object({ dirty: z.array(syncDirtyItemSchema(features)) });
|
|
1520
1651
|
return {
|
|
1521
|
-
data: (await transport.requestParsed(
|
|
1652
|
+
data: (await transport.requestParsed(list, "/api/ee/remote-sync/dirty", options)).dirty,
|
|
1522
1653
|
total: null
|
|
1523
1654
|
};
|
|
1524
1655
|
}
|
|
1525
1656
|
/**
|
|
1526
|
-
* Compare the tracked remote branch against what Metabase last
|
|
1527
|
-
* comparison
|
|
1657
|
+
* Compare the tracked remote branch against what Metabase last synced. A server with
|
|
1658
|
+
* `remoteSyncChangesCache` caches the comparison, and `force-refresh` re-reads the remote instead;
|
|
1659
|
+
* one without it reads the remote on every call and drops the key, so every answer is fresh.
|
|
1528
1660
|
*/
|
|
1529
1661
|
async function hasRemoteChanges(params = {}, options = {}) {
|
|
1530
|
-
|
|
1662
|
+
const { features } = await transport.server(options);
|
|
1663
|
+
return transport.requestParsed(syncRemoteChangesSchema(features), "/api/ee/remote-sync/has-remote-changes", {
|
|
1531
1664
|
...options,
|
|
1532
1665
|
query: { "force-refresh": params["force-refresh"] }
|
|
1533
1666
|
});
|
|
@@ -1545,9 +1678,10 @@ function gitSyncResource(transport) {
|
|
|
1545
1678
|
* instance.
|
|
1546
1679
|
*/
|
|
1547
1680
|
async function importFromRemote(params = {}, options = {}) {
|
|
1681
|
+
checkSchedule(params.wait);
|
|
1548
1682
|
const expectedBranch = await expectedBranchFor(params.expected_branch, options);
|
|
1549
1683
|
await requireMerge(params.merge, options);
|
|
1550
|
-
const started = await transport.requestParsed(SyncImportStarted, "/api/ee/remote-sync/import", {
|
|
1684
|
+
const started = await readingRefusal(transport.requestParsed(SyncImportStarted, "/api/ee/remote-sync/import", {
|
|
1551
1685
|
...options,
|
|
1552
1686
|
method: "POST",
|
|
1553
1687
|
body: {
|
|
@@ -1556,7 +1690,7 @@ function gitSyncResource(transport) {
|
|
|
1556
1690
|
merge: params.merge,
|
|
1557
1691
|
expected_branch: expectedBranch
|
|
1558
1692
|
}
|
|
1559
|
-
});
|
|
1693
|
+
}), "import", options);
|
|
1560
1694
|
const message = started.message ?? null;
|
|
1561
1695
|
if (params.wait === void 0 || started.task_id === null) return {
|
|
1562
1696
|
message,
|
|
@@ -1598,9 +1732,10 @@ function gitSyncResource(transport) {
|
|
|
1598
1732
|
* changes in by a three-way merge instead, and `force` overwrites them.
|
|
1599
1733
|
*/
|
|
1600
1734
|
async function exportToRemote(params = {}, options = {}) {
|
|
1735
|
+
checkSchedule(params.wait);
|
|
1601
1736
|
const branchName = await exportBranchFor(params.branch, options);
|
|
1602
1737
|
await requireMerge(params.merge, options);
|
|
1603
|
-
const started = await transport.requestParsed(SyncExportStarted, "/api/ee/remote-sync/export", {
|
|
1738
|
+
const started = await readingRefusal(transport.requestParsed(SyncExportStarted, "/api/ee/remote-sync/export", {
|
|
1604
1739
|
...options,
|
|
1605
1740
|
method: "POST",
|
|
1606
1741
|
body: {
|
|
@@ -1609,7 +1744,7 @@ function gitSyncResource(transport) {
|
|
|
1609
1744
|
force: params.force,
|
|
1610
1745
|
merge: params.merge
|
|
1611
1746
|
}
|
|
1612
|
-
});
|
|
1747
|
+
}), "export", options);
|
|
1613
1748
|
const accepted = {
|
|
1614
1749
|
message: started.message,
|
|
1615
1750
|
task_id: started.task_id,
|
|
@@ -1628,16 +1763,17 @@ function gitSyncResource(transport) {
|
|
|
1628
1763
|
* otherwise.
|
|
1629
1764
|
*/
|
|
1630
1765
|
async function exportPreflight(params, options = {}) {
|
|
1631
|
-
return transport.requestParsed(SyncExportPreflight, "/api/ee/remote-sync/export-preflight", {
|
|
1766
|
+
return readingRefusal(transport.requestParsed(SyncExportPreflight, "/api/ee/remote-sync/export-preflight", {
|
|
1632
1767
|
...options,
|
|
1633
1768
|
query: { branch: params.branch }
|
|
1634
|
-
});
|
|
1769
|
+
}), "export", options);
|
|
1635
1770
|
}
|
|
1636
1771
|
/**
|
|
1637
1772
|
* Export Metabase's current content to a branch the remote does not have yet. The endpoint
|
|
1638
1773
|
* queues a task and returns at once; pass `wait` to poll that task to a terminal status.
|
|
1639
1774
|
*/
|
|
1640
1775
|
async function stash(params, options = {}) {
|
|
1776
|
+
checkSchedule(params.wait);
|
|
1641
1777
|
const started = await transport.requestParsed(SyncStashStarted, "/api/ee/remote-sync/stash", {
|
|
1642
1778
|
...options,
|
|
1643
1779
|
method: "POST",
|
|
@@ -1665,7 +1801,11 @@ function gitSyncResource(transport) {
|
|
|
1665
1801
|
total: null
|
|
1666
1802
|
};
|
|
1667
1803
|
}
|
|
1668
|
-
/**
|
|
1804
|
+
/**
|
|
1805
|
+
* Create a branch on the remote and point git-sync at it. Metabase 58 to 65 route it; a server
|
|
1806
|
+
* from v66 does not, and answers an `HttpError` of kind `route-missing`. There `stash` makes a
|
|
1807
|
+
* branch, holding Metabase's content.
|
|
1808
|
+
*/
|
|
1669
1809
|
async function createBranch(params, options = {}) {
|
|
1670
1810
|
return transport.requestParsed(SyncBranchCreated, "/api/ee/remote-sync/create-branch", {
|
|
1671
1811
|
...options,
|
|
@@ -1674,6 +1814,18 @@ function gitSyncResource(transport) {
|
|
|
1674
1814
|
});
|
|
1675
1815
|
}
|
|
1676
1816
|
/**
|
|
1817
|
+
* Check that the remote answers to the saved URL and token, or to those given, without saving
|
|
1818
|
+
* them. Admin only. A remote that cannot be reached, a URL the server does not take, or a remote
|
|
1819
|
+
* that is not set up is refused with 400, carrying the server's reason.
|
|
1820
|
+
*/
|
|
1821
|
+
async function testConnection(params = {}, options = {}) {
|
|
1822
|
+
return transport.requestParsed(SyncConnectionTested, "/api/ee/remote-sync/test-connection", {
|
|
1823
|
+
...options,
|
|
1824
|
+
method: "POST",
|
|
1825
|
+
body: params
|
|
1826
|
+
});
|
|
1827
|
+
}
|
|
1828
|
+
/**
|
|
1677
1829
|
* Mark one collection as git-synced, or unmark it. The server cascades the flag to descendants
|
|
1678
1830
|
* by location prefix, and may queue an import task to bring the instance in line with the
|
|
1679
1831
|
* remote. A server without `remoteSyncCollectionsOnlyUpdate` validates every settings update as
|
|
@@ -1683,11 +1835,11 @@ function gitSyncResource(transport) {
|
|
|
1683
1835
|
* settings that are already empty.
|
|
1684
1836
|
*/
|
|
1685
1837
|
async function setCollectionSynced(collectionId, synced, options = {}) {
|
|
1686
|
-
return transport.requestParsed(SyncSettingsUpdateResult, "/api/ee/remote-sync/settings", {
|
|
1838
|
+
return readingRefusal(transport.requestParsed(SyncSettingsUpdateResult, "/api/ee/remote-sync/settings", {
|
|
1687
1839
|
...options,
|
|
1688
1840
|
method: "PUT",
|
|
1689
1841
|
body: await settingsUpdateBody({ [collectionId]: synced }, options)
|
|
1690
|
-
});
|
|
1842
|
+
}), "settings", options);
|
|
1691
1843
|
}
|
|
1692
1844
|
async function settingsUpdateBody(collections, options) {
|
|
1693
1845
|
const { features } = await transport.server(options);
|
|
@@ -1709,6 +1861,27 @@ function gitSyncResource(transport) {
|
|
|
1709
1861
|
"remote-sync-token": token
|
|
1710
1862
|
};
|
|
1711
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* Configure the remote, the sync direction, the tracked branch, whether remote changes are
|
|
1866
|
+
* imported on their own, whether transforms are synced, and which collections are synced; a key
|
|
1867
|
+
* left out keeps its value. Admin only. A blank URL clears the remote. Send `remote-sync-url`
|
|
1868
|
+
* with the token, the direction or the branch: most servers check such an update against the URL
|
|
1869
|
+
* it carries and refuse it with 400 without one, and a server without
|
|
1870
|
+
* `remoteSyncCollectionsOnlyUpdate` checks every update that way. A read-write instance that
|
|
1871
|
+
* tracks a branch may refuse another `remote-sync-branch` with 400, leaving the switch to an
|
|
1872
|
+
* import of that branch. The server refuses with 400 while a sync task runs; one without
|
|
1873
|
+
* `remoteSyncCollectionsOnlyUpdate` saves the settings first and refuses only the import it would
|
|
1874
|
+
* start. On an instance left read-only the update starts an import, whose task id the answer
|
|
1875
|
+
* carries.
|
|
1876
|
+
*/
|
|
1877
|
+
async function updateSettings(params, options = {}) {
|
|
1878
|
+
if (params["remote-sync-transforms"] !== void 0) await transport.requireFeatures(["remoteSyncTransformsSetting"], options);
|
|
1879
|
+
return readingRefusal(transport.requestParsed(SyncSettingsUpdateResult, "/api/ee/remote-sync/settings", {
|
|
1880
|
+
...options,
|
|
1881
|
+
method: "PUT",
|
|
1882
|
+
body: params
|
|
1883
|
+
}), "settings", options);
|
|
1884
|
+
}
|
|
1712
1885
|
/** The collections currently in git-sync's scope. */
|
|
1713
1886
|
async function syncedCollections(options = {}) {
|
|
1714
1887
|
return {
|
|
@@ -1774,7 +1947,10 @@ function gitSyncResource(transport) {
|
|
|
1774
1947
|
return pollUntil(async (signal) => currentTask({
|
|
1775
1948
|
...options,
|
|
1776
1949
|
signal
|
|
1777
|
-
}), (task) => task === null || isSyncTaskTerminal(task.status),
|
|
1950
|
+
}), (task) => task === null || isSyncTaskTerminal(task.status), {
|
|
1951
|
+
...wait,
|
|
1952
|
+
signal: combineAborts(wait.signal, options.signal, transport.signal)
|
|
1953
|
+
});
|
|
1778
1954
|
}
|
|
1779
1955
|
return {
|
|
1780
1956
|
currentTask: explain("currentTask", currentTask),
|
|
@@ -1788,7 +1964,9 @@ function gitSyncResource(transport) {
|
|
|
1788
1964
|
stash: explain("stash", stash),
|
|
1789
1965
|
branches: explain("branches", branches),
|
|
1790
1966
|
createBranch: explain("createBranch", createBranch),
|
|
1967
|
+
testConnection: explain("testConnection", testConnection),
|
|
1791
1968
|
setCollectionSynced: explain("setCollectionSynced", setCollectionSynced),
|
|
1969
|
+
updateSettings: explain("updateSettings", updateSettings),
|
|
1792
1970
|
syncedCollections: refuse("syncedCollections", syncedCollections),
|
|
1793
1971
|
remoteUrl,
|
|
1794
1972
|
branch: refuseAfterReading("branch", RemoteSyncBranchProperty, branch),
|
|
@@ -1859,6 +2037,41 @@ function glossaryResource(transport) {
|
|
|
1859
2037
|
};
|
|
1860
2038
|
}
|
|
1861
2039
|
//#endregion
|
|
2040
|
+
//#region ../client/src/domain/health.ts
|
|
2041
|
+
const Health = z.object({
|
|
2042
|
+
status: z.string(),
|
|
2043
|
+
progress: z.number().min(0).max(1).optional()
|
|
2044
|
+
}).loose();
|
|
2045
|
+
Health.pick({
|
|
2046
|
+
status: true,
|
|
2047
|
+
progress: true
|
|
2048
|
+
}).strip();
|
|
2049
|
+
//#endregion
|
|
2050
|
+
//#region ../client/src/resources/health.ts
|
|
2051
|
+
function healthResource(transport) {
|
|
2052
|
+
/**
|
|
2053
|
+
* Check whether the server is up: `ok` once it has booted and reaches its app database, else
|
|
2054
|
+
* `initializing` with its `progress`, or why the app database is out of reach. Needs no
|
|
2055
|
+
* credential. Answers without retrying unless `retries` is set.
|
|
2056
|
+
*/
|
|
2057
|
+
async function get(options = {}) {
|
|
2058
|
+
try {
|
|
2059
|
+
return await transport.requestParsed(Health, "/api/health", {
|
|
2060
|
+
...options,
|
|
2061
|
+
retries: options.retries ?? 0
|
|
2062
|
+
});
|
|
2063
|
+
} catch (error) {
|
|
2064
|
+
if (!(error instanceof HttpError) || error.status !== 503) throw error;
|
|
2065
|
+
const { body } = error.developerDetail;
|
|
2066
|
+
if (body === null) throw error;
|
|
2067
|
+
const health = parseJsonResult(body, Health);
|
|
2068
|
+
if (!health.ok) throw error;
|
|
2069
|
+
return health.value;
|
|
2070
|
+
}
|
|
2071
|
+
}
|
|
2072
|
+
return { get };
|
|
2073
|
+
}
|
|
2074
|
+
//#endregion
|
|
1862
2075
|
//#region ../client/src/resources/library.ts
|
|
1863
2076
|
const LIBRARY_ROOT_PATH = "/api/ee/library/";
|
|
1864
2077
|
const PUBLISH_TABLES_PATH = "/api/ee/data-studio/table/publish-tables";
|
|
@@ -2317,6 +2530,17 @@ const PermissionsGraph = z.object({
|
|
|
2317
2530
|
revision: z.number().int().nonnegative(),
|
|
2318
2531
|
groups: z.record(z.string(), z.record(z.string(), DatabasePermissions))
|
|
2319
2532
|
}).loose();
|
|
2533
|
+
const PermissionGroup = z.object({
|
|
2534
|
+
id: z.number().int(),
|
|
2535
|
+
name: z.string(),
|
|
2536
|
+
magic_group_type: z.string().nullable(),
|
|
2537
|
+
member_count: z.number().int().nonnegative()
|
|
2538
|
+
}).loose();
|
|
2539
|
+
PermissionGroup.pick({
|
|
2540
|
+
id: true,
|
|
2541
|
+
name: true,
|
|
2542
|
+
magic_group_type: true
|
|
2543
|
+
}).strip();
|
|
2320
2544
|
//#endregion
|
|
2321
2545
|
//#region ../client/src/resources/permission.ts
|
|
2322
2546
|
function permissionResource(transport) {
|
|
@@ -2340,10 +2564,22 @@ function permissionResource(transport) {
|
|
|
2340
2564
|
async function groupGraph(id, options = {}) {
|
|
2341
2565
|
return transport.requestParsed(PermissionsGraph, `/api/permissions/graph/group/${id}`, { ...options });
|
|
2342
2566
|
}
|
|
2567
|
+
/**
|
|
2568
|
+
* List the permission groups, each with its member count. Needs an admin, the settings
|
|
2569
|
+
* application permission, or a group manager, who sees only the groups they manage.
|
|
2570
|
+
* `GET /api/permissions/group` answers a bare array.
|
|
2571
|
+
*/
|
|
2572
|
+
async function groups(options = {}) {
|
|
2573
|
+
return {
|
|
2574
|
+
data: await transport.requestParsed(z.array(PermissionGroup), "/api/permissions/group", { ...options }),
|
|
2575
|
+
total: null
|
|
2576
|
+
};
|
|
2577
|
+
}
|
|
2343
2578
|
return {
|
|
2344
2579
|
graph,
|
|
2345
2580
|
databaseGraph,
|
|
2346
|
-
groupGraph
|
|
2581
|
+
groupGraph,
|
|
2582
|
+
groups
|
|
2347
2583
|
};
|
|
2348
2584
|
}
|
|
2349
2585
|
//#endregion
|
|
@@ -2839,8 +3075,21 @@ function segmentResource(transport) {
|
|
|
2839
3075
|
archive
|
|
2840
3076
|
};
|
|
2841
3077
|
}
|
|
3078
|
+
z.object({
|
|
3079
|
+
username: z.string().min(1),
|
|
3080
|
+
password: z.string().min(1)
|
|
3081
|
+
}).strict();
|
|
3082
|
+
const Session = z.object({ id: z.string() }).loose();
|
|
3083
|
+
Session.pick({ id: true }).strip();
|
|
2842
3084
|
//#endregion
|
|
2843
3085
|
//#region ../client/src/resources/session.ts
|
|
3086
|
+
const SessionSettingsRead = SessionProperties.transform((properties, ctx) => {
|
|
3087
|
+
const { features } = profileFromProperties(properties);
|
|
3088
|
+
const parsed = sessionSettingsSchema(features).safeParse(properties);
|
|
3089
|
+
if (parsed.success) return parsed.data;
|
|
3090
|
+
for (const issue of parsed.error.issues) ctx.addIssue({ ...issue });
|
|
3091
|
+
return z.NEVER;
|
|
3092
|
+
});
|
|
2844
3093
|
function sessionResource(transport) {
|
|
2845
3094
|
/**
|
|
2846
3095
|
* Get the session properties: the settings the caller may read, among them the server's version
|
|
@@ -2849,7 +3098,32 @@ function sessionResource(transport) {
|
|
|
2849
3098
|
async function properties(options = {}) {
|
|
2850
3099
|
return transport.probe(SessionProperties, options);
|
|
2851
3100
|
}
|
|
2852
|
-
|
|
3101
|
+
/**
|
|
3102
|
+
* Get the settings a bootstrap reads from the session properties: the setup state, the site name,
|
|
3103
|
+
* the AI and MCP switches and remote sync, parsed by the shape of the server that answers. Read
|
|
3104
|
+
* afresh, never from a profile handed in.
|
|
3105
|
+
*/
|
|
3106
|
+
async function settings(options = {}) {
|
|
3107
|
+
return transport.probe(SessionSettingsRead, options);
|
|
3108
|
+
}
|
|
3109
|
+
/**
|
|
3110
|
+
* Log in with a username and password, answering the new session's id. A wrong password answers
|
|
3111
|
+
* 401. An account with a second factor is answered with a challenge rather than a session, and
|
|
3112
|
+
* one without where the instance requires a second factor with an enrollment; this method
|
|
3113
|
+
* reports either as a `ResponseShapeError`.
|
|
3114
|
+
*/
|
|
3115
|
+
async function create(params, options = {}) {
|
|
3116
|
+
return transport.requestParsed(Session, "/api/session", {
|
|
3117
|
+
...options,
|
|
3118
|
+
method: "POST",
|
|
3119
|
+
body: params
|
|
3120
|
+
});
|
|
3121
|
+
}
|
|
3122
|
+
return {
|
|
3123
|
+
properties,
|
|
3124
|
+
settings,
|
|
3125
|
+
create
|
|
3126
|
+
};
|
|
2853
3127
|
}
|
|
2854
3128
|
//#endregion
|
|
2855
3129
|
//#region ../client/src/resources/setting.ts
|
|
@@ -3218,6 +3492,101 @@ function describeCollectionAnswer(answered) {
|
|
|
3218
3492
|
return `the table stays in collection ${answered.value}`;
|
|
3219
3493
|
}
|
|
3220
3494
|
//#endregion
|
|
3495
|
+
//#region ../client/src/domain/task.ts
|
|
3496
|
+
const TaskRunType = z.enum([
|
|
3497
|
+
"subscription",
|
|
3498
|
+
"alert",
|
|
3499
|
+
"sync",
|
|
3500
|
+
"fingerprint"
|
|
3501
|
+
]);
|
|
3502
|
+
const TaskRunEntityType = z.enum([
|
|
3503
|
+
"database",
|
|
3504
|
+
"card",
|
|
3505
|
+
"dashboard"
|
|
3506
|
+
]);
|
|
3507
|
+
const TaskRunStatus = z.enum([
|
|
3508
|
+
"started",
|
|
3509
|
+
"success",
|
|
3510
|
+
"failed",
|
|
3511
|
+
"abandoned"
|
|
3512
|
+
]);
|
|
3513
|
+
const TaskRun = z.object({
|
|
3514
|
+
id: z.number().int(),
|
|
3515
|
+
run_type: TaskRunType,
|
|
3516
|
+
entity_type: TaskRunEntityType,
|
|
3517
|
+
entity_id: z.number().int(),
|
|
3518
|
+
started_at: z.string(),
|
|
3519
|
+
ended_at: z.string().nullable(),
|
|
3520
|
+
status: TaskRunStatus,
|
|
3521
|
+
entity_name: z.string().nullable(),
|
|
3522
|
+
task_count: z.number().int(),
|
|
3523
|
+
success_count: z.number().int(),
|
|
3524
|
+
failed_count: z.number().int()
|
|
3525
|
+
}).loose();
|
|
3526
|
+
TaskRun.pick({
|
|
3527
|
+
id: true,
|
|
3528
|
+
run_type: true,
|
|
3529
|
+
entity_type: true,
|
|
3530
|
+
entity_id: true,
|
|
3531
|
+
status: true,
|
|
3532
|
+
started_at: true,
|
|
3533
|
+
ended_at: true
|
|
3534
|
+
}).strip();
|
|
3535
|
+
const TaskHistoryStatus = z.enum([
|
|
3536
|
+
"started",
|
|
3537
|
+
"success",
|
|
3538
|
+
"failed",
|
|
3539
|
+
"unknown"
|
|
3540
|
+
]);
|
|
3541
|
+
const TaskHistoryDetails = z.object({ message: z.string().nullable().optional() }).loose();
|
|
3542
|
+
const TaskHistory = z.object({
|
|
3543
|
+
id: z.number().int(),
|
|
3544
|
+
task: z.string(),
|
|
3545
|
+
db_id: z.number().int().nullable(),
|
|
3546
|
+
started_at: z.string(),
|
|
3547
|
+
ended_at: z.string().nullable(),
|
|
3548
|
+
duration: z.number().int().nullable(),
|
|
3549
|
+
status: TaskHistoryStatus,
|
|
3550
|
+
task_details: TaskHistoryDetails.nullable()
|
|
3551
|
+
}).loose();
|
|
3552
|
+
const TaskRunWithTasks = TaskRun.extend({ tasks: z.array(TaskHistory) });
|
|
3553
|
+
//#endregion
|
|
3554
|
+
//#region ../client/src/resources/task.ts
|
|
3555
|
+
function taskResource(transport) {
|
|
3556
|
+
const { explain, explainWalk } = explainer(transport, "task");
|
|
3557
|
+
/**
|
|
3558
|
+
* Walk the background-job runs, such as database syncs and subscription sends, newest first,
|
|
3559
|
+
* each with the name of the entity it ran against and a count of its tasks. Needs the monitoring
|
|
3560
|
+
* application permission.
|
|
3561
|
+
*/
|
|
3562
|
+
async function* runPages(params = {}, options = {}) {
|
|
3563
|
+
yield* paginatePages(transport, "/api/task/runs", TaskRun, {
|
|
3564
|
+
query: {
|
|
3565
|
+
"run-type": params["run-type"],
|
|
3566
|
+
"entity-type": params["entity-type"],
|
|
3567
|
+
"entity-id": params["entity-id"],
|
|
3568
|
+
status: params.status,
|
|
3569
|
+
"started-at": params["started-at"]
|
|
3570
|
+
},
|
|
3571
|
+
...options.offset !== void 0 && { offset: options.offset },
|
|
3572
|
+
...options.max !== void 0 && { max: options.max },
|
|
3573
|
+
...options.pageSize !== void 0 && { pageSize: options.pageSize },
|
|
3574
|
+
...options.signal !== void 0 && { signal: options.signal }
|
|
3575
|
+
});
|
|
3576
|
+
}
|
|
3577
|
+
/**
|
|
3578
|
+
* Get a single task run with all its child tasks, oldest first. Needs the monitoring application
|
|
3579
|
+
* permission.
|
|
3580
|
+
*/
|
|
3581
|
+
async function run(id, options = {}) {
|
|
3582
|
+
return transport.requestParsed(TaskRunWithTasks, `/api/task/runs/${id}`, options);
|
|
3583
|
+
}
|
|
3584
|
+
return {
|
|
3585
|
+
runPages: explainWalk("runPages", runPages),
|
|
3586
|
+
run: explain("run", run)
|
|
3587
|
+
};
|
|
3588
|
+
}
|
|
3589
|
+
//#endregion
|
|
3221
3590
|
//#region ../client/src/resources/timeline-event.ts
|
|
3222
3591
|
function timelineEventResource(transport) {
|
|
3223
3592
|
/** Get one timeline event by id. */
|
|
@@ -3917,21 +4286,24 @@ function transformResource(transport) {
|
|
|
3917
4286
|
/**
|
|
3918
4287
|
* Start a run of a transform by id. The server queues the run and answers at once; `wait` polls
|
|
3919
4288
|
* it to a terminal status, and `syncTarget` follows that with the output table's registration.
|
|
3920
|
-
*
|
|
4289
|
+
* Both waits share the one deadline `wait.timeoutMs` sets, or none when it is `null`. A server
|
|
4290
|
+
* that answers no run id started nothing, and there is then nothing to poll.
|
|
3921
4291
|
*/
|
|
3922
4292
|
async function run(id, params = {}, options = {}) {
|
|
4293
|
+
const requested = params.syncTarget === true ? params.wait ?? {} : params.wait;
|
|
4294
|
+
const deadline = requested === void 0 ? null : startDeadline(requested);
|
|
3923
4295
|
const kickoff = await transport.requestParsed(TransformRunKickoff, `/api/transform/${id}/run`, {
|
|
3924
4296
|
...options,
|
|
3925
4297
|
method: "POST"
|
|
3926
4298
|
});
|
|
3927
|
-
|
|
3928
|
-
if (schedule === void 0 || kickoff.run_id === null) return {
|
|
4299
|
+
if (requested === void 0 || kickoff.run_id === null) return {
|
|
3929
4300
|
message: kickoff.message,
|
|
3930
4301
|
run_id: kickoff.run_id,
|
|
3931
4302
|
final: null
|
|
3932
4303
|
};
|
|
4304
|
+
const schedule = callWait(requested, options);
|
|
3933
4305
|
const runId = kickoff.run_id;
|
|
3934
|
-
const final = await
|
|
4306
|
+
const final = await pollWithin(deadline, async (signal) => getRun(runId, {
|
|
3935
4307
|
...options,
|
|
3936
4308
|
signal
|
|
3937
4309
|
}), (candidate) => isTransformRunTerminal(candidate.status), schedule);
|
|
@@ -3940,7 +4312,7 @@ function transformResource(transport) {
|
|
|
3940
4312
|
run_id: runId,
|
|
3941
4313
|
final
|
|
3942
4314
|
};
|
|
3943
|
-
const targetTableId = isTransformRunFailed(final.status) ? null : await awaitTargetTableId(id, schedule, options);
|
|
4315
|
+
const targetTableId = isTransformRunFailed(final.status) ? null : await awaitTargetTableId(id, deadline, schedule, options);
|
|
3944
4316
|
return {
|
|
3945
4317
|
message: kickoff.message,
|
|
3946
4318
|
run_id: runId,
|
|
@@ -3948,9 +4320,9 @@ function transformResource(transport) {
|
|
|
3948
4320
|
target_table_id: targetTableId
|
|
3949
4321
|
};
|
|
3950
4322
|
}
|
|
3951
|
-
async function awaitTargetTableId(id, wait, options) {
|
|
4323
|
+
async function awaitTargetTableId(id, deadline, wait, options) {
|
|
3952
4324
|
try {
|
|
3953
|
-
return (await
|
|
4325
|
+
return (await pollWithin(deadline, async (signal) => get(id, {
|
|
3954
4326
|
...options,
|
|
3955
4327
|
signal
|
|
3956
4328
|
}), (transform) => transform.target_table_id !== null, wait)).target_table_id;
|
|
@@ -3959,6 +4331,12 @@ function transformResource(transport) {
|
|
|
3959
4331
|
throw error;
|
|
3960
4332
|
}
|
|
3961
4333
|
}
|
|
4334
|
+
function callWait(wait, options) {
|
|
4335
|
+
return {
|
|
4336
|
+
...wait,
|
|
4337
|
+
signal: combineAborts(wait.signal, options.signal, transport.signal)
|
|
4338
|
+
};
|
|
4339
|
+
}
|
|
3962
4340
|
return {
|
|
3963
4341
|
list: explain("list", list),
|
|
3964
4342
|
get: explain("get", get),
|
|
@@ -4149,20 +4527,217 @@ CurrentUser.pick({
|
|
|
4149
4527
|
common_name: true,
|
|
4150
4528
|
is_superuser: true
|
|
4151
4529
|
}).strip();
|
|
4530
|
+
const User = z.object({
|
|
4531
|
+
id: z.number().int(),
|
|
4532
|
+
email: z.string(),
|
|
4533
|
+
first_name: z.string().nullable(),
|
|
4534
|
+
last_name: z.string().nullable(),
|
|
4535
|
+
common_name: z.string(),
|
|
4536
|
+
is_superuser: z.boolean().optional(),
|
|
4537
|
+
is_active: z.boolean().optional()
|
|
4538
|
+
}).loose();
|
|
4539
|
+
User.pick({
|
|
4540
|
+
id: true,
|
|
4541
|
+
email: true,
|
|
4542
|
+
common_name: true,
|
|
4543
|
+
is_superuser: true
|
|
4544
|
+
}).strip();
|
|
4545
|
+
z.enum([
|
|
4546
|
+
"active",
|
|
4547
|
+
"deactivated",
|
|
4548
|
+
"all"
|
|
4549
|
+
]);
|
|
4550
|
+
z.object({
|
|
4551
|
+
first_name: z.string().min(1).nullable().optional(),
|
|
4552
|
+
last_name: z.string().min(1).nullable().optional(),
|
|
4553
|
+
email: z.string(),
|
|
4554
|
+
password: z.string().min(1).nullable().optional()
|
|
4555
|
+
}).strict();
|
|
4152
4556
|
//#endregion
|
|
4153
4557
|
//#region ../client/src/resources/user.ts
|
|
4558
|
+
const UserList = z.object({
|
|
4559
|
+
data: z.array(User),
|
|
4560
|
+
total: z.number().int().nonnegative()
|
|
4561
|
+
});
|
|
4154
4562
|
function userResource(transport) {
|
|
4155
4563
|
/** Get the user the request's credentials authenticate as. */
|
|
4156
4564
|
async function current(options = {}) {
|
|
4157
4565
|
return transport.requestParsed(CurrentUser, "/api/user/current", { ...options });
|
|
4158
4566
|
}
|
|
4159
|
-
|
|
4567
|
+
/**
|
|
4568
|
+
* List the users, ordered by first name. Needs an admin, a data analyst or a group manager, who
|
|
4569
|
+
* sees the members of the groups they manage; a sandboxed user sees only themselves. Which
|
|
4570
|
+
* columns each user carries depends on the caller, as `User` says.
|
|
4571
|
+
*/
|
|
4572
|
+
async function list(params = {}, options = {}) {
|
|
4573
|
+
const response = await transport.requestParsed(UserList, "/api/user", {
|
|
4574
|
+
...options,
|
|
4575
|
+
query: {
|
|
4576
|
+
status: params.status,
|
|
4577
|
+
query: params.query,
|
|
4578
|
+
group_id: params.group_id
|
|
4579
|
+
}
|
|
4580
|
+
});
|
|
4581
|
+
return {
|
|
4582
|
+
data: response.data,
|
|
4583
|
+
total: response.total
|
|
4584
|
+
};
|
|
4585
|
+
}
|
|
4586
|
+
/**
|
|
4587
|
+
* Create a user and send the invite. Admin only. Without a password the account gets a random
|
|
4588
|
+
* one, so it can sign in only through the invite. A taken email answers 400 naming `email`.
|
|
4589
|
+
*/
|
|
4590
|
+
async function create(params, options = {}) {
|
|
4591
|
+
return transport.requestParsed(User, "/api/user", {
|
|
4592
|
+
...options,
|
|
4593
|
+
method: "POST",
|
|
4594
|
+
body: params
|
|
4595
|
+
});
|
|
4596
|
+
}
|
|
4597
|
+
return {
|
|
4598
|
+
current,
|
|
4599
|
+
list,
|
|
4600
|
+
create
|
|
4601
|
+
};
|
|
4602
|
+
}
|
|
4603
|
+
//#endregion
|
|
4604
|
+
//#region ../client/src/domain/workspace-instance.ts
|
|
4605
|
+
const WorkspaceInstanceOutput = z.object({
|
|
4606
|
+
db: z.string().nullable().optional(),
|
|
4607
|
+
schema: z.string().nullable().optional()
|
|
4608
|
+
}).loose();
|
|
4609
|
+
const WorkspaceInstanceDatabase = z.object({
|
|
4610
|
+
input_schemas: z.array(z.string()),
|
|
4611
|
+
output: WorkspaceInstanceOutput
|
|
4612
|
+
}).loose();
|
|
4613
|
+
const WorkspaceInstance = z.object({
|
|
4614
|
+
name: z.string(),
|
|
4615
|
+
databases: z.record(z.string(), WorkspaceInstanceDatabase),
|
|
4616
|
+
can_write: z.boolean()
|
|
4617
|
+
}).loose();
|
|
4618
|
+
WorkspaceInstance.pick({
|
|
4619
|
+
name: true,
|
|
4620
|
+
can_write: true
|
|
4621
|
+
}).strip();
|
|
4622
|
+
//#endregion
|
|
4623
|
+
//#region ../client/src/resources/workspace-instance.ts
|
|
4624
|
+
const WorkspaceInstanceEnvelope = z.object({ data: WorkspaceInstance.nullable() }).loose();
|
|
4625
|
+
function workspaceInstanceResource(transport) {
|
|
4626
|
+
const { explain } = explainer(transport, "workspaceInstance");
|
|
4627
|
+
/**
|
|
4628
|
+
* The workspace loaded on this instance, from its `config.yml` at boot or set at runtime; admins
|
|
4629
|
+
* only. `null` when none is loaded, as on a manager-only instance. `can_write` is `false` when
|
|
4630
|
+
* deployment config set the workspace, which then cannot be changed at runtime.
|
|
4631
|
+
*/
|
|
4632
|
+
async function current(options = {}) {
|
|
4633
|
+
return (await transport.requestParsed(WorkspaceInstanceEnvelope, "/api/ee/workspace-instance/current", { ...options })).data;
|
|
4634
|
+
}
|
|
4635
|
+
return { current: explain("current", current) };
|
|
4636
|
+
}
|
|
4637
|
+
//#endregion
|
|
4638
|
+
//#region ../client/src/domain/workspace.ts
|
|
4639
|
+
const WorkspaceDatabaseStatus = z.enum([
|
|
4640
|
+
"unprovisioned",
|
|
4641
|
+
"provisioning",
|
|
4642
|
+
"provisioned",
|
|
4643
|
+
"deprovisioning"
|
|
4644
|
+
]);
|
|
4645
|
+
const WorkspaceDatabase = z.object({
|
|
4646
|
+
database_id: z.number().int(),
|
|
4647
|
+
input_schemas: z.array(z.string()),
|
|
4648
|
+
output_namespace: z.string(),
|
|
4649
|
+
status: WorkspaceDatabaseStatus
|
|
4650
|
+
}).loose();
|
|
4651
|
+
const WorkspaceDatabaseCompact = WorkspaceDatabase.pick({
|
|
4652
|
+
database_id: true,
|
|
4653
|
+
status: true
|
|
4654
|
+
}).strip();
|
|
4655
|
+
const WorkspaceCreator = z.object({
|
|
4656
|
+
id: z.number().int(),
|
|
4657
|
+
first_name: z.string().nullable(),
|
|
4658
|
+
last_name: z.string().nullable(),
|
|
4659
|
+
email: z.string(),
|
|
4660
|
+
common_name: z.string().nullable().optional()
|
|
4661
|
+
}).loose();
|
|
4662
|
+
const Workspace = z.object({
|
|
4663
|
+
id: z.number().int().positive(),
|
|
4664
|
+
name: z.string(),
|
|
4665
|
+
creator: WorkspaceCreator.nullable(),
|
|
4666
|
+
created_at: z.string(),
|
|
4667
|
+
updated_at: z.string(),
|
|
4668
|
+
databases: z.array(WorkspaceDatabase).optional()
|
|
4669
|
+
}).loose();
|
|
4670
|
+
Workspace.pick({
|
|
4671
|
+
id: true,
|
|
4672
|
+
name: true
|
|
4673
|
+
}).strip().extend({ databases: z.array(WorkspaceDatabaseCompact).optional() });
|
|
4674
|
+
z.object({
|
|
4675
|
+
name: z.string().min(1),
|
|
4676
|
+
database_ids: z.array(z.number().int().positive()).min(1)
|
|
4677
|
+
}).strict();
|
|
4678
|
+
//#endregion
|
|
4679
|
+
//#region ../client/src/resources/workspace-manager.ts
|
|
4680
|
+
const WORKSPACE_MANAGER_PATH = "/api/ee/workspace-manager";
|
|
4681
|
+
function workspaceManagerResource(transport) {
|
|
4682
|
+
const { explain } = explainer(transport, "workspaceManager");
|
|
4683
|
+
/** List all workspaces, each with its databases; admins only. `GET /api/ee/workspace-manager` answers a bare array. */
|
|
4684
|
+
async function list(options = {}) {
|
|
4685
|
+
return {
|
|
4686
|
+
data: await transport.requestParsed(z.array(Workspace), WORKSPACE_MANAGER_PATH, { ...options }),
|
|
4687
|
+
total: null
|
|
4688
|
+
};
|
|
4689
|
+
}
|
|
4690
|
+
/** Get a single workspace by id. */
|
|
4691
|
+
async function get(id, options = {}) {
|
|
4692
|
+
return transport.requestParsed(Workspace, `${WORKSPACE_MANAGER_PATH}/${id}`, { ...options });
|
|
4693
|
+
}
|
|
4694
|
+
/**
|
|
4695
|
+
* Create a workspace attached to the given databases, each of which must be eligible for
|
|
4696
|
+
* workspaces, and provision it. The server provisions every database before it answers, so the
|
|
4697
|
+
* caller sets a `timeoutMs` long enough for that. A provisioning failure whose cleanup also fails
|
|
4698
|
+
* answers the workspace with its databases `unprovisioned`, to be torn down by a delete.
|
|
4699
|
+
*/
|
|
4700
|
+
async function create(params, options = {}) {
|
|
4701
|
+
return transport.requestParsed(Workspace, WORKSPACE_MANAGER_PATH, {
|
|
4702
|
+
...options,
|
|
4703
|
+
method: "POST",
|
|
4704
|
+
body: params
|
|
4705
|
+
});
|
|
4706
|
+
}
|
|
4707
|
+
/**
|
|
4708
|
+
* Delete a workspace, tearing down every database's warehouse isolation first. When any teardown
|
|
4709
|
+
* fails the workspace is kept with the failed databases, so the delete can be retried.
|
|
4710
|
+
*/
|
|
4711
|
+
async function remove(id, options = {}) {
|
|
4712
|
+
await transport.requestRaw(`${WORKSPACE_MANAGER_PATH}/${id}`, {
|
|
4713
|
+
...options,
|
|
4714
|
+
method: "DELETE",
|
|
4715
|
+
expectContentType: "binary"
|
|
4716
|
+
});
|
|
4717
|
+
}
|
|
4718
|
+
/**
|
|
4719
|
+
* The workspace's developer-instance config, the YAML a Metabase boots from. It holds the
|
|
4720
|
+
* workspace's warehouse login. The server refuses with 409 while any of its databases is not
|
|
4721
|
+
* `provisioned`.
|
|
4722
|
+
*/
|
|
4723
|
+
async function config(id, options = {}) {
|
|
4724
|
+
return (await transport.requestRaw(`${WORKSPACE_MANAGER_PATH}/${id}/config`, {
|
|
4725
|
+
...options,
|
|
4726
|
+
expectContentType: "binary"
|
|
4727
|
+
})).text();
|
|
4728
|
+
}
|
|
4729
|
+
return {
|
|
4730
|
+
list: explain("list", list),
|
|
4731
|
+
get: explain("get", get),
|
|
4732
|
+
create: explain("create", create),
|
|
4733
|
+
delete: explain("delete", remove),
|
|
4734
|
+
config: explain("config", config)
|
|
4735
|
+
};
|
|
4160
4736
|
}
|
|
4161
4737
|
//#endregion
|
|
4162
4738
|
//#region ../client/src/client.ts
|
|
4163
4739
|
var client_exports = /* @__PURE__ */ __exportAll({ createClient: () => createClient });
|
|
4164
|
-
function
|
|
4165
|
-
const transport = createTransport(config, options);
|
|
4740
|
+
function surfaceOn(transport) {
|
|
4166
4741
|
return {
|
|
4167
4742
|
apiKey: apiKeyResource(transport),
|
|
4168
4743
|
card: cardResource(transport),
|
|
@@ -4180,6 +4755,7 @@ function createClient(config, options) {
|
|
|
4180
4755
|
field: fieldResource(transport),
|
|
4181
4756
|
gitSync: gitSyncResource(transport),
|
|
4182
4757
|
glossary: glossaryResource(transport),
|
|
4758
|
+
health: healthResource(transport),
|
|
4183
4759
|
library: libraryResource(transport),
|
|
4184
4760
|
measure: measureResource(transport),
|
|
4185
4761
|
metric: metricResource(transport),
|
|
@@ -4196,6 +4772,7 @@ function createClient(config, options) {
|
|
|
4196
4772
|
setup: setupResource(transport),
|
|
4197
4773
|
snippet: snippetResource(transport),
|
|
4198
4774
|
table: tableResource(transport),
|
|
4775
|
+
task: taskResource(transport),
|
|
4199
4776
|
timeline: timelineResource(transport),
|
|
4200
4777
|
timelineEvent: timelineEventResource(transport),
|
|
4201
4778
|
transform: transformResource(transport),
|
|
@@ -4207,6 +4784,8 @@ function createClient(config, options) {
|
|
|
4207
4784
|
transformTest: transformTestResource(transport),
|
|
4208
4785
|
upload: uploadResource(transport),
|
|
4209
4786
|
user: userResource(transport),
|
|
4787
|
+
workspaceInstance: workspaceInstanceResource(transport),
|
|
4788
|
+
workspaceManager: workspaceManagerResource(transport),
|
|
4210
4789
|
server: transport.server,
|
|
4211
4790
|
verifiedServer: transport.verifiedServer,
|
|
4212
4791
|
probesSettled: transport.probesSettled,
|
|
@@ -4215,5 +4794,70 @@ function createClient(config, options) {
|
|
|
4215
4794
|
requestStream: transport.requestStream
|
|
4216
4795
|
};
|
|
4217
4796
|
}
|
|
4797
|
+
function createClient(config, options) {
|
|
4798
|
+
const observers = options.onError === void 0 ? [] : [options.onError];
|
|
4799
|
+
return clientOn(createTransport(config, options), observers);
|
|
4800
|
+
}
|
|
4801
|
+
function clientOn(transport, observers) {
|
|
4802
|
+
const client = {
|
|
4803
|
+
...surfaceOn(transport),
|
|
4804
|
+
with: (derived) => {
|
|
4805
|
+
const inherited = derived.onError === void 0 ? observers : [derived.onError, ...observers];
|
|
4806
|
+
return clientOn(transport.with(derived), inherited);
|
|
4807
|
+
}
|
|
4808
|
+
};
|
|
4809
|
+
return observers.length === 0 ? client : observed(client, observers);
|
|
4810
|
+
}
|
|
4811
|
+
function observed(surface, observers) {
|
|
4812
|
+
const namespaces = /* @__PURE__ */ new Map();
|
|
4813
|
+
return new Proxy(surface, { get(target, property, receiver) {
|
|
4814
|
+
const value = Reflect.get(target, property, receiver);
|
|
4815
|
+
if (typeof value === "function") return (...args) => observedCall(() => Reflect.apply(value, target, args), observers);
|
|
4816
|
+
if (typeof value !== "object" || value === null) return value;
|
|
4817
|
+
const known = namespaces.get(property);
|
|
4818
|
+
if (known !== void 0) return known;
|
|
4819
|
+
const namespace = observed(value, observers);
|
|
4820
|
+
namespaces.set(property, namespace);
|
|
4821
|
+
return namespace;
|
|
4822
|
+
} });
|
|
4823
|
+
}
|
|
4824
|
+
function observedCall(call, observers) {
|
|
4825
|
+
let result;
|
|
4826
|
+
try {
|
|
4827
|
+
result = call();
|
|
4828
|
+
} catch (error) {
|
|
4829
|
+
throw shown(error, observers);
|
|
4830
|
+
}
|
|
4831
|
+
if (result instanceof Promise) return result.catch((error) => {
|
|
4832
|
+
throw shown(error, observers);
|
|
4833
|
+
});
|
|
4834
|
+
if (isAsyncIterable(result)) return observedWalk(result, observers);
|
|
4835
|
+
return result;
|
|
4836
|
+
}
|
|
4837
|
+
async function* observedWalk(walk, observers) {
|
|
4838
|
+
try {
|
|
4839
|
+
yield* walk;
|
|
4840
|
+
} catch (error) {
|
|
4841
|
+
throw shown(error, observers);
|
|
4842
|
+
}
|
|
4843
|
+
}
|
|
4844
|
+
function shown(error, observers) {
|
|
4845
|
+
let first = null;
|
|
4846
|
+
for (const observer of observers) try {
|
|
4847
|
+
showTo(observer, error);
|
|
4848
|
+
} catch (thrown) {
|
|
4849
|
+
first ??= { thrown };
|
|
4850
|
+
}
|
|
4851
|
+
return first === null ? error : first.thrown;
|
|
4852
|
+
}
|
|
4853
|
+
function showTo(observer, error) {
|
|
4854
|
+
const answer = observer(error);
|
|
4855
|
+
if (!isThenable(answer)) return;
|
|
4856
|
+
Promise.resolve(answer).catch(() => void 0);
|
|
4857
|
+
throw new ConfigError("An error observer answered a promise. An observer runs synchronously and is not awaited.");
|
|
4858
|
+
}
|
|
4859
|
+
function isAsyncIterable(value) {
|
|
4860
|
+
return typeof value === "object" && value !== null && Symbol.asyncIterator in value && typeof value[Symbol.asyncIterator] === "function";
|
|
4861
|
+
}
|
|
4218
4862
|
//#endregion
|
|
4219
4863
|
export { createClient as n, client_exports as t };
|