@everfur/sdk 0.18.2 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +124 -0
- package/README.md +6 -5
- package/dist/{Chat.d-BkLu9G00.d.ts → Chat.d-BHovj6Ku.d.ts} +1 -1
- package/dist/{Chat.d-B7iUVGmB.d.cts → Chat.d-BO-XtVYe.d.cts} +1 -1
- package/dist/{DepthViews.d-BiS-GTEf.d.cts → DepthViews.d-BwIkdmWZ.d.cts} +1 -1
- package/dist/{DepthViews.d-C-zs_BnZ.d.cts → DepthViews.d-Bx85LeiP.d.cts} +1 -1
- package/dist/{DepthViews.d-hXV6Ef0y.d.ts → DepthViews.d-CBUunxP1.d.ts} +1 -1
- package/dist/{DepthViews.d-C0DVqywN.d.ts → DepthViews.d-DKoZgF8l.d.ts} +1 -1
- package/dist/{IntakeMedia.d-4a89XrP7.d.ts → IntakeMedia.d-B_ZVDxh3.d.ts} +1 -1
- package/dist/{IntakeMedia.d-JJCUvQu7.d.cts → IntakeMedia.d-CnGzpllr.d.cts} +1 -1
- package/dist/{IntakeMedia.d-DGxrhgIW.d.ts → IntakeMedia.d-DNUAks9E.d.ts} +1 -1
- package/dist/{IntakeMedia.d-DUPR4lVM.d.cts → IntakeMedia.d-Dqc5V_YH.d.cts} +1 -1
- package/dist/{RecordsPage.d-BG_RDR1V.d.ts → RecordsPage.d-CsvBhU0f.d.ts} +1 -1
- package/dist/{RecordsPage.d-5rHMTDyY.d.cts → RecordsPage.d-DRFp2LXH.d.cts} +1 -1
- package/dist/animations/index.cjs +1 -94
- package/dist/animations/index.d.cts +3 -3
- package/dist/animations/index.d.ts +3 -3
- package/dist/animations/index.js +1 -94
- package/dist/{attachments.d-_mgNU-ur.d.ts → attachments.d-DOZjCdkb.d.ts} +2 -2
- package/dist/{attachments.d-DFbXLAYK.d.cts → attachments.d-DWUsHPf9.d.cts} +2 -2
- package/dist/{bookingCopy.d-RU8lNYJ4.d.ts → bookingCopy.d-BlMWlvgv.d.ts} +10 -3
- package/dist/{bookingCopy.d-0K1trjxx.d.cts → bookingCopy.d-tvO7y6MK.d.cts} +10 -3
- package/dist/{casesRepository.d-D2SQFL27.d.ts → casesRepository.d-C7qbrOL-.d.ts} +1 -1
- package/dist/{casesRepository.d-D7vIZ9oX.d.cts → casesRepository.d-sSo6oakf.d.cts} +1 -1
- package/dist/chat/index.cjs +29 -119
- package/dist/chat/index.d.cts +11 -10
- package/dist/chat/index.d.ts +11 -10
- package/dist/chat/index.js +30 -120
- package/dist/chat/lite/index.cjs +29 -119
- package/dist/chat/lite/index.d.cts +11 -10
- package/dist/chat/lite/index.d.ts +11 -10
- package/dist/chat/lite/index.js +30 -120
- package/dist/{attachments.d-D7f7OfPE.d.ts → chatHandoffToken.d-C4tEyuCT.d.ts} +33 -9
- package/dist/{attachments.d-HmRqizDG.d.cts → chatHandoffToken.d-D6GUoBvs.d.cts} +33 -9
- package/dist/{ports.d-RKc2C07X.d.ts → chatTypes.d-BI4vidgu.d.ts} +41 -52
- package/dist/{ports.d-CB9YZT2L.d.cts → chatTypes.d-CSyw9em_.d.cts} +41 -52
- package/dist/client/index.cjs +2 -95
- package/dist/client/index.d.cts +7 -7
- package/dist/client/index.d.ts +7 -7
- package/dist/client/index.js +2 -95
- package/dist/{clinicBatch.d-BN1jfVGo.d.cts → clinicBatch.d-BxA_uGBb.d.cts} +2 -2
- package/dist/{clinicBatch.d-BhaCdstU.d.ts → clinicBatch.d-T5oSAhY-.d.ts} +2 -2
- package/dist/{config.d-D_k_rNZZ.d.ts → config.d-N5Xzy53V.d.ts} +1 -1
- package/dist/{config.d-BFTqU7ft.d.cts → config.d-jCmrhM4a.d.cts} +1 -1
- package/dist/consent/index.cjs +1 -94
- package/dist/consent/index.d.cts +5 -5
- package/dist/consent/index.d.ts +5 -5
- package/dist/consent/index.js +1 -94
- package/dist/{context.d-B4LODPF1.d.ts → context.d-BJEpEERH.d.ts} +7 -6
- package/dist/{context.d-D2fhrjAM.d.cts → context.d-l4HkFJI8.d.cts} +7 -6
- package/dist/{copy.d-Bn9eIgkW.d.ts → copy.d-hFRaovog.d.ts} +2 -2
- package/dist/{copy.d-DjYhMxxS.d.cts → copy.d-hS49oJ4w.d.cts} +2 -2
- package/dist/core/index.cjs +6 -99
- package/dist/core/index.d.cts +14 -13
- package/dist/core/index.d.ts +14 -13
- package/dist/core/index.js +6 -99
- package/dist/{depth.d-CsKZkLNi.d.cts → depth.d-BYwddMNU.d.cts} +2 -2
- package/dist/{depth.d-DlaIV8TV.d.ts → depth.d-C99_xup2.d.ts} +2 -2
- package/dist/{entitlementRepository.d-CpIRpfzy.d.cts → entitlementRepository.d-CiU_QIPL.d.cts} +2 -2
- package/dist/{entitlementRepository.d-C5d_6QMi.d.ts → entitlementRepository.d-qZAlET7C.d.ts} +2 -2
- package/dist/{focus.d-DOlAaNIU.d.ts → focus.d-CG6KhDBK.d.ts} +2 -2
- package/dist/{focus.d-DdBbwzjP.d.cts → focus.d-RJMXplJc.d.cts} +2 -2
- package/dist/health-plan/index.cjs +1 -94
- package/dist/health-plan/index.d.cts +9 -9
- package/dist/health-plan/index.d.ts +9 -9
- package/dist/health-plan/index.js +1 -94
- package/dist/{idempotency.d-CmQc1OUv.d.ts → idempotency.d-D-ZWpO9p.d.ts} +1 -1
- package/dist/{idempotency.d-P4O5lNBq.d.cts → idempotency.d-DJyOZDPb.d.cts} +1 -1
- package/dist/{identity.d-BmbAwQYx.d.cts → identity.d-CA7mW59I.d.cts} +1 -1
- package/dist/{identity.d-BZXPu9Hi.d.ts → identity.d-DIOnFzXL.d.ts} +1 -1
- package/dist/index.cjs +30 -120
- package/dist/index.d.cts +14 -13
- package/dist/index.d.ts +14 -13
- package/dist/index.js +31 -121
- package/dist/{introEvents.d-Bqw2Hcpt.d.cts → introEvents.d-7wNDMhEF.d.cts} +1 -1
- package/dist/{introEvents.d-Cy8yxOoe.d.ts → introEvents.d-BjqfFgE1.d.ts} +1 -1
- package/dist/notifications/inbox/index.cjs +44 -0
- package/dist/notifications/inbox/index.d.cts +50 -0
- package/dist/notifications/inbox/index.d.ts +50 -0
- package/dist/notifications/inbox/index.js +44 -0
- package/dist/notifications/index.cjs +18 -98
- package/dist/notifications/index.d.cts +12 -6
- package/dist/notifications/index.d.ts +12 -6
- package/dist/notifications/index.js +18 -98
- package/dist/{optInView.d-wGSNOB86.d.ts → optInView.d-B5v4cDDW.d.ts} +2 -2
- package/dist/{optInView.d-DXj2w4KU.d.cts → optInView.d-BQhHPleh.d.cts} +2 -2
- package/dist/parse.d-DYsx1Q2V.d.cts +168 -0
- package/dist/parse.d-Do0sdAgm.d.ts +168 -0
- package/dist/{pets.d-CP13kAFa.d.cts → pets.d-DRqMaP8A.d.cts} +1 -1
- package/dist/{pets.d-tqGZP3Co.d.ts → pets.d-DVrOb-Bj.d.ts} +1 -1
- package/dist/{petsRepository.d-CLyzuoo4.d.ts → petsRepository.d-CpYWRWFq.d.ts} +1 -1
- package/dist/{petsRepository.d-CyerzD5G.d.cts → petsRepository.d-tZADfKA1.d.cts} +1 -1
- package/dist/photo/index.cjs +1 -94
- package/dist/photo/index.js +1 -94
- package/dist/records/depth/index.cjs +1 -94
- package/dist/records/depth/index.d.cts +9 -9
- package/dist/records/depth/index.d.ts +9 -9
- package/dist/records/depth/index.js +1 -94
- package/dist/records/index.cjs +2 -95
- package/dist/records/index.d.cts +10 -10
- package/dist/records/index.d.ts +10 -10
- package/dist/records/index.js +2 -95
- package/dist/{requestFunnel.d-BPWf5SQf.d.ts → requestFunnel.d-B8OVGh0p.d.ts} +2 -2
- package/dist/{requestFunnel.d-DocT7FXR.d.cts → requestFunnel.d-C4abgvt9.d.cts} +2 -2
- package/dist/{parse.d-MQST1RP3.d.ts → route.d-BAZqGLfl.d.ts} +90 -53
- package/dist/{parse.d-C9_UMXfA.d.cts → route.d-CTf8h9vS.d.cts} +90 -53
- package/dist/{runtimeTypes.d-CkwEMpy8.d.cts → runtimeTypes.d-DbaQKGLv.d.cts} +39 -5
- package/dist/{runtimeTypes.d-D4Cjjf_C.d.ts → runtimeTypes.d-DrIz5e6L.d.ts} +39 -5
- package/dist/{screenProps.d-DNTTp7hU.d.ts → screenProps.d-BP8LAZWn.d.ts} +1 -1
- package/dist/{screenProps.d-Byla6nJL.d.cts → screenProps.d-Di3wYGCn.d.cts} +1 -1
- package/dist/server/events/index.cjs +2 -95
- package/dist/server/events/index.d.cts +122 -4
- package/dist/server/events/index.d.ts +122 -4
- package/dist/server/events/index.js +2 -95
- package/dist/server/index.cjs +2 -95
- package/dist/server/index.d.cts +3 -3
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +2 -95
- package/dist/shop/index.d.cts +3 -3
- package/dist/shop/index.d.ts +3 -3
- package/dist/tabs/index.cjs +3 -96
- package/dist/tabs/index.d.cts +6 -6
- package/dist/tabs/index.d.ts +6 -6
- package/dist/tabs/index.js +3 -96
- package/dist/televet/booking/index.cjs +11 -103
- package/dist/televet/booking/index.d.cts +13 -11
- package/dist/televet/booking/index.d.ts +13 -11
- package/dist/televet/booking/index.js +11 -103
- package/dist/televet/index.cjs +1 -94
- package/dist/televet/index.d.cts +3 -3
- package/dist/televet/index.d.ts +3 -3
- package/dist/televet/index.js +1 -94
- package/dist/{televetGlobal.d-CC-DrqkQ.d.ts → televetGlobal.d-B0_jbCtC.d.ts} +7 -0
- package/dist/{televetGlobal.d-CKwDCbmN.d.cts → televetGlobal.d-BWYJR391.d.cts} +7 -0
- package/dist/testing/index.cjs +1 -94
- package/dist/testing/index.d.cts +1 -1
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/index.js +1 -94
- package/dist/testing/rn/index.cjs +1 -94
- package/dist/testing/rn/index.d.cts +8 -7
- package/dist/testing/rn/index.d.ts +8 -7
- package/dist/testing/rn/index.js +1 -94
- package/dist/testing/web/index.cjs +1 -94
- package/dist/testing/web/index.d.cts +8 -7
- package/dist/testing/web/index.d.ts +8 -7
- package/dist/testing/web/index.js +1 -94
- package/dist/texting/index.cjs +1 -94
- package/dist/texting/index.d.cts +5 -5
- package/dist/texting/index.d.ts +5 -5
- package/dist/texting/index.js +1 -94
- package/dist/{threadOptions.d-jgk_sHrj.d.ts → threadOptions.d-Cwmyu8pc.d.ts} +2 -2
- package/dist/{threadOptions.d-CIrevUL8.d.cts → threadOptions.d-REwBuXAY.d.cts} +2 -2
- package/dist/{timelineRows.d-BST14weg.d.ts → timelineRows.d-CTlGQTB0.d.ts} +1 -1
- package/dist/{timelineRows.d-BEjiHpkP.d.cts → timelineRows.d-CongJG58.d.cts} +1 -1
- package/dist/unreadStore.d-gCsleb6l.d.ts +74 -0
- package/dist/unreadStore.d-w5x6lEpR.d.cts +74 -0
- package/dist/{useHealthPlanSubscription.d-C9kh4mvk.d.ts → useHealthPlanSubscription.d-BSo5kFT9.d.ts} +2 -2
- package/dist/{useHealthPlanSubscription.d-CYJi9ZNE.d.cts → useHealthPlanSubscription.d-Br7GKHTt.d.cts} +2 -2
- package/dist/useInboxUnread.d-Blxu00eY.d.ts +206 -0
- package/dist/useInboxUnread.d-pi6FNnK-.d.cts +206 -0
- package/dist/{usePresentation.d-COEh8Xa1.d.cts → usePresentation.d-C6ci1s3j.d.cts} +1 -1
- package/dist/{usePresentation.d-WA3sfMpz.d.ts → usePresentation.d-yd9Gh4GB.d.ts} +1 -1
- package/dist/{useRecordsDepth.d-DZfdRdIU.d.cts → useRecordsDepth.d-BIDVPfx7.d.cts} +1 -1
- package/dist/{useRecordsDepth.d-CAYnVYl1.d.ts → useRecordsDepth.d-C5snbNxR.d.ts} +1 -1
- package/dist/{appStateLifecycle.d-_TM06yEk.d.cts → useUnread.d-CORommFJ.d.cts} +49 -14
- package/dist/{appStateLifecycle.d-7H_2a9it.d.ts → useUnread.d-w0dKMnx7.d.ts} +49 -14
- package/dist/video/index.cjs +1 -94
- package/dist/video/index.js +1 -94
- package/dist/{view.d-D8soknYh.d.ts → view.d-CK2UN4qn.d.ts} +3 -3
- package/dist/{view.d-eM315KIZ.d.cts → view.d-DUhKppyl.d.cts} +3 -3
- package/dist/web/consent/index.cjs +1 -94
- package/dist/web/consent/index.d.cts +5 -5
- package/dist/web/consent/index.d.ts +5 -5
- package/dist/web/consent/index.js +1 -94
- package/dist/web/health-plan/index.cjs +1 -94
- package/dist/web/health-plan/index.d.cts +11 -11
- package/dist/web/health-plan/index.d.ts +11 -11
- package/dist/web/health-plan/index.js +1 -94
- package/dist/web/inbox/index.cjs +49 -0
- package/dist/web/inbox/index.d.cts +191 -0
- package/dist/web/inbox/index.d.ts +191 -0
- package/dist/web/inbox/index.js +49 -0
- package/dist/web/index.cjs +28 -118
- package/dist/web/index.d.cts +76 -36
- package/dist/web/index.d.ts +76 -36
- package/dist/web/index.js +28 -118
- package/dist/web/intro/index.cjs +3 -96
- package/dist/web/intro/index.d.cts +6 -6
- package/dist/web/intro/index.d.ts +6 -6
- package/dist/web/intro/index.js +3 -96
- package/dist/web/notifications/index.cjs +16 -96
- package/dist/web/notifications/index.d.cts +8 -3
- package/dist/web/notifications/index.d.ts +8 -3
- package/dist/web/notifications/index.js +16 -96
- package/dist/web/records/depth/index.cjs +1 -94
- package/dist/web/records/depth/index.d.cts +9 -9
- package/dist/web/records/depth/index.d.ts +9 -9
- package/dist/web/records/depth/index.js +1 -94
- package/dist/web/records/index.cjs +1 -94
- package/dist/web/records/index.d.cts +11 -11
- package/dist/web/records/index.d.ts +11 -11
- package/dist/web/records/index.js +1 -94
- package/dist/web/records-sheet/index.cjs +2 -95
- package/dist/web/records-sheet/index.js +2 -95
- package/dist/web/shop/index.d.cts +3 -3
- package/dist/web/shop/index.d.ts +3 -3
- package/dist/web/televet/booking/index.cjs +9 -102
- package/dist/web/televet/booking/index.d.cts +18 -11
- package/dist/web/televet/booking/index.d.ts +18 -11
- package/dist/web/televet/booking/index.js +9 -102
- package/dist/web/televet/index.cjs +1 -94
- package/dist/web/televet/index.d.cts +3 -3
- package/dist/web/televet/index.d.ts +3 -3
- package/dist/web/televet/index.js +1 -94
- package/dist/web/texting/index.cjs +1 -94
- package/dist/web/texting/index.d.cts +5 -5
- package/dist/web/texting/index.d.ts +5 -5
- package/dist/web/texting/index.js +1 -94
- package/notifications/inbox/package.json +8 -0
- package/package.json +29 -1
- package/web/inbox/native-blocked.cjs +12 -0
- package/web/inbox/package.json +8 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
import { F as FileHandle } from './ports.d-BX4f4UsB.js';
|
|
3
|
+
import { P as PetRef, C as ConversationId } from './ids.d-B2GAAifq.js';
|
|
4
|
+
|
|
5
|
+
/** The presigned POST/PUT policy returned by `/uploads/initiate` (SPEC-11b §2.1). */
|
|
6
|
+
interface PresignedPolicy {
|
|
7
|
+
/** Absolute S3 endpoint URL to POST/PUT the bytes at. */
|
|
8
|
+
readonly url: string;
|
|
9
|
+
/** POST-policy form fields to include with the upload (empty for a plain PUT). */
|
|
10
|
+
readonly fields: Readonly<Record<string, string>>;
|
|
11
|
+
/** The owned-uploads-prefixed key the analyze call then references. */
|
|
12
|
+
readonly s3Key: string;
|
|
13
|
+
/** epoch seconds the policy expires; telemetry only. */
|
|
14
|
+
readonly expiresAt: number | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The native upload seam. It PUTs `file` at the presigned `target` (SPEC-11b §2.1). `idempotencyKey` is reused
|
|
18
|
+
* on every retry so a re-uploaded identical file dedupes server-side. A network failure REJECTS; the controller
|
|
19
|
+
* normalizes that to a `mediaUploadFailed` and exposes a retake affordance (never auto-retried, SPEC-00 §3.2).
|
|
20
|
+
*
|
|
21
|
+
* NOTE: the spine `FilePort.presignedPut(file, { idempotencyKey, signal })` has no slot for the presigned
|
|
22
|
+
* target; this richer port is the shape it must grow to. See the manifest gap note.
|
|
23
|
+
*/
|
|
24
|
+
interface UploadPort {
|
|
25
|
+
presignedPut(file: FileHandle, opts: {
|
|
26
|
+
readonly target: PresignedPolicy;
|
|
27
|
+
readonly idempotencyKey: string;
|
|
28
|
+
readonly signal?: AbortSignal;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
interface Timers {
|
|
32
|
+
setTimeout(handler: () => void, ms: number): unknown;
|
|
33
|
+
clearTimeout(handle: unknown): void;
|
|
34
|
+
now(): number;
|
|
35
|
+
}
|
|
36
|
+
/** The useSyncExternalStore contract the rn hooks bind to. */
|
|
37
|
+
interface ReadableStore<S> {
|
|
38
|
+
subscribe(listener: () => void): () => void;
|
|
39
|
+
getSnapshot(): S;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** What is known about a pet's newest chat thread. */
|
|
43
|
+
interface EverfurUnread {
|
|
44
|
+
/** True when the newest thread has unread messages, false when it has none; null until known. */
|
|
45
|
+
readonly hasUnread: boolean | null;
|
|
46
|
+
/** Unread messages in that thread, as the server counted them; null until known. */
|
|
47
|
+
readonly unreadCount: number | null;
|
|
48
|
+
/** The newest thread, the one the count is for; null when the member has none or nothing is known yet. */
|
|
49
|
+
readonly conversationId: ConversationId | null;
|
|
50
|
+
/** The pet this is about; null for the member's list across pets. */
|
|
51
|
+
readonly petRef: PetRef | null;
|
|
52
|
+
}
|
|
53
|
+
/** The first row of a head read, as the chat's own list read reports it. */
|
|
54
|
+
interface UnreadHead {
|
|
55
|
+
readonly id: ConversationId;
|
|
56
|
+
readonly unreadCount: number | null;
|
|
57
|
+
}
|
|
58
|
+
/** The runtime's unread store (`runtime.unread`). `useEverfurUnread` binds it; a partner never needs it directly. */
|
|
59
|
+
interface UnreadStore {
|
|
60
|
+
/** A change notice. While at least one listener is subscribed, a known change also raises `unread_changed`. */
|
|
61
|
+
subscribe(listener: () => void): () => void;
|
|
62
|
+
/** The pet's state: a stable reference until it changes. */
|
|
63
|
+
get(petRef: PetRef | null): EverfurUnread;
|
|
64
|
+
/** Read the pet's list head now. One read in flight per pet; nothing is read without a signed-in member. Settles. */
|
|
65
|
+
refresh(petRef: PetRef | null): Promise<void>;
|
|
66
|
+
/** SDK side: a head read another reader (the chat) made: its first row, or null for an empty list. */
|
|
67
|
+
reportHead(petRef: PetRef | null, head: UnreadHead | null): void;
|
|
68
|
+
/** SDK side: the member read this thread. */
|
|
69
|
+
reportRead(conversationId: ConversationId): void;
|
|
70
|
+
/** SDK side: a re-scope. Forget everything, drop what is in flight. */
|
|
71
|
+
reset(): void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type { EverfurUnread as E, PresignedPolicy as P, ReadableStore as R, Timers as T, UploadPort as U, UnreadStore as a };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
import { F as FileHandle } from './ports.d-BX4f4UsB.cjs';
|
|
3
|
+
import { P as PetRef, C as ConversationId } from './ids.d-B2GAAifq.cjs';
|
|
4
|
+
|
|
5
|
+
/** The presigned POST/PUT policy returned by `/uploads/initiate` (SPEC-11b §2.1). */
|
|
6
|
+
interface PresignedPolicy {
|
|
7
|
+
/** Absolute S3 endpoint URL to POST/PUT the bytes at. */
|
|
8
|
+
readonly url: string;
|
|
9
|
+
/** POST-policy form fields to include with the upload (empty for a plain PUT). */
|
|
10
|
+
readonly fields: Readonly<Record<string, string>>;
|
|
11
|
+
/** The owned-uploads-prefixed key the analyze call then references. */
|
|
12
|
+
readonly s3Key: string;
|
|
13
|
+
/** epoch seconds the policy expires; telemetry only. */
|
|
14
|
+
readonly expiresAt: number | null;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The native upload seam. It PUTs `file` at the presigned `target` (SPEC-11b §2.1). `idempotencyKey` is reused
|
|
18
|
+
* on every retry so a re-uploaded identical file dedupes server-side. A network failure REJECTS; the controller
|
|
19
|
+
* normalizes that to a `mediaUploadFailed` and exposes a retake affordance (never auto-retried, SPEC-00 §3.2).
|
|
20
|
+
*
|
|
21
|
+
* NOTE: the spine `FilePort.presignedPut(file, { idempotencyKey, signal })` has no slot for the presigned
|
|
22
|
+
* target; this richer port is the shape it must grow to. See the manifest gap note.
|
|
23
|
+
*/
|
|
24
|
+
interface UploadPort {
|
|
25
|
+
presignedPut(file: FileHandle, opts: {
|
|
26
|
+
readonly target: PresignedPolicy;
|
|
27
|
+
readonly idempotencyKey: string;
|
|
28
|
+
readonly signal?: AbortSignal;
|
|
29
|
+
}): Promise<void>;
|
|
30
|
+
}
|
|
31
|
+
interface Timers {
|
|
32
|
+
setTimeout(handler: () => void, ms: number): unknown;
|
|
33
|
+
clearTimeout(handle: unknown): void;
|
|
34
|
+
now(): number;
|
|
35
|
+
}
|
|
36
|
+
/** The useSyncExternalStore contract the rn hooks bind to. */
|
|
37
|
+
interface ReadableStore<S> {
|
|
38
|
+
subscribe(listener: () => void): () => void;
|
|
39
|
+
getSnapshot(): S;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/** What is known about a pet's newest chat thread. */
|
|
43
|
+
interface EverfurUnread {
|
|
44
|
+
/** True when the newest thread has unread messages, false when it has none; null until known. */
|
|
45
|
+
readonly hasUnread: boolean | null;
|
|
46
|
+
/** Unread messages in that thread, as the server counted them; null until known. */
|
|
47
|
+
readonly unreadCount: number | null;
|
|
48
|
+
/** The newest thread, the one the count is for; null when the member has none or nothing is known yet. */
|
|
49
|
+
readonly conversationId: ConversationId | null;
|
|
50
|
+
/** The pet this is about; null for the member's list across pets. */
|
|
51
|
+
readonly petRef: PetRef | null;
|
|
52
|
+
}
|
|
53
|
+
/** The first row of a head read, as the chat's own list read reports it. */
|
|
54
|
+
interface UnreadHead {
|
|
55
|
+
readonly id: ConversationId;
|
|
56
|
+
readonly unreadCount: number | null;
|
|
57
|
+
}
|
|
58
|
+
/** The runtime's unread store (`runtime.unread`). `useEverfurUnread` binds it; a partner never needs it directly. */
|
|
59
|
+
interface UnreadStore {
|
|
60
|
+
/** A change notice. While at least one listener is subscribed, a known change also raises `unread_changed`. */
|
|
61
|
+
subscribe(listener: () => void): () => void;
|
|
62
|
+
/** The pet's state: a stable reference until it changes. */
|
|
63
|
+
get(petRef: PetRef | null): EverfurUnread;
|
|
64
|
+
/** Read the pet's list head now. One read in flight per pet; nothing is read without a signed-in member. Settles. */
|
|
65
|
+
refresh(petRef: PetRef | null): Promise<void>;
|
|
66
|
+
/** SDK side: a head read another reader (the chat) made: its first row, or null for an empty list. */
|
|
67
|
+
reportHead(petRef: PetRef | null, head: UnreadHead | null): void;
|
|
68
|
+
/** SDK side: the member read this thread. */
|
|
69
|
+
reportRead(conversationId: ConversationId): void;
|
|
70
|
+
/** SDK side: a re-scope. Forget everything, drop what is in flight. */
|
|
71
|
+
reset(): void;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export type { EverfurUnread as E, PresignedPolicy as P, ReadableStore as R, Timers as T, UploadPort as U, UnreadStore as a };
|
package/dist/{useHealthPlanSubscription.d-C9kh4mvk.d.ts → useHealthPlanSubscription.d-BSo5kFT9.d.ts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, b as HealthPlanItem, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, p as HealthPlan, j as HealthPlanPageRepository, H as HealthPlanPage, q as HealthPlanRepository, i as HealthPlanSubscriptionRepository, r as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-
|
|
2
|
+
import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, b as HealthPlanItem, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, p as HealthPlan, j as HealthPlanPageRepository, H as HealthPlanPage, q as HealthPlanRepository, i as HealthPlanSubscriptionRepository, r as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-CG6KhDBK.js';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { P as PetRef } from './ids.d-B2GAAifq.js';
|
|
5
|
-
import { d as HealthPlanCart } from './usePresentation.d-
|
|
5
|
+
import { d as HealthPlanCart } from './usePresentation.d-yd9Gh4GB.js';
|
|
6
6
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
|
|
7
7
|
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.js';
|
|
8
8
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, b as HealthPlanItem, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, p as HealthPlan, j as HealthPlanPageRepository, H as HealthPlanPage, q as HealthPlanRepository, i as HealthPlanSubscriptionRepository, r as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-
|
|
2
|
+
import { f as HealthPlanFocusIcon, m as HealthPlanFocusPrices, c as HealthPlanFocusDesign, b as HealthPlanItem, n as HealthPlanFocusExtra, o as HealthPlanFocusWait, p as HealthPlan, j as HealthPlanPageRepository, H as HealthPlanPage, q as HealthPlanRepository, i as HealthPlanSubscriptionRepository, r as HealthPlanSubscriptionQuote, g as HealthPlanSubscription, h as HealthPlanOneBoxOrder } from './focus.d-RJMXplJc.cjs';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { P as PetRef } from './ids.d-B2GAAifq.cjs';
|
|
5
|
-
import { d as HealthPlanCart } from './usePresentation.d-
|
|
5
|
+
import { d as HealthPlanCart } from './usePresentation.d-C6ci1s3j.cjs';
|
|
6
6
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
7
7
|
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
|
|
8
8
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
3
|
+
import { P as PetRef, U as UserRef } from './ids.d-B2GAAifq.js';
|
|
4
|
+
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
|
|
5
|
+
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.js';
|
|
6
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-68yrE3BE.js';
|
|
7
|
+
import { A as AuthContext } from './identity.d-DIOnFzXL.js';
|
|
8
|
+
import { d as EverfurNotification } from './parse.d-Do0sdAgm.js';
|
|
9
|
+
|
|
10
|
+
/** The words of the inbox. Every key is a plain string. */
|
|
11
|
+
interface EverfurInboxCopy {
|
|
12
|
+
/** The list's heading and accessible name. */
|
|
13
|
+
readonly title: string;
|
|
14
|
+
/** The loading state's accessible name. */
|
|
15
|
+
readonly loading: string;
|
|
16
|
+
readonly emptyTitle: string;
|
|
17
|
+
readonly emptyBody: string;
|
|
18
|
+
/** The list failed to load. */
|
|
19
|
+
readonly errorTitle: string;
|
|
20
|
+
readonly errorBody: string;
|
|
21
|
+
readonly retry: string;
|
|
22
|
+
/** A row whose title arrived empty. */
|
|
23
|
+
readonly rowFallbackTitle: string;
|
|
24
|
+
/** Before an unread row's accessible name. */
|
|
25
|
+
readonly unreadPrefix: string;
|
|
26
|
+
/** After a relative time in an accessible name ("2h ago"). */
|
|
27
|
+
readonly timeAgoSuffix: string;
|
|
28
|
+
/** A time under a minute ago. */
|
|
29
|
+
readonly now: string;
|
|
30
|
+
/** Read the next older page. */
|
|
31
|
+
readonly more: string;
|
|
32
|
+
/** One item failed to load. */
|
|
33
|
+
readonly detailErrorTitle: string;
|
|
34
|
+
readonly detailErrorBody: string;
|
|
35
|
+
/** One item is gone (expired after 90 days, or removed). */
|
|
36
|
+
readonly notFoundTitle: string;
|
|
37
|
+
readonly notFoundBody: string;
|
|
38
|
+
/** Back from one item to the list. */
|
|
39
|
+
readonly back: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* What an inbox item is about, as the wire names it: `kind`, then the item's references under their wire keys
|
|
44
|
+
* (`pet_ref`, `visit_ref`, `intent`...). Values are short opaque strings or null; route on `kind` and treat a kind
|
|
45
|
+
* you do not know as "open the item".
|
|
46
|
+
*/
|
|
47
|
+
interface EverfurInboxTarget {
|
|
48
|
+
readonly kind: string;
|
|
49
|
+
readonly [key: string]: string | null;
|
|
50
|
+
}
|
|
51
|
+
/** One inbox item. */
|
|
52
|
+
interface EverfurInboxItem {
|
|
53
|
+
/** Everfur's id for the item (`inb_...`). */
|
|
54
|
+
readonly id: string;
|
|
55
|
+
/** The notification type's settings key (`playbook.C07`, `partner.record.ready`...). */
|
|
56
|
+
readonly typeKey: string;
|
|
57
|
+
/** The partner event type when there is one (`record.ready`), else null. */
|
|
58
|
+
readonly eventType: string | null;
|
|
59
|
+
/** The event id (`evt_...`) the same message carried on push, when there is one. */
|
|
60
|
+
readonly eventId: string | null;
|
|
61
|
+
/** The words Everfur wrote for the member. Plain text: render it as text, never as markup. */
|
|
62
|
+
readonly title: string;
|
|
63
|
+
readonly body: string;
|
|
64
|
+
/** Your pet reference the item is about, or null. */
|
|
65
|
+
readonly petRef: PetRef | null;
|
|
66
|
+
/** What the item is about, or null when it is a message with nothing to open. */
|
|
67
|
+
readonly target: EverfurInboxTarget | null;
|
|
68
|
+
/** ISO 8601. */
|
|
69
|
+
readonly createdAt: string;
|
|
70
|
+
/** ISO 8601, or null while unread. */
|
|
71
|
+
readonly readAt: string | null;
|
|
72
|
+
}
|
|
73
|
+
/** One page of the inbox, newest first. */
|
|
74
|
+
interface EverfurInboxPage {
|
|
75
|
+
readonly items: readonly EverfurInboxItem[];
|
|
76
|
+
/** Pass it back as `cursor` for the next (older) page; null on the last page. */
|
|
77
|
+
readonly nextCursor: string | null;
|
|
78
|
+
/** The member's unread items across the whole inbox. */
|
|
79
|
+
readonly unreadCount: number;
|
|
80
|
+
}
|
|
81
|
+
/** What `listPage` reads. Every field is optional. */
|
|
82
|
+
interface EverfurInboxQuery {
|
|
83
|
+
/** Items per page, 1 to 50 (default 20). */
|
|
84
|
+
readonly limit?: number;
|
|
85
|
+
/** The `nextCursor` of the page before. */
|
|
86
|
+
readonly cursor?: string;
|
|
87
|
+
/** Only the items about this pet. */
|
|
88
|
+
readonly petRef?: PetRef;
|
|
89
|
+
/** Only the item of this event (`evt_...`): how a tapped web push finds its item. */
|
|
90
|
+
readonly eventId?: string;
|
|
91
|
+
}
|
|
92
|
+
/** A tapped item, ready to route: the item, and the typed routing block when the item carries one. */
|
|
93
|
+
interface EverfurInboxOpen {
|
|
94
|
+
readonly item: EverfurInboxItem;
|
|
95
|
+
/**
|
|
96
|
+
* The item's target read the way `parseEverfurNotification` reads a tapped push, or null when the item names no
|
|
97
|
+
* event or its target is malformed (a kind this release does not know parses as `unknown`, as on a push). Route on
|
|
98
|
+
* `notification.target.kind` when present;
|
|
99
|
+
* otherwise on `item.target`, or show the item itself.
|
|
100
|
+
*/
|
|
101
|
+
readonly notification: EverfurNotification | null;
|
|
102
|
+
}
|
|
103
|
+
interface EverfurInboxClient {
|
|
104
|
+
/** `GET /widget/v1/inbox`. Settles `ok(EverfurInboxPage)`; the not-found error while the inbox is off for your tenant. */
|
|
105
|
+
listPage(query?: EverfurInboxQuery, opts?: {
|
|
106
|
+
readonly signal?: AbortSignal;
|
|
107
|
+
}): Promise<EverfurResult<EverfurInboxPage>>;
|
|
108
|
+
/** `GET /widget/v1/inbox/{item_id}`. An unknown, expired or another member's item is the not-found error. */
|
|
109
|
+
getItem(itemId: string, opts?: {
|
|
110
|
+
readonly signal?: AbortSignal;
|
|
111
|
+
}): Promise<EverfurResult<EverfurInboxItem>>;
|
|
112
|
+
/** `POST /widget/v1/inbox/read` with these ids (1 to 100). Idempotent. Settles the unread count after it. */
|
|
113
|
+
markRead(itemIds: readonly string[]): Promise<EverfurResult<number>>;
|
|
114
|
+
/** `POST /widget/v1/inbox/read` with `all`. Idempotent. Settles the unread count after it (0). */
|
|
115
|
+
markAllRead(): Promise<EverfurResult<number>>;
|
|
116
|
+
/** `GET /widget/v1/inbox/unread-count`. */
|
|
117
|
+
unreadCount(opts?: {
|
|
118
|
+
readonly signal?: AbortSignal;
|
|
119
|
+
}): Promise<EverfurResult<number>>;
|
|
120
|
+
}
|
|
121
|
+
/** The part of the runtime this client needs, read at call time. Any `EverfurRuntime` satisfies it. */
|
|
122
|
+
interface InboxRuntime {
|
|
123
|
+
readonly isDisposed: boolean;
|
|
124
|
+
readonly registry: {
|
|
125
|
+
readonly services: {
|
|
126
|
+
authFor(userRef: UserRef | null): AuthContext;
|
|
127
|
+
readonly errorPolicy: ErrorPolicyPort | undefined;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The client over the runtime under your provider (`useEverfurContext().runtime`). Auth is read at call time, so the
|
|
133
|
+
* client can be built once and reused across sign-ins; a disposed runtime settles every verb without a request.
|
|
134
|
+
*/
|
|
135
|
+
declare function createInboxClient(runtime: InboxRuntime): EverfurInboxClient;
|
|
136
|
+
|
|
137
|
+
/** Where the inbox stands. `off`: the inbox is not switched on for your tenant. */
|
|
138
|
+
type EverfurInboxStatus = 'idle' | 'loading' | 'ready' | 'off' | 'error';
|
|
139
|
+
interface EverfurInboxSnapshot {
|
|
140
|
+
readonly status: EverfurInboxStatus;
|
|
141
|
+
/** Every item read so far, newest first. */
|
|
142
|
+
readonly items: readonly EverfurInboxItem[];
|
|
143
|
+
/** The member's unread items across the inbox; null until a read answered. */
|
|
144
|
+
readonly unreadCount: number | null;
|
|
145
|
+
/** True while there are older items to read (`loadMore`). */
|
|
146
|
+
readonly hasMore: boolean;
|
|
147
|
+
/** A `refresh` is reading the first page again. */
|
|
148
|
+
readonly refreshing: boolean;
|
|
149
|
+
/** A `loadMore` is reading an older page. */
|
|
150
|
+
readonly loadingMore: boolean;
|
|
151
|
+
/** The last read's failure, or null. `error.displayMessage` is safe to show. */
|
|
152
|
+
readonly error: EverfurError | null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface UseEverfurInboxOptions {
|
|
156
|
+
/** Only this pet's items. Absent, every item of the member (the inbox is the member's, not one pet's). */
|
|
157
|
+
readonly petRef?: PetRef | null;
|
|
158
|
+
/** Items per page, 1 to 50 (default 20). */
|
|
159
|
+
readonly pageSize?: number;
|
|
160
|
+
/**
|
|
161
|
+
* When to read again. Absent, the host's own signals (the page becoming visible again on the web, and a push
|
|
162
|
+
* Everfur's service worker received; the app returning to the foreground on React Native); pass your port to add
|
|
163
|
+
* your own push announcement (`onAnnounced`), or `null` to read on mount only.
|
|
164
|
+
*/
|
|
165
|
+
readonly lifecycle?: LifecyclePort | null;
|
|
166
|
+
}
|
|
167
|
+
interface EverfurInboxState extends EverfurInboxSnapshot {
|
|
168
|
+
/** Read the first page again now (a retry, a pull to refresh). Settles; never throws. */
|
|
169
|
+
refresh(): Promise<void>;
|
|
170
|
+
/** Read the next older page. */
|
|
171
|
+
loadMore(): Promise<void>;
|
|
172
|
+
markRead(itemId: string): Promise<EverfurResult<void>>;
|
|
173
|
+
markAllRead(): Promise<EverfurResult<void>>;
|
|
174
|
+
/** The item ready to route (read from Everfur when it is not on screen), marked read. */
|
|
175
|
+
open(ref: {
|
|
176
|
+
readonly itemId?: string;
|
|
177
|
+
readonly eventId?: string;
|
|
178
|
+
}): Promise<EverfurResult<EverfurInboxOpen>>;
|
|
179
|
+
}
|
|
180
|
+
/** The inbox client bound to the runtime under your provider. */
|
|
181
|
+
declare function useEverfurInboxClient(): EverfurInboxClient;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Called with a tapped item, already marked read. Route `open.notification?.target` (or `open.item.target`) as you
|
|
185
|
+
* route a tapped push. Return `false` to have the inbox show the item itself instead. A throw is swallowed.
|
|
186
|
+
*/
|
|
187
|
+
type EverfurInboxOpenHandler = (open: EverfurInboxOpen) => boolean | void;
|
|
188
|
+
|
|
189
|
+
interface UseEverfurInboxUnreadOptions {
|
|
190
|
+
/**
|
|
191
|
+
* When to read again. Absent, the host's own signals (as `useEverfurInbox`); pass your port to add your own push
|
|
192
|
+
* announcement (`onAnnounced`), or `null` to read on mount only.
|
|
193
|
+
*/
|
|
194
|
+
readonly lifecycle?: LifecyclePort | null;
|
|
195
|
+
}
|
|
196
|
+
interface EverfurInboxUnread {
|
|
197
|
+
/**
|
|
198
|
+
* The member's unread inbox items across pets, shared with `EverfurInbox`; null until read, while signed out, and
|
|
199
|
+
* while the inbox is off for your tenant.
|
|
200
|
+
*/
|
|
201
|
+
readonly unreadCount: number | null;
|
|
202
|
+
/** Read the count again now, for example from your own push handler. Settles; never throws. */
|
|
203
|
+
readonly refresh: () => Promise<void>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export { type EverfurInboxOpenHandler as E, type InboxRuntime as I, type UseEverfurInboxOptions as U, type EverfurInboxCopy as a, type EverfurInboxState as b, type UseEverfurInboxUnreadOptions as c, type EverfurInboxUnread as d, type EverfurInboxClient as e, type EverfurInboxItem as f, type EverfurInboxOpen as g, type EverfurInboxPage as h, type EverfurInboxQuery as i, type EverfurInboxSnapshot as j, type EverfurInboxStatus as k, type EverfurInboxTarget as l, createInboxClient as m, useEverfurInboxClient as u };
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
+
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
3
|
+
import { P as PetRef, U as UserRef } from './ids.d-B2GAAifq.cjs';
|
|
4
|
+
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
5
|
+
import { L as LifecyclePort } from './LifecyclePort.d-Cr1p33a7.cjs';
|
|
6
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort.d-DirW9hgO.cjs';
|
|
7
|
+
import { A as AuthContext } from './identity.d-CA7mW59I.cjs';
|
|
8
|
+
import { d as EverfurNotification } from './parse.d-DYsx1Q2V.cjs';
|
|
9
|
+
|
|
10
|
+
/** The words of the inbox. Every key is a plain string. */
|
|
11
|
+
interface EverfurInboxCopy {
|
|
12
|
+
/** The list's heading and accessible name. */
|
|
13
|
+
readonly title: string;
|
|
14
|
+
/** The loading state's accessible name. */
|
|
15
|
+
readonly loading: string;
|
|
16
|
+
readonly emptyTitle: string;
|
|
17
|
+
readonly emptyBody: string;
|
|
18
|
+
/** The list failed to load. */
|
|
19
|
+
readonly errorTitle: string;
|
|
20
|
+
readonly errorBody: string;
|
|
21
|
+
readonly retry: string;
|
|
22
|
+
/** A row whose title arrived empty. */
|
|
23
|
+
readonly rowFallbackTitle: string;
|
|
24
|
+
/** Before an unread row's accessible name. */
|
|
25
|
+
readonly unreadPrefix: string;
|
|
26
|
+
/** After a relative time in an accessible name ("2h ago"). */
|
|
27
|
+
readonly timeAgoSuffix: string;
|
|
28
|
+
/** A time under a minute ago. */
|
|
29
|
+
readonly now: string;
|
|
30
|
+
/** Read the next older page. */
|
|
31
|
+
readonly more: string;
|
|
32
|
+
/** One item failed to load. */
|
|
33
|
+
readonly detailErrorTitle: string;
|
|
34
|
+
readonly detailErrorBody: string;
|
|
35
|
+
/** One item is gone (expired after 90 days, or removed). */
|
|
36
|
+
readonly notFoundTitle: string;
|
|
37
|
+
readonly notFoundBody: string;
|
|
38
|
+
/** Back from one item to the list. */
|
|
39
|
+
readonly back: string;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* What an inbox item is about, as the wire names it: `kind`, then the item's references under their wire keys
|
|
44
|
+
* (`pet_ref`, `visit_ref`, `intent`...). Values are short opaque strings or null; route on `kind` and treat a kind
|
|
45
|
+
* you do not know as "open the item".
|
|
46
|
+
*/
|
|
47
|
+
interface EverfurInboxTarget {
|
|
48
|
+
readonly kind: string;
|
|
49
|
+
readonly [key: string]: string | null;
|
|
50
|
+
}
|
|
51
|
+
/** One inbox item. */
|
|
52
|
+
interface EverfurInboxItem {
|
|
53
|
+
/** Everfur's id for the item (`inb_...`). */
|
|
54
|
+
readonly id: string;
|
|
55
|
+
/** The notification type's settings key (`playbook.C07`, `partner.record.ready`...). */
|
|
56
|
+
readonly typeKey: string;
|
|
57
|
+
/** The partner event type when there is one (`record.ready`), else null. */
|
|
58
|
+
readonly eventType: string | null;
|
|
59
|
+
/** The event id (`evt_...`) the same message carried on push, when there is one. */
|
|
60
|
+
readonly eventId: string | null;
|
|
61
|
+
/** The words Everfur wrote for the member. Plain text: render it as text, never as markup. */
|
|
62
|
+
readonly title: string;
|
|
63
|
+
readonly body: string;
|
|
64
|
+
/** Your pet reference the item is about, or null. */
|
|
65
|
+
readonly petRef: PetRef | null;
|
|
66
|
+
/** What the item is about, or null when it is a message with nothing to open. */
|
|
67
|
+
readonly target: EverfurInboxTarget | null;
|
|
68
|
+
/** ISO 8601. */
|
|
69
|
+
readonly createdAt: string;
|
|
70
|
+
/** ISO 8601, or null while unread. */
|
|
71
|
+
readonly readAt: string | null;
|
|
72
|
+
}
|
|
73
|
+
/** One page of the inbox, newest first. */
|
|
74
|
+
interface EverfurInboxPage {
|
|
75
|
+
readonly items: readonly EverfurInboxItem[];
|
|
76
|
+
/** Pass it back as `cursor` for the next (older) page; null on the last page. */
|
|
77
|
+
readonly nextCursor: string | null;
|
|
78
|
+
/** The member's unread items across the whole inbox. */
|
|
79
|
+
readonly unreadCount: number;
|
|
80
|
+
}
|
|
81
|
+
/** What `listPage` reads. Every field is optional. */
|
|
82
|
+
interface EverfurInboxQuery {
|
|
83
|
+
/** Items per page, 1 to 50 (default 20). */
|
|
84
|
+
readonly limit?: number;
|
|
85
|
+
/** The `nextCursor` of the page before. */
|
|
86
|
+
readonly cursor?: string;
|
|
87
|
+
/** Only the items about this pet. */
|
|
88
|
+
readonly petRef?: PetRef;
|
|
89
|
+
/** Only the item of this event (`evt_...`): how a tapped web push finds its item. */
|
|
90
|
+
readonly eventId?: string;
|
|
91
|
+
}
|
|
92
|
+
/** A tapped item, ready to route: the item, and the typed routing block when the item carries one. */
|
|
93
|
+
interface EverfurInboxOpen {
|
|
94
|
+
readonly item: EverfurInboxItem;
|
|
95
|
+
/**
|
|
96
|
+
* The item's target read the way `parseEverfurNotification` reads a tapped push, or null when the item names no
|
|
97
|
+
* event or its target is malformed (a kind this release does not know parses as `unknown`, as on a push). Route on
|
|
98
|
+
* `notification.target.kind` when present;
|
|
99
|
+
* otherwise on `item.target`, or show the item itself.
|
|
100
|
+
*/
|
|
101
|
+
readonly notification: EverfurNotification | null;
|
|
102
|
+
}
|
|
103
|
+
interface EverfurInboxClient {
|
|
104
|
+
/** `GET /widget/v1/inbox`. Settles `ok(EverfurInboxPage)`; the not-found error while the inbox is off for your tenant. */
|
|
105
|
+
listPage(query?: EverfurInboxQuery, opts?: {
|
|
106
|
+
readonly signal?: AbortSignal;
|
|
107
|
+
}): Promise<EverfurResult<EverfurInboxPage>>;
|
|
108
|
+
/** `GET /widget/v1/inbox/{item_id}`. An unknown, expired or another member's item is the not-found error. */
|
|
109
|
+
getItem(itemId: string, opts?: {
|
|
110
|
+
readonly signal?: AbortSignal;
|
|
111
|
+
}): Promise<EverfurResult<EverfurInboxItem>>;
|
|
112
|
+
/** `POST /widget/v1/inbox/read` with these ids (1 to 100). Idempotent. Settles the unread count after it. */
|
|
113
|
+
markRead(itemIds: readonly string[]): Promise<EverfurResult<number>>;
|
|
114
|
+
/** `POST /widget/v1/inbox/read` with `all`. Idempotent. Settles the unread count after it (0). */
|
|
115
|
+
markAllRead(): Promise<EverfurResult<number>>;
|
|
116
|
+
/** `GET /widget/v1/inbox/unread-count`. */
|
|
117
|
+
unreadCount(opts?: {
|
|
118
|
+
readonly signal?: AbortSignal;
|
|
119
|
+
}): Promise<EverfurResult<number>>;
|
|
120
|
+
}
|
|
121
|
+
/** The part of the runtime this client needs, read at call time. Any `EverfurRuntime` satisfies it. */
|
|
122
|
+
interface InboxRuntime {
|
|
123
|
+
readonly isDisposed: boolean;
|
|
124
|
+
readonly registry: {
|
|
125
|
+
readonly services: {
|
|
126
|
+
authFor(userRef: UserRef | null): AuthContext;
|
|
127
|
+
readonly errorPolicy: ErrorPolicyPort | undefined;
|
|
128
|
+
};
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* The client over the runtime under your provider (`useEverfurContext().runtime`). Auth is read at call time, so the
|
|
133
|
+
* client can be built once and reused across sign-ins; a disposed runtime settles every verb without a request.
|
|
134
|
+
*/
|
|
135
|
+
declare function createInboxClient(runtime: InboxRuntime): EverfurInboxClient;
|
|
136
|
+
|
|
137
|
+
/** Where the inbox stands. `off`: the inbox is not switched on for your tenant. */
|
|
138
|
+
type EverfurInboxStatus = 'idle' | 'loading' | 'ready' | 'off' | 'error';
|
|
139
|
+
interface EverfurInboxSnapshot {
|
|
140
|
+
readonly status: EverfurInboxStatus;
|
|
141
|
+
/** Every item read so far, newest first. */
|
|
142
|
+
readonly items: readonly EverfurInboxItem[];
|
|
143
|
+
/** The member's unread items across the inbox; null until a read answered. */
|
|
144
|
+
readonly unreadCount: number | null;
|
|
145
|
+
/** True while there are older items to read (`loadMore`). */
|
|
146
|
+
readonly hasMore: boolean;
|
|
147
|
+
/** A `refresh` is reading the first page again. */
|
|
148
|
+
readonly refreshing: boolean;
|
|
149
|
+
/** A `loadMore` is reading an older page. */
|
|
150
|
+
readonly loadingMore: boolean;
|
|
151
|
+
/** The last read's failure, or null. `error.displayMessage` is safe to show. */
|
|
152
|
+
readonly error: EverfurError | null;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface UseEverfurInboxOptions {
|
|
156
|
+
/** Only this pet's items. Absent, every item of the member (the inbox is the member's, not one pet's). */
|
|
157
|
+
readonly petRef?: PetRef | null;
|
|
158
|
+
/** Items per page, 1 to 50 (default 20). */
|
|
159
|
+
readonly pageSize?: number;
|
|
160
|
+
/**
|
|
161
|
+
* When to read again. Absent, the host's own signals (the page becoming visible again on the web, and a push
|
|
162
|
+
* Everfur's service worker received; the app returning to the foreground on React Native); pass your port to add
|
|
163
|
+
* your own push announcement (`onAnnounced`), or `null` to read on mount only.
|
|
164
|
+
*/
|
|
165
|
+
readonly lifecycle?: LifecyclePort | null;
|
|
166
|
+
}
|
|
167
|
+
interface EverfurInboxState extends EverfurInboxSnapshot {
|
|
168
|
+
/** Read the first page again now (a retry, a pull to refresh). Settles; never throws. */
|
|
169
|
+
refresh(): Promise<void>;
|
|
170
|
+
/** Read the next older page. */
|
|
171
|
+
loadMore(): Promise<void>;
|
|
172
|
+
markRead(itemId: string): Promise<EverfurResult<void>>;
|
|
173
|
+
markAllRead(): Promise<EverfurResult<void>>;
|
|
174
|
+
/** The item ready to route (read from Everfur when it is not on screen), marked read. */
|
|
175
|
+
open(ref: {
|
|
176
|
+
readonly itemId?: string;
|
|
177
|
+
readonly eventId?: string;
|
|
178
|
+
}): Promise<EverfurResult<EverfurInboxOpen>>;
|
|
179
|
+
}
|
|
180
|
+
/** The inbox client bound to the runtime under your provider. */
|
|
181
|
+
declare function useEverfurInboxClient(): EverfurInboxClient;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Called with a tapped item, already marked read. Route `open.notification?.target` (or `open.item.target`) as you
|
|
185
|
+
* route a tapped push. Return `false` to have the inbox show the item itself instead. A throw is swallowed.
|
|
186
|
+
*/
|
|
187
|
+
type EverfurInboxOpenHandler = (open: EverfurInboxOpen) => boolean | void;
|
|
188
|
+
|
|
189
|
+
interface UseEverfurInboxUnreadOptions {
|
|
190
|
+
/**
|
|
191
|
+
* When to read again. Absent, the host's own signals (as `useEverfurInbox`); pass your port to add your own push
|
|
192
|
+
* announcement (`onAnnounced`), or `null` to read on mount only.
|
|
193
|
+
*/
|
|
194
|
+
readonly lifecycle?: LifecyclePort | null;
|
|
195
|
+
}
|
|
196
|
+
interface EverfurInboxUnread {
|
|
197
|
+
/**
|
|
198
|
+
* The member's unread inbox items across pets, shared with `EverfurInbox`; null until read, while signed out, and
|
|
199
|
+
* while the inbox is off for your tenant.
|
|
200
|
+
*/
|
|
201
|
+
readonly unreadCount: number | null;
|
|
202
|
+
/** Read the count again now, for example from your own push handler. Settles; never throws. */
|
|
203
|
+
readonly refresh: () => Promise<void>;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
export { type EverfurInboxOpenHandler as E, type InboxRuntime as I, type UseEverfurInboxOptions as U, type EverfurInboxCopy as a, type EverfurInboxState as b, type UseEverfurInboxUnreadOptions as c, type EverfurInboxUnread as d, type EverfurInboxClient as e, type EverfurInboxItem as f, type EverfurInboxOpen as g, type EverfurInboxPage as h, type EverfurInboxQuery as i, type EverfurInboxSnapshot as j, type EverfurInboxStatus as k, type EverfurInboxTarget as l, createInboxClient as m, useEverfurInboxClient as u };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { s as HealthPlanReasonKind, b as HealthPlanItem, p as HealthPlan, q as HealthPlanRepository, t as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-
|
|
2
|
+
import { s as HealthPlanReasonKind, b as HealthPlanItem, p as HealthPlan, q as HealthPlanRepository, t as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-RJMXplJc.cjs';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
5
5
|
import { P as PetRef } from './ids.d-B2GAAifq.cjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*! @everfur/sdk. Copyright (c) 2026 Strand Health Inc. dba Everfur. All rights reserved. Use is subject to the Everfur SDK License: https://docs.everfur.com/license */
|
|
2
|
-
import { s as HealthPlanReasonKind, b as HealthPlanItem, p as HealthPlan, q as HealthPlanRepository, t as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-
|
|
2
|
+
import { s as HealthPlanReasonKind, b as HealthPlanItem, p as HealthPlan, q as HealthPlanRepository, t as HealthPlanPagePet, c as HealthPlanFocusDesign, H as HealthPlanPage } from './focus.d-CG6KhDBK.js';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
|
|
5
5
|
import { P as PetRef } from './ids.d-B2GAAifq.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.cjs';
|
|
3
3
|
import { E as EverfurResult } from './EverfurResult.d-BFH-3s6E.cjs';
|
|
4
4
|
import { P as PetRef } from './ids.d-B2GAAifq.cjs';
|
|
5
|
-
import { l as RecordsDepthClient } from './depth.d-
|
|
5
|
+
import { l as RecordsDepthClient } from './depth.d-BYwddMNU.cjs';
|
|
6
6
|
|
|
7
7
|
type RecordsDepthStatus = 'loading' | 'empty' | 'error' | 'populated';
|
|
8
8
|
/** One depth read as a render state. `withheld` (no consent, or a fail-closed parse) renders nothing. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { E as EverfurError } from './EverfurError.d-8NHtlgzA.js';
|
|
3
3
|
import { E as EverfurResult } from './EverfurResult.d-D_-254ZY.js';
|
|
4
4
|
import { P as PetRef } from './ids.d-B2GAAifq.js';
|
|
5
|
-
import { l as RecordsDepthClient } from './depth.d-
|
|
5
|
+
import { l as RecordsDepthClient } from './depth.d-C99_xup2.js';
|
|
6
6
|
|
|
7
7
|
type RecordsDepthStatus = 'loading' | 'empty' | 'error' | 'populated';
|
|
8
8
|
/** One depth read as a render state. `withheld` (no consent, or a fail-closed parse) renders nothing. */
|