@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,533 @@
|
|
|
1
|
+
import { c as EverfurResult, E as EverfurError } from './EverfurResult-DN9pL2Ab.js';
|
|
2
|
+
import { P as PetRef } from './ids-B2GAAifq.js';
|
|
3
|
+
import { R as RequestFunnel } from './requestFunnel-DFMGcluw.js';
|
|
4
|
+
import { A as AuthContext } from './identity-CEi9GRFZ.js';
|
|
5
|
+
import { E as ErrorPolicyPort } from './ErrorPolicyPort-CwbfmxzJ.js';
|
|
6
|
+
import { d as RecordsRequestView, R as RecordDocumentMeta, a as RecordEntity } from './models-B-Uh2LTf.js';
|
|
7
|
+
|
|
8
|
+
/** Directory contact details only. The server intentionally does not expose clinic email addresses. */
|
|
9
|
+
interface RecordsClinic {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly name: string;
|
|
12
|
+
readonly address: string | null;
|
|
13
|
+
readonly phone: string | null;
|
|
14
|
+
readonly emailStatus: string;
|
|
15
|
+
readonly distanceKm: number | null;
|
|
16
|
+
}
|
|
17
|
+
interface RecordsClinicSearchInput {
|
|
18
|
+
readonly query?: string;
|
|
19
|
+
readonly location?: {
|
|
20
|
+
readonly latitude: number;
|
|
21
|
+
readonly longitude: number;
|
|
22
|
+
};
|
|
23
|
+
readonly limit?: number;
|
|
24
|
+
/** Use with the same query/location that produced it. Opaque; never decode it. */
|
|
25
|
+
readonly cursor?: string;
|
|
26
|
+
}
|
|
27
|
+
interface RecordsClinicSearchPage {
|
|
28
|
+
readonly clinics: readonly RecordsClinic[];
|
|
29
|
+
readonly nextCursor: string | null;
|
|
30
|
+
}
|
|
31
|
+
/** `GET /widget/v1/records/clinics/recent`: the directory clinics THIS member sent a request to before. */
|
|
32
|
+
interface RecordsRecentClinicsInput {
|
|
33
|
+
/** 1 to 25 (the route's bound); the server default when omitted. */
|
|
34
|
+
readonly limit?: number;
|
|
35
|
+
}
|
|
36
|
+
/** Backend-authored templates. Present them before signing; never substitute SDK-authored legal copy. */
|
|
37
|
+
interface RecordsAuthorizationCopy {
|
|
38
|
+
readonly authorizationVersion: string;
|
|
39
|
+
readonly scopeTemplate: string;
|
|
40
|
+
readonly authorizationTemplate: string;
|
|
41
|
+
}
|
|
42
|
+
type RecordsClinicTarget = {
|
|
43
|
+
readonly clinicId: string;
|
|
44
|
+
readonly clinicFreeText?: never;
|
|
45
|
+
} | {
|
|
46
|
+
readonly clinicId?: never;
|
|
47
|
+
readonly clinicFreeText: string;
|
|
48
|
+
};
|
|
49
|
+
/** Exactly one explicit authorization signature; never inferred from the partner's virtual user. */
|
|
50
|
+
type RecordsAuthorizationSignature = {
|
|
51
|
+
readonly signatureId: string;
|
|
52
|
+
readonly signaturePngBase64?: never;
|
|
53
|
+
} | {
|
|
54
|
+
readonly signatureId?: never;
|
|
55
|
+
readonly signaturePngBase64: string;
|
|
56
|
+
};
|
|
57
|
+
type CreateClinicRequestInput = RecordsClinicTarget & RecordsAuthorizationSignature & {
|
|
58
|
+
readonly petRef: PetRef;
|
|
59
|
+
readonly ownerName: string;
|
|
60
|
+
readonly authorizationVersion: string;
|
|
61
|
+
/** Owner-supplied contact only; server anti-relay checks prevent redirecting an addressable clinic. */
|
|
62
|
+
readonly clinicEmail?: string;
|
|
63
|
+
/** Stable for retries of this authorization, distinct for a new authorization. */
|
|
64
|
+
readonly idempotencyKey: string;
|
|
65
|
+
};
|
|
66
|
+
/** Multipart signature upload policy. Do not log or persist this short-lived credential. */
|
|
67
|
+
interface RecordsSignatureUploadPolicy {
|
|
68
|
+
readonly uploadId: string;
|
|
69
|
+
readonly uploadUrl: string;
|
|
70
|
+
readonly uploadFields: Readonly<Record<string, string>>;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
interface HttpRecordsClinicRepositoryDeps {
|
|
74
|
+
readonly auth: AuthContext;
|
|
75
|
+
readonly funnel?: RequestFunnel;
|
|
76
|
+
readonly errorPolicy?: ErrorPolicyPort;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** The most clinics one batch may name (the server's `_MAX_BATCH_CLINICS`). */
|
|
80
|
+
declare const RECORDS_CLINIC_BATCH_MAX = 10;
|
|
81
|
+
/** One clinic of a batch: exactly one clinic target, exactly one signature, and its own idempotency key. */
|
|
82
|
+
type RecordsClinicBatchItem = RecordsClinicTarget & RecordsAuthorizationSignature & {
|
|
83
|
+
/** Owner-supplied contact only; server anti-relay checks prevent redirecting an addressable clinic. */
|
|
84
|
+
readonly clinicEmail?: string;
|
|
85
|
+
/** Stable for retries of this clinic's authorization, distinct for a new one. */
|
|
86
|
+
readonly idempotencyKey: string;
|
|
87
|
+
};
|
|
88
|
+
interface CreateClinicRequestBatchInput {
|
|
89
|
+
/** The registered pet the records are requested for. */
|
|
90
|
+
readonly petRef: PetRef;
|
|
91
|
+
/** The signer's name, confirmed by the owner before signing. */
|
|
92
|
+
readonly ownerName: string;
|
|
93
|
+
/** The version of the backend-authored authorization copy the owner signed. */
|
|
94
|
+
readonly authorizationVersion: string;
|
|
95
|
+
/** 1..RECORDS_CLINIC_BATCH_MAX clinics. */
|
|
96
|
+
readonly clinics: readonly RecordsClinicBatchItem[];
|
|
97
|
+
}
|
|
98
|
+
/** One clinic's outcome: `request` when created, `failureCode` and `failureReason` when not. */
|
|
99
|
+
interface RecordsClinicBatchResult {
|
|
100
|
+
/** The idempotency key this clinic was sent with. */
|
|
101
|
+
readonly idempotencyKey: string;
|
|
102
|
+
/** The directory clinic, when the clinic was chosen from the directory. */
|
|
103
|
+
readonly clinicId: string | null;
|
|
104
|
+
/** The owner-entered clinic, when it was not. */
|
|
105
|
+
readonly clinicFreeText: string | null;
|
|
106
|
+
/** True when this clinic has a request in the response; false with failureCode otherwise. */
|
|
107
|
+
readonly created: boolean;
|
|
108
|
+
/** The created request, mapped like every other records request. */
|
|
109
|
+
readonly request: RecordsRequestView | null;
|
|
110
|
+
/** Machine-readable reason this clinic was not created. */
|
|
111
|
+
readonly failureCode: string | null;
|
|
112
|
+
/** Server-authored; safe to log, but render your own copy from `failureCode`. */
|
|
113
|
+
readonly failureReason: string | null;
|
|
114
|
+
}
|
|
115
|
+
interface RecordsClinicBatch {
|
|
116
|
+
/** The group every request of this batch belongs to. */
|
|
117
|
+
readonly requestGroupId: string;
|
|
118
|
+
/** The pet the batch was for; always the input's petRef. */
|
|
119
|
+
readonly petRef: string;
|
|
120
|
+
/** One result per clinic, in the order sent. */
|
|
121
|
+
readonly results: readonly RecordsClinicBatchResult[];
|
|
122
|
+
/** How many clinics have a request. */
|
|
123
|
+
readonly createdCount: number;
|
|
124
|
+
/** How many clinics failed. */
|
|
125
|
+
readonly failedCount: number;
|
|
126
|
+
}
|
|
127
|
+
/** The multi-clinic records request client. */
|
|
128
|
+
interface RecordsClinicBatchClient {
|
|
129
|
+
/** Run it only from the owner's own signed action: it gives consent and contacts clinics in the owner's name. */
|
|
130
|
+
createClinicRequestBatch(input: CreateClinicRequestBatchInput): Promise<EverfurResult<RecordsClinicBatch>>;
|
|
131
|
+
}
|
|
132
|
+
/** The batch client, over the same auth, funnel and error policy as the clinic repository. */
|
|
133
|
+
declare function createRecordsClinicBatchClient(deps: HttpRecordsClinicRepositoryDeps): RecordsClinicBatchClient;
|
|
134
|
+
|
|
135
|
+
/** A corrected field's wire value: text and dates as strings, numbers as numbers, flags as booleans. */
|
|
136
|
+
type FactFieldValue = string | number | boolean;
|
|
137
|
+
interface RecordFactEditInput {
|
|
138
|
+
/** The row's `category` (the wire `entity_type`). */
|
|
139
|
+
readonly entityType: string;
|
|
140
|
+
/** The row's `canonicalKey`; never an `entity_id`. */
|
|
141
|
+
readonly canonicalKey: string;
|
|
142
|
+
/**
|
|
143
|
+
* Field overrides under the fact's typed slot, e.g. `{ value_text: 'Chicken' }`, `{ value_num: 12.4 }`,
|
|
144
|
+
* `{ value_date: '2026-05-01' }` or `{ value_bool: true }`. Never empty.
|
|
145
|
+
*/
|
|
146
|
+
readonly correctedFields: Readonly<Record<string, FactFieldValue>>;
|
|
147
|
+
/** Stable for a retry of the same correction. */
|
|
148
|
+
readonly idempotencyKey?: string;
|
|
149
|
+
}
|
|
150
|
+
interface RecordFactRemoveInput {
|
|
151
|
+
readonly entityType: string;
|
|
152
|
+
readonly canonicalKey: string;
|
|
153
|
+
readonly idempotencyKey?: string;
|
|
154
|
+
}
|
|
155
|
+
/** The display field every fact accepts as a correction target on this wire (the text slot). */
|
|
156
|
+
declare const FACT_VALUE_FIELD = "value_text";
|
|
157
|
+
/**
|
|
158
|
+
* True when the server refused the write because a staff reviewer already decided this fact.
|
|
159
|
+
*
|
|
160
|
+
* MEASURED, and the reason this is not written on the normalized code. The route raises the reviewer-wins
|
|
161
|
+
* refusal with a STRING detail (`_REVIEWER_LOCKED_DETAIL`), and `http_exception_handler` renders a string
|
|
162
|
+
* detail through `_HTTP_CODE_MAP`, so the body reaching the SDK is `{code: 'ConflictException', message,
|
|
163
|
+
* request_id}` and NOT the code-free body this guard used to assume. `ConflictException` folds to `conflict`,
|
|
164
|
+
* exactly like the typed `records_consent_required` the same two routes answer when consent was withdrawn
|
|
165
|
+
* between the read and the write, so the old `code !== 'conflict'` test was false for BOTH of them: the
|
|
166
|
+
* reviewer-wins copy below was unreachable, and a consent withdrawal read as a connection fault.
|
|
167
|
+
*
|
|
168
|
+
* The split that does hold is on the wire code (`isRecordsConsentRequired`): every other 409 on these routes
|
|
169
|
+
* is the reviewer lock, including a 409 that carries no wire code at all, which is the coarser of the two
|
|
170
|
+
* "your write did not apply" messages and therefore the safe default.
|
|
171
|
+
*/
|
|
172
|
+
declare function isFactReviewerLocked(error: EverfurError | null): boolean;
|
|
173
|
+
/** The text-slot correction (`value_text`). Prefer `factCorrectionFor`, which picks the ORIGINAL row's slot. */
|
|
174
|
+
declare function factValueCorrection(value: string): Readonly<Record<string, string>>;
|
|
175
|
+
type FactValueKind = 'num' | 'date' | 'bool' | 'text';
|
|
176
|
+
/** The four typed slots of a fact envelope, keyed by kind. */
|
|
177
|
+
declare const FACT_FIELD_BY_KIND: Readonly<Record<FactValueKind, string>>;
|
|
178
|
+
/** The slot a fact lives in, read off its display value. `null` (no value on the wire) is text. */
|
|
179
|
+
declare function inferFactValueKind(value: string | null | undefined): FactValueKind;
|
|
180
|
+
/**
|
|
181
|
+
* The one-field `corrected_fields` for a correction of `original` (the row's display value) to `corrected`
|
|
182
|
+
* (what the owner typed). The key is the original's slot; the value is coerced into it, or sent as text when
|
|
183
|
+
* it does not fit. The corrected value is trimmed; the caller has already refused an empty one.
|
|
184
|
+
*/
|
|
185
|
+
declare function factCorrectionFor(original: string | null | undefined, corrected: string): Readonly<Record<string, string | number | boolean>>;
|
|
186
|
+
|
|
187
|
+
/** One reading on a marker's trend line, with its provenance (the clinic, the document, the review flag). */
|
|
188
|
+
interface RecordMarkerPoint {
|
|
189
|
+
readonly at: string | null;
|
|
190
|
+
readonly value: number | null;
|
|
191
|
+
readonly unit: string | null;
|
|
192
|
+
readonly qualitativeResult: string | null;
|
|
193
|
+
readonly refLow: number | null;
|
|
194
|
+
readonly refHigh: number | null;
|
|
195
|
+
/** The BE-computed range status (`in_range`, `above`, `below`); null when no band is on file. */
|
|
196
|
+
readonly status: string | null;
|
|
197
|
+
readonly sourceClinic: string | null;
|
|
198
|
+
/** The base wire's document key for the source document; null when the wire named none. */
|
|
199
|
+
readonly docId: string | null;
|
|
200
|
+
/** True once Everfur's team verified the reading against the original document. */
|
|
201
|
+
readonly reviewed: boolean;
|
|
202
|
+
}
|
|
203
|
+
interface RecordMarkerLatest {
|
|
204
|
+
readonly at: string | null;
|
|
205
|
+
readonly value: number | null;
|
|
206
|
+
readonly unit: string | null;
|
|
207
|
+
readonly qualitativeResult: string | null;
|
|
208
|
+
readonly status: string | null;
|
|
209
|
+
}
|
|
210
|
+
/** One swipeable trend card: a canonical marker with its point series, latest reading and trajectory. */
|
|
211
|
+
interface RecordMarker {
|
|
212
|
+
readonly markerId: string;
|
|
213
|
+
readonly name: string;
|
|
214
|
+
readonly loincCode: string | null;
|
|
215
|
+
readonly unit: string | null;
|
|
216
|
+
readonly panel: string | null;
|
|
217
|
+
/** BE-authored meaning text, rendered verbatim. */
|
|
218
|
+
readonly meaning: string | null;
|
|
219
|
+
readonly latest: RecordMarkerLatest | null;
|
|
220
|
+
/** `up`, `down` or `flat`, BE-decided; null when the wire sent none. */
|
|
221
|
+
readonly trajectory: string | null;
|
|
222
|
+
readonly points: readonly RecordMarkerPoint[];
|
|
223
|
+
}
|
|
224
|
+
/** The BE-computed donut aggregate: the FE renders these counts verbatim and never tallies statuses itself. */
|
|
225
|
+
interface RecordMarkerSummary {
|
|
226
|
+
readonly totalMarkers: number;
|
|
227
|
+
readonly inRangeCount: number;
|
|
228
|
+
readonly outOfRangeCount: number;
|
|
229
|
+
readonly unknownCount: number;
|
|
230
|
+
}
|
|
231
|
+
interface RecordMarkersView {
|
|
232
|
+
readonly petRef: PetRef;
|
|
233
|
+
/** The consent-not-granted or fail-closed shape: render nothing. */
|
|
234
|
+
readonly withheld: boolean;
|
|
235
|
+
readonly markers: readonly RecordMarker[];
|
|
236
|
+
readonly summary: RecordMarkerSummary | null;
|
|
237
|
+
/** BE-authored, rendered verbatim. */
|
|
238
|
+
readonly disclaimer: string;
|
|
239
|
+
readonly featuredMarkerId: string | null;
|
|
240
|
+
}
|
|
241
|
+
/** The markers wire to a frozen view; withheld or malformed folds to withheld (never partial). */
|
|
242
|
+
declare function mapRecordMarkers(petRef: string, wire: unknown): RecordMarkersView;
|
|
243
|
+
|
|
244
|
+
interface HttpRecordsRepositoryDeps {
|
|
245
|
+
/** The partner's `EverfurConfig.errorPolicy`, so its retry knobs reach the funnel. Narrowing only. */
|
|
246
|
+
readonly errorPolicy?: ErrorPolicyPort;
|
|
247
|
+
readonly auth: AuthContext;
|
|
248
|
+
/** The ONE request funnel. Built from `auth` when absent; injected in tests for a deterministic clock. */
|
|
249
|
+
readonly funnel?: RequestFunnel;
|
|
250
|
+
/**
|
|
251
|
+
* The API base URL the transport was built for. The depth client resolves a RELATIVE link the server
|
|
252
|
+
* returns (the consumer share link is a path) against this origin; absent, such a link is refused.
|
|
253
|
+
*/
|
|
254
|
+
readonly apiBaseUrl?: string;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* One file the member uploaded onto their own request.
|
|
259
|
+
*
|
|
260
|
+
* `fileName` is null for an upload made before the server kept the name (the schema says so), and a
|
|
261
|
+
* surface must then show the format, size and time on their own rather than inventing a title.
|
|
262
|
+
* `byteSize` and `receivedAt` are nullable for the same historical reason.
|
|
263
|
+
*/
|
|
264
|
+
interface RecordsRequestDocument {
|
|
265
|
+
/** The document's own id on the wire. Stable, and the list key. */
|
|
266
|
+
readonly sourceDocId: string;
|
|
267
|
+
readonly fileName: string | null;
|
|
268
|
+
readonly docFormat: string | null;
|
|
269
|
+
readonly byteSize: number | null;
|
|
270
|
+
/** ISO 8601, or null when the row carries no time. */
|
|
271
|
+
readonly receivedAt: string | null;
|
|
272
|
+
/** A presigned https GET the host opens itself. Never fetched with the bearer. */
|
|
273
|
+
readonly downloadUrl: string;
|
|
274
|
+
/** Seconds the signed URL stays good for, as the server minted it. */
|
|
275
|
+
readonly expiresInSeconds: number;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/** A freshly minted share link. `shareUrl` is shown once; the list read never repeats it. */
|
|
279
|
+
interface RecordShareLink {
|
|
280
|
+
readonly shareId: string;
|
|
281
|
+
readonly shareUrl: string;
|
|
282
|
+
readonly expiresAt: string | null;
|
|
283
|
+
}
|
|
284
|
+
/** One live share link as the list read reports it (no URL: the token was shown once, at creation). */
|
|
285
|
+
interface RecordShare {
|
|
286
|
+
readonly shareId: string;
|
|
287
|
+
readonly expiresAt: string | null;
|
|
288
|
+
readonly createdAt: string | null;
|
|
289
|
+
readonly viewCount: number;
|
|
290
|
+
readonly lastViewedAt: string | null;
|
|
291
|
+
}
|
|
292
|
+
/** The presigned PDF download. */
|
|
293
|
+
interface RecordPdfLink {
|
|
294
|
+
readonly downloadUrl: string;
|
|
295
|
+
readonly expiresAt: string | null;
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* The share link as an absolute https URL. The consumer route returns the RELATIVE form
|
|
299
|
+
* (`/api/v1/records/everfur_record/shared/<token>.pdf`), which is resolved against the API base URL the
|
|
300
|
+
* client was built for; an absolute value is kept as it is. A link that cannot be made absolute https (a
|
|
301
|
+
* relative path with no base URL, another scheme, a malformed value) is refused: it is never opened raw.
|
|
302
|
+
*/
|
|
303
|
+
declare function resolveShareUrl(shareUrl: string, apiBaseUrl: string | undefined): string | null;
|
|
304
|
+
/** The mint response to a frozen link, or null when malformed (fail-closed: no link is better than a bad one). */
|
|
305
|
+
declare function mapRecordShareLink(wire: unknown, apiBaseUrl?: string): RecordShareLink | null;
|
|
306
|
+
/** The list response to frozen rows, or null when malformed. */
|
|
307
|
+
declare function mapRecordShareList(wire: unknown): readonly RecordShare[] | null;
|
|
308
|
+
/** The PDF link response to a frozen link, or null when malformed or not https. */
|
|
309
|
+
declare function mapRecordPdfLink(wire: unknown): RecordPdfLink | null;
|
|
310
|
+
|
|
311
|
+
interface RecordsSignatureSuggestion {
|
|
312
|
+
readonly signatureId: string;
|
|
313
|
+
/** A short-lived presigned https URL of the signature PNG. */
|
|
314
|
+
readonly previewUrl: string;
|
|
315
|
+
readonly createdAt: string | null;
|
|
316
|
+
}
|
|
317
|
+
/** The gallery wire to frozen suggestions, or null when malformed. A row whose preview is not https is refused. */
|
|
318
|
+
declare function mapSignatureSuggestions(wire: unknown): readonly RecordsSignatureSuggestion[] | null;
|
|
319
|
+
|
|
320
|
+
/** One reading of a lab marker. Provenance absent; `docId` is the base wire's document key. */
|
|
321
|
+
interface RecordLabPoint {
|
|
322
|
+
readonly at: string | null;
|
|
323
|
+
readonly value: number | null;
|
|
324
|
+
readonly unit: string | null;
|
|
325
|
+
readonly qualitativeResult: string | null;
|
|
326
|
+
readonly refLow: number | null;
|
|
327
|
+
readonly refHigh: number | null;
|
|
328
|
+
/** The BE-computed range status (`in_range`, `high`, `low`, ...); never derived here. */
|
|
329
|
+
readonly status: string | null;
|
|
330
|
+
readonly docId: string | null;
|
|
331
|
+
}
|
|
332
|
+
/** One lab marker series, the consumer "Blood & lab work" row. */
|
|
333
|
+
interface RecordLabMarker {
|
|
334
|
+
readonly markerId: string;
|
|
335
|
+
readonly name: string;
|
|
336
|
+
readonly loincCode: string | null;
|
|
337
|
+
readonly unit: string | null;
|
|
338
|
+
readonly panel: string | null;
|
|
339
|
+
/** BE-authored meaning text, rendered verbatim. */
|
|
340
|
+
readonly meaning: string | null;
|
|
341
|
+
readonly latest: Omit<RecordLabPoint, 'refLow' | 'refHigh' | 'docId'>;
|
|
342
|
+
readonly trajectory: string | null;
|
|
343
|
+
readonly points: readonly RecordLabPoint[];
|
|
344
|
+
}
|
|
345
|
+
interface RecordEncounter {
|
|
346
|
+
readonly encounterId: string;
|
|
347
|
+
readonly date: string | null;
|
|
348
|
+
readonly type: string | null;
|
|
349
|
+
readonly clinicName: string | null;
|
|
350
|
+
readonly veterinarian: string | null;
|
|
351
|
+
readonly docId: string | null;
|
|
352
|
+
}
|
|
353
|
+
interface RecordClinicianNoteSection {
|
|
354
|
+
readonly section: string;
|
|
355
|
+
/** The vet's own words, verbatim. */
|
|
356
|
+
readonly text: string;
|
|
357
|
+
}
|
|
358
|
+
interface RecordClinicianNote {
|
|
359
|
+
readonly noteId: string;
|
|
360
|
+
readonly encounterId: string | null;
|
|
361
|
+
readonly observedOn: string | null;
|
|
362
|
+
readonly sections: readonly RecordClinicianNoteSection[];
|
|
363
|
+
}
|
|
364
|
+
interface RecordExamSystem {
|
|
365
|
+
readonly system: string;
|
|
366
|
+
/** `normal`, `abnormal` or `not_examined` (BE-graded). */
|
|
367
|
+
readonly findingStatus: string | null;
|
|
368
|
+
/** The BE-graded finding text for an abnormal system, verbatim; null otherwise. */
|
|
369
|
+
readonly finding: string | null;
|
|
370
|
+
}
|
|
371
|
+
interface RecordPhysicalExam {
|
|
372
|
+
readonly examId: string;
|
|
373
|
+
readonly encounterId: string | null;
|
|
374
|
+
readonly observedOn: string | null;
|
|
375
|
+
readonly docId: string | null;
|
|
376
|
+
/** In the server's order. */
|
|
377
|
+
readonly systems: readonly RecordExamSystem[];
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* The consumer "What's on file" card (records_epdf_schemas.py `Completeness`): coverage flags and counts only,
|
|
381
|
+
* never a review payload. Additive on the depth wire; an older backend omits it and the card does not render.
|
|
382
|
+
*/
|
|
383
|
+
interface RecordCompleteness {
|
|
384
|
+
readonly hasLabHistory: boolean;
|
|
385
|
+
readonly hasVaccinationHistory: boolean;
|
|
386
|
+
readonly hasWeightHistory: boolean;
|
|
387
|
+
readonly hasVitalsHistory: boolean;
|
|
388
|
+
readonly hasPhysicalExamHistory: boolean;
|
|
389
|
+
readonly hasProcedureHistory: boolean;
|
|
390
|
+
readonly hasGeneticHistory: boolean;
|
|
391
|
+
readonly hasReproductiveHistory: boolean;
|
|
392
|
+
readonly hasParasitePreventionHistory: boolean;
|
|
393
|
+
readonly earliestRecordAt: string | null;
|
|
394
|
+
readonly latestRecordAt: string | null;
|
|
395
|
+
readonly documentsIngested: number;
|
|
396
|
+
readonly documentsInReview: number;
|
|
397
|
+
/** Held facts still awaiting review, by entity type. */
|
|
398
|
+
readonly entitiesPendingReview: Readonly<Record<string, number>>;
|
|
399
|
+
readonly heldTotal: number;
|
|
400
|
+
}
|
|
401
|
+
interface RecordConflictCandidate {
|
|
402
|
+
readonly value: string;
|
|
403
|
+
readonly docId: string | null;
|
|
404
|
+
readonly collectedAt: string | null;
|
|
405
|
+
}
|
|
406
|
+
/** A disagreement between documents for one field or entity (records_epdf_schemas.py `Conflict`). */
|
|
407
|
+
interface RecordConflict {
|
|
408
|
+
readonly conflictId: string;
|
|
409
|
+
readonly entityType: string;
|
|
410
|
+
readonly field: string | null;
|
|
411
|
+
/** `benign`, `needs_review` or `identity_risk` (BE-graded). */
|
|
412
|
+
readonly severity: string;
|
|
413
|
+
readonly candidates: readonly RecordConflictCandidate[];
|
|
414
|
+
}
|
|
415
|
+
/** The withheld sections of the record read (plus the completeness card and the conflicts, when the wire carries them). */
|
|
416
|
+
interface RecordDepthView {
|
|
417
|
+
readonly petRef: PetRef;
|
|
418
|
+
/** True when the depth keys were on the wire (the flag is on for the tenant). False means: render nothing. */
|
|
419
|
+
readonly available: boolean;
|
|
420
|
+
/** The consent-not-granted or fail-closed shape: render nothing. */
|
|
421
|
+
readonly withheld: boolean;
|
|
422
|
+
readonly labResults: readonly RecordLabMarker[];
|
|
423
|
+
readonly encounters: readonly RecordEncounter[];
|
|
424
|
+
readonly clinicianNotes: readonly RecordClinicianNote[];
|
|
425
|
+
readonly physicalExams: readonly RecordPhysicalExam[];
|
|
426
|
+
/** Null when the wire carried no `completeness` (an older backend). */
|
|
427
|
+
readonly completeness: RecordCompleteness | null;
|
|
428
|
+
readonly conflicts: readonly RecordConflict[];
|
|
429
|
+
}
|
|
430
|
+
interface RecordsTimelineVisit {
|
|
431
|
+
readonly visitId: string;
|
|
432
|
+
readonly visitDate: string | null;
|
|
433
|
+
readonly veterinarian: string | null;
|
|
434
|
+
readonly summary: string | null;
|
|
435
|
+
readonly docId: string | null;
|
|
436
|
+
}
|
|
437
|
+
interface RecordsTimelineVaccine {
|
|
438
|
+
readonly vaccineId: string;
|
|
439
|
+
readonly product: string | null;
|
|
440
|
+
readonly lot: string | null;
|
|
441
|
+
readonly administeredOn: string | null;
|
|
442
|
+
readonly expiresOn: string | null;
|
|
443
|
+
readonly docId: string | null;
|
|
444
|
+
}
|
|
445
|
+
interface RecordsTimelineWeight {
|
|
446
|
+
readonly weightId: string;
|
|
447
|
+
readonly observedOn: string | null;
|
|
448
|
+
readonly weightKg: number | null;
|
|
449
|
+
readonly docId: string | null;
|
|
450
|
+
}
|
|
451
|
+
interface RecordsTimelineMedication {
|
|
452
|
+
readonly medicationId: string;
|
|
453
|
+
readonly drugName: string | null;
|
|
454
|
+
readonly dose: string | null;
|
|
455
|
+
readonly route: string | null;
|
|
456
|
+
readonly frequency: string | null;
|
|
457
|
+
readonly sig: string | null;
|
|
458
|
+
readonly rxNumber: string | null;
|
|
459
|
+
readonly startedOn: string | null;
|
|
460
|
+
readonly stoppedOn: string | null;
|
|
461
|
+
readonly docId: string | null;
|
|
462
|
+
}
|
|
463
|
+
/** The consumer timeline for a pet: four rails, every clinical field verbatim. */
|
|
464
|
+
interface RecordsTimelineView {
|
|
465
|
+
readonly petRef: PetRef;
|
|
466
|
+
readonly withheld: boolean;
|
|
467
|
+
/** No entry on any rail (a granted pet with nothing published yet). */
|
|
468
|
+
readonly isEmpty: boolean;
|
|
469
|
+
readonly visits: readonly RecordsTimelineVisit[];
|
|
470
|
+
readonly vaccines: readonly RecordsTimelineVaccine[];
|
|
471
|
+
readonly weights: readonly RecordsTimelineWeight[];
|
|
472
|
+
readonly medications: readonly RecordsTimelineMedication[];
|
|
473
|
+
/** BE-authored, rendered verbatim. */
|
|
474
|
+
readonly disclaimer: string;
|
|
475
|
+
}
|
|
476
|
+
/** What one published document contributed to the pet's record. */
|
|
477
|
+
interface RecordDocumentContributionsView {
|
|
478
|
+
readonly petRef: PetRef;
|
|
479
|
+
readonly withheld: boolean;
|
|
480
|
+
readonly document: RecordDocumentMeta | null;
|
|
481
|
+
readonly contributions: readonly RecordEntity[];
|
|
482
|
+
readonly contributionCount: number;
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* The four depth sections off a record wire. Absent keys (the flag is off) read as `available:false`;
|
|
486
|
+
* `withheld:true` or a section that fails the allowlist parse reads as withheld, never partial.
|
|
487
|
+
*/
|
|
488
|
+
declare function mapRecordDepth(petRef: string, wire: unknown): RecordDepthView;
|
|
489
|
+
/** The consumer timeline wire to a frozen view; withheld or malformed folds to withheld. */
|
|
490
|
+
declare function mapRecordsTimeline(petRef: string, wire: unknown): RecordsTimelineView;
|
|
491
|
+
/** The per-document contributions wire to a frozen view; withheld or malformed folds to withheld. */
|
|
492
|
+
declare function mapDocumentContributions(petRef: string, wire: unknown): RecordDocumentContributionsView;
|
|
493
|
+
/**
|
|
494
|
+
* The depth reads and the owner's record writes for a signed member, all behind the same strict flag. Every
|
|
495
|
+
* method settles; a dark flag is the ordinary not-found error (httpStatus 404), which every surface over this
|
|
496
|
+
* client folds to "hidden, no error" exactly as it folds `available:false` on the record read.
|
|
497
|
+
*/
|
|
498
|
+
interface RecordsDepthClient {
|
|
499
|
+
/** The withheld sections off the record read. `available:false` when the tenant's flag is off. */
|
|
500
|
+
getRecordDepth(petRef: PetRef): Promise<EverfurResult<RecordDepthView>>;
|
|
501
|
+
getTimeline(petRef: PetRef): Promise<EverfurResult<RecordsTimelineView>>;
|
|
502
|
+
getDocumentContributions(petRef: PetRef, docId: string): Promise<EverfurResult<RecordDocumentContributionsView>>;
|
|
503
|
+
/** The consumer dashboard's lab markers with the BE-computed donut summary (`markers.ts`). */
|
|
504
|
+
getMarkers(petRef: PetRef): Promise<EverfurResult<RecordMarkersView>>;
|
|
505
|
+
/** Mint a public, expiring share link to the pet's record. The URL is returned ONCE. */
|
|
506
|
+
createShare(petRef: PetRef): Promise<EverfurResult<RecordShareLink>>;
|
|
507
|
+
/** The pet's live share links (never the URLs). */
|
|
508
|
+
listShares(petRef: PetRef): Promise<EverfurResult<readonly RecordShare[]>>;
|
|
509
|
+
/** Turn a link off. A link already off (404) settles as the ordinary not-found error. */
|
|
510
|
+
revokeShare(petRef: PetRef, shareId: string): Promise<EverfurResult<void>>;
|
|
511
|
+
/** A presigned link to the record PDF the host opens itself. */
|
|
512
|
+
getPdfLink(petRef: PetRef): Promise<EverfurResult<RecordPdfLink>>;
|
|
513
|
+
/** Correct one fact's display value (append-only overlay; 409 when a reviewer already decided it). */
|
|
514
|
+
editFact(petRef: PetRef, input: RecordFactEditInput): Promise<EverfurResult<void>>;
|
|
515
|
+
/** Remove one fact from the owner-facing record (append-only reject; 409 when reviewer-decided). */
|
|
516
|
+
removeFact(petRef: PetRef, input: RecordFactRemoveInput): Promise<EverfurResult<void>>;
|
|
517
|
+
/**
|
|
518
|
+
* The files the member uploaded onto one of their own records requests, oldest first, each with a
|
|
519
|
+
* short-lived signed download.
|
|
520
|
+
*
|
|
521
|
+
* NOT GATED BY THE DEPTH SWITCH, unlike every other method on this client: the route bounds these
|
|
522
|
+
* on `records.record.read` and the pet's records consent only, because they are the member's OWN
|
|
523
|
+
* uploads rather than clinical depth. So a caller must NOT fold a 404 here to `available:false`
|
|
524
|
+
* and hide the member's files; a 404 means the request is not theirs.
|
|
525
|
+
*/
|
|
526
|
+
listRequestDocuments(requestId: string): Promise<EverfurResult<readonly RecordsRequestDocument[]>>;
|
|
527
|
+
/** The member's reusable signature gallery for the consent screen, newest first. */
|
|
528
|
+
listAuthorizationSignatures(): Promise<EverfurResult<readonly RecordsSignatureSuggestion[]>>;
|
|
529
|
+
}
|
|
530
|
+
/** The depth client, over the same auth, funnel and error policy as the records repository. */
|
|
531
|
+
declare function createRecordsDepthClient(deps: HttpRecordsRepositoryDeps): RecordsDepthClient;
|
|
532
|
+
|
|
533
|
+
export { isFactReviewerLocked as $, RECORDS_CLINIC_BATCH_MAX as A, type RecordFactEditInput as B, type CreateClinicRequestBatchInput as C, type RecordFactRemoveInput as D, type RecordMarker as E, FACT_FIELD_BY_KIND as F, type RecordMarkerLatest as G, type HttpRecordsClinicRepositoryDeps as H, type RecordMarkerPoint as I, type RecordMarkerSummary as J, type RecordMarkersView as K, type RecordPdfLink as L, type RecordShare as M, type RecordShareLink as N, type RecordsAuthorizationSignature as O, type RecordsClinicBatch as P, type RecordsClinicBatchClient as Q, type RecordClinicianNote as R, type RecordsClinicBatchItem as S, type RecordsClinicBatchResult as T, type RecordsClinicTarget as U, type RecordsSignatureSuggestion as V, createRecordsClinicBatchClient as W, createRecordsDepthClient as X, factCorrectionFor as Y, factValueCorrection as Z, inferFactValueKind as _, type RecordClinicianNoteSection as a, mapRecordMarkers as a0, mapRecordPdfLink as a1, mapRecordShareLink as a2, mapRecordShareList as a3, mapSignatureSuggestions as a4, resolveShareUrl as a5, type RecordsClinicSearchInput as a6, type RecordsClinicSearchPage as a7, type RecordsRecentClinicsInput as a8, type RecordsAuthorizationCopy as a9, type CreateClinicRequestInput as aa, type RecordsSignatureUploadPolicy as ab, type RecordCompleteness as b, type RecordConflict as c, type RecordConflictCandidate as d, type RecordDepthView as e, type RecordDocumentContributionsView as f, type RecordEncounter as g, type RecordExamSystem as h, type RecordLabMarker as i, type RecordLabPoint as j, type RecordPhysicalExam as k, type RecordsClinic as l, type RecordsDepthClient as m, type RecordsRequestDocument as n, type RecordsTimelineMedication as o, type RecordsTimelineVaccine as p, type RecordsTimelineView as q, type RecordsTimelineVisit as r, type RecordsTimelineWeight as s, mapDocumentContributions as t, mapRecordDepth as u, mapRecordsTimeline as v, FACT_VALUE_FIELD as w, type FactFieldValue as x, type FactValueKind as y, type HttpRecordsRepositoryDeps as z };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { E as EverfurError } from './EverfurResult-DN9pL2Ab.js';
|
|
2
|
+
import { R as RequestFunnel } from './requestFunnel-DFMGcluw.js';
|
|
3
|
+
import { A as AuthContext } from './identity-CEi9GRFZ.js';
|
|
4
|
+
import { C as ClientBranding } from './branding-CsRdeNwK.js';
|
|
5
|
+
import { E as EntitlementDecision } from './resolve-D4Ywz5OS.js';
|
|
6
|
+
|
|
7
|
+
/** The conditional-GET endpoint (SPEC-00 §5.3). Relative; the transport prefixes the resolved base URL. */
|
|
8
|
+
declare const ENTITLEMENTS_PATH = "/widget/v1/entitlements";
|
|
9
|
+
/**
|
|
10
|
+
* The settled outcome of one entitlement fetch. `updated` carries a fresh verdict + the cadence to re-poll on;
|
|
11
|
+
* `notModified` means the cached verdict still holds; `failed` carries a normalized error and means keep-last.
|
|
12
|
+
*/
|
|
13
|
+
type EntitlementResolution = {
|
|
14
|
+
readonly kind: 'updated';
|
|
15
|
+
readonly revision: number;
|
|
16
|
+
readonly region: string;
|
|
17
|
+
readonly ttlSeconds: number;
|
|
18
|
+
readonly decisions: readonly EntitlementDecision[];
|
|
19
|
+
/**
|
|
20
|
+
* Server-driven branding parsed from the SAME 200 body's render_hints (orthogonal to capabilities).
|
|
21
|
+
* null when absent or unparseable (fail-closed -> the compiled Everfur default theme). OPTIONAL so a
|
|
22
|
+
* hand-built resolution (tests / injected resolve) need not supply it.
|
|
23
|
+
*/
|
|
24
|
+
readonly branding?: ClientBranding | null;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'notModified';
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: 'failed';
|
|
29
|
+
readonly error: EverfurError;
|
|
30
|
+
};
|
|
31
|
+
interface FetchEntitlementsArgs {
|
|
32
|
+
/** The revision we last stored; echoed as If-None-Match so an unchanged verdict returns 304. */
|
|
33
|
+
readonly cachedRevision?: number | null;
|
|
34
|
+
/** Optional region hint; forwarded as ?region. */
|
|
35
|
+
readonly region?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fetch the server-resolved entitlement verdict once. Never throws: a 304, a domain error, a network reject,
|
|
39
|
+
* and a malformed body all SETTLE to an EntitlementResolution. Fail-closed on every non-`updated` path.
|
|
40
|
+
*/
|
|
41
|
+
declare function fetchEntitlements(auth: AuthContext, args?: FetchEntitlementsArgs, funnel?: RequestFunnel): Promise<EntitlementResolution>;
|
|
42
|
+
|
|
43
|
+
export { ENTITLEMENTS_PATH as E, type FetchEntitlementsArgs as F, type EntitlementResolution as a, fetchEntitlements as f };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { E as EverfurError } from './EverfurResult-DN9pL2Ab.cjs';
|
|
2
|
+
import { R as RequestFunnel } from './requestFunnel-BjDpqqvm.cjs';
|
|
3
|
+
import { A as AuthContext } from './identity-C2-08BZW.cjs';
|
|
4
|
+
import { C as ClientBranding } from './branding-CsRdeNwK.cjs';
|
|
5
|
+
import { E as EntitlementDecision } from './resolve-D4Ywz5OS.cjs';
|
|
6
|
+
|
|
7
|
+
/** The conditional-GET endpoint (SPEC-00 §5.3). Relative; the transport prefixes the resolved base URL. */
|
|
8
|
+
declare const ENTITLEMENTS_PATH = "/widget/v1/entitlements";
|
|
9
|
+
/**
|
|
10
|
+
* The settled outcome of one entitlement fetch. `updated` carries a fresh verdict + the cadence to re-poll on;
|
|
11
|
+
* `notModified` means the cached verdict still holds; `failed` carries a normalized error and means keep-last.
|
|
12
|
+
*/
|
|
13
|
+
type EntitlementResolution = {
|
|
14
|
+
readonly kind: 'updated';
|
|
15
|
+
readonly revision: number;
|
|
16
|
+
readonly region: string;
|
|
17
|
+
readonly ttlSeconds: number;
|
|
18
|
+
readonly decisions: readonly EntitlementDecision[];
|
|
19
|
+
/**
|
|
20
|
+
* Server-driven branding parsed from the SAME 200 body's render_hints (orthogonal to capabilities).
|
|
21
|
+
* null when absent or unparseable (fail-closed -> the compiled Everfur default theme). OPTIONAL so a
|
|
22
|
+
* hand-built resolution (tests / injected resolve) need not supply it.
|
|
23
|
+
*/
|
|
24
|
+
readonly branding?: ClientBranding | null;
|
|
25
|
+
} | {
|
|
26
|
+
readonly kind: 'notModified';
|
|
27
|
+
} | {
|
|
28
|
+
readonly kind: 'failed';
|
|
29
|
+
readonly error: EverfurError;
|
|
30
|
+
};
|
|
31
|
+
interface FetchEntitlementsArgs {
|
|
32
|
+
/** The revision we last stored; echoed as If-None-Match so an unchanged verdict returns 304. */
|
|
33
|
+
readonly cachedRevision?: number | null;
|
|
34
|
+
/** Optional region hint; forwarded as ?region. */
|
|
35
|
+
readonly region?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Fetch the server-resolved entitlement verdict once. Never throws: a 304, a domain error, a network reject,
|
|
39
|
+
* and a malformed body all SETTLE to an EntitlementResolution. Fail-closed on every non-`updated` path.
|
|
40
|
+
*/
|
|
41
|
+
declare function fetchEntitlements(auth: AuthContext, args?: FetchEntitlementsArgs, funnel?: RequestFunnel): Promise<EntitlementResolution>;
|
|
42
|
+
|
|
43
|
+
export { ENTITLEMENTS_PATH as E, type FetchEntitlementsArgs as F, type EntitlementResolution as a, fetchEntitlements as f };
|