@everfur/sdk 0.1.1 → 0.4.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 +703 -4
- package/README.md +63 -23
- package/consent/package.json +8 -0
- package/dist/Chat-BZZ-Py5l.d.ts +128 -0
- package/dist/Chat-Dq4fffIO.d.cts +128 -0
- package/dist/DepthViews-BG3E25MD.d.ts +16 -0
- package/dist/DepthViews-B_hIypI6.d.cts +19 -0
- package/dist/DepthViews-CL75jyRA.d.cts +16 -0
- package/dist/DepthViews-CkYri51q.d.ts +19 -0
- package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
- package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
- package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
- package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
- package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
- package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
- package/dist/animations/index.cjs +1 -1997
- package/dist/animations/index.d.cts +35 -35
- package/dist/animations/index.d.ts +35 -35
- package/dist/animations/index.js +1 -1972
- package/dist/attachments-BorG422I.d.cts +146 -0
- package/dist/attachments-BrUWQYNK.d.ts +257 -0
- package/dist/attachments-D_SECjr1.d.cts +257 -0
- package/dist/attachments-DpldrvIW.d.ts +146 -0
- package/dist/bookingCopy-CqtDYvCR.d.ts +732 -0
- package/dist/bookingCopy-SREvkG19.d.cts +732 -0
- package/dist/branding-CsRdeNwK.d.cts +566 -0
- package/dist/branding-CsRdeNwK.d.ts +566 -0
- package/dist/callCopy-DoQKG3-L.d.cts +40 -0
- package/dist/callCopy-DoQKG3-L.d.ts +40 -0
- package/dist/casesRepository-DwtZVsbj.d.cts +51 -0
- package/dist/casesRepository-v6QczS9N.d.ts +51 -0
- package/dist/chat/index.cjs +1 -1170
- package/dist/chat/index.d.cts +32 -53
- package/dist/chat/index.d.ts +32 -53
- package/dist/chat/index.js +1 -1167
- package/dist/client/index.cjs +9 -2315
- package/dist/client/index.d.cts +80 -16
- package/dist/client/index.d.ts +80 -16
- package/dist/client/index.js +9 -2215
- package/dist/{config-CiJ0PVBB.d.ts → config--Wu1Umhd.d.cts} +64 -26
- package/dist/{config-BSjBdxrZ.d.cts → config-C7eb_IMD.d.ts} +64 -26
- package/dist/consent/index.cjs +1 -0
- package/dist/consent/index.d.cts +33 -0
- package/dist/consent/index.d.ts +33 -0
- package/dist/consent/index.js +1 -0
- package/dist/context-CL3lyuy1.d.cts +159 -0
- package/dist/context-CahAEha8.d.ts +159 -0
- package/dist/copy-DdVFDL01.d.ts +198 -0
- package/dist/copy-UeUJVk8X.d.cts +198 -0
- package/dist/core/index.cjs +13 -3178
- package/dist/core/index.d.cts +164 -29
- package/dist/core/index.d.ts +164 -29
- package/dist/core/index.js +13 -3166
- package/dist/depth-D5HwcvKC.d.cts +533 -0
- package/dist/depth-DvPwPuT_.d.ts +533 -0
- package/dist/entitlementRepository-B7egEdW6.d.ts +43 -0
- package/dist/entitlementRepository-BpJ7tiwl.d.cts +43 -0
- package/dist/{identity-Brl-lDd6.d.cts → identity-C2-08BZW.d.cts} +20 -7
- package/dist/{identity-DK9zORrG.d.ts → identity-CEi9GRFZ.d.ts} +20 -7
- package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
- package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
- package/dist/index.cjs +12 -4494
- package/dist/index.d.cts +30 -121
- package/dist/index.d.ts +30 -121
- package/dist/index.js +12 -4470
- package/dist/models-B-Uh2LTf.d.ts +214 -0
- package/dist/models-D2EUxPZY.d.cts +214 -0
- package/dist/notifications/index.cjs +2 -0
- package/dist/notifications/index.d.cts +17 -0
- package/dist/notifications/index.d.ts +17 -0
- package/dist/notifications/index.js +2 -0
- package/dist/optionalModule-DbJmsq5f.d.cts +21 -0
- package/dist/optionalModule-DbJmsq5f.d.ts +21 -0
- package/dist/pets-DJv2sj2H.d.ts +92 -0
- package/dist/pets-JVCXgRgR.d.cts +92 -0
- package/dist/petsRepository-B_gKbAzJ.d.cts +142 -0
- package/dist/petsRepository-Bk6GDwLs.d.ts +142 -0
- package/dist/photo/index.cjs +1 -2189
- package/dist/photo/index.d.cts +6 -6
- package/dist/photo/index.d.ts +6 -6
- package/dist/photo/index.js +1 -2186
- package/dist/ports-BN6RHF9W.d.cts +48 -0
- package/dist/ports-BN6RHF9W.d.ts +48 -0
- package/dist/ports-BY2ph0_y.d.cts +376 -0
- package/dist/ports-D7YW8qz9.d.ts +376 -0
- package/dist/profile-CSs1wlXT.d.cts +93 -0
- package/dist/profile-CSs1wlXT.d.ts +93 -0
- package/dist/records/depth/index.cjs +2 -0
- package/dist/records/depth/index.d.cts +13 -0
- package/dist/records/depth/index.d.ts +13 -0
- package/dist/records/depth/index.js +2 -0
- package/dist/records/index.cjs +3 -2839
- package/dist/records/index.d.cts +137 -203
- package/dist/records/index.d.ts +137 -203
- package/dist/records/index.js +3 -2833
- package/dist/requestFunnel-BjDpqqvm.d.cts +110 -0
- package/dist/requestFunnel-DFMGcluw.d.ts +110 -0
- package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
- package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
- package/dist/{runtime-Bvr8yqXm.d.cts → runtimeTypes-gZEJu-da.d.cts} +104 -132
- package/dist/{runtime-BIYzf9cK.d.ts → runtimeTypes-w5KqBMcs.d.ts} +104 -132
- package/dist/server/events/index.cjs +2 -0
- package/dist/server/events/index.d.cts +550 -0
- package/dist/server/events/index.d.ts +550 -0
- package/dist/server/events/index.js +2 -0
- package/dist/server/index.cjs +2 -533
- package/dist/server/index.d.cts +73 -18
- package/dist/server/index.d.ts +73 -18
- package/dist/server/index.js +2 -530
- package/dist/species-BXAIMh7I.d.cts +9 -0
- package/dist/species-BXAIMh7I.d.ts +9 -0
- package/dist/televet/booking/index.cjs +1 -0
- package/dist/televet/booking/index.d.cts +294 -0
- package/dist/televet/booking/index.d.ts +294 -0
- package/dist/televet/booking/index.js +1 -0
- package/dist/televet/call/index.cjs +1 -0
- package/dist/televet/call/index.d.cts +141 -0
- package/dist/televet/call/index.d.ts +141 -0
- package/dist/televet/call/index.js +1 -0
- package/dist/televet/index.cjs +1 -0
- package/dist/televet/index.d.cts +142 -0
- package/dist/televet/index.d.ts +142 -0
- package/dist/televet/index.js +1 -0
- package/dist/testing/index.cjs +5 -823
- package/dist/testing/index.d.cts +18 -4
- package/dist/testing/index.d.ts +18 -4
- package/dist/testing/index.js +5 -820
- package/dist/testing/rn/index.cjs +1 -449
- package/dist/testing/rn/index.d.cts +18 -29
- package/dist/testing/rn/index.d.ts +18 -29
- package/dist/testing/rn/index.js +1 -444
- package/dist/testing/web/index.cjs +1 -0
- package/dist/testing/web/index.d.cts +132 -0
- package/dist/testing/web/index.d.ts +132 -0
- package/dist/testing/web/index.js +1 -0
- package/dist/timelineRows-C15jxFFH.d.ts +19 -0
- package/dist/timelineRows-odO8g9r2.d.cts +19 -0
- package/dist/typeStyle-CKqVYD6L.d.cts +111 -0
- package/dist/typeStyle-DmoyacDG.d.ts +111 -0
- package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
- package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
- package/dist/useRecordsDepth-C6rjEaLn.d.cts +237 -0
- package/dist/useRecordsDepth-crhBllQK.d.ts +237 -0
- package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
- package/dist/useVetVisit-CjmMa896.d.ts +187 -0
- package/dist/video/index.cjs +1 -1941
- package/dist/video/index.d.cts +4 -4
- package/dist/video/index.d.ts +4 -4
- package/dist/video/index.js +1 -1938
- package/dist/view-Bxwxp4xD.d.ts +310 -0
- package/dist/view-DyitEO0m.d.cts +310 -0
- package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
- package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
- package/dist/web/consent/index.cjs +1 -0
- package/dist/web/consent/index.d.cts +34 -0
- package/dist/web/consent/index.d.ts +34 -0
- package/dist/web/consent/index.js +1 -0
- package/dist/web/index.cjs +14 -0
- package/dist/web/index.d.cts +218 -0
- package/dist/web/index.d.ts +218 -0
- package/dist/web/index.js +14 -0
- package/dist/web/notifications/index.cjs +2 -0
- package/dist/web/notifications/index.d.cts +213 -0
- package/dist/web/notifications/index.d.ts +213 -0
- package/dist/web/notifications/index.js +2 -0
- package/dist/web/records/depth/index.cjs +2 -0
- package/dist/web/records/depth/index.d.cts +12 -0
- package/dist/web/records/depth/index.d.ts +12 -0
- package/dist/web/records/depth/index.js +2 -0
- package/dist/web/records/index.cjs +4 -0
- package/dist/web/records/index.d.cts +285 -0
- package/dist/web/records/index.d.ts +285 -0
- package/dist/web/records/index.js +4 -0
- package/dist/web/televet/booking/index.cjs +1 -0
- package/dist/web/televet/booking/index.d.cts +349 -0
- package/dist/web/televet/booking/index.d.ts +349 -0
- package/dist/web/televet/booking/index.js +1 -0
- package/dist/web/televet/call/index.cjs +1 -0
- package/dist/web/televet/call/index.d.cts +142 -0
- package/dist/web/televet/call/index.d.ts +142 -0
- package/dist/web/televet/call/index.js +1 -0
- package/dist/web/televet/index.cjs +1 -0
- package/dist/web/televet/index.d.cts +136 -0
- package/dist/web/televet/index.d.ts +136 -0
- package/dist/web/televet/index.js +1 -0
- package/notifications/package.json +8 -0
- package/package.json +266 -10
- package/records/depth/package.json +8 -0
- package/server/events/device-blocked.cjs +15 -0
- package/server/events/package.json +9 -0
- package/televet/booking/package.json +8 -0
- package/televet/call/package.json +8 -0
- package/televet/package.json +8 -0
- package/testing/web/native-blocked.cjs +12 -0
- package/testing/web/package.json +8 -0
- package/web/consent/native-blocked.cjs +12 -0
- package/web/consent/package.json +8 -0
- package/web/native-blocked.cjs +12 -0
- package/web/notifications/native-blocked.cjs +12 -0
- package/web/notifications/package.json +8 -0
- package/web/package.json +8 -0
- package/web/records/depth/native-blocked.cjs +12 -0
- package/web/records/depth/package.json +8 -0
- package/web/records/native-blocked.cjs +12 -0
- package/web/records/package.json +8 -0
- package/web/televet/booking/native-blocked.cjs +12 -0
- package/web/televet/booking/package.json +8 -0
- package/web/televet/call/native-blocked.cjs +12 -0
- package/web/televet/call/package.json +8 -0
- package/web/televet/native-blocked.cjs +12 -0
- package/web/televet/package.json +8 -0
- package/dist/ChatController-CKdBvPj2.d.ts +0 -146
- package/dist/ChatController-CpUMvvZf.d.cts +0 -146
- package/dist/FilePort-BabWrv7I.d.cts +0 -22
- package/dist/FilePort-BabWrv7I.d.ts +0 -22
- package/dist/petsRepository-BEGb97M9.d.cts +0 -326
- package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
- package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
- package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import { ReactNode, CSSProperties } from 'react';
|
|
2
|
+
import { P as PetRef } from '../../../ids-B2GAAifq.js';
|
|
3
|
+
export { B as Brand, _ as __brand } from '../../../ids-B2GAAifq.js';
|
|
4
|
+
import { T as TelevetConsult, a as TelevetBookingStep, b as TelevetBookingController, c as TelevetSlot } from '../../../bookingCopy-CqtDYvCR.js';
|
|
5
|
+
export { C as CANCELLATION_POLICY_VERSION_MAX, d as CONSULT_KINDS, e as CONSULT_MINUTES, f as CONSULT_STATUSES, g as ConsultKind, h as ConsultStatus, M as MEDIA_REFS_MAX, R as REASON_TEXT_MAX, i as TELEVET_BOOKING_BASE, j as TELEVET_BOOKING_COPY, k as TELEVET_BOOKING_STEPS, l as TERMINAL_CONSULT_STATUSES, m as TelevetBookingAction, n as TelevetBookingBody, o as TelevetBookingContext, p as TelevetBookingControllerDeps, q as TelevetBookingCopy, r as TelevetBookingDraft, s as TelevetBookingEntitlement, t as TelevetBookingRefusal, u as TelevetBookingState, v as TelevetCancellationPolicy, w as TelevetClinician, x as TelevetRead, y as TelevetSlotHold, z as TelevetStatePolicy, A as TelevetWrite, B as attestation, D as canConfirm, E as createTelevetBookingController, F as currentStep, G as emptyTelevetDraft, H as formatVisitRange, I as formatWhen, J as formatWhenWithDay, K as hasPreviousStep, L as initialTelevetBookingState, N as isHoldExpired, O as isSkipped, P as isTelevetBookingCopyReady, Q as isWellFormedStateCode, S as televetBookingKey, U as televetBookingReducer, V as televetBookingRefusal, W as televetHoldCall, X as televetRescheduleCall, Y as useTelevetBookConsult, Z as useTelevetBookingAvailable, _ as useTelevetBookingController, $ as useTelevetBookingEntitlement, a0 as useTelevetCancellationPolicy, a1 as useTelevetClinicians, a2 as useTelevetHoldSlot, a3 as useTelevetNextSlot, a4 as useTelevetRescheduleConsult, a5 as useTelevetSlots, a6 as useTelevetStatePolicy, a7 as validateBookingBody } from '../../../bookingCopy-CqtDYvCR.js';
|
|
6
|
+
export { E as EverfurError, a as EverfurErrorCategory, b as EverfurErrorCode, c as EverfurResult } from '../../../EverfurResult-DN9pL2Ab.js';
|
|
7
|
+
export { W as WidgetPet } from '../../../petsRepository-Bk6GDwLs.js';
|
|
8
|
+
import '../../../requestFunnel-DFMGcluw.js';
|
|
9
|
+
import '../../../ErrorPolicyPort-CwbfmxzJ.js';
|
|
10
|
+
import '../../../config-C7eb_IMD.js';
|
|
11
|
+
import '../../../identity-CEi9GRFZ.js';
|
|
12
|
+
import '../../../TelemetryPort-BDNr00hu.js';
|
|
13
|
+
import '../../../profile-CSs1wlXT.js';
|
|
14
|
+
|
|
15
|
+
/** The calendar entry a booked visit asks the host to write. */
|
|
16
|
+
interface TelevetCalendarEvent {
|
|
17
|
+
/**
|
|
18
|
+
* A stable key for THIS consult's entry.
|
|
19
|
+
*
|
|
20
|
+
* Keyed on the CONSULT so a re-press updates the same entry rather than writing a second event for one
|
|
21
|
+
* visit, and so a later cancel or reschedule can address the SAME row. A host that ignores the key writes
|
|
22
|
+
* duplicates the owner has to clean up by hand.
|
|
23
|
+
*/
|
|
24
|
+
readonly key: string;
|
|
25
|
+
readonly title: string;
|
|
26
|
+
readonly startDate: Date;
|
|
27
|
+
readonly endDate: Date;
|
|
28
|
+
/** The reminder offset in minutes, negative for "before". The platform queues its own at the same offset. */
|
|
29
|
+
readonly alarmOffsetMinutes: number;
|
|
30
|
+
}
|
|
31
|
+
/** Writes the entry. Resolves true when it landed; false when the host has no calendar to write to. */
|
|
32
|
+
type TelevetCalendarWriter = (event: TelevetCalendarEvent) => Promise<boolean>;
|
|
33
|
+
/** The calendar key for a consult. One definition, so a cancel and a reschedule address the booked row. */
|
|
34
|
+
declare function televetConsultCalendarKey(consultId: string): string;
|
|
35
|
+
interface TelevetBookedScreenProps {
|
|
36
|
+
readonly consult: TelevetConsult;
|
|
37
|
+
readonly petName: string | null;
|
|
38
|
+
readonly onDone: () => void;
|
|
39
|
+
/** Absent, there is no Add to calendar control. */
|
|
40
|
+
readonly onAddToCalendar?: TelevetCalendarWriter | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Has the host PROVEN it can host the call in place? Defaults to false.
|
|
43
|
+
*
|
|
44
|
+
* Fail closed: a host that has not said so is assumed not to have mounted the call surface, and the in-place
|
|
45
|
+
* join promise is withheld rather than printed on a hope.
|
|
46
|
+
*/
|
|
47
|
+
readonly canJoinInApp?: boolean;
|
|
48
|
+
}
|
|
49
|
+
declare function TelevetBookedScreen({ consult, petName, onDone, onAddToCalendar, canJoinInApp, }: TelevetBookedScreenProps): ReactNode;
|
|
50
|
+
|
|
51
|
+
/** The heading levels the DOM has elements for. */
|
|
52
|
+
type EverfurHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* The host's own discard confirmation.
|
|
56
|
+
*
|
|
57
|
+
* Receives the ported title, body and the two button labels, and resolves true to leave. A partner with its
|
|
58
|
+
* own dialog system passes this; absent, the SDK renders the in-page dialog below.
|
|
59
|
+
*/
|
|
60
|
+
type TelevetDiscardConfirm = (prompt: {
|
|
61
|
+
readonly title: string;
|
|
62
|
+
readonly body: string;
|
|
63
|
+
readonly confirmLabel: string;
|
|
64
|
+
readonly keepLabel: string;
|
|
65
|
+
}) => Promise<boolean>;
|
|
66
|
+
interface TelevetBookingChromeProps {
|
|
67
|
+
readonly step: TelevetBookingStep;
|
|
68
|
+
readonly furthestIndex: number;
|
|
69
|
+
/** The title on the bar. The reschedule flow passes its own, so the bar never says "Book a visit" there. */
|
|
70
|
+
readonly title?: string;
|
|
71
|
+
/** False on the first visible step, where Back would leave the flow entirely. */
|
|
72
|
+
readonly canGoBack: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Has the owner entered anything worth losing?
|
|
75
|
+
*
|
|
76
|
+
* Gates the discard confirm AND the `beforeunload` backstop. A confirm on an untouched flow is a pointless
|
|
77
|
+
* obstacle; NO confirm on a flow holding typed clinical text is the actual defect, because that text is
|
|
78
|
+
* volatile component state with no draft to restore it from.
|
|
79
|
+
*/
|
|
80
|
+
readonly isDirty: boolean;
|
|
81
|
+
readonly onBack: () => void;
|
|
82
|
+
readonly onClose: () => void;
|
|
83
|
+
readonly onConfirmDiscard?: TelevetDiscardConfirm | undefined;
|
|
84
|
+
/**
|
|
85
|
+
* The heading level of the bar's title. Defaults to 2, the level an embedded surface may safely claim.
|
|
86
|
+
*
|
|
87
|
+
* Pass 1 only when the flow IS the page in your app. See `src/web/headingLevel.ts`.
|
|
88
|
+
*/
|
|
89
|
+
readonly headingLevel?: EverfurHeadingLevel | undefined;
|
|
90
|
+
}
|
|
91
|
+
declare function TelevetBookingChrome({ step, furthestIndex, title, canGoBack, isDirty, onBack, onClose, onConfirmDiscard, headingLevel: level, }: TelevetBookingChromeProps): ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* The back control's spoken label.
|
|
94
|
+
*
|
|
95
|
+
* "Back" is the platform word for the control and is not product copy, which is why it is a constant here and
|
|
96
|
+
* not a key in the ported deck. The web records port declares the same constant for the same reason.
|
|
97
|
+
*/
|
|
98
|
+
declare const BACK_LABEL = "Back";
|
|
99
|
+
|
|
100
|
+
/** A picked-but-not-yet-uploaded attachment, in the host's own terms. */
|
|
101
|
+
interface TelevetIntakeMediaItem {
|
|
102
|
+
readonly uri: string;
|
|
103
|
+
readonly filename: string;
|
|
104
|
+
readonly mimeType: string;
|
|
105
|
+
readonly fileSize: number;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* The host's media picker.
|
|
109
|
+
*
|
|
110
|
+
* Resolves the picks, or null when the owner cancelled. The SDK takes no picker dependency and opens no file
|
|
111
|
+
* dialog of its own; a partner supplies whichever picker its site already has, typically an `<input
|
|
112
|
+
* type="file">` whose `File` objects it turns into object URLs.
|
|
113
|
+
*
|
|
114
|
+
* `limit` is the remaining headroom, so the host can cap its own selection rather than returning picks this
|
|
115
|
+
* row has to silently discard.
|
|
116
|
+
*/
|
|
117
|
+
type TelevetMediaPicker = (limit: number) => Promise<readonly TelevetIntakeMediaItem[] | null>;
|
|
118
|
+
interface TelevetIntakeMediaProps {
|
|
119
|
+
readonly media: readonly TelevetIntakeMediaItem[];
|
|
120
|
+
readonly onChange: (next: readonly TelevetIntakeMediaItem[]) => void;
|
|
121
|
+
/** Absent, the row renders nothing at all. There is no disabled Add control. */
|
|
122
|
+
readonly onPickMedia?: TelevetMediaPicker | undefined;
|
|
123
|
+
/**
|
|
124
|
+
* The list's accessible name.
|
|
125
|
+
*
|
|
126
|
+
* Required, with no default string here: naming the group is what makes the tiles announce as a set, and
|
|
127
|
+
* the name is user-facing copy this SDK does not author. The intake step passes a ported key down.
|
|
128
|
+
*/
|
|
129
|
+
readonly listLabel: string;
|
|
130
|
+
}
|
|
131
|
+
declare function TelevetIntakeMedia({ media, onChange, onPickMedia, listLabel }: TelevetIntakeMediaProps): ReactNode;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Why a booking did not complete.
|
|
135
|
+
*
|
|
136
|
+
* `not_entitled` is separated from `failed` because the two need opposite affordances: a transient failure
|
|
137
|
+
* invites a retry, and a 402 must not. `unavailable` is separated from both because no retry can succeed.
|
|
138
|
+
*/
|
|
139
|
+
type TelevetBookingFailure = 'taken' | 'expired' | 'failed' | 'not_entitled'
|
|
140
|
+
/** The remedy is a DIFFERENT VET, not a different time: re-picking a slot with the same clinician refuses again. */
|
|
141
|
+
| 'clinician_unavailable'
|
|
142
|
+
/** Per-owner caps. The remedy is WAITING, so this must never render as an invitation to press again. */
|
|
143
|
+
| 'rate_limited'
|
|
144
|
+
/** The partner booking surface is not served here. The remedy is the hosted visit, not a retry. */
|
|
145
|
+
| 'unavailable' | null;
|
|
146
|
+
/** What the host can tell us about a location it could not resolve, so the right card renders. */
|
|
147
|
+
type TelevetLocationStatus = 'unknown' | 'blocked' | 'unavailable';
|
|
148
|
+
interface EverfurTelevetBookingProps {
|
|
149
|
+
/** The pet the visit is for. Seeds the draft; a one-pet roster skips the picker entirely. */
|
|
150
|
+
readonly petRef?: PetRef | null;
|
|
151
|
+
/** The owner's two-letter US state. The SDK never reads a browser location for it. */
|
|
152
|
+
readonly usState?: string | null;
|
|
153
|
+
/** Host/test seam: inject a booking controller instead of building one from the provider's session. */
|
|
154
|
+
readonly controller?: TelevetBookingController;
|
|
155
|
+
readonly onBooked?: (consult: TelevetConsult) => void;
|
|
156
|
+
/** Leaves the flow. The flow never navigates itself, so the same screens work in a modal, a tab or a route. */
|
|
157
|
+
readonly onExit?: () => void;
|
|
158
|
+
/** Leaves the flow to create a pet, then comes back. Absent, the empty roster has no action. */
|
|
159
|
+
readonly onAddPet?: () => void;
|
|
160
|
+
/** The host's media picker for the intake step. Absent, there is no attachment row. */
|
|
161
|
+
readonly onPickMedia?: TelevetMediaPicker;
|
|
162
|
+
/** The host's calendar writer for the confirmation. Absent, there is no Add to calendar control. */
|
|
163
|
+
readonly onAddToCalendar?: TelevetCalendarWriter;
|
|
164
|
+
/** The host's own discard dialog. Absent, the SDK renders its own `<dialog>`. */
|
|
165
|
+
readonly onConfirmDiscard?: TelevetDiscardConfirm;
|
|
166
|
+
/** Asks the host to resolve the owner's state again. Absent, the location cards render without an action. */
|
|
167
|
+
readonly onRequestLocation?: () => void;
|
|
168
|
+
/** Why the host has no state for us, so the right card renders. */
|
|
169
|
+
readonly locationStatus?: TelevetLocationStatus;
|
|
170
|
+
/**
|
|
171
|
+
* Has the host PROVEN it can host the call in place? Defaults to false.
|
|
172
|
+
*
|
|
173
|
+
* Fail closed: without the call surface mounted the confirmation must not promise an in-place join.
|
|
174
|
+
*/
|
|
175
|
+
readonly canJoinInApp?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* What to render when the partner booking surface is not served for this tenant.
|
|
178
|
+
*
|
|
179
|
+
* THE FLOW WILL NOT DEAD-END. Absent this, an unserved surface renders the paused card, which is a state but
|
|
180
|
+
* not a way forward; the prebuilt flow passes the hosted-visit handoff here so the owner still reaches a vet.
|
|
181
|
+
*/
|
|
182
|
+
readonly renderUnavailable?: () => ReactNode;
|
|
183
|
+
/**
|
|
184
|
+
* The heading level this flow's title claims. Defaults to 2.
|
|
185
|
+
*
|
|
186
|
+
* A DROP-IN WIDGET DOES NOT OWN YOUR PAGE'S `<h1>`, so the default is 2 and every heading inside the flow
|
|
187
|
+
* sits one level below it. Pass 1 when the flow IS the page in your app. See `src/web/headingLevel.ts` for
|
|
188
|
+
* the full reasoning and for why the default falls on the safe side rather than on the tidier one.
|
|
189
|
+
*/
|
|
190
|
+
readonly headingLevel?: number;
|
|
191
|
+
readonly style?: CSSProperties;
|
|
192
|
+
readonly testID?: string;
|
|
193
|
+
}
|
|
194
|
+
declare function EverfurTelevetBooking(props: EverfurTelevetBookingProps): ReactNode;
|
|
195
|
+
|
|
196
|
+
/** The screens of the televet stack. */
|
|
197
|
+
type TelevetScreen = {
|
|
198
|
+
readonly name: 'booking';
|
|
199
|
+
} | {
|
|
200
|
+
readonly name: 'reschedule';
|
|
201
|
+
readonly consult: TelevetConsult;
|
|
202
|
+
};
|
|
203
|
+
/** How the flow's own stack relates to the browser's history. */
|
|
204
|
+
type TelevetHistoryMode = 'memory' | 'browser';
|
|
205
|
+
interface EverfurTelevetProps {
|
|
206
|
+
/** The pet the visit is for. Seeds the draft; a one-pet roster skips the picker entirely. */
|
|
207
|
+
readonly petRef?: PetRef | null;
|
|
208
|
+
/** The owner's two-letter US state. The SDK never reads a browser location for it. */
|
|
209
|
+
readonly usState?: string | null;
|
|
210
|
+
/** Host/test seam: inject a booking controller instead of building one from the provider's session. */
|
|
211
|
+
readonly controller?: TelevetBookingController;
|
|
212
|
+
readonly onBooked?: (consult: TelevetConsult) => void;
|
|
213
|
+
/** The root screen's exit; absent, the root's Close does nothing and the host owns leaving. */
|
|
214
|
+
readonly onExit?: () => void;
|
|
215
|
+
readonly onAddPet?: () => void;
|
|
216
|
+
readonly onPickMedia?: TelevetMediaPicker;
|
|
217
|
+
readonly onAddToCalendar?: TelevetCalendarWriter;
|
|
218
|
+
readonly onConfirmDiscard?: TelevetDiscardConfirm;
|
|
219
|
+
readonly onRequestLocation?: () => void;
|
|
220
|
+
readonly locationStatus?: TelevetLocationStatus;
|
|
221
|
+
/**
|
|
222
|
+
* How the flow's stack relates to the browser's history. `memory` by default, which never touches
|
|
223
|
+
* `history`: a widget embedded in someone else's page must not take over their back button.
|
|
224
|
+
*/
|
|
225
|
+
readonly historyMode?: TelevetHistoryMode;
|
|
226
|
+
/**
|
|
227
|
+
* Has the host mounted the call surface (`@everfur/sdk/web/televet/call`)? Defaults to FALSE.
|
|
228
|
+
*
|
|
229
|
+
* Fail closed. A partner that has not said so gets a confirmation that promises only what it can keep.
|
|
230
|
+
*/
|
|
231
|
+
readonly canJoinInApp?: boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Replace the hosted-visit fallback shown when the in-page booking surface is not served.
|
|
234
|
+
*
|
|
235
|
+
* The default is the published `VetVisitButton`, which mints the single-use handoff and opens the hosted
|
|
236
|
+
* Everfur visit. Passing `null` here is not a way to remove it: a flow with no fallback dead-ends, so an
|
|
237
|
+
* explicit render prop is the only way to change it.
|
|
238
|
+
*/
|
|
239
|
+
readonly renderUnavailable?: () => ReactNode;
|
|
240
|
+
/** The screen the flow starts on; the booking flow when omitted. */
|
|
241
|
+
readonly initialScreen?: TelevetScreen;
|
|
242
|
+
/**
|
|
243
|
+
* The heading level this flow's title claims. Defaults to 2.
|
|
244
|
+
*
|
|
245
|
+
* A DROP-IN WIDGET DOES NOT OWN YOUR PAGE'S `<h1>`. Pass 1 only when the flow IS the page in your app; every
|
|
246
|
+
* heading inside the flow then follows one level below. See `src/web/headingLevel.ts`.
|
|
247
|
+
*/
|
|
248
|
+
readonly headingLevel?: number;
|
|
249
|
+
readonly style?: CSSProperties;
|
|
250
|
+
/** Your own placeholder while the entitlement verdict is pending on a cold mount. */
|
|
251
|
+
readonly renderPending?: () => ReactNode;
|
|
252
|
+
/** A class the host may hang its own layout rules on; the SDK sets no classes of its own. */
|
|
253
|
+
readonly className?: string;
|
|
254
|
+
}
|
|
255
|
+
declare function EverfurTelevetFlow(props: EverfurTelevetProps): ReactNode;
|
|
256
|
+
/** The public prebuilt televet surface: the flow, starting at booking. */
|
|
257
|
+
declare const EverfurTelevet: typeof EverfurTelevetFlow;
|
|
258
|
+
|
|
259
|
+
interface EverfurTelevetRescheduleProps {
|
|
260
|
+
/** The consult being moved. Null while the host is still loading it. */
|
|
261
|
+
readonly consult: TelevetConsult | null;
|
|
262
|
+
readonly onRescheduled?: (moved: TelevetConsult) => void;
|
|
263
|
+
/** Backing out. Never destructive: the original consult is left exactly as it was. */
|
|
264
|
+
readonly onCancel?: () => void;
|
|
265
|
+
/** Host/test seam: inject a booking controller instead of building one from the provider's session. */
|
|
266
|
+
readonly controller?: TelevetBookingController;
|
|
267
|
+
readonly style?: CSSProperties;
|
|
268
|
+
readonly testID?: string;
|
|
269
|
+
}
|
|
270
|
+
declare function EverfurTelevetReschedule(props: EverfurTelevetRescheduleProps): ReactNode;
|
|
271
|
+
|
|
272
|
+
interface TelevetDay {
|
|
273
|
+
readonly key: string;
|
|
274
|
+
readonly iso: string;
|
|
275
|
+
readonly weekday: string;
|
|
276
|
+
readonly dayNumber: string;
|
|
277
|
+
}
|
|
278
|
+
interface TelevetDayStripProps {
|
|
279
|
+
readonly slots: readonly TelevetSlot[];
|
|
280
|
+
readonly selectedDayKey: string | null;
|
|
281
|
+
readonly onSelectDay: (day: TelevetDay) => void;
|
|
282
|
+
/**
|
|
283
|
+
* The group's accessible name.
|
|
284
|
+
*
|
|
285
|
+
* A PROP WITH NO DEFAULT STRING IN THIS FILE. Naming the group is required for the radiogroup to be
|
|
286
|
+
* announced usefully, and the name is user-facing copy, which this SDK does not author. The slot picker
|
|
287
|
+
* passes the ported deck's own heading down.
|
|
288
|
+
*/
|
|
289
|
+
readonly groupLabel: string;
|
|
290
|
+
}
|
|
291
|
+
/** The day strip. Renders nothing when the window holds no readable day. */
|
|
292
|
+
declare function TelevetDayStrip({ slots, selectedDayKey, onSelectDay, groupLabel }: TelevetDayStripProps): ReactNode;
|
|
293
|
+
/**
|
|
294
|
+
* The distinct local days the slots cover, in server order.
|
|
295
|
+
*
|
|
296
|
+
* Exported for the picker, which needs the first day to seed the selection, and for the suite. Identical to
|
|
297
|
+
* the RN implementation: this is pure data and the port changes nothing about it.
|
|
298
|
+
*/
|
|
299
|
+
declare function televetDaysFromSlots(slots: readonly TelevetSlot[]): readonly TelevetDay[];
|
|
300
|
+
|
|
301
|
+
interface TelevetSlotPickerProps {
|
|
302
|
+
/** The server's full window. Never truncated: the day filter is what bounds it. */
|
|
303
|
+
readonly slots: readonly TelevetSlot[];
|
|
304
|
+
/** The slot whose hold is in flight, or null. Disables the whole grid. */
|
|
305
|
+
readonly busySlotId: string | null;
|
|
306
|
+
readonly onPick: (slot: TelevetSlot) => void;
|
|
307
|
+
/** Rendered above the strip, for example a failure line from the container. */
|
|
308
|
+
readonly header?: ReactNode;
|
|
309
|
+
/**
|
|
310
|
+
* The accessible name for the day strip and the time grid.
|
|
311
|
+
*
|
|
312
|
+
* Required, with no default written here: it is user-facing copy and this SDK authors none. The containers
|
|
313
|
+
* pass the ported deck's own headings down.
|
|
314
|
+
*/
|
|
315
|
+
readonly dayGroupLabel: string;
|
|
316
|
+
readonly timeGroupLabel: string;
|
|
317
|
+
readonly rowTestIdPrefix?: string;
|
|
318
|
+
readonly testID?: string;
|
|
319
|
+
}
|
|
320
|
+
declare function TelevetSlotPicker({ slots, busySlotId, onPick, header, dayGroupLabel, timeGroupLabel, rowTestIdPrefix, testID, }: TelevetSlotPickerProps): ReactNode;
|
|
321
|
+
|
|
322
|
+
/** One "label ... value" row in the summary card, as a bound `<dt>` / `<dd>` pair. */
|
|
323
|
+
declare function TelevetSummaryRow({ label, value, last, testID, }: {
|
|
324
|
+
readonly label: string;
|
|
325
|
+
readonly value: string;
|
|
326
|
+
/** The last row draws no divider, so the card does not end on a line. */
|
|
327
|
+
readonly last?: boolean;
|
|
328
|
+
readonly testID?: string;
|
|
329
|
+
}): ReactNode;
|
|
330
|
+
/**
|
|
331
|
+
* A consent tick.
|
|
332
|
+
*
|
|
333
|
+
* A REAL CHECKBOX. `accessibilityRole="checkbox"` with a `checked` state is what makes a screen reader announce
|
|
334
|
+
* it as an agreement rather than a button; in the DOM the element itself does that, and also brings focus,
|
|
335
|
+
* Space-to-toggle and the label-wraps-input behaviour for free.
|
|
336
|
+
*/
|
|
337
|
+
declare function TelevetConsentCheckbox({ label, checked, onToggle, testID, }: {
|
|
338
|
+
readonly label: string;
|
|
339
|
+
readonly checked: boolean;
|
|
340
|
+
readonly onToggle: (next: boolean) => void;
|
|
341
|
+
readonly testID?: string;
|
|
342
|
+
}): ReactNode;
|
|
343
|
+
/** The summary card's own frame, exported so the container does not re-declare it. */
|
|
344
|
+
declare function TelevetSummaryCard({ children, testID }: {
|
|
345
|
+
readonly children: ReactNode;
|
|
346
|
+
readonly testID?: string;
|
|
347
|
+
}): ReactNode;
|
|
348
|
+
|
|
349
|
+
export { BACK_LABEL, type EverfurHeadingLevel, EverfurTelevet, EverfurTelevetBooking, type EverfurTelevetBookingProps, EverfurTelevetFlow, type EverfurTelevetProps, EverfurTelevetReschedule, type EverfurTelevetRescheduleProps, PetRef, TelevetBookedScreen, type TelevetBookedScreenProps, TelevetBookingChrome, type TelevetBookingChromeProps, TelevetBookingController, type TelevetBookingFailure, TelevetBookingStep, type TelevetCalendarEvent, type TelevetCalendarWriter, TelevetConsentCheckbox, TelevetConsult, type TelevetDay, TelevetDayStrip, type TelevetDayStripProps, type TelevetDiscardConfirm, type TelevetHistoryMode, TelevetIntakeMedia, type TelevetIntakeMediaItem, type TelevetIntakeMediaProps, type TelevetLocationStatus, type TelevetMediaPicker, type TelevetScreen, TelevetSlot, TelevetSlotPicker, type TelevetSlotPickerProps, TelevetSummaryCard, TelevetSummaryRow, televetConsultCalendarKey, televetDaysFromSlots };
|