@keboola/api-client 55.0.0 → 57.0.0
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/AGENTS.md +110 -229
- package/API-SURFACE.md +12 -2
- package/CHANGELOG.md +61 -0
- package/README.md +20 -133
- package/dist/{ManagementSessionMintError-Bc9bc7Ai.cjs → ManagementSessionMintError-BCOLLaJi.cjs} +3 -2
- package/dist/ManagementSessionMintError-BCOLLaJi.cjs.map +1 -0
- package/dist/{ManagementSessionMintError-BMHDcEqV.js → ManagementSessionMintError-KUX3utTV.js} +3 -2
- package/dist/ManagementSessionMintError-KUX3utTV.js.map +1 -0
- package/dist/{adminRoles-Cm513r1G.d.ts → adminRoles-CnfGDvjN.d.ts} +2 -2
- package/dist/{adminRoles-BTKVwEy8.d.cts → adminRoles-D6AS9Bzx.d.cts} +2 -2
- package/dist/ai/index.d.cts +2 -2
- package/dist/ai/index.d.ts +2 -2
- package/dist/ai/types.d.cts +1 -1
- package/dist/ai/types.d.ts +1 -1
- package/dist/apps/index.cjs +1 -1
- package/dist/apps/index.d.cts +2 -2
- package/dist/apps/index.d.ts +2 -2
- package/dist/apps/index.js +1 -1
- package/dist/apps/types.d.cts +2 -2
- package/dist/apps/types.d.ts +2 -2
- package/dist/{apps-C1x5IKNQ.cjs → apps-BA9JRLAZ.cjs} +55 -1
- package/dist/apps-BA9JRLAZ.cjs.map +1 -0
- package/dist/{apps-BN7fWtSm.js → apps-DDcguJ1i.js} +55 -1
- package/dist/apps-DDcguJ1i.js.map +1 -0
- package/dist/assets/index.d.cts +1 -1
- package/dist/assets/index.d.ts +1 -1
- package/dist/auth/index.cjs +1 -1
- package/dist/auth/index.d.cts +1 -1
- package/dist/auth/index.d.ts +1 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/types.d.cts +2 -2
- package/dist/auth/types.d.ts +2 -2
- package/dist/{authClient-BM4L8XEN.js → authClient-BKGpJI5L.js} +14 -45
- package/dist/authClient-BKGpJI5L.js.map +1 -0
- package/dist/{authClient-DspK50e7.cjs → authClient-C3KG9hXw.cjs} +15 -58
- package/dist/authClient-C3KG9hXw.cjs.map +1 -0
- package/dist/{authClient-ij_Rm2Yn.d.ts → authClient-CbWpMmdX.d.ts} +7 -4
- package/dist/{authClient-NBi0pqD5.d.cts → authClient-UKeopxZZ.d.cts} +7 -4
- package/dist/billing/index.d.cts +1 -1
- package/dist/billing/index.d.ts +1 -1
- package/dist/billing/types.d.cts +1 -1
- package/dist/billing/types.d.ts +1 -1
- package/dist/chat/index.d.cts +2 -2
- package/dist/chat/index.d.ts +2 -2
- package/dist/chat/types.d.cts +1 -1
- package/dist/chat/types.d.ts +1 -1
- package/dist/componentsMcp/index.d.cts +1 -1
- package/dist/componentsMcp/index.d.ts +1 -1
- package/dist/componentsMcp/types.d.cts +1 -1
- package/dist/componentsMcp/types.d.ts +1 -1
- package/dist/constants/index.cjs +2 -2
- package/dist/constants/index.d.cts +3 -3
- package/dist/constants/index.d.ts +3 -3
- package/dist/constants/index.js +2 -2
- package/dist/{constants-HccvU5kx.js → constants-CxEaHCyt.js} +4 -3
- package/dist/constants-CxEaHCyt.js.map +1 -0
- package/dist/{constants-V9hAyPTo.cjs → constants-fiyOLyZE.cjs} +4 -3
- package/dist/constants-fiyOLyZE.cjs.map +1 -0
- package/dist/dataScience/index.d.cts +3 -3
- package/dist/dataScience/index.d.ts +3 -3
- package/dist/dataScience/types.d.cts +1 -1
- package/dist/dataScience/types.d.ts +1 -1
- package/dist/developerPortal/index.cjs +1 -1
- package/dist/developerPortal/index.d.cts +3 -3
- package/dist/developerPortal/index.d.ts +3 -3
- package/dist/developerPortal/index.js +1 -1
- package/dist/developerPortal/types.d.cts +2 -2
- package/dist/developerPortal/types.d.ts +2 -2
- package/dist/{developerPortalClient-CzCJ5sE3.js → developerPortalClient-3Q7049-4.js} +19 -1
- package/dist/developerPortalClient-3Q7049-4.js.map +1 -0
- package/dist/{developerPortalClient-BcK9F-Fs.cjs → developerPortalClient-Cj9bStCS.cjs} +19 -1
- package/dist/developerPortalClient-Cj9bStCS.cjs.map +1 -0
- package/dist/domain/permissions/index.d.cts +1 -1
- package/dist/domain/permissions/index.d.ts +1 -1
- package/dist/editor/index.d.cts +2 -2
- package/dist/editor/index.d.ts +2 -2
- package/dist/editor/types.d.cts +1 -1
- package/dist/editor/types.d.ts +1 -1
- package/dist/{emitter-raKkIqRp.d.ts → emitter-yaYzJOdh.d.cts} +1 -2
- package/dist/{emitter-raKkIqRp.d.cts → emitter-yaYzJOdh.d.ts} +1 -2
- package/dist/encryption/index.d.cts +1 -1
- package/dist/encryption/index.d.ts +1 -1
- package/dist/encryption/types.d.cts +1 -1
- package/dist/encryption/types.d.ts +1 -1
- package/dist/import/index.d.cts +3 -3
- package/dist/import/index.d.ts +3 -3
- package/dist/{index-FrsEkDvX.d.cts → index-9p4O-clX.d.cts} +2035 -73
- package/dist/{index-FrsEkDvX.d.ts → index-9p4O-clX.d.ts} +2035 -73
- package/dist/{index-BGE3eZfd.d.cts → index-B-HCh7LL.d.cts} +3 -3
- package/dist/{index-D3hWR_e4.d.ts → index-B0e42GnK.d.cts} +4 -3
- package/dist/{index-DeWeUUfE.d.ts → index-BbXGsspe.d.ts} +4 -4
- package/dist/{index-CYk7Aa8u.d.cts → index-Bg9BWpIY.d.ts} +4 -3
- package/dist/{index-CmyFWQXn.d.cts → index-BgEu7wGk.d.cts} +2671 -7325
- package/dist/{index-B8K-Bbdq.d.cts → index-Btft3BFn.d.ts} +29 -3
- package/dist/{index-CNJBmCHM.d.cts → index-ByaAn_lm.d.cts} +4 -4
- package/dist/{index-DLWMm1-T.d.ts → index-C92Ct6K5.d.ts} +178 -4
- package/dist/{index-CEDjFidH.d.ts → index-CBq59Aif.d.ts} +3 -3
- package/dist/{index-CQNwp6wX.d.ts → index-CGUPsu_R.d.cts} +29 -3
- package/dist/{index-CZvBjQvl.d.ts → index-CIA6-x2Q.d.ts} +4 -4
- package/dist/{index-BVe4S2CK.d.ts → index-CeWVf3d1.d.ts} +4 -4
- package/dist/{index-CQPs3hrp.d.ts → index-Cj0l_DL_.d.ts} +2671 -7325
- package/dist/{index-BUZ-vTRt.d.ts → index-Ck0UPKMM.d.ts} +2 -2
- package/dist/{index-d9zxFmNI.d.cts → index-D0ACg_Pp.d.cts} +7 -4
- package/dist/{index-8QhOqFLY.d.cts → index-D8nMnVp1.d.cts} +4 -4
- package/dist/{index-24GpnYhn.d.cts → index-DENUPo51.d.cts} +2 -2
- package/dist/{index-iFCann29.d.cts → index-DGjxLWZ-.d.cts} +3 -3
- package/dist/{index-CdeWTy8t.d.ts → index-Dse6Psvc.d.ts} +7 -4
- package/dist/{index-DTGOEke4.d.ts → index-DxcaEIhU.d.ts} +3 -3
- package/dist/{index-BE6qM0vu.d.cts → index-OCEoQ1Y-.d.cts} +4 -4
- package/dist/{index-BXgjPlZN.d.cts → index-jR69kGUZ.d.cts} +178 -4
- package/dist/index.cjs +613 -865
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +9 -9
- package/dist/index.d.ts +9 -9
- package/dist/index.js +611 -860
- package/dist/index.js.map +1 -1
- package/dist/kaiAgent/index.cjs +1 -1
- package/dist/kaiAgent/index.d.cts +2 -2
- package/dist/kaiAgent/index.d.ts +2 -2
- package/dist/kaiAgent/index.js +1 -1
- package/dist/kaiAgent/types.d.cts +2 -2
- package/dist/kaiAgent/types.d.ts +2 -2
- package/dist/{kaiAgent-De2T6G4G.cjs → kaiAgent-Q00g6S1v.cjs} +16 -1
- package/dist/kaiAgent-Q00g6S1v.cjs.map +1 -0
- package/dist/{kaiAgent-D0MoKqXe.js → kaiAgent-aqylPZHY.js} +16 -1
- package/dist/kaiAgent-aqylPZHY.js.map +1 -0
- package/dist/management/index.cjs +1 -1
- package/dist/management/index.d.cts +1 -1
- package/dist/management/index.d.ts +1 -1
- package/dist/management/index.js +1 -1
- package/dist/management/types.d.cts +1 -1
- package/dist/management/types.d.ts +1 -1
- package/dist/{management-BlMQnPNS.js → management-CIK5-Aq5.js} +14 -7
- package/dist/management-CIK5-Aq5.js.map +1 -0
- package/dist/{management-dIMrTTpI.cjs → management-Dqrc516s.cjs} +14 -7
- package/dist/management-Dqrc516s.cjs.map +1 -0
- package/dist/{metaObject-ClvW342q.d.ts → metaObject-AQ7wKDOu.d.ts} +2 -2
- package/dist/{metaObject-D7oudegV.d.cts → metaObject-I35_krxf.d.cts} +2 -2
- package/dist/metastore/index.d.cts +1 -1
- package/dist/metastore/index.d.ts +1 -1
- package/dist/metastore/types.d.cts +1 -1
- package/dist/metastore/types.d.ts +1 -1
- package/dist/microsoftGraph/index.d.cts +3 -3
- package/dist/microsoftGraph/index.d.ts +3 -3
- package/dist/microsoftGraph/types.d.cts +2 -2
- package/dist/microsoftGraph/types.d.ts +2 -2
- package/dist/{middleware-DxGv7DG8.js → middleware-DWmhthX0.js} +2 -2
- package/dist/middleware-DWmhthX0.js.map +1 -0
- package/dist/{middleware-vIaPDtQI.cjs → middleware-DYdDD4O6.cjs} +2 -2
- package/dist/middleware-DYdDD4O6.cjs.map +1 -0
- package/dist/notifications/index.d.cts +2 -2
- package/dist/notifications/index.d.ts +2 -2
- package/dist/notifications/types.d.cts +1 -1
- package/dist/notifications/types.d.ts +1 -1
- package/dist/oauth/index.d.cts +2 -2
- package/dist/oauth/index.d.ts +2 -2
- package/dist/oauth/types.d.cts +1 -1
- package/dist/oauth/types.d.ts +1 -1
- package/dist/omnisearch/index.d.cts +2 -2
- package/dist/omnisearch/index.d.ts +2 -2
- package/dist/omnisearch/types.d.cts +1 -1
- package/dist/omnisearch/types.d.ts +1 -1
- package/dist/{project-DS0HOV3M.d.ts → project-DwRvx_zN.d.ts} +3 -3
- package/dist/{project-BGk9CtOq.d.cts → project-ERH0FTGW.d.cts} +3 -3
- package/dist/queryService/index.cjs +1 -1
- package/dist/queryService/index.d.cts +1 -1
- package/dist/queryService/index.d.ts +1 -1
- package/dist/queryService/index.js +1 -1
- package/dist/queryService/types.d.cts +1 -1
- package/dist/queryService/types.d.ts +1 -1
- package/dist/{queryService-C3BQ6GKW.cjs → queryService-CECWubS0.cjs} +2 -2
- package/dist/{queryService-C3BQ6GKW.cjs.map → queryService-CECWubS0.cjs.map} +1 -1
- package/dist/{queryService-DQHtHy2-.js → queryService-CIxb_mcP.js} +2 -2
- package/dist/{queryService-DQHtHy2-.js.map → queryService-CIxb_mcP.js.map} +1 -1
- package/dist/queue/index.cjs +1 -1
- package/dist/queue/index.d.cts +11 -4
- package/dist/queue/index.d.ts +11 -4
- package/dist/queue/index.js +1 -1
- package/dist/queue/types.d.cts +1 -1
- package/dist/queue/types.d.ts +1 -1
- package/dist/{queue-6cywDnA-.js → queue-BBihD5qQ.js} +2 -2
- package/dist/{queue-6cywDnA-.js.map → queue-BBihD5qQ.js.map} +1 -1
- package/dist/{queue-J2uXzXR9.cjs → queue-PmTfoniJ.cjs} +2 -2
- package/dist/{queue-J2uXzXR9.cjs.map → queue-PmTfoniJ.cjs.map} +1 -1
- package/dist/scheduler/index.d.cts +2 -2
- package/dist/scheduler/index.d.ts +2 -2
- package/dist/scheduler/types.d.cts +1 -1
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/{schema-DLmBEgPM.d.cts → schema-CqzWi5cO.d.cts} +14 -4
- package/dist/{schema-DLmBEgPM.d.ts → schema-CqzWi5cO.d.ts} +14 -4
- package/dist/sdk/configurations/index.d.cts +2 -3
- package/dist/sdk/configurations/index.d.ts +2 -3
- package/dist/sdk/dataAppServer/index.cjs +3 -3
- package/dist/sdk/dataAppServer/index.d.cts +1 -1
- package/dist/sdk/dataAppServer/index.d.ts +1 -1
- package/dist/sdk/dataAppServer/index.js +3 -3
- package/dist/sdk/developerPortal/index.cjs +3 -3
- package/dist/sdk/developerPortal/index.cjs.map +1 -1
- package/dist/sdk/developerPortal/index.d.cts +178 -4
- package/dist/sdk/developerPortal/index.d.ts +178 -4
- package/dist/sdk/developerPortal/index.js +3 -3
- package/dist/sdk/developerPortal/index.js.map +1 -1
- package/dist/sdk/kaiMemory/index.d.cts +1 -1
- package/dist/sdk/kaiMemory/index.d.ts +1 -1
- package/dist/sdk/kaiMemory/types.d.cts +1 -1
- package/dist/sdk/kaiMemory/types.d.ts +1 -1
- package/dist/sdk/queryService/index.d.cts +1 -1
- package/dist/sdk/queryService/index.d.ts +1 -1
- package/dist/sdk/securityPolicy/index.d.cts +2 -2
- package/dist/sdk/securityPolicy/index.d.ts +2 -2
- package/dist/sdk/securityPolicy/types.d.cts +1 -1
- package/dist/sdk/securityPolicy/types.d.ts +1 -1
- package/dist/sdk/semanticLayer/index.d.cts +1 -1
- package/dist/sdk/semanticLayer/index.d.ts +1 -1
- package/dist/sdk/semanticLayer/types.d.cts +1 -1
- package/dist/sdk/semanticLayer/types.d.ts +1 -1
- package/dist/sdk/tag/index.d.cts +3 -3
- package/dist/sdk/tag/index.d.ts +3 -3
- package/dist/sdk/tag/types.d.cts +1 -1
- package/dist/sdk/tag/types.d.ts +1 -1
- package/dist/sdk/vault/index.d.cts +1 -1
- package/dist/sdk/vault/index.d.ts +1 -1
- package/dist/status/index.d.cts +1 -1
- package/dist/status/index.d.ts +1 -1
- package/dist/storage/index.cjs +3 -3
- package/dist/storage/index.d.cts +2 -3
- package/dist/storage/index.d.ts +2 -3
- package/dist/storage/index.js +3 -3
- package/dist/storage/types.d.cts +6 -6
- package/dist/storage/types.d.ts +6 -6
- package/dist/{storage-BL-TfHp8.cjs → storage-chxoWtAL.cjs} +83 -42
- package/dist/storage-chxoWtAL.cjs.map +1 -0
- package/dist/{storage-DEJN8sw-.js → storage-o9teEKl_.js} +83 -42
- package/dist/storage-o9teEKl_.js.map +1 -0
- package/dist/{store-2OyH1XOP.cjs → store-7xlVu4qF.cjs} +3 -14
- package/dist/store-7xlVu4qF.cjs.map +1 -0
- package/dist/{store-HP0zRcLz.js → store-DDUzPeCm.js} +3 -14
- package/dist/store-DDUzPeCm.js.map +1 -0
- package/dist/stream/index.d.cts +2 -2
- package/dist/stream/index.d.ts +2 -2
- package/dist/stream/types.d.cts +1 -1
- package/dist/stream/types.d.ts +1 -1
- package/dist/syncActions/index.d.cts +2 -2
- package/dist/syncActions/index.d.ts +2 -2
- package/dist/syncActions/types.d.cts +1 -1
- package/dist/syncActions/types.d.ts +1 -1
- package/dist/telemetry/index.d.cts +2 -2
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/telemetry/types.d.cts +1 -1
- package/dist/telemetry/types.d.ts +1 -1
- package/dist/{transientRetries-BORv47mH.js → transientRetries-dssygpwU.js} +2 -2
- package/dist/{transientRetries-BORv47mH.js.map → transientRetries-dssygpwU.js.map} +1 -1
- package/dist/{transientRetries-CBorl4Ue.cjs → transientRetries-yVaQgKqP.cjs} +2 -2
- package/dist/{transientRetries-CBorl4Ue.cjs.map → transientRetries-yVaQgKqP.cjs.map} +1 -1
- package/dist/{types-BEw98Dd2.d.cts → types-B1kernzE.d.cts} +2 -2
- package/dist/{types-DjSjUKUl.d.ts → types-BBmS7-IS.d.ts} +151 -4
- package/dist/{types-DbthI3r-.d.ts → types-BJyWTgXX.d.ts} +2 -2
- package/dist/{types-DNwIMEuB.d.cts → types-BPNFTA63.d.cts} +21 -7
- package/dist/{types-Bv2Ds1hL.d.cts → types-BPSExpye.d.cts} +244 -4
- package/dist/{types-Dsf7CYmm.d.ts → types-BiXonOK6.d.ts} +2 -2
- package/dist/{types-BXKL0wTI.d.cts → types-BimRBONo.d.cts} +3 -3
- package/dist/{types-D2hhEGem.d.cts → types-BuEC58u3.d.cts} +2 -2
- package/dist/{types-dU3EA8gk.d.ts → types-BzHyi99r.d.cts} +5 -3
- package/dist/{types-J_dgwMjP.d.ts → types-C4T_2JdN.d.cts} +40 -27
- package/dist/{types-OHt0D_f2.d.ts → types-C53aKnWt.d.ts} +2 -2
- package/dist/{types-Do3__S4Q.d.cts → types-CEjgqmr2.d.cts} +2 -2
- package/dist/{types-CQYyULrw.d.ts → types-CGtpwTJk.d.ts} +2 -2
- package/dist/{types-D5bxXqEU.d.ts → types-CH1uguug.d.cts} +2 -163
- package/dist/{types-Tg3euEN_.d.ts → types-CP8-CssY.d.ts} +2 -2
- package/dist/{types-DX1Dz0xK.d.ts → types-CPQ6RkiZ.d.ts} +244 -4
- package/dist/{types-DSWIIMdv.d.ts → types-CPwofeyq.d.ts} +3 -3
- package/dist/{types-ChOJ-Az7.d.cts → types-CQAEOq-K.d.cts} +2 -2
- package/dist/{types-CKdNf_2k.d.cts → types-CVWoP_PC.d.cts} +3 -3
- package/dist/{types-B4ezB18r.d.cts → types-CbM2MApW.d.cts} +2 -2
- package/dist/{types-BD0B1KQ6.d.ts → types-CbOfT6lb.d.ts} +21 -7
- package/dist/{types-DMhgKHCP.d.cts → types-CcPpqVhm.d.cts} +2 -2
- package/dist/{types-d5Bt8Mr3.d.ts → types-CeqpzbBH.d.ts} +2 -2
- package/dist/{types-DU8aPTFW.d.cts → types-CjJYZaMO.d.cts} +2 -2
- package/dist/{types-B4Vwz45w.d.cts → types-CjP8RcFN.d.cts} +2 -2
- package/dist/{types-Rrcx-8LM.d.ts → types-CjfsPtwk.d.ts} +2 -2
- package/dist/{types-B6f6LpZ_.d.cts → types-CnSBLcZB.d.ts} +163 -3
- package/dist/{types-Bp8G9yta.d.ts → types-CsXLdnfV.d.ts} +2 -2
- package/dist/{types-Y4e8GGa3.d.cts → types-CzAh5-0z.d.cts} +2 -2
- package/dist/{types-BDgOF2WN.d.ts → types-D0F_c5KI.d.ts} +4 -4
- package/dist/{types-C5B3Pfob.d.cts → types-D3L3CqKl.d.cts} +151 -4
- package/dist/{types-CTYTMXXj.d.ts → types-D4oIei5M.d.cts} +163 -3
- package/dist/{types-CSE8bHiq.d.cts → types-D6ilG8sC.d.cts} +3 -3
- package/dist/{types-Cf0WE6qK.d.cts → types-DEGkXcw2.d.ts} +5 -3
- package/dist/{types-BynQKst1.d.cts → types-DEhAcO1Z.d.cts} +2 -2
- package/dist/{types-DCARsJWs.d.cts → types-DaIfg9Mb.d.cts} +4 -4
- package/dist/{types-p_lWvuQJ.d.ts → types-DhofEmWy.d.ts} +2 -2
- package/dist/{types-zlYUn0oi.d.ts → types-Dp61pYgP.d.ts} +3 -3
- package/dist/{types-CRC4lbPw.d.cts → types-Dteot3tT.d.ts} +757 -112
- package/dist/{types-DoSZQ1Bi.d.ts → types-K-JISUUI.d.cts} +757 -112
- package/dist/{types-Bwvss_gW.d.cts → types-TywAc1ow.d.ts} +40 -27
- package/dist/{types-B6JcEPEu.d.ts → types-UBpth6_9.d.ts} +2 -2
- package/dist/{types-DKKHKj19.d.cts → types-Vw-tduOH.d.ts} +2 -163
- package/dist/{types-CIlBSV99.d.cts → types-ZyLTqgpa.d.cts} +2 -2
- package/dist/{types-D-ufoskb.d.cts → types-aylD1zQz.d.cts} +17 -2
- package/dist/{types-BVJmcoqA.d.cts → types-fYY4q7dC.d.cts} +2 -2
- package/dist/{types-DK1bSUNr.d.ts → types-jYn3e3Du.d.ts} +3 -3
- package/dist/{types-CepTvkfm.d.ts → types-qXqJRPHj.d.ts} +2 -2
- package/dist/{types-kGZQQcIK.d.ts → types-r-Qa3y8e.d.ts} +2 -2
- package/dist/{types-Cr6WA6CN.d.ts → types-z82j5aNW.d.ts} +17 -2
- package/dist/validateConnectionStatus-DgJwuEy9.js +86 -0
- package/dist/validateConnectionStatus-DgJwuEy9.js.map +1 -0
- package/dist/validateConnectionStatus-DpYRsU-e.cjs +121 -0
- package/dist/validateConnectionStatus-DpYRsU-e.cjs.map +1 -0
- package/dist/vault/index.d.cts +1 -1
- package/dist/vault/index.d.ts +1 -1
- package/dist/vault/types.d.cts +1 -1
- package/dist/vault/types.d.ts +1 -1
- package/package.json +2 -2
- package/surface/apps.md +8 -3
- package/surface/auth.md +3 -2
- package/surface/chat.md +3 -3
- package/surface/dataScience.md +2 -2
- package/surface/kaiAgent.md +4 -3
- package/surface/management.md +4 -4
- package/surface/queue.md +7 -7
- package/surface/storage.md +32 -26
- package/dist/ManagementSessionMintError-BMHDcEqV.js.map +0 -1
- package/dist/ManagementSessionMintError-Bc9bc7Ai.cjs.map +0 -1
- package/dist/apps-BN7fWtSm.js.map +0 -1
- package/dist/apps-C1x5IKNQ.cjs.map +0 -1
- package/dist/authClient-BM4L8XEN.js.map +0 -1
- package/dist/authClient-DspK50e7.cjs.map +0 -1
- package/dist/constants-HccvU5kx.js.map +0 -1
- package/dist/constants-V9hAyPTo.cjs.map +0 -1
- package/dist/developerPortalClient-BcK9F-Fs.cjs.map +0 -1
- package/dist/developerPortalClient-CzCJ5sE3.js.map +0 -1
- package/dist/index-BGsP2QBc.d.ts +0 -10
- package/dist/index-CWowDl63.d.cts +0 -10
- package/dist/kaiAgent-D0MoKqXe.js.map +0 -1
- package/dist/kaiAgent-De2T6G4G.cjs.map +0 -1
- package/dist/management-BlMQnPNS.js.map +0 -1
- package/dist/management-dIMrTTpI.cjs.map +0 -1
- package/dist/middleware-DxGv7DG8.js.map +0 -1
- package/dist/middleware-vIaPDtQI.cjs.map +0 -1
- package/dist/storage-BL-TfHp8.cjs.map +0 -1
- package/dist/storage-DEJN8sw-.js.map +0 -1
- package/dist/store-2OyH1XOP.cjs.map +0 -1
- package/dist/store-HP0zRcLz.js.map +0 -1
- package/dist/validateConnectionStatus-DV00sDmu.js +0 -34
- package/dist/validateConnectionStatus-DV00sDmu.js.map +0 -1
- package/dist/validateConnectionStatus-ckaHcRx8.cjs +0 -51
- package/dist/validateConnectionStatus-ckaHcRx8.cjs.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as getBranchesInputSchema, $t as commonActionInputSchema, A as GoogleSheetsTable, At as FACEBOOK_ACCOUNTS_ACTION, B as GoogleAnalyticsGetProfilesPropertiesInput, Bt as dbtActionInputSchema, C as oneDriveSearchFilesResultSchema, Ct as flowMigrationPreviewResultsSchema, D as testLookerCredentialsInputSchema, Dt as FacebookGetAccountsInput, E as lookerCredentialsResultSchema, Et as FacebookAccount, F as GoogleDriveCreateFileInput, Ft as emailAttachmentsEmailSchema, G as GoogleAnalyticsProperty, Gt as ConfigurationMigrationStatus, H as GoogleAnalyticsGetPropertiesMetadataInput, Ht as dbtDocsSchema, I as GoogleDriveFile, It as getEmailAttachmentsEmailInputSchema, J as googleAnalyticsGetPropertiesMetadataInputSchema, Jt as getConfigurationMigrationStatusInputSchema, K as googleAnalyticsGetProfilesPropertiesInputSchema, Kt as GetConfigurationMigrationStatusInput, L as GoogleDriveTable, Lt as DbtActionInput, M as googleSheetsAddSheetResultSchema, Mt as FacebookComponentId, N as googleSheetsCreateSpreadsheetResultSchema, Nt as isFacebookComponentId, O as GoogleSheetsSheet, Ot as facebookAccountsSchema, P as googleSheetsTableActionInputSchema, Pt as GetEmailAttachmentsEmailInput, Q as GitBranch, Qt as TestConnectionResult, R as googleDriveCreateFileInputSchema, Rt as DbtCompiled, S as oneDriveSearchFilesInputSchema, St as flowMigrationPreviewResultSchema, T as TestLookerCredentialsInput, Tt as flowMigrationValidationResultsSchema, U as GoogleAnalyticsGetPropertiesMetadataResult, Ut as dbtModelTimingSchema, V as GoogleAnalyticsGetProfilesPropertiesResult, Vt as dbtCompiledSchema, W as GoogleAnalyticsProfile, Wt as dbtRunResultsSchema, X as GetBranchesInput, Xt as CommonActionInput, Y as googleAnalyticsGetPropertiesMetadataResultSchema, Yt as getConfigurationMigrationStatusResultSchema, Z as GitAuth, Zt as PreparedRow, _ as oneDriveCreateWorkbookResultSchema, _t as genericExtractorTestRequestResultSchema, a as SshKeyPair, an as codePatternGenerateResultSchema, at as GenericExtractorLoadFromCurlInput, b as oneDriveGetWorksheetsInputSchema, bt as FlowMigrationValidationResult, c as snowflakeDwhManagerUserActionInputSchema, cn as apifyObjectsInputSchema, ct as GenericExtractorTestRequestInput, d as OneDriveCreateWorksheetInput, dn as SyncActionBody, dt as genericExtractorJobSchema, en as preparedRowsSchema, et as gitBranchesSchema, f as OneDriveFile, fn as SyncActionContext, ft as genericExtractorLoadFromCurlInputSchema, g as oneDriveCreateWorkbookInputSchema, gt as genericExtractorTestRequestInputSchema, h as OneDriveWorksheet, ht as genericExtractorPerformFunctionResultSchema, i as oauthCredentialsSchema, in as codePatternGenerateInputSchema, it as GenericExtractorJob, j as GoogleSheetsTableActionInput, jt as FACEBOOK_FAMILY, k as GoogleSheetsSpreadsheet, kt as facebookGetAccountsInputSchema, l as snowflakeDwhManagerUserActionResultSchema, ln as apifyObjectsSchema, lt as GenericExtractorTestRequestResult, m as OneDriveSearchFilesInput, mn as syncActionContextSchema, mt as genericExtractorPerformFunctionInputSchema, n as OauthCredentials, nn as CodePatternGenerateInput, nt as DbtComponentId, o as sshKeyPairSchema, on as ApifyObject, ot as GenericExtractorMapping, p as OneDriveGetWorksheetsInput, pn as syncActionBodySchema, pt as genericExtractorMappingSchema, q as googleAnalyticsGetProfilesPropertiesResultSchema, qt as configurationMigrationStatusSchema, r as buildOauthAuthorization, rn as CodePatternGenerateResult, rt as GenericExtractorInferMappingInput, s as SnowflakeDwhManagerUserActionInput, sn as ApifyObjectsInput, st as GenericExtractorPerformFunctionInput, t as PostActionsBodyRaw, tn as testConnectionResultSchema, tt as DBT_FAMILY, u as OneDriveCreateWorkbookInput, ut as genericExtractorInferMappingInputSchema, v as oneDriveCreateWorksheetInputSchema, vt as FlowMigrationInput, w as LookerCredentialsResult, wt as flowMigrationValidationResultSchema, x as oneDriveGetWorksheetsResultSchema, xt as flowMigrationInputSchema, y as oneDriveCreateWorksheetResultSchema, yt as FlowMigrationPreviewResult, z as googleDriveCreateFileResultSchema, zt as DbtModelTiming } from "../types-
|
|
1
|
+
import { $ as getBranchesInputSchema, $t as commonActionInputSchema, A as GoogleSheetsTable, At as FACEBOOK_ACCOUNTS_ACTION, B as GoogleAnalyticsGetProfilesPropertiesInput, Bt as dbtActionInputSchema, C as oneDriveSearchFilesResultSchema, Ct as flowMigrationPreviewResultsSchema, D as testLookerCredentialsInputSchema, Dt as FacebookGetAccountsInput, E as lookerCredentialsResultSchema, Et as FacebookAccount, F as GoogleDriveCreateFileInput, Ft as emailAttachmentsEmailSchema, G as GoogleAnalyticsProperty, Gt as ConfigurationMigrationStatus, H as GoogleAnalyticsGetPropertiesMetadataInput, Ht as dbtDocsSchema, I as GoogleDriveFile, It as getEmailAttachmentsEmailInputSchema, J as googleAnalyticsGetPropertiesMetadataInputSchema, Jt as getConfigurationMigrationStatusInputSchema, K as googleAnalyticsGetProfilesPropertiesInputSchema, Kt as GetConfigurationMigrationStatusInput, L as GoogleDriveTable, Lt as DbtActionInput, M as googleSheetsAddSheetResultSchema, Mt as FacebookComponentId, N as googleSheetsCreateSpreadsheetResultSchema, Nt as isFacebookComponentId, O as GoogleSheetsSheet, Ot as facebookAccountsSchema, P as googleSheetsTableActionInputSchema, Pt as GetEmailAttachmentsEmailInput, Q as GitBranch, Qt as TestConnectionResult, R as googleDriveCreateFileInputSchema, Rt as DbtCompiled, S as oneDriveSearchFilesInputSchema, St as flowMigrationPreviewResultSchema, T as TestLookerCredentialsInput, Tt as flowMigrationValidationResultsSchema, U as GoogleAnalyticsGetPropertiesMetadataResult, Ut as dbtModelTimingSchema, V as GoogleAnalyticsGetProfilesPropertiesResult, Vt as dbtCompiledSchema, W as GoogleAnalyticsProfile, Wt as dbtRunResultsSchema, X as GetBranchesInput, Xt as CommonActionInput, Y as googleAnalyticsGetPropertiesMetadataResultSchema, Yt as getConfigurationMigrationStatusResultSchema, Z as GitAuth, Zt as PreparedRow, _ as oneDriveCreateWorkbookResultSchema, _t as genericExtractorTestRequestResultSchema, a as SshKeyPair, an as codePatternGenerateResultSchema, at as GenericExtractorLoadFromCurlInput, b as oneDriveGetWorksheetsInputSchema, bt as FlowMigrationValidationResult, c as snowflakeDwhManagerUserActionInputSchema, cn as apifyObjectsInputSchema, ct as GenericExtractorTestRequestInput, d as OneDriveCreateWorksheetInput, dn as SyncActionBody, dt as genericExtractorJobSchema, en as preparedRowsSchema, et as gitBranchesSchema, f as OneDriveFile, fn as SyncActionContext, ft as genericExtractorLoadFromCurlInputSchema, g as oneDriveCreateWorkbookInputSchema, gt as genericExtractorTestRequestInputSchema, h as OneDriveWorksheet, ht as genericExtractorPerformFunctionResultSchema, i as oauthCredentialsSchema, in as codePatternGenerateInputSchema, it as GenericExtractorJob, j as GoogleSheetsTableActionInput, jt as FACEBOOK_FAMILY, k as GoogleSheetsSpreadsheet, kt as facebookGetAccountsInputSchema, l as snowflakeDwhManagerUserActionResultSchema, ln as apifyObjectsSchema, lt as GenericExtractorTestRequestResult, m as OneDriveSearchFilesInput, mn as syncActionContextSchema, mt as genericExtractorPerformFunctionInputSchema, n as OauthCredentials, nn as CodePatternGenerateInput, nt as DbtComponentId, o as sshKeyPairSchema, on as ApifyObject, ot as GenericExtractorMapping, p as OneDriveGetWorksheetsInput, pn as syncActionBodySchema, pt as genericExtractorMappingSchema, q as googleAnalyticsGetProfilesPropertiesResultSchema, qt as configurationMigrationStatusSchema, r as buildOauthAuthorization, rn as CodePatternGenerateResult, rt as GenericExtractorInferMappingInput, s as SnowflakeDwhManagerUserActionInput, sn as ApifyObjectsInput, st as GenericExtractorPerformFunctionInput, t as PostActionsBodyRaw, tn as testConnectionResultSchema, tt as DBT_FAMILY, u as OneDriveCreateWorkbookInput, ut as genericExtractorInferMappingInputSchema, v as oneDriveCreateWorksheetInputSchema, vt as FlowMigrationInput, w as LookerCredentialsResult, wt as flowMigrationValidationResultSchema, x as oneDriveGetWorksheetsResultSchema, xt as flowMigrationInputSchema, y as oneDriveCreateWorksheetResultSchema, yt as FlowMigrationPreviewResult, z as googleDriveCreateFileResultSchema, zt as DbtModelTiming } from "../types-CjJYZaMO.cjs";
|
|
2
2
|
export { type ApifyObject, type ApifyObjectsInput, type CodePatternGenerateInput, type CodePatternGenerateResult, type CommonActionInput, type ConfigurationMigrationStatus, type DBT_FAMILY, type DbtActionInput, type DbtCompiled, type DbtComponentId, type DbtModelTiming, type FACEBOOK_ACCOUNTS_ACTION, type FACEBOOK_FAMILY, type FacebookAccount, type FacebookComponentId, type FacebookGetAccountsInput, type FlowMigrationInput, type FlowMigrationPreviewResult, type FlowMigrationValidationResult, type GenericExtractorInferMappingInput, type GenericExtractorJob, type GenericExtractorLoadFromCurlInput, type GenericExtractorMapping, type GenericExtractorPerformFunctionInput, type GenericExtractorTestRequestInput, type GenericExtractorTestRequestResult, type GetBranchesInput, type GetConfigurationMigrationStatusInput, type GetEmailAttachmentsEmailInput, type GitAuth, type GitBranch, type GoogleAnalyticsGetProfilesPropertiesInput, type GoogleAnalyticsGetProfilesPropertiesResult, type GoogleAnalyticsGetPropertiesMetadataInput, type GoogleAnalyticsGetPropertiesMetadataResult, type GoogleAnalyticsProfile, type GoogleAnalyticsProperty, type GoogleDriveCreateFileInput, type GoogleDriveFile, type GoogleDriveTable, type GoogleSheetsSheet, type GoogleSheetsSpreadsheet, type GoogleSheetsTable, type GoogleSheetsTableActionInput, type LookerCredentialsResult, type OauthCredentials, type OneDriveCreateWorkbookInput, type OneDriveCreateWorksheetInput, type OneDriveFile, type OneDriveGetWorksheetsInput, type OneDriveSearchFilesInput, type OneDriveWorksheet, PostActionsBodyRaw, type PreparedRow, type SnowflakeDwhManagerUserActionInput, type SshKeyPair, type SyncActionBody, type SyncActionContext, type TestConnectionResult, type TestLookerCredentialsInput, type apifyObjectsInputSchema, type apifyObjectsSchema, type buildOauthAuthorization, type codePatternGenerateInputSchema, type codePatternGenerateResultSchema, type commonActionInputSchema, type configurationMigrationStatusSchema, type dbtActionInputSchema, type dbtCompiledSchema, type dbtDocsSchema, type dbtModelTimingSchema, type dbtRunResultsSchema, type emailAttachmentsEmailSchema, type facebookAccountsSchema, type facebookGetAccountsInputSchema, type flowMigrationInputSchema, type flowMigrationPreviewResultSchema, type flowMigrationPreviewResultsSchema, type flowMigrationValidationResultSchema, type flowMigrationValidationResultsSchema, type genericExtractorInferMappingInputSchema, type genericExtractorJobSchema, type genericExtractorLoadFromCurlInputSchema, type genericExtractorMappingSchema, type genericExtractorPerformFunctionInputSchema, type genericExtractorPerformFunctionResultSchema, type genericExtractorTestRequestInputSchema, type genericExtractorTestRequestResultSchema, type getBranchesInputSchema, type getConfigurationMigrationStatusInputSchema, type getConfigurationMigrationStatusResultSchema, type getEmailAttachmentsEmailInputSchema, type gitBranchesSchema, type googleAnalyticsGetProfilesPropertiesInputSchema, type googleAnalyticsGetProfilesPropertiesResultSchema, type googleAnalyticsGetPropertiesMetadataInputSchema, type googleAnalyticsGetPropertiesMetadataResultSchema, type googleDriveCreateFileInputSchema, type googleDriveCreateFileResultSchema, type googleSheetsAddSheetResultSchema, type googleSheetsCreateSpreadsheetResultSchema, type googleSheetsTableActionInputSchema, type isFacebookComponentId, type lookerCredentialsResultSchema, type oauthCredentialsSchema, type oneDriveCreateWorkbookInputSchema, type oneDriveCreateWorkbookResultSchema, type oneDriveCreateWorksheetInputSchema, type oneDriveCreateWorksheetResultSchema, type oneDriveGetWorksheetsInputSchema, type oneDriveGetWorksheetsResultSchema, type oneDriveSearchFilesInputSchema, type oneDriveSearchFilesResultSchema, type preparedRowsSchema, type snowflakeDwhManagerUserActionInputSchema, type snowflakeDwhManagerUserActionResultSchema, type sshKeyPairSchema, type syncActionBodySchema, type syncActionContextSchema, type testConnectionResultSchema, type testLookerCredentialsInputSchema };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as getBranchesInputSchema, $t as commonActionInputSchema, A as GoogleSheetsTable, At as FACEBOOK_ACCOUNTS_ACTION, B as GoogleAnalyticsGetProfilesPropertiesInput, Bt as dbtActionInputSchema, C as oneDriveSearchFilesResultSchema, Ct as flowMigrationPreviewResultsSchema, D as testLookerCredentialsInputSchema, Dt as FacebookGetAccountsInput, E as lookerCredentialsResultSchema, Et as FacebookAccount, F as GoogleDriveCreateFileInput, Ft as emailAttachmentsEmailSchema, G as GoogleAnalyticsProperty, Gt as ConfigurationMigrationStatus, H as GoogleAnalyticsGetPropertiesMetadataInput, Ht as dbtDocsSchema, I as GoogleDriveFile, It as getEmailAttachmentsEmailInputSchema, J as googleAnalyticsGetPropertiesMetadataInputSchema, Jt as getConfigurationMigrationStatusInputSchema, K as googleAnalyticsGetProfilesPropertiesInputSchema, Kt as GetConfigurationMigrationStatusInput, L as GoogleDriveTable, Lt as DbtActionInput, M as googleSheetsAddSheetResultSchema, Mt as FacebookComponentId, N as googleSheetsCreateSpreadsheetResultSchema, Nt as isFacebookComponentId, O as GoogleSheetsSheet, Ot as facebookAccountsSchema, P as googleSheetsTableActionInputSchema, Pt as GetEmailAttachmentsEmailInput, Q as GitBranch, Qt as TestConnectionResult, R as googleDriveCreateFileInputSchema, Rt as DbtCompiled, S as oneDriveSearchFilesInputSchema, St as flowMigrationPreviewResultSchema, T as TestLookerCredentialsInput, Tt as flowMigrationValidationResultsSchema, U as GoogleAnalyticsGetPropertiesMetadataResult, Ut as dbtModelTimingSchema, V as GoogleAnalyticsGetProfilesPropertiesResult, Vt as dbtCompiledSchema, W as GoogleAnalyticsProfile, Wt as dbtRunResultsSchema, X as GetBranchesInput, Xt as CommonActionInput, Y as googleAnalyticsGetPropertiesMetadataResultSchema, Yt as getConfigurationMigrationStatusResultSchema, Z as GitAuth, Zt as PreparedRow, _ as oneDriveCreateWorkbookResultSchema, _t as genericExtractorTestRequestResultSchema, a as SshKeyPair, an as codePatternGenerateResultSchema, at as GenericExtractorLoadFromCurlInput, b as oneDriveGetWorksheetsInputSchema, bt as FlowMigrationValidationResult, c as snowflakeDwhManagerUserActionInputSchema, cn as apifyObjectsInputSchema, ct as GenericExtractorTestRequestInput, d as OneDriveCreateWorksheetInput, dn as SyncActionBody, dt as genericExtractorJobSchema, en as preparedRowsSchema, et as gitBranchesSchema, f as OneDriveFile, fn as SyncActionContext, ft as genericExtractorLoadFromCurlInputSchema, g as oneDriveCreateWorkbookInputSchema, gt as genericExtractorTestRequestInputSchema, h as OneDriveWorksheet, ht as genericExtractorPerformFunctionResultSchema, i as oauthCredentialsSchema, in as codePatternGenerateInputSchema, it as GenericExtractorJob, j as GoogleSheetsTableActionInput, jt as FACEBOOK_FAMILY, k as GoogleSheetsSpreadsheet, kt as facebookGetAccountsInputSchema, l as snowflakeDwhManagerUserActionResultSchema, ln as apifyObjectsSchema, lt as GenericExtractorTestRequestResult, m as OneDriveSearchFilesInput, mn as syncActionContextSchema, mt as genericExtractorPerformFunctionInputSchema, n as OauthCredentials, nn as CodePatternGenerateInput, nt as DbtComponentId, o as sshKeyPairSchema, on as ApifyObject, ot as GenericExtractorMapping, p as OneDriveGetWorksheetsInput, pn as syncActionBodySchema, pt as genericExtractorMappingSchema, q as googleAnalyticsGetProfilesPropertiesResultSchema, qt as configurationMigrationStatusSchema, r as buildOauthAuthorization, rn as CodePatternGenerateResult, rt as GenericExtractorInferMappingInput, s as SnowflakeDwhManagerUserActionInput, sn as ApifyObjectsInput, st as GenericExtractorPerformFunctionInput, t as PostActionsBodyRaw, tn as testConnectionResultSchema, tt as DBT_FAMILY, u as OneDriveCreateWorkbookInput, ut as genericExtractorInferMappingInputSchema, v as oneDriveCreateWorksheetInputSchema, vt as FlowMigrationInput, w as LookerCredentialsResult, wt as flowMigrationValidationResultSchema, x as oneDriveGetWorksheetsResultSchema, xt as flowMigrationInputSchema, y as oneDriveCreateWorksheetResultSchema, yt as FlowMigrationPreviewResult, z as googleDriveCreateFileResultSchema, zt as DbtModelTiming } from "../types-
|
|
1
|
+
import { $ as getBranchesInputSchema, $t as commonActionInputSchema, A as GoogleSheetsTable, At as FACEBOOK_ACCOUNTS_ACTION, B as GoogleAnalyticsGetProfilesPropertiesInput, Bt as dbtActionInputSchema, C as oneDriveSearchFilesResultSchema, Ct as flowMigrationPreviewResultsSchema, D as testLookerCredentialsInputSchema, Dt as FacebookGetAccountsInput, E as lookerCredentialsResultSchema, Et as FacebookAccount, F as GoogleDriveCreateFileInput, Ft as emailAttachmentsEmailSchema, G as GoogleAnalyticsProperty, Gt as ConfigurationMigrationStatus, H as GoogleAnalyticsGetPropertiesMetadataInput, Ht as dbtDocsSchema, I as GoogleDriveFile, It as getEmailAttachmentsEmailInputSchema, J as googleAnalyticsGetPropertiesMetadataInputSchema, Jt as getConfigurationMigrationStatusInputSchema, K as googleAnalyticsGetProfilesPropertiesInputSchema, Kt as GetConfigurationMigrationStatusInput, L as GoogleDriveTable, Lt as DbtActionInput, M as googleSheetsAddSheetResultSchema, Mt as FacebookComponentId, N as googleSheetsCreateSpreadsheetResultSchema, Nt as isFacebookComponentId, O as GoogleSheetsSheet, Ot as facebookAccountsSchema, P as googleSheetsTableActionInputSchema, Pt as GetEmailAttachmentsEmailInput, Q as GitBranch, Qt as TestConnectionResult, R as googleDriveCreateFileInputSchema, Rt as DbtCompiled, S as oneDriveSearchFilesInputSchema, St as flowMigrationPreviewResultSchema, T as TestLookerCredentialsInput, Tt as flowMigrationValidationResultsSchema, U as GoogleAnalyticsGetPropertiesMetadataResult, Ut as dbtModelTimingSchema, V as GoogleAnalyticsGetProfilesPropertiesResult, Vt as dbtCompiledSchema, W as GoogleAnalyticsProfile, Wt as dbtRunResultsSchema, X as GetBranchesInput, Xt as CommonActionInput, Y as googleAnalyticsGetPropertiesMetadataResultSchema, Yt as getConfigurationMigrationStatusResultSchema, Z as GitAuth, Zt as PreparedRow, _ as oneDriveCreateWorkbookResultSchema, _t as genericExtractorTestRequestResultSchema, a as SshKeyPair, an as codePatternGenerateResultSchema, at as GenericExtractorLoadFromCurlInput, b as oneDriveGetWorksheetsInputSchema, bt as FlowMigrationValidationResult, c as snowflakeDwhManagerUserActionInputSchema, cn as apifyObjectsInputSchema, ct as GenericExtractorTestRequestInput, d as OneDriveCreateWorksheetInput, dn as SyncActionBody, dt as genericExtractorJobSchema, en as preparedRowsSchema, et as gitBranchesSchema, f as OneDriveFile, fn as SyncActionContext, ft as genericExtractorLoadFromCurlInputSchema, g as oneDriveCreateWorkbookInputSchema, gt as genericExtractorTestRequestInputSchema, h as OneDriveWorksheet, ht as genericExtractorPerformFunctionResultSchema, i as oauthCredentialsSchema, in as codePatternGenerateInputSchema, it as GenericExtractorJob, j as GoogleSheetsTableActionInput, jt as FACEBOOK_FAMILY, k as GoogleSheetsSpreadsheet, kt as facebookGetAccountsInputSchema, l as snowflakeDwhManagerUserActionResultSchema, ln as apifyObjectsSchema, lt as GenericExtractorTestRequestResult, m as OneDriveSearchFilesInput, mn as syncActionContextSchema, mt as genericExtractorPerformFunctionInputSchema, n as OauthCredentials, nn as CodePatternGenerateInput, nt as DbtComponentId, o as sshKeyPairSchema, on as ApifyObject, ot as GenericExtractorMapping, p as OneDriveGetWorksheetsInput, pn as syncActionBodySchema, pt as genericExtractorMappingSchema, q as googleAnalyticsGetProfilesPropertiesResultSchema, qt as configurationMigrationStatusSchema, r as buildOauthAuthorization, rn as CodePatternGenerateResult, rt as GenericExtractorInferMappingInput, s as SnowflakeDwhManagerUserActionInput, sn as ApifyObjectsInput, st as GenericExtractorPerformFunctionInput, t as PostActionsBodyRaw, tn as testConnectionResultSchema, tt as DBT_FAMILY, u as OneDriveCreateWorkbookInput, ut as genericExtractorInferMappingInputSchema, v as oneDriveCreateWorksheetInputSchema, vt as FlowMigrationInput, w as LookerCredentialsResult, wt as flowMigrationValidationResultSchema, x as oneDriveGetWorksheetsResultSchema, xt as flowMigrationInputSchema, y as oneDriveCreateWorksheetResultSchema, yt as FlowMigrationPreviewResult, z as googleDriveCreateFileResultSchema, zt as DbtModelTiming } from "../types-CGtpwTJk.js";
|
|
2
2
|
export { type ApifyObject, type ApifyObjectsInput, type CodePatternGenerateInput, type CodePatternGenerateResult, type CommonActionInput, type ConfigurationMigrationStatus, type DBT_FAMILY, type DbtActionInput, type DbtCompiled, type DbtComponentId, type DbtModelTiming, type FACEBOOK_ACCOUNTS_ACTION, type FACEBOOK_FAMILY, type FacebookAccount, type FacebookComponentId, type FacebookGetAccountsInput, type FlowMigrationInput, type FlowMigrationPreviewResult, type FlowMigrationValidationResult, type GenericExtractorInferMappingInput, type GenericExtractorJob, type GenericExtractorLoadFromCurlInput, type GenericExtractorMapping, type GenericExtractorPerformFunctionInput, type GenericExtractorTestRequestInput, type GenericExtractorTestRequestResult, type GetBranchesInput, type GetConfigurationMigrationStatusInput, type GetEmailAttachmentsEmailInput, type GitAuth, type GitBranch, type GoogleAnalyticsGetProfilesPropertiesInput, type GoogleAnalyticsGetProfilesPropertiesResult, type GoogleAnalyticsGetPropertiesMetadataInput, type GoogleAnalyticsGetPropertiesMetadataResult, type GoogleAnalyticsProfile, type GoogleAnalyticsProperty, type GoogleDriveCreateFileInput, type GoogleDriveFile, type GoogleDriveTable, type GoogleSheetsSheet, type GoogleSheetsSpreadsheet, type GoogleSheetsTable, type GoogleSheetsTableActionInput, type LookerCredentialsResult, type OauthCredentials, type OneDriveCreateWorkbookInput, type OneDriveCreateWorksheetInput, type OneDriveFile, type OneDriveGetWorksheetsInput, type OneDriveSearchFilesInput, type OneDriveWorksheet, PostActionsBodyRaw, type PreparedRow, type SnowflakeDwhManagerUserActionInput, type SshKeyPair, type SyncActionBody, type SyncActionContext, type TestConnectionResult, type TestLookerCredentialsInput, type apifyObjectsInputSchema, type apifyObjectsSchema, type buildOauthAuthorization, type codePatternGenerateInputSchema, type codePatternGenerateResultSchema, type commonActionInputSchema, type configurationMigrationStatusSchema, type dbtActionInputSchema, type dbtCompiledSchema, type dbtDocsSchema, type dbtModelTimingSchema, type dbtRunResultsSchema, type emailAttachmentsEmailSchema, type facebookAccountsSchema, type facebookGetAccountsInputSchema, type flowMigrationInputSchema, type flowMigrationPreviewResultSchema, type flowMigrationPreviewResultsSchema, type flowMigrationValidationResultSchema, type flowMigrationValidationResultsSchema, type genericExtractorInferMappingInputSchema, type genericExtractorJobSchema, type genericExtractorLoadFromCurlInputSchema, type genericExtractorMappingSchema, type genericExtractorPerformFunctionInputSchema, type genericExtractorPerformFunctionResultSchema, type genericExtractorTestRequestInputSchema, type genericExtractorTestRequestResultSchema, type getBranchesInputSchema, type getConfigurationMigrationStatusInputSchema, type getConfigurationMigrationStatusResultSchema, type getEmailAttachmentsEmailInputSchema, type gitBranchesSchema, type googleAnalyticsGetProfilesPropertiesInputSchema, type googleAnalyticsGetProfilesPropertiesResultSchema, type googleAnalyticsGetPropertiesMetadataInputSchema, type googleAnalyticsGetPropertiesMetadataResultSchema, type googleDriveCreateFileInputSchema, type googleDriveCreateFileResultSchema, type googleSheetsAddSheetResultSchema, type googleSheetsCreateSpreadsheetResultSchema, type googleSheetsTableActionInputSchema, type isFacebookComponentId, type lookerCredentialsResultSchema, type oauthCredentialsSchema, type oneDriveCreateWorkbookInputSchema, type oneDriveCreateWorkbookResultSchema, type oneDriveCreateWorksheetInputSchema, type oneDriveCreateWorksheetResultSchema, type oneDriveGetWorksheetsInputSchema, type oneDriveGetWorksheetsResultSchema, type oneDriveSearchFilesInputSchema, type oneDriveSearchFilesResultSchema, type preparedRowsSchema, type snowflakeDwhManagerUserActionInputSchema, type snowflakeDwhManagerUserActionResultSchema, type sshKeyPairSchema, type syncActionBodySchema, type syncActionContextSchema, type testConnectionResultSchema, type testLookerCredentialsInputSchema };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CbM2MApW.cjs";
|
|
2
|
+
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-BuEC58u3.cjs";
|
|
3
3
|
/**
|
|
4
4
|
* Takes the plain telemetry URL and appends the `/provisioning` ingress prefix.
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as ClientInitOptions } from "../types-
|
|
2
|
-
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-
|
|
1
|
+
import { n as ClientInitOptions } from "../types-CP8-CssY.js";
|
|
2
|
+
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-qXqJRPHj.js";
|
|
3
3
|
/**
|
|
4
4
|
* Takes the plain telemetry URL and appends the `/provisioning` ingress prefix.
|
|
5
5
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-
|
|
1
|
+
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-BuEC58u3.cjs";
|
|
2
2
|
export { GetProvisioningTokenBody, ProvisioningToken };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-
|
|
1
|
+
import { n as ProvisioningToken, t as GetProvisioningTokenBody } from "../types-qXqJRPHj.js";
|
|
2
2
|
export { GetProvisioningTokenBody, ProvisioningToken };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as isApiError } from "./createFetchClient-Dc_ZMuq7.js";
|
|
2
2
|
import { t as createAbortError } from "./createAbortError-c6ekCpRy.js";
|
|
3
|
-
import { n as createEmitter, t as createStore } from "./store-
|
|
3
|
+
import { n as createEmitter, t as createStore } from "./store-DDUzPeCm.js";
|
|
4
4
|
// src/utils/async/delay.ts
|
|
5
5
|
const delay = (timeout, signal) => new Promise((resolve, reject) => {
|
|
6
6
|
if (signal?.aborted) return reject(createAbortError(signal.reason));
|
|
@@ -442,4 +442,4 @@ const transientRetries = () => {
|
|
|
442
442
|
};
|
|
443
443
|
export { poller as a, Result as c, delay as d, failureOf as i, asError as l, jobStatus as n, clamp as o, emitter as r, finiteOr as s, transientRetries as t, lazy as u };
|
|
444
444
|
|
|
445
|
-
//# sourceMappingURL=transientRetries-
|
|
445
|
+
//# sourceMappingURL=transientRetries-dssygpwU.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transientRetries-BORv47mH.js","names":[],"sources":["../src/utils/async/delay.ts","../src/utils/async/lazy.ts","../src/utils/async/result.ts","../src/utils/async/poll/utils.ts","../src/utils/async/poll/backoff.ts","../src/utils/async/poll/pollLoop.ts","../src/utils/async/poll/poll.ts","../src/domain/jobStatus.ts","../src/clients/transientRetries.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport const delay = (timeout: number, signal?: AbortSignal) =>\n new Promise<void>((resolve, reject) => {\n if (signal?.aborted) return reject(createAbortError(signal.reason));\n\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(createAbortError(signal?.reason));\n };\n\n // `once: true` only detaches the listener once the event fires, so the timeout path has to\n // detach it explicitly — a caller reusing one signal across many delays (`poll` does) would\n // otherwise pile up a listener per delay for as long as the signal is alive.\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, timeout);\n\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n","import type { TaskFn } from './types';\n\n/**\n * Runs `task` once and replays its promise to every later caller.\n *\n * - A rejection is not cached: the next call retries, so a transient failure never sticks.\n * - Callers that joined the failed run reject with its error.\n */\nexport const lazy = <T>(task: TaskFn<T>): (() => Promise<Awaited<T>>) => {\n let value: Promise<Awaited<T>> | null = null;\n\n // async wrapper so a synchronous throw from `task` rejects rather than throws.\n const runTask = async (): Promise<Awaited<T>> => await task();\n\n return () => {\n value ??= runTask().catch((error: unknown) => {\n value = null;\n throw error;\n });\n return value;\n };\n};\n","export type Success<T> = { success: true; data: T };\nexport type Failure<E extends Error> = { success: false; error: E };\nexport type Result<T, E extends Error = Error> = Success<T> | Failure<E>;\n\n// A task that returns a promise is a type error: the wrapper would report success before it\n// settles, and the rejection would go unhandled. Use the `*Async` sibling.\ntype NotPromise<T> = T extends PromiseLike<unknown> ? never : T;\n\nexport const asError = (thrown: unknown) =>\n thrown instanceof Error ? thrown : new Error(String(thrown), { cause: thrown });\n\nconst success = <T>(data: T): Result<T, never> => ({ success: true, data });\nconst failure = <E extends Error>(error: E): Result<never, E> => ({ success: false, error });\nconst isSuccess = <T, E extends Error>(result: Result<T, E>): result is Success<T> =>\n result.success;\nconst isFailure = <T, E extends Error>(result: Result<T, E>): result is Failure<E> =>\n !result.success;\n\nconst map = <T, E extends Error, U>(result: Result<T, E>, fn: (data: T) => U): Result<U, E> =>\n result.success ? success(fn(result.data)) : result;\n\nconst mapError = <T, E extends Error, F extends Error>(\n result: Result<T, E>,\n fn: (error: E) => F,\n): Result<T, F> => (result.success ? result : failure(fn(result.error)));\n\nconst andThen = <T, E extends Error, U, F extends Error>(\n result: Result<T, E>,\n fn: (data: T) => Result<U, F>,\n): Result<U, E | F> => (result.success ? fn(result.data) : result);\n\nconst match = <T, E extends Error, R>(\n result: Result<T, E>,\n onSuccess: (data: T) => R,\n onFailure: (error: E) => R,\n): R => (result.success ? onSuccess(result.data) : onFailure(result.error));\n\n// A side effect on a success; the result itself passes through untouched, same instance.\nconst tap = <T, E extends Error>(result: Result<T, E>, fn: (data: T) => void): Result<T, E> => {\n if (result.success) fn(result.data);\n return result;\n};\n\nconst unwrap = <T, E extends Error>(result: Result<T, E>): T => {\n if (result.success) return result.data;\n throw result.error;\n};\n\nconst unwrapOr = <T, E extends Error, U>(result: Result<T, E>, fallback: U): T | U =>\n result.success ? result.data : fallback;\n\nconst tryCatch = <T>(task: () => NotPromise<T>): Result<T> => {\n try {\n return success(task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst tryCatchAsync = async <T>(task: () => T | PromiseLike<T>): Promise<Result<T>> => {\n try {\n return success(await task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst fromThrowable =\n <A extends unknown[], R>(fn: (...args: A) => NotPromise<R>) =>\n (...args: A): Result<R> =>\n tryCatch(() => fn(...args));\n\nconst fromThrowableAsync =\n <A extends unknown[], R>(fn: (...args: A) => R | PromiseLike<R>) =>\n (...args: A): Promise<Result<R>> =>\n tryCatchAsync(() => fn(...args));\n\nexport const Result = {\n success,\n failure,\n isSuccess,\n isFailure,\n map,\n mapError,\n andThen,\n match,\n tap,\n unwrap,\n unwrapOr,\n tryCatch,\n tryCatchAsync,\n fromThrowable,\n fromThrowableAsync,\n};\n","/**\n * The longest delay a timer can hold: `setTimeout` takes a 32-bit signed number of milliseconds,\n * about 24.9 days.\n *\n * - Above it the delay wraps: Node warns and fires after 1 ms, so a long wait becomes a busy loop.\n * - It bounds a backoff curve and a poll's timeout alike, since both end up in a timer.\n */\nexport const MAX_TIMER_DELAY = 2 ** 31 - 1;\n\nexport const clamp = (value: number, min: number, max = Infinity) =>\n Math.min(Math.max(value, min), max);\n\nexport const finiteOr = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\n\n/** A signal that never aborts, so an input nobody gave costs no branch of its own. */\nexport const neverAborts = () => new AbortController().signal;\n","import { clamp, finiteOr, MAX_TIMER_DELAY } from './utils';\n\nexport type Jitter =\n | 'none' // delay\n | 'full' // [0, delay)\n | 'equal'; // [delay / 2, delay)\n\ntype Backoff =\n | { type: 'constant'; interval: number } // 3000, 3000, 3000, ...\n | { type: 'linear'; initialInterval: number; step: number } // 1000, 2000, 3000, …\n | { type: 'exponential'; initialInterval: number; factor?: number }; // 1000, 2000, 4000, 8000, …\n\ntype RandomFn = () => number;\ntype JitterFn = (delay: number) => number;\ntype BackoffFn = (attempt: number) => number;\n\nexport type BackoffDef = {\n jitter?: Jitter;\n maxInterval?: number;\n random?: RandomFn;\n} & Backoff;\n\nconst MIN_STEP = 500;\nconst MIN_FACTOR = 2;\nconst MIN_INTERVAL = 500;\n\nexport const createBackoff = ({\n jitter = 'none',\n maxInterval: _maxInterval = MAX_TIMER_DELAY,\n random = Math.random,\n ...backoff\n}: BackoffDef): BackoffFn => {\n const backoffFn: BackoffFn = (attempt) => {\n if (backoff.type === 'linear') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const step = clamp(finiteOr(backoff.step, MIN_STEP), MIN_STEP);\n\n return interval + step * (attempt - 1);\n }\n if (backoff.type === 'exponential') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const factor = clamp(finiteOr(backoff.factor ?? MIN_FACTOR, MIN_FACTOR), MIN_FACTOR);\n\n return interval * factor ** (attempt - 1);\n }\n\n return clamp(finiteOr(backoff.interval, MIN_INTERVAL), MIN_INTERVAL);\n };\n\n const jitterFn: JitterFn = (delay) => {\n if (jitter === 'none') return delay;\n if (jitter === 'full') return delay * random();\n return delay / 2 + (delay / 2) * random(); // equal\n };\n\n const maxInterval = clamp(finiteOr(_maxInterval, MAX_TIMER_DELAY), MIN_INTERVAL, MAX_TIMER_DELAY);\n return (_attempt) => {\n const attempt = clamp(finiteOr(Math.trunc(_attempt), 1), 1);\n const capped = Math.min(backoffFn(attempt), maxInterval);\n // Floored after the jitter, not before: `full` jitter multiplies by a random fraction, so a floor\n // applied to the curve alone leaves sub-millisecond gaps between attempts.\n return clamp(finiteOr(jitterFn(capped), MIN_INTERVAL), MIN_INTERVAL, maxInterval);\n };\n};\n","import { delay } from '../delay';\nimport { Result } from '../result';\n\nimport { type BackoffDef, createBackoff } from './backoff';\nimport { clamp, finiteOr, MAX_TIMER_DELAY, neverAborts } from './utils';\n\ntype Clock = {\n wait: (ms: number, signal?: AbortSignal) => Promise<void>;\n now: () => number;\n};\n\nexport type PollContext = {\n attempt: number;\n elapsed: number;\n};\n\n/** The context plus the answer it is about: what `until` decides on, and what an ending reports. */\nexport type PollTick<T> = PollContext & { last: T | null };\n\nexport type PollResultState = 'done' | 'timedOut' | 'exhausted' | 'aborted' | 'errored';\n\nexport type PollResult<T> = PollTick<T> &\n (\n | { state: 'done'; data: T }\n | { state: 'timedOut' | 'exhausted'; error?: Error }\n | { state: 'aborted'; reason?: unknown }\n | { state: 'errored'; error: Error }\n );\n\nexport type PollOptions<T> = {\n pollFn: (context: PollContext & { signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n signal?: AbortSignal;\n backoff?: BackoffDef;\n isRetryable?: (error: Error) => boolean;\n maxAttempts?: number;\n timeout?: number;\n clock?: Clock;\n};\n\n/** One constructor per ending, so a result is built the same way wherever a poll ends. */\nexport const pollResult = {\n done: <T>(data: T, context: PollTick<T>): PollResult<T> => ({\n state: 'done',\n data,\n ...context,\n last: data,\n }),\n errored: <T>(error: Error, context: PollTick<T>): PollResult<T> => ({\n state: 'errored',\n error,\n ...context,\n }),\n exhausted: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'exhausted',\n error,\n ...context,\n }),\n timedOut: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'timedOut',\n error,\n ...context,\n }),\n aborted: <T>(context: PollTick<T>, reason: unknown): PollResult<T> => ({\n state: 'aborted',\n reason,\n ...context,\n }),\n};\n\nexport const pollLoop = async <T>({\n pollFn: _pollFn,\n until: _until,\n signal: callerSignal = neverAborts(),\n backoff: backoffDef = { type: 'constant', interval: 3000 },\n clock = { wait: (ms, signal) => delay(ms, signal), now: () => performance.now() },\n isRetryable: _isRetryable = () => false,\n maxAttempts: _maxAttempts = Infinity,\n timeout: _timeout = Infinity,\n}: PollOptions<T>): Promise<PollResult<T>> => {\n // A deadline ends up in a timer, so a finite one is bounded by what a timer can hold. `Infinity`\n // is answered before the clamp: it means no deadline, and clamping would make it the longest one.\n const requested = finiteOr(_timeout, Infinity);\n const timeout = requested === Infinity ? Infinity : clamp(requested, 0, MAX_TIMER_DELAY);\n const maxAttempts = Math.trunc(clamp(finiteOr(_maxAttempts, Infinity), 0));\n\n const timeoutSignal = timeout === Infinity ? neverAborts() : AbortSignal.timeout(timeout);\n const anySignal = AbortSignal.any([callerSignal, timeoutSignal]);\n const anyAborted = Promise.withResolvers<never>();\n\n anySignal.addEventListener('abort', () => anyAborted.reject(anySignal.reason), {\n once: true,\n });\n void anyAborted.promise.catch(() => undefined);\n\n const backoffFn = createBackoff(backoffDef);\n const startedAt = clock.now();\n\n const until = Result.fromThrowable(_until);\n const isRetryable = Result.fromThrowable(_isRetryable);\n // Only what the context declares: a request is not handed the tick's `last` as well.\n const pollFn = ({ attempt: at, elapsed }: PollContext) =>\n Result.tryCatchAsync(() =>\n Promise.race([_pollFn({ attempt: at, elapsed, signal: anySignal }), anyAborted.promise]),\n );\n const sleep = Result.fromThrowableAsync((ms: number) => clock.wait(ms, anySignal));\n\n let attempt = 0;\n // What a retry swallowed: the poll carries it to whichever ending runs out first.\n let last: T | null = null;\n let lastError: Error | undefined;\n const context = (at = clock.now() - startedAt): PollTick<T> => ({\n attempt,\n elapsed: at,\n last,\n });\n\n if (attempt >= maxAttempts) return pollResult.exhausted<T>(context());\n\n while (true) {\n const before = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(before, lastError);\n if (callerSignal.aborted) return pollResult.aborted(before, callerSignal.reason);\n\n attempt++;\n // The attempt it is, not the one before it — `before` was read to decide whether to make it.\n const poll = await pollFn({ ...before, attempt });\n\n // What the attempt produced, recorded before the tick that reports it: on any ending but `done`\n // these two are the only account of what the poll saw, and reading them one attempt behind is\n // reading the wrong answer.\n if (poll.success) last = poll.data;\n else lastError = poll.error;\n\n const after = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(after, lastError);\n if (callerSignal.aborted) return pollResult.aborted(after, callerSignal.reason);\n\n if (!poll.success) {\n const canRetry = isRetryable(poll.error);\n\n // A predicate that throws cannot ask for a retry. The request's own failure stays the reported\n // one — it is the type a caller's guards expect — and the predicate's rides along as its cause.\n if (!canRetry.success) {\n poll.error.cause ??= canRetry.error;\n return pollResult.errored(poll.error, after);\n }\n if (!canRetry.data) return pollResult.errored(poll.error, after);\n }\n\n if (poll.success) {\n const isDone = until({ ...after, data: poll.data });\n if (!isDone.success) return pollResult.errored(isDone.error, after);\n if (isDone.data) return pollResult.done(poll.data, after);\n }\n\n // exhausted\n if (attempt >= maxAttempts) return pollResult.exhausted(after, lastError);\n\n // sleep\n const backoff = backoffFn(attempt);\n if (after.elapsed + backoff >= timeout) return pollResult.timedOut(after, lastError);\n\n const slept = await sleep(backoff);\n if (!slept.success) {\n const afterSleep = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(afterSleep, lastError);\n if (callerSignal.aborted) return pollResult.aborted(afterSleep, callerSignal.reason);\n\n return pollResult.errored(slept.error, afterSleep);\n }\n }\n};\n","import { createAbortError } from '../../createAbortError';\nimport { createEmitter, createStore } from '../../store';\nimport { lazy } from '../lazy';\nimport { Result } from '../result';\n\nimport {\n type PollContext,\n pollLoop,\n type PollOptions,\n type PollResult,\n pollResult,\n type PollResultState,\n type PollTick,\n} from './pollLoop';\nimport { neverAborts } from './utils';\n\nexport type PollKey = readonly unknown[];\n\n/** `requesting` is the request the poll starts from, before any attempt; `polling` is the attempts. */\nexport type PollState = 'idle' | 'requesting' | 'polling' | PollResultState;\nexport type PollSnapshot<T = unknown> = PollTick<T> & { pollKey: PollKey; state: PollState };\n\ntype OnFailure<T> = (result: PollResult<T>, error: Error) => Error | undefined;\n\nexport type Poller<T, S = T> = {\n readonly state: PollState;\n start: () => Promise<PollResult<T>>;\n wait: (onFailure?: OnFailure<T>) => Promise<S>;\n stop: (reason?: string) => void;\n subscribe: (listener: (snapshot: PollSnapshot<T>) => void) => () => void;\n debug: () => PollSnapshot<T>;\n};\n\ntype InitRequest<R> = (signal: AbortSignal) => Promise<R>;\n\nconst isRequest = <R>(init: R | InitRequest<R> | undefined): init is InitRequest<R> =>\n typeof init === 'function';\n\n/**\n * The loop's options plus what names the poll and what it starts from.\n *\n * - `pollKey` names the poll; the loop never sees it. Given as a function of `init`, it is what the\n * poll started from that names it, once that is known.\n * - `init` is a value or a request for it (an enqueue), handed to `pollFn`; a request runs first.\n * - `failed` reads a `done` value for `wait`: what it returns, `wait` throws. A client that\n * knows what gets through declares it as `Poller<T, S>` on its own return.\n */\nexport type PollerOptions<T, K extends PollKey = PollKey, R = undefined> = Omit<\n PollOptions<T>,\n 'pollFn' | 'until'\n> & {\n pollKey: K | ((init: R) => K);\n init?: R | InitRequest<R>;\n pollFn: (context: PollContext & { init: R; signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n failed?: (data: T) => Error | undefined;\n};\n\nexport type ObservedPoller = Pick<Poller<unknown>, 'stop' | 'subscribe' | 'debug' | 'start'>;\n\nexport const emitter = createEmitter<ObservedPoller>();\n\nexport const failureOf = (result: PollResult<unknown>): Error => {\n if ('error' in result && result.error) return result.error;\n\n if (result.state === 'aborted') {\n if (result.reason instanceof Error) return result.reason;\n\n return createAbortError(\n typeof result.reason === 'string' ? result.reason : 'The poll was stopped.',\n );\n }\n\n return new Error(`The poll ${result.state} after ${result.attempt} attempts.`);\n};\n\nexport const poller = <T, K extends PollKey = PollKey, R = undefined>({\n pollKey,\n init,\n signal,\n pollFn,\n until,\n failed,\n ...pollLoopOptions\n}: PollerOptions<T, K, R>): Poller<T> => {\n const callerSignal = signal ?? neverAborts();\n const pollerSignal = new AbortController();\n const anySignal = AbortSignal.any([pollerSignal.signal, callerSignal]);\n\n const keyOf = (from: R) => (typeof pollKey === 'function' ? pollKey(from) : pollKey);\n // An absent `init` is the `undefined` that `R` defaults to, which the body cannot prove.\n const givenInit = (): R => init as R;\n\n // snapshoting; the key is unknown while a request for `init` is out, so it starts empty then\n const snapshot = createStore<PollSnapshot<T>>({\n pollKey: isRequest(init) ? [] : keyOf(givenInit()),\n state: 'idle',\n attempt: 0,\n elapsed: 0,\n last: null,\n });\n const updateSnapshot = (next: Partial<PollSnapshot<T>>) =>\n snapshot.set({ ...snapshot.get(), ...next });\n\n const handleUntil = (tick: PollTick<T> & { data: T }) => {\n updateSnapshot({ attempt: tick.attempt, elapsed: tick.elapsed, last: tick.data });\n return until(tick);\n };\n\n // The result knows what a tick cannot: attempts that failed, and the time the ending itself took.\n const settle = (result: PollResult<T>) => {\n updateSnapshot({\n state: result.state,\n attempt: result.attempt,\n elapsed: result.elapsed,\n last: result.last,\n });\n return result;\n };\n\n // The request runs under the poller's signal, before the first attempt. The poll's deadline\n // bounds the polling, not this request.\n const requestInit = (request: InitRequest<R>) => {\n updateSnapshot({ state: 'requesting' });\n\n return Result.tryCatchAsync(() => {\n anySignal.throwIfAborted();\n return request(anySignal);\n });\n };\n\n const now = () => pollLoopOptions.clock?.now() ?? performance.now();\n\n // How a poll ends when its request did: no attempt was made, and a stop reads as an abort.\n const endedBeforePolling = (error: Error, startedAt: number) => {\n const before: PollTick<T> = { attempt: 0, elapsed: now() - startedAt, last: null };\n\n return anySignal.aborted\n ? pollResult.aborted(before, anySignal.reason)\n : pollResult.errored(error, before);\n };\n\n const start = lazy(async (): Promise<PollResult<T>> => {\n let resolved = givenInit();\n if (isRequest(init)) {\n const startedAt = now();\n const requested = await requestInit(init);\n if (!requested.success) return settle(endedBeforePolling(requested.error, startedAt));\n resolved = requested.data;\n }\n updateSnapshot({ pollKey: keyOf(resolved), state: 'polling' });\n\n return settle(\n await pollLoop({\n ...pollLoopOptions,\n pollFn: (context) => pollFn({ ...context, init: resolved }),\n until: handleUntil,\n signal: anySignal,\n }),\n );\n });\n\n const stop = (reason?: string) => pollerSignal.abort(reason);\n const subscribe = (listener: (snapshot: PollSnapshot<T>) => void) =>\n snapshot.subscribe(() => listener(snapshot.get()));\n const debug = snapshot.get;\n\n const wait = async (onFailure?: OnFailure<T>) => {\n const result = await start();\n if (result.state === 'done') {\n const error = failed?.(result.data);\n if (!error) return result.data;\n throw onFailure?.(result, error) ?? error;\n }\n const error = failureOf(result);\n throw onFailure?.(result, error) ?? error;\n };\n\n const controls = {\n stop,\n subscribe,\n debug,\n start,\n };\n\n emitter.emit(controls);\n\n return {\n get state() {\n return snapshot.get().state;\n },\n wait,\n ...controls,\n };\n};\n","import type { QueryJobStatus } from '../clients/queryService/types';\nimport type { QueueJobStatus } from '../clients/queue/types';\nimport type { StorageJobStatus } from '../clients/storage/jobs/types';\n\n/**\n * One service's statuses split by what the job is doing.\n *\n * - Groups are disjoint and cover the vocabulary; terminal = successful + failed.\n * - The annotation makes a renamed generated status fail the build here.\n */\ntype StatusGroups<Status extends string> = {\n running: readonly Status[];\n successful: readonly Status[];\n failed: readonly Status[];\n};\n\n/** A service's statuses as named constants — `SUCCESS: 'success'`. */\ntype StatusNames<Status extends string> = { [K in Status as Uppercase<K>]: K };\n\n// Mirrors `StorageJobStatus` in `connection`.\nconst STORAGE: StatusGroups<StorageJobStatus> = {\n running: ['waiting', 'processing'],\n successful: ['success'],\n failed: ['error'],\n};\n\n/**\n * Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.\n *\n * - `terminating` is running until `terminated`.\n * - The split mirrors the job's `isSuccess`; with a job in hand, read `job.isSuccess` instead.\n */\nconst QUEUE: StatusGroups<QueueJobStatus> = {\n running: ['created', 'waiting', 'processing', 'terminating'],\n successful: ['success', 'warning'],\n failed: ['error', 'cancelled', 'terminated'],\n};\n\n// Mirrors `JobState` in `go-monorepo` (`services/query/internal/repository/models`).\n// `canceled` with one `l`, unlike the other services.\nconst QUERY: StatusGroups<QueryJobStatus> = {\n running: ['created', 'enqueued', 'processing'],\n successful: ['completed'],\n failed: ['failed', 'canceled'],\n};\n\n/**\n * One service's status predicates, sets and named constants.\n *\n * - `isSuccessful` / `isFailed` are `false` while running.\n * - `isKnown` narrows an untyped string.\n * - `named` is asserted: `Object.fromEntries` can't prove the key mapping.\n */\nconst forService = <Status extends string>(groups: StatusGroups<Status>) => {\n const all = [...groups.running, ...groups.successful, ...groups.failed];\n\n const running: ReadonlySet<Status> = new Set(groups.running);\n const successful: ReadonlySet<Status> = new Set(groups.successful);\n const failed: ReadonlySet<Status> = new Set(groups.failed);\n const terminal: ReadonlySet<Status> = new Set([...groups.successful, ...groups.failed]);\n const known: ReadonlySet<string> = new Set<string>(all);\n\n return {\n isRunning: (status: Status) => running.has(status),\n isTerminal: (status: Status) => terminal.has(status),\n isSuccessful: (status: Status) => successful.has(status),\n isFailed: (status: Status) => failed.has(status),\n isKnown: (value: string): value is Status => known.has(value),\n describe: (status: Status) => ({\n isRunning: running.has(status),\n isTerminal: terminal.has(status),\n isSuccessful: successful.has(status),\n isFailed: failed.has(status),\n }),\n statuses: { running, successful, failed, terminal },\n named: Object.fromEntries(\n all.map((status) => [status.toUpperCase(), status]),\n ) as StatusNames<Status>,\n };\n};\n\n/**\n * Job statuses per service, e.g. `jobStatus.queue.isFailed(status)`.\n *\n * - Never merge services: labels overlap but their meaning differs.\n * - `query` covers the query job, not its statements (which have `notExecuted`).\n */\nexport const jobStatus = {\n storage: forService(STORAGE),\n queue: forService(QUEUE),\n query: forService(QUERY),\n};\n","import { isApiError } from '../fetchClient';\n\nconst MAX_CONSECUTIVE_FAILURES = 5;\n\n// A read that failed in transit, or that the service answered with a 5xx or 429. The job runs\n// server-side either way, so a later read can still see it finish.\nconst isTransient = (error: Error) =>\n error instanceof TypeError ||\n (isApiError(error) && (error.response.status >= 500 || error.response.status === 429));\n\n/** A job poll's retry rule: a transient read is retried up to five times in a row; one that succeeds resets the count. */\nexport const transientRetries = () => {\n let failures = 0;\n\n return {\n reset: () => {\n failures = 0;\n },\n isRetryable: (error: Error) => isTransient(error) && ++failures < MAX_CONSECUTIVE_FAILURES,\n };\n};\n"],"mappings":";;;;AAEA,MAAa,SAAS,SAAiB,WACrC,IAAI,SAAe,SAAS,WAAW;CACrC,IAAI,QAAQ,SAAS,OAAO,OAAO,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAO,iBAAiB,QAAQ,MAAM,CAAC;CACzC;CAKA,MAAM,YAAY,iBAAiB;EACjC,QAAQ,oBAAoB,SAAS,OAAO;EAC5C,QAAQ;CACV,GAAG,OAAO;CAEV,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3D,CAAC;;;;;;;;ACZH,MAAa,QAAW,SAAiD;CACvE,IAAI,QAAoC;CAGxC,MAAM,UAAU,YAAiC,MAAM,KAAK;CAE5D,aAAa;EACX,UAAU,QAAQ,CAAC,CAAC,OAAO,UAAmB;GAC5C,QAAQ;GACR,MAAM;EACR,CAAC;EACD,OAAO;CACT;AACF;;ACbA,MAAa,WAAW,WACtB,kBAAkB,QAAQ,SAAS,IAAI,MAAM,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC;AAEhF,MAAM,WAAc,UAA+B;CAAE,SAAS;CAAM;AAAK;AACzE,MAAM,WAA4B,WAAgC;CAAE,SAAS;CAAO;AAAM;AAC1F,MAAM,aAAiC,WACrC,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AQ,IAAI,MAAM;EACjD,aAAa,WAAmB,SAAS,IAAI,MAAM;EACnD,eAAe,WAAmB,WAAW,IAAI,MAAM;EACvD,WAAW,WAAmB,OAAO,IAAI,MAAM;EAC/C,UAAU,UAAmC,MAAM,IAAI,KAAK;EAC5D,WAAW,YAAoB;GAC7B,WAAW,QAAQ,IAAI,MAAM;GAC7B,YAAY,SAAS,IAAI,MAAM;GAC/B,cAAc,WAAW,IAAI,MAAM;GACnC,UAAU,OAAO,IAAI,MAAM;EAC7B;EACA,UAAU;GAAE;GAAS;GAAY;GAAQ;EAAS;EAClD,OAAO,OAAO,YACZ,IAAI,KAAK,WAAW,CAAC,OAAO,YAAY,GAAG,MAAM,CAAC,CACpD;CACF;AACF;;;;;;;AAQA,MAAa,YAAY;CACvB,SAAS,WAAW,OAAO;CAC3B,OAAO,WAAW,KAAK;CACvB,OAAO,WAAW,KAAK;AACzB;;ACzFA,MAAM,2BAA2B;AAIjC,MAAM,eAAe,UACnB,iBAAiB,aAChB,WAAW,KAAK,MAAM,MAAM,SAAS,UAAU,OAAO,MAAM,SAAS,WAAW;;AAGnF,MAAa,yBAAyB;CACpC,IAAI,WAAW;CAEf,OAAO;EACL,aAAa;GACX,WAAW;EACb;EACA,cAAc,UAAiB,YAAY,KAAK,KAAK,EAAE,WAAW;CACpE;AACF"}
|
|
1
|
+
{"version":3,"file":"transientRetries-dssygpwU.js","names":[],"sources":["../src/utils/async/delay.ts","../src/utils/async/lazy.ts","../src/utils/async/result.ts","../src/utils/async/poll/utils.ts","../src/utils/async/poll/backoff.ts","../src/utils/async/poll/pollLoop.ts","../src/utils/async/poll/poll.ts","../src/domain/jobStatus.ts","../src/clients/transientRetries.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport const delay = (timeout: number, signal?: AbortSignal) =>\n new Promise<void>((resolve, reject) => {\n if (signal?.aborted) return reject(createAbortError(signal.reason));\n\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(createAbortError(signal?.reason));\n };\n\n // `once: true` only detaches the listener once the event fires, so the timeout path has to\n // detach it explicitly — a caller reusing one signal across many delays (`poll` does) would\n // otherwise pile up a listener per delay for as long as the signal is alive.\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, timeout);\n\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n","import type { TaskFn } from './types';\n\n/**\n * Runs `task` once and replays its promise to every later caller.\n *\n * - A rejection is not cached: the next call retries, so a transient failure never sticks.\n * - Callers that joined the failed run reject with its error.\n */\nexport const lazy = <T>(task: TaskFn<T>): (() => Promise<Awaited<T>>) => {\n let value: Promise<Awaited<T>> | null = null;\n\n // async wrapper so a synchronous throw from `task` rejects rather than throws.\n const runTask = async (): Promise<Awaited<T>> => await task();\n\n return () => {\n value ??= runTask().catch((error: unknown) => {\n value = null;\n throw error;\n });\n return value;\n };\n};\n","export type Success<T> = { success: true; data: T };\nexport type Failure<E extends Error> = { success: false; error: E };\nexport type Result<T, E extends Error = Error> = Success<T> | Failure<E>;\n\n// A task that returns a promise is a type error: the wrapper would report success before it\n// settles, and the rejection would go unhandled. Use the `*Async` sibling.\ntype NotPromise<T> = T extends PromiseLike<unknown> ? never : T;\n\nexport const asError = (thrown: unknown) =>\n thrown instanceof Error ? thrown : new Error(String(thrown), { cause: thrown });\n\nconst success = <T>(data: T): Result<T, never> => ({ success: true, data });\nconst failure = <E extends Error>(error: E): Result<never, E> => ({ success: false, error });\nconst isSuccess = <T, E extends Error>(result: Result<T, E>): result is Success<T> =>\n result.success;\nconst isFailure = <T, E extends Error>(result: Result<T, E>): result is Failure<E> =>\n !result.success;\n\nconst map = <T, E extends Error, U>(result: Result<T, E>, fn: (data: T) => U): Result<U, E> =>\n result.success ? success(fn(result.data)) : result;\n\nconst mapError = <T, E extends Error, F extends Error>(\n result: Result<T, E>,\n fn: (error: E) => F,\n): Result<T, F> => (result.success ? result : failure(fn(result.error)));\n\nconst andThen = <T, E extends Error, U, F extends Error>(\n result: Result<T, E>,\n fn: (data: T) => Result<U, F>,\n): Result<U, E | F> => (result.success ? fn(result.data) : result);\n\nconst match = <T, E extends Error, R>(\n result: Result<T, E>,\n onSuccess: (data: T) => R,\n onFailure: (error: E) => R,\n): R => (result.success ? onSuccess(result.data) : onFailure(result.error));\n\n// A side effect on a success; the result itself passes through untouched, same instance.\nconst tap = <T, E extends Error>(result: Result<T, E>, fn: (data: T) => void): Result<T, E> => {\n if (result.success) fn(result.data);\n return result;\n};\n\nconst unwrap = <T, E extends Error>(result: Result<T, E>): T => {\n if (result.success) return result.data;\n throw result.error;\n};\n\nconst unwrapOr = <T, E extends Error, U>(result: Result<T, E>, fallback: U): T | U =>\n result.success ? result.data : fallback;\n\nconst tryCatch = <T>(task: () => NotPromise<T>): Result<T> => {\n try {\n return success(task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst tryCatchAsync = async <T>(task: () => T | PromiseLike<T>): Promise<Result<T>> => {\n try {\n return success(await task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst fromThrowable =\n <A extends unknown[], R>(fn: (...args: A) => NotPromise<R>) =>\n (...args: A): Result<R> =>\n tryCatch(() => fn(...args));\n\nconst fromThrowableAsync =\n <A extends unknown[], R>(fn: (...args: A) => R | PromiseLike<R>) =>\n (...args: A): Promise<Result<R>> =>\n tryCatchAsync(() => fn(...args));\n\nexport const Result = {\n success,\n failure,\n isSuccess,\n isFailure,\n map,\n mapError,\n andThen,\n match,\n tap,\n unwrap,\n unwrapOr,\n tryCatch,\n tryCatchAsync,\n fromThrowable,\n fromThrowableAsync,\n};\n","/**\n * The longest delay a timer can hold: `setTimeout` takes a 32-bit signed number of milliseconds,\n * about 24.9 days.\n *\n * - Above it the delay wraps: Node warns and fires after 1 ms, so a long wait becomes a busy loop.\n * - It bounds a backoff curve and a poll's timeout alike, since both end up in a timer.\n */\nexport const MAX_TIMER_DELAY = 2 ** 31 - 1;\n\nexport const clamp = (value: number, min: number, max = Infinity) =>\n Math.min(Math.max(value, min), max);\n\nexport const finiteOr = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\n\n/** A signal that never aborts, so an input nobody gave costs no branch of its own. */\nexport const neverAborts = () => new AbortController().signal;\n","import { clamp, finiteOr, MAX_TIMER_DELAY } from './utils';\n\nexport type Jitter =\n | 'none' // delay\n | 'full' // [0, delay)\n | 'equal'; // [delay / 2, delay)\n\ntype Backoff =\n | { type: 'constant'; interval: number } // 3000, 3000, 3000, ...\n | { type: 'linear'; initialInterval: number; step: number } // 1000, 2000, 3000, …\n | { type: 'exponential'; initialInterval: number; factor?: number }; // 1000, 2000, 4000, 8000, …\n\ntype RandomFn = () => number;\ntype JitterFn = (delay: number) => number;\ntype BackoffFn = (attempt: number) => number;\n\nexport type BackoffDef = {\n jitter?: Jitter;\n maxInterval?: number;\n random?: RandomFn;\n} & Backoff;\n\nconst MIN_STEP = 500;\nconst MIN_FACTOR = 2;\nconst MIN_INTERVAL = 500;\n\nexport const createBackoff = ({\n jitter = 'none',\n maxInterval: _maxInterval = MAX_TIMER_DELAY,\n random = Math.random,\n ...backoff\n}: BackoffDef): BackoffFn => {\n const backoffFn: BackoffFn = (attempt) => {\n if (backoff.type === 'linear') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const step = clamp(finiteOr(backoff.step, MIN_STEP), MIN_STEP);\n\n return interval + step * (attempt - 1);\n }\n if (backoff.type === 'exponential') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const factor = clamp(finiteOr(backoff.factor ?? MIN_FACTOR, MIN_FACTOR), MIN_FACTOR);\n\n return interval * factor ** (attempt - 1);\n }\n\n return clamp(finiteOr(backoff.interval, MIN_INTERVAL), MIN_INTERVAL);\n };\n\n const jitterFn: JitterFn = (delay) => {\n if (jitter === 'none') return delay;\n if (jitter === 'full') return delay * random();\n return delay / 2 + (delay / 2) * random(); // equal\n };\n\n const maxInterval = clamp(finiteOr(_maxInterval, MAX_TIMER_DELAY), MIN_INTERVAL, MAX_TIMER_DELAY);\n return (_attempt) => {\n const attempt = clamp(finiteOr(Math.trunc(_attempt), 1), 1);\n const capped = Math.min(backoffFn(attempt), maxInterval);\n // Floored after the jitter, not before: `full` jitter multiplies by a random fraction, so a floor\n // applied to the curve alone leaves sub-millisecond gaps between attempts.\n return clamp(finiteOr(jitterFn(capped), MIN_INTERVAL), MIN_INTERVAL, maxInterval);\n };\n};\n","import { delay } from '../delay';\nimport { Result } from '../result';\n\nimport { type BackoffDef, createBackoff } from './backoff';\nimport { clamp, finiteOr, MAX_TIMER_DELAY, neverAborts } from './utils';\n\ntype Clock = {\n wait: (ms: number, signal?: AbortSignal) => Promise<void>;\n now: () => number;\n};\n\nexport type PollContext = {\n attempt: number;\n elapsed: number;\n};\n\n/** The context plus the answer it is about: what `until` decides on, and what an ending reports. */\nexport type PollTick<T> = PollContext & { last: T | null };\n\nexport type PollResultState = 'done' | 'timedOut' | 'exhausted' | 'aborted' | 'errored';\n\nexport type PollResult<T> = PollTick<T> &\n (\n | { state: 'done'; data: T }\n | { state: 'timedOut' | 'exhausted'; error?: Error }\n | { state: 'aborted'; reason?: unknown }\n | { state: 'errored'; error: Error }\n );\n\nexport type PollOptions<T> = {\n pollFn: (context: PollContext & { signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n signal?: AbortSignal;\n backoff?: BackoffDef;\n isRetryable?: (error: Error) => boolean;\n maxAttempts?: number;\n timeout?: number;\n clock?: Clock;\n};\n\n/** One constructor per ending, so a result is built the same way wherever a poll ends. */\nexport const pollResult = {\n done: <T>(data: T, context: PollTick<T>): PollResult<T> => ({\n state: 'done',\n data,\n ...context,\n last: data,\n }),\n errored: <T>(error: Error, context: PollTick<T>): PollResult<T> => ({\n state: 'errored',\n error,\n ...context,\n }),\n exhausted: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'exhausted',\n error,\n ...context,\n }),\n timedOut: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'timedOut',\n error,\n ...context,\n }),\n aborted: <T>(context: PollTick<T>, reason: unknown): PollResult<T> => ({\n state: 'aborted',\n reason,\n ...context,\n }),\n};\n\nexport const pollLoop = async <T>({\n pollFn: _pollFn,\n until: _until,\n signal: callerSignal = neverAborts(),\n backoff: backoffDef = { type: 'constant', interval: 3000 },\n clock = { wait: (ms, signal) => delay(ms, signal), now: () => performance.now() },\n isRetryable: _isRetryable = () => false,\n maxAttempts: _maxAttempts = Infinity,\n timeout: _timeout = Infinity,\n}: PollOptions<T>): Promise<PollResult<T>> => {\n // A deadline ends up in a timer, so a finite one is bounded by what a timer can hold. `Infinity`\n // is answered before the clamp: it means no deadline, and clamping would make it the longest one.\n const requested = finiteOr(_timeout, Infinity);\n const timeout = requested === Infinity ? Infinity : clamp(requested, 0, MAX_TIMER_DELAY);\n const maxAttempts = Math.trunc(clamp(finiteOr(_maxAttempts, Infinity), 0));\n\n const timeoutSignal = timeout === Infinity ? neverAborts() : AbortSignal.timeout(timeout);\n const anySignal = AbortSignal.any([callerSignal, timeoutSignal]);\n const anyAborted = Promise.withResolvers<never>();\n\n anySignal.addEventListener('abort', () => anyAborted.reject(anySignal.reason), {\n once: true,\n });\n void anyAborted.promise.catch(() => undefined);\n\n const backoffFn = createBackoff(backoffDef);\n const startedAt = clock.now();\n\n const until = Result.fromThrowable(_until);\n const isRetryable = Result.fromThrowable(_isRetryable);\n // Only what the context declares: a request is not handed the tick's `last` as well.\n const pollFn = ({ attempt: at, elapsed }: PollContext) =>\n Result.tryCatchAsync(() =>\n Promise.race([_pollFn({ attempt: at, elapsed, signal: anySignal }), anyAborted.promise]),\n );\n const sleep = Result.fromThrowableAsync((ms: number) => clock.wait(ms, anySignal));\n\n let attempt = 0;\n // What a retry swallowed: the poll carries it to whichever ending runs out first.\n let last: T | null = null;\n let lastError: Error | undefined;\n const context = (at = clock.now() - startedAt): PollTick<T> => ({\n attempt,\n elapsed: at,\n last,\n });\n\n if (attempt >= maxAttempts) return pollResult.exhausted<T>(context());\n\n while (true) {\n const before = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(before, lastError);\n if (callerSignal.aborted) return pollResult.aborted(before, callerSignal.reason);\n\n attempt++;\n // The attempt it is, not the one before it — `before` was read to decide whether to make it.\n const poll = await pollFn({ ...before, attempt });\n\n // What the attempt produced, recorded before the tick that reports it: on any ending but `done`\n // these two are the only account of what the poll saw, and reading them one attempt behind is\n // reading the wrong answer.\n if (poll.success) last = poll.data;\n else lastError = poll.error;\n\n const after = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(after, lastError);\n if (callerSignal.aborted) return pollResult.aborted(after, callerSignal.reason);\n\n if (!poll.success) {\n const canRetry = isRetryable(poll.error);\n\n // A predicate that throws cannot ask for a retry. The request's own failure stays the reported\n // one — it is the type a caller's guards expect — and the predicate's rides along as its cause.\n if (!canRetry.success) {\n poll.error.cause ??= canRetry.error;\n return pollResult.errored(poll.error, after);\n }\n if (!canRetry.data) return pollResult.errored(poll.error, after);\n }\n\n if (poll.success) {\n const isDone = until({ ...after, data: poll.data });\n if (!isDone.success) return pollResult.errored(isDone.error, after);\n if (isDone.data) return pollResult.done(poll.data, after);\n }\n\n // exhausted\n if (attempt >= maxAttempts) return pollResult.exhausted(after, lastError);\n\n // sleep\n const backoff = backoffFn(attempt);\n if (after.elapsed + backoff >= timeout) return pollResult.timedOut(after, lastError);\n\n const slept = await sleep(backoff);\n if (!slept.success) {\n const afterSleep = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(afterSleep, lastError);\n if (callerSignal.aborted) return pollResult.aborted(afterSleep, callerSignal.reason);\n\n return pollResult.errored(slept.error, afterSleep);\n }\n }\n};\n","import { createAbortError } from '../../createAbortError';\nimport { createEmitter, createStore } from '../../store';\nimport { lazy } from '../lazy';\nimport { Result } from '../result';\n\nimport {\n type PollContext,\n pollLoop,\n type PollOptions,\n type PollResult,\n pollResult,\n type PollResultState,\n type PollTick,\n} from './pollLoop';\nimport { neverAborts } from './utils';\n\nexport type PollKey = readonly unknown[];\n\n/** `requesting` is the request the poll starts from, before any attempt; `polling` is the attempts. */\nexport type PollState = 'idle' | 'requesting' | 'polling' | PollResultState;\nexport type PollSnapshot<T = unknown> = PollTick<T> & { pollKey: PollKey; state: PollState };\n\ntype OnFailure<T> = (result: PollResult<T>, error: Error) => Error | undefined;\n\nexport type Poller<T, S = T> = {\n readonly state: PollState;\n start: () => Promise<PollResult<T>>;\n wait: (onFailure?: OnFailure<T>) => Promise<S>;\n stop: (reason?: string) => void;\n subscribe: (listener: (snapshot: PollSnapshot<T>) => void) => () => void;\n debug: () => PollSnapshot<T>;\n};\n\ntype InitRequest<R> = (signal: AbortSignal) => Promise<R>;\n\nconst isRequest = <R>(init: R | InitRequest<R> | undefined): init is InitRequest<R> =>\n typeof init === 'function';\n\n/**\n * The loop's options plus what names the poll and what it starts from.\n *\n * - `pollKey` names the poll; the loop never sees it. Given as a function of `init`, it is what the\n * poll started from that names it, once that is known.\n * - `init` is a value or a request for it (an enqueue), handed to `pollFn`; a request runs first.\n * - `failed` reads a `done` value for `wait`: what it returns, `wait` throws. A client that\n * knows what gets through declares it as `Poller<T, S>` on its own return.\n */\nexport type PollerOptions<T, K extends PollKey = PollKey, R = undefined> = Omit<\n PollOptions<T>,\n 'pollFn' | 'until'\n> & {\n pollKey: K | ((init: R) => K);\n init?: R | InitRequest<R>;\n pollFn: (context: PollContext & { init: R; signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n failed?: (data: T) => Error | undefined;\n};\n\nexport type ObservedPoller = Pick<Poller<unknown>, 'stop' | 'subscribe' | 'debug' | 'start'>;\n\nexport const emitter = createEmitter<ObservedPoller>();\n\nexport const failureOf = (result: PollResult<unknown>): Error => {\n if ('error' in result && result.error) return result.error;\n\n if (result.state === 'aborted') {\n if (result.reason instanceof Error) return result.reason;\n\n return createAbortError(\n typeof result.reason === 'string' ? result.reason : 'The poll was stopped.',\n );\n }\n\n return new Error(`The poll ${result.state} after ${result.attempt} attempts.`);\n};\n\nexport const poller = <T, K extends PollKey = PollKey, R = undefined>({\n pollKey,\n init,\n signal,\n pollFn,\n until,\n failed,\n ...pollLoopOptions\n}: PollerOptions<T, K, R>): Poller<T> => {\n const callerSignal = signal ?? neverAborts();\n const pollerSignal = new AbortController();\n const anySignal = AbortSignal.any([pollerSignal.signal, callerSignal]);\n\n const keyOf = (from: R) => (typeof pollKey === 'function' ? pollKey(from) : pollKey);\n // An absent `init` is the `undefined` that `R` defaults to, which the body cannot prove.\n const givenInit = (): R => init as R;\n\n // snapshoting; the key is unknown while a request for `init` is out, so it starts empty then\n const snapshot = createStore<PollSnapshot<T>>({\n pollKey: isRequest(init) ? [] : keyOf(givenInit()),\n state: 'idle',\n attempt: 0,\n elapsed: 0,\n last: null,\n });\n const updateSnapshot = (next: Partial<PollSnapshot<T>>) =>\n snapshot.set({ ...snapshot.get(), ...next });\n\n const handleUntil = (tick: PollTick<T> & { data: T }) => {\n updateSnapshot({ attempt: tick.attempt, elapsed: tick.elapsed, last: tick.data });\n return until(tick);\n };\n\n // The result knows what a tick cannot: attempts that failed, and the time the ending itself took.\n const settle = (result: PollResult<T>) => {\n updateSnapshot({\n state: result.state,\n attempt: result.attempt,\n elapsed: result.elapsed,\n last: result.last,\n });\n return result;\n };\n\n // The request runs under the poller's signal, before the first attempt. The poll's deadline\n // bounds the polling, not this request.\n const requestInit = (request: InitRequest<R>) => {\n updateSnapshot({ state: 'requesting' });\n\n return Result.tryCatchAsync(() => {\n anySignal.throwIfAborted();\n return request(anySignal);\n });\n };\n\n const now = () => pollLoopOptions.clock?.now() ?? performance.now();\n\n // How a poll ends when its request did: no attempt was made, and a stop reads as an abort.\n const endedBeforePolling = (error: Error, startedAt: number) => {\n const before: PollTick<T> = { attempt: 0, elapsed: now() - startedAt, last: null };\n\n return anySignal.aborted\n ? pollResult.aborted(before, anySignal.reason)\n : pollResult.errored(error, before);\n };\n\n const start = lazy(async (): Promise<PollResult<T>> => {\n let resolved = givenInit();\n if (isRequest(init)) {\n const startedAt = now();\n const requested = await requestInit(init);\n if (!requested.success) return settle(endedBeforePolling(requested.error, startedAt));\n resolved = requested.data;\n }\n updateSnapshot({ pollKey: keyOf(resolved), state: 'polling' });\n\n return settle(\n await pollLoop({\n ...pollLoopOptions,\n pollFn: (context) => pollFn({ ...context, init: resolved }),\n until: handleUntil,\n signal: anySignal,\n }),\n );\n });\n\n const stop = (reason?: string) => pollerSignal.abort(reason);\n const subscribe = (listener: (snapshot: PollSnapshot<T>) => void) =>\n snapshot.subscribe(() => listener(snapshot.get()));\n const debug = snapshot.get;\n\n const wait = async (onFailure?: OnFailure<T>) => {\n const result = await start();\n if (result.state === 'done') {\n const error = failed?.(result.data);\n if (!error) return result.data;\n throw onFailure?.(result, error) ?? error;\n }\n const error = failureOf(result);\n throw onFailure?.(result, error) ?? error;\n };\n\n const controls = {\n stop,\n subscribe,\n debug,\n start,\n };\n\n emitter.emit(controls);\n\n return {\n get state() {\n return snapshot.get().state;\n },\n wait,\n ...controls,\n };\n};\n","import type { QueryJobStatus } from '../clients/queryService/types';\nimport type { QueueJobStatus } from '../clients/queue/types';\nimport type { StorageJobStatus } from '../clients/storage/jobs/types';\n\n/**\n * One service's statuses split by what the job is doing.\n *\n * - Groups are disjoint and cover the vocabulary; terminal = successful + failed.\n * - The annotation makes a renamed generated status fail the build here.\n */\ntype StatusGroups<Status extends string> = {\n running: readonly Status[];\n successful: readonly Status[];\n failed: readonly Status[];\n};\n\n/** A service's statuses as named constants — `SUCCESS: 'success'`. */\ntype StatusNames<Status extends string> = { [K in Status as Uppercase<K>]: K };\n\n// Mirrors `StorageJobStatus` in `connection`.\nconst STORAGE: StatusGroups<StorageJobStatus> = {\n running: ['waiting', 'processing'],\n successful: ['success'],\n failed: ['error'],\n};\n\n/**\n * Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.\n *\n * - `terminating` is running until `terminated`.\n * - The split mirrors the job's `isSuccess`; with a job in hand, read `job.isSuccess` instead.\n */\nconst QUEUE: StatusGroups<QueueJobStatus> = {\n running: ['created', 'waiting', 'processing', 'terminating'],\n successful: ['success', 'warning'],\n failed: ['error', 'cancelled', 'terminated'],\n};\n\n// Mirrors `JobState` in `go-monorepo` (`services/query/internal/repository/models`).\n// `canceled` with one `l`, unlike the other services.\nconst QUERY: StatusGroups<QueryJobStatus> = {\n running: ['created', 'enqueued', 'processing'],\n successful: ['completed'],\n failed: ['failed', 'canceled'],\n};\n\n/**\n * One service's status predicates, sets and named constants.\n *\n * - `isSuccessful` / `isFailed` are `false` while running.\n * - `isKnown` narrows an untyped string.\n * - `named` is asserted: `Object.fromEntries` can't prove the key mapping.\n */\nconst forService = <Status extends string>(groups: StatusGroups<Status>) => {\n const all = [...groups.running, ...groups.successful, ...groups.failed];\n\n const running: ReadonlySet<Status> = new Set(groups.running);\n const successful: ReadonlySet<Status> = new Set(groups.successful);\n const failed: ReadonlySet<Status> = new Set(groups.failed);\n const terminal: ReadonlySet<Status> = new Set([...groups.successful, ...groups.failed]);\n const known: ReadonlySet<string> = new Set<string>(all);\n\n return {\n isRunning: (status: Status) => running.has(status),\n isTerminal: (status: Status) => terminal.has(status),\n isSuccessful: (status: Status) => successful.has(status),\n isFailed: (status: Status) => failed.has(status),\n isKnown: (value: string): value is Status => known.has(value),\n describe: (status: Status) => ({\n isRunning: running.has(status),\n isTerminal: terminal.has(status),\n isSuccessful: successful.has(status),\n isFailed: failed.has(status),\n }),\n statuses: { running, successful, failed, terminal },\n named: Object.fromEntries(\n all.map((status) => [status.toUpperCase(), status]),\n ) as StatusNames<Status>,\n };\n};\n\n/**\n * Job statuses per service, e.g. `jobStatus.queue.isFailed(status)`.\n *\n * - Never merge services: labels overlap but their meaning differs.\n * - `query` covers the query job, not its statements (which have `notExecuted`).\n */\nexport const jobStatus = {\n storage: forService(STORAGE),\n queue: forService(QUEUE),\n query: forService(QUERY),\n};\n","import { isApiError } from '../fetchClient';\n\nconst MAX_CONSECUTIVE_FAILURES = 5;\n\n// A read that failed in transit, or that the service answered with a 5xx or 429. The job runs\n// server-side either way, so a later read can still see it finish.\nconst isTransient = (error: Error) =>\n error instanceof TypeError ||\n (isApiError(error) && (error.response.status >= 500 || error.response.status === 429));\n\n/** A job poll's retry rule: a transient read is retried up to five times in a row; one that succeeds resets the count. */\nexport const transientRetries = () => {\n let failures = 0;\n\n return {\n reset: () => {\n failures = 0;\n },\n isRetryable: (error: Error) => isTransient(error) && ++failures < MAX_CONSECUTIVE_FAILURES,\n };\n};\n"],"mappings":";;;;AAEA,MAAa,SAAS,SAAiB,WACrC,IAAI,SAAe,SAAS,WAAW;CACrC,IAAI,QAAQ,SAAS,OAAO,OAAO,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAO,iBAAiB,QAAQ,MAAM,CAAC;CACzC;CAKA,MAAM,YAAY,iBAAiB;EACjC,QAAQ,oBAAoB,SAAS,OAAO;EAC5C,QAAQ;CACV,GAAG,OAAO;CAEV,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3D,CAAC;;;;;;;;ACZH,MAAa,QAAW,SAAiD;CACvE,IAAI,QAAoC;CAGxC,MAAM,UAAU,YAAiC,MAAM,KAAK;CAE5D,aAAa;EACX,UAAU,QAAQ,CAAC,CAAC,OAAO,UAAmB;GAC5C,QAAQ;GACR,MAAM;EACR,CAAC;EACD,OAAO;CACT;AACF;;ACbA,MAAa,WAAW,WACtB,kBAAkB,QAAQ,SAAS,IAAI,MAAM,OAAO,MAAM,GAAG,EAAE,OAAO,OAAO,CAAC;AAEhF,MAAM,WAAc,UAA+B;CAAE,SAAS;CAAM;AAAK;AACzE,MAAM,WAA4B,WAAgC;CAAE,SAAS;CAAO;AAAM;AAC1F,MAAM,aAAiC,WACrC,OAAO;AACT,MAAM,aAAiC,WACrC,CAAC,OAAO;AAEV,MAAM,OAA8B,QAAsB,OACxD,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AAW,IAAI,MAAM;EACvD,WAAW,WAAmB,OAAO,IAAI,MAAM;EAC/C,UAAU,UAAmC,MAAM,IAAI,KAAK;EAC5D,WAAW,YAAoB;GAC7B,WAAW,QAAQ,IAAI,MAAM;GAC7B,YAAY,SAAS,IAAI,MAAM;GAC/B,cAAc,WAAW,IAAI,MAAM;GACnC,UAAU,OAAO,IAAI,MAAM;EAC7B;EACA,UAAU;GAAE;GAAS;GAAY;GAAQ;EAAS;EAClD,OAAO,OAAO,YACZ,IAAI,KAAK,WAAW,CAAC,OAAO,YAAY,GAAG,MAAM,CAAC,CACpD;CACF;AACF;;;;;;;AAQA,MAAa,YAAY;CACvB,SAAS,WAAW,OAAO;CAC3B,OAAO,WAAW,KAAK;CACvB,OAAO,WAAW,KAAK;AACzB;;ACzFA,MAAM,2BAA2B;AAIjC,MAAM,eAAe,UACnB,iBAAiB,aAChB,WAAW,KAAK,MAAM,MAAM,SAAS,UAAU,OAAO,MAAM,SAAS,WAAW;;AAGnF,MAAa,yBAAyB;CACpC,IAAI,WAAW;CAEf,OAAO;EACL,aAAa;GACX,WAAW;EACb;EACA,cAAc,UAAiB,YAAY,KAAK,KAAK,EAAE,WAAW;CACpE;AACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const require_createFetchClient = require("./createFetchClient-CDKSkd7i.cjs");
|
|
2
2
|
const require_createAbortError = require("./createAbortError-Dzc9yObN.cjs");
|
|
3
|
-
const require_store = require("./store-
|
|
3
|
+
const require_store = require("./store-7xlVu4qF.cjs");
|
|
4
4
|
// src/utils/async/delay.ts
|
|
5
5
|
const delay = (timeout, signal) => new Promise((resolve, reject) => {
|
|
6
6
|
if (signal?.aborted) return reject(require_createAbortError.createAbortError(signal.reason));
|
|
@@ -507,4 +507,4 @@ Object.defineProperty(exports, "transientRetries", {
|
|
|
507
507
|
}
|
|
508
508
|
});
|
|
509
509
|
|
|
510
|
-
//# sourceMappingURL=transientRetries-
|
|
510
|
+
//# sourceMappingURL=transientRetries-yVaQgKqP.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transientRetries-CBorl4Ue.cjs","names":["createAbortError","createEmitter","createAbortError","createStore","isApiError"],"sources":["../src/utils/async/delay.ts","../src/utils/async/lazy.ts","../src/utils/async/result.ts","../src/utils/async/poll/utils.ts","../src/utils/async/poll/backoff.ts","../src/utils/async/poll/pollLoop.ts","../src/utils/async/poll/poll.ts","../src/domain/jobStatus.ts","../src/clients/transientRetries.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport const delay = (timeout: number, signal?: AbortSignal) =>\n new Promise<void>((resolve, reject) => {\n if (signal?.aborted) return reject(createAbortError(signal.reason));\n\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(createAbortError(signal?.reason));\n };\n\n // `once: true` only detaches the listener once the event fires, so the timeout path has to\n // detach it explicitly — a caller reusing one signal across many delays (`poll` does) would\n // otherwise pile up a listener per delay for as long as the signal is alive.\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, timeout);\n\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n","import type { TaskFn } from './types';\n\n/**\n * Runs `task` once and replays its promise to every later caller.\n *\n * - A rejection is not cached: the next call retries, so a transient failure never sticks.\n * - Callers that joined the failed run reject with its error.\n */\nexport const lazy = <T>(task: TaskFn<T>): (() => Promise<Awaited<T>>) => {\n let value: Promise<Awaited<T>> | null = null;\n\n // async wrapper so a synchronous throw from `task` rejects rather than throws.\n const runTask = async (): Promise<Awaited<T>> => await task();\n\n return () => {\n value ??= runTask().catch((error: unknown) => {\n value = null;\n throw error;\n });\n return value;\n };\n};\n","export type Success<T> = { success: true; data: T };\nexport type Failure<E extends Error> = { success: false; error: E };\nexport type Result<T, E extends Error = Error> = Success<T> | Failure<E>;\n\n// A task that returns a promise is a type error: the wrapper would report success before it\n// settles, and the rejection would go unhandled. Use the `*Async` sibling.\ntype NotPromise<T> = T extends PromiseLike<unknown> ? never : T;\n\nexport const asError = (thrown: unknown) =>\n thrown instanceof Error ? thrown : new Error(String(thrown), { cause: thrown });\n\nconst success = <T>(data: T): Result<T, never> => ({ success: true, data });\nconst failure = <E extends Error>(error: E): Result<never, E> => ({ success: false, error });\nconst isSuccess = <T, E extends Error>(result: Result<T, E>): result is Success<T> =>\n result.success;\nconst isFailure = <T, E extends Error>(result: Result<T, E>): result is Failure<E> =>\n !result.success;\n\nconst map = <T, E extends Error, U>(result: Result<T, E>, fn: (data: T) => U): Result<U, E> =>\n result.success ? success(fn(result.data)) : result;\n\nconst mapError = <T, E extends Error, F extends Error>(\n result: Result<T, E>,\n fn: (error: E) => F,\n): Result<T, F> => (result.success ? result : failure(fn(result.error)));\n\nconst andThen = <T, E extends Error, U, F extends Error>(\n result: Result<T, E>,\n fn: (data: T) => Result<U, F>,\n): Result<U, E | F> => (result.success ? fn(result.data) : result);\n\nconst match = <T, E extends Error, R>(\n result: Result<T, E>,\n onSuccess: (data: T) => R,\n onFailure: (error: E) => R,\n): R => (result.success ? onSuccess(result.data) : onFailure(result.error));\n\n// A side effect on a success; the result itself passes through untouched, same instance.\nconst tap = <T, E extends Error>(result: Result<T, E>, fn: (data: T) => void): Result<T, E> => {\n if (result.success) fn(result.data);\n return result;\n};\n\nconst unwrap = <T, E extends Error>(result: Result<T, E>): T => {\n if (result.success) return result.data;\n throw result.error;\n};\n\nconst unwrapOr = <T, E extends Error, U>(result: Result<T, E>, fallback: U): T | U =>\n result.success ? result.data : fallback;\n\nconst tryCatch = <T>(task: () => NotPromise<T>): Result<T> => {\n try {\n return success(task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst tryCatchAsync = async <T>(task: () => T | PromiseLike<T>): Promise<Result<T>> => {\n try {\n return success(await task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst fromThrowable =\n <A extends unknown[], R>(fn: (...args: A) => NotPromise<R>) =>\n (...args: A): Result<R> =>\n tryCatch(() => fn(...args));\n\nconst fromThrowableAsync =\n <A extends unknown[], R>(fn: (...args: A) => R | PromiseLike<R>) =>\n (...args: A): Promise<Result<R>> =>\n tryCatchAsync(() => fn(...args));\n\nexport const Result = {\n success,\n failure,\n isSuccess,\n isFailure,\n map,\n mapError,\n andThen,\n match,\n tap,\n unwrap,\n unwrapOr,\n tryCatch,\n tryCatchAsync,\n fromThrowable,\n fromThrowableAsync,\n};\n","/**\n * The longest delay a timer can hold: `setTimeout` takes a 32-bit signed number of milliseconds,\n * about 24.9 days.\n *\n * - Above it the delay wraps: Node warns and fires after 1 ms, so a long wait becomes a busy loop.\n * - It bounds a backoff curve and a poll's timeout alike, since both end up in a timer.\n */\nexport const MAX_TIMER_DELAY = 2 ** 31 - 1;\n\nexport const clamp = (value: number, min: number, max = Infinity) =>\n Math.min(Math.max(value, min), max);\n\nexport const finiteOr = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\n\n/** A signal that never aborts, so an input nobody gave costs no branch of its own. */\nexport const neverAborts = () => new AbortController().signal;\n","import { clamp, finiteOr, MAX_TIMER_DELAY } from './utils';\n\nexport type Jitter =\n | 'none' // delay\n | 'full' // [0, delay)\n | 'equal'; // [delay / 2, delay)\n\ntype Backoff =\n | { type: 'constant'; interval: number } // 3000, 3000, 3000, ...\n | { type: 'linear'; initialInterval: number; step: number } // 1000, 2000, 3000, …\n | { type: 'exponential'; initialInterval: number; factor?: number }; // 1000, 2000, 4000, 8000, …\n\ntype RandomFn = () => number;\ntype JitterFn = (delay: number) => number;\ntype BackoffFn = (attempt: number) => number;\n\nexport type BackoffDef = {\n jitter?: Jitter;\n maxInterval?: number;\n random?: RandomFn;\n} & Backoff;\n\nconst MIN_STEP = 500;\nconst MIN_FACTOR = 2;\nconst MIN_INTERVAL = 500;\n\nexport const createBackoff = ({\n jitter = 'none',\n maxInterval: _maxInterval = MAX_TIMER_DELAY,\n random = Math.random,\n ...backoff\n}: BackoffDef): BackoffFn => {\n const backoffFn: BackoffFn = (attempt) => {\n if (backoff.type === 'linear') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const step = clamp(finiteOr(backoff.step, MIN_STEP), MIN_STEP);\n\n return interval + step * (attempt - 1);\n }\n if (backoff.type === 'exponential') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const factor = clamp(finiteOr(backoff.factor ?? MIN_FACTOR, MIN_FACTOR), MIN_FACTOR);\n\n return interval * factor ** (attempt - 1);\n }\n\n return clamp(finiteOr(backoff.interval, MIN_INTERVAL), MIN_INTERVAL);\n };\n\n const jitterFn: JitterFn = (delay) => {\n if (jitter === 'none') return delay;\n if (jitter === 'full') return delay * random();\n return delay / 2 + (delay / 2) * random(); // equal\n };\n\n const maxInterval = clamp(finiteOr(_maxInterval, MAX_TIMER_DELAY), MIN_INTERVAL, MAX_TIMER_DELAY);\n return (_attempt) => {\n const attempt = clamp(finiteOr(Math.trunc(_attempt), 1), 1);\n const capped = Math.min(backoffFn(attempt), maxInterval);\n // Floored after the jitter, not before: `full` jitter multiplies by a random fraction, so a floor\n // applied to the curve alone leaves sub-millisecond gaps between attempts.\n return clamp(finiteOr(jitterFn(capped), MIN_INTERVAL), MIN_INTERVAL, maxInterval);\n };\n};\n","import { delay } from '../delay';\nimport { Result } from '../result';\n\nimport { type BackoffDef, createBackoff } from './backoff';\nimport { clamp, finiteOr, MAX_TIMER_DELAY, neverAborts } from './utils';\n\ntype Clock = {\n wait: (ms: number, signal?: AbortSignal) => Promise<void>;\n now: () => number;\n};\n\nexport type PollContext = {\n attempt: number;\n elapsed: number;\n};\n\n/** The context plus the answer it is about: what `until` decides on, and what an ending reports. */\nexport type PollTick<T> = PollContext & { last: T | null };\n\nexport type PollResultState = 'done' | 'timedOut' | 'exhausted' | 'aborted' | 'errored';\n\nexport type PollResult<T> = PollTick<T> &\n (\n | { state: 'done'; data: T }\n | { state: 'timedOut' | 'exhausted'; error?: Error }\n | { state: 'aborted'; reason?: unknown }\n | { state: 'errored'; error: Error }\n );\n\nexport type PollOptions<T> = {\n pollFn: (context: PollContext & { signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n signal?: AbortSignal;\n backoff?: BackoffDef;\n isRetryable?: (error: Error) => boolean;\n maxAttempts?: number;\n timeout?: number;\n clock?: Clock;\n};\n\n/** One constructor per ending, so a result is built the same way wherever a poll ends. */\nexport const pollResult = {\n done: <T>(data: T, context: PollTick<T>): PollResult<T> => ({\n state: 'done',\n data,\n ...context,\n last: data,\n }),\n errored: <T>(error: Error, context: PollTick<T>): PollResult<T> => ({\n state: 'errored',\n error,\n ...context,\n }),\n exhausted: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'exhausted',\n error,\n ...context,\n }),\n timedOut: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'timedOut',\n error,\n ...context,\n }),\n aborted: <T>(context: PollTick<T>, reason: unknown): PollResult<T> => ({\n state: 'aborted',\n reason,\n ...context,\n }),\n};\n\nexport const pollLoop = async <T>({\n pollFn: _pollFn,\n until: _until,\n signal: callerSignal = neverAborts(),\n backoff: backoffDef = { type: 'constant', interval: 3000 },\n clock = { wait: (ms, signal) => delay(ms, signal), now: () => performance.now() },\n isRetryable: _isRetryable = () => false,\n maxAttempts: _maxAttempts = Infinity,\n timeout: _timeout = Infinity,\n}: PollOptions<T>): Promise<PollResult<T>> => {\n // A deadline ends up in a timer, so a finite one is bounded by what a timer can hold. `Infinity`\n // is answered before the clamp: it means no deadline, and clamping would make it the longest one.\n const requested = finiteOr(_timeout, Infinity);\n const timeout = requested === Infinity ? Infinity : clamp(requested, 0, MAX_TIMER_DELAY);\n const maxAttempts = Math.trunc(clamp(finiteOr(_maxAttempts, Infinity), 0));\n\n const timeoutSignal = timeout === Infinity ? neverAborts() : AbortSignal.timeout(timeout);\n const anySignal = AbortSignal.any([callerSignal, timeoutSignal]);\n const anyAborted = Promise.withResolvers<never>();\n\n anySignal.addEventListener('abort', () => anyAborted.reject(anySignal.reason), {\n once: true,\n });\n void anyAborted.promise.catch(() => undefined);\n\n const backoffFn = createBackoff(backoffDef);\n const startedAt = clock.now();\n\n const until = Result.fromThrowable(_until);\n const isRetryable = Result.fromThrowable(_isRetryable);\n // Only what the context declares: a request is not handed the tick's `last` as well.\n const pollFn = ({ attempt: at, elapsed }: PollContext) =>\n Result.tryCatchAsync(() =>\n Promise.race([_pollFn({ attempt: at, elapsed, signal: anySignal }), anyAborted.promise]),\n );\n const sleep = Result.fromThrowableAsync((ms: number) => clock.wait(ms, anySignal));\n\n let attempt = 0;\n // What a retry swallowed: the poll carries it to whichever ending runs out first.\n let last: T | null = null;\n let lastError: Error | undefined;\n const context = (at = clock.now() - startedAt): PollTick<T> => ({\n attempt,\n elapsed: at,\n last,\n });\n\n if (attempt >= maxAttempts) return pollResult.exhausted<T>(context());\n\n while (true) {\n const before = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(before, lastError);\n if (callerSignal.aborted) return pollResult.aborted(before, callerSignal.reason);\n\n attempt++;\n // The attempt it is, not the one before it — `before` was read to decide whether to make it.\n const poll = await pollFn({ ...before, attempt });\n\n // What the attempt produced, recorded before the tick that reports it: on any ending but `done`\n // these two are the only account of what the poll saw, and reading them one attempt behind is\n // reading the wrong answer.\n if (poll.success) last = poll.data;\n else lastError = poll.error;\n\n const after = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(after, lastError);\n if (callerSignal.aborted) return pollResult.aborted(after, callerSignal.reason);\n\n if (!poll.success) {\n const canRetry = isRetryable(poll.error);\n\n // A predicate that throws cannot ask for a retry. The request's own failure stays the reported\n // one — it is the type a caller's guards expect — and the predicate's rides along as its cause.\n if (!canRetry.success) {\n poll.error.cause ??= canRetry.error;\n return pollResult.errored(poll.error, after);\n }\n if (!canRetry.data) return pollResult.errored(poll.error, after);\n }\n\n if (poll.success) {\n const isDone = until({ ...after, data: poll.data });\n if (!isDone.success) return pollResult.errored(isDone.error, after);\n if (isDone.data) return pollResult.done(poll.data, after);\n }\n\n // exhausted\n if (attempt >= maxAttempts) return pollResult.exhausted(after, lastError);\n\n // sleep\n const backoff = backoffFn(attempt);\n if (after.elapsed + backoff >= timeout) return pollResult.timedOut(after, lastError);\n\n const slept = await sleep(backoff);\n if (!slept.success) {\n const afterSleep = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(afterSleep, lastError);\n if (callerSignal.aborted) return pollResult.aborted(afterSleep, callerSignal.reason);\n\n return pollResult.errored(slept.error, afterSleep);\n }\n }\n};\n","import { createAbortError } from '../../createAbortError';\nimport { createEmitter, createStore } from '../../store';\nimport { lazy } from '../lazy';\nimport { Result } from '../result';\n\nimport {\n type PollContext,\n pollLoop,\n type PollOptions,\n type PollResult,\n pollResult,\n type PollResultState,\n type PollTick,\n} from './pollLoop';\nimport { neverAborts } from './utils';\n\nexport type PollKey = readonly unknown[];\n\n/** `requesting` is the request the poll starts from, before any attempt; `polling` is the attempts. */\nexport type PollState = 'idle' | 'requesting' | 'polling' | PollResultState;\nexport type PollSnapshot<T = unknown> = PollTick<T> & { pollKey: PollKey; state: PollState };\n\ntype OnFailure<T> = (result: PollResult<T>, error: Error) => Error | undefined;\n\nexport type Poller<T, S = T> = {\n readonly state: PollState;\n start: () => Promise<PollResult<T>>;\n wait: (onFailure?: OnFailure<T>) => Promise<S>;\n stop: (reason?: string) => void;\n subscribe: (listener: (snapshot: PollSnapshot<T>) => void) => () => void;\n debug: () => PollSnapshot<T>;\n};\n\ntype InitRequest<R> = (signal: AbortSignal) => Promise<R>;\n\nconst isRequest = <R>(init: R | InitRequest<R> | undefined): init is InitRequest<R> =>\n typeof init === 'function';\n\n/**\n * The loop's options plus what names the poll and what it starts from.\n *\n * - `pollKey` names the poll; the loop never sees it. Given as a function of `init`, it is what the\n * poll started from that names it, once that is known.\n * - `init` is a value or a request for it (an enqueue), handed to `pollFn`; a request runs first.\n * - `failed` reads a `done` value for `wait`: what it returns, `wait` throws. A client that\n * knows what gets through declares it as `Poller<T, S>` on its own return.\n */\nexport type PollerOptions<T, K extends PollKey = PollKey, R = undefined> = Omit<\n PollOptions<T>,\n 'pollFn' | 'until'\n> & {\n pollKey: K | ((init: R) => K);\n init?: R | InitRequest<R>;\n pollFn: (context: PollContext & { init: R; signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n failed?: (data: T) => Error | undefined;\n};\n\nexport type ObservedPoller = Pick<Poller<unknown>, 'stop' | 'subscribe' | 'debug' | 'start'>;\n\nexport const emitter = createEmitter<ObservedPoller>();\n\nexport const failureOf = (result: PollResult<unknown>): Error => {\n if ('error' in result && result.error) return result.error;\n\n if (result.state === 'aborted') {\n if (result.reason instanceof Error) return result.reason;\n\n return createAbortError(\n typeof result.reason === 'string' ? result.reason : 'The poll was stopped.',\n );\n }\n\n return new Error(`The poll ${result.state} after ${result.attempt} attempts.`);\n};\n\nexport const poller = <T, K extends PollKey = PollKey, R = undefined>({\n pollKey,\n init,\n signal,\n pollFn,\n until,\n failed,\n ...pollLoopOptions\n}: PollerOptions<T, K, R>): Poller<T> => {\n const callerSignal = signal ?? neverAborts();\n const pollerSignal = new AbortController();\n const anySignal = AbortSignal.any([pollerSignal.signal, callerSignal]);\n\n const keyOf = (from: R) => (typeof pollKey === 'function' ? pollKey(from) : pollKey);\n // An absent `init` is the `undefined` that `R` defaults to, which the body cannot prove.\n const givenInit = (): R => init as R;\n\n // snapshoting; the key is unknown while a request for `init` is out, so it starts empty then\n const snapshot = createStore<PollSnapshot<T>>({\n pollKey: isRequest(init) ? [] : keyOf(givenInit()),\n state: 'idle',\n attempt: 0,\n elapsed: 0,\n last: null,\n });\n const updateSnapshot = (next: Partial<PollSnapshot<T>>) =>\n snapshot.set({ ...snapshot.get(), ...next });\n\n const handleUntil = (tick: PollTick<T> & { data: T }) => {\n updateSnapshot({ attempt: tick.attempt, elapsed: tick.elapsed, last: tick.data });\n return until(tick);\n };\n\n // The result knows what a tick cannot: attempts that failed, and the time the ending itself took.\n const settle = (result: PollResult<T>) => {\n updateSnapshot({\n state: result.state,\n attempt: result.attempt,\n elapsed: result.elapsed,\n last: result.last,\n });\n return result;\n };\n\n // The request runs under the poller's signal, before the first attempt. The poll's deadline\n // bounds the polling, not this request.\n const requestInit = (request: InitRequest<R>) => {\n updateSnapshot({ state: 'requesting' });\n\n return Result.tryCatchAsync(() => {\n anySignal.throwIfAborted();\n return request(anySignal);\n });\n };\n\n const now = () => pollLoopOptions.clock?.now() ?? performance.now();\n\n // How a poll ends when its request did: no attempt was made, and a stop reads as an abort.\n const endedBeforePolling = (error: Error, startedAt: number) => {\n const before: PollTick<T> = { attempt: 0, elapsed: now() - startedAt, last: null };\n\n return anySignal.aborted\n ? pollResult.aborted(before, anySignal.reason)\n : pollResult.errored(error, before);\n };\n\n const start = lazy(async (): Promise<PollResult<T>> => {\n let resolved = givenInit();\n if (isRequest(init)) {\n const startedAt = now();\n const requested = await requestInit(init);\n if (!requested.success) return settle(endedBeforePolling(requested.error, startedAt));\n resolved = requested.data;\n }\n updateSnapshot({ pollKey: keyOf(resolved), state: 'polling' });\n\n return settle(\n await pollLoop({\n ...pollLoopOptions,\n pollFn: (context) => pollFn({ ...context, init: resolved }),\n until: handleUntil,\n signal: anySignal,\n }),\n );\n });\n\n const stop = (reason?: string) => pollerSignal.abort(reason);\n const subscribe = (listener: (snapshot: PollSnapshot<T>) => void) =>\n snapshot.subscribe(() => listener(snapshot.get()));\n const debug = snapshot.get;\n\n const wait = async (onFailure?: OnFailure<T>) => {\n const result = await start();\n if (result.state === 'done') {\n const error = failed?.(result.data);\n if (!error) return result.data;\n throw onFailure?.(result, error) ?? error;\n }\n const error = failureOf(result);\n throw onFailure?.(result, error) ?? error;\n };\n\n const controls = {\n stop,\n subscribe,\n debug,\n start,\n };\n\n emitter.emit(controls);\n\n return {\n get state() {\n return snapshot.get().state;\n },\n wait,\n ...controls,\n };\n};\n","import type { QueryJobStatus } from '../clients/queryService/types';\nimport type { QueueJobStatus } from '../clients/queue/types';\nimport type { StorageJobStatus } from '../clients/storage/jobs/types';\n\n/**\n * One service's statuses split by what the job is doing.\n *\n * - Groups are disjoint and cover the vocabulary; terminal = successful + failed.\n * - The annotation makes a renamed generated status fail the build here.\n */\ntype StatusGroups<Status extends string> = {\n running: readonly Status[];\n successful: readonly Status[];\n failed: readonly Status[];\n};\n\n/** A service's statuses as named constants — `SUCCESS: 'success'`. */\ntype StatusNames<Status extends string> = { [K in Status as Uppercase<K>]: K };\n\n// Mirrors `StorageJobStatus` in `connection`.\nconst STORAGE: StatusGroups<StorageJobStatus> = {\n running: ['waiting', 'processing'],\n successful: ['success'],\n failed: ['error'],\n};\n\n/**\n * Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.\n *\n * - `terminating` is running until `terminated`.\n * - The split mirrors the job's `isSuccess`; with a job in hand, read `job.isSuccess` instead.\n */\nconst QUEUE: StatusGroups<QueueJobStatus> = {\n running: ['created', 'waiting', 'processing', 'terminating'],\n successful: ['success', 'warning'],\n failed: ['error', 'cancelled', 'terminated'],\n};\n\n// Mirrors `JobState` in `go-monorepo` (`services/query/internal/repository/models`).\n// `canceled` with one `l`, unlike the other services.\nconst QUERY: StatusGroups<QueryJobStatus> = {\n running: ['created', 'enqueued', 'processing'],\n successful: ['completed'],\n failed: ['failed', 'canceled'],\n};\n\n/**\n * One service's status predicates, sets and named constants.\n *\n * - `isSuccessful` / `isFailed` are `false` while running.\n * - `isKnown` narrows an untyped string.\n * - `named` is asserted: `Object.fromEntries` can't prove the key mapping.\n */\nconst forService = <Status extends string>(groups: StatusGroups<Status>) => {\n const all = [...groups.running, ...groups.successful, ...groups.failed];\n\n const running: ReadonlySet<Status> = new Set(groups.running);\n const successful: ReadonlySet<Status> = new Set(groups.successful);\n const failed: ReadonlySet<Status> = new Set(groups.failed);\n const terminal: ReadonlySet<Status> = new Set([...groups.successful, ...groups.failed]);\n const known: ReadonlySet<string> = new Set<string>(all);\n\n return {\n isRunning: (status: Status) => running.has(status),\n isTerminal: (status: Status) => terminal.has(status),\n isSuccessful: (status: Status) => successful.has(status),\n isFailed: (status: Status) => failed.has(status),\n isKnown: (value: string): value is Status => known.has(value),\n describe: (status: Status) => ({\n isRunning: running.has(status),\n isTerminal: terminal.has(status),\n isSuccessful: successful.has(status),\n isFailed: failed.has(status),\n }),\n statuses: { running, successful, failed, terminal },\n named: Object.fromEntries(\n all.map((status) => [status.toUpperCase(), status]),\n ) as StatusNames<Status>,\n };\n};\n\n/**\n * Job statuses per service, e.g. `jobStatus.queue.isFailed(status)`.\n *\n * - Never merge services: labels overlap but their meaning differs.\n * - `query` covers the query job, not its statements (which have `notExecuted`).\n */\nexport const jobStatus = {\n storage: forService(STORAGE),\n queue: forService(QUEUE),\n query: forService(QUERY),\n};\n","import { isApiError } from '../fetchClient';\n\nconst MAX_CONSECUTIVE_FAILURES = 5;\n\n// A read that failed in transit, or that the service answered with a 5xx or 429. The job runs\n// server-side either way, so a later read can still see it finish.\nconst isTransient = (error: Error) =>\n error instanceof TypeError ||\n (isApiError(error) && (error.response.status >= 500 || error.response.status === 429));\n\n/** A job poll's retry rule: a transient read is retried up to five times in a row; one that succeeds resets the count. */\nexport const transientRetries = () => {\n let failures = 0;\n\n return {\n reset: () => {\n failures = 0;\n },\n isRetryable: (error: Error) => isTransient(error) && ++failures < MAX_CONSECUTIVE_FAILURES,\n };\n};\n"],"mappings":";;;;AAEA,MAAa,SAAS,SAAiB,WACrC,IAAI,SAAe,SAAS,WAAW;CACrC,IAAI,QAAQ,SAAS,OAAO,OAAOA,yBAAAA,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAOA,yBAAAA,iBAAiB,QAAQ,MAAM,CAAC;CACzC;CAKA,MAAM,YAAY,iBAAiB;EACjC,QAAQ,oBAAoB,SAAS,OAAO;EAC5C,QAAQ;CACV,GAAG,OAAO;CAEV,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAAC;AAC3D,CAAC;;;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A,cAAc,UAAiB,YAAY,KAAK,KAAK,EAAE,WAAW;CACpE;AACF"}
|
|
1
|
+
{"version":3,"file":"transientRetries-yVaQgKqP.cjs","names":["createAbortError","createEmitter","createAbortError","createStore","isApiError"],"sources":["../src/utils/async/delay.ts","../src/utils/async/lazy.ts","../src/utils/async/result.ts","../src/utils/async/poll/utils.ts","../src/utils/async/poll/backoff.ts","../src/utils/async/poll/pollLoop.ts","../src/utils/async/poll/poll.ts","../src/domain/jobStatus.ts","../src/clients/transientRetries.ts"],"sourcesContent":["import { createAbortError } from '../createAbortError';\n\nexport const delay = (timeout: number, signal?: AbortSignal) =>\n new Promise<void>((resolve, reject) => {\n if (signal?.aborted) return reject(createAbortError(signal.reason));\n\n const onAbort = () => {\n clearTimeout(timeoutId);\n reject(createAbortError(signal?.reason));\n };\n\n // `once: true` only detaches the listener once the event fires, so the timeout path has to\n // detach it explicitly — a caller reusing one signal across many delays (`poll` does) would\n // otherwise pile up a listener per delay for as long as the signal is alive.\n const timeoutId = setTimeout(() => {\n signal?.removeEventListener('abort', onAbort);\n resolve();\n }, timeout);\n\n signal?.addEventListener('abort', onAbort, { once: true });\n });\n","import type { TaskFn } from './types';\n\n/**\n * Runs `task` once and replays its promise to every later caller.\n *\n * - A rejection is not cached: the next call retries, so a transient failure never sticks.\n * - Callers that joined the failed run reject with its error.\n */\nexport const lazy = <T>(task: TaskFn<T>): (() => Promise<Awaited<T>>) => {\n let value: Promise<Awaited<T>> | null = null;\n\n // async wrapper so a synchronous throw from `task` rejects rather than throws.\n const runTask = async (): Promise<Awaited<T>> => await task();\n\n return () => {\n value ??= runTask().catch((error: unknown) => {\n value = null;\n throw error;\n });\n return value;\n };\n};\n","export type Success<T> = { success: true; data: T };\nexport type Failure<E extends Error> = { success: false; error: E };\nexport type Result<T, E extends Error = Error> = Success<T> | Failure<E>;\n\n// A task that returns a promise is a type error: the wrapper would report success before it\n// settles, and the rejection would go unhandled. Use the `*Async` sibling.\ntype NotPromise<T> = T extends PromiseLike<unknown> ? never : T;\n\nexport const asError = (thrown: unknown) =>\n thrown instanceof Error ? thrown : new Error(String(thrown), { cause: thrown });\n\nconst success = <T>(data: T): Result<T, never> => ({ success: true, data });\nconst failure = <E extends Error>(error: E): Result<never, E> => ({ success: false, error });\nconst isSuccess = <T, E extends Error>(result: Result<T, E>): result is Success<T> =>\n result.success;\nconst isFailure = <T, E extends Error>(result: Result<T, E>): result is Failure<E> =>\n !result.success;\n\nconst map = <T, E extends Error, U>(result: Result<T, E>, fn: (data: T) => U): Result<U, E> =>\n result.success ? success(fn(result.data)) : result;\n\nconst mapError = <T, E extends Error, F extends Error>(\n result: Result<T, E>,\n fn: (error: E) => F,\n): Result<T, F> => (result.success ? result : failure(fn(result.error)));\n\nconst andThen = <T, E extends Error, U, F extends Error>(\n result: Result<T, E>,\n fn: (data: T) => Result<U, F>,\n): Result<U, E | F> => (result.success ? fn(result.data) : result);\n\nconst match = <T, E extends Error, R>(\n result: Result<T, E>,\n onSuccess: (data: T) => R,\n onFailure: (error: E) => R,\n): R => (result.success ? onSuccess(result.data) : onFailure(result.error));\n\n// A side effect on a success; the result itself passes through untouched, same instance.\nconst tap = <T, E extends Error>(result: Result<T, E>, fn: (data: T) => void): Result<T, E> => {\n if (result.success) fn(result.data);\n return result;\n};\n\nconst unwrap = <T, E extends Error>(result: Result<T, E>): T => {\n if (result.success) return result.data;\n throw result.error;\n};\n\nconst unwrapOr = <T, E extends Error, U>(result: Result<T, E>, fallback: U): T | U =>\n result.success ? result.data : fallback;\n\nconst tryCatch = <T>(task: () => NotPromise<T>): Result<T> => {\n try {\n return success(task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst tryCatchAsync = async <T>(task: () => T | PromiseLike<T>): Promise<Result<T>> => {\n try {\n return success(await task());\n } catch (thrown) {\n return failure(asError(thrown));\n }\n};\n\nconst fromThrowable =\n <A extends unknown[], R>(fn: (...args: A) => NotPromise<R>) =>\n (...args: A): Result<R> =>\n tryCatch(() => fn(...args));\n\nconst fromThrowableAsync =\n <A extends unknown[], R>(fn: (...args: A) => R | PromiseLike<R>) =>\n (...args: A): Promise<Result<R>> =>\n tryCatchAsync(() => fn(...args));\n\nexport const Result = {\n success,\n failure,\n isSuccess,\n isFailure,\n map,\n mapError,\n andThen,\n match,\n tap,\n unwrap,\n unwrapOr,\n tryCatch,\n tryCatchAsync,\n fromThrowable,\n fromThrowableAsync,\n};\n","/**\n * The longest delay a timer can hold: `setTimeout` takes a 32-bit signed number of milliseconds,\n * about 24.9 days.\n *\n * - Above it the delay wraps: Node warns and fires after 1 ms, so a long wait becomes a busy loop.\n * - It bounds a backoff curve and a poll's timeout alike, since both end up in a timer.\n */\nexport const MAX_TIMER_DELAY = 2 ** 31 - 1;\n\nexport const clamp = (value: number, min: number, max = Infinity) =>\n Math.min(Math.max(value, min), max);\n\nexport const finiteOr = (value: number, fallback: number) =>\n Number.isFinite(value) ? value : fallback;\n\n/** A signal that never aborts, so an input nobody gave costs no branch of its own. */\nexport const neverAborts = () => new AbortController().signal;\n","import { clamp, finiteOr, MAX_TIMER_DELAY } from './utils';\n\nexport type Jitter =\n | 'none' // delay\n | 'full' // [0, delay)\n | 'equal'; // [delay / 2, delay)\n\ntype Backoff =\n | { type: 'constant'; interval: number } // 3000, 3000, 3000, ...\n | { type: 'linear'; initialInterval: number; step: number } // 1000, 2000, 3000, …\n | { type: 'exponential'; initialInterval: number; factor?: number }; // 1000, 2000, 4000, 8000, …\n\ntype RandomFn = () => number;\ntype JitterFn = (delay: number) => number;\ntype BackoffFn = (attempt: number) => number;\n\nexport type BackoffDef = {\n jitter?: Jitter;\n maxInterval?: number;\n random?: RandomFn;\n} & Backoff;\n\nconst MIN_STEP = 500;\nconst MIN_FACTOR = 2;\nconst MIN_INTERVAL = 500;\n\nexport const createBackoff = ({\n jitter = 'none',\n maxInterval: _maxInterval = MAX_TIMER_DELAY,\n random = Math.random,\n ...backoff\n}: BackoffDef): BackoffFn => {\n const backoffFn: BackoffFn = (attempt) => {\n if (backoff.type === 'linear') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const step = clamp(finiteOr(backoff.step, MIN_STEP), MIN_STEP);\n\n return interval + step * (attempt - 1);\n }\n if (backoff.type === 'exponential') {\n const interval = clamp(finiteOr(backoff.initialInterval, MIN_INTERVAL), MIN_INTERVAL);\n const factor = clamp(finiteOr(backoff.factor ?? MIN_FACTOR, MIN_FACTOR), MIN_FACTOR);\n\n return interval * factor ** (attempt - 1);\n }\n\n return clamp(finiteOr(backoff.interval, MIN_INTERVAL), MIN_INTERVAL);\n };\n\n const jitterFn: JitterFn = (delay) => {\n if (jitter === 'none') return delay;\n if (jitter === 'full') return delay * random();\n return delay / 2 + (delay / 2) * random(); // equal\n };\n\n const maxInterval = clamp(finiteOr(_maxInterval, MAX_TIMER_DELAY), MIN_INTERVAL, MAX_TIMER_DELAY);\n return (_attempt) => {\n const attempt = clamp(finiteOr(Math.trunc(_attempt), 1), 1);\n const capped = Math.min(backoffFn(attempt), maxInterval);\n // Floored after the jitter, not before: `full` jitter multiplies by a random fraction, so a floor\n // applied to the curve alone leaves sub-millisecond gaps between attempts.\n return clamp(finiteOr(jitterFn(capped), MIN_INTERVAL), MIN_INTERVAL, maxInterval);\n };\n};\n","import { delay } from '../delay';\nimport { Result } from '../result';\n\nimport { type BackoffDef, createBackoff } from './backoff';\nimport { clamp, finiteOr, MAX_TIMER_DELAY, neverAborts } from './utils';\n\ntype Clock = {\n wait: (ms: number, signal?: AbortSignal) => Promise<void>;\n now: () => number;\n};\n\nexport type PollContext = {\n attempt: number;\n elapsed: number;\n};\n\n/** The context plus the answer it is about: what `until` decides on, and what an ending reports. */\nexport type PollTick<T> = PollContext & { last: T | null };\n\nexport type PollResultState = 'done' | 'timedOut' | 'exhausted' | 'aborted' | 'errored';\n\nexport type PollResult<T> = PollTick<T> &\n (\n | { state: 'done'; data: T }\n | { state: 'timedOut' | 'exhausted'; error?: Error }\n | { state: 'aborted'; reason?: unknown }\n | { state: 'errored'; error: Error }\n );\n\nexport type PollOptions<T> = {\n pollFn: (context: PollContext & { signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n signal?: AbortSignal;\n backoff?: BackoffDef;\n isRetryable?: (error: Error) => boolean;\n maxAttempts?: number;\n timeout?: number;\n clock?: Clock;\n};\n\n/** One constructor per ending, so a result is built the same way wherever a poll ends. */\nexport const pollResult = {\n done: <T>(data: T, context: PollTick<T>): PollResult<T> => ({\n state: 'done',\n data,\n ...context,\n last: data,\n }),\n errored: <T>(error: Error, context: PollTick<T>): PollResult<T> => ({\n state: 'errored',\n error,\n ...context,\n }),\n exhausted: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'exhausted',\n error,\n ...context,\n }),\n timedOut: <T>(context: PollTick<T>, error?: Error): PollResult<T> => ({\n state: 'timedOut',\n error,\n ...context,\n }),\n aborted: <T>(context: PollTick<T>, reason: unknown): PollResult<T> => ({\n state: 'aborted',\n reason,\n ...context,\n }),\n};\n\nexport const pollLoop = async <T>({\n pollFn: _pollFn,\n until: _until,\n signal: callerSignal = neverAborts(),\n backoff: backoffDef = { type: 'constant', interval: 3000 },\n clock = { wait: (ms, signal) => delay(ms, signal), now: () => performance.now() },\n isRetryable: _isRetryable = () => false,\n maxAttempts: _maxAttempts = Infinity,\n timeout: _timeout = Infinity,\n}: PollOptions<T>): Promise<PollResult<T>> => {\n // A deadline ends up in a timer, so a finite one is bounded by what a timer can hold. `Infinity`\n // is answered before the clamp: it means no deadline, and clamping would make it the longest one.\n const requested = finiteOr(_timeout, Infinity);\n const timeout = requested === Infinity ? Infinity : clamp(requested, 0, MAX_TIMER_DELAY);\n const maxAttempts = Math.trunc(clamp(finiteOr(_maxAttempts, Infinity), 0));\n\n const timeoutSignal = timeout === Infinity ? neverAborts() : AbortSignal.timeout(timeout);\n const anySignal = AbortSignal.any([callerSignal, timeoutSignal]);\n const anyAborted = Promise.withResolvers<never>();\n\n anySignal.addEventListener('abort', () => anyAborted.reject(anySignal.reason), {\n once: true,\n });\n void anyAborted.promise.catch(() => undefined);\n\n const backoffFn = createBackoff(backoffDef);\n const startedAt = clock.now();\n\n const until = Result.fromThrowable(_until);\n const isRetryable = Result.fromThrowable(_isRetryable);\n // Only what the context declares: a request is not handed the tick's `last` as well.\n const pollFn = ({ attempt: at, elapsed }: PollContext) =>\n Result.tryCatchAsync(() =>\n Promise.race([_pollFn({ attempt: at, elapsed, signal: anySignal }), anyAborted.promise]),\n );\n const sleep = Result.fromThrowableAsync((ms: number) => clock.wait(ms, anySignal));\n\n let attempt = 0;\n // What a retry swallowed: the poll carries it to whichever ending runs out first.\n let last: T | null = null;\n let lastError: Error | undefined;\n const context = (at = clock.now() - startedAt): PollTick<T> => ({\n attempt,\n elapsed: at,\n last,\n });\n\n if (attempt >= maxAttempts) return pollResult.exhausted<T>(context());\n\n while (true) {\n const before = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(before, lastError);\n if (callerSignal.aborted) return pollResult.aborted(before, callerSignal.reason);\n\n attempt++;\n // The attempt it is, not the one before it — `before` was read to decide whether to make it.\n const poll = await pollFn({ ...before, attempt });\n\n // What the attempt produced, recorded before the tick that reports it: on any ending but `done`\n // these two are the only account of what the poll saw, and reading them one attempt behind is\n // reading the wrong answer.\n if (poll.success) last = poll.data;\n else lastError = poll.error;\n\n const after = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(after, lastError);\n if (callerSignal.aborted) return pollResult.aborted(after, callerSignal.reason);\n\n if (!poll.success) {\n const canRetry = isRetryable(poll.error);\n\n // A predicate that throws cannot ask for a retry. The request's own failure stays the reported\n // one — it is the type a caller's guards expect — and the predicate's rides along as its cause.\n if (!canRetry.success) {\n poll.error.cause ??= canRetry.error;\n return pollResult.errored(poll.error, after);\n }\n if (!canRetry.data) return pollResult.errored(poll.error, after);\n }\n\n if (poll.success) {\n const isDone = until({ ...after, data: poll.data });\n if (!isDone.success) return pollResult.errored(isDone.error, after);\n if (isDone.data) return pollResult.done(poll.data, after);\n }\n\n // exhausted\n if (attempt >= maxAttempts) return pollResult.exhausted(after, lastError);\n\n // sleep\n const backoff = backoffFn(attempt);\n if (after.elapsed + backoff >= timeout) return pollResult.timedOut(after, lastError);\n\n const slept = await sleep(backoff);\n if (!slept.success) {\n const afterSleep = context();\n if (timeoutSignal.aborted) return pollResult.timedOut(afterSleep, lastError);\n if (callerSignal.aborted) return pollResult.aborted(afterSleep, callerSignal.reason);\n\n return pollResult.errored(slept.error, afterSleep);\n }\n }\n};\n","import { createAbortError } from '../../createAbortError';\nimport { createEmitter, createStore } from '../../store';\nimport { lazy } from '../lazy';\nimport { Result } from '../result';\n\nimport {\n type PollContext,\n pollLoop,\n type PollOptions,\n type PollResult,\n pollResult,\n type PollResultState,\n type PollTick,\n} from './pollLoop';\nimport { neverAborts } from './utils';\n\nexport type PollKey = readonly unknown[];\n\n/** `requesting` is the request the poll starts from, before any attempt; `polling` is the attempts. */\nexport type PollState = 'idle' | 'requesting' | 'polling' | PollResultState;\nexport type PollSnapshot<T = unknown> = PollTick<T> & { pollKey: PollKey; state: PollState };\n\ntype OnFailure<T> = (result: PollResult<T>, error: Error) => Error | undefined;\n\nexport type Poller<T, S = T> = {\n readonly state: PollState;\n start: () => Promise<PollResult<T>>;\n wait: (onFailure?: OnFailure<T>) => Promise<S>;\n stop: (reason?: string) => void;\n subscribe: (listener: (snapshot: PollSnapshot<T>) => void) => () => void;\n debug: () => PollSnapshot<T>;\n};\n\ntype InitRequest<R> = (signal: AbortSignal) => Promise<R>;\n\nconst isRequest = <R>(init: R | InitRequest<R> | undefined): init is InitRequest<R> =>\n typeof init === 'function';\n\n/**\n * The loop's options plus what names the poll and what it starts from.\n *\n * - `pollKey` names the poll; the loop never sees it. Given as a function of `init`, it is what the\n * poll started from that names it, once that is known.\n * - `init` is a value or a request for it (an enqueue), handed to `pollFn`; a request runs first.\n * - `failed` reads a `done` value for `wait`: what it returns, `wait` throws. A client that\n * knows what gets through declares it as `Poller<T, S>` on its own return.\n */\nexport type PollerOptions<T, K extends PollKey = PollKey, R = undefined> = Omit<\n PollOptions<T>,\n 'pollFn' | 'until'\n> & {\n pollKey: K | ((init: R) => K);\n init?: R | InitRequest<R>;\n pollFn: (context: PollContext & { init: R; signal: AbortSignal }) => Promise<T>;\n until: (tick: PollTick<T> & { data: T }) => boolean;\n failed?: (data: T) => Error | undefined;\n};\n\nexport type ObservedPoller = Pick<Poller<unknown>, 'stop' | 'subscribe' | 'debug' | 'start'>;\n\nexport const emitter = createEmitter<ObservedPoller>();\n\nexport const failureOf = (result: PollResult<unknown>): Error => {\n if ('error' in result && result.error) return result.error;\n\n if (result.state === 'aborted') {\n if (result.reason instanceof Error) return result.reason;\n\n return createAbortError(\n typeof result.reason === 'string' ? result.reason : 'The poll was stopped.',\n );\n }\n\n return new Error(`The poll ${result.state} after ${result.attempt} attempts.`);\n};\n\nexport const poller = <T, K extends PollKey = PollKey, R = undefined>({\n pollKey,\n init,\n signal,\n pollFn,\n until,\n failed,\n ...pollLoopOptions\n}: PollerOptions<T, K, R>): Poller<T> => {\n const callerSignal = signal ?? neverAborts();\n const pollerSignal = new AbortController();\n const anySignal = AbortSignal.any([pollerSignal.signal, callerSignal]);\n\n const keyOf = (from: R) => (typeof pollKey === 'function' ? pollKey(from) : pollKey);\n // An absent `init` is the `undefined` that `R` defaults to, which the body cannot prove.\n const givenInit = (): R => init as R;\n\n // snapshoting; the key is unknown while a request for `init` is out, so it starts empty then\n const snapshot = createStore<PollSnapshot<T>>({\n pollKey: isRequest(init) ? [] : keyOf(givenInit()),\n state: 'idle',\n attempt: 0,\n elapsed: 0,\n last: null,\n });\n const updateSnapshot = (next: Partial<PollSnapshot<T>>) =>\n snapshot.set({ ...snapshot.get(), ...next });\n\n const handleUntil = (tick: PollTick<T> & { data: T }) => {\n updateSnapshot({ attempt: tick.attempt, elapsed: tick.elapsed, last: tick.data });\n return until(tick);\n };\n\n // The result knows what a tick cannot: attempts that failed, and the time the ending itself took.\n const settle = (result: PollResult<T>) => {\n updateSnapshot({\n state: result.state,\n attempt: result.attempt,\n elapsed: result.elapsed,\n last: result.last,\n });\n return result;\n };\n\n // The request runs under the poller's signal, before the first attempt. The poll's deadline\n // bounds the polling, not this request.\n const requestInit = (request: InitRequest<R>) => {\n updateSnapshot({ state: 'requesting' });\n\n return Result.tryCatchAsync(() => {\n anySignal.throwIfAborted();\n return request(anySignal);\n });\n };\n\n const now = () => pollLoopOptions.clock?.now() ?? performance.now();\n\n // How a poll ends when its request did: no attempt was made, and a stop reads as an abort.\n const endedBeforePolling = (error: Error, startedAt: number) => {\n const before: PollTick<T> = { attempt: 0, elapsed: now() - startedAt, last: null };\n\n return anySignal.aborted\n ? pollResult.aborted(before, anySignal.reason)\n : pollResult.errored(error, before);\n };\n\n const start = lazy(async (): Promise<PollResult<T>> => {\n let resolved = givenInit();\n if (isRequest(init)) {\n const startedAt = now();\n const requested = await requestInit(init);\n if (!requested.success) return settle(endedBeforePolling(requested.error, startedAt));\n resolved = requested.data;\n }\n updateSnapshot({ pollKey: keyOf(resolved), state: 'polling' });\n\n return settle(\n await pollLoop({\n ...pollLoopOptions,\n pollFn: (context) => pollFn({ ...context, init: resolved }),\n until: handleUntil,\n signal: anySignal,\n }),\n );\n });\n\n const stop = (reason?: string) => pollerSignal.abort(reason);\n const subscribe = (listener: (snapshot: PollSnapshot<T>) => void) =>\n snapshot.subscribe(() => listener(snapshot.get()));\n const debug = snapshot.get;\n\n const wait = async (onFailure?: OnFailure<T>) => {\n const result = await start();\n if (result.state === 'done') {\n const error = failed?.(result.data);\n if (!error) return result.data;\n throw onFailure?.(result, error) ?? error;\n }\n const error = failureOf(result);\n throw onFailure?.(result, error) ?? error;\n };\n\n const controls = {\n stop,\n subscribe,\n debug,\n start,\n };\n\n emitter.emit(controls);\n\n return {\n get state() {\n return snapshot.get().state;\n },\n wait,\n ...controls,\n };\n};\n","import type { QueryJobStatus } from '../clients/queryService/types';\nimport type { QueueJobStatus } from '../clients/queue/types';\nimport type { StorageJobStatus } from '../clients/storage/jobs/types';\n\n/**\n * One service's statuses split by what the job is doing.\n *\n * - Groups are disjoint and cover the vocabulary; terminal = successful + failed.\n * - The annotation makes a renamed generated status fail the build here.\n */\ntype StatusGroups<Status extends string> = {\n running: readonly Status[];\n successful: readonly Status[];\n failed: readonly Status[];\n};\n\n/** A service's statuses as named constants — `SUCCESS: 'success'`. */\ntype StatusNames<Status extends string> = { [K in Status as Uppercase<K>]: K };\n\n// Mirrors `StorageJobStatus` in `connection`.\nconst STORAGE: StatusGroups<StorageJobStatus> = {\n running: ['waiting', 'processing'],\n successful: ['success'],\n failed: ['error'],\n};\n\n/**\n * Mirrors `PlainJobInterface` in `job-queue-internal-api-php-client`.\n *\n * - `terminating` is running until `terminated`.\n * - The split mirrors the job's `isSuccess`; with a job in hand, read `job.isSuccess` instead.\n */\nconst QUEUE: StatusGroups<QueueJobStatus> = {\n running: ['created', 'waiting', 'processing', 'terminating'],\n successful: ['success', 'warning'],\n failed: ['error', 'cancelled', 'terminated'],\n};\n\n// Mirrors `JobState` in `go-monorepo` (`services/query/internal/repository/models`).\n// `canceled` with one `l`, unlike the other services.\nconst QUERY: StatusGroups<QueryJobStatus> = {\n running: ['created', 'enqueued', 'processing'],\n successful: ['completed'],\n failed: ['failed', 'canceled'],\n};\n\n/**\n * One service's status predicates, sets and named constants.\n *\n * - `isSuccessful` / `isFailed` are `false` while running.\n * - `isKnown` narrows an untyped string.\n * - `named` is asserted: `Object.fromEntries` can't prove the key mapping.\n */\nconst forService = <Status extends string>(groups: StatusGroups<Status>) => {\n const all = [...groups.running, ...groups.successful, ...groups.failed];\n\n const running: ReadonlySet<Status> = new Set(groups.running);\n const successful: ReadonlySet<Status> = new Set(groups.successful);\n const failed: ReadonlySet<Status> = new Set(groups.failed);\n const terminal: ReadonlySet<Status> = new Set([...groups.successful, ...groups.failed]);\n const known: ReadonlySet<string> = new Set<string>(all);\n\n return {\n isRunning: (status: Status) => running.has(status),\n isTerminal: (status: Status) => terminal.has(status),\n isSuccessful: (status: Status) => successful.has(status),\n isFailed: (status: Status) => failed.has(status),\n isKnown: (value: string): value is Status => known.has(value),\n describe: (status: Status) => ({\n isRunning: running.has(status),\n isTerminal: terminal.has(status),\n isSuccessful: successful.has(status),\n isFailed: failed.has(status),\n }),\n statuses: { running, successful, failed, terminal },\n named: Object.fromEntries(\n all.map((status) => [status.toUpperCase(), status]),\n ) as StatusNames<Status>,\n };\n};\n\n/**\n * Job statuses per service, e.g. `jobStatus.queue.isFailed(status)`.\n *\n * - Never merge services: labels overlap but their meaning differs.\n * - `query` covers the query job, not its statements (which have `notExecuted`).\n */\nexport const jobStatus = {\n storage: forService(STORAGE),\n queue: forService(QUEUE),\n query: forService(QUERY),\n};\n","import { isApiError } from '../fetchClient';\n\nconst MAX_CONSECUTIVE_FAILURES = 5;\n\n// A read that failed in transit, or that the service answered with a 5xx or 429. The job runs\n// server-side either way, so a later read can still see it finish.\nconst isTransient = (error: Error) =>\n error instanceof TypeError ||\n (isApiError(error) && (error.response.status >= 500 || error.response.status === 429));\n\n/** A job poll's retry rule: a transient read is retried up to five times in a row; one that succeeds resets the count. */\nexport const transientRetries = () => {\n let failures = 0;\n\n return {\n reset: () => {\n failures = 0;\n },\n isRetryable: (error: Error) => isTransient(error) && ++failures < MAX_CONSECUTIVE_FAILURES,\n };\n};\n"],"mappings":";;;;AAEA,MAAa,SAAS,SAAiB,WACrC,IAAI,SAAe,SAAS,WAAW;CACrC,IAAI,QAAQ,SAAS,OAAO,OAAOA,yBAAAA,iBAAiB,OAAO,MAAM,CAAC;CAElE,MAAM,gBAAgB;EACpB,aAAa,SAAS;EACtB,OAAOA,yBAAAA,iBAAiB,QAAQ,MAAM,CAAC;CACzC;CAKA,MAAM,YAAY,iBAAiB;EACjC,QAAQ,oBAAoB,SAAS,OAAO;EAC5C,QAAQ;CACV,GAAG,OAAO;CAEV,QAAQ,iBAAiB,SAAS,SAAS,EAAE,MAAM,KAAK,CAA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GACX,WAAW;EACb;EACA,cAAc,UAAiB,YAAY,KAAK,KAAK,EAAE,WAAW;CACpE;AACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as OpenapiFormDataType } from "./index-
|
|
1
|
+
import { a as OpenapiFormDataType } from "./index-9p4O-clX.cjs";
|
|
2
2
|
/**
|
|
3
3
|
* This file was auto-generated by openapi-typescript.
|
|
4
4
|
* Do not make direct changes to the file.
|
|
@@ -456,4 +456,4 @@ type WriteTableInput = Omit<WriteTableFormData, 'data'> & {
|
|
|
456
456
|
file: File;
|
|
457
457
|
};
|
|
458
458
|
export { WriteTableInput as n, UploadFileInput as t };
|
|
459
|
-
//# sourceMappingURL=types-
|
|
459
|
+
//# sourceMappingURL=types-B1kernzE.d.cts.map
|