@everfur/sdk 0.1.1 → 0.3.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.
Files changed (187) hide show
  1. package/CHANGELOG.md +634 -0
  2. package/README.md +58 -23
  3. package/consent/package.json +8 -0
  4. package/dist/Chat-DPUD6dnc.d.cts +128 -0
  5. package/dist/Chat-DwAC2vhB.d.ts +128 -0
  6. package/dist/DepthViews-DNEM96Se.d.ts +16 -0
  7. package/dist/DepthViews-DP0R-DhB.d.cts +19 -0
  8. package/dist/DepthViews-D_3hl4xk.d.ts +19 -0
  9. package/dist/DepthViews-DbFhR4Du.d.cts +16 -0
  10. package/dist/ErrorPolicyPort-CNf4uQZP.d.cts +22 -0
  11. package/dist/ErrorPolicyPort-CwbfmxzJ.d.ts +22 -0
  12. package/dist/{EverfurResult-D92-uL82.d.cts → EverfurResult-DN9pL2Ab.d.cts} +11 -10
  13. package/dist/{EverfurResult-D92-uL82.d.ts → EverfurResult-DN9pL2Ab.d.ts} +11 -10
  14. package/dist/{PhotoController-BItt5M7u.d.cts → PhotoController-3l7MT9jA.d.cts} +1 -1
  15. package/dist/{PhotoController-D8zMTdcW.d.ts → PhotoController-vzY5bfY_.d.ts} +1 -1
  16. package/dist/animations/index.cjs +1 -1997
  17. package/dist/animations/index.d.cts +35 -35
  18. package/dist/animations/index.d.ts +35 -35
  19. package/dist/animations/index.js +1 -1972
  20. package/dist/attachments-5NeobOCd.d.ts +256 -0
  21. package/dist/attachments-Bw3iMQgu.d.ts +146 -0
  22. package/dist/attachments-CQgFrEQ7.d.cts +146 -0
  23. package/dist/attachments-D8T5re7e.d.cts +256 -0
  24. package/dist/casesRepository-ClLv6qMl.d.ts +188 -0
  25. package/dist/casesRepository-DHwtGRYY.d.cts +188 -0
  26. package/dist/chat/index.cjs +1 -1170
  27. package/dist/chat/index.d.cts +31 -53
  28. package/dist/chat/index.d.ts +31 -53
  29. package/dist/chat/index.js +1 -1167
  30. package/dist/client/index.cjs +9 -2315
  31. package/dist/client/index.d.cts +77 -15
  32. package/dist/client/index.d.ts +77 -15
  33. package/dist/client/index.js +9 -2215
  34. package/dist/{config-CiJ0PVBB.d.ts → config-CzTZGlfF.d.cts} +63 -25
  35. package/dist/{config-BSjBdxrZ.d.cts → config-DW60uRb9.d.ts} +63 -25
  36. package/dist/consent/index.cjs +1 -0
  37. package/dist/consent/index.d.cts +33 -0
  38. package/dist/consent/index.d.ts +33 -0
  39. package/dist/consent/index.js +1 -0
  40. package/dist/context-DXhqHlPU.d.ts +159 -0
  41. package/dist/context-XvTzq1tE.d.cts +159 -0
  42. package/dist/copy-Mjoo91aS.d.ts +198 -0
  43. package/dist/copy-bKDNigLb.d.cts +198 -0
  44. package/dist/core/index.cjs +13 -3178
  45. package/dist/core/index.d.cts +58 -12
  46. package/dist/core/index.d.ts +58 -12
  47. package/dist/core/index.js +13 -3166
  48. package/dist/depth-CErXCU8J.d.cts +502 -0
  49. package/dist/depth-DjDcJ6kH.d.ts +502 -0
  50. package/dist/entitlementRepository-DKdXFgTo.d.cts +698 -0
  51. package/dist/entitlementRepository-DSbzuyAW.d.ts +698 -0
  52. package/dist/{identity-DK9zORrG.d.ts → identity-BMx2SUOM.d.ts} +19 -6
  53. package/dist/{identity-Brl-lDd6.d.cts → identity-DI4eVx9S.d.cts} +19 -6
  54. package/dist/{ids-CJ1S6adf.d.cts → ids-B2GAAifq.d.cts} +1 -1
  55. package/dist/{ids-CJ1S6adf.d.ts → ids-B2GAAifq.d.ts} +1 -1
  56. package/dist/index.cjs +12 -4494
  57. package/dist/index.d.cts +29 -121
  58. package/dist/index.d.ts +29 -121
  59. package/dist/index.js +12 -4470
  60. package/dist/models-B-Uh2LTf.d.ts +214 -0
  61. package/dist/models-D2EUxPZY.d.cts +214 -0
  62. package/dist/notifications/index.cjs +2 -0
  63. package/dist/notifications/index.d.cts +17 -0
  64. package/dist/notifications/index.d.ts +17 -0
  65. package/dist/notifications/index.js +2 -0
  66. package/dist/pets-CtQdRpWo.d.ts +92 -0
  67. package/dist/pets-aB8q0JyX.d.cts +92 -0
  68. package/dist/photo/index.cjs +1 -2189
  69. package/dist/photo/index.d.cts +6 -6
  70. package/dist/photo/index.d.ts +6 -6
  71. package/dist/photo/index.js +1 -2186
  72. package/dist/ports-BN6RHF9W.d.cts +48 -0
  73. package/dist/ports-BN6RHF9W.d.ts +48 -0
  74. package/dist/ports-DEBzEhbp.d.cts +386 -0
  75. package/dist/ports-DMolTRzU.d.ts +386 -0
  76. package/dist/profile-CSs1wlXT.d.cts +93 -0
  77. package/dist/profile-CSs1wlXT.d.ts +93 -0
  78. package/dist/records/depth/index.cjs +2 -0
  79. package/dist/records/depth/index.d.cts +13 -0
  80. package/dist/records/depth/index.d.ts +13 -0
  81. package/dist/records/depth/index.js +2 -0
  82. package/dist/records/index.cjs +3 -2839
  83. package/dist/records/index.d.cts +137 -203
  84. package/dist/records/index.d.ts +137 -203
  85. package/dist/records/index.js +3 -2833
  86. package/dist/requestFunnel-CjW7uDuA.d.ts +87 -0
  87. package/dist/requestFunnel-L-BQfi0z.d.cts +87 -0
  88. package/dist/{resolve-Dq_4_agU.d.ts → resolve-D4Ywz5OS.d.cts} +10 -4
  89. package/dist/{resolve-Dq_4_agU.d.cts → resolve-D4Ywz5OS.d.ts} +10 -4
  90. package/dist/{runtime-Bvr8yqXm.d.cts → runtime-B8s-_hv8.d.cts} +121 -59
  91. package/dist/{runtime-BIYzf9cK.d.ts → runtime-BR9ysG0J.d.ts} +121 -59
  92. package/dist/server/events/index.cjs +2 -0
  93. package/dist/server/events/index.d.cts +550 -0
  94. package/dist/server/events/index.d.ts +550 -0
  95. package/dist/server/events/index.js +2 -0
  96. package/dist/server/index.cjs +2 -533
  97. package/dist/server/index.d.cts +73 -18
  98. package/dist/server/index.d.ts +73 -18
  99. package/dist/server/index.js +2 -530
  100. package/dist/species-BXAIMh7I.d.cts +9 -0
  101. package/dist/species-BXAIMh7I.d.ts +9 -0
  102. package/dist/televet/index.cjs +1 -0
  103. package/dist/televet/index.d.cts +60 -0
  104. package/dist/televet/index.d.ts +60 -0
  105. package/dist/televet/index.js +1 -0
  106. package/dist/testing/index.cjs +5 -823
  107. package/dist/testing/index.d.cts +17 -3
  108. package/dist/testing/index.d.ts +17 -3
  109. package/dist/testing/index.js +5 -820
  110. package/dist/testing/rn/index.cjs +1 -449
  111. package/dist/testing/rn/index.d.cts +17 -29
  112. package/dist/testing/rn/index.d.ts +17 -29
  113. package/dist/testing/rn/index.js +1 -444
  114. package/dist/testing/web/index.cjs +1 -0
  115. package/dist/testing/web/index.d.cts +131 -0
  116. package/dist/testing/web/index.d.ts +131 -0
  117. package/dist/testing/web/index.js +1 -0
  118. package/dist/timelineRows-CaohZzXS.d.cts +19 -0
  119. package/dist/timelineRows-DZed6dAM.d.ts +19 -0
  120. package/dist/typeStyle-0TydiZ1w.d.cts +19 -0
  121. package/dist/typeStyle-CWMsoe6b.d.ts +19 -0
  122. package/dist/uploadTransport-D0M0T4hN.d.ts +38 -0
  123. package/dist/uploadTransport-DKJHs3Yj.d.cts +38 -0
  124. package/dist/useRecordsDepth-BHBzJ76R.d.cts +237 -0
  125. package/dist/useRecordsDepth-BU-OhzH6.d.ts +237 -0
  126. package/dist/useVetVisit-Bc84hWUU.d.cts +187 -0
  127. package/dist/useVetVisit-CjmMa896.d.ts +187 -0
  128. package/dist/video/index.cjs +1 -1941
  129. package/dist/video/index.d.cts +4 -4
  130. package/dist/video/index.d.ts +4 -4
  131. package/dist/video/index.js +1 -1938
  132. package/dist/view-C3qPIXGX.d.cts +310 -0
  133. package/dist/view-DtSPYpKa.d.ts +310 -0
  134. package/dist/visitIntent-D7_yVp1I.d.cts +8 -0
  135. package/dist/visitIntent-D7_yVp1I.d.ts +8 -0
  136. package/dist/web/consent/index.cjs +1 -0
  137. package/dist/web/consent/index.d.cts +34 -0
  138. package/dist/web/consent/index.d.ts +34 -0
  139. package/dist/web/consent/index.js +1 -0
  140. package/dist/web/index.cjs +14 -0
  141. package/dist/web/index.d.cts +217 -0
  142. package/dist/web/index.d.ts +217 -0
  143. package/dist/web/index.js +14 -0
  144. package/dist/web/notifications/index.cjs +2 -0
  145. package/dist/web/notifications/index.d.cts +213 -0
  146. package/dist/web/notifications/index.d.ts +213 -0
  147. package/dist/web/notifications/index.js +2 -0
  148. package/dist/web/records/depth/index.cjs +2 -0
  149. package/dist/web/records/depth/index.d.cts +12 -0
  150. package/dist/web/records/depth/index.d.ts +12 -0
  151. package/dist/web/records/depth/index.js +2 -0
  152. package/dist/web/records/index.cjs +4 -0
  153. package/dist/web/records/index.d.cts +194 -0
  154. package/dist/web/records/index.d.ts +194 -0
  155. package/dist/web/records/index.js +4 -0
  156. package/dist/web/televet/index.cjs +1 -0
  157. package/dist/web/televet/index.d.cts +50 -0
  158. package/dist/web/televet/index.d.ts +50 -0
  159. package/dist/web/televet/index.js +1 -0
  160. package/notifications/package.json +8 -0
  161. package/package.json +197 -9
  162. package/records/depth/package.json +8 -0
  163. package/server/events/device-blocked.cjs +15 -0
  164. package/server/events/package.json +9 -0
  165. package/televet/package.json +8 -0
  166. package/testing/web/native-blocked.cjs +12 -0
  167. package/testing/web/package.json +8 -0
  168. package/web/consent/native-blocked.cjs +12 -0
  169. package/web/consent/package.json +8 -0
  170. package/web/native-blocked.cjs +12 -0
  171. package/web/notifications/native-blocked.cjs +12 -0
  172. package/web/notifications/package.json +8 -0
  173. package/web/package.json +8 -0
  174. package/web/records/depth/native-blocked.cjs +12 -0
  175. package/web/records/depth/package.json +8 -0
  176. package/web/records/native-blocked.cjs +12 -0
  177. package/web/records/package.json +8 -0
  178. package/web/televet/native-blocked.cjs +12 -0
  179. package/web/televet/package.json +8 -0
  180. package/dist/ChatController-CKdBvPj2.d.ts +0 -146
  181. package/dist/ChatController-CpUMvvZf.d.cts +0 -146
  182. package/dist/FilePort-BabWrv7I.d.cts +0 -22
  183. package/dist/FilePort-BabWrv7I.d.ts +0 -22
  184. package/dist/petsRepository-BEGb97M9.d.cts +0 -326
  185. package/dist/petsRepository-Bu18r2kK.d.ts +0 -326
  186. package/dist/requestFunnel-DuUH-kAe.d.cts +0 -28
  187. package/dist/requestFunnel-dio5OmR9.d.ts +0 -28
@@ -0,0 +1,198 @@
1
+ import { c as EverfurResult, E as EverfurError } from './EverfurResult-DN9pL2Ab.cjs';
2
+ import { R as RequestFunnel } from './requestFunnel-L-BQfi0z.cjs';
3
+ import { A as AuthContext } from './identity-DI4eVx9S.cjs';
4
+ import { U as UserRef } from './ids-B2GAAifq.cjs';
5
+ import { E as ErrorPolicyPort } from './ErrorPolicyPort-CNf4uQZP.cjs';
6
+
7
+ /**
8
+ * The consent scopes a member controls from an embedded surface: exactly the scopes a backend gate reads off
9
+ * this ledger. Declaration order is the order a surface lists them in.
10
+ */
11
+ declare const EVERFUR_CONSENT_SCOPES: readonly ["transcript_exposure", "partner_context"];
12
+ /** One scope of the consent ledger. */
13
+ type EverfurConsentScope = (typeof EVERFUR_CONSENT_SCOPES)[number];
14
+ /** `consent_version: Field(None, max_length=64)` on the PUT body. */
15
+ declare const CONSENT_VERSION_MAX = 64;
16
+ /** True for a scope this SDK surfaces. `records_content` is deliberately NOT one; see the module header. */
17
+ declare function isEverfurConsentScope(value: unknown): value is EverfurConsentScope;
18
+ /**
19
+ * The resolved consent state for one scope, fail-closed.
20
+ *
21
+ * `granted` and `hasDecision` are not the same question, and a surface that conflates them is a dark
22
+ * pattern. `hasDecision: false` means nobody has asked yet, which is the state that should raise the
23
+ * prompt. `granted: false` with `hasDecision: true` means the member said no, and asking again is nagging.
24
+ */
25
+ interface EverfurConsentVerdict {
26
+ readonly scope: EverfurConsentScope;
27
+ readonly granted: boolean;
28
+ readonly hasDecision: boolean;
29
+ /** The policy version in force when the decision was recorded, or null when there is none. */
30
+ readonly consentVersion: string | null;
31
+ /** Who authored the decision, as the server recorded it (`end_user` or `system`), or null. */
32
+ readonly actor: string | null;
33
+ /** ISO 8601, or null when there is no decision on record. */
34
+ readonly recordedAt: string | null;
35
+ }
36
+ /** One decision to append: the scope, whether it is a grant or a withdrawal, and the version shown. */
37
+ interface EverfurConsentDecision {
38
+ readonly scope: EverfurConsentScope;
39
+ /** `true` to grant, `false` to withdraw. A withdrawal is the same route, never a harder path. */
40
+ readonly granted: boolean;
41
+ /** The version of the consent text the member was shown; the server defaults it when omitted. */
42
+ readonly consentVersion?: string;
43
+ }
44
+ interface ConsentRepository {
45
+ /**
46
+ * `GET /widget/v1/consent?scope=...` - the current verdict for the signed-in member. Settles
47
+ * `ok(EverfurConsentVerdict)` on 200 and `err(EverfurError)` otherwise. Never throws.
48
+ */
49
+ read(scope: EverfurConsentScope, opts?: {
50
+ readonly signal?: AbortSignal;
51
+ }): Promise<EverfurResult<EverfurConsentVerdict>>;
52
+ /**
53
+ * `PUT /widget/v1/consent` - append a grant or a withdrawal. The actor is fixed server-side to the
54
+ * authenticated member, so nothing here sends one. Settles `ok(EverfurConsentVerdict)`; never throws.
55
+ */
56
+ write(decision: EverfurConsentDecision, opts?: {
57
+ readonly signal?: AbortSignal;
58
+ }): Promise<EverfurResult<EverfurConsentVerdict>>;
59
+ }
60
+ /**
61
+ * The part of the runtime this repository needs: the current auth at call time, the partner's error policy,
62
+ * and whether the runtime is gone. `useEverfurContext().runtime` satisfies it; the narrow shape keeps this
63
+ * subpath's public types down to what it reads.
64
+ */
65
+ interface ConsentRuntime {
66
+ readonly isDisposed: boolean;
67
+ readonly registry: {
68
+ readonly services: {
69
+ authFor(userRef: UserRef | null): AuthContext;
70
+ readonly errorPolicy: ErrorPolicyPort | undefined;
71
+ };
72
+ };
73
+ }
74
+ /** The lower seam: the repository over one already-built auth context, or an already-built funnel (tests). */
75
+ interface ConsentRepositoryDeps {
76
+ readonly auth: AuthContext;
77
+ readonly errorPolicy?: ErrorPolicyPort;
78
+ /** Internal test seam: an already-built funnel. */
79
+ readonly funnel?: RequestFunnel;
80
+ }
81
+ /**
82
+ * The repository over the runtime under your provider (`useEverfurContext().runtime`). Auth is read at CALL
83
+ * time, so one repository serves every sign-in, and a disposed runtime settles every verb without a request.
84
+ */
85
+ declare function createConsentRepository(runtime: ConsentRuntime): ConsentRepository;
86
+ /** The same repository over one auth context (or an injected funnel). Internal seam, for deterministic tests. */
87
+ declare function createConsentRepositoryOver(deps: ConsentRepositoryDeps): ConsentRepository;
88
+
89
+ /** `signed_out`: no member on the provider. `failed`: every scope's read was refused; `refresh()` retries. */
90
+ type EverfurConsentStatus = 'signed_out' | 'loading' | 'ready' | 'failed';
91
+ /** One scope's state, as a surface renders it. */
92
+ interface EverfurConsentScopeState {
93
+ readonly scope: EverfurConsentScope;
94
+ /** The member's current answer. Fail-closed: false until the server says otherwise. */
95
+ readonly granted: boolean;
96
+ /**
97
+ * Whether anyone has asked yet. `false` is the PROMPT state; `granted: false` with `hasDecision: true` is a
98
+ * refusal on record, and asking again is nagging.
99
+ */
100
+ readonly hasDecision: boolean;
101
+ /** The policy version in force when the decision was recorded, or null. */
102
+ readonly consentVersion: string | null;
103
+ /** ISO 8601, or null when there is no decision on record. */
104
+ readonly recordedAt: string | null;
105
+ /**
106
+ * Whether the verdict above came back from the server. False means this scope has NO answer on record
107
+ * here: either its read has not settled or its read was refused (`error` says which). It is not the same
108
+ * question as `hasDecision`, which is about the member; this one is about us.
109
+ */
110
+ readonly loaded: boolean;
111
+ /** True while THIS scope's write is in flight. The other scopes stay usable. */
112
+ readonly saving: boolean;
113
+ /** This scope's last read or write failure, or null. `error.displayMessage` is safe to show. */
114
+ readonly error: EverfurError | null;
115
+ }
116
+ /** What the hook reads. Omit it and every scope this SDK surfaces is read. */
117
+ interface EverfurConsentOptions {
118
+ /**
119
+ * Read only these scopes. A toggle that renders ONE act passes its own scope, so mounting two toggles is two
120
+ * reads rather than four. An unknown value is dropped; an empty result falls back to every scope.
121
+ */
122
+ readonly scopes?: readonly EverfurConsentScope[];
123
+ }
124
+ interface EverfurConsentState {
125
+ readonly status: EverfurConsentStatus;
126
+ /** One entry per scope, in `EVERFUR_CONSENT_SCOPES` order. Empty only before the first read settles. */
127
+ readonly scopes: readonly EverfurConsentScopeState[];
128
+ /** The failure that made the whole read fail, or null. Per-scope failures hang off the scope. */
129
+ readonly error: EverfurError | null;
130
+ /**
131
+ * Grant or withdraw one scope. Optimistic: the switch flips now and rolls back if the wire refuses.
132
+ * Settles an `EverfurResult`; never throws.
133
+ */
134
+ setConsent(scope: EverfurConsentScope, granted: boolean): Promise<EverfurResult<EverfurConsentVerdict>>;
135
+ /** Read every scope again (the way out of `failed`, and the way to pick up a decision made elsewhere). */
136
+ refresh(): Promise<void>;
137
+ }
138
+ /**
139
+ * The consent repository bound to the runtime under your provider, for imperative callers (a settings screen
140
+ * that reads one scope without mounting the hook). Auth is read at call time, so one repository serves every
141
+ * sign-in.
142
+ */
143
+ declare function useEverfurConsentRepository(): ConsentRepository;
144
+ /**
145
+ * Read the member's consent state for every scope this SDK surfaces, and let them change it. Mount it on the
146
+ * screen where a member manages their data; `EverfurConsentToggle` renders one scope of it on either host.
147
+ */
148
+ declare function useEverfurConsent(options?: EverfurConsentOptions): EverfurConsentState;
149
+
150
+ /** What a band paints. `row` is the only state carrying a switch; every other state carries none. */
151
+ type ConsentRowView =
152
+ /** No member on the provider: a switch here could not write, so none is offered. */
153
+ {
154
+ readonly kind: 'signedOut';
155
+ }
156
+ /** The read has not settled yet. */
157
+ | {
158
+ readonly kind: 'loading';
159
+ }
160
+ /** This scope could not be READ, so there is no answer to show. `error.displayMessage` is the safe copy. */
161
+ | {
162
+ readonly kind: 'failed';
163
+ readonly error: EverfurError;
164
+ } | {
165
+ readonly kind: 'row';
166
+ readonly scope: EverfurConsentScope;
167
+ readonly granted: boolean;
168
+ /** false is the never-asked state: the switch is off and nothing claims the member answered. */
169
+ readonly hasDecision: boolean;
170
+ /** This scope's write is in flight: the switch shows the optimistic answer and takes no new tap. */
171
+ readonly saving: boolean;
172
+ /** The last WRITE's refusal, after the switch was rolled back, or null. The switch stays usable. */
173
+ readonly error: EverfurError | null;
174
+ };
175
+ /**
176
+ * The view for one scope of a consent state.
177
+ *
178
+ * A scope the state does not carry yet is `loading`, never an empty row: inventing an ungranted row for it
179
+ * would paint a consent answer nobody gave.
180
+ */
181
+ declare function consentRowView(state: EverfurConsentState, scope: EverfurConsentScope): ConsentRowView;
182
+
183
+ /** One scope's row copy. `body` takes the partner's display name, the referent the member recognises. */
184
+ interface ConsentScopeCopy {
185
+ readonly title: string;
186
+ readonly body: (partner: string) => string;
187
+ }
188
+ declare const CONSENT_COPY: Readonly<{
189
+ loading: "Loading";
190
+ retry: "Try again";
191
+ signedOut: "Sign in required";
192
+ changeable: "You can change this at any time.";
193
+ saving: "Saving";
194
+ }>;
195
+ /** AUTHORED (2026-09-20), pending copy review. One entry per scope this SDK surfaces. */
196
+ declare const CONSENT_SCOPE_COPY: Readonly<Record<EverfurConsentScope, ConsentScopeCopy>>;
197
+
198
+ export { CONSENT_COPY as C, type EverfurConsentScope as E, CONSENT_SCOPE_COPY as a, CONSENT_VERSION_MAX as b, type ConsentRepository as c, type ConsentRepositoryDeps as d, type ConsentRowView as e, type ConsentRuntime as f, type ConsentScopeCopy as g, EVERFUR_CONSENT_SCOPES as h, type EverfurConsentDecision as i, type EverfurConsentOptions as j, type EverfurConsentScopeState as k, type EverfurConsentState as l, type EverfurConsentStatus as m, type EverfurConsentVerdict as n, consentRowView as o, createConsentRepository as p, createConsentRepositoryOver as q, isEverfurConsentScope as r, useEverfurConsentRepository as s, useEverfurConsent as u };