@hipnation-truth/sdk 0.19.0 → 0.21.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/dist/react.d.ts +21 -0
- package/dist/react.js +20 -0
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
package/dist/react.d.ts
CHANGED
|
@@ -92,6 +92,15 @@ interface ConversationListItem {
|
|
|
92
92
|
lastMessageKind: string | null;
|
|
93
93
|
/** `"inbound" | "outbound"` of the previewed message. */
|
|
94
94
|
lastDirection: string | null;
|
|
95
|
+
/**
|
|
96
|
+
* Call lifecycle state when the previewed event is a call/voicemail:
|
|
97
|
+
* `"missed" | "connected" | "ringing" | "hangup" | "voicemail" |
|
|
98
|
+
* "voicemail_uploaded"`. Lets the inbox show "Missed call" / "Call in
|
|
99
|
+
* progress" / "Voicemail" instead of a bare "Call". Null for SMS.
|
|
100
|
+
*/
|
|
101
|
+
lastCallState: string | null;
|
|
102
|
+
/** Call duration in seconds (calls only). */
|
|
103
|
+
lastCallDurationSec: number | null;
|
|
95
104
|
/** Caller's unread count for this conversation. */
|
|
96
105
|
unreadCount: number;
|
|
97
106
|
/** ISO timestamp of when the caller last marked the conversation read. */
|
|
@@ -163,6 +172,12 @@ interface ConversationTaskRow {
|
|
|
163
172
|
* patient handle without a second reactive query.
|
|
164
173
|
*/
|
|
165
174
|
interface ConversationTaskForUserRow extends ConversationTaskRow {
|
|
175
|
+
/**
|
|
176
|
+
* Task title — only standalone (New-Task-modal) tasks have one; conversation
|
|
177
|
+
* tasks have none (the `description` is the content). When set, the My Tasks
|
|
178
|
+
* card shows it as the headline with the real `description` below it.
|
|
179
|
+
*/
|
|
180
|
+
title: string | null;
|
|
166
181
|
/** Normalized `(patient_phone | provider_phone)` for the task's conversation. */
|
|
167
182
|
phonePair: string | null;
|
|
168
183
|
/**
|
|
@@ -196,6 +211,8 @@ interface ConversationMessageRow {
|
|
|
196
211
|
toNumber: string | null;
|
|
197
212
|
voicemailLink: string | null;
|
|
198
213
|
duration: number | null;
|
|
214
|
+
/** Voicemail/call transcript — Dialpad delivers `{ text }` (B5). */
|
|
215
|
+
transcript: unknown | null;
|
|
199
216
|
text: string | null;
|
|
200
217
|
mms: boolean;
|
|
201
218
|
mmsUrl: string | null;
|
|
@@ -654,6 +671,8 @@ interface ConversationMessage {
|
|
|
654
671
|
toNumber: string | null;
|
|
655
672
|
voicemailLink: string | null;
|
|
656
673
|
duration: number | null;
|
|
674
|
+
/** Voicemail/call transcript — Dialpad delivers `{ text }` (B5). */
|
|
675
|
+
transcript: unknown | null;
|
|
657
676
|
text: string | null;
|
|
658
677
|
mms: boolean;
|
|
659
678
|
mmsUrl: string | null;
|
|
@@ -944,6 +963,8 @@ interface PatientSearchResult {
|
|
|
944
963
|
/** Hint patient id — present when the row originates from Hint. */
|
|
945
964
|
hintId: string | undefined;
|
|
946
965
|
firstName: string;
|
|
966
|
+
/** Middle name — surfaced so the picker renders the full legal name (B9). */
|
|
967
|
+
middleName: string | undefined;
|
|
947
968
|
lastName: string;
|
|
948
969
|
/** ISO date string (YYYY-MM-DD) — undefined when not available. */
|
|
949
970
|
dob: string | undefined;
|
package/dist/react.js
CHANGED
|
@@ -2390,6 +2390,10 @@ function TruthProvider({
|
|
|
2390
2390
|
const convexClient = (0, import_react6.useMemo)(() => new import_react5.ConvexReactClient(url), [url]);
|
|
2391
2391
|
const truthClient = (0, import_react6.useMemo)(
|
|
2392
2392
|
() => new TruthClient({
|
|
2393
|
+
// Pin the resource client to the SAME deployment the React hooks
|
|
2394
|
+
// use; without this it falls back to CONVEX_URLS[environment] and a
|
|
2395
|
+
// caller-supplied `convexUrl` would split hooks vs. client methods.
|
|
2396
|
+
convexUrl: url,
|
|
2393
2397
|
apiKey: resolvedApiKey,
|
|
2394
2398
|
environment,
|
|
2395
2399
|
apiBaseUrl: resolvedApiBaseUrl,
|
|
@@ -2399,6 +2403,7 @@ function TruthProvider({
|
|
|
2399
2403
|
autoInitServiceWorker: false
|
|
2400
2404
|
}),
|
|
2401
2405
|
[
|
|
2406
|
+
url,
|
|
2402
2407
|
resolvedApiKey,
|
|
2403
2408
|
resolvedApiBaseUrl,
|
|
2404
2409
|
environment,
|
|
@@ -2413,6 +2418,8 @@ function TruthProvider({
|
|
|
2413
2418
|
if (_activeClient === truthClient) {
|
|
2414
2419
|
_activeClient = null;
|
|
2415
2420
|
}
|
|
2421
|
+
void truthClient.destroy().catch(() => {
|
|
2422
|
+
});
|
|
2416
2423
|
};
|
|
2417
2424
|
}, [truthClient]);
|
|
2418
2425
|
const sdkContext = (0, import_react6.useMemo)(
|
|
@@ -2799,6 +2806,9 @@ function useNotifications(options) {
|
|
|
2799
2806
|
return { ok: false, reason: "no_native_token" };
|
|
2800
2807
|
}
|
|
2801
2808
|
setDevicePushToken(nativeToken);
|
|
2809
|
+
if (!apiBaseUrl || !apiKey) {
|
|
2810
|
+
return { ok: false, reason: "missing_truth_config" };
|
|
2811
|
+
}
|
|
2802
2812
|
const res = yield fetch(
|
|
2803
2813
|
`${apiBaseUrl}/api/notifications/devices/register`,
|
|
2804
2814
|
{
|
|
@@ -2960,6 +2970,11 @@ function useNotificationsActions() {
|
|
|
2960
2970
|
const apiKey = (_b = sdkContext == null ? void 0 : sdkContext.apiKey) != null ? _b : "";
|
|
2961
2971
|
const post = (0, import_react9.useCallback)(
|
|
2962
2972
|
(path, body) => __async(null, null, function* () {
|
|
2973
|
+
if (!apiBaseUrl || !apiKey) {
|
|
2974
|
+
throw new Error(
|
|
2975
|
+
"useNotificationsActions: missing apiBaseUrl/apiKey \u2014 wrap in <TruthProvider> or pass options"
|
|
2976
|
+
);
|
|
2977
|
+
}
|
|
2963
2978
|
const res = yield fetch(`${apiBaseUrl}/api${path}`, {
|
|
2964
2979
|
method: "POST",
|
|
2965
2980
|
headers: {
|
|
@@ -3318,6 +3333,11 @@ function useUserSync(input) {
|
|
|
3318
3333
|
return;
|
|
3319
3334
|
}
|
|
3320
3335
|
const key = [
|
|
3336
|
+
// Include the resolved config so a first mount with missing creds
|
|
3337
|
+
// (sync no-ops as "missing_truth_config") doesn't pin the key and
|
|
3338
|
+
// permanently skip the valid retry once creds arrive.
|
|
3339
|
+
apiBaseUrl,
|
|
3340
|
+
apiKey,
|
|
3321
3341
|
input.userId,
|
|
3322
3342
|
(_a2 = input.email) != null ? _a2 : "",
|
|
3323
3343
|
(_b2 = input.name) != null ? _b2 : "",
|