@hipnation-truth/sdk 0.6.0 → 0.7.1

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/index.d.mts CHANGED
@@ -93,6 +93,14 @@ interface TruthClientConfig {
93
93
  flushIntervalMs?: number;
94
94
  /** Base URL for the Truth API (overrides environment-based default) */
95
95
  apiBaseUrl?: string;
96
+ /**
97
+ * Auto-register the service worker and subscribe to web push on init.
98
+ * Only applies in browser environments with Push API support.
99
+ * Default: true.
100
+ */
101
+ autoInitServiceWorker?: boolean;
102
+ /** Path to the service worker file. Default: "/truth-sw.js" */
103
+ serviceWorkerPath?: string;
96
104
  }
97
105
  /**
98
106
  * Actor context attached to tracked events.
@@ -407,6 +415,168 @@ declare class NotesResource {
407
415
  pushToElation(input: PushNoteToElationInput): Promise<PushNoteToElationResult>;
408
416
  }
409
417
 
418
+ /**
419
+ * NotificationsResource — wraps Truth's /api/notifications/* endpoints.
420
+ *
421
+ * Server-side use (for example from a CommHub backend job or
422
+ * another service): `truth.notifications.send({ userId, title, body })`.
423
+ *
424
+ * Client-side React usage lives in `@hipnation-truth/sdk/react` via
425
+ * the `useNotifications` hook which mirrors `expo-notifications`.
426
+ */
427
+ type NotificationPlatform = "ios" | "android" | "web";
428
+ interface RegisterDeviceInput {
429
+ userId: string;
430
+ platform: NotificationPlatform;
431
+ nativeToken?: string;
432
+ webPushSubscription?: {
433
+ endpoint: string;
434
+ keys: {
435
+ p256dh: string;
436
+ auth: string;
437
+ };
438
+ };
439
+ appVersion?: string;
440
+ osVersion?: string;
441
+ locale?: string;
442
+ timezone?: string;
443
+ }
444
+ interface RegisterDeviceResult {
445
+ deviceId: string;
446
+ action: "inserted" | "updated";
447
+ snsEndpointArn?: string;
448
+ }
449
+ interface UnregisterDeviceInput {
450
+ nativeToken?: string;
451
+ deviceId?: string;
452
+ }
453
+ interface SendNotificationInput {
454
+ userId: string;
455
+ title: string;
456
+ body: string;
457
+ data?: Record<string, unknown>;
458
+ badge?: number;
459
+ sound?: string;
460
+ }
461
+ interface SendNotificationResult {
462
+ delivered: number;
463
+ failed?: number;
464
+ suppressed?: boolean;
465
+ suppressionReason?: string;
466
+ }
467
+ interface NotificationPreferences {
468
+ channels: {
469
+ sms: boolean;
470
+ push: boolean;
471
+ email: boolean;
472
+ inApp: boolean;
473
+ };
474
+ quietHours?: {
475
+ enabled: boolean;
476
+ start: string;
477
+ end: string;
478
+ timezone: string;
479
+ };
480
+ doNotDisturbUntil?: string;
481
+ updatedAt: string;
482
+ }
483
+ interface UpdatePreferencesInput {
484
+ userId: string;
485
+ channels?: NotificationPreferences["channels"];
486
+ quietHours?: NotificationPreferences["quietHours"];
487
+ doNotDisturbUntil?: string | null;
488
+ }
489
+ interface ScheduleNotificationInput extends SendNotificationInput {
490
+ /** ISO 8601 timestamp; must be strictly in the future. */
491
+ scheduledAt: string;
492
+ }
493
+ interface ScheduleNotificationResult {
494
+ jobId: string;
495
+ scheduledAt: string;
496
+ }
497
+ interface CancelScheduledNotificationResult {
498
+ cancelled: boolean;
499
+ reason?: string;
500
+ status?: string;
501
+ }
502
+ type ScheduledJobStatus = "pending" | "executed" | "cancelled" | "failed";
503
+ interface ScheduledNotification {
504
+ jobId: string;
505
+ userId: string;
506
+ title: string;
507
+ body: string;
508
+ data?: unknown;
509
+ badge?: number;
510
+ sound?: string;
511
+ scheduledAt: string;
512
+ status: ScheduledJobStatus;
513
+ resultHistoryId?: string;
514
+ errorMessage?: string;
515
+ createdAt: string;
516
+ }
517
+ interface PushEventPayload {
518
+ title: string;
519
+ body: string;
520
+ data?: unknown;
521
+ }
522
+ declare class NotificationsError extends Error {
523
+ readonly status: number;
524
+ constructor(operation: string, status: number, message?: string);
525
+ }
526
+ declare class NotificationsResource {
527
+ private readonly baseUrl;
528
+ private readonly apiKey;
529
+ constructor(apiBaseUrl: string, apiKey: string);
530
+ private post;
531
+ private get;
532
+ private delete;
533
+ /**
534
+ * Register a device (or refresh its metadata) for push delivery.
535
+ * Safe to call repeatedly — the server dedupes by native token.
536
+ */
537
+ registerDevice(input: RegisterDeviceInput): Promise<RegisterDeviceResult>;
538
+ /** Revoke a device — on sign-out or when the OS reports an invalid token. */
539
+ unregisterDevice(input: UnregisterDeviceInput): Promise<{
540
+ revoked: boolean;
541
+ }>;
542
+ /**
543
+ * Send a push notification to every active device belonging to
544
+ * `userId`. Honors the user's notificationPreferences (quiet hours,
545
+ * DND, channel off) before publishing.
546
+ */
547
+ send(input: SendNotificationInput): Promise<SendNotificationResult>;
548
+ /** Read a user's notification preferences. Returns defaults when no row exists. */
549
+ getPreferences(userId: string): Promise<NotificationPreferences>;
550
+ updatePreferences(input: UpdatePreferencesInput): Promise<{
551
+ ok: boolean;
552
+ }>;
553
+ /**
554
+ * Schedule a future push notification. Convex's native scheduler
555
+ * fires the send at `scheduledAt` and runs the same delivery
556
+ * pipeline as `send()` (preferences, devices, history audit).
557
+ *
558
+ * Throws `NotificationsError` with status 400 if `scheduledAt` is
559
+ * not strictly in the future.
560
+ */
561
+ schedule(input: ScheduleNotificationInput): Promise<ScheduleNotificationResult>;
562
+ /**
563
+ * Cancel a pending scheduled notification. Returns `cancelled: false`
564
+ * (no error) if the job has already executed, was previously
565
+ * cancelled, or no longer exists — `reason` describes which case.
566
+ */
567
+ cancelScheduled(jobId: string): Promise<CancelScheduledNotificationResult>;
568
+ /**
569
+ * List scheduled notifications for a user — pending, executed,
570
+ * cancelled, or failed. Most-recent first. Default limit 100.
571
+ */
572
+ listScheduled(userId: string, options?: {
573
+ limit?: number;
574
+ }): Promise<ScheduledNotification[]>;
575
+ getVapidKey(): Promise<string | null>;
576
+ onPushReceived(callback: (payload: PushEventPayload) => void): () => void;
577
+ onPushTapped(callback: (payload: PushEventPayload) => void): () => void;
578
+ }
579
+
410
580
  /**
411
581
  * PatientDetailsResource — merged Hint + Elation patient lookups.
412
582
  *
@@ -1114,9 +1284,17 @@ declare class TruthClient {
1114
1284
  readonly notes: NotesResource;
1115
1285
  /** Physicians (Convex-backed cache from Elation) */
1116
1286
  readonly physicians: PhysiciansResource;
1287
+ /** Push / web notifications (AWS End User Messaging) */
1288
+ readonly notifications: NotificationsResource;
1117
1289
  private readonly convex;
1118
1290
  private readonly tracker;
1291
+ private _vapidPublicKey;
1292
+ private _webPushReady;
1293
+ private readonly _serviceWorkerPath;
1119
1294
  constructor(config: TruthClientConfig);
1295
+ get vapidPublicKey(): string | null;
1296
+ get webPushReady(): Promise<void> | null;
1297
+ private initWebPush;
1120
1298
  /**
1121
1299
  * The resolved Truth API base URL for this environment.
1122
1300
  * Use this when making HTTP calls to Truth's proxy endpoints
@@ -1241,4 +1419,26 @@ declare class Tracker {
1241
1419
  private registerShutdownHooks;
1242
1420
  }
1243
1421
 
1244
- export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationSentPayload, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleReminderInput, type ScheduleReminderResult, type SecurityAccessDeniedPayload, type SecurityEventType, type SendSmsParams, type SendSmsResponse, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UpdateTaskStatusInput, type VoicemailAuthResponse, generateUuidV7 };
1422
+ /**
1423
+ * Web Push helpers for browser environments.
1424
+ *
1425
+ * Handles service worker registration, VAPID push subscription, and
1426
+ * message forwarding from the service worker to the main thread.
1427
+ */
1428
+ interface WebPushConfig {
1429
+ vapidPublicKey: string;
1430
+ serviceWorkerPath?: string;
1431
+ }
1432
+ declare function isWebPushSupported(): boolean;
1433
+ declare function registerServiceWorker(path?: string): Promise<ServiceWorkerRegistration>;
1434
+ declare function subscribeToPush(registration: ServiceWorkerRegistration, vapidPublicKey: string): Promise<PushSubscription>;
1435
+ declare function subscriptionToJSON(sub: PushSubscription): {
1436
+ endpoint: string;
1437
+ keys: {
1438
+ p256dh: string;
1439
+ auth: string;
1440
+ };
1441
+ };
1442
+ declare function onServiceWorkerMessage(type: string, callback: (payload: unknown) => void): () => void;
1443
+
1444
+ export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type CancelScheduledNotificationResult, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationPlatform, type NotificationPreferences, type NotificationSentPayload, NotificationsError, NotificationsResource, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushEventPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type RegisterDeviceInput, type RegisterDeviceResult, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleNotificationInput, type ScheduleNotificationResult, type ScheduleReminderInput, type ScheduleReminderResult, type ScheduledJobStatus, type ScheduledNotification, type SecurityAccessDeniedPayload, type SecurityEventType, type SendNotificationInput, type SendNotificationResult, type SendSmsParams, type SendSmsResponse, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UnregisterDeviceInput, type UpdatePreferencesInput, type UpdateTaskStatusInput, type VoicemailAuthResponse, type WebPushConfig, generateUuidV7, isWebPushSupported, onServiceWorkerMessage, registerServiceWorker, subscribeToPush, subscriptionToJSON };
package/dist/index.d.ts CHANGED
@@ -93,6 +93,14 @@ interface TruthClientConfig {
93
93
  flushIntervalMs?: number;
94
94
  /** Base URL for the Truth API (overrides environment-based default) */
95
95
  apiBaseUrl?: string;
96
+ /**
97
+ * Auto-register the service worker and subscribe to web push on init.
98
+ * Only applies in browser environments with Push API support.
99
+ * Default: true.
100
+ */
101
+ autoInitServiceWorker?: boolean;
102
+ /** Path to the service worker file. Default: "/truth-sw.js" */
103
+ serviceWorkerPath?: string;
96
104
  }
97
105
  /**
98
106
  * Actor context attached to tracked events.
@@ -407,6 +415,168 @@ declare class NotesResource {
407
415
  pushToElation(input: PushNoteToElationInput): Promise<PushNoteToElationResult>;
408
416
  }
409
417
 
418
+ /**
419
+ * NotificationsResource — wraps Truth's /api/notifications/* endpoints.
420
+ *
421
+ * Server-side use (for example from a CommHub backend job or
422
+ * another service): `truth.notifications.send({ userId, title, body })`.
423
+ *
424
+ * Client-side React usage lives in `@hipnation-truth/sdk/react` via
425
+ * the `useNotifications` hook which mirrors `expo-notifications`.
426
+ */
427
+ type NotificationPlatform = "ios" | "android" | "web";
428
+ interface RegisterDeviceInput {
429
+ userId: string;
430
+ platform: NotificationPlatform;
431
+ nativeToken?: string;
432
+ webPushSubscription?: {
433
+ endpoint: string;
434
+ keys: {
435
+ p256dh: string;
436
+ auth: string;
437
+ };
438
+ };
439
+ appVersion?: string;
440
+ osVersion?: string;
441
+ locale?: string;
442
+ timezone?: string;
443
+ }
444
+ interface RegisterDeviceResult {
445
+ deviceId: string;
446
+ action: "inserted" | "updated";
447
+ snsEndpointArn?: string;
448
+ }
449
+ interface UnregisterDeviceInput {
450
+ nativeToken?: string;
451
+ deviceId?: string;
452
+ }
453
+ interface SendNotificationInput {
454
+ userId: string;
455
+ title: string;
456
+ body: string;
457
+ data?: Record<string, unknown>;
458
+ badge?: number;
459
+ sound?: string;
460
+ }
461
+ interface SendNotificationResult {
462
+ delivered: number;
463
+ failed?: number;
464
+ suppressed?: boolean;
465
+ suppressionReason?: string;
466
+ }
467
+ interface NotificationPreferences {
468
+ channels: {
469
+ sms: boolean;
470
+ push: boolean;
471
+ email: boolean;
472
+ inApp: boolean;
473
+ };
474
+ quietHours?: {
475
+ enabled: boolean;
476
+ start: string;
477
+ end: string;
478
+ timezone: string;
479
+ };
480
+ doNotDisturbUntil?: string;
481
+ updatedAt: string;
482
+ }
483
+ interface UpdatePreferencesInput {
484
+ userId: string;
485
+ channels?: NotificationPreferences["channels"];
486
+ quietHours?: NotificationPreferences["quietHours"];
487
+ doNotDisturbUntil?: string | null;
488
+ }
489
+ interface ScheduleNotificationInput extends SendNotificationInput {
490
+ /** ISO 8601 timestamp; must be strictly in the future. */
491
+ scheduledAt: string;
492
+ }
493
+ interface ScheduleNotificationResult {
494
+ jobId: string;
495
+ scheduledAt: string;
496
+ }
497
+ interface CancelScheduledNotificationResult {
498
+ cancelled: boolean;
499
+ reason?: string;
500
+ status?: string;
501
+ }
502
+ type ScheduledJobStatus = "pending" | "executed" | "cancelled" | "failed";
503
+ interface ScheduledNotification {
504
+ jobId: string;
505
+ userId: string;
506
+ title: string;
507
+ body: string;
508
+ data?: unknown;
509
+ badge?: number;
510
+ sound?: string;
511
+ scheduledAt: string;
512
+ status: ScheduledJobStatus;
513
+ resultHistoryId?: string;
514
+ errorMessage?: string;
515
+ createdAt: string;
516
+ }
517
+ interface PushEventPayload {
518
+ title: string;
519
+ body: string;
520
+ data?: unknown;
521
+ }
522
+ declare class NotificationsError extends Error {
523
+ readonly status: number;
524
+ constructor(operation: string, status: number, message?: string);
525
+ }
526
+ declare class NotificationsResource {
527
+ private readonly baseUrl;
528
+ private readonly apiKey;
529
+ constructor(apiBaseUrl: string, apiKey: string);
530
+ private post;
531
+ private get;
532
+ private delete;
533
+ /**
534
+ * Register a device (or refresh its metadata) for push delivery.
535
+ * Safe to call repeatedly — the server dedupes by native token.
536
+ */
537
+ registerDevice(input: RegisterDeviceInput): Promise<RegisterDeviceResult>;
538
+ /** Revoke a device — on sign-out or when the OS reports an invalid token. */
539
+ unregisterDevice(input: UnregisterDeviceInput): Promise<{
540
+ revoked: boolean;
541
+ }>;
542
+ /**
543
+ * Send a push notification to every active device belonging to
544
+ * `userId`. Honors the user's notificationPreferences (quiet hours,
545
+ * DND, channel off) before publishing.
546
+ */
547
+ send(input: SendNotificationInput): Promise<SendNotificationResult>;
548
+ /** Read a user's notification preferences. Returns defaults when no row exists. */
549
+ getPreferences(userId: string): Promise<NotificationPreferences>;
550
+ updatePreferences(input: UpdatePreferencesInput): Promise<{
551
+ ok: boolean;
552
+ }>;
553
+ /**
554
+ * Schedule a future push notification. Convex's native scheduler
555
+ * fires the send at `scheduledAt` and runs the same delivery
556
+ * pipeline as `send()` (preferences, devices, history audit).
557
+ *
558
+ * Throws `NotificationsError` with status 400 if `scheduledAt` is
559
+ * not strictly in the future.
560
+ */
561
+ schedule(input: ScheduleNotificationInput): Promise<ScheduleNotificationResult>;
562
+ /**
563
+ * Cancel a pending scheduled notification. Returns `cancelled: false`
564
+ * (no error) if the job has already executed, was previously
565
+ * cancelled, or no longer exists — `reason` describes which case.
566
+ */
567
+ cancelScheduled(jobId: string): Promise<CancelScheduledNotificationResult>;
568
+ /**
569
+ * List scheduled notifications for a user — pending, executed,
570
+ * cancelled, or failed. Most-recent first. Default limit 100.
571
+ */
572
+ listScheduled(userId: string, options?: {
573
+ limit?: number;
574
+ }): Promise<ScheduledNotification[]>;
575
+ getVapidKey(): Promise<string | null>;
576
+ onPushReceived(callback: (payload: PushEventPayload) => void): () => void;
577
+ onPushTapped(callback: (payload: PushEventPayload) => void): () => void;
578
+ }
579
+
410
580
  /**
411
581
  * PatientDetailsResource — merged Hint + Elation patient lookups.
412
582
  *
@@ -1114,9 +1284,17 @@ declare class TruthClient {
1114
1284
  readonly notes: NotesResource;
1115
1285
  /** Physicians (Convex-backed cache from Elation) */
1116
1286
  readonly physicians: PhysiciansResource;
1287
+ /** Push / web notifications (AWS End User Messaging) */
1288
+ readonly notifications: NotificationsResource;
1117
1289
  private readonly convex;
1118
1290
  private readonly tracker;
1291
+ private _vapidPublicKey;
1292
+ private _webPushReady;
1293
+ private readonly _serviceWorkerPath;
1119
1294
  constructor(config: TruthClientConfig);
1295
+ get vapidPublicKey(): string | null;
1296
+ get webPushReady(): Promise<void> | null;
1297
+ private initWebPush;
1120
1298
  /**
1121
1299
  * The resolved Truth API base URL for this environment.
1122
1300
  * Use this when making HTTP calls to Truth's proxy endpoints
@@ -1241,4 +1419,26 @@ declare class Tracker {
1241
1419
  private registerShutdownHooks;
1242
1420
  }
1243
1421
 
1244
- export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationSentPayload, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleReminderInput, type ScheduleReminderResult, type SecurityAccessDeniedPayload, type SecurityEventType, type SendSmsParams, type SendSmsResponse, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UpdateTaskStatusInput, type VoicemailAuthResponse, generateUuidV7 };
1422
+ /**
1423
+ * Web Push helpers for browser environments.
1424
+ *
1425
+ * Handles service worker registration, VAPID push subscription, and
1426
+ * message forwarding from the service worker to the main thread.
1427
+ */
1428
+ interface WebPushConfig {
1429
+ vapidPublicKey: string;
1430
+ serviceWorkerPath?: string;
1431
+ }
1432
+ declare function isWebPushSupported(): boolean;
1433
+ declare function registerServiceWorker(path?: string): Promise<ServiceWorkerRegistration>;
1434
+ declare function subscribeToPush(registration: ServiceWorkerRegistration, vapidPublicKey: string): Promise<PushSubscription>;
1435
+ declare function subscriptionToJSON(sub: PushSubscription): {
1436
+ endpoint: string;
1437
+ keys: {
1438
+ p256dh: string;
1439
+ auth: string;
1440
+ };
1441
+ };
1442
+ declare function onServiceWorkerMessage(type: string, callback: (payload: unknown) => void): () => void;
1443
+
1444
+ export { AUTH_EVENTS, type ActorContext, type Appointment, type AppointmentListOptions, AppointmentResource, type Attachment, AttachmentsError, AttachmentsResource, type AuthEventType, type AuthLoginFailedPayload, type AuthLoginSucceededPayload, CALL_EVENTS, CONVERSATION_EVENTS, type CallConnectedPayload, type CallEndedPayload, type CallEventType, type CallInitiatedPayload, type CallMissedPayload, type CallStatusResponse, type CancelScheduledNotificationResult, type ConversationAttachmentDownloadedPayload, type ConversationAttachmentUploadedPayload, type ConversationCreatedPayload, type ConversationEventType, type ConversationMarkedReadPayload, type ConversationMessageReceivedPayload, type ConversationMessageSentPayload, type CreateTaskInput, type CreateUploadUrlInput, type CreateUploadUrlResult, type DetectionResult, type DialpadNumberInfo, DialpadProxyError, DialpadResource, type DialpadUser, ENVIRONMENTS, EVENT_TYPES, EhrProviderProxy, EhrProxyError, EhrResource, type Environment, type EventActor, type EventCompliance, type EventEnvelope, type EventPayloadMap, type EventSubject, type EventType, type GetDownloadUrlResult, type InitiateCallResponse, MessagesResource, NOTIFICATION_EVENTS, type NonVisitNoteBullet, NotesError, NotesResource, type NotificationDeliveredPayload, type NotificationEventType, type NotificationOpenedPayload, type NotificationPlatform, type NotificationPreferences, type NotificationSentPayload, NotificationsError, NotificationsResource, PROVIDER_EVENTS, type PaginatedResult, type Patient, type PatientBasicDetailsResult, PatientDetailsError, type PatientDetailsInput, PatientDetailsResource, type PatientDetailsResult, type PatientListOptions, type PatientMedicalDetailsResult, PatientResource, type Physician, PhysiciansResource, type ProviderEventType, type ProviderSyncFailedPayload, type ProviderSyncStartedPayload, type ProviderSyncSucceededPayload, type PushEventPayload, type PushNoteToElationInput, type PushNoteToElationResult, REMINDER_EVENTS, type RecordAttachmentInput, type RegisterDeviceInput, type RegisterDeviceResult, type Reminder, type ReminderEventType, type ReminderScheduledPayload, type ReminderStatus, type ReminderTriggeredPayload, RemindersResource, SECURITY_EVENTS, type ScheduleNotificationInput, type ScheduleNotificationResult, type ScheduleReminderInput, type ScheduleReminderResult, type ScheduledJobStatus, type ScheduledNotification, type SecurityAccessDeniedPayload, type SecurityEventType, type SendNotificationInput, type SendNotificationResult, type SendSmsParams, type SendSmsResponse, TASK_EVENTS, TRANSLATION_EVENTS, type Task, type TaskAssignedPayload, type TaskCreatedPayload, type TaskEventType, type TaskStatus, type TaskStatusChangedPayload, TasksResource, type TrackOptions, Tracker, type TranslateBatchInput, type TranslateTextInput, type TranslationCompletedPayload, TranslationError, type TranslationEventType, type TranslationRequestedPayload, TranslationResource, type TranslationResult, TruthClient, type TruthClientConfig, type UnregisterDeviceInput, type UpdatePreferencesInput, type UpdateTaskStatusInput, type VoicemailAuthResponse, type WebPushConfig, generateUuidV7, isWebPushSupported, onServiceWorkerMessage, registerServiceWorker, subscribeToPush, subscriptionToJSON };