@everfur/sdk 0.8.0 → 0.9.1
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/CHANGELOG.md +91 -0
- package/README.md +1 -1
- package/dist/{Chat-Cv9EYMYA.d.ts → Chat-BoVmqEeF.d.ts} +3 -3
- package/dist/{Chat-s2vcPbw3.d.cts → Chat-DbHkTbqz.d.cts} +3 -3
- package/dist/{DepthViews-DNRY0Ugm.d.ts → DepthViews-BzwflaJ3.d.ts} +1 -1
- package/dist/{DepthViews-Cz7mSW7p.d.cts → DepthViews-Chyp69Ue.d.cts} +1 -1
- package/dist/{DepthViews-DvNixbxg.d.cts → DepthViews-DK7EJ6Hp.d.cts} +1 -1
- package/dist/{DepthViews-CVxUHOJ-.d.ts → DepthViews-yO1H371y.d.ts} +1 -1
- package/dist/{ErrorPolicyPort-NFDPe-5w.d.cts → ErrorPolicyPort-10s3HJCt.d.cts} +1 -1
- package/dist/{ErrorPolicyPort-DwSnmGcX.d.ts → ErrorPolicyPort-C3nNSS_j.d.ts} +1 -1
- package/dist/{EverfurError-pEXDbUJ1.d.cts → EverfurError-DeBqRpQV.d.cts} +1 -1
- package/dist/{EverfurError-pEXDbUJ1.d.ts → EverfurError-DeBqRpQV.d.ts} +1 -1
- package/dist/{EverfurResult-dtl8ERAw.d.cts → EverfurResult-COlXj1wq.d.cts} +1 -1
- package/dist/{EverfurResult-sKkoXew0.d.ts → EverfurResult-ClPTS0P2.d.ts} +1 -1
- package/dist/{IntakeMedia-BFZfBLjB.d.cts → IntakeMedia-B-_vA9ZB.d.cts} +2 -1
- package/dist/{IntakeMedia-C8GlN_GK.d.ts → IntakeMedia-CIoTXAWs.d.ts} +2 -1
- package/dist/animations/index.cjs +2 -2
- package/dist/animations/index.d.cts +6 -6
- package/dist/animations/index.d.ts +6 -6
- package/dist/animations/index.js +2 -2
- package/dist/{attachments-y3EcOX_w.d.cts → attachments-B7TrtyfH.d.cts} +3 -3
- package/dist/{attachments-y_aO4hlk.d.ts → attachments-BmMrn9tU.d.ts} +7 -7
- package/dist/{attachments-BaslXMdS.d.ts → attachments-Dcb19rMP.d.ts} +3 -3
- package/dist/{attachments-DbFwz4iq.d.cts → attachments-Dnpqk1Gl.d.cts} +7 -7
- package/dist/{bookingCopy-4i1R7klo.d.cts → bookingCopy-C153FHEC.d.cts} +7 -6
- package/dist/{bookingCopy-B3UMITD-.d.ts → bookingCopy-DR0-SmqH.d.ts} +7 -6
- package/dist/{branding-BwEu68C8.d.cts → branding-BCfwLj0h.d.cts} +99 -6
- package/dist/{branding-BYEqU855.d.ts → branding-DJf4h12Q.d.ts} +99 -6
- package/dist/{callRoom-B1qq_D-4.d.ts → callRoom-B92eH_ij.d.ts} +1 -1
- package/dist/{callRoom-DfZTWFXh.d.cts → callRoom-BhIdadyV.d.cts} +1 -1
- package/dist/{casesRepository-SI0zp5YH.d.ts → casesRepository-BXdwCWQF.d.ts} +2 -2
- package/dist/{casesRepository-B6Z0XBIb.d.cts → casesRepository-DC9lEQez.d.cts} +2 -2
- package/dist/chat/index.cjs +27 -25
- package/dist/chat/index.d.cts +12 -12
- package/dist/chat/index.d.ts +12 -12
- package/dist/chat/index.js +27 -25
- package/dist/client/index.cjs +8 -8
- package/dist/client/index.d.cts +14 -14
- package/dist/client/index.d.ts +14 -14
- package/dist/client/index.js +8 -8
- package/dist/{config-v5k6NsK_.d.cts → config-BRyNmzhx.d.cts} +3 -3
- package/dist/{config-Cvo47voG.d.ts → config-DdK2czhD.d.ts} +3 -3
- package/dist/consent/index.cjs +3 -3
- package/dist/consent/index.d.cts +9 -9
- package/dist/consent/index.d.ts +9 -9
- package/dist/consent/index.js +3 -3
- package/dist/{context-cZ7NZ0sG.d.ts → context-_EyjBNKI.d.ts} +9 -9
- package/dist/{context-BZOtJbBO.d.cts → context-jaONuHXM.d.cts} +9 -9
- package/dist/{copy-CZBUHbyS.d.ts → copy-BJpRsqK-.d.ts} +5 -5
- package/dist/{copy-ChJupm1p.d.cts → copy-D8iSBQE6.d.cts} +5 -5
- package/dist/core/index.cjs +5 -5
- package/dist/core/index.d.cts +19 -19
- package/dist/core/index.d.ts +19 -19
- package/dist/core/index.js +5 -5
- package/dist/{depth-CRyU7-pf.d.cts → depth-DJ1KGMww.d.cts} +6 -6
- package/dist/{depth-vNpwOkZ8.d.ts → depth-bKpg3L9r.d.ts} +6 -6
- package/dist/{entitlementRepository-Bv8nSYRd.d.cts → entitlementRepository-4x_tBE73.d.cts} +4 -4
- package/dist/{entitlementRepository-CUdxbQrP.d.ts → entitlementRepository-CojBLazH.d.ts} +4 -4
- package/dist/{identity-B8GkH53J.d.ts → identity-A8fVB518.d.ts} +2 -2
- package/dist/{identity-BHaMJ3KK.d.cts → identity-CmxZ4GR0.d.cts} +2 -2
- package/dist/index.cjs +31 -29
- package/dist/index.d.cts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +31 -29
- package/dist/{models-DzvqEjMm.d.cts → models-A4A5S7AG.d.cts} +1 -1
- package/dist/{models-CrbUwbuS.d.ts → models-CnXY5LuO.d.ts} +1 -1
- package/dist/notifications/index.cjs +1 -1
- package/dist/notifications/index.d.cts +5 -5
- package/dist/notifications/index.d.ts +5 -5
- package/dist/notifications/index.js +1 -1
- package/dist/{pets-BI7Ji8hi.d.cts → pets-DjBlY7yg.d.cts} +2 -2
- package/dist/{pets-Dnn-DK1T.d.ts → pets-e5RjSP6O.d.ts} +2 -2
- package/dist/{petsRepository-B2lO1sKS.d.ts → petsRepository-CQh8paML.d.ts} +2 -2
- package/dist/{petsRepository-BP9nhM1R.d.cts → petsRepository-DkQ2fwZY.d.cts} +2 -2
- package/dist/photo/index.cjs +2 -2
- package/dist/photo/index.d.cts +3 -3
- package/dist/photo/index.d.ts +3 -3
- package/dist/photo/index.js +2 -2
- package/dist/{ports-C40S2V14.d.cts → ports-2voZkqty.d.cts} +7 -7
- package/dist/{ports-BUXF0Rp3.d.ts → ports-CzVBbI_A.d.ts} +7 -7
- package/dist/records/depth/index.cjs +7 -7
- package/dist/records/depth/index.d.cts +11 -11
- package/dist/records/depth/index.d.ts +11 -11
- package/dist/records/depth/index.js +7 -7
- package/dist/records/index.cjs +33 -33
- package/dist/records/index.d.cts +14 -14
- package/dist/records/index.d.ts +14 -14
- package/dist/records/index.js +33 -33
- package/dist/{requestFunnel-BxNVGyGm.d.cts → requestFunnel-CA0ANsWj.d.cts} +5 -5
- package/dist/{requestFunnel-BrOijMcw.d.ts → requestFunnel-CQ42Kf9G.d.ts} +5 -5
- package/dist/{runtimeTypes-DOO3f-W-.d.cts → runtimeTypes-BxtQXaYi.d.cts} +7 -7
- package/dist/{runtimeTypes-CvI1ZH8j.d.ts → runtimeTypes-C0tI7s-V.d.ts} +7 -7
- package/dist/server/events/index.cjs +2 -2
- package/dist/server/events/index.d.cts +4 -4
- package/dist/server/events/index.d.ts +4 -4
- package/dist/server/events/index.js +2 -2
- package/dist/server/index.cjs +2 -2
- package/dist/server/index.d.cts +5 -5
- package/dist/server/index.d.ts +5 -5
- package/dist/server/index.js +2 -2
- package/dist/televet/booking/index.cjs +20 -17
- package/dist/televet/booking/index.d.cts +12 -12
- package/dist/televet/booking/index.d.ts +12 -12
- package/dist/televet/booking/index.js +20 -17
- package/dist/televet/call/index.cjs +1 -1
- package/dist/televet/call/index.d.cts +2 -2
- package/dist/televet/call/index.d.ts +2 -2
- package/dist/televet/call/index.js +1 -1
- package/dist/televet/index.cjs +3 -3
- package/dist/televet/index.d.cts +7 -7
- package/dist/televet/index.d.ts +7 -7
- package/dist/televet/index.js +3 -3
- package/dist/testing/index.cjs +2 -2
- package/dist/testing/index.d.cts +3 -3
- package/dist/testing/index.d.ts +3 -3
- package/dist/testing/index.js +2 -2
- package/dist/testing/rn/index.cjs +2 -2
- package/dist/testing/rn/index.d.cts +13 -13
- package/dist/testing/rn/index.d.ts +13 -13
- package/dist/testing/rn/index.js +2 -2
- package/dist/testing/web/index.cjs +1 -1
- package/dist/testing/web/index.d.cts +14 -14
- package/dist/testing/web/index.d.ts +14 -14
- package/dist/testing/web/index.js +1 -1
- package/dist/{timelineRows-CEx2TzYB.d.ts → timelineRows-GSpzKLla.d.ts} +1 -1
- package/dist/{timelineRows-Dffceql_.d.cts → timelineRows-WFv_3EOi.d.cts} +1 -1
- package/dist/{tokens-Tzo1KBND.d.cts → tokens-DLj8OnLH.d.cts} +51 -6
- package/dist/{tokens-Tzo1KBND.d.ts → tokens-DLj8OnLH.d.ts} +51 -6
- package/dist/{typeStyle-C3IG9Sft.d.ts → typeStyle-BxVyF71R.d.ts} +11 -3
- package/dist/{typeStyle-CZ3Tj60N.d.cts → typeStyle-DJedEu14.d.cts} +11 -3
- package/dist/{useRecordsDepth-D6a6-_u_.d.cts → useRecordsDepth-BL5Pf3oK.d.cts} +4 -4
- package/dist/{useRecordsDepth-DuPUJFDQ.d.ts → useRecordsDepth-BQF0Zynl.d.ts} +4 -4
- package/dist/{useVetVisit-RPBOabl8.d.ts → useVetVisit-DmWa7lt1.d.ts} +2 -2
- package/dist/{useVetVisit-BQX_aTJs.d.cts → useVetVisit-PtBjNwZr.d.cts} +2 -2
- package/dist/video/index.cjs +2 -2
- package/dist/video/index.d.cts +3 -3
- package/dist/video/index.d.ts +3 -3
- package/dist/video/index.js +2 -2
- package/dist/{view-UFwCG1Pn.d.cts → view-D3kOelPL.d.cts} +5 -5
- package/dist/{view-BSmN5RWf.d.ts → view-rgB1iqWO.d.ts} +5 -5
- package/dist/web/consent/index.cjs +3 -3
- package/dist/web/consent/index.d.cts +9 -9
- package/dist/web/consent/index.d.ts +9 -9
- package/dist/web/consent/index.js +3 -3
- package/dist/web/index.cjs +35 -34
- package/dist/web/index.d.cts +29 -23
- package/dist/web/index.d.ts +29 -23
- package/dist/web/index.js +35 -34
- package/dist/web/notifications/index.cjs +1 -1
- 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 +10 -9
- package/dist/web/records/depth/index.d.cts +11 -11
- package/dist/web/records/depth/index.d.ts +11 -11
- package/dist/web/records/depth/index.js +10 -9
- package/dist/web/records/index.cjs +54 -51
- package/dist/web/records/index.d.cts +15 -15
- package/dist/web/records/index.d.ts +15 -15
- package/dist/web/records/index.js +55 -52
- package/dist/web/televet/booking/index.cjs +24 -22
- package/dist/web/televet/booking/index.d.cts +18 -15
- package/dist/web/televet/booking/index.d.ts +18 -15
- package/dist/web/televet/booking/index.js +24 -22
- 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 +2 -2
- package/dist/web/televet/index.d.cts +5 -5
- package/dist/web/televet/index.d.ts +5 -5
- package/dist/web/televet/index.js +2 -2
- package/package.json +1 -1
|
@@ -88,7 +88,7 @@ return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _Everf
|
|
|
88
88
|
/* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
89
89
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
90
90
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
91
|
-
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__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",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"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(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",USER_FACING_COPY=/* @__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:ACCESS_DENIED_COPY,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:
|
|
91
|
+
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__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",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__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(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function errorFrame(fields){/* @__PURE__ */
|
|
92
92
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
93
93
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
94
94
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function serverLength(value){return[...value].length}var KNOWN_STATUSES=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review","published","failed","revoked"]),STATUS_ALIASES=/* @__PURE__ */Object.freeze({submitted:"requested",sent:"requested",dispatching:"requested",awaiting_response:"awaiting_clinic",clinic_responded_no_records:"awaiting_clinic",records_received:"received",parsing_failed:"in_review",review_email_failed:"in_review",clinic_declined:"failed"});function normalizeStatus(raw){let aliased=Object.prototype.hasOwnProperty.call(STATUS_ALIASES,raw)?STATUS_ALIASES[raw]:void 0;if(aliased!==void 0)return aliased;let value=raw;return KNOWN_STATUSES.has(value)?value:"parsing"}var requestSchema=/* @__PURE__ */zod.z.object({request_id:/* @__PURE__ */zod.z.string().min(1),pet_ref:/* @__PURE__ */zod.z.string().min(1),status:/* @__PURE__ */zod.z.string(),simple_status:/* @__PURE__ */zod.z.string().nullish(),simple_status_detail:/* @__PURE__ */zod.z.string().nullish(),status_label:/* @__PURE__ */zod.z.string().optional(),dispatch_status:/* @__PURE__ */zod.z.string().nullish(),can_retry_send:/* @__PURE__ */zod.z.boolean().optional(),can_revoke:/* @__PURE__ */zod.z.boolean().optional(),can_convert_to_upload:/* @__PURE__ */zod.z.boolean().optional(),can_update_clinic_email:/* @__PURE__ */zod.z.boolean().optional(),reminder_count:/* @__PURE__ */zod.z.number().int().nonnegative().optional(),last_reminder_at:/* @__PURE__ */zod.z.string().nullish(),waiting_expectation:/* @__PURE__ */zod.z.string().nullish(),document_count:/* @__PURE__ */zod.z.number().optional(),held_item_count:/* @__PURE__ */zod.z.number().optional(),received_at:/* @__PURE__ */zod.z.string().nullish(),parsing_started_at:/* @__PURE__ */zod.z.string().nullish(),review_started_at:/* @__PURE__ */zod.z.string().nullish(),created_at:/* @__PURE__ */zod.z.string().optional(),updated_at:/* @__PURE__ */zod.z.string().optional(),source:/* @__PURE__ */zod.z.string().nullish().catch(null),action_needed_label:/* @__PURE__ */zod.z.string().nullish().catch(null),failure_reason:/* @__PURE__ */zod.z.string().nullish().catch(null),failure_code:/* @__PURE__ */zod.z.string().nullish().catch(null),recovery_stage:/* @__PURE__ */zod.z.string().nullish().catch(null),show_clinic_phone:/* @__PURE__ */zod.z.boolean().optional().catch(void 0),clinic_name:/* @__PURE__ */zod.z.string().nullish().catch(null),clinic_email:/* @__PURE__ */zod.z.string().nullish().catch(null),clinic_phone:/* @__PURE__ */zod.z.string().nullish().catch(null),converted_to_upload_at:/* @__PURE__ */zod.z.string().nullish().catch(null),request_group_id:/* @__PURE__ */zod.z.string().nullish().catch(null)}).passthrough();function mapRequestView(wire){let parsed=requestSchema.safeParse(wire);if(!parsed.success)return null;let w=parsed.data,simpleStatus=normalizeSimpleStatus(w.simple_status),status=simpleStatus==="requested"&&(w.status==="awaiting_upload"||w.simple_status_detail==="awaiting_owner_upload")?"awaiting_upload":simpleStatus==="parsing"&&(w.simple_status_detail==="in_review"||w.simple_status_detail==="review_email_failed")?"in_review":simpleStatus??normalizeStatus(w.status);/* @__PURE__ */
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { E as EntitlementSnapshot } from '../../runtimeTypes-
|
|
2
|
-
import { E as EverfurResult } from '../../EverfurResult-
|
|
1
|
+
import { E as EntitlementSnapshot } from '../../runtimeTypes-BxtQXaYi.cjs';
|
|
2
|
+
import { E as EverfurResult } from '../../EverfurResult-COlXj1wq.cjs';
|
|
3
3
|
import { R as RecordsRequestId, P as PetRef } from '../../ids-B2GAAifq.cjs';
|
|
4
4
|
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.cjs';
|
|
5
|
-
import { d as RecordsRequestView } from '../../models-
|
|
6
|
-
export { c as RecordsRequestStatus, e as RecordsSimpleStatus } from '../../models-
|
|
7
|
-
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-
|
|
8
|
-
export {
|
|
5
|
+
import { d as RecordsRequestView } from '../../models-A4A5S7AG.cjs';
|
|
6
|
+
export { c as RecordsRequestStatus, e as RecordsSimpleStatus } from '../../models-A4A5S7AG.cjs';
|
|
7
|
+
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DeBqRpQV.cjs';
|
|
8
|
+
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens-DLj8OnLH.cjs';
|
|
9
|
+
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding-BCfwLj0h.cjs';
|
|
9
10
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.cjs';
|
|
10
|
-
import '../../petsRepository-
|
|
11
|
-
import '../../identity-
|
|
12
|
-
import '../../config-
|
|
11
|
+
import '../../petsRepository-DkQ2fwZY.cjs';
|
|
12
|
+
import '../../identity-CmxZ4GR0.cjs';
|
|
13
|
+
import '../../config-BRyNmzhx.cjs';
|
|
13
14
|
import '../../profile-CSs1wlXT.cjs';
|
|
14
15
|
import '../../cacheEpoch-DknKn3S0.cjs';
|
|
15
|
-
import '../../ErrorPolicyPort-
|
|
16
|
-
import '../../ports-
|
|
17
|
-
import '../../casesRepository-
|
|
18
|
-
import '../../requestFunnel-
|
|
16
|
+
import '../../ErrorPolicyPort-10s3HJCt.cjs';
|
|
17
|
+
import '../../ports-2voZkqty.cjs';
|
|
18
|
+
import '../../casesRepository-DC9lEQez.cjs';
|
|
19
|
+
import '../../requestFunnel-CA0ANsWj.cjs';
|
|
19
20
|
import '../../TelemetryPort-BDNr00hu.cjs';
|
|
20
21
|
import '../../ports-BN6RHF9W.cjs';
|
|
21
22
|
import '../../CameraPort-Cv31Pz7g.cjs';
|
|
22
|
-
import '../../tokens-Tzo1KBND.cjs';
|
|
23
23
|
|
|
24
24
|
/** The testing seam handle: apply a resolved verdict to THIS provider's runtime. */
|
|
25
25
|
interface EverfurTestEntitlements {
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { E as EntitlementSnapshot } from '../../runtimeTypes-
|
|
2
|
-
import { E as EverfurResult } from '../../EverfurResult-
|
|
1
|
+
import { E as EntitlementSnapshot } from '../../runtimeTypes-C0tI7s-V.js';
|
|
2
|
+
import { E as EverfurResult } from '../../EverfurResult-ClPTS0P2.js';
|
|
3
3
|
import { R as RecordsRequestId, P as PetRef } from '../../ids-B2GAAifq.js';
|
|
4
4
|
export { B as Brand, _ as __brand } from '../../ids-B2GAAifq.js';
|
|
5
|
-
import { d as RecordsRequestView } from '../../models-
|
|
6
|
-
export { c as RecordsRequestStatus, e as RecordsSimpleStatus } from '../../models-
|
|
7
|
-
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-
|
|
8
|
-
export {
|
|
5
|
+
import { d as RecordsRequestView } from '../../models-CnXY5LuO.js';
|
|
6
|
+
export { c as RecordsRequestStatus, e as RecordsSimpleStatus } from '../../models-CnXY5LuO.js';
|
|
7
|
+
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode } from '../../EverfurError-DeBqRpQV.js';
|
|
8
|
+
export { c as EverfurFontSource, d as EverfurFontWeight } from '../../tokens-DLj8OnLH.js';
|
|
9
|
+
export { C as ClientBranding, R as RadiusScale, S as SurfaceStyle } from '../../branding-DJf4h12Q.js';
|
|
9
10
|
export { b as CapabilityDisabled, D as DisabledLevel, E as EntitlementDecision } from '../../resolve-D4Ywz5OS.js';
|
|
10
|
-
import '../../petsRepository-
|
|
11
|
-
import '../../identity-
|
|
12
|
-
import '../../config-
|
|
11
|
+
import '../../petsRepository-CQh8paML.js';
|
|
12
|
+
import '../../identity-A8fVB518.js';
|
|
13
|
+
import '../../config-DdK2czhD.js';
|
|
13
14
|
import '../../profile-CSs1wlXT.js';
|
|
14
15
|
import '../../cacheEpoch-DknKn3S0.js';
|
|
15
|
-
import '../../ErrorPolicyPort-
|
|
16
|
-
import '../../ports-
|
|
17
|
-
import '../../casesRepository-
|
|
18
|
-
import '../../requestFunnel-
|
|
16
|
+
import '../../ErrorPolicyPort-C3nNSS_j.js';
|
|
17
|
+
import '../../ports-CzVBbI_A.js';
|
|
18
|
+
import '../../casesRepository-BXdwCWQF.js';
|
|
19
|
+
import '../../requestFunnel-CQ42Kf9G.js';
|
|
19
20
|
import '../../TelemetryPort-BDNr00hu.js';
|
|
20
21
|
import '../../ports-BN6RHF9W.js';
|
|
21
22
|
import '../../CameraPort-Cv31Pz7g.js';
|
|
22
|
-
import '../../tokens-Tzo1KBND.js';
|
|
23
23
|
|
|
24
24
|
/** The testing seam handle: apply a resolved verdict to THIS provider's runtime. */
|
|
25
25
|
interface EverfurTestEntitlements {
|
|
@@ -88,7 +88,7 @@ return Object.freeze({ok:false,error:error})}var EverfurConfigError=class _Everf
|
|
|
88
88
|
/* @__PURE__ */Object.freeze({wireCode:"verify_user_ref_invalid",envelope:"http_envelope",httpStatus:422,retryable:false}),
|
|
89
89
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_empty",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
90
90
|
/* @__PURE__ */Object.freeze({wireCode:"webhook_endpoint_update_invalid",envelope:"http_envelope",httpStatus:400,retryable:false}),
|
|
91
|
-
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__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",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__PURE__ */Object.freeze({authExpired:"authentication",authRejected:"authentication",sessionRequired:"authentication",identitySignatureRequired:"authentication",accessDenied:"authorization",paymentRequired:"entitlement",quotaExceeded:"rateLimit",rateLimited:"rateLimit",validationFailed:"invalidRequest",sdkUpdateRequired:"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(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",USER_FACING_COPY=/* @__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:ACCESS_DENIED_COPY,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:
|
|
91
|
+
/* @__PURE__ */Object.freeze({wireCode:"webhook_url_rejected",envelope:"http_envelope",httpStatus:400,retryable:false})]);/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(row=>row.wireCode));var NORMALIZED_FOLD=/* @__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",accessDenied:"accessDenied",invalidRequest:"sdkUpdateRequired",authRejected:"authRejected",rateLimited:"rateLimited",insufficientCapability:"accessDenied",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"}),CONTRACT_ERROR_ROWS=/* @__PURE__ */Object.freeze(CONTRACT_RETRYABILITY.map(generated=>/* @__PURE__ */Object.freeze({wireCode:generated.wireCode,envelope:generated.envelope,retryable:generated.retryable,normalized:NORMALIZED_FOLD[generated.wireCode]}))),BY_KEY=new Map(CONTRACT_ERROR_ROWS.map(r=>[r.envelope+r.wireCode.toUpperCase(),r])),ENVELOPE_LOOKUP_ORDER=/* @__PURE__ */Object.freeze(["http_envelope",...[...new Set(CONTRACT_ERROR_ROWS.map(r=>r.envelope))].filter(e=>e!=="http_envelope").sort()]);function contractErrorFor(wireCode,envelope){if(typeof wireCode!="string")return;let key=wireCode.trim().toUpperCase();if(key.length!==0)for(let candidate of[envelope??"http_envelope",...ENVELOPE_LOOKUP_ORDER]){let row=BY_KEY.get(candidate+key);if(row)return row}}var CATEGORY_OF=/* @__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(code){return CATEGORY_OF[code]}function fromWire(wire){let contractRow=contractErrorFor(wire);if(contractRow)return contractRow.normalized;let upper=(wire??"").trim().toUpperCase(),canonical=upper.replace(/[^A-Z0-9]/g,"");if(canonical==="AUTHREJECTED")return"authRejected";if(upper.startsWith("AUTH"))return"authExpired";switch(canonical){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"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"}}var AUTO_RETRYABLE_CODES=/* @__PURE__ */new Set(["streamTimeout","rateLimited","internalError","upstreamLlmTimeout","streamIncomplete"]);function isAutoRetryable(code){return AUTO_RETRYABLE_CODES.has(code)}var RETRYABLE_CONTRACT_CODES=/* @__PURE__ */new Set(["serviceUnavailable","conflict","idempotencyInFlight"]);function isRetryableCode(code){return isAutoRetryable(code)||RETRYABLE_CONTRACT_CODES.has(code)}var BACKOFF_BASE_MS=500,BACKOFF_CAP_MS=8e3,MAX_RETRY_ATTEMPTS=4;function backoffDelayMs(attempt,rng=Math.random){let bounded=Math.max(0,attempt),ceiling=Math.min(BACKOFF_BASE_MS*2**bounded,BACKOFF_CAP_MS);return Math.floor(rng()*ceiling)}var ACCESS_DENIED_COPY="This feature isn't available on your account right now.",VALIDATION_FAILED_COPY="Something in that request was not right. Check the details and try again.",USER_FACING_COPY=/* @__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:ACCESS_DENIED_COPY,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:VALIDATION_FAILED_COPY,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:ACCESS_DENIED_COPY,runtimeDisposed:VALIDATION_FAILED_COPY,unknown:"Something went wrong. Please try again."});function userFacingError(code){return USER_FACING_COPY[code]}function defineHidden(target,key,value){Object.defineProperty(target,key,{value:value,enumerable:false,writable:false,configurable:false})}var REASON_CODE_SHAPE=/^[a-z][a-z0-9_]{0,63}$/;function makeEverfurError(code,opts){let row=contractErrorFor(opts?.wireCode,opts?.wireEnvelope),error={code:code,category:categoryFor(code),retryable:opts?.retryable??isRetryableCode(code),displayMessage:userFacingError(code)};opts?.httpStatus!==void 0&&(error.httpStatus=opts.httpStatus),opts?.requestId&&(error.requestId=opts.requestId),typeof opts?.reasonCode=="string"&&REASON_CODE_SHAPE.test(opts.reasonCode)&&(error.reasonCode=opts.reasonCode);let wait=opts?.retryAfterSeconds;if(typeof wait=="number"&&Number.isFinite(wait)&&wait>=0&&(error.retryAfterSeconds=Math.round(wait)),row);return opts?.wireMessage&&defineHidden(error,"wireMessage",opts.wireMessage),opts?.raw!==void 0&&opts.raw!==null&&defineHidden(error,"raw",opts.raw),/* @__PURE__ */Object.freeze(error)}function errorFrame(fields){/* @__PURE__ */
|
|
92
92
|
return Object.freeze({kind:"error",terminal:true,code:fields.code,retryable:fields.retryable,wireMessage:fields.wireMessage,synthesized:fields.synthesized,lastEventId:fields.lastEventId,serverRequestId:null})}function authHeaders(auth){let headers={};return auth.mode==="personalized"?headers.authorization=`Bearer ${auth.token}`:headers["x-everfur-partner-key"]=auth.publishableKey,auth.userRef&&(headers["x-everfur-user-ref"]=auth.userRef),auth.sessionId&&(headers["x-everfur-session-id"]=auth.sessionId),headers}function withAuthHeaders(req,auth){return{...req,headers:{...stripAuthHeaders(req.headers),...authHeaders(auth)}}}function stripAuthHeaders(headers){if(!headers)return{};let out={};for(let[key,value]of Object.entries(headers)){let lower=key.toLowerCase();lower==="authorization"||lower==="x-everfur-partner-key"||(out[key]=value)}return out}async function authedSend(req,ctx){if(ctx.mode==="anonymous")return ctx.transport.request(withAuthHeaders(req,{mode:"anonymous",publishableKey:ctx.publishableKey,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));let token;try{token=await ctx.identity.currentToken()}catch{return err(authRejectedError())}let first=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:token,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));if(first.ok||first.error.httpStatus!==401)return first;let refreshed;try{refreshed=await ctx.identity.currentToken({forceRefresh:!0})}catch{return err(authRejectedError())}let retry=await ctx.transport.request(withAuthHeaders(req,{mode:"personalized",token:refreshed,userRef:ctx.userRef,...ctx.sessionId?{sessionId:ctx.sessionId}:{}}));return!retry.ok&&retry.error.httpStatus===401?err(authRejectedError(retry.error.httpStatus)):retry}function authRejectedError(httpStatus){return makeEverfurError("authRejected",{retryable:false,...httpStatus!==void 0?{httpStatus:httpStatus}:{}})}function networkError(cause){return makeEverfurError("internalError",{retryable:true,wireMessage:describeCause(cause)})}function describeCause(cause){return cause instanceof Error?cause.message:typeof cause=="string"?cause:"network request failed"}var FUNNEL_UNARY_TIMEOUT_MS=3e4,RETRY_OVERRIDE_MAX_MS=BACKOFF_CAP_MS*2,IDEMPOTENCY_HEADER="idempotency-key",MUTATING_METHODS=/* @__PURE__ */new Set(["POST","PUT","PATCH","DELETE"]),NOOP_OBSERVER=/* @__PURE__ */Object.freeze({onEvent(){}}),defaultFunnelTimers=/* @__PURE__ */Object.freeze({setTimeout:(handler,ms)=>setTimeout(handler,ms),clearTimeout:handle=>clearTimeout(handle),now:()=>Date.now()});function seededIdempotencyKey(seed){let safe=seed.trim().replace(/[^A-Za-z0-9_.:-]/g,"-");return safe.length===0?null:`efs_${safe}`.slice(0,128)}function createRequestFunnel(deps){let observer=deps.observer??NOOP_OBSERVER,timers=deps.timers??defaultFunnelTimers,rng=deps.rng??Math.random,sleep=deps.sleep??((ms,signal)=>delayAbortable(ms,timers,signal)),ceiling=deps.maxAttempts??MAX_RETRY_ATTEMPTS,timeoutMs=deps.unaryTimeoutMs??FUNNEL_UNARY_TIMEOUT_MS,mintKey=deps.newIdempotencyKey??defaultIdempotencyKeyFactory(),emit=event=>{try{observer.onEvent(event)}catch{}};async function send(call,req,opts){let perCallMaxAttempts=opts?.maxAttempts,maxAttempts=Math.max(1,perCallMaxAttempts??ceiling),idempotent=opts?.idempotent??MUTATING_METHODS.has(req.method),seeded=opts?.idempotencyKey===void 0?null:seededIdempotencyKey(opts.idempotencyKey),idempotencyKey=idempotent?seeded??mintKey():null,base=assembleHeaders(req,idempotencyKey),attempt=0;for(;;){let stamp=extra=>/* @__PURE__ */Object.freeze({call:call,method:req.method,path:req.path,attempt:attempt,...idempotencyKey?{idempotencyKey:idempotencyKey}:{},...extra});emit(stamp({phase:"attempt"}));let deadline=boundedSignal(timeoutMs,timers),merged=mergeSignals(deadline.signal,req.signal),settled;try{settled=await authedSend({...base,signal:merged.signal},deps.auth)}catch(cause){settled=err(networkError(cause))}finally{merged.dispose(),deadline.cancel()}if(settled.ok)return emit(stamp({phase:"settled",ok:true,reason:"ok"})),settled;let error=settled.error,decision=decideRetry(error,attempt,{maxAttempts:maxAttempts,rng:rng,now:timers.now(),aborted:req.signal?.aborted===true,...perCallMaxAttempts!==void 0?{perCallMaxAttempts:perCallMaxAttempts}:{},...deps.errorPolicy!==void 0?{policy:deps.errorPolicy}:{}}),settledEvent={ok:false,code:error.code,reason:decision.reason,...error.httpStatus!==void 0?{httpStatus:error.httpStatus}:{},...error.requestId!==void 0?{requestId:error.requestId}:{}};if(!decision.retry)return emit(stamp({phase:"settled",...settledEvent})),err(error);if(emit(stamp({phase:"retry",...settledEvent,delayMs:decision.delayMs})),await sleep(decision.delayMs,req.signal),req.signal?.aborted===true)return emit(stamp({phase:"settled",...settledEvent,reason:"aborted"})),err(error);attempt+=1}}async function authorize(req){return withAuthHeaders(req,await resolveDeviceAuth(deps.auth))}async function*stream(call,req,signal){emit(
|
|
93
93
|
/* @__PURE__ */Object.freeze({call:call,phase:"stream.open",method:req.method,path:req.path,attempt:0}));try{yield*deps.auth.transport.stream(req,signal)}catch{yield errorFrame({code:"internal_error",retryable:true,wireMessage:null,synthesized:true,lastEventId:null})}}/* @__PURE__ */
|
|
94
94
|
return Object.freeze({send:send,authorize:authorize,stream:stream})}function assembleHeaders(req,idempotencyKey){let headers={};for(let[key,value]of Object.entries(req.headers??{}))key.toLowerCase()!==IDEMPOTENCY_HEADER&&(headers[key]=value);return idempotencyKey!==null&&(headers["Idempotency-Key"]=idempotencyKey),{...req,headers:headers}}function defaultIdempotencyKeyFactory(){let counter=0;return()=>`efk_${Date.now().toString(36)}_${(counter++).toString(36)}_${Math.random().toString(36).slice(2,12)}`}var POLICY_MAX_ATTEMPTS_CAP=10;function decideRetry(error,attempt,ctx){if(ctx.aborted)return{retry:false,reason:"aborted"};let throttle=throttleKind(error);if(throttle==="quota")return{retry:false,reason:"daily-quota-exhausted"};if(throttle!=="burst"&&!isAutoRetryable(error.code))return{retry:false,reason:"terminal-code"};let reason=throttle==="burst"?"burst-throttle":"retryable-code";if((()=>{if(ctx.policy===void 0)return false;try{return!ctx.policy.shouldRetry(error.code,attempt)}catch{return false}})())return{retry:false,reason:"terminal-code"};let policyCeiling=()=>{if(ctx.policy===void 0)return null;let raw;try{raw=ctx.policy.maxAttempts(error.code)}catch{return null}return typeof raw!="number"||!Number.isFinite(raw)?null:Math.max(1,Math.min(POLICY_MAX_ATTEMPTS_CAP,Math.floor(raw)))},ceiling=ctx.perCallMaxAttempts??policyCeiling()??ctx.maxAttempts;if(attempt+1>=ceiling)return{retry:false,reason:"attempts-exhausted"};let override=retryOverrideMs(error,ctx.now);return override!==null?override>RETRY_OVERRIDE_MAX_MS?{retry:false,reason:"server-reset-beyond-budget"}:{retry:true,reason:reason,delayMs:override}:{retry:true,reason:reason,delayMs:backoffDelayMs(attempt,ctx.rng)}}function throttleKind(error){let code=error.code==="unknown"?fromWire(rawWireCode(error.raw)):error.code;return code==="quotaExceeded"?"quota":code==="rateLimited"||error.httpStatus===429?"burst":null}function retryOverrideMs(error,now){let at=findResetsAt(error.raw);if(at!==null){let delta=at-now;return delta>0?delta:0}let wait=findRetryAfterSeconds(error.raw);return wait===null?null:Math.round(wait*1e3)}function findRetryAfterSeconds(raw){for(let scope of candidateScopes(raw)){let value=scope.retry_after_seconds;if(typeof value=="number"&&Number.isFinite(value)&&value>=0)return value}return null}function findResetsAt(raw){for(let scope of candidateScopes(raw)){let value=scope.resets_at,parsed=parseInstantMs(value);if(parsed!==null)return parsed}return null}function candidateScopes(raw){if(!isRecord(raw))return[];let out=[raw];for(let nested of["error","detail"]){let value=raw[nested];isRecord(value)&&out.push(value)}return out}function parseInstantMs(value){if(typeof value=="number"&&Number.isFinite(value))return value<1e11?Math.round(value*1e3):Math.round(value);if(typeof value=="string"&&value.trim().length>0){let parsed=Date.parse(value);return Number.isFinite(parsed)?parsed:null}return null}function rawWireCode(raw){for(let scope of candidateScopes(raw)){let code=scope.code;if(typeof code=="string"&&code.length>0)return code}return null}function isRecord(value){return typeof value=="object"&&value!==null}async function resolveDeviceAuth(auth){return auth.mode==="anonymous"?{mode:"anonymous",publishableKey:auth.publishableKey,userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}:{mode:"personalized",token:await auth.identity.currentToken(),userRef:auth.userRef,...auth.sessionId?{sessionId:auth.sessionId}:{}}}function boundedSignal(ms,timers){let ctrl=new AbortController,handle=timers.setTimeout(()=>ctrl.abort(),ms);return{signal:ctrl.signal,cancel:()=>timers.clearTimeout(handle)}}function mergeSignals(deadline,caller){let noop=()=>{};if(!caller)return{signal:deadline,dispose:noop};let ctrl=new AbortController;if(deadline.aborted||caller.aborted)return ctrl.abort(),{signal:ctrl.signal,dispose:noop};let onAbort=()=>ctrl.abort();return deadline.addEventListener("abort",onAbort,{once:true}),caller.addEventListener("abort",onAbort,{once:true}),{signal:ctrl.signal,dispose:()=>{deadline.removeEventListener("abort",onAbort),caller.removeEventListener("abort",onAbort)}}}function delayAbortable(ms,timers,signal){return ms<=0||signal?.aborted===true?Promise.resolve():new Promise(resolve=>{let handle=timers.setTimeout(()=>{signal?.removeEventListener("abort",onAbort),resolve()},ms),onAbort=()=>{timers.clearTimeout(handle),resolve()};signal?.addEventListener("abort",onAbort,{once:true})})}function hasLoneSurrogate(value){for(let i=0;i<value.length;i+=1){let code=value.charCodeAt(i);if(code>=55296&&code<=56319){let low=value.charCodeAt(i+1);if(!(low>=56320&&low<=57343))return true;i+=1}else if(code>=56320&&code<=57343)return true}return false}function serverLength(value){return[...value].length}var KNOWN_STATUSES=/* @__PURE__ */new Set(["requested","awaiting_clinic","awaiting_upload","received","parsing","in_review","published","failed","revoked"]),STATUS_ALIASES=/* @__PURE__ */Object.freeze({submitted:"requested",sent:"requested",dispatching:"requested",awaiting_response:"awaiting_clinic",clinic_responded_no_records:"awaiting_clinic",records_received:"received",parsing_failed:"in_review",review_email_failed:"in_review",clinic_declined:"failed"});function normalizeStatus(raw){let aliased=Object.prototype.hasOwnProperty.call(STATUS_ALIASES,raw)?STATUS_ALIASES[raw]:void 0;if(aliased!==void 0)return aliased;let value=raw;return KNOWN_STATUSES.has(value)?value:"parsing"}var requestSchema=/* @__PURE__ */z.object({request_id:/* @__PURE__ */z.string().min(1),pet_ref:/* @__PURE__ */z.string().min(1),status:/* @__PURE__ */z.string(),simple_status:/* @__PURE__ */z.string().nullish(),simple_status_detail:/* @__PURE__ */z.string().nullish(),status_label:/* @__PURE__ */z.string().optional(),dispatch_status:/* @__PURE__ */z.string().nullish(),can_retry_send:/* @__PURE__ */z.boolean().optional(),can_revoke:/* @__PURE__ */z.boolean().optional(),can_convert_to_upload:/* @__PURE__ */z.boolean().optional(),can_update_clinic_email:/* @__PURE__ */z.boolean().optional(),reminder_count:/* @__PURE__ */z.number().int().nonnegative().optional(),last_reminder_at:/* @__PURE__ */z.string().nullish(),waiting_expectation:/* @__PURE__ */z.string().nullish(),document_count:/* @__PURE__ */z.number().optional(),held_item_count:/* @__PURE__ */z.number().optional(),received_at:/* @__PURE__ */z.string().nullish(),parsing_started_at:/* @__PURE__ */z.string().nullish(),review_started_at:/* @__PURE__ */z.string().nullish(),created_at:/* @__PURE__ */z.string().optional(),updated_at:/* @__PURE__ */z.string().optional(),source:/* @__PURE__ */z.string().nullish().catch(null),action_needed_label:/* @__PURE__ */z.string().nullish().catch(null),failure_reason:/* @__PURE__ */z.string().nullish().catch(null),failure_code:/* @__PURE__ */z.string().nullish().catch(null),recovery_stage:/* @__PURE__ */z.string().nullish().catch(null),show_clinic_phone:/* @__PURE__ */z.boolean().optional().catch(void 0),clinic_name:/* @__PURE__ */z.string().nullish().catch(null),clinic_email:/* @__PURE__ */z.string().nullish().catch(null),clinic_phone:/* @__PURE__ */z.string().nullish().catch(null),converted_to_upload_at:/* @__PURE__ */z.string().nullish().catch(null),request_group_id:/* @__PURE__ */z.string().nullish().catch(null)}).passthrough();function mapRequestView(wire){let parsed=requestSchema.safeParse(wire);if(!parsed.success)return null;let w=parsed.data,simpleStatus=normalizeSimpleStatus(w.simple_status),status=simpleStatus==="requested"&&(w.status==="awaiting_upload"||w.simple_status_detail==="awaiting_owner_upload")?"awaiting_upload":simpleStatus==="parsing"&&(w.simple_status_detail==="in_review"||w.simple_status_detail==="review_email_failed")?"in_review":simpleStatus??normalizeStatus(w.status);/* @__PURE__ */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The fixed set of slot names, in the order the surfaces list them. */
|
|
2
|
-
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "vetBubble", "recordCard", "vetVisitButton", "primaryButton", "link"];
|
|
2
|
+
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "vetBubble", "recordCard", "vetVisitButton", "primaryButton", "link", "header", "banner", "chip", "card", "input", "tab", "bookingStep", "dialog"];
|
|
3
3
|
type EverfurThemeSlotName = (typeof THEME_SLOT_NAMES)[number];
|
|
4
4
|
/** The allow-listed paint keys a slot accepts. */
|
|
5
5
|
declare const THEME_SLOT_KEYS: readonly ["backgroundColor", "borderColor", "borderRadius", "textColor"];
|
|
@@ -59,8 +59,10 @@ type SlotSurrounds = Readonly<Partial<Record<EverfurThemeSlotName, readonly stri
|
|
|
59
59
|
* - A slot without one: its `textColor` is measured on the slot's DEFAULT ground (`grounds`, the surface's own
|
|
60
60
|
* paint there) and, when it fails, pushed toward the legible pole of that ground until it reads, so a text-only
|
|
61
61
|
* slot can never paint invisible text either. Without `grounds` such a slot keeps its colour as supplied.
|
|
62
|
-
* - An edge (`borderColor`) is
|
|
63
|
-
* reads below 3:1.
|
|
62
|
+
* - An edge (`borderColor`) that is what shows a control (`edgeShowsTheControl`) is measured on the fill it
|
|
63
|
+
* bounds (the same seats) and pushed the same way when it reads below 3:1. The hairline of a decorative
|
|
64
|
+
* container, an edge in the fill's own colour and the edge of a fill that already stands out from its surround
|
|
65
|
+
* are kept as given.
|
|
64
66
|
* Returns the same reference when nothing changes.
|
|
65
67
|
*/
|
|
66
68
|
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds, surrounds?: SlotSurrounds): EverfurThemeSlots;
|
|
@@ -210,6 +212,16 @@ interface EverfurColorTokens {
|
|
|
210
212
|
readonly primaryEdge: string;
|
|
211
213
|
readonly checkupCardLowRiskBg: string;
|
|
212
214
|
readonly checkupCardConcernBg: string;
|
|
215
|
+
/**
|
|
216
|
+
* The INFORMATIONAL status colour as ink: the title of the `Good to know` and `Monitor at home` banners on a
|
|
217
|
+
* partner palette. Follows `brandInk` unless a branding sets `info_color` (`colorInfo`), which re-derives it,
|
|
218
|
+
* guarded at 4.5:1 on every ground and on its own wash. Everfur's own light look keeps the banner's authored chip.
|
|
219
|
+
*/
|
|
220
|
+
readonly info: string;
|
|
221
|
+
/** The informational wash under `info`: the brand's soft wash unless a branding sets `info_color`. */
|
|
222
|
+
readonly badgeBgInfo: string;
|
|
223
|
+
/** The informational edge (a banner's outline): `structureEdge` unless a branding sets `info_color` (3:1). */
|
|
224
|
+
readonly infoEdge: string;
|
|
213
225
|
}
|
|
214
226
|
/** Spacing scale (dp). */
|
|
215
227
|
interface EverfurSpaceTokens {
|
|
@@ -253,9 +265,10 @@ interface EverfurLineHeightTokens {
|
|
|
253
265
|
* RN-assignable font-weight literals. Typed as the exact string literals we ship (not bare `string`) so a
|
|
254
266
|
* consumer can spread a weight token straight into a `Text` style: React Native's `TextStyle['fontWeight']`
|
|
255
267
|
* accepts these, but rejects `string`. Kept framework-free (no react-native import) to hold the client layer's
|
|
256
|
-
* no-framework boundary - these
|
|
268
|
+
* no-framework boundary - these literals are a subset of RN's fontWeight union. The compiled default uses 400,
|
|
269
|
+
* 500 and 700; a branding's `font_weight_body` / `font_weight_heading` may name any hundred from 100 to 900.
|
|
257
270
|
*/
|
|
258
|
-
type EverfurFontWeight = '400' | '500' | '700';
|
|
271
|
+
type EverfurFontWeight = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
259
272
|
/** RN fontWeight tokens. */
|
|
260
273
|
interface EverfurWeightTokens {
|
|
261
274
|
readonly regular: EverfurFontWeight;
|
|
@@ -336,6 +349,33 @@ interface EverfurTypeTokens {
|
|
|
336
349
|
* chrome tiers; 0 means none (React Native's `maxFontSizeMultiplier` semantics).
|
|
337
350
|
*/
|
|
338
351
|
readonly scaleCaps: Readonly<Record<'content' | 'heading' | 'control' | 'compact' | 'badge', number>>;
|
|
352
|
+
/**
|
|
353
|
+
* The family of the HEADINGS (screen and card titles, the header bar's title), from `heading_font_family`
|
|
354
|
+
* (`fontFamilyHeading`); null keeps each heading in the face it is drawn with. Read it through `headingFace()`.
|
|
355
|
+
*/
|
|
356
|
+
readonly headingFamily: string | null;
|
|
357
|
+
/** The weight of the headings (`font_weight_heading`, `fontWeightHeading`, 100 to 900); null keeps each heading's own. */
|
|
358
|
+
readonly headingWeight: EverfurFontWeight | null;
|
|
359
|
+
/**
|
|
360
|
+
* The font files and stylesheets the theme asks the host to load (`appearance.fonts`, at most four). The web
|
|
361
|
+
* provider loads them once per page; React Native never fetches a font (the app registers it with expo-font and
|
|
362
|
+
* passes the family). Empty by default.
|
|
363
|
+
*/
|
|
364
|
+
readonly fontSources: readonly EverfurFontSource[];
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* One font the theme asks the web host to load (`appearance.fonts`). Exactly one of `src` (an https font file, loaded
|
|
368
|
+
* with the FontFace API under `family`, `weight` and `style`) or `cssSrc` (an https stylesheet, such as a Google Fonts
|
|
369
|
+
* link, added once as a `<link rel="stylesheet">`). The family is then named by `fontFamily` or `fontFamilyHeading`.
|
|
370
|
+
*/
|
|
371
|
+
interface EverfurFontSource {
|
|
372
|
+
readonly family: string;
|
|
373
|
+
readonly src?: string;
|
|
374
|
+
readonly cssSrc?: string;
|
|
375
|
+
/** The weight the file carries, 100 to 900; absent, 400. Ignored for a stylesheet. */
|
|
376
|
+
readonly weight?: EverfurFontWeight;
|
|
377
|
+
/** `normal` (the default) or `italic`. Ignored for a stylesheet. */
|
|
378
|
+
readonly style?: 'normal' | 'italic';
|
|
339
379
|
}
|
|
340
380
|
interface EverfurSpringToken {
|
|
341
381
|
readonly damping: number;
|
|
@@ -373,6 +413,11 @@ interface EverfurThemeMeta {
|
|
|
373
413
|
readonly placeholder: string | null;
|
|
374
414
|
/** White-label switch (hide_powered_by): drop the "powered by everfur" attribution. Default false (shown). */
|
|
375
415
|
readonly hidePoweredBy: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* The image an assistant message shows in place of the default assistant mark (`assistant_avatar_url`,
|
|
418
|
+
* `assistantAvatarUrl`), https only; null keeps the default. A failed load falls back to the default mark.
|
|
419
|
+
*/
|
|
420
|
+
readonly assistantAvatarUrl: string | null;
|
|
376
421
|
}
|
|
377
422
|
/**
|
|
378
423
|
* The frozen, never-null theme the rn layer renders. Read a token as `theme.color.brand`,
|
|
@@ -415,4 +460,4 @@ declare const EVERFUR_LIGHT: EverfurTheme;
|
|
|
415
460
|
/** The compiled DARK default (deeply frozen). */
|
|
416
461
|
declare const EVERFUR_DARK: EverfurTheme;
|
|
417
462
|
|
|
418
|
-
export {
|
|
463
|
+
export { type EverfurTextScaleTier as A, SLOT_MIN_CONTRAST as B, SYSTEM_FONT_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurColorTokens as E, SYSTEM_MONO_FAMILY as F, type SlotGrounds as G, type SlotSurrounds as H, TEXT_SCALE_TIER_CAPS as I, cssCubicBezier as J, deepFreeze as K, guardSlotContrast as L, mergeThemeSlots as M, parseThemeSlots as N, SLOT_MIN_BORDER_CONTRAST as S, THEME_SLOT_KEYS as T, type EverfurFontFaceKey as a, type EverfurFontFamilies as b, type EverfurFontSource as c, type EverfurFontWeight as d, type EverfurLetterSpacingTokens as e, type EverfurLineHeightTokens as f, type EverfurMotionDurationTokens as g, type EverfurMotionTokens as h, type EverfurRadiusTokens as i, type EverfurSpaceTokens as j, type EverfurSpringToken as k, type EverfurTextColorTokens as l, type EverfurTheme as m, type EverfurThemeMeta as n, type EverfurThemeSlot as o, type EverfurThemeSlotKey as p, type EverfurThemeSlotName as q, type EverfurThemeSlots as r, type EverfurTypeSizeTokens as s, type EverfurTypeTokens as t, type EverfurWeightTokens as u, THEME_SLOT_NAMES as v, EASING_CURVES as w, EVERFUR_DARK as x, EVERFUR_LIGHT as y, type EverfurEasingCurve as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** The fixed set of slot names, in the order the surfaces list them. */
|
|
2
|
-
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "vetBubble", "recordCard", "vetVisitButton", "primaryButton", "link"];
|
|
2
|
+
declare const THEME_SLOT_NAMES: readonly ["composerInput", "sendButton", "userBubble", "assistantBubble", "vetBubble", "recordCard", "vetVisitButton", "primaryButton", "link", "header", "banner", "chip", "card", "input", "tab", "bookingStep", "dialog"];
|
|
3
3
|
type EverfurThemeSlotName = (typeof THEME_SLOT_NAMES)[number];
|
|
4
4
|
/** The allow-listed paint keys a slot accepts. */
|
|
5
5
|
declare const THEME_SLOT_KEYS: readonly ["backgroundColor", "borderColor", "borderRadius", "textColor"];
|
|
@@ -59,8 +59,10 @@ type SlotSurrounds = Readonly<Partial<Record<EverfurThemeSlotName, readonly stri
|
|
|
59
59
|
* - A slot without one: its `textColor` is measured on the slot's DEFAULT ground (`grounds`, the surface's own
|
|
60
60
|
* paint there) and, when it fails, pushed toward the legible pole of that ground until it reads, so a text-only
|
|
61
61
|
* slot can never paint invisible text either. Without `grounds` such a slot keeps its colour as supplied.
|
|
62
|
-
* - An edge (`borderColor`) is
|
|
63
|
-
* reads below 3:1.
|
|
62
|
+
* - An edge (`borderColor`) that is what shows a control (`edgeShowsTheControl`) is measured on the fill it
|
|
63
|
+
* bounds (the same seats) and pushed the same way when it reads below 3:1. The hairline of a decorative
|
|
64
|
+
* container, an edge in the fill's own colour and the edge of a fill that already stands out from its surround
|
|
65
|
+
* are kept as given.
|
|
64
66
|
* Returns the same reference when nothing changes.
|
|
65
67
|
*/
|
|
66
68
|
declare function guardSlotContrast(slots: EverfurThemeSlots, grounds?: SlotGrounds, surrounds?: SlotSurrounds): EverfurThemeSlots;
|
|
@@ -210,6 +212,16 @@ interface EverfurColorTokens {
|
|
|
210
212
|
readonly primaryEdge: string;
|
|
211
213
|
readonly checkupCardLowRiskBg: string;
|
|
212
214
|
readonly checkupCardConcernBg: string;
|
|
215
|
+
/**
|
|
216
|
+
* The INFORMATIONAL status colour as ink: the title of the `Good to know` and `Monitor at home` banners on a
|
|
217
|
+
* partner palette. Follows `brandInk` unless a branding sets `info_color` (`colorInfo`), which re-derives it,
|
|
218
|
+
* guarded at 4.5:1 on every ground and on its own wash. Everfur's own light look keeps the banner's authored chip.
|
|
219
|
+
*/
|
|
220
|
+
readonly info: string;
|
|
221
|
+
/** The informational wash under `info`: the brand's soft wash unless a branding sets `info_color`. */
|
|
222
|
+
readonly badgeBgInfo: string;
|
|
223
|
+
/** The informational edge (a banner's outline): `structureEdge` unless a branding sets `info_color` (3:1). */
|
|
224
|
+
readonly infoEdge: string;
|
|
213
225
|
}
|
|
214
226
|
/** Spacing scale (dp). */
|
|
215
227
|
interface EverfurSpaceTokens {
|
|
@@ -253,9 +265,10 @@ interface EverfurLineHeightTokens {
|
|
|
253
265
|
* RN-assignable font-weight literals. Typed as the exact string literals we ship (not bare `string`) so a
|
|
254
266
|
* consumer can spread a weight token straight into a `Text` style: React Native's `TextStyle['fontWeight']`
|
|
255
267
|
* accepts these, but rejects `string`. Kept framework-free (no react-native import) to hold the client layer's
|
|
256
|
-
* no-framework boundary - these
|
|
268
|
+
* no-framework boundary - these literals are a subset of RN's fontWeight union. The compiled default uses 400,
|
|
269
|
+
* 500 and 700; a branding's `font_weight_body` / `font_weight_heading` may name any hundred from 100 to 900.
|
|
257
270
|
*/
|
|
258
|
-
type EverfurFontWeight = '400' | '500' | '700';
|
|
271
|
+
type EverfurFontWeight = '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900';
|
|
259
272
|
/** RN fontWeight tokens. */
|
|
260
273
|
interface EverfurWeightTokens {
|
|
261
274
|
readonly regular: EverfurFontWeight;
|
|
@@ -336,6 +349,33 @@ interface EverfurTypeTokens {
|
|
|
336
349
|
* chrome tiers; 0 means none (React Native's `maxFontSizeMultiplier` semantics).
|
|
337
350
|
*/
|
|
338
351
|
readonly scaleCaps: Readonly<Record<'content' | 'heading' | 'control' | 'compact' | 'badge', number>>;
|
|
352
|
+
/**
|
|
353
|
+
* The family of the HEADINGS (screen and card titles, the header bar's title), from `heading_font_family`
|
|
354
|
+
* (`fontFamilyHeading`); null keeps each heading in the face it is drawn with. Read it through `headingFace()`.
|
|
355
|
+
*/
|
|
356
|
+
readonly headingFamily: string | null;
|
|
357
|
+
/** The weight of the headings (`font_weight_heading`, `fontWeightHeading`, 100 to 900); null keeps each heading's own. */
|
|
358
|
+
readonly headingWeight: EverfurFontWeight | null;
|
|
359
|
+
/**
|
|
360
|
+
* The font files and stylesheets the theme asks the host to load (`appearance.fonts`, at most four). The web
|
|
361
|
+
* provider loads them once per page; React Native never fetches a font (the app registers it with expo-font and
|
|
362
|
+
* passes the family). Empty by default.
|
|
363
|
+
*/
|
|
364
|
+
readonly fontSources: readonly EverfurFontSource[];
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* One font the theme asks the web host to load (`appearance.fonts`). Exactly one of `src` (an https font file, loaded
|
|
368
|
+
* with the FontFace API under `family`, `weight` and `style`) or `cssSrc` (an https stylesheet, such as a Google Fonts
|
|
369
|
+
* link, added once as a `<link rel="stylesheet">`). The family is then named by `fontFamily` or `fontFamilyHeading`.
|
|
370
|
+
*/
|
|
371
|
+
interface EverfurFontSource {
|
|
372
|
+
readonly family: string;
|
|
373
|
+
readonly src?: string;
|
|
374
|
+
readonly cssSrc?: string;
|
|
375
|
+
/** The weight the file carries, 100 to 900; absent, 400. Ignored for a stylesheet. */
|
|
376
|
+
readonly weight?: EverfurFontWeight;
|
|
377
|
+
/** `normal` (the default) or `italic`. Ignored for a stylesheet. */
|
|
378
|
+
readonly style?: 'normal' | 'italic';
|
|
339
379
|
}
|
|
340
380
|
interface EverfurSpringToken {
|
|
341
381
|
readonly damping: number;
|
|
@@ -373,6 +413,11 @@ interface EverfurThemeMeta {
|
|
|
373
413
|
readonly placeholder: string | null;
|
|
374
414
|
/** White-label switch (hide_powered_by): drop the "powered by everfur" attribution. Default false (shown). */
|
|
375
415
|
readonly hidePoweredBy: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* The image an assistant message shows in place of the default assistant mark (`assistant_avatar_url`,
|
|
418
|
+
* `assistantAvatarUrl`), https only; null keeps the default. A failed load falls back to the default mark.
|
|
419
|
+
*/
|
|
420
|
+
readonly assistantAvatarUrl: string | null;
|
|
376
421
|
}
|
|
377
422
|
/**
|
|
378
423
|
* The frozen, never-null theme the rn layer renders. Read a token as `theme.color.brand`,
|
|
@@ -415,4 +460,4 @@ declare const EVERFUR_LIGHT: EverfurTheme;
|
|
|
415
460
|
/** The compiled DARK default (deeply frozen). */
|
|
416
461
|
declare const EVERFUR_DARK: EverfurTheme;
|
|
417
462
|
|
|
418
|
-
export {
|
|
463
|
+
export { type EverfurTextScaleTier as A, SLOT_MIN_CONTRAST as B, SYSTEM_FONT_FAMILY as C, DEFAULT_MAX_FONT_SCALE as D, type EverfurColorTokens as E, SYSTEM_MONO_FAMILY as F, type SlotGrounds as G, type SlotSurrounds as H, TEXT_SCALE_TIER_CAPS as I, cssCubicBezier as J, deepFreeze as K, guardSlotContrast as L, mergeThemeSlots as M, parseThemeSlots as N, SLOT_MIN_BORDER_CONTRAST as S, THEME_SLOT_KEYS as T, type EverfurFontFaceKey as a, type EverfurFontFamilies as b, type EverfurFontSource as c, type EverfurFontWeight as d, type EverfurLetterSpacingTokens as e, type EverfurLineHeightTokens as f, type EverfurMotionDurationTokens as g, type EverfurMotionTokens as h, type EverfurRadiusTokens as i, type EverfurSpaceTokens as j, type EverfurSpringToken as k, type EverfurTextColorTokens as l, type EverfurTheme as m, type EverfurThemeMeta as n, type EverfurThemeSlot as o, type EverfurThemeSlotKey as p, type EverfurThemeSlotName as q, type EverfurThemeSlots as r, type EverfurTypeSizeTokens as s, type EverfurTypeTokens as t, type EverfurWeightTokens as u, THEME_SLOT_NAMES as v, EASING_CURVES as w, EVERFUR_DARK as x, EVERFUR_LIGHT as y, type EverfurEasingCurve as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientBranding, E as EverfurThemeInput } from './branding-
|
|
2
|
-
import {
|
|
1
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding-DJf4h12Q.js';
|
|
2
|
+
import { m as EverfurTheme, d as EverfurFontWeight, a as EverfurFontFaceKey } from './tokens-DLj8OnLH.js';
|
|
3
3
|
|
|
4
4
|
/** One partner input the contrast guard adjusted. */
|
|
5
5
|
interface EverfurThemeAdjustment {
|
|
@@ -127,5 +127,13 @@ interface EverfurFaceStyle {
|
|
|
127
127
|
* `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
|
|
128
128
|
*/
|
|
129
129
|
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
130
|
+
/**
|
|
131
|
+
* The family and weight of a HEADING (a screen or card title, the header bar's title) that is drawn in `fallback`
|
|
132
|
+
* (most headings are `bold`). A branding's `heading_font_family` makes it a base family at the heading weight
|
|
133
|
+
* (`font_weight_heading`, else the fallback face's weight); a heading weight alone re-weights the fallback face unless
|
|
134
|
+
* that face is a NAMED face (the weight is baked into it, and a synthetic weight over it is the platform bug `face()`
|
|
135
|
+
* exists to avoid). With neither set this is exactly `face(theme, fallback)`, so Everfur's look is unchanged.
|
|
136
|
+
*/
|
|
137
|
+
declare function headingFace(theme: EverfurTheme, fallback?: EverfurFontFaceKey): EverfurFaceStyle;
|
|
130
138
|
|
|
131
|
-
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, type EverfurThemeAdjustment as a, face as f, previewTheme as p, resolveTheme as r, themeAdjustments as t, withServerBranding as w };
|
|
139
|
+
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, type EverfurThemeAdjustment as a, face as f, headingFace as h, previewTheme as p, resolveTheme as r, themeAdjustments as t, withServerBranding as w };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as ClientBranding, E as EverfurThemeInput } from './branding-
|
|
2
|
-
import {
|
|
1
|
+
import { C as ClientBranding, E as EverfurThemeInput } from './branding-BCfwLj0h.cjs';
|
|
2
|
+
import { m as EverfurTheme, d as EverfurFontWeight, a as EverfurFontFaceKey } from './tokens-DLj8OnLH.cjs';
|
|
3
3
|
|
|
4
4
|
/** One partner input the contrast guard adjusted. */
|
|
5
5
|
interface EverfurThemeAdjustment {
|
|
@@ -127,5 +127,13 @@ interface EverfurFaceStyle {
|
|
|
127
127
|
* `{ ...face(theme, 'bold'), fontSize: theme.type.size.body }`. Pure and total over any resolved theme.
|
|
128
128
|
*/
|
|
129
129
|
declare function face(theme: EverfurTheme, weight: EverfurFontFaceKey): EverfurFaceStyle;
|
|
130
|
+
/**
|
|
131
|
+
* The family and weight of a HEADING (a screen or card title, the header bar's title) that is drawn in `fallback`
|
|
132
|
+
* (most headings are `bold`). A branding's `heading_font_family` makes it a base family at the heading weight
|
|
133
|
+
* (`font_weight_heading`, else the fallback face's weight); a heading weight alone re-weights the fallback face unless
|
|
134
|
+
* that face is a NAMED face (the weight is baked into it, and a synthetic weight over it is the platform bug `face()`
|
|
135
|
+
* exists to avoid). With neither set this is exactly `face(theme, fallback)`, so Everfur's look is unchanged.
|
|
136
|
+
*/
|
|
137
|
+
declare function headingFace(theme: EverfurTheme, fallback?: EverfurFontFaceKey): EverfurFaceStyle;
|
|
130
138
|
|
|
131
|
-
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, type EverfurThemeAdjustment as a, face as f, previewTheme as p, resolveTheme as r, themeAdjustments as t, withServerBranding as w };
|
|
139
|
+
export { type EverfurFaceStyle as E, type ResolveThemeInput as R, TEXT_SCALE_FLOOR as T, type EverfurThemeAdjustment as a, face as f, headingFace as h, previewTheme as p, resolveTheme as r, themeAdjustments as t, withServerBranding as w };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.cjs';
|
|
2
|
-
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
4
|
-
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-
|
|
5
|
-
import { E as EverfurError } from './EverfurError-
|
|
2
|
+
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-DJ1KGMww.cjs';
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-COlXj1wq.cjs';
|
|
4
|
+
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-A4A5S7AG.cjs';
|
|
5
|
+
import { E as EverfurError } from './EverfurError-DeBqRpQV.cjs';
|
|
6
6
|
|
|
7
7
|
interface RecordsClinicController {
|
|
8
8
|
searchClinics(input?: RecordsClinicSearchInput): Promise<EverfurResult<RecordsClinicSearchPage>>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { R as RecordsRequestId, P as PetRef } from './ids-B2GAAifq.js';
|
|
2
|
-
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
4
|
-
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-
|
|
5
|
-
import { E as EverfurError } from './EverfurError-
|
|
2
|
+
import { ag as RecordsClinicSearchInput, ah as RecordsClinicSearchPage, ai as RecordsRecentClinicsInput, aj as RecordsAuthorizationCopy, ak as CreateClinicRequestInput, al as RecordsSignatureUploadPolicy, m as RecordsClinic, W as RecordsClinicBatch, X as RecordsClinicBatchClient, n as RecordsDepthClient } from './depth-bKpg3L9r.js';
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-ClPTS0P2.js';
|
|
4
|
+
import { f as RecordsRequestGroupView, d as RecordsRequestView } from './models-CnXY5LuO.js';
|
|
5
|
+
import { E as EverfurError } from './EverfurError-DeBqRpQV.js';
|
|
6
6
|
|
|
7
7
|
interface RecordsClinicController {
|
|
8
8
|
searchClinics(input?: RecordsClinicSearchInput): Promise<EverfurResult<RecordsClinicSearchPage>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EverfurError } from './EverfurError-
|
|
1
|
+
import { E as EverfurError } from './EverfurError-DeBqRpQV.js';
|
|
2
2
|
import { P as PetRef } from './ids-B2GAAifq.js';
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-ClPTS0P2.js';
|
|
4
4
|
import { V as VetVisitIntent } from './visitIntent-D7_yVp1I.js';
|
|
5
5
|
|
|
6
6
|
/** What the hosted page will open for a handoff minted with `visitRef`: the platform's own echo. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { E as EverfurError } from './EverfurError-
|
|
1
|
+
import { E as EverfurError } from './EverfurError-DeBqRpQV.cjs';
|
|
2
2
|
import { P as PetRef } from './ids-B2GAAifq.cjs';
|
|
3
|
-
import { E as EverfurResult } from './EverfurResult-
|
|
3
|
+
import { E as EverfurResult } from './EverfurResult-COlXj1wq.cjs';
|
|
4
4
|
import { V as VetVisitIntent } from './visitIntent-D7_yVp1I.cjs';
|
|
5
5
|
|
|
6
6
|
/** What the hosted page will open for a handoff minted with `visitRef`: the platform's own echo. */
|