@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
package/dist/core/index.d.cts
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
export { K as KvPort } from '../cacheEpoch-DknKn3S0.cjs';
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
2
|
+
import { C as CreateEverfurRuntimeInput, e as EverfurRuntime } from '../runtimeTypes-gZEJu-da.cjs';
|
|
3
|
+
export { B as BeforeLogoutContext, f as BeforeLogoutHook, g as CapabilityKind, h as CapabilityRegistry, i as CapabilityServices, j as ChatControllerRegistry, k as ChatScope, E as EntitlementSnapshot, l as EntitlementStore, m as EverfurRuntimeConfig, L as LogLevel, a as LogRecord, b as LogSink, N as NULL_SECURE_STORE, P as PrepareOptions, c as PrepareResult, d as PrepareStatus, R as RuntimeTheme, n as RuntimeUser, S as SecureStorePort } from '../runtimeTypes-gZEJu-da.cjs';
|
|
4
|
+
import { T as TelemetryPort } from '../TelemetryPort-BDNr00hu.cjs';
|
|
5
|
+
export { n as noopTelemetry } from '../TelemetryPort-BDNr00hu.cjs';
|
|
6
|
+
export { E as ErrorPolicyPort, d as defaultErrorPolicy } from '../ErrorPolicyPort-CNf4uQZP.cjs';
|
|
6
7
|
export { C as CameraPort, a as CaptureOptions, M as MediaSource, u as unavailableCamera } from '../CameraPort-Cv31Pz7g.cjs';
|
|
7
|
-
export { F as FileHandle,
|
|
8
|
-
|
|
9
|
-
import '../
|
|
10
|
-
|
|
11
|
-
import '../EverfurResult-
|
|
12
|
-
import '../
|
|
13
|
-
|
|
14
|
-
import '../
|
|
8
|
+
export { F as FileHandle, b as FilePort } from '../ports-BN6RHF9W.cjs';
|
|
9
|
+
export { O as OptionalModule, o as optionalModule } from '../optionalModule-DbJmsq5f.cjs';
|
|
10
|
+
import { m as ChatControllerDeps, l as ChatController, n as SuggestedPromptCategory } from '../ports-BY2ph0_y.cjs';
|
|
11
|
+
export { o as CHAT_FEEDBACK_TYPES, p as CHECKIN_ANSWERABLE_STATUS, C as ChatCheckin, a as ChatCheckinTarget, b as ChatConversation, c as ChatConversationListOptions, d as ChatConversationPage, e as ChatFeedbackReceipt, f as ChatFeedbackType, q as ChatHandlers, g as ChatHistoryOptions, i as ChatMessage, h as ChatMessagePage, r as ChatSnapshot, j as ChatStatus, k as Citation, F as FEEDBACK_NOTES_MAX_CHARS, M as MAX_IMAGE_KEYS_PER_MESSAGE, S as SendOptions, s as Timers, t as isCheckinSettled } from '../ports-BY2ph0_y.cjs';
|
|
12
|
+
import { E as EverfurError } from '../EverfurResult-DN9pL2Ab.cjs';
|
|
13
|
+
import { P as PetRef, C as ConversationId } from '../ids-B2GAAifq.cjs';
|
|
14
|
+
export { f as ATTACHMENT_ACCEPT, g as ATTACHMENT_BACKOFF_MS, h as ATTACHMENT_INITIATE_PATH, i as ATTACHMENT_MAX_ATTEMPTS, j as ATTACHMENT_MIME_TYPES, k as ATTACHMENT_QUEUE_CONCURRENCY, A as AttachmentError, a as AttachmentErrorCode, b as AttachmentOutcome, c as AttachmentQueue, l as AttachmentQueueDeps, m as AttachmentQueueSnapshot, d as AttachmentState, e as AttachmentStatus, n as AttachmentUploadPolicy, M as MAX_ATTACHMENTS_PER_MESSAGE, o as MAX_ATTACHMENT_BYTES, p as MAX_FILENAME_LENGTH, V as ValidatedAttachment, q as attachmentSize, r as createAttachmentQueue, s as formatBytes, t as initiateAttachmentUpload, u as isAttachmentMime, v as sanitizeFilename, w as uploadAttachmentBytes, x as validateAttachment } from '../attachments-BorG422I.cjs';
|
|
15
|
+
import { p as EventSourceFactory, G as SdkPlatform } from '../config--Wu1Umhd.cjs';
|
|
16
|
+
import { a as EntitlementResolution, F as FetchEntitlementsArgs } from '../entitlementRepository-BpJ7tiwl.cjs';
|
|
17
|
+
import { E as EntitlementDecision } from '../resolve-D4Ywz5OS.cjs';
|
|
18
|
+
import { A as AuthContext } from '../identity-C2-08BZW.cjs';
|
|
19
|
+
import { C as ClientBranding } from '../branding-CsRdeNwK.cjs';
|
|
20
|
+
export { E as EverfurThemeInput } from '../branding-CsRdeNwK.cjs';
|
|
21
|
+
export { C as CreateClinicRequestBatchInput, F as FACT_FIELD_BY_KIND, w as FACT_VALUE_FIELD, x as FactFieldValue, y as FactValueKind, H as HttpRecordsClinicRepositoryDeps, z as HttpRecordsRepositoryDeps, A as RECORDS_CLINIC_BATCH_MAX, R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, B as RecordFactEditInput, D as RecordFactRemoveInput, i as RecordLabMarker, j as RecordLabPoint, E as RecordMarker, G as RecordMarkerLatest, I as RecordMarkerPoint, J as RecordMarkerSummary, K as RecordMarkersView, L as RecordPdfLink, k as RecordPhysicalExam, M as RecordShare, N as RecordShareLink, O as RecordsAuthorizationSignature, P as RecordsClinicBatch, Q as RecordsClinicBatchClient, S as RecordsClinicBatchItem, T as RecordsClinicBatchResult, U as RecordsClinicTarget, m as RecordsDepthClient, n as RecordsRequestDocument, V as RecordsSignatureSuggestion, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, W as createRecordsClinicBatchClient, X as createRecordsDepthClient, Y as factCorrectionFor, Z as factValueCorrection, _ as inferFactValueKind, $ as isFactReviewerLocked, t as mapDocumentContributions, u as mapRecordDepth, a0 as mapRecordMarkers, a1 as mapRecordPdfLink, a2 as mapRecordShareLink, a3 as mapRecordShareList, v as mapRecordsTimeline, a4 as mapSignatureSuggestions, a5 as resolveShareUrl } from '../depth-D5HwcvKC.cjs';
|
|
22
|
+
export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin, f as RecordsRequestGroupView, d as RecordsRequestView } from '../models-D2EUxPZY.cjs';
|
|
23
|
+
export { C as CheckinAnswer, a as CheckinOutcome, W as WatchCase } from '../casesRepository-DwtZVsbj.cjs';
|
|
24
|
+
import '../petsRepository-B_gKbAzJ.cjs';
|
|
25
|
+
import '../profile-CSs1wlXT.cjs';
|
|
26
|
+
import '../requestFunnel-BjDpqqvm.cjs';
|
|
15
27
|
|
|
16
|
-
/** The settled outcome of a guarded optional-module load. Never a throw. */
|
|
17
|
-
type OptionalModule<T> = {
|
|
18
|
-
readonly available: true;
|
|
19
|
-
readonly module: T;
|
|
20
|
-
} | {
|
|
21
|
-
readonly available: false;
|
|
22
|
-
readonly module: null;
|
|
23
|
-
readonly reason: string;
|
|
24
|
-
};
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
+
* The server's own limits on a chat message, mirrored here so a violation is caught before any UI is
|
|
30
|
+
* rendered for it. `SendWidgetMessageRequest.message` on EFBackend main declares
|
|
31
|
+
* `min_length=1, max_length=4000`; the server remains authoritative and still enforces both.
|
|
29
32
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @param validate optional shape guard; when it returns false the module is treated as unavailable.
|
|
33
|
+
* These are NOT in the generated contract projection, so they are pinned here with their source rather
|
|
34
|
+
* than derived. If the server relaxes either bound, this is the one place to update.
|
|
33
35
|
*/
|
|
34
|
-
declare
|
|
36
|
+
declare const MESSAGE_MAX_CHARS = 4000;
|
|
37
|
+
|
|
38
|
+
declare function createChatController(deps: ChatControllerDeps): ChatController;
|
|
35
39
|
|
|
36
40
|
interface ChatBootstrapInput {
|
|
37
41
|
/** omit => general conversation */
|
|
@@ -56,6 +60,11 @@ interface ChatBootstrapResult {
|
|
|
56
60
|
readonly error: string | null;
|
|
57
61
|
/** SAFE display copy: conversation not pre-initialized; the first send retries */
|
|
58
62
|
readonly warning: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* The typed error behind `error` or `warning` (the auth block, else the conversation-init failure), null
|
|
65
|
+
* when the conversation was primed. `runtime.prepare()` reports it as the chat step's outcome.
|
|
66
|
+
*/
|
|
67
|
+
readonly cause: EverfurError | null;
|
|
59
68
|
readonly diagnostics: ChatBootstrapDiagnostics;
|
|
60
69
|
}
|
|
61
70
|
/**
|
|
@@ -67,4 +76,130 @@ declare function bootstrapChat(input: ChatBootstrapInput, deps: {
|
|
|
67
76
|
readonly controller: ChatController;
|
|
68
77
|
}): Promise<ChatBootstrapResult>;
|
|
69
78
|
|
|
70
|
-
|
|
79
|
+
/** Minimum re-poll interval; a server ttl below this is clamped so we never hot-loop the endpoint. */
|
|
80
|
+
declare const MIN_POLL_INTERVAL_SECONDS = 30;
|
|
81
|
+
/** Injectable timer seam so a suite drives the re-poll clock deterministically (default: global timers). */
|
|
82
|
+
type TimerHandle = ReturnType<typeof setTimeout>;
|
|
83
|
+
interface PollScheduler {
|
|
84
|
+
set(callback: () => void, ms: number): TimerHandle;
|
|
85
|
+
clear(handle: TimerHandle): void;
|
|
86
|
+
}
|
|
87
|
+
interface EntitlementPollerDeps {
|
|
88
|
+
/** Re-derived every poll so a token refresh / user re-scope is reflected on the next hop. */
|
|
89
|
+
readonly authFor: () => AuthContext;
|
|
90
|
+
/**
|
|
91
|
+
* Push a fresh verdict into the runtime store. Called ONLY on a 200 'updated'. Carries the server-driven
|
|
92
|
+
* branding parsed from the SAME body (null when absent/unparseable -> the compiled default theme); branding
|
|
93
|
+
* is additive and orthogonal to the decisions.
|
|
94
|
+
*/
|
|
95
|
+
readonly update: (decisions: readonly EntitlementDecision[], branding: ClientBranding | null) => void;
|
|
96
|
+
/** Optional region hint forwarded to the endpoint. */
|
|
97
|
+
readonly region?: string;
|
|
98
|
+
/** Called synchronously as each fetch starts; the runtime marks the store pending for a scope's first one. */
|
|
99
|
+
readonly onFetch?: () => void;
|
|
100
|
+
/**
|
|
101
|
+
* Called when a fetch settles for the current scope, whatever the outcome (`updated` after `update`,
|
|
102
|
+
* `notModified`, `failed`, a thrown resolve). Not called for a fetch a refresh() or stop() superseded.
|
|
103
|
+
*/
|
|
104
|
+
readonly onSettled?: () => void;
|
|
105
|
+
readonly telemetry?: TelemetryPort;
|
|
106
|
+
/** Test seam; defaults to global timers (unref'd so a live poll never pins a Node event loop). */
|
|
107
|
+
readonly scheduler?: PollScheduler;
|
|
108
|
+
/** Test seam; defaults to the real repository call. */
|
|
109
|
+
readonly resolve?: (auth: AuthContext, args: FetchEntitlementsArgs) => Promise<EntitlementResolution>;
|
|
110
|
+
/** Floor override for tests; defaults to MIN_POLL_INTERVAL_SECONDS. */
|
|
111
|
+
readonly floorSeconds?: number;
|
|
112
|
+
/** Test seam for deterministic failure-retry jitter; defaults to Math.random. */
|
|
113
|
+
readonly rng?: () => number;
|
|
114
|
+
}
|
|
115
|
+
interface EntitlementPoller {
|
|
116
|
+
/** Idempotent. Kicks an immediate first poll, then self-schedules on the returned cadence. */
|
|
117
|
+
start(): void;
|
|
118
|
+
/** Idempotent. Clears the pending timer and prevents any post-stop update (dispose calls this). */
|
|
119
|
+
stop(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Drop the cached revision and re-poll immediately. A user / pet re-scope invalidates the cached verdict, so
|
|
122
|
+
* the next request must be UNCONDITIONAL (no If-None-Match) to force a fresh 200 for the new scope.
|
|
123
|
+
*/
|
|
124
|
+
refresh(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Settle ONE verdict fetch and report it: the poll already in flight when one is (the warm-up rides the
|
|
127
|
+
* first tick rather than racing it), otherwise a fresh one. On a poller that was never started it fetches
|
|
128
|
+
* once and arms nothing. Resolves null when a stop() or refresh() superseded the fetch before it landed.
|
|
129
|
+
*/
|
|
130
|
+
prime(): Promise<EntitlementResolution | null>;
|
|
131
|
+
}
|
|
132
|
+
declare function createEntitlementPoller(deps: EntitlementPollerDeps): EntitlementPoller;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* How long `logout()` waits for the before-logout hooks before it proceeds without them. The device unregistration
|
|
136
|
+
* the notifications hook issues is one request; a partner's sign-out screen must never hang on a slow network.
|
|
137
|
+
*/
|
|
138
|
+
declare const LOGOUT_HOOK_BUDGET_MS = 3000;
|
|
139
|
+
|
|
140
|
+
/** Runtime-construction options, distinct from the partner-facing config (host wiring / test seams). */
|
|
141
|
+
interface CreateRuntimeOptions {
|
|
142
|
+
/**
|
|
143
|
+
* Whether to start the entitlement poller. Default: start ONLY when the transport was NOT injected (a real,
|
|
144
|
+
* base-URL runtime). An injected transport is the test seam, so auto-start stays OFF to keep MockTransport
|
|
145
|
+
* suites network-free; pass `true` to exercise the wired poller against a MockTransport.
|
|
146
|
+
*/
|
|
147
|
+
readonly startEntitlementPolling?: boolean;
|
|
148
|
+
/** Test seam: an injected scheduler so a suite can drive the entitlement re-poll timer deterministically. */
|
|
149
|
+
readonly pollScheduler?: PollScheduler;
|
|
150
|
+
/**
|
|
151
|
+
* Host-wiring seam: the EventSource factory the built HTTP transport falls back to when a streaming
|
|
152
|
+
* `res.body` is unavailable (stock RN fetch). The rn facade injects react-native-sse here so streaming works
|
|
153
|
+
* on stock React Native; core NEVER imports react-native-sse (it stays framework-free and only threads this
|
|
154
|
+
* through). Absent (web/expo, or an injected transport) => the fetch-body streaming path is used.
|
|
155
|
+
*/
|
|
156
|
+
readonly eventSourceFactory?: EventSourceFactory;
|
|
157
|
+
/**
|
|
158
|
+
* Host-wiring seam: which entry point built this runtime, sent as X-Everfur-SDK-Platform on every request.
|
|
159
|
+
* The rn facade leaves it at the default; the web facade names `web`. Never read from partner config, for
|
|
160
|
+
* the reason on `SdkPlatform`.
|
|
161
|
+
*/
|
|
162
|
+
readonly platform?: SdkPlatform;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Construct the runtime once (EverfurProvider mount). Builds the transport (injected test seam, else the
|
|
166
|
+
* real HTTP transport from the resolved client config), the IdentityProvider when a user is set, the
|
|
167
|
+
* capability registry, the entitlement store, and (for a real runtime) the entitlement poller.
|
|
168
|
+
* A config that cannot be resolved (missing publishableKey, or an unresolvable / non-https base URL when
|
|
169
|
+
* no transport is injected) does NOT throw: it yields a DISABLED runtime whose transport refuses and
|
|
170
|
+
* whose every capability settles to the deliberate off-state at `disabled.level === 'sdk_config'`.
|
|
171
|
+
* @throws {EverfurConfigError} only for a supplied ACTIVE secureStore, which expresses a security
|
|
172
|
+
* intent the SDK cannot yet honour and must not silently discard.
|
|
173
|
+
*/
|
|
174
|
+
declare function createEverfurRuntime(input: CreateEverfurRuntimeInput, opts?: CreateRuntimeOptions): EverfurRuntime;
|
|
175
|
+
|
|
176
|
+
/** The pad's fixed canvas, in bitmap pixels (a 3:1 signature strip). */
|
|
177
|
+
declare const SIGNATURE_CANVAS: Readonly<{
|
|
178
|
+
width: 360;
|
|
179
|
+
height: 120;
|
|
180
|
+
}>;
|
|
181
|
+
/** A one-bit bitmap: `pixels[y * width + x]` is 1 for ink, 0 for paper. */
|
|
182
|
+
interface SignatureBitmap {
|
|
183
|
+
readonly width: number;
|
|
184
|
+
readonly height: number;
|
|
185
|
+
readonly pixels: Uint8Array;
|
|
186
|
+
}
|
|
187
|
+
type SignaturePoint = readonly [number, number];
|
|
188
|
+
/**
|
|
189
|
+
* The pen strokes of the pad (each a polyline in canvas pixels) as ink. A single point is a dot; a stroke that
|
|
190
|
+
* leaves the canvas is clipped, never wrapped. A non-finite point is skipped, every coordinate is clamped near
|
|
191
|
+
* the canvas, and one stroke plots at most `MAX_STEPS_PER_STROKE` steps, so no input can pin the JS thread.
|
|
192
|
+
*/
|
|
193
|
+
declare function rasterizeStrokes(strokes: readonly (readonly SignaturePoint[])[], penRadius?: number): SignatureBitmap;
|
|
194
|
+
/**
|
|
195
|
+
* A typed name as ink, centred, shrunk to fit (the web pad's shrink-to-fit rule). The scale is the largest that
|
|
196
|
+
* fits the name on one line; a name too long even at scale 1 is clipped at the canvas edge rather than wrapped.
|
|
197
|
+
*/
|
|
198
|
+
declare function rasterizeTypedName(name: string): SignatureBitmap;
|
|
199
|
+
/**
|
|
200
|
+
* Encode a bitmap as a 1-bit grayscale PNG (ink is black on white), base64 for `signaturePngBase64`. The rows
|
|
201
|
+
* use filter type 0; the image data is one zlib stream (header, fixed-Huffman DEFLATE, Adler-32).
|
|
202
|
+
*/
|
|
203
|
+
declare function encodeSignaturePng(bitmap: SignatureBitmap): string;
|
|
204
|
+
|
|
205
|
+
export { type ChatBootstrapDiagnostics, type ChatBootstrapInput, type ChatBootstrapResult, ChatController, ChatControllerDeps, CreateEverfurRuntimeInput, type CreateRuntimeOptions, type EntitlementPoller, type EntitlementPollerDeps, EverfurRuntime, LOGOUT_HOOK_BUDGET_MS, MESSAGE_MAX_CHARS, MIN_POLL_INTERVAL_SECONDS, type PollScheduler, SIGNATURE_CANVAS, SdkPlatform, type SignatureBitmap, type SignaturePoint, SuggestedPromptCategory, TelemetryPort, type TimerHandle, bootstrapChat, createChatController, createEntitlementPoller, createEverfurRuntime, encodeSignaturePng, rasterizeStrokes, rasterizeTypedName };
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
export { K as KvPort } from '../cacheEpoch-DknKn3S0.js';
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
2
|
+
import { C as CreateEverfurRuntimeInput, e as EverfurRuntime } from '../runtimeTypes-w5KqBMcs.js';
|
|
3
|
+
export { B as BeforeLogoutContext, f as BeforeLogoutHook, g as CapabilityKind, h as CapabilityRegistry, i as CapabilityServices, j as ChatControllerRegistry, k as ChatScope, E as EntitlementSnapshot, l as EntitlementStore, m as EverfurRuntimeConfig, L as LogLevel, a as LogRecord, b as LogSink, N as NULL_SECURE_STORE, P as PrepareOptions, c as PrepareResult, d as PrepareStatus, R as RuntimeTheme, n as RuntimeUser, S as SecureStorePort } from '../runtimeTypes-w5KqBMcs.js';
|
|
4
|
+
import { T as TelemetryPort } from '../TelemetryPort-BDNr00hu.js';
|
|
5
|
+
export { n as noopTelemetry } from '../TelemetryPort-BDNr00hu.js';
|
|
6
|
+
export { E as ErrorPolicyPort, d as defaultErrorPolicy } from '../ErrorPolicyPort-CwbfmxzJ.js';
|
|
6
7
|
export { C as CameraPort, a as CaptureOptions, M as MediaSource, u as unavailableCamera } from '../CameraPort-Cv31Pz7g.js';
|
|
7
|
-
export { F as FileHandle,
|
|
8
|
-
|
|
9
|
-
import '../
|
|
10
|
-
|
|
11
|
-
import '../EverfurResult-
|
|
12
|
-
import '../
|
|
13
|
-
|
|
14
|
-
import '../
|
|
8
|
+
export { F as FileHandle, b as FilePort } from '../ports-BN6RHF9W.js';
|
|
9
|
+
export { O as OptionalModule, o as optionalModule } from '../optionalModule-DbJmsq5f.js';
|
|
10
|
+
import { m as ChatControllerDeps, l as ChatController, n as SuggestedPromptCategory } from '../ports-D7YW8qz9.js';
|
|
11
|
+
export { o as CHAT_FEEDBACK_TYPES, p as CHECKIN_ANSWERABLE_STATUS, C as ChatCheckin, a as ChatCheckinTarget, b as ChatConversation, c as ChatConversationListOptions, d as ChatConversationPage, e as ChatFeedbackReceipt, f as ChatFeedbackType, q as ChatHandlers, g as ChatHistoryOptions, i as ChatMessage, h as ChatMessagePage, r as ChatSnapshot, j as ChatStatus, k as Citation, F as FEEDBACK_NOTES_MAX_CHARS, M as MAX_IMAGE_KEYS_PER_MESSAGE, S as SendOptions, s as Timers, t as isCheckinSettled } from '../ports-D7YW8qz9.js';
|
|
12
|
+
import { E as EverfurError } from '../EverfurResult-DN9pL2Ab.js';
|
|
13
|
+
import { P as PetRef, C as ConversationId } from '../ids-B2GAAifq.js';
|
|
14
|
+
export { f as ATTACHMENT_ACCEPT, g as ATTACHMENT_BACKOFF_MS, h as ATTACHMENT_INITIATE_PATH, i as ATTACHMENT_MAX_ATTEMPTS, j as ATTACHMENT_MIME_TYPES, k as ATTACHMENT_QUEUE_CONCURRENCY, A as AttachmentError, a as AttachmentErrorCode, b as AttachmentOutcome, c as AttachmentQueue, l as AttachmentQueueDeps, m as AttachmentQueueSnapshot, d as AttachmentState, e as AttachmentStatus, n as AttachmentUploadPolicy, M as MAX_ATTACHMENTS_PER_MESSAGE, o as MAX_ATTACHMENT_BYTES, p as MAX_FILENAME_LENGTH, V as ValidatedAttachment, q as attachmentSize, r as createAttachmentQueue, s as formatBytes, t as initiateAttachmentUpload, u as isAttachmentMime, v as sanitizeFilename, w as uploadAttachmentBytes, x as validateAttachment } from '../attachments-DpldrvIW.js';
|
|
15
|
+
import { p as EventSourceFactory, G as SdkPlatform } from '../config-C7eb_IMD.js';
|
|
16
|
+
import { a as EntitlementResolution, F as FetchEntitlementsArgs } from '../entitlementRepository-B7egEdW6.js';
|
|
17
|
+
import { E as EntitlementDecision } from '../resolve-D4Ywz5OS.js';
|
|
18
|
+
import { A as AuthContext } from '../identity-CEi9GRFZ.js';
|
|
19
|
+
import { C as ClientBranding } from '../branding-CsRdeNwK.js';
|
|
20
|
+
export { E as EverfurThemeInput } from '../branding-CsRdeNwK.js';
|
|
21
|
+
export { C as CreateClinicRequestBatchInput, F as FACT_FIELD_BY_KIND, w as FACT_VALUE_FIELD, x as FactFieldValue, y as FactValueKind, H as HttpRecordsClinicRepositoryDeps, z as HttpRecordsRepositoryDeps, A as RECORDS_CLINIC_BATCH_MAX, R as RecordClinicianNote, a as RecordClinicianNoteSection, b as RecordCompleteness, c as RecordConflict, d as RecordConflictCandidate, e as RecordDepthView, f as RecordDocumentContributionsView, g as RecordEncounter, h as RecordExamSystem, B as RecordFactEditInput, D as RecordFactRemoveInput, i as RecordLabMarker, j as RecordLabPoint, E as RecordMarker, G as RecordMarkerLatest, I as RecordMarkerPoint, J as RecordMarkerSummary, K as RecordMarkersView, L as RecordPdfLink, k as RecordPhysicalExam, M as RecordShare, N as RecordShareLink, O as RecordsAuthorizationSignature, P as RecordsClinicBatch, Q as RecordsClinicBatchClient, S as RecordsClinicBatchItem, T as RecordsClinicBatchResult, U as RecordsClinicTarget, m as RecordsDepthClient, n as RecordsRequestDocument, V as RecordsSignatureSuggestion, o as RecordsTimelineMedication, p as RecordsTimelineVaccine, q as RecordsTimelineView, r as RecordsTimelineVisit, s as RecordsTimelineWeight, W as createRecordsClinicBatchClient, X as createRecordsDepthClient, Y as factCorrectionFor, Z as factValueCorrection, _ as inferFactValueKind, $ as isFactReviewerLocked, t as mapDocumentContributions, u as mapRecordDepth, a0 as mapRecordMarkers, a1 as mapRecordPdfLink, a2 as mapRecordShareLink, a3 as mapRecordShareList, v as mapRecordsTimeline, a4 as mapSignatureSuggestions, a5 as resolveShareUrl } from '../depth-DvPwPuT_.js';
|
|
22
|
+
export { R as RecordDocumentMeta, a as RecordEntity, b as RecordOrigin, f as RecordsRequestGroupView, d as RecordsRequestView } from '../models-B-Uh2LTf.js';
|
|
23
|
+
export { C as CheckinAnswer, a as CheckinOutcome, W as WatchCase } from '../casesRepository-v6QczS9N.js';
|
|
24
|
+
import '../petsRepository-Bk6GDwLs.js';
|
|
25
|
+
import '../profile-CSs1wlXT.js';
|
|
26
|
+
import '../requestFunnel-DFMGcluw.js';
|
|
15
27
|
|
|
16
|
-
/** The settled outcome of a guarded optional-module load. Never a throw. */
|
|
17
|
-
type OptionalModule<T> = {
|
|
18
|
-
readonly available: true;
|
|
19
|
-
readonly module: T;
|
|
20
|
-
} | {
|
|
21
|
-
readonly available: false;
|
|
22
|
-
readonly module: null;
|
|
23
|
-
readonly reason: string;
|
|
24
|
-
};
|
|
25
28
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
+
* The server's own limits on a chat message, mirrored here so a violation is caught before any UI is
|
|
30
|
+
* rendered for it. `SendWidgetMessageRequest.message` on EFBackend main declares
|
|
31
|
+
* `min_length=1, max_length=4000`; the server remains authoritative and still enforces both.
|
|
29
32
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
* @param validate optional shape guard; when it returns false the module is treated as unavailable.
|
|
33
|
+
* These are NOT in the generated contract projection, so they are pinned here with their source rather
|
|
34
|
+
* than derived. If the server relaxes either bound, this is the one place to update.
|
|
33
35
|
*/
|
|
34
|
-
declare
|
|
36
|
+
declare const MESSAGE_MAX_CHARS = 4000;
|
|
37
|
+
|
|
38
|
+
declare function createChatController(deps: ChatControllerDeps): ChatController;
|
|
35
39
|
|
|
36
40
|
interface ChatBootstrapInput {
|
|
37
41
|
/** omit => general conversation */
|
|
@@ -56,6 +60,11 @@ interface ChatBootstrapResult {
|
|
|
56
60
|
readonly error: string | null;
|
|
57
61
|
/** SAFE display copy: conversation not pre-initialized; the first send retries */
|
|
58
62
|
readonly warning: string | null;
|
|
63
|
+
/**
|
|
64
|
+
* The typed error behind `error` or `warning` (the auth block, else the conversation-init failure), null
|
|
65
|
+
* when the conversation was primed. `runtime.prepare()` reports it as the chat step's outcome.
|
|
66
|
+
*/
|
|
67
|
+
readonly cause: EverfurError | null;
|
|
59
68
|
readonly diagnostics: ChatBootstrapDiagnostics;
|
|
60
69
|
}
|
|
61
70
|
/**
|
|
@@ -67,4 +76,130 @@ declare function bootstrapChat(input: ChatBootstrapInput, deps: {
|
|
|
67
76
|
readonly controller: ChatController;
|
|
68
77
|
}): Promise<ChatBootstrapResult>;
|
|
69
78
|
|
|
70
|
-
|
|
79
|
+
/** Minimum re-poll interval; a server ttl below this is clamped so we never hot-loop the endpoint. */
|
|
80
|
+
declare const MIN_POLL_INTERVAL_SECONDS = 30;
|
|
81
|
+
/** Injectable timer seam so a suite drives the re-poll clock deterministically (default: global timers). */
|
|
82
|
+
type TimerHandle = ReturnType<typeof setTimeout>;
|
|
83
|
+
interface PollScheduler {
|
|
84
|
+
set(callback: () => void, ms: number): TimerHandle;
|
|
85
|
+
clear(handle: TimerHandle): void;
|
|
86
|
+
}
|
|
87
|
+
interface EntitlementPollerDeps {
|
|
88
|
+
/** Re-derived every poll so a token refresh / user re-scope is reflected on the next hop. */
|
|
89
|
+
readonly authFor: () => AuthContext;
|
|
90
|
+
/**
|
|
91
|
+
* Push a fresh verdict into the runtime store. Called ONLY on a 200 'updated'. Carries the server-driven
|
|
92
|
+
* branding parsed from the SAME body (null when absent/unparseable -> the compiled default theme); branding
|
|
93
|
+
* is additive and orthogonal to the decisions.
|
|
94
|
+
*/
|
|
95
|
+
readonly update: (decisions: readonly EntitlementDecision[], branding: ClientBranding | null) => void;
|
|
96
|
+
/** Optional region hint forwarded to the endpoint. */
|
|
97
|
+
readonly region?: string;
|
|
98
|
+
/** Called synchronously as each fetch starts; the runtime marks the store pending for a scope's first one. */
|
|
99
|
+
readonly onFetch?: () => void;
|
|
100
|
+
/**
|
|
101
|
+
* Called when a fetch settles for the current scope, whatever the outcome (`updated` after `update`,
|
|
102
|
+
* `notModified`, `failed`, a thrown resolve). Not called for a fetch a refresh() or stop() superseded.
|
|
103
|
+
*/
|
|
104
|
+
readonly onSettled?: () => void;
|
|
105
|
+
readonly telemetry?: TelemetryPort;
|
|
106
|
+
/** Test seam; defaults to global timers (unref'd so a live poll never pins a Node event loop). */
|
|
107
|
+
readonly scheduler?: PollScheduler;
|
|
108
|
+
/** Test seam; defaults to the real repository call. */
|
|
109
|
+
readonly resolve?: (auth: AuthContext, args: FetchEntitlementsArgs) => Promise<EntitlementResolution>;
|
|
110
|
+
/** Floor override for tests; defaults to MIN_POLL_INTERVAL_SECONDS. */
|
|
111
|
+
readonly floorSeconds?: number;
|
|
112
|
+
/** Test seam for deterministic failure-retry jitter; defaults to Math.random. */
|
|
113
|
+
readonly rng?: () => number;
|
|
114
|
+
}
|
|
115
|
+
interface EntitlementPoller {
|
|
116
|
+
/** Idempotent. Kicks an immediate first poll, then self-schedules on the returned cadence. */
|
|
117
|
+
start(): void;
|
|
118
|
+
/** Idempotent. Clears the pending timer and prevents any post-stop update (dispose calls this). */
|
|
119
|
+
stop(): void;
|
|
120
|
+
/**
|
|
121
|
+
* Drop the cached revision and re-poll immediately. A user / pet re-scope invalidates the cached verdict, so
|
|
122
|
+
* the next request must be UNCONDITIONAL (no If-None-Match) to force a fresh 200 for the new scope.
|
|
123
|
+
*/
|
|
124
|
+
refresh(): void;
|
|
125
|
+
/**
|
|
126
|
+
* Settle ONE verdict fetch and report it: the poll already in flight when one is (the warm-up rides the
|
|
127
|
+
* first tick rather than racing it), otherwise a fresh one. On a poller that was never started it fetches
|
|
128
|
+
* once and arms nothing. Resolves null when a stop() or refresh() superseded the fetch before it landed.
|
|
129
|
+
*/
|
|
130
|
+
prime(): Promise<EntitlementResolution | null>;
|
|
131
|
+
}
|
|
132
|
+
declare function createEntitlementPoller(deps: EntitlementPollerDeps): EntitlementPoller;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* How long `logout()` waits for the before-logout hooks before it proceeds without them. The device unregistration
|
|
136
|
+
* the notifications hook issues is one request; a partner's sign-out screen must never hang on a slow network.
|
|
137
|
+
*/
|
|
138
|
+
declare const LOGOUT_HOOK_BUDGET_MS = 3000;
|
|
139
|
+
|
|
140
|
+
/** Runtime-construction options, distinct from the partner-facing config (host wiring / test seams). */
|
|
141
|
+
interface CreateRuntimeOptions {
|
|
142
|
+
/**
|
|
143
|
+
* Whether to start the entitlement poller. Default: start ONLY when the transport was NOT injected (a real,
|
|
144
|
+
* base-URL runtime). An injected transport is the test seam, so auto-start stays OFF to keep MockTransport
|
|
145
|
+
* suites network-free; pass `true` to exercise the wired poller against a MockTransport.
|
|
146
|
+
*/
|
|
147
|
+
readonly startEntitlementPolling?: boolean;
|
|
148
|
+
/** Test seam: an injected scheduler so a suite can drive the entitlement re-poll timer deterministically. */
|
|
149
|
+
readonly pollScheduler?: PollScheduler;
|
|
150
|
+
/**
|
|
151
|
+
* Host-wiring seam: the EventSource factory the built HTTP transport falls back to when a streaming
|
|
152
|
+
* `res.body` is unavailable (stock RN fetch). The rn facade injects react-native-sse here so streaming works
|
|
153
|
+
* on stock React Native; core NEVER imports react-native-sse (it stays framework-free and only threads this
|
|
154
|
+
* through). Absent (web/expo, or an injected transport) => the fetch-body streaming path is used.
|
|
155
|
+
*/
|
|
156
|
+
readonly eventSourceFactory?: EventSourceFactory;
|
|
157
|
+
/**
|
|
158
|
+
* Host-wiring seam: which entry point built this runtime, sent as X-Everfur-SDK-Platform on every request.
|
|
159
|
+
* The rn facade leaves it at the default; the web facade names `web`. Never read from partner config, for
|
|
160
|
+
* the reason on `SdkPlatform`.
|
|
161
|
+
*/
|
|
162
|
+
readonly platform?: SdkPlatform;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Construct the runtime once (EverfurProvider mount). Builds the transport (injected test seam, else the
|
|
166
|
+
* real HTTP transport from the resolved client config), the IdentityProvider when a user is set, the
|
|
167
|
+
* capability registry, the entitlement store, and (for a real runtime) the entitlement poller.
|
|
168
|
+
* A config that cannot be resolved (missing publishableKey, or an unresolvable / non-https base URL when
|
|
169
|
+
* no transport is injected) does NOT throw: it yields a DISABLED runtime whose transport refuses and
|
|
170
|
+
* whose every capability settles to the deliberate off-state at `disabled.level === 'sdk_config'`.
|
|
171
|
+
* @throws {EverfurConfigError} only for a supplied ACTIVE secureStore, which expresses a security
|
|
172
|
+
* intent the SDK cannot yet honour and must not silently discard.
|
|
173
|
+
*/
|
|
174
|
+
declare function createEverfurRuntime(input: CreateEverfurRuntimeInput, opts?: CreateRuntimeOptions): EverfurRuntime;
|
|
175
|
+
|
|
176
|
+
/** The pad's fixed canvas, in bitmap pixels (a 3:1 signature strip). */
|
|
177
|
+
declare const SIGNATURE_CANVAS: Readonly<{
|
|
178
|
+
width: 360;
|
|
179
|
+
height: 120;
|
|
180
|
+
}>;
|
|
181
|
+
/** A one-bit bitmap: `pixels[y * width + x]` is 1 for ink, 0 for paper. */
|
|
182
|
+
interface SignatureBitmap {
|
|
183
|
+
readonly width: number;
|
|
184
|
+
readonly height: number;
|
|
185
|
+
readonly pixels: Uint8Array;
|
|
186
|
+
}
|
|
187
|
+
type SignaturePoint = readonly [number, number];
|
|
188
|
+
/**
|
|
189
|
+
* The pen strokes of the pad (each a polyline in canvas pixels) as ink. A single point is a dot; a stroke that
|
|
190
|
+
* leaves the canvas is clipped, never wrapped. A non-finite point is skipped, every coordinate is clamped near
|
|
191
|
+
* the canvas, and one stroke plots at most `MAX_STEPS_PER_STROKE` steps, so no input can pin the JS thread.
|
|
192
|
+
*/
|
|
193
|
+
declare function rasterizeStrokes(strokes: readonly (readonly SignaturePoint[])[], penRadius?: number): SignatureBitmap;
|
|
194
|
+
/**
|
|
195
|
+
* A typed name as ink, centred, shrunk to fit (the web pad's shrink-to-fit rule). The scale is the largest that
|
|
196
|
+
* fits the name on one line; a name too long even at scale 1 is clipped at the canvas edge rather than wrapped.
|
|
197
|
+
*/
|
|
198
|
+
declare function rasterizeTypedName(name: string): SignatureBitmap;
|
|
199
|
+
/**
|
|
200
|
+
* Encode a bitmap as a 1-bit grayscale PNG (ink is black on white), base64 for `signaturePngBase64`. The rows
|
|
201
|
+
* use filter type 0; the image data is one zlib stream (header, fixed-Huffman DEFLATE, Adler-32).
|
|
202
|
+
*/
|
|
203
|
+
declare function encodeSignaturePng(bitmap: SignatureBitmap): string;
|
|
204
|
+
|
|
205
|
+
export { type ChatBootstrapDiagnostics, type ChatBootstrapInput, type ChatBootstrapResult, ChatController, ChatControllerDeps, CreateEverfurRuntimeInput, type CreateRuntimeOptions, type EntitlementPoller, type EntitlementPollerDeps, EverfurRuntime, LOGOUT_HOOK_BUDGET_MS, MESSAGE_MAX_CHARS, MIN_POLL_INTERVAL_SECONDS, type PollScheduler, SIGNATURE_CANVAS, SdkPlatform, type SignatureBitmap, type SignaturePoint, SuggestedPromptCategory, TelemetryPort, type TimerHandle, bootstrapChat, createChatController, createEntitlementPoller, createEverfurRuntime, encodeSignaturePng, rasterizeStrokes, rasterizeTypedName };
|