@tellescope/types-models 1.255.18 → 1.256.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/lib/cjs/index.d.ts +40 -3
- package/lib/cjs/index.d.ts.map +1 -1
- package/lib/cjs/index.js +16 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/index.d.ts +40 -3
- package/lib/esm/index.d.ts.map +1 -1
- package/lib/esm/index.js +15 -0
- package/lib/esm/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
- package/src/index.ts +60 -5
package/src/index.ts
CHANGED
|
@@ -593,6 +593,9 @@ export interface Organization extends Organization_readonly, Organization_requir
|
|
|
593
593
|
customerIOFields?: string[],
|
|
594
594
|
customerIOIdField?: string,
|
|
595
595
|
createEnduserForms?: string[],
|
|
596
|
+
// Journey containing a "Generate Patient Summary" action; enables the Regenerate button on the
|
|
597
|
+
// AI Summary panel of the patient profile. Unset automatically if the journey is deleted.
|
|
598
|
+
defaultSummaryJourneyId?: string,
|
|
596
599
|
creditCount?: number,
|
|
597
600
|
creditTrialStartedAt?: Date,
|
|
598
601
|
hasIntegrations?: string[],
|
|
@@ -642,16 +645,24 @@ export interface RecordInfo {
|
|
|
642
645
|
|
|
643
646
|
export interface ClientRecord extends RecordInfo { id: string }
|
|
644
647
|
|
|
645
|
-
|
|
646
|
-
|
|
648
|
+
// Ids a session scope pins itself to, substituted into the scope's route shapes server-side.
|
|
649
|
+
export interface SessionScopeContext {
|
|
650
|
+
calendarEventId?: string,
|
|
647
651
|
}
|
|
648
|
-
|
|
649
|
-
export interface
|
|
652
|
+
|
|
653
|
+
export interface WithSessionConfinement {
|
|
654
|
+
sessionScopes?: SessionScope[], // named scopes, resolved to routes server-side
|
|
655
|
+
scopeContext?: SessionScopeContext,
|
|
656
|
+
allowedPaths?: string[], // LEGACY — superseded by sessionScopes, honored until old tokens expire
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
export interface WithAllowedPaths extends WithSessionConfinement {}
|
|
660
|
+
|
|
661
|
+
export interface Session extends WithSessionConfinement {
|
|
650
662
|
type: "user" | "enduser",
|
|
651
663
|
businessId: string,
|
|
652
664
|
iat: number,
|
|
653
665
|
exp: number,
|
|
654
|
-
allowedPaths?: string[],
|
|
655
666
|
requiresMFA?: boolean,
|
|
656
667
|
}
|
|
657
668
|
|
|
@@ -1249,6 +1260,23 @@ export const FORM_INGESTION_API_KEY_SCOPE = 'form-ingestion' as const
|
|
|
1249
1260
|
export const API_KEY_SCOPES = [FORM_INGESTION_API_KEY_SCOPE] as const
|
|
1250
1261
|
export type APIKeyScope = typeof API_KEY_SCOPES[number]
|
|
1251
1262
|
|
|
1263
|
+
/**
|
|
1264
|
+
* Confinement scopes for limited-purpose SESSIONS (video links, public forms, booking pages, ics
|
|
1265
|
+
* links). Each name resolves server-side to a fixed set of method+path grants.
|
|
1266
|
+
*
|
|
1267
|
+
* Distinct from APIKeyScope above, and NOT interchangeable — note the inverted empty-array
|
|
1268
|
+
* semantics: `scopes: []` on an API key means unrestricted, whereas a session confined to no scopes
|
|
1269
|
+
* reaches nothing. The route table is intentionally backend-only; only the names are public.
|
|
1270
|
+
*/
|
|
1271
|
+
export const SESSION_SCOPES = [
|
|
1272
|
+
'video-join-link',
|
|
1273
|
+
'video-start-link',
|
|
1274
|
+
'public-form',
|
|
1275
|
+
'appointment-booking',
|
|
1276
|
+
'ics-download',
|
|
1277
|
+
] as const
|
|
1278
|
+
export type SessionScope = typeof SESSION_SCOPES[number]
|
|
1279
|
+
|
|
1252
1280
|
export interface APIKey_readonly extends ClientRecord {
|
|
1253
1281
|
hashedKey: string, // stored as hash
|
|
1254
1282
|
key?: string, // deprecated
|
|
@@ -1527,6 +1555,8 @@ export interface SMSMessage extends SMSMessage_readonly, SMSMessage_required, SM
|
|
|
1527
1555
|
replyToTemplateId?: string,
|
|
1528
1556
|
assignedTo?: string[],
|
|
1529
1557
|
templatedMessage?: string,
|
|
1558
|
+
// AI translations of the message body, keyed by language code (inbound messages, Timeline)
|
|
1559
|
+
translations?: Translations<'message'>,
|
|
1530
1560
|
canvasId?: string,
|
|
1531
1561
|
discussionRoomId?: string,
|
|
1532
1562
|
mediaURLs?: string[],
|
|
@@ -2660,6 +2690,12 @@ export interface FormResponse_required {
|
|
|
2660
2690
|
formTitle: string,
|
|
2661
2691
|
responses?: FormResponseValue[], // some cases where undefined (not intended but now need to handle)
|
|
2662
2692
|
publicSubmit?: boolean,
|
|
2693
|
+
// Backend-managed. When set, `email` and `phone` are not written from this response's intake
|
|
2694
|
+
// answers; all other intake fields are unaffected. Set when the response is attached to a contact
|
|
2695
|
+
// that already existed, and left unset when the response created the contact. Once set it stays
|
|
2696
|
+
// set for the life of the response. Intentionally absent from schema.ts, so it cannot be set or
|
|
2697
|
+
// cleared through the API.
|
|
2698
|
+
authFieldIntakeDisabled?: boolean,
|
|
2663
2699
|
submittedBy?: string,
|
|
2664
2700
|
submittedByIsPlaceholder?: boolean,
|
|
2665
2701
|
markedAsSubmitted?: boolean,
|
|
@@ -5101,6 +5137,23 @@ export type PhonePlaybackInfo = {
|
|
|
5101
5137
|
export type PhonePlaybackType = keyof PhonePlaybackInfo
|
|
5102
5138
|
export type PhonePlayback = PhonePlaybackInfo[PhonePlaybackType]
|
|
5103
5139
|
|
|
5140
|
+
// Capabilities granted to an 'AI Agent' node — each entry enables tool(s) the agent may use
|
|
5141
|
+
// mid-call (e.g. collecting and submitting a form). Extensible the same way PhoneTreeActions is:
|
|
5142
|
+
// future capabilities (e.g. appointment booking) are new entries in PhoneTreeAgentTools.
|
|
5143
|
+
export type PhoneTreeAgentToolBuilder <T extends string, V> = { type: T, info: V }
|
|
5144
|
+
export type PhoneTreeAgentTools = {
|
|
5145
|
+
'Submit Form': PhoneTreeAgentToolBuilder<'Submit Form', {
|
|
5146
|
+
formId: string,
|
|
5147
|
+
useWhen?: string, // guidance for when the agent should collect this form (disambiguates when several forms are configured)
|
|
5148
|
+
}>,
|
|
5149
|
+
'Book Appointment': PhoneTreeAgentToolBuilder<'Book Appointment', {
|
|
5150
|
+
appointmentBookingPageId: string,
|
|
5151
|
+
useWhen?: string, // guidance for when the agent should offer booking
|
|
5152
|
+
}>,
|
|
5153
|
+
}
|
|
5154
|
+
export type PhoneTreeAgentToolType = keyof PhoneTreeAgentTools
|
|
5155
|
+
export type PhoneTreeAgentTool = PhoneTreeAgentTools[PhoneTreeAgentToolType]
|
|
5156
|
+
|
|
5104
5157
|
export type PhoneTreeActionBuilder <T, V> = { type: T, info: V }
|
|
5105
5158
|
export type PhoneTreeActions = {
|
|
5106
5159
|
// 'Play': PhoneTreeActionBuilder<"Play", { playback: PhonePlayback }>
|
|
@@ -5168,6 +5221,7 @@ export type PhoneTreeActions = {
|
|
|
5168
5221
|
maxCreditsPerCall?: number, // per-call spend circuit breaker, default from constants
|
|
5169
5222
|
model?: string, // friendly AI model name, see SELECTABLE_AI_MODELS (constants); defaults to Claude Sonnet 5
|
|
5170
5223
|
outcomes: { value: string, description: string }[], // the agent must end with one of these
|
|
5224
|
+
tools?: PhoneTreeAgentTool[], // capabilities the agent may use mid-call (e.g. 'Submit Form')
|
|
5171
5225
|
}>
|
|
5172
5226
|
}
|
|
5173
5227
|
export type PhoneTreeActionType = keyof PhoneTreeActions
|
|
@@ -7071,6 +7125,7 @@ export type DataSyncRecord = {
|
|
|
7071
7125
|
data: 'deleted' | string, // when not deleted, stringified JSON
|
|
7072
7126
|
userIds: string[], // Default access
|
|
7073
7127
|
enduserIds: string[], // Assigned access
|
|
7128
|
+
visibleToAllUsers?: boolean, // 'visibleToAllUsers' schema access constraint (staff users only)
|
|
7074
7129
|
}
|
|
7075
7130
|
|
|
7076
7131
|
export type InsuranceType = "Primary" | "Secondary"
|