@everfur/sdk 1.4.0 → 1.5.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/README.md +2 -2
- package/dist/{Chat.d-BXuEjJsg.d.ts → Chat.d-BCfyvzX8.d.ts} +1 -1
- package/dist/{Chat.d-D9n8tSDD.d.cts → Chat.d-Od44h51D.d.cts} +1 -1
- package/dist/{DepthViews.d-PmjccZLr.d.cts → DepthViews.d-BGspxovy.d.cts} +1 -1
- package/dist/{DepthViews.d-aOChkwU2.d.ts → DepthViews.d-BIHVrf9r.d.ts} +1 -1
- package/dist/{DepthViews.d-ktxIIsnb.d.cts → DepthViews.d-BaLh7Lsi.d.cts} +1 -1
- package/dist/{DepthViews.d-CpF_Y_z9.d.ts → DepthViews.d-CEVk9poG.d.ts} +1 -1
- package/dist/ErrorPolicyPort.d-BIdmYQnk.d.cts +43 -0
- package/dist/ErrorPolicyPort.d-BnI5qWg4.d.ts +43 -0
- package/dist/{RecordsPage.d-BfMSOsg_.d.ts → RecordsPage.d-D10RIgdc.d.ts} +1 -1
- package/dist/{RecordsPage.d-DWjFpZs1.d.cts → RecordsPage.d-DbhYNSbq.d.cts} +1 -1
- package/dist/animations/index.cjs +1 -1
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +1 -1
- package/dist/{attachments.d-DjWUR-h9.d.ts → attachments.d-BlukNfIf.d.ts} +2 -2
- package/dist/{attachments.d-Bsg6duaq.d.cts → attachments.d-CF4lLuGK.d.cts} +2 -2
- package/dist/{bookingCopy.d-ITpabqPr.d.ts → bookingCopy.d-BuDv16WP.d.ts} +12 -12
- package/dist/{bookingCopy.d-B39JAmIZ.d.cts → bookingCopy.d-rnBSqOSN.d.cts} +12 -12
- package/dist/{branding.d-Bzs4HJoN.d.cts → branding.d-CqDLKj1U.d.cts} +1 -1
- package/dist/{branding.d-CiC6xfGT.d.ts → branding.d-XrZYClN4.d.ts} +1 -1
- package/dist/{callCopy.d-Bw6oZT54.d.cts → callCopy.d-BQxpwXqT.d.cts} +3 -3
- package/dist/{callCopy.d-Bw6oZT54.d.ts → callCopy.d-BQxpwXqT.d.ts} +3 -3
- package/dist/{callRoom.d-B1DoYdJe.d.cts → callRoom.d-9Dm7XnUr.d.cts} +1 -1
- package/dist/{callRoom.d-Dqm1rUqT.d.ts → callRoom.d-t-khijDv.d.ts} +1 -1
- package/dist/{casesRepository.d-De4ZtgJ_.d.cts → casesRepository.d-CVuKTkJo.d.cts} +1 -1
- package/dist/{casesRepository.d-DsEeFd0F.d.ts → casesRepository.d-Dn1fK1b2.d.ts} +1 -1
- package/dist/chat/index.cjs +195 -195
- package/dist/chat/index.d.cts +14 -14
- package/dist/chat/index.d.ts +14 -14
- package/dist/chat/index.js +203 -203
- package/dist/chat/lite/index.cjs +206 -206
- package/dist/chat/lite/index.d.cts +14 -14
- package/dist/chat/lite/index.d.ts +14 -14
- package/dist/chat/lite/index.js +206 -206
- package/dist/{chatHandoffToken.d-sbumx0He.d.cts → chatHandoffToken.d-BjfmIxXk.d.cts} +7 -7
- package/dist/{chatHandoffToken.d-YJY6TZbj.d.ts → chatHandoffToken.d-CFiI6IMc.d.ts} +7 -7
- package/dist/{checkin.d-DxpoRutq.d.cts → checkin.d-BP3ZWBfX.d.cts} +19 -7
- package/dist/{checkin.d-C6vh9KVr.d.ts → checkin.d-CokpahFL.d.ts} +19 -7
- package/dist/{chunk-FZ6DAQFH.js → chunk-4KFFE42Z.js} +20 -20
- package/dist/{chunk-ZPIOCHKW.js → chunk-6IHY7HS7.js} +1 -1
- package/dist/{chunk-II4QDD6F.js → chunk-BMYNDBUR.js} +1 -1
- package/dist/{chunk-AJEELSFO.js → chunk-HHCGXQJR.js} +13 -13
- package/dist/client/index.cjs +31 -31
- package/dist/client/index.d.cts +24 -21
- package/dist/client/index.d.ts +24 -21
- package/dist/client/index.js +31 -31
- package/dist/{clinicBatch.d-B3YJc8IO.d.cts → clinicBatch.d-C0xx5L4j.d.cts} +3 -3
- package/dist/{clinicBatch.d-DhvQuPHV.d.ts → clinicBatch.d-DNi4UURs.d.ts} +3 -3
- package/dist/{config.d-DRoQ2lAx.d.ts → config.d-B7Z-KTGq.d.ts} +10 -2
- package/dist/{config.d-BiVy0fLx.d.cts → config.d-ClAI2RZ6.d.cts} +10 -2
- package/dist/consent/index.cjs +1 -1
- package/dist/consent/index.d.cts +6 -6
- package/dist/consent/index.d.ts +6 -6
- package/dist/consent/index.js +2 -2
- package/dist/{context.d-Cq2C4vdh.d.cts → context.d-Bj6-xYPA.d.cts} +13 -7
- package/dist/{context.d-D1l56nFr.d.ts → context.d-DS1GXUEY.d.ts} +13 -7
- package/dist/{copy.d-Ce_8KuZg.d.cts → copy.d--F5A9cXK.d.cts} +3 -3
- package/dist/{copy.d-BP36f_63.d.ts → copy.d-DmxuFJFe.d.ts} +3 -3
- package/dist/core/index.cjs +42 -41
- package/dist/core/index.d.cts +20 -20
- package/dist/core/index.d.ts +20 -20
- package/dist/core/index.js +42 -41
- package/dist/{depth.d-DzMMmRN4.d.ts → depth.d-CgzYE6_n.d.ts} +3 -3
- package/dist/{depth.d-BtlcIqPJ.d.cts → depth.d-DLaP0o8Y.d.cts} +3 -3
- package/dist/{entitlementRepository.d-x2YFdgYD.d.ts → entitlementRepository.d-CkUTlVAb.d.ts} +3 -3
- package/dist/{entitlementRepository.d-CEDU1gZE.d.cts → entitlementRepository.d-DVTp-BB9.d.cts} +3 -3
- package/dist/{focus.d-BX7oahFk.d.cts → focus.d-CLTjm6In.d.cts} +1 -1
- package/dist/{focus.d-armXecf0.d.ts → focus.d-u-HYvim0.d.ts} +1 -1
- package/dist/health-plan/index.cjs +1 -1
- package/dist/health-plan/index.d.cts +17 -17
- package/dist/health-plan/index.d.ts +17 -17
- package/dist/health-plan/index.js +1 -1
- package/dist/{healthPlanRepository.d-DBx7-NLE.d.cts → healthPlanRepository.d-B22kjrYa.d.cts} +3 -3
- package/dist/{healthPlanRepository.d-C7K9dJK5.d.ts → healthPlanRepository.d-CwRXeoM7.d.ts} +3 -3
- package/dist/{idempotency.d-Dak2-pON.d.cts → idempotency.d-CFVMhWcv.d.cts} +1 -1
- package/dist/{idempotency.d-symqJ8Tt.d.ts → idempotency.d-dOFfV91-.d.ts} +1 -1
- package/dist/{identity.d-DOKJFaiz.d.ts → identity.d-D4VtpqRr.d.ts} +1 -1
- package/dist/{identity.d-DIH9h3Le.d.cts → identity.d-DDpXOtas.d.cts} +1 -1
- package/dist/{inbox.d-AuGKeaZv.d.cts → inbox.d-CPcMMz-Y.d.cts} +2 -2
- package/dist/{inbox.d-B5b57OXc.d.ts → inbox.d-DJ9xgU1Z.d.ts} +2 -2
- package/dist/index.cjs +248 -247
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +22 -22
- package/dist/index.js +247 -246
- package/dist/{introEvents.d-ehik7PEn.d.cts → introEvents.d-B7acmGwf.d.cts} +1 -1
- package/dist/{introEvents.d-S4Q4BOSt.d.ts → introEvents.d-DW3gLljE.d.ts} +1 -1
- package/dist/{layout.d-Bm2_1wa4.d.ts → layout.d-C8y_ki1V.d.ts} +1 -1
- package/dist/{layout.d-CFF-nBXf.d.cts → layout.d-DfaFM_lp.d.cts} +1 -1
- package/dist/{models.d-DOwpK1ZF.d.ts → models.d-BKmOfoqV.d.cts} +2 -2
- package/dist/{models.d-Su_BBBTW.d.cts → models.d-BULqCO2R.d.ts} +2 -2
- package/dist/notifications/inbox/index.cjs +9 -9
- package/dist/notifications/inbox/index.d.cts +7 -7
- package/dist/notifications/inbox/index.d.ts +7 -7
- package/dist/notifications/inbox/index.js +9 -9
- package/dist/notifications/index.cjs +3 -3
- package/dist/notifications/index.d.cts +8 -8
- package/dist/notifications/index.d.ts +8 -8
- package/dist/notifications/index.js +6 -6
- package/dist/{optInView.d-DbGx1A9R.d.cts → optInView.d-ByDJMrMv.d.cts} +13 -13
- package/dist/{optInView.d-xnIxCLlH.d.ts → optInView.d-DVshLxbD.d.ts} +13 -13
- package/dist/{parse.d-DtHmpAMT.d.cts → parse.d-BDZ7ffgj.d.cts} +4 -1
- package/dist/{parse.d-DtHmpAMT.d.ts → parse.d-BDZ7ffgj.d.ts} +4 -1
- package/dist/{pets.d-BEqKykpu.d.ts → pets.d-BpLObpfM.d.ts} +1 -1
- package/dist/{pets.d-BS6sLxY-.d.cts → pets.d-DXhzTNuI.d.cts} +1 -1
- package/dist/{petsRepository.d-iHrHkXM2.d.ts → petsRepository.d-_QfM7F6T.d.ts} +1 -1
- package/dist/{petsRepository.d-DB5CNKsK.d.cts → petsRepository.d-ai_tZ3lu.d.cts} +1 -1
- package/dist/photo/index.cjs +1 -1
- package/dist/photo/index.js +23 -23
- package/dist/{presentation.d-CWGjwq8Z.d.cts → presentation.d-BkIvMtIl.d.cts} +3 -3
- package/dist/{presentation.d-CWGjwq8Z.d.ts → presentation.d-BkIvMtIl.d.ts} +3 -3
- package/dist/records/depth/index.cjs +1 -1
- package/dist/records/depth/index.d.cts +10 -10
- package/dist/records/depth/index.d.ts +10 -10
- package/dist/records/depth/index.js +1 -1
- package/dist/records/index.cjs +2 -2
- package/dist/records/index.d.cts +13 -13
- package/dist/records/index.d.ts +13 -13
- package/dist/records/index.js +71 -71
- package/dist/{requestFunnel.d-SySe6xHp.d.cts → requestFunnel.d-BwZDfWVD.d.cts} +3 -3
- package/dist/{requestFunnel.d-CehftayS.d.ts → requestFunnel.d-DKBPTpsy.d.ts} +3 -3
- package/dist/{route.d-9wclfD-y.d.cts → route.d-DCzQh4ix.d.cts} +3 -3
- package/dist/{route.d-IP_gkOWL.d.ts → route.d-DSYEd2MR.d.ts} +3 -3
- package/dist/{runtimeTypes.d-BdUe3tYs.d.ts → runtimeTypes.d-BzUig75K.d.ts} +15 -11
- package/dist/{runtimeTypes.d-_UZ6rMUY.d.cts → runtimeTypes.d-CL4l7ta4.d.cts} +15 -11
- package/dist/{screenProps.d-Bd2yphad.d.cts → screenProps.d-6xmE1C-V.d.cts} +2 -2
- package/dist/{screenProps.d-D9Vi-Afl.d.ts → screenProps.d-fHBKArt_.d.ts} +2 -2
- package/dist/{sdkConfigStore.d-VPvsIL8E.d.ts → sdkConfigStore.d-BNCVVEWC.d.ts} +1 -1
- package/dist/{sdkConfigStore.d-BHrzkVpP.d.cts → sdkConfigStore.d-C2BAr9kI.d.cts} +1 -1
- package/dist/server/events/index.cjs +4 -4
- package/dist/server/events/index.d.cts +2 -2
- package/dist/server/events/index.d.ts +2 -2
- package/dist/server/events/index.js +4 -4
- package/dist/server/index.cjs +9 -9
- package/dist/server/index.d.cts +18 -4
- package/dist/server/index.d.ts +18 -4
- package/dist/server/index.js +9 -9
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/slots/index.cjs +1 -1
- package/dist/slots/index.d.cts +6 -6
- package/dist/slots/index.d.ts +6 -6
- package/dist/slots/index.js +1 -1
- package/dist/tabs/index.cjs +88 -85
- package/dist/tabs/index.d.cts +15 -15
- package/dist/tabs/index.d.ts +15 -15
- package/dist/tabs/index.js +87 -84
- package/dist/televet/booking/index.cjs +41 -41
- package/dist/televet/booking/index.d.cts +8 -8
- package/dist/televet/booking/index.d.ts +8 -8
- package/dist/televet/booking/index.js +4 -4
- package/dist/televet/call/index.d.cts +2 -2
- package/dist/televet/call/index.d.ts +2 -2
- package/dist/televet/index.cjs +1 -1
- package/dist/televet/index.js +1 -1
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/testing/rn/index.cjs +8 -8
- package/dist/testing/rn/index.d.cts +13 -13
- package/dist/testing/rn/index.d.ts +13 -13
- package/dist/testing/rn/index.js +9 -9
- package/dist/testing/web/index.cjs +3 -3
- package/dist/testing/web/index.d.cts +13 -13
- package/dist/testing/web/index.d.ts +13 -13
- package/dist/testing/web/index.js +1 -1
- package/dist/texting/index.cjs +1 -1
- package/dist/texting/index.d.cts +6 -6
- package/dist/texting/index.d.ts +6 -6
- package/dist/texting/index.js +26 -26
- package/dist/{threadOptions.d-bEAFkIsC.d.cts → threadOptions.d-Bqy5d5Fx.d.cts} +1 -1
- package/dist/{threadOptions.d-U5YBUKM-.d.ts → threadOptions.d-DOEIpk1t.d.ts} +1 -1
- package/dist/{threadOptions.d-BW0rePcs.d.cts → threadOptions.d-Dc57dm7h.d.cts} +7 -7
- package/dist/{threadOptions.d-CrAb71J2.d.ts → threadOptions.d-NSlFx-Lp.d.ts} +7 -7
- package/dist/{timelineRows.d-DXppCSCg.d.cts → timelineRows.d-7w8NsNi4.d.cts} +1 -1
- package/dist/{timelineRows.d-9Uhf4q5d.d.ts → timelineRows.d-CthNM5hV.d.ts} +1 -1
- package/dist/{typeStyle.d-rzVzCfLz.d.ts → typeStyle.d-8mcLhtbH.d.ts} +1 -1
- package/dist/{typeStyle.d-B-YgiWcS.d.cts → typeStyle.d-CLrQZW-r.d.cts} +1 -1
- package/dist/{unreadStore.d-gCsleb6l.d.ts → unreadStore.d-CLnChKca.d.ts} +17 -9
- package/dist/{unreadStore.d-w5x6lEpR.d.cts → unreadStore.d-Donv4bcF.d.cts} +17 -9
- package/dist/{useHealthPlanSubscription.d-CRBPMlsc.d.ts → useHealthPlanSubscription.d-CV7M21HS.d.ts} +3 -3
- package/dist/{useHealthPlanSubscription.d-DfjTYv1u.d.cts → useHealthPlanSubscription.d-SA9-SuKe.d.cts} +3 -3
- package/dist/{useInboxUnread.d-CP3KwSkn.d.ts → useInboxUnread.d-CXiaR3BZ.d.ts} +1 -1
- package/dist/{useInboxUnread.d-DiE_NbtS.d.cts → useInboxUnread.d-DERpMelw.d.cts} +1 -1
- package/dist/{usePresentation.d-DefUwatV.d.cts → usePresentation.d-BJzFicRQ.d.cts} +3 -3
- package/dist/{usePresentation.d-w5_oWKmh.d.ts → usePresentation.d-DgSGIWS-.d.ts} +3 -3
- package/dist/{useRecordsDepth.d-l6D0ZS4l.d.cts → useRecordsDepth.d-C9W45gwS.d.cts} +1 -1
- package/dist/{useRecordsDepth.d-DG2GiAyt.d.ts → useRecordsDepth.d-ZX2rhcUx.d.ts} +1 -1
- package/dist/{useUnread.d-xDOpYyqx.d.ts → useUnread.d-CedFK4k6.d.ts} +5 -5
- package/dist/{useUnread.d-DeRDFtTb.d.cts → useUnread.d-DST1GMmL.d.cts} +5 -5
- package/dist/video/index.cjs +1 -1
- package/dist/video/index.js +1 -1
- package/dist/{view.d-ufGX_MKK.d.cts → view.d-3lxzyJlL.d.cts} +6 -6
- package/dist/{view.d-iTInze7B.d.ts → view.d-DRiYNQJ8.d.ts} +6 -6
- package/dist/web/consent/index.cjs +3 -3
- package/dist/web/consent/index.d.cts +6 -6
- package/dist/web/consent/index.d.ts +6 -6
- package/dist/web/consent/index.js +5 -5
- package/dist/web/health-plan/index.cjs +2 -2
- package/dist/web/health-plan/index.d.cts +17 -17
- package/dist/web/health-plan/index.d.ts +17 -17
- package/dist/web/health-plan/index.js +1 -1
- package/dist/web/inbox/index.cjs +5 -5
- package/dist/web/inbox/index.d.cts +9 -8
- package/dist/web/inbox/index.d.ts +9 -8
- package/dist/web/inbox/index.js +5 -5
- package/dist/web/index.cjs +196 -195
- package/dist/web/index.d.cts +34 -34
- package/dist/web/index.d.ts +34 -34
- package/dist/web/index.js +196 -195
- package/dist/web/intro/index.cjs +10 -10
- package/dist/web/intro/index.d.cts +8 -8
- package/dist/web/intro/index.d.ts +8 -8
- package/dist/web/intro/index.js +6 -6
- package/dist/web/notifications/index.cjs +5 -5
- package/dist/web/notifications/index.d.cts +7 -7
- package/dist/web/notifications/index.d.ts +7 -7
- package/dist/web/notifications/index.js +1 -1
- package/dist/web/records/depth/index.cjs +1 -1
- package/dist/web/records/depth/index.d.cts +10 -10
- package/dist/web/records/depth/index.d.ts +10 -10
- package/dist/web/records/depth/index.js +1 -1
- package/dist/web/records/index.cjs +1 -1
- package/dist/web/records/index.d.cts +13 -13
- package/dist/web/records/index.d.ts +13 -13
- package/dist/web/records/index.js +1 -1
- package/dist/web/records-sheet/index.cjs +2 -2
- package/dist/web/records-sheet/index.js +2 -2
- package/dist/web/shop/index.cjs +1 -1
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/shop/index.js +15 -15
- package/dist/web/televet/booking/index.cjs +7 -7
- package/dist/web/televet/booking/index.d.cts +9 -9
- package/dist/web/televet/booking/index.d.ts +9 -9
- package/dist/web/televet/booking/index.js +69 -69
- package/dist/web/televet/call/index.cjs +1 -1
- package/dist/web/televet/call/index.d.cts +2 -2
- package/dist/web/televet/call/index.d.ts +2 -2
- package/dist/web/televet/call/index.js +1 -1
- package/dist/web/televet/index.cjs +6 -6
- package/dist/web/televet/index.js +1 -1
- package/dist/web/texting/index.cjs +1 -1
- package/dist/web/texting/index.d.cts +6 -6
- package/dist/web/texting/index.d.ts +6 -6
- package/dist/web/texting/index.js +1 -1
- package/dist/web/ui/index.cjs +1 -1
- package/dist/web/ui/index.js +32 -32
- package/package.json +1 -32
- package/dist/ErrorPolicyPort.d-68yrE3BE.d.ts +0 -23
- package/dist/ErrorPolicyPort.d-DirW9hgO.d.cts +0 -23
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { b as EverfurErrorCode } from './EverfurError.d-8NHtlgzA.cjs';
|
|
3
|
-
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-
|
|
3
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-BIdmYQnk.cjs';
|
|
4
4
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
5
|
-
import { d as EverfurRequest, F as Frame } from './config.d-
|
|
6
|
-
import { A as AuthContext } from './identity.d-
|
|
5
|
+
import { d as EverfurRequest, F as Frame } from './config.d-ClAI2RZ6.cjs';
|
|
6
|
+
import { A as AuthContext } from './identity.d-DDpXOtas.cjs';
|
|
7
7
|
|
|
8
8
|
/** Why the funnel stopped, or kept going. Every settle and every retry names one. */
|
|
9
9
|
type FunnelRetryReason = 'ok' | 'aborted' | 'terminal-code' | 'attempts-exhausted' | 'daily-quota-exhausted' | 'burst-throttle' | 'retryable-code' | 'server-reset-beyond-budget';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { b as EverfurErrorCode } from './EverfurError.d-8NHtlgzA.js';
|
|
3
|
-
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-
|
|
3
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-BnI5qWg4.js';
|
|
4
4
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
5
|
-
import { d as EverfurRequest, F as Frame } from './config.d-
|
|
6
|
-
import { A as AuthContext } from './identity.d-
|
|
5
|
+
import { d as EverfurRequest, F as Frame } from './config.d-B7Z-KTGq.js';
|
|
6
|
+
import { A as AuthContext } from './identity.d-D4VtpqRr.js';
|
|
7
7
|
|
|
8
8
|
/** Why the funnel stopped, or kept going. Every settle and every retry names one. */
|
|
9
9
|
type FunnelRetryReason = 'ok' | 'aborted' | 'terminal-code' | 'attempts-exhausted' | 'daily-quota-exhausted' | 'burst-throttle' | 'retryable-code' | 'server-reset-beyond-budget';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
3
3
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
4
|
-
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-
|
|
5
|
-
import { A as AuthContext } from './identity.d-
|
|
4
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-BIdmYQnk.cjs';
|
|
5
|
+
import { A as AuthContext } from './identity.d-DDpXOtas.cjs';
|
|
6
6
|
import { U as UserRef, P as PetRef, R as RecordsRequestId } from './ids.d-B2GAAifq.cjs';
|
|
7
|
-
import { a as ChatCheckinTarget } from './checkin.d-
|
|
7
|
+
import { a as ChatCheckinTarget } from './checkin.d-BP3ZWBfX.cjs';
|
|
8
8
|
import { V as VetVisitIntent } from './visitIntent.d-CY7mrflo.cjs';
|
|
9
9
|
import { d as EverfurNotification, g as EverfurNotificationTarget } from './parse.d-cH7ZmMeo.cjs';
|
|
10
10
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
|
|
3
3
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
4
|
-
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-
|
|
5
|
-
import { A as AuthContext } from './identity.d-
|
|
4
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-BnI5qWg4.js';
|
|
5
|
+
import { A as AuthContext } from './identity.d-D4VtpqRr.js';
|
|
6
6
|
import { U as UserRef, P as PetRef, R as RecordsRequestId } from './ids.d-B2GAAifq.js';
|
|
7
|
-
import { a as ChatCheckinTarget } from './checkin.d-
|
|
7
|
+
import { a as ChatCheckinTarget } from './checkin.d-CokpahFL.js';
|
|
8
8
|
import { V as VetVisitIntent } from './visitIntent.d-CY7mrflo.js';
|
|
9
9
|
import { d as EverfurNotification, g as EverfurNotificationTarget } from './parse.d-Cj3fURer.js';
|
|
10
10
|
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { E as EntitlementDecision, C as CapabilityName } from './resolve.d-BTC3b6FW.js';
|
|
3
|
-
import { P as PetProfileInput, R as RegisteredPet, a as PetProfilePatch } from './petsRepository.d-
|
|
3
|
+
import { P as PetProfileInput, R as RegisteredPet, a as PetProfilePatch } from './petsRepository.d-_QfM7F6T.js';
|
|
4
4
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
5
|
-
import { C as ClientBranding, E as EverfurThemeInput } from './branding.d-
|
|
6
|
-
import {
|
|
5
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding.d-XrZYClN4.js';
|
|
6
|
+
import { a as EverfurErrorContext, E as ErrorPolicyPort } from './ErrorPolicyPort.d-BnI5qWg4.js';
|
|
7
|
+
import { A as AuthContext, T as TokenProvider } from './identity.d-D4VtpqRr.js';
|
|
7
8
|
import { U as UserRef, P as PetRef, C as ConversationId } from './ids.d-B2GAAifq.js';
|
|
8
|
-
import { T as TransportPort } from './config.d-
|
|
9
|
+
import { T as TransportPort } from './config.d-B7Z-KTGq.js';
|
|
9
10
|
import { K as KvPort, I as ImageCachePort } from './cacheEpoch.d-DknKn3S0.js';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { U as UploadPort, a as UnreadStore } from './unreadStore.d-gCsleb6l.js';
|
|
11
|
+
import { o as ChatController } from './checkin.d-CokpahFL.js';
|
|
12
|
+
import { U as UploadPort, a as UnreadStore } from './unreadStore.d-CLnChKca.js';
|
|
13
13
|
import { C as CameraPort } from './CameraPort.d-Cv31Pz7g.js';
|
|
14
|
-
import { R as RequestFunnel } from './requestFunnel.d-
|
|
15
|
-
import { S as SdkConfigStore } from './sdkConfigStore.d-
|
|
14
|
+
import { R as RequestFunnel } from './requestFunnel.d-DKBPTpsy.js';
|
|
15
|
+
import { S as SdkConfigStore } from './sdkConfigStore.d-BNCVVEWC.js';
|
|
16
16
|
import { T as TelemetryPort } from './TelemetryPort.d-BDNr00hu.js';
|
|
17
17
|
import { U as UploadTransport } from './ports.d-BX4f4UsB.js';
|
|
18
18
|
|
|
@@ -63,6 +63,8 @@ type EverfurClientEvent = {
|
|
|
63
63
|
readonly type: 'error';
|
|
64
64
|
readonly code: string;
|
|
65
65
|
readonly requestId: string | null;
|
|
66
|
+
/** SDK version, platform, surface, publishable key, app version and request id, for your error reporter. */
|
|
67
|
+
readonly context?: EverfurErrorContext;
|
|
66
68
|
} | {
|
|
67
69
|
readonly type: 'session_expired';
|
|
68
70
|
readonly userRef: string | null;
|
|
@@ -73,9 +75,9 @@ type EverfurClientEvent = {
|
|
|
73
75
|
readonly type: 'unread_changed';
|
|
74
76
|
/** The pet whose chat list was read; null for the member's list across pets. */
|
|
75
77
|
readonly petRef: string | null;
|
|
76
|
-
/** The
|
|
78
|
+
/** The thread to open: the newest one with unread messages, else the newest; null when the member has none. */
|
|
77
79
|
readonly conversationId: string | null;
|
|
78
|
-
/** Unread messages
|
|
80
|
+
/** Unread messages across the pet's newest threads (up to 20), as the server counted them. */
|
|
79
81
|
readonly unreadCount: number;
|
|
80
82
|
readonly hasUnread: boolean;
|
|
81
83
|
} | {
|
|
@@ -164,6 +166,8 @@ interface EverfurRuntimeConfig {
|
|
|
164
166
|
readonly imageCache?: ImageCachePort;
|
|
165
167
|
/** Structured, redacted LogPort events when true. */
|
|
166
168
|
readonly debug?: boolean;
|
|
169
|
+
/** The host app's version; sent as `X-Everfur-App-Version` on React Native and carried on every error context. */
|
|
170
|
+
readonly appVersion?: string;
|
|
167
171
|
/**
|
|
168
172
|
* Lifecycle events (`ready`, `error`, `session_expired`, `conversation_started`, `unread_changed`; see `EverfurClientEvent`).
|
|
169
173
|
* `unread_changed` arrives only while `useEverfurUnread` is mounted.
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { E as EntitlementDecision, C as CapabilityName } from './resolve.d-BTC3b6FW.cjs';
|
|
3
|
-
import { P as PetProfileInput, R as RegisteredPet, a as PetProfilePatch } from './petsRepository.d-
|
|
3
|
+
import { P as PetProfileInput, R as RegisteredPet, a as PetProfilePatch } from './petsRepository.d-ai_tZ3lu.cjs';
|
|
4
4
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
5
|
-
import { C as ClientBranding, E as EverfurThemeInput } from './branding.d-
|
|
6
|
-
import {
|
|
5
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding.d-CqDLKj1U.cjs';
|
|
6
|
+
import { a as EverfurErrorContext, E as ErrorPolicyPort } from './ErrorPolicyPort.d-BIdmYQnk.cjs';
|
|
7
|
+
import { A as AuthContext, T as TokenProvider } from './identity.d-DDpXOtas.cjs';
|
|
7
8
|
import { U as UserRef, P as PetRef, C as ConversationId } from './ids.d-B2GAAifq.cjs';
|
|
8
|
-
import { T as TransportPort } from './config.d-
|
|
9
|
+
import { T as TransportPort } from './config.d-ClAI2RZ6.cjs';
|
|
9
10
|
import { K as KvPort, I as ImageCachePort } from './cacheEpoch.d-DknKn3S0.cjs';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { U as UploadPort, a as UnreadStore } from './unreadStore.d-w5x6lEpR.cjs';
|
|
11
|
+
import { o as ChatController } from './checkin.d-BP3ZWBfX.cjs';
|
|
12
|
+
import { U as UploadPort, a as UnreadStore } from './unreadStore.d-Donv4bcF.cjs';
|
|
13
13
|
import { C as CameraPort } from './CameraPort.d-Cv31Pz7g.cjs';
|
|
14
|
-
import { R as RequestFunnel } from './requestFunnel.d-
|
|
15
|
-
import { S as SdkConfigStore } from './sdkConfigStore.d-
|
|
14
|
+
import { R as RequestFunnel } from './requestFunnel.d-BwZDfWVD.cjs';
|
|
15
|
+
import { S as SdkConfigStore } from './sdkConfigStore.d-C2BAr9kI.cjs';
|
|
16
16
|
import { T as TelemetryPort } from './TelemetryPort.d-BDNr00hu.cjs';
|
|
17
17
|
import { U as UploadTransport } from './ports.d-BX4f4UsB.cjs';
|
|
18
18
|
|
|
@@ -63,6 +63,8 @@ type EverfurClientEvent = {
|
|
|
63
63
|
readonly type: 'error';
|
|
64
64
|
readonly code: string;
|
|
65
65
|
readonly requestId: string | null;
|
|
66
|
+
/** SDK version, platform, surface, publishable key, app version and request id, for your error reporter. */
|
|
67
|
+
readonly context?: EverfurErrorContext;
|
|
66
68
|
} | {
|
|
67
69
|
readonly type: 'session_expired';
|
|
68
70
|
readonly userRef: string | null;
|
|
@@ -73,9 +75,9 @@ type EverfurClientEvent = {
|
|
|
73
75
|
readonly type: 'unread_changed';
|
|
74
76
|
/** The pet whose chat list was read; null for the member's list across pets. */
|
|
75
77
|
readonly petRef: string | null;
|
|
76
|
-
/** The
|
|
78
|
+
/** The thread to open: the newest one with unread messages, else the newest; null when the member has none. */
|
|
77
79
|
readonly conversationId: string | null;
|
|
78
|
-
/** Unread messages
|
|
80
|
+
/** Unread messages across the pet's newest threads (up to 20), as the server counted them. */
|
|
79
81
|
readonly unreadCount: number;
|
|
80
82
|
readonly hasUnread: boolean;
|
|
81
83
|
} | {
|
|
@@ -164,6 +166,8 @@ interface EverfurRuntimeConfig {
|
|
|
164
166
|
readonly imageCache?: ImageCachePort;
|
|
165
167
|
/** Structured, redacted LogPort events when true. */
|
|
166
168
|
readonly debug?: boolean;
|
|
169
|
+
/** The host app's version; sent as `X-Everfur-App-Version` on React Native and carried on every error context. */
|
|
170
|
+
readonly appVersion?: string;
|
|
167
171
|
/**
|
|
168
172
|
* Lifecycle events (`ready`, `error`, `session_expired`, `conversation_started`, `unread_changed`; see `EverfurClientEvent`).
|
|
169
173
|
* `unread_changed` arrives only while `useEverfurUnread` is mounted.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { P as PetRef, R as RecordsRequestId } from './ids.d-B2GAAifq.cjs';
|
|
3
|
-
import { R as RecordsClinicBatch, a as RecordsClinicBatchClient } from './clinicBatch.d-
|
|
3
|
+
import { R as RecordsClinicBatch, a as RecordsClinicBatchClient } from './clinicBatch.d-C0xx5L4j.cjs';
|
|
4
4
|
import { C as CaptureRecordsSignature, R as RecordsClinicController } from './clinicRequestProps.d-DOYyRjr8.cjs';
|
|
5
5
|
import { R as RecordsClinic, c as RecordsClinicSearchInput } from './clinicModels.d-BXgKZqDb.cjs';
|
|
6
6
|
import { a as RecordsAskHandler } from './recordsAsk.d-C5CGSi3j.cjs';
|
|
@@ -73,7 +73,7 @@ type RecordsScreen = {
|
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Every upload and clinic request for the pet, each with its own status: the consumer's
|
|
76
|
-
* `RecordsRequestListScreen` (
|
|
76
|
+
* `RecordsRequestListScreen` (the consumer mobile app src/features/records/ui/RecordsRequestListScreen.tsx, the
|
|
77
77
|
* `/records/requests` route the dashboard's `RecordsRequestsStatusCard` opens). On the web it is the
|
|
78
78
|
* records page's own request list.
|
|
79
79
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
import { P as PetRef, R as RecordsRequestId } from './ids.d-B2GAAifq.js';
|
|
3
|
-
import { R as RecordsClinicBatch, a as RecordsClinicBatchClient } from './clinicBatch.d-
|
|
3
|
+
import { R as RecordsClinicBatch, a as RecordsClinicBatchClient } from './clinicBatch.d-DNi4UURs.js';
|
|
4
4
|
import { C as CaptureRecordsSignature, R as RecordsClinicController } from './clinicRequestProps.d-hJZBLkg7.js';
|
|
5
5
|
import { R as RecordsClinic, c as RecordsClinicSearchInput } from './clinicModels.d-CaS64-P-.js';
|
|
6
6
|
import { a as RecordsAskHandler } from './recordsAsk.d-C5CGSi3j.js';
|
|
@@ -73,7 +73,7 @@ type RecordsScreen = {
|
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
75
|
* Every upload and clinic request for the pet, each with its own status: the consumer's
|
|
76
|
-
* `RecordsRequestListScreen` (
|
|
76
|
+
* `RecordsRequestListScreen` (the consumer mobile app src/features/records/ui/RecordsRequestListScreen.tsx, the
|
|
77
77
|
* `/records/requests` route the dashboard's `RecordsRequestsStatusCard` opens). On the web it is the
|
|
78
78
|
* records page's own request list.
|
|
79
79
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { S as SdkConfigV3 } from './parse.d-
|
|
2
|
+
import { S as SdkConfigV3 } from './parse.d-BDZ7ffgj.js';
|
|
3
3
|
|
|
4
4
|
/** Where the config stands. `idle`: nothing asked yet. */
|
|
5
5
|
type SdkConfigStatus = 'idle' | 'loading' | 'ready' | 'legacy' | 'failed';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { S as SdkConfigV3 } from './parse.d-
|
|
2
|
+
import { S as SdkConfigV3 } from './parse.d-BDZ7ffgj.cjs';
|
|
3
3
|
|
|
4
4
|
/** Where the config stands. `idle`: nothing asked yet. */
|
|
5
5
|
type SdkConfigStatus = 'idle' | 'loading' | 'ready' | 'legacy' | 'failed';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
2
|
"use strict";var e=require("crypto");function ok(e,t){/* @__PURE__ */
|
|
3
3
|
return Object.freeze({ok:true,value:e})}function err(e){/* @__PURE__ */
|
|
4
|
-
return Object.freeze({ok:false,error:e})}var t=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var n="Everfur-Signature",a=300,i="v1",o=4096,l=64,s=/^[0-9]+$/,d=class _EverfurWebhookVerificationError extends Error{constructor(e){super(`Everfur webhook verification failed: ${e}`),this.name="EverfurWebhookVerificationError",this.code=e,Object.setPrototypeOf(this,_EverfurWebhookVerificationError.prototype)}};function constructEvent(r,n,i,o={}){let s=p(r),v=c(i),h=o.toleranceSeconds??a;if(!Number.isInteger(h)||h<0)throw new t("invalid-argument","toleranceSeconds must be a non-negative integer");let m=
|
|
5
|
-
return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:e,message:t})})}function tryResolveApiBaseUrl(e){let t=e?.trim(),r=t&&t.length>0?t:R(
|
|
6
|
-
return Object.freeze({ok:true,value:o})}function k(e){let t=e.toLowerCase();return t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t==="::1"}function R(e){let t=globalThis.process?.env?.[e];return typeof t=="string"&&t.trim().length>0?t.trim():void 0}var D="DAILY_QUOTA_EXCEEDED",N=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function O(e,t){if(!N.has(e.toUpperCase().replace(/[^A-Z0-9]/g,"")))return e;let r=t,n=r?.daily_limit??r?.error?.daily_limit;return typeof n=="number"&&Number.isFinite(n)?D:e}var F=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],I=/* @__PURE__ */Object.freeze(F.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(I.map(e=>e.wireCode));var A=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound"}),j=/* @__PURE__ */Object.freeze(I.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:A[e.wireCode]}))),x=new Map(j.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),U=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(j.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...U]){let t=x.get(e+r);if(t)return t}}var q=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(e){return q[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}var L=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return L.has(e)}var $=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||$.has(e)}var P="This feature isn't available on your account right now.",M="Something in that request was not right. Check the details and try again.",V=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:P,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:M,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:P,runtimeDisposed:M,unknown:"Something went wrong. Please try again."}),Y="This session has ended. Please sign in again.",z="linked_account_read_only";function B(e,t,r){return e==="conflict"&&r===z?P:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?Y:userFacingError(e)}function userFacingError(e){return V[e]}function K(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var W=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===z,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:B(e,t?.wireCode,n?z:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&W.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let i=t?.retryAfterSeconds;if(typeof i=="number"&&Number.isFinite(i)&&i>=0&&(a.retryAfterSeconds=Math.round(i)),r);return t?.wireMessage&&K(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&K(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}var H="free_cap_reached";function G(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}function Q(e){if(typeof e!="object"||e===null)return null;let t=e,r=t.detail,n=typeof r=="object"&&r!==null?r:t;if(n.error!==H&&n.code!==H)return null;let a=G(n.limit),i=G(n.used);if(a===null||i===null)return null;let o=n.resets_at,l=n.emergency_guidance;/* @__PURE__ */
|
|
7
|
-
return Object.freeze({limit:a,used:i,resetsAt:typeof o=="string"&&o.length>0?o:null,...typeof l=="string"&&l.trim().length>0?{emergencyGuidance:l}:{}})}function Z(e,t){if(e.status!==429&&e.status!==503)return t;let r=J(e.headers.get(X),Date.now());if(r===null)return t;let n=t!==null&&typeof t=="object"&&!Array.isArray(t)?t:null;return n!==null&&ee(n)?t:{...n??{},retry_after_seconds:r}}var X="retry-after";function J(e,t){if(e===null)return null;let r=e.trim();if(/^\d+$/.test(r))return Number(r);let n=Date.parse(r);return Number.isFinite(n)?Math.max(0,Math.ceil((n-t)/1e3)):null}function ee(e){return[e,e.error,e.detail].some(e=>e!==null&&typeof e=="object"&&("retry_after_seconds"in e||"resets_at"in e))}var te="x-request-id";function errorFromResponse(e,t,r){let n=ae(t),a=n?fromWire(n):fromHttpStatus(e),i=ie(t);return makeEverfurError(a,{httpStatus:e,...oe(t)?{retryable:true}:{},...r?{requestId:r}:{},...n?{wireCode:n}:{},...ne(t)?{reasonCode:ne(t)}:{},...re(t)!==null?{retryAfterSeconds:re(t)}:{},...i?{wireMessage:i}:{},...t!=null?{raw:t}:{}})}function re(e){let t=e,r=t?.retry_after_seconds??t?.error?.retry_after_seconds;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:le(e)})}function requestIdOf(e){let t=e.headers.get(te);return typeof t=="string"&&t.length>0?t:null}function getGlobalFetch(){let e=globalThis.fetch;if(typeof e!="function")throw new t("missing-peer-dependency","global fetch is unavailable; provide config.transport or an injected fetch implementation");return e}function ne(e){let t=e,r=t?.error?.reason_code??t?.reason_code;return typeof r=="string"&&r.length>0?r:null}function ae(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?O(r,e):Q(e)!==null?H:null}function ie(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}function oe(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}function le(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var se=/* @__PURE__ */Object.freeze(["member.linked","member.unlinked","visit.booked","visit.cancelled","visit.completed","visit.no_show","record_request.updated","record.ready","webhook_endpoint.test","chat.follow_up_due","chat.urgency.flagged","pet.vaccination.due","visit.rescheduled","visit.reminder","visit.followup_sent","chat.reminder_due","record.activation","visit.message_received","visit.ended","contact.exported","health_plan.box_due","health_plan.one_box_ordered","claim.evidence_returned","claim.evidence_updated","claim.records_requested","claim.failed","claim.duplicate","claim.decided","claim.inbound_refused","insured_pet.profile.ready","insured_pet.profile.updated","chat.engagement_message","visit.notes_ready","visit.vet_joined","visit.summary_sent","chat.answer_ready","chat.follow_up_day5_due","care.medication_check_due","care.dose_due","care.refill_due","care.prevention_due","care.meal_due","care.nose_to_tail_due","care.reminder_due","record.labs_ready","record.update_available","order.updated","order.prescription_updated","walk.reminder","walk.reminder_offer","weather.heat","weather.storm","weather.air_quality","weather.ice","weather.pollen","safety.danger_day","safety.food_recall","insight.week","insight.birthday","tip.weekly","tip.daily","insight.weight_trend","tip.question_guide","insight.monthly_notes","pet.adoption_day","insight.year_summary","pack.walk_logged","pack.question","pack.reactions","pack.care_handoff","pack.photo_ready","mood.check_in_due","streak.at_risk","streak.milestone","membership.first_visit","membership.renewal","membership.invite","support.replied"]),de=/* @__PURE__ */Object.freeze(["member.linked","member.unlinked","chat.urgency.flagged","webhook_endpoint.test","contact.exported","health_plan.box_due","health_plan.one_box_ordered","claim.evidence_returned","claim.evidence_updated","claim.records_requested","claim.failed","claim.duplicate","claim.decided","claim.inbound_refused","insured_pet.profile.ready","insured_pet.profile.updated"]);function isEverfurWebhookEventType(e){return typeof e=="string"&&se.includes(e)}function isEverfurWebhookEvent(e){return isEverfurWebhookEventType(e.type)}var ue=/* @__PURE__ */Object.freeze(["pet.profile.updated","pet.incident.reported","pet.behavior_note.added","pet.service_score.recorded","pet.deleted","member.status_changed","member.deleted"]);var pe=["sk_partner_","rk_partner_"];function ce(e,r){if(typeof e!="string"||e.length===0)throw new t("invalid-argument","partnerSecretKey is required");if(e.startsWith("pk_"))throw new t("invalid-argument",`partnerSecretKey is a publishable key (pk_...): ${r} needs your secret key, server side only`);if(!pe.some(t=>e.startsWith(t)))throw new t("invalid-argument","partnerSecretKey must be an sk_partner_ secret key or an rk_partner_ restricted key")}var fe=128;function assertValidUserRef(e){let r=typeof e=="string"?[...e].length:0;if(typeof e!="string"||r<1||r>fe)throw new t("invalid-argument",`user_ref must be 1..${fe} characters`);if(e.trim().length===0)throw new t("invalid-argument","user_ref must not be blank: the server strips surrounding whitespace before validating, so a whitespace-only value arrives empty and is rejected as required.");if(e!==e.trim())throw new t("invalid-argument","user_ref must not have leading or trailing whitespace: the server strips it, so padded and unpadded forms of the same id resolve to ONE user. Pass the exact id you want to key on.");if(e.includes("@"))throw new t("invalid-argument","user_ref must not contain '@'");if(!_e(e))throw new t("invalid-argument","user_ref must be printable (no control characters)");return e}function _e(e){return!ve.test(e)}var ve=/[\p{Cc}\p{Cf}\p{Cs}\p{Co}\p{Cn}\p{Zl}\p{Zp}]|(?!\u0020)[\p{Zs}]/u;function he(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return true;t+=1}else if(r>=56320&&r<=57343)return true}return false}function me(e){return[...e].length}var ye=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(ye,t)?ye[t]:null}var be=50,we=128,ge=120,Ee=120,Se=2e3,Ce=120,Te=80,ke=/* @__PURE__ */new Set(["male","female","unknown"]),Re=/* @__PURE__ */new Set(["day","month","year"]),De=/* @__PURE__ */new Set(["low","medium","high","athletic"]),Ne=/* @__PURE__ */new Set(["indoor","outdoor","both"]),Oe=/* @__PURE__ */new Set(["mild","moderate","severe"]),Fe=/^(\d{4})-(\d{2})-(\d{2})$/,Ie=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],Ae=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...Ie,...Ae].map(([e])=>e));function je(e){let t=Fe.exec(e);if(t===null)return false;let[r,n,a]=[Number(t[1]),Number(t[2]),Number(t[3])],i=new Date(Date.UTC(r,n-1,a));return i.getUTCFullYear()===r&&i.getUTCMonth()===n-1&&i.getUTCDate()===a}var xe=e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,Ue=(e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,qe=(e,t)=>typeof t=="string"&&je(t)?null:`${e} must be a real date written YYYY-MM-DD`,Le=(e,t={})=>(r,n)=>{if(typeof n!="string")return`${r} must be a string`;if(he(n))return`${r} contains an unpaired surrogate and cannot be encoded`;let a=t.trimmed?n.trim():n;if(t.required&&a.length===0)return`${r} is required and must not be blank`;let i=me(a);return i<=e?null:`${r} is ${i} characters; the server accepts at most ${e}`},$e={sex:xe(ke),spayedNeutered:Ue,birthDate:qe,birthDatePrecision:xe(Re),activityLevel:xe(De),indoorOutdoor:xe(Ne),foodBrand:Le(Ce),foodType:Le(Ce),microchipId:Le(Te)},Pe=["ref","ref",false,Le(we,{required:true,trimmed:true})],Me=["notes","notes",false,Le(Se,{trimmed:true})],Ve=[Pe,["name","name",true,Le(ge,{required:true,trimmed:true})],["dose","dose",false,Le(Ee,{trimmed:true})],["frequency","frequency",false,Le(Ee,{trimmed:true})],["startDate","start_date",false,qe],["endDate","end_date",false,qe],Me],Ye={allergies:[Pe,["allergen","allergen",true,Le(ge,{required:true,trimmed:true})],["severity","severity",false,xe(Oe)],Me],medications:Ve,supplements:Ve,conditions:[Pe,["conditionName","condition_name",true,Le(ge,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,qe],Me]};function ze(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return{error:`${n} must be an object`};let a=r,i={};for(let[t,r,o,l]of Ye[e]){let e=a[t];if(e==null){if(o)return{error:`${n}.${t} is required`};e===null&&(i[r]=null);continue}let s=l(`${n}.${t}`,e);if(s!==null)return{error:s};i[r]=e}let o=i.start_date,l=i.end_date;return typeof o=="string"&&typeof l=="string"&&l<o?{error:`${n}.endDate must not be before startDate`}:{item:i}}function Be(e,t){if(!Array.isArray(t))return{error:`${e} must be an array (send [] to clear it)`};if(t.length>be)return{error:`${e} has ${t.length} items; the server accepts at most ${be}`};let r=[],n=/* @__PURE__ */new Set;for(let a=0;a<t.length;a+=1){let i=ze(e,a,t[a]);if("error"in i)return i;let o=i.item.ref;if(typeof o=="string"){let t=o.trim();if(n.has(t))return{error:`${e}: ref ${JSON.stringify(t)} is used twice; a ref names one item`};n.add(t)}r.push(i.item)}return{items:r}}function Ke(e,t){let r=e,n={};for(let[e,t]of Ie){let a=r[e];if(a!==void 0){if(a!==null){let t=$e[e](e,a);if(t!==null)return{error:t}}n[t]=a}}let a=r.birthDate!==void 0,i=r.birthDatePrecision!==void 0;if(a!==i||a&&r.birthDate===null!=(r.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[e,t]of Ae){let a=r[e];if(a===void 0)continue;let i=Be(e,a);if("error"in i)return i;n[t]=i.items}return Object.keys(n).length>0&&t!==void 0&&canonicalPetSpecies(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}var We=[["name","name"],["species","species"],["breed","breed"],["ageYears","age_years"],["weightKg","weight_kg"],["partnerLabelInstructions","partner_label_instructions"]];function He(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new t("invalid-argument","the pet profile must be an object");let r={};for(let[t,n]of We)e[t]!==void 0&&(r[n]=e[t]);let n=Ke(e,e.species);if("error"in n)throw new t("invalid-argument",n.error);return Object.assign(r,n.body)}var Ge=/^[\x21-\x7e]{1,255}$/,Qe=32*1024,Ze=/^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:[Zz]|[+-]\d{2}:?\d{2})$/,Xe=3e4,Je=/* @__PURE__ */Object.freeze({"pet.profile.updated":{subject:"pet",schemaVersions:[1,2]},"pet.incident.reported":{subject:"pet",schemaVersions:[1]},"pet.behavior_note.added":{subject:"pet",schemaVersions:[1]},"pet.service_score.recorded":{subject:"pet",schemaVersions:[1]},"pet.deleted":{subject:"pet",schemaVersions:[1]},"member.status_changed":{subject:"member",schemaVersions:[1]},"member.deleted":{subject:"member",schemaVersions:[1]}});async function sendPartnerEvent(r,n,a){let i=a??e.randomUUID();if(typeof i!="string"||!Ge.test(i))throw new t("invalid-argument","idempotencyKey must be 1 to 255 visible ASCII characters (no spaces, no control or non-ASCII characters)");ce(r.partnerSecretKey,"sending events");let o=at(tt(n)),l=r.fetchImpl??getGlobalFetch(),s=`${resolveApiBaseUrl(r.apiBaseUrl)}/partners/events`,d={...buildBaseHeaders({sdkVersion:h,platform:m,contractVersion:r.contractVersion??y}),accept:"application/json","content-type":"application/json","idempotency-key":i,"x-everfur-partner-secret-key":r.partnerSecretKey},u=new AbortController,p=setTimeout(()=>u.abort(),Xe),c;try{c=await l(s,{method:"POST",headers:d,body:o,signal:u.signal})}catch(e){return err(networkError(e))}finally{clearTimeout(p)}let f=null;try{f=await c.json()}catch{f=null}let _=requestIdOf(c);if(!c.ok)return err(errorFromResponse(c.status,Z(c,f),_));let v=it(f,i);return v?ok(v):err(errorFromResponse(502,{error:{code:"INTERNAL_ERROR"}},_))}function et(e){return typeof e=="string"&&ue.includes(e)}function tt(e){if(typeof e!="object"||e===null)throw new t("invalid-argument","event is required");if(!et(e.type))throw new t("invalid-argument",`event.type must be one of ${ue.join(", ")}`);let r=Je[e.type],n=e.schemaVersion??1;if(typeof n!="number"||!r.schemaVersions.includes(n))throw new t("invalid-argument",`event.schemaVersion must be one of ${r.schemaVersions.join(", ")} for ${e.type}`);let userRef=assertValidUserRef(e.userRef);if(r.subject==="pet"&&e.petRef===void 0)throw new t("invalid-argument",`event.petRef is required for ${e.type}`);if(r.subject==="member"&&e.petRef!==void 0)throw new t("invalid-argument",`event.petRef is not accepted on ${e.type}`);let petRef=e.petRef===void 0?void 0:rt(e.petRef);if(typeof e.data!="object"||e.data===null||Array.isArray(e.data))throw new t("invalid-argument","event.data must be an object");let a=e.type==="pet.profile.updated"&&n===2?He(e.data):e.data,i={type:e.type,schema_version:n,user_ref:userRef,occurred_at:nt(e.occurredAt),data:a};return petRef!==void 0&&(i.pet_ref=petRef),i}function rt(e){try{return assertValidUserRef(e)}catch(e){throw e instanceof t?new t("invalid-argument",`event.petRef follows the user_ref rule: ${e.message}`):e}}function nt(e){if(typeof e=="string"&&!Ze.test(e))throw new t("invalid-argument","event.occurredAt must be a Date or an ISO 8601 date-time with an explicit offset (Z or +05:30)");let r=e instanceof Date?e:typeof e=="string"?new Date(e):new Date(Number.NaN);if(Number.isNaN(r.getTime()))throw new t("invalid-argument","event.occurredAt must be a Date or an ISO 8601 date-time with an explicit offset (Z or +05:30)");return r.toISOString()}function at(e){let r;try{r=JSON.stringify(e)}catch{throw new t("invalid-argument","event.data must be JSON-serialisable")}let n=(new TextEncoder).encode(r).byteLength;if(n>Qe)throw new t("invalid-argument",`the event is ${n} bytes once serialised; Everfur accepts at most ${Qe} (32 KB)`);return r}function it(e,t){if(typeof e!="object"||e===null)return null;let r=e,n=r.id,a=r.type,i=r.schema_version,userRef=r.user_ref,petRef=r.pet_ref??null,o=r.occurred_at,l=r.received_at,s=r.status,d=r.livemode;return typeof n!="string"||n.length===0||!et(a)||typeof i!="number"||typeof userRef!="string"||petRef!==null&&typeof petRef!="string"||typeof o!="string"||typeof l!="string"||typeof s!="string"||typeof d!="boolean"?null:/* @__PURE__ */Object.freeze({id:n,type:a,schemaVersion:i,userRef:userRef,petRef:petRef,occurredAt:o,receivedAt:l,status:s,livemode:d,idempotencyKey:t})}exports.DEFAULT_WEBHOOK_TOLERANCE_SECONDS=a;exports.EVERFUR_SIGNATURE_HEADER=n;exports.EVERFUR_WEBHOOK_EVENT_TYPES=se;exports.EVERFUR_WEBHOOK_ONLY_EVENT_TYPES=de;exports.EverfurWebhookVerificationError=d;exports.PARTNER_INBOUND_EVENT_TYPES=ue;exports.constructEvent=constructEvent;exports.generateTestSignatureHeader=generateTestSignatureHeader;exports.isEverfurWebhookEvent=isEverfurWebhookEvent;exports.isEverfurWebhookEventType=isEverfurWebhookEventType;exports.sendPartnerEvent=sendPartnerEvent;
|
|
4
|
+
return Object.freeze({ok:false,error:e})}var t=class _EverfurConfigError extends Error{constructor(e,t){super(t),this.name="EverfurConfigError",this.kind=e,Object.setPrototypeOf(this,_EverfurConfigError.prototype)}};function r(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var n="Everfur-Signature",a=300,i="v1",o=4096,l=64,s=/^[0-9]+$/,d=class _EverfurWebhookVerificationError extends Error{constructor(e){super(`Everfur webhook verification failed: ${e}`),this.name="EverfurWebhookVerificationError",this.code=e,Object.setPrototypeOf(this,_EverfurWebhookVerificationError.prototype)}};function constructEvent(r,n,i,o={}){let s=p(r),v=c(i),h=o.toleranceSeconds??a;if(!Number.isInteger(h)||h<0)throw new t("invalid-argument","toleranceSeconds must be a non-negative integer");let m=_(n),y=o.nowSeconds??Math.floor(Date.now()/1e3);if(Math.abs(y-m.timestamp)>h)throw new d("timestamp_outside_tolerance");let b=false;for(let t of v){let r=Buffer.from(u(t,m.timestamp,s),"ascii");for(let t of m.signatures){if(t.length!==l)continue;let n=Buffer.from(t,"utf8");n.length===r.length&&e.timingSafeEqual(r,n)&&(b=true)}}if(!b)throw new d("no_matching_signature");return f(s)}function generateTestSignatureHeader(e){let r=p(e.payload),n=c(e.secrets),a=e.timestamp??Math.floor(Date.now()/1e3);if(!Number.isSafeInteger(a)||a<0)throw new t("invalid-argument","timestamp must be a non-negative integer (unix seconds)");return[`t=${a}`,...n.map(e=>`${i}=${u(e,a,r)}`)].join(",")}function u(t,r,n){return e.createHmac("sha256",Buffer.from(t,"utf8")).update(`${r}.`,"ascii").update(n).digest("hex")}function p(e){if(typeof e=="string")return Buffer.from(e,"utf8");if(e instanceof Uint8Array)return e;throw new t("invalid-argument","constructEvent needs the raw request body (a string or a Buffer), not parsed JSON: re-serialised JSON does not reproduce the signed bytes.")}function c(e){let r=typeof e=="string"?[e]:Array.isArray(e)?e:[];if(r.length===0||r.some(e=>typeof e!="string"||e.length===0))throw new t("invalid-argument","at least one non-empty webhook signing secret is required");return r}function _(e){if(typeof e!="string"||e.length===0||e.length>o)throw new d("malformed_header");let t=null,r=[];for(let n of e.split(",")){let e=n.trim(),a=e.indexOf("=");if(a<0)throw new d("malformed_header");let o=e.slice(0,a),l=e.slice(a+1);if(o==="t"){if(t!==null||!s.test(l))throw new d("malformed_header");let e=Number(l);if(!Number.isSafeInteger(e))throw new d("malformed_header");t=e}else o===i&&r.push(l)}if(t===null||r.length===0)throw new d("malformed_header");return{timestamp:t,signatures:r}}function f(e){let t;try{t=JSON.parse(Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"))}catch{throw new d("malformed_payload")}if(!r(t))throw new d("malformed_payload");let{id:n,object:a,type:i,api_version:o,created:l,livemode:s,data:u}=t;if(typeof n!="string"||n.length===0||a!=="event"||typeof i!="string"||i.length===0||typeof o!="string"||typeof l!="number"||typeof s!="boolean"||!r(u)||!r(u.object))throw new d("malformed_payload");return t}var v=/^([A-Za-z][A-Za-z0-9+.-]*):\/\/([^/?#]*)/;var h="1.5.0";var m="2026-09-19",y="EVERFUR_API_BASE_URL";function b(e,t){/* @__PURE__ */
|
|
5
|
+
return Object.freeze({ok:false,failure:/* @__PURE__ */Object.freeze({reason:e,message:t})})}function tryResolveApiBaseUrl(e){let t=e?.trim(),r=t&&t.length>0?t:R(y);return r?C(r):b("missing-api-base-url",`apiBaseUrl is required: pass config.apiBaseUrl or set ${y}. The SDK never ships a hardcoded host.`)}function resolveApiBaseUrl(e){let r=tryResolveApiBaseUrl(e);if(!r.ok)throw new t("invalid-argument",r.failure.message);return r.value}function w(e){return e.slice(e.lastIndexOf("@")+1).replace(/:\d+$/,"").toLowerCase()}function g(e){return e.length===0||e.includes("@")?false:e.startsWith("[")&&e.endsWith("]")?true:!e.includes(":")}function E(e,t){let r=e.indexOf("://");return r<0||e.slice(r+3).includes("@")?false:g(t)}function S(e,t){return`${e}://${t}`}function C(e){let t=e.trim(),r=v.exec(t);if(r===null||r[2]===void 0||r[2].length===0)return b("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let n=(r[1]??"").toLowerCase(),a=w(r[2]);if(a.length===0)return b("malformed-api-base-url","apiBaseUrl is not a valid absolute URL");let i=E(t,a)?`: ${S(n,a)}`:"";if(n!=="https"){if(!(n==="http"&&T(a)))return n==="http"?b("insecure-api-base-url",`apiBaseUrl must use https (cleartext http is only allowed for localhost)${i}`):b("unsupported-api-base-url-scheme",`apiBaseUrl must be http(s)${i}`)}let o=t.endsWith("/")?t.slice(0,-1):t;/* @__PURE__ */
|
|
6
|
+
return Object.freeze({ok:true,value:o})}function T(e){let t=e.toLowerCase();return t==="localhost"||t==="127.0.0.1"||t==="[::1]"||t==="::1"}function R(e){let t=globalThis.process?.env?.[e];return typeof t=="string"&&t.trim().length>0?t.trim():void 0}var k="server";function D(e){return{"X-Everfur-SDK-Version":h,"X-Everfur-SDK-Platform":k,"X-Everfur-Contract":e}}var N="DAILY_QUOTA_EXCEEDED",O=/* @__PURE__ */new Set(["THROTTLINGEXCEPTION","RATELIMITED","TOOMANYREQUESTS"]);function F(e,t){if(!O.has(e.toUpperCase().replace(/[^A-Z0-9]/g,"")))return e;let r=t,n=r?.daily_limit??r?.error?.daily_limit;return typeof n=="number"&&Number.isFinite(n)?N:e}var I=[{wireCode:"AccessDeniedException",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"AuthorizationException",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"ConflictException",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"DAILY_QUOTA_EXCEEDED",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"FILE_TOO_LARGE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"IDEMPOTENCY_KEY_IN_FLIGHT",envelope:"http_envelope",httpStatus:409,retryable:true},{wireCode:"IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"INVALID_CONTENT_TYPE",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"InternalFailureException",envelope:"http_envelope",httpStatus:500,retryable:true},{wireCode:"MethodNotAllowedException",envelope:"http_envelope",httpStatus:405,retryable:false},{wireCode:"NotImplementedException",envelope:"http_envelope",httpStatus:501,retryable:false},{wireCode:"PaymentRequiredException",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ResourceNotFoundException",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"ServiceUnavailableException",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"TIER_UPGRADE_REQUIRED",envelope:"http_envelope",httpStatus:402,retryable:false},{wireCode:"ThrottlingException",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"ValidationException",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"accessDenied",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"access_denied",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"anchor_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"anchor_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"anonTokenInvalid",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"attachment_unreadable",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"authExpired",envelope:"http_envelope",httpStatus:401,retryable:true},{wireCode:"authRejected",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"before_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundle_not_uploaded",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"bundles_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"catalog_empty_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"catalog_shrink_refused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"consent_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_required",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"consent_scope_wrong_route",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"device_cipher_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"email_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"endpoint_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"environment_mismatch",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_cursor_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"event_payload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_not_available",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"event_type_unknown",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_required",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"idempotency_key_reused",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"inbox_cursor_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"insufficientCapability",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"insufficient_scope",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"internal_error",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"invalidRequest",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"invalid_client",envelope:"oauth_error",httpStatus:401,retryable:false},{wireCode:"invalid_client_metadata",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_grant",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_redirect_uri",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_request",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_scope",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"invalid_target",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"item_id_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"linked_account_read_only",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_connection_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"mcp_request_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"mcp_request_gone",envelope:"http_envelope",httpStatus:410,retryable:false},{wireCode:"mcp_request_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"not_found",envelope:"sse_frame",httpStatus:200,retryable:false},{wireCode:"not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"open_url_not_allowed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"partner_visit_link_conflict",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"partner_visit_owner_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"partner_visit_pet_already_mapped",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"payload_too_large",envelope:"http_envelope",httpStatus:413,retryable:false},{wireCode:"petRefInUse",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"pet_health_list_removals_unconfirmed",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_health_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"pet_not_registered",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"provider_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"rateLimited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"read_target_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"record_subject_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"record_upload_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"records_consent_required",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"restricted_key",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"sandbox_only",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_required",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"session_revoked",envelope:"http_envelope",httpStatus:401,retryable:false},{wireCode:"share_limit_reached",envelope:"http_envelope",httpStatus:429,retryable:false},{wireCode:"slow_down",envelope:"oauth_error",httpStatus:429,retryable:true},{wireCode:"species_unsupported",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"subscription_keys_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"tenant_filter_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"tenant_has_no_capabilities",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tenant_resource_not_found",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"tenant_surface_not_enabled",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"ticket_not_resolved",envelope:"http_envelope",httpStatus:409,retryable:false},{wireCode:"tickets_disabled",envelope:"http_envelope",httpStatus:404,retryable:false},{wireCode:"timeout",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"timezone_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"token_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"unavailable",envelope:"sse_frame",httpStatus:200,retryable:true},{wireCode:"unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"unrestrictedKeyRequired",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"unsupported_grant_type",envelope:"oauth_error",httpStatus:400,retryable:false},{wireCode:"unsupported_response_type",envelope:"oauth_error",httpStatus:302,retryable:false},{wireCode:"user_ref_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"verify_mint_rate_limited",envelope:"http_envelope",httpStatus:429,retryable:true},{wireCode:"verify_mint_refused",envelope:"http_envelope",httpStatus:403,retryable:false},{wireCode:"verify_mint_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false},{wireCode:"web_push_unavailable",envelope:"http_envelope",httpStatus:503,retryable:true},{wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false},{wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false}],A=/* @__PURE__ */Object.freeze(I.map(e=>/* @__PURE__ */Object.freeze(e)));/* @__PURE__ */Object.freeze(A.map(e=>e.wireCode));var j=/* @__PURE__ */Object.freeze({ValidationException:"validationFailed",AuthorizationException:"authRejected",PaymentRequiredException:"paymentRequired",AccessDeniedException:"accessDenied",ResourceNotFoundException:"resourceNotFound",ConflictException:"conflict",ThrottlingException:"rateLimited",InternalFailureException:"internalError",NotImplementedException:"notImplemented",ServiceUnavailableException:"serviceUnavailable",MethodNotAllowedException:"validationFailed",authExpired:"authExpired",unavailable:"serviceUnavailable",session_required:"sessionRequired",session_revoked:"authExpired",anonTokenInvalid:"authRejected",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",unrestrictedKeyRequired:"accessDenied",user_ref_invalid:"validationFailed",event_cursor_invalid:"validationFailed",event_filter_invalid:"validationFailed",event_payload_invalid:"validationFailed",event_type_unknown:"validationFailed",idempotency_key_invalid:"validationFailed",idempotency_key_required:"validationFailed",idempotency_key_reused:"idempotencyConflict",payload_too_large:"validationFailed",webhook_url_rejected:"validationFailed",webhook_endpoint_update_empty:"validationFailed",webhook_endpoint_update_invalid:"validationFailed",event_type_not_available:"conflict",record_subject_not_found:"resourceNotFound",records_consent_required:"conflict",record_species_unsupported:"validationFailed",record_upload_invalid:"validationFailed",FILE_TOO_LARGE:"validationFailed",INVALID_CONTENT_TYPE:"validationFailed",attachment_unreadable:"validationFailed",provider_unsupported:"validationFailed",token_invalid:"validationFailed",device_cipher_unavailable:"serviceUnavailable",email_invalid:"validationFailed",consent_required:"validationFailed",consent_invalid:"validationFailed",consent_scope_wrong_route:"validationFailed",IDEMPOTENCY_KEY_IN_FLIGHT:"idempotencyInFlight",IDEMPOTENCY_KEY_REUSED_DIFFERENT_REQUEST:"idempotencyConflict",DAILY_QUOTA_EXCEEDED:"quotaExceeded",TIER_UPGRADE_REQUIRED:"paymentRequired",not_found:"conversationNotFound",timeout:"streamTimeout",internal_error:"internalError",invalid_request:"validationFailed",invalid_client:"authRejected",invalid_grant:"authRejected",unsupported_grant_type:"validationFailed",invalid_scope:"validationFailed",invalid_target:"validationFailed",invalid_redirect_uri:"validationFailed",invalid_client_metadata:"validationFailed",unsupported_response_type:"validationFailed",access_denied:"accessDenied",slow_down:"rateLimited",mcp_request_not_found:"resourceNotFound",mcp_request_gone:"resourceNotFound",mcp_connection_not_found:"resourceNotFound",mcp_request_conflict:"conflict",sandbox_only:"accessDenied",tenant_has_no_capabilities:"conflict",verify_mint_refused:"accessDenied",verify_mint_rate_limited:"rateLimited",verify_mint_unavailable:"serviceUnavailable",verify_user_ref_invalid:"validationFailed",insufficient_scope:"accessDenied",tenant_filter_invalid:"validationFailed",tenant_resource_not_found:"resourceNotFound",tenant_surface_not_enabled:"conflict",pet_health_species_unsupported:"validationFailed",pet_health_list_removals_unconfirmed:"validationFailed",petRefInUse:"conflict",share_limit_reached:"conflict",pet_not_registered:"resourceNotFound",species_unsupported:"validationFailed",partner_visit_owner_only:"accessDenied",partner_visit_link_conflict:"conflict",partner_visit_pet_already_mapped:"conflict",linked_account_read_only:"conflict",catalog_empty_refused:"conflict",catalog_shrink_refused:"conflict",endpoint_not_allowed:"validationFailed",event_id_invalid:"validationFailed",inbox_cursor_invalid:"validationFailed",item_id_invalid:"validationFailed",open_url_not_allowed:"validationFailed",read_target_invalid:"validationFailed",subscription_keys_invalid:"validationFailed",web_push_unavailable:"serviceUnavailable",anchor_not_found:"resourceNotFound",anchor_ref_invalid:"validationFailed",before_invalid:"validationFailed",bundle_mismatch:"validationFailed",bundle_not_uploaded:"validationFailed",bundles_unavailable:"serviceUnavailable",environment_mismatch:"validationFailed",restricted_key:"accessDenied",ticket_not_resolved:"conflict",tickets_disabled:"resourceNotFound",timezone_invalid:"validationFailed"}),x=/* @__PURE__ */Object.freeze(A.map(e=>/* @__PURE__ */Object.freeze({wireCode:e.wireCode,envelope:e.envelope,retryable:e.retryable,normalized:j[e.wireCode]}))),U=new Map(x.map(e=>[e.envelope+e.wireCode.toUpperCase(),e])),q=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(x.map(e=>e.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(e,t){if(typeof e!="string")return;let r=e.trim().toUpperCase();if(r.length!==0)for(let e of[t??"http_envelope",...q]){let t=U.get(e+r);if(t)return t}}var L=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"invalidRequest",runtimeDisposed:"invalidRequest",conversationNotFound:"notFound",petNotFound:"notFound",resourceNotFound:"notFound",conflict:"conflict",idempotencyConflict:"conflict",idempotencyInFlight:"conflict",streamTimeout:"connection",streamIncomplete:"connection",upstreamLlmTimeout:"connection",serviceUnavailable:"connection",internalError:"server",notImplemented:"server",mediaUploadFailed:"media",moderationBlocked:"policy",unknown:"unknown"});function categoryFor(e){return L[e]}function fromWire(e){let t=contractErrorFor(e);if(t)return t.normalized;let r=(e??"").trim().toUpperCase(),n=r.replace(/[^A-Z0-9]/g,"");if(n==="AUTHREJECTED")return"authRejected";if(r.startsWith("AUTH"))return"authExpired";switch(n){case"DAILYQUOTAEXCEEDED":case"QUOTAEXCEEDED":return"quotaExceeded";case"RATELIMITED":case"TOOMANYREQUESTS":case"TELEVETRATELIMITED":return"rateLimited";case"IDEMPOTENCYKEYCONFLICT":case"IDEMPOTENCYCONFLICT":return"idempotencyConflict";case"ACCESSDENIED":case"FORBIDDEN":return"accessDenied";case"IDENTITYSIGNATUREREQUIRED":return"identitySignatureRequired";case"FREECAPREACHED":return"paymentRequired";case"RUNTIMEDISPOSED":return"runtimeDisposed";case"NOTFOUND":case"CONVERSATIONNOTFOUND":return"conversationNotFound";case"PETNOTFOUND":return"petNotFound";case"TIMEOUT":case"STREAMTIMEOUT":return"streamTimeout";case"MEDIAUPLOADFAILED":case"UNRECOGNIZEDVIDEOFORMAT":case"FILETOOSMALL":return"mediaUploadFailed";case"MODERATIONBLOCKED":return"moderationBlocked";case"UPSTREAMLLMTIMEOUT":return"upstreamLlmTimeout";case"INTERNALERROR":case"INTERNALSERVERERROR":return"internalError";case"STREAMINCOMPLETE":case"CHATSTREAMINCOMPLETE":return"streamIncomplete";case"INVALIDANALYSISTYPE":case"INVALIDUPLOADPURPOSE":return"unknown";default:return"unknown"}}function fromHttpStatus(e){return e===401?"authExpired":e===403?"accessDenied":e===404?"conversationNotFound":e===409?"idempotencyConflict":e===421?"unknown":e===429?"rateLimited":e===400||e===422?"unknown":e>=500?"internalError":"unknown"}var $=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(e){return $.has(e)}var P=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(e){return isAutoRetryable(e)||P.has(e)}var M="This feature isn't available on your account right now.",z="Something in that request was not right. Check the details and try again.",V=/* @__PURE__ */Object.freeze({authExpired:"Please sign in again to continue.",authRejected:"Please sign in again to continue.",sessionRequired:"This app needs to be updated to keep using Everfur.",accessDenied:M,paymentRequired:"This is part of a paid plan.",quotaExceeded:"You have used today's messages. This resets tomorrow.",rateLimited:"You are sending messages quickly. Try again in a few seconds.",validationFailed:z,sdkUpdateRequired:"This app needs to be updated to keep using Everfur.",conflict:"That is already running. Wait for it to finish, then try again.",idempotencyConflict:"That message was already delivered.",idempotencyInFlight:"That is still processing. Give it a moment.",conversationNotFound:"This conversation is no longer available.",petNotFound:"We could not find that pet. Please pick a pet and try again.",resourceNotFound:"We could not find that.",streamTimeout:"The response timed out. Tap retry to try again.",mediaUploadFailed:"We could not upload that photo. Please attach it again.",moderationBlocked:"This request cannot be answered here.",upstreamLlmTimeout:"The response timed out. Tap retry to try again.",internalError:"We hit a snag on our end. Please try again.",notImplemented:"That is not available yet.",serviceUnavailable:"That service is briefly unavailable. Try again shortly.",streamIncomplete:"The connection dropped mid-answer. Tap retry to continue.",identitySignatureRequired:M,runtimeDisposed:z,unknown:"Something went wrong. Please try again."}),Y="This session has ended. Please sign in again.",B="linked_account_read_only";function K(e,t,r){return e==="conflict"&&r===B?M:(e==="authRejected"||e==="authExpired")&&typeof t=="string"&&t.trim().toLowerCase()==="session_revoked"?Y:userFacingError(e)}function userFacingError(e){return V[e]}function W(e,t,r){Object.defineProperty(e,t,{value:r,enumerable:false,writable:false,configurable:false})}var H=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(e,t){let r=contractErrorFor(t?.wireCode,t?.wireEnvelope),n=e==="conflict"&&t?.reasonCode===B,a={code:e,category:categoryFor(e),retryable:t?.retryable??(n?false:isRetryableCode(e)),displayMessage:K(e,t?.wireCode,n?B:null)};t?.httpStatus!==void 0&&(a.httpStatus=t.httpStatus),t?.requestId&&(a.requestId=t.requestId),typeof t?.reasonCode=="string"&&H.test(t.reasonCode)&&(a.reasonCode=t.reasonCode);let i=t?.retryAfterSeconds;if(typeof i=="number"&&Number.isFinite(i)&&i>=0&&(a.retryAfterSeconds=Math.round(i)),r);return t?.wireMessage&&W(a,"wireMessage",t.wireMessage),t?.raw!==void 0&&t.raw!==null&&W(a,"raw",t.raw),/* @__PURE__ */Object.freeze(a)}var G="free_cap_reached";function Q(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}function Z(e){if(typeof e!="object"||e===null)return null;let t=e,r=t.detail,n=typeof r=="object"&&r!==null?r:t;if(n.error!==G&&n.code!==G)return null;let a=Q(n.limit),i=Q(n.used);if(a===null||i===null)return null;let o=n.resets_at,l=n.emergency_guidance;/* @__PURE__ */
|
|
7
|
+
return Object.freeze({limit:a,used:i,resetsAt:typeof o=="string"&&o.length>0?o:null,...typeof l=="string"&&l.trim().length>0?{emergencyGuidance:l}:{}})}function X(e,t){if(e.status!==429&&e.status!==503)return t;let r=ee(e.headers.get(J),Date.now());if(r===null)return t;let n=t!==null&&typeof t=="object"&&!Array.isArray(t)?t:null;return n!==null&&te(n)?t:{...n??{},retry_after_seconds:r}}var J="retry-after";function ee(e,t){if(e===null)return null;let r=e.trim();if(/^\d+$/.test(r))return Number(r);let n=Date.parse(r);return Number.isFinite(n)?Math.max(0,Math.ceil((n-t)/1e3)):null}function te(e){return[e,e.error,e.detail].some(e=>e!==null&&typeof e=="object"&&("retry_after_seconds"in e||"resets_at"in e))}var re="x-request-id";function errorFromResponse(e,t,r){let n=ie(t),a=n?fromWire(n):fromHttpStatus(e),i=oe(t);return makeEverfurError(a,{httpStatus:e,...le(t)?{retryable:true}:{},...r?{requestId:r}:{},...n?{wireCode:n}:{},...ae(t)?{reasonCode:ae(t)}:{},...ne(t)!==null?{retryAfterSeconds:ne(t)}:{},...i?{wireMessage:i}:{},...t!=null?{raw:t}:{}})}function ne(e){let t=e,r=t?.retry_after_seconds??t?.error?.retry_after_seconds;return typeof r=="number"&&Number.isFinite(r)&&r>=0?r:null}function networkError(e){return makeEverfurError("internalError",{retryable:true,wireMessage:se(e)})}function requestIdOf(e){let t=e.headers.get(re);return typeof t=="string"&&t.length>0?t:null}function getGlobalFetch(){let e=globalThis.fetch;if(typeof e!="function")throw new t("missing-peer-dependency","global fetch is unavailable; provide config.transport or an injected fetch implementation");return e}function ae(e){let t=e,r=t?.error?.reason_code??t?.reason_code;return typeof r=="string"&&r.length>0?r:null}function ie(e){let t=e,r=t?.error?.code??t?.code;return typeof r=="string"&&r.length>0?F(r,e):Z(e)!==null?G:null}function oe(e){let t=e,r=t?.error?.message??t?.message;return typeof r=="string"&&r.length>0?r:null}function le(e){let t=e;return t?.error?.retryable===true||t?.retryable===true}function se(e){return e instanceof Error?e.message:typeof e=="string"?e:"network request failed"}var de=/* @__PURE__ */Object.freeze(["member.linked","member.unlinked","visit.booked","visit.cancelled","visit.completed","visit.no_show","record_request.updated","record.ready","webhook_endpoint.test","chat.follow_up_due","chat.urgency.flagged","pet.vaccination.due","visit.rescheduled","visit.reminder","visit.followup_sent","chat.reminder_due","record.activation","visit.message_received","visit.ended","contact.exported","health_plan.box_due","health_plan.one_box_ordered","claim.evidence_returned","claim.evidence_updated","claim.records_requested","claim.failed","claim.duplicate","claim.decided","claim.inbound_refused","insured_pet.profile.ready","insured_pet.profile.updated","chat.engagement_message","visit.notes_ready","visit.vet_joined","visit.summary_sent","chat.answer_ready","chat.follow_up_day5_due","care.medication_check_due","care.dose_due","care.refill_due","care.prevention_due","care.meal_due","care.nose_to_tail_due","care.reminder_due","record.labs_ready","record.update_available","order.updated","order.prescription_updated","walk.reminder","walk.reminder_offer","weather.heat","weather.storm","weather.air_quality","weather.ice","weather.pollen","safety.danger_day","safety.food_recall","insight.week","insight.birthday","tip.weekly","tip.daily","insight.weight_trend","tip.question_guide","insight.monthly_notes","pet.adoption_day","insight.year_summary","pack.walk_logged","pack.question","pack.reactions","pack.care_handoff","pack.photo_ready","mood.check_in_due","streak.at_risk","streak.milestone","membership.first_visit","membership.renewal","membership.invite","support.replied"]),ue=/* @__PURE__ */Object.freeze(["member.linked","member.unlinked","chat.urgency.flagged","webhook_endpoint.test","contact.exported","health_plan.box_due","health_plan.one_box_ordered","claim.evidence_returned","claim.evidence_updated","claim.records_requested","claim.failed","claim.duplicate","claim.decided","claim.inbound_refused","insured_pet.profile.ready","insured_pet.profile.updated"]);function isEverfurWebhookEventType(e){return typeof e=="string"&&de.includes(e)}function isEverfurWebhookEvent(e){return isEverfurWebhookEventType(e.type)}var pe=/* @__PURE__ */Object.freeze(["pet.profile.updated","pet.incident.reported","pet.behavior_note.added","pet.service_score.recorded","pet.deleted","member.status_changed","member.deleted"]);var ce=["sk_partner_","rk_partner_"];function _e(e,r){if(typeof e!="string"||e.length===0)throw new t("invalid-argument","partnerSecretKey is required");if(e.startsWith("pk_"))throw new t("invalid-argument",`partnerSecretKey is a publishable key (pk_...): ${r} needs your secret key, server side only`);if(!ce.some(t=>e.startsWith(t)))throw new t("invalid-argument","partnerSecretKey must be an sk_partner_ secret key or an rk_partner_ restricted key")}var fe=128;function assertValidUserRef(e){let r=typeof e=="string"?[...e].length:0;if(typeof e!="string"||r<1||r>fe)throw new t("invalid-argument",`user_ref must be 1..${fe} characters`);if(e.trim().length===0)throw new t("invalid-argument","user_ref must not be blank: the server strips surrounding whitespace before validating, so a whitespace-only value arrives empty and is rejected as required.");if(e!==e.trim())throw new t("invalid-argument","user_ref must not have leading or trailing whitespace: the server strips it, so padded and unpadded forms of the same id resolve to ONE user. Pass the exact id you want to key on.");if(e.includes("@"))throw new t("invalid-argument","user_ref must not contain '@'");if(!ve(e))throw new t("invalid-argument","user_ref must be printable (no control characters)");return e}function ve(e){return!he.test(e)}var he=/[\p{Cc}\p{Cf}\p{Cs}\p{Co}\p{Cn}\p{Zl}\p{Zp}]|(?!\u0020)[\p{Zs}]/u;function me(e){for(let t=0;t<e.length;t+=1){let r=e.charCodeAt(t);if(r>=55296&&r<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return true;t+=1}else if(r>=56320&&r<=57343)return true}return false}function ye(e){return[...e].length}var be=/* @__PURE__ */Object.freeze({dog:"dog",canine:"dog",k9:"dog",puppy:"dog",cat:"cat",feline:"cat",kitten:"cat"});function canonicalPetSpecies(e){if(typeof e!="string")return null;let t=e.trim().toLowerCase();return Object.prototype.hasOwnProperty.call(be,t)?be[t]:null}var we=50,ge=128,Ee=120,Se=120,Ce=2e3,Te=120,Re=80,ke=/* @__PURE__ */new Set(["male","female","unknown"]),De=/* @__PURE__ */new Set(["day","month","year"]),Ne=/* @__PURE__ */new Set(["low","medium","high","athletic"]),Oe=/* @__PURE__ */new Set(["indoor","outdoor","both"]),Fe=/* @__PURE__ */new Set(["mild","moderate","severe"]),Ie=/^(\d{4})-(\d{2})-(\d{2})$/,Ae=[["sex","sex"],["spayedNeutered","spayed_neutered"],["birthDate","birth_date"],["birthDatePrecision","birth_date_precision"],["activityLevel","activity_level"],["indoorOutdoor","indoor_outdoor"],["foodBrand","food_brand"],["foodType","food_type"],["microchipId","microchip_id"]],je=[["allergies","allergies"],["medications","medications"],["supplements","supplements"],["conditions","conditions"]];/* @__PURE__ */Object.freeze([...Ae,...je].map(([e])=>e));function xe(e){let t=Ie.exec(e);if(t===null)return false;let[r,n,a]=[Number(t[1]),Number(t[2]),Number(t[3])],i=new Date(Date.UTC(r,n-1,a));return i.getUTCFullYear()===r&&i.getUTCMonth()===n-1&&i.getUTCDate()===a}var Ue=e=>(t,r)=>typeof r=="string"&&e.has(r)?null:`${t} must be one of ${[...e].join(", ")}`,qe=(e,t)=>typeof t=="boolean"?null:`${e} must be true or false`,Le=(e,t)=>typeof t=="string"&&xe(t)?null:`${e} must be a real date written YYYY-MM-DD`,$e=(e,t={})=>(r,n)=>{if(typeof n!="string")return`${r} must be a string`;if(me(n))return`${r} contains an unpaired surrogate and cannot be encoded`;let a=t.trimmed?n.trim():n;if(t.required&&a.length===0)return`${r} is required and must not be blank`;let i=ye(a);return i<=e?null:`${r} is ${i} characters; the server accepts at most ${e}`},Pe={sex:Ue(ke),spayedNeutered:qe,birthDate:Le,birthDatePrecision:Ue(De),activityLevel:Ue(Ne),indoorOutdoor:Ue(Oe),foodBrand:$e(Te),foodType:$e(Te),microchipId:$e(Re)},Me=["ref","ref",false,$e(ge,{required:true,trimmed:true})],ze=["notes","notes",false,$e(Ce,{trimmed:true})],Ve=[Me,["name","name",true,$e(Ee,{required:true,trimmed:true})],["dose","dose",false,$e(Se,{trimmed:true})],["frequency","frequency",false,$e(Se,{trimmed:true})],["startDate","start_date",false,Le],["endDate","end_date",false,Le],ze],Ye={allergies:[Me,["allergen","allergen",true,$e(Ee,{required:true,trimmed:true})],["severity","severity",false,Ue(Fe)],ze],medications:Ve,supplements:Ve,conditions:[Me,["conditionName","condition_name",true,$e(Ee,{required:true,trimmed:true})],["diagnosedDate","diagnosed_date",false,Le],ze]};function Be(e,t,r){let n=`${e}[${t}]`;if(typeof r!="object"||r===null||Array.isArray(r))return{error:`${n} must be an object`};let a=r,i={};for(let[t,r,o,l]of Ye[e]){let e=a[t];if(e==null){if(o)return{error:`${n}.${t} is required`};e===null&&(i[r]=null);continue}let s=l(`${n}.${t}`,e);if(s!==null)return{error:s};i[r]=e}let o=i.start_date,l=i.end_date;return typeof o=="string"&&typeof l=="string"&&l<o?{error:`${n}.endDate must not be before startDate`}:{item:i}}function Ke(e,t){if(!Array.isArray(t))return{error:`${e} must be an array (send [] to clear it)`};if(t.length>we)return{error:`${e} has ${t.length} items; the server accepts at most ${we}`};let r=[],n=/* @__PURE__ */new Set;for(let a=0;a<t.length;a+=1){let i=Be(e,a,t[a]);if("error"in i)return i;let o=i.item.ref;if(typeof o=="string"){let t=o.trim();if(n.has(t))return{error:`${e}: ref ${JSON.stringify(t)} is used twice; a ref names one item`};n.add(t)}r.push(i.item)}return{items:r}}function We(e,t){let r=e,n={};for(let[e,t]of Ae){let a=r[e];if(a!==void 0){if(a!==null){let t=Pe[e](e,a);if(t!==null)return{error:t}}n[t]=a}}let a=r.birthDate!==void 0,i=r.birthDatePrecision!==void 0;if(a!==i||a&&r.birthDate===null!=(r.birthDatePrecision===null))return{error:"birthDate and birthDatePrecision must be sent together, both set or both null"};for(let[e,t]of je){let a=r[e];if(a===void 0)continue;let i=Ke(e,a);if("error"in i)return i;n[t]=i.items}return Object.keys(n).length>0&&t!==void 0&&canonicalPetSpecies(t)===null?{error:"health fields need a pet Everfur reads as a dog or a cat (dog, canine, k9, puppy, cat, feline, kitten)"}:{body:n}}var He=[["name","name"],["species","species"],["breed","breed"],["ageYears","age_years"],["weightKg","weight_kg"],["partnerLabelInstructions","partner_label_instructions"]];function Ge(e){if(typeof e!="object"||e===null||Array.isArray(e))throw new t("invalid-argument","the pet profile must be an object");let r={};for(let[t,n]of He)e[t]!==void 0&&(r[n]=e[t]);let n=We(e,e.species);if("error"in n)throw new t("invalid-argument",n.error);return Object.assign(r,n.body)}var Qe=/^[\x21-\x7e]{1,255}$/,Ze=32*1024,Xe=/^\d{4}-\d{2}-\d{2}[Tt ]\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:[Zz]|[+-]\d{2}:?\d{2})$/,Je=3e4,et=/* @__PURE__ */Object.freeze({"pet.profile.updated":{subject:"pet",schemaVersions:[1,2]},"pet.incident.reported":{subject:"pet",schemaVersions:[1]},"pet.behavior_note.added":{subject:"pet",schemaVersions:[1]},"pet.service_score.recorded":{subject:"pet",schemaVersions:[1]},"pet.deleted":{subject:"pet",schemaVersions:[1]},"member.status_changed":{subject:"member",schemaVersions:[1]},"member.deleted":{subject:"member",schemaVersions:[1]}});async function sendPartnerEvent(r,n,a){let i=a??e.randomUUID();if(typeof i!="string"||!Qe.test(i))throw new t("invalid-argument","idempotencyKey must be 1 to 255 visible ASCII characters (no spaces, no control or non-ASCII characters)");_e(r.partnerSecretKey,"sending events");let o=it(rt(n)),l=r.fetchImpl??getGlobalFetch(),s=`${resolveApiBaseUrl(r.apiBaseUrl)}/partners/events`,d={...D(r.contractVersion??m),accept:"application/json","content-type":"application/json","idempotency-key":i,"x-everfur-partner-secret-key":r.partnerSecretKey},u=new AbortController,p=setTimeout(()=>u.abort(),Je),c;try{c=await l(s,{method:"POST",headers:d,body:o,signal:u.signal})}catch(e){return err(networkError(e))}finally{clearTimeout(p)}let _=null;try{_=await c.json()}catch{_=null}let f=requestIdOf(c);if(!c.ok)return err(errorFromResponse(c.status,X(c,_),f));let v=ot(_,i);return v?ok(v):err(errorFromResponse(502,{error:{code:"INTERNAL_ERROR"}},f))}function tt(e){return typeof e=="string"&&pe.includes(e)}function rt(e){if(typeof e!="object"||e===null)throw new t("invalid-argument","event is required");if(!tt(e.type))throw new t("invalid-argument",`event.type must be one of ${pe.join(", ")}`);let r=et[e.type],n=e.schemaVersion??1;if(typeof n!="number"||!r.schemaVersions.includes(n))throw new t("invalid-argument",`event.schemaVersion must be one of ${r.schemaVersions.join(", ")} for ${e.type}`);let userRef=assertValidUserRef(e.userRef);if(r.subject==="pet"&&e.petRef===void 0)throw new t("invalid-argument",`event.petRef is required for ${e.type}`);if(r.subject==="member"&&e.petRef!==void 0)throw new t("invalid-argument",`event.petRef is not accepted on ${e.type}`);let petRef=e.petRef===void 0?void 0:nt(e.petRef);if(typeof e.data!="object"||e.data===null||Array.isArray(e.data))throw new t("invalid-argument","event.data must be an object");let a=e.type==="pet.profile.updated"&&n===2?Ge(e.data):e.data,i={type:e.type,schema_version:n,user_ref:userRef,occurred_at:at(e.occurredAt),data:a};return petRef!==void 0&&(i.pet_ref=petRef),i}function nt(e){try{return assertValidUserRef(e)}catch(e){throw e instanceof t?new t("invalid-argument",`event.petRef follows the user_ref rule: ${e.message}`):e}}function at(e){if(typeof e=="string"&&!Xe.test(e))throw new t("invalid-argument","event.occurredAt must be a Date or an ISO 8601 date-time with an explicit offset (Z or +05:30)");let r=e instanceof Date?e:typeof e=="string"?new Date(e):new Date(Number.NaN);if(Number.isNaN(r.getTime()))throw new t("invalid-argument","event.occurredAt must be a Date or an ISO 8601 date-time with an explicit offset (Z or +05:30)");return r.toISOString()}function it(e){let r;try{r=JSON.stringify(e)}catch{throw new t("invalid-argument","event.data must be JSON-serialisable")}let n=(new TextEncoder).encode(r).byteLength;if(n>Ze)throw new t("invalid-argument",`the event is ${n} bytes once serialised; Everfur accepts at most ${Ze} (32 KB)`);return r}function ot(e,t){if(typeof e!="object"||e===null)return null;let r=e,n=r.id,a=r.type,i=r.schema_version,userRef=r.user_ref,petRef=r.pet_ref??null,o=r.occurred_at,l=r.received_at,s=r.status,d=r.livemode;return typeof n!="string"||n.length===0||!tt(a)||typeof i!="number"||typeof userRef!="string"||petRef!==null&&typeof petRef!="string"||typeof o!="string"||typeof l!="string"||typeof s!="string"||typeof d!="boolean"?null:/* @__PURE__ */Object.freeze({id:n,type:a,schemaVersion:i,userRef:userRef,petRef:petRef,occurredAt:o,receivedAt:l,status:s,livemode:d,idempotencyKey:t})}exports.DEFAULT_WEBHOOK_TOLERANCE_SECONDS=a;exports.EVERFUR_SIGNATURE_HEADER=n;exports.EVERFUR_WEBHOOK_EVENT_TYPES=de;exports.EVERFUR_WEBHOOK_ONLY_EVENT_TYPES=ue;exports.EverfurWebhookVerificationError=d;exports.PARTNER_INBOUND_EVENT_TYPES=pe;exports.constructEvent=constructEvent;exports.generateTestSignatureHeader=generateTestSignatureHeader;exports.isEverfurWebhookEvent=isEverfurWebhookEvent;exports.isEverfurWebhookEventType=isEverfurWebhookEventType;exports.sendPartnerEvent=sendPartnerEvent;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { P as PartnerPetProfile } from '../../pets.d-
|
|
2
|
+
import { P as PartnerPetProfile } from '../../pets.d-DXhzTNuI.cjs';
|
|
3
3
|
import { E as EverfurResult } from '../../EverfurResult.d-BFH-3s6E.cjs';
|
|
4
|
-
import { k as FetchLike } from '../../config.d-
|
|
4
|
+
import { k as FetchLike } from '../../config.d-ClAI2RZ6.cjs';
|
|
5
5
|
export { b as PetActivityLevel, c as PetAllergy, d as PetAllergySeverity, e as PetBirthDatePrecision, f as PetCondition, P as PetHealthProfileInput, g as PetIndoorOutdoor, h as PetMedication, i as PetSex } from '../../profile.d-CSs1wlXT.cjs';
|
|
6
6
|
import '../../EverfurError.d-8NHtlgzA.cjs';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { P as PartnerPetProfile } from '../../pets.d-
|
|
2
|
+
import { P as PartnerPetProfile } from '../../pets.d-BpLObpfM.js';
|
|
3
3
|
import { E as EverfurResult } from '../../EverfurResult.d-D_-254ZY.js';
|
|
4
|
-
import { k as FetchLike } from '../../config.d-
|
|
4
|
+
import { k as FetchLike } from '../../config.d-B7Z-KTGq.js';
|
|
5
5
|
export { b as PetActivityLevel, c as PetAllergy, d as PetAllergySeverity, e as PetBirthDatePrecision, f as PetCondition, P as PetHealthProfileInput, g as PetIndoorOutdoor, h as PetMedication, i as PetSex } from '../../profile.d-CSs1wlXT.js';
|
|
6
6
|
import '../../EverfurError.d-8NHtlgzA.js';
|
|
7
7
|
|