@tellescope/types-models 1.250.1 → 1.251.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/src/index.ts CHANGED
@@ -541,6 +541,7 @@ export interface Organization extends Organization_readonly, Organization_requir
541
541
  answersSyncToPortal?: { id: string, questions: string[] }[]
542
542
  externalFormIdsToSync?: string[],
543
543
  enforceMFA?: boolean,
544
+ accountSwitchingEnabled?: boolean, // opt-in: must be true for users in this org to participate in linked-account access (as either requester or target)
544
545
  analyticsIframes?: {
545
546
  title: string,
546
547
  iframeURL: string,
@@ -571,6 +572,7 @@ export interface Organization extends Organization_readonly, Organization_requir
571
572
  skipActivePatientBilling?: boolean,
572
573
  portalV2SchemaURL?: string,
573
574
  timeTrackingPrograms?: TimeTrackingProgram[],
575
+ belugaAutomationMappings?: BelugaAutomationMappingEntry[],
574
576
  }
575
577
  export type OrganizationTheme = {
576
578
  name: string,
@@ -673,6 +675,11 @@ export interface UserSession extends Session, OrganizationLimits { // User joine
673
675
  availablePhoneNumbers: string[],
674
676
  availableFromEmails: string[],
675
677
  isa?: boolean,
678
+ // When set, this session was created via account-switching. actorUserId is the user
679
+ // who initiated the switch (e.g. A switching into B → session.id = B, session.actorUserId = A).
680
+ actorUserId?: string,
681
+ actorEmail?: string,
682
+ actorBusinessId?: string,
676
683
  }
677
684
 
678
685
  export type StateCredentialInfo = {
@@ -722,6 +729,31 @@ export type UserCallRoutingBehavior = (
722
729
 
723
730
  export type MFASettings = { email?: boolean }
724
731
 
732
+ export interface LinkedAccount {
733
+ id: string,
734
+ email: string,
735
+ orgName: string,
736
+ fname?: string,
737
+ lname?: string,
738
+ requiresMFA: boolean,
739
+ }
740
+
741
+ export type LinkedAccountAccessStatus = 'pending' | 'accepted'
742
+
743
+ export interface LinkedAccountAccessEntry {
744
+ userId: string,
745
+ email: string,
746
+ fname?: string,
747
+ lname?: string,
748
+ orgName?: string,
749
+ status: LinkedAccountAccessStatus,
750
+ createdAt: Date,
751
+ // Governs only the pending-request TTL. Once status flips to 'accepted',
752
+ // this field is preserved for audit but no longer gates anything; switching
753
+ // is permitted indefinitely until the owner revokes.
754
+ requestExpiresAt: Date,
755
+ }
756
+
725
757
  export type LabeledField = { field: string, value: string }
726
758
 
727
759
  export interface User_readonly extends ClientRecord {
@@ -810,6 +842,7 @@ export interface User extends User_required, User_readonly, User_updatesDisabled
810
842
  dashboardView?: CustomDashboardView,
811
843
  hideFromCalendarView?: boolean,
812
844
  requireSSO?: string[],
845
+ linkedAccountAccess?: LinkedAccountAccessEntry[],
813
846
  }
814
847
 
815
848
  export type Preference = 'email' | 'sms' | 'call' | 'chat'
@@ -1147,6 +1180,7 @@ export interface EnduserMedication extends EnduserMedication_readonly, EnduserMe
1147
1180
  // Medication status (e.g., 'draft', 'pending', 'active', 'Prescribed')
1148
1181
  status?: string,
1149
1182
  protocol?: string,
1183
+ category?: string, // sourced from upstream prescribing integrations (e.g. Beluga RX_WRITTEN)
1150
1184
  scriptSureDraft?: {
1151
1185
  prescriptionRouteId?: string, // Optional reference to PrescriptionRoute used
1152
1186
  drugId?: string, // ScriptSure drug ID
@@ -2603,7 +2637,7 @@ export interface FormResponse extends FormResponse_readonly, FormResponse_requir
2603
2637
  calendarEventId?: string,
2604
2638
  copiedFrom?: string,
2605
2639
  copiedFromEnduserId?: string,
2606
- groupId?: string, // may be an automationStepId when created from Journey in push forms action
2640
+ groupId?: string, // may be an automationStepId when created from Journey in push forms action — intentional, so Canvas sibling lookup (canvas.ts) and the per-push completion detector can find the batch. The API resolves the real formGroupId from the automation step at trigger-detection time for "Form Group Completed" triggers.
2607
2641
  groupInstance?: string,
2608
2642
  groupPosition?: number,
2609
2643
  utm?: LabeledField[],
@@ -3371,8 +3405,9 @@ export type BelugaAutoRxPatientPreferenceItem = {
3371
3405
  medId: string,
3372
3406
  }
3373
3407
  export type BelugaAutoRxAutomationAction = AutomationActionBuilder<'belugaAutoRx', {
3374
- patientPreference: BelugaAutoRxPatientPreferenceItem,
3375
- pharmacyId: string,
3408
+ patientPreference?: BelugaAutoRxPatientPreferenceItem,
3409
+ pharmacyId?: string,
3410
+ useOrganizationMapping?: boolean,
3376
3411
  }>
3377
3412
  export type BelugaUpdateVisitPatientPreferenceItem = {
3378
3413
  name: string,
@@ -3383,9 +3418,15 @@ export type BelugaUpdateVisitPatientPreferenceItem = {
3383
3418
  medId: string,
3384
3419
  }
3385
3420
  export type BelugaUpdateVisitAutomationAction = AutomationActionBuilder<'belugaUpdateVisit', {
3421
+ patientPreferences?: BelugaUpdateVisitPatientPreferenceItem[],
3422
+ pharmacyId?: string,
3423
+ useOrganizationMapping?: boolean,
3424
+ }>
3425
+ export type BelugaAutomationMappingEntry = {
3426
+ enduserCondition: Record<string, any>,
3386
3427
  patientPreferences: BelugaUpdateVisitPatientPreferenceItem[],
3387
3428
  pharmacyId: string,
3388
- }>
3429
+ }
3389
3430
  export type SendChatAutomationAction = AutomationActionBuilder<'sendChat', {
3390
3431
  templateId: string,
3391
3432
  identifier: string,
@@ -3950,6 +3991,9 @@ export interface UserLog extends UserLog_readonly, UserLog_required, UserLog_upd
3950
3991
  info?: Indexable,
3951
3992
  enduserId?: string,
3952
3993
  note?: string,
3994
+ // Set on logs emitted during a switched-in session; reflects the user who initiated the switch.
3995
+ // userId on the same row is the acted-as user (target). See UserSession.actorUserId.
3996
+ actorUserId?: string,
3953
3997
  }
3954
3998
 
3955
3999
  export interface EnduserTask_readonly extends ClientRecord {}
@@ -4735,7 +4779,11 @@ export type AutomationTriggerEvents = {
4735
4779
  cancelReasons?: string[], // filter by specific cancel reasons
4736
4780
  }, {}>,
4737
4781
  'Appointment Rescheduled': AutomationTriggerEventBuilder<"Appointment Rescheduled", { titles?: string[], detectManualReschedules?: boolean }, {}>,
4738
- 'Medication Added': AutomationTriggerEventBuilder<"Medication Added", { titles: string[], protocols: string[] }, {}>,
4782
+ 'Medication Added': AutomationTriggerEventBuilder<"Medication Added", {
4783
+ titles: string[],
4784
+ protocols: string[],
4785
+ titleCondition?: CompoundFilter<'title'>,
4786
+ }, {}>,
4739
4787
  'No Recent Appointment': AutomationTriggerEventBuilder<"No Recent Appointment", {
4740
4788
  intervalInMS: number,
4741
4789
  templateIds?: string[],
@@ -4776,6 +4824,7 @@ export type AutomationTriggerEvents = {
4776
4824
  'Problem Created': AutomationTriggerEventBuilder<"Problem Created", { titles?: string[] }, {}>,
4777
4825
  'Message Delivery Failure': AutomationTriggerEventBuilder<"Message Delivery Failure", { }, {}>,
4778
4826
  'Incoming Message': AutomationTriggerEventBuilder<"Incoming Message", { noCareTeam?: boolean, destinations?: string[], channels?: string[], keywords?: string[] }, {}>,
4827
+ 'Outbound Chat Sent': AutomationTriggerEventBuilder<"Outbound Chat Sent", { }, {}>,
4779
4828
  'Pregnancy Ended': AutomationTriggerEventBuilder<"Pregnancy Ended", { reason?: string }, {}>,
4780
4829
  'Form Group Completed': AutomationTriggerEventBuilder<"Form Group Completed", { groupId: string }, {}>,
4781
4830
  'Form Group Incomplete': AutomationTriggerEventBuilder<"Form Group Incomplete", { groupId: string, intervalInMS: number }, {}>,
@@ -4801,6 +4850,9 @@ export type AutomationTriggerEvents = {
4801
4850
  'Incoming Fax': AutomationTriggerEventBuilder<"Incoming Fax", {
4802
4851
  senderFaxNumbers?: string[],
4803
4852
  }, {}>,
4853
+ 'Beluga Visit Sync Failed': AutomationTriggerEventBuilder<"Beluga Visit Sync Failed", {
4854
+ formIds?: string[],
4855
+ }, {}>,
4804
4856
  }
4805
4857
  export type AutomationTriggerEventType = keyof AutomationTriggerEvents
4806
4858
  export type AutomationTriggerEvent = AutomationTriggerEvents[AutomationTriggerEventType]