retell-sdk 2.2.3 → 2.2.6
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/example.js +48 -5
- package/example.js.map +1 -1
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js.map +1 -1
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +5 -1
- package/lib/security.js.map +1 -1
- package/models/components/agent.d.ts +3 -205
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +5 -187
- package/models/components/agent.js.map +1 -1
- package/models/components/agentpromptparams.d.ts.map +1 -1
- package/models/components/agentpromptparams.js.map +1 -1
- package/models/components/calldetail.d.ts +33 -22
- package/models/components/calldetail.d.ts.map +1 -1
- package/models/components/calldetail.js +44 -31
- package/models/components/calldetail.js.map +1 -1
- package/models/components/callphonenumber.d.ts.map +1 -1
- package/models/components/callphonenumber.js.map +1 -1
- package/models/components/index.d.ts +0 -3
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -3
- package/models/components/index.js.map +1 -1
- package/models/components/phonenumber.d.ts.map +1 -1
- package/models/components/phonenumber.js.map +1 -1
- package/models/components/security.d.ts.map +1 -1
- package/models/errors/createagent.d.ts.map +1 -1
- package/models/errors/createagent.js +36 -12
- package/models/errors/createagent.js.map +1 -1
- package/models/errors/createphonecall.d.ts.map +1 -1
- package/models/errors/createphonecall.js +54 -18
- package/models/errors/createphonecall.js.map +1 -1
- package/models/errors/createphonenumber.d.ts.map +1 -1
- package/models/errors/createphonenumber.js +42 -14
- package/models/errors/createphonenumber.js.map +1 -1
- package/models/errors/deleteagent.d.ts.map +1 -1
- package/models/errors/deleteagent.js +36 -12
- package/models/errors/deleteagent.js.map +1 -1
- package/models/errors/deletephonenumber.d.ts.map +1 -1
- package/models/errors/deletephonenumber.js +33 -11
- package/models/errors/deletephonenumber.js.map +1 -1
- package/models/errors/getagent.d.ts.map +1 -1
- package/models/errors/getagent.js +36 -12
- package/models/errors/getagent.js.map +1 -1
- package/models/errors/getcall.d.ts.map +1 -1
- package/models/errors/getcall.js +30 -10
- package/models/errors/getcall.js.map +1 -1
- package/models/errors/getphonenumber.d.ts.map +1 -1
- package/models/errors/getphonenumber.js +36 -12
- package/models/errors/getphonenumber.js.map +1 -1
- package/models/errors/index.d.ts +1 -6
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -6
- package/models/errors/index.js.map +1 -1
- package/models/errors/listagents.d.ts.map +1 -1
- package/models/errors/listagents.js +15 -5
- package/models/errors/listagents.js.map +1 -1
- package/models/errors/listcalls.d.ts.map +1 -1
- package/models/errors/listcalls.js +24 -8
- package/models/errors/listcalls.js.map +1 -1
- package/models/errors/listphonenumbers.d.ts.map +1 -1
- package/models/errors/listphonenumbers.js +27 -9
- package/models/errors/listphonenumbers.js.map +1 -1
- package/models/errors/registercall.d.ts +218 -0
- package/models/errors/registercall.d.ts.map +1 -0
- package/models/errors/registercall.js +386 -0
- package/models/errors/registercall.js.map +1 -0
- package/models/errors/updateagent.d.ts.map +1 -1
- package/models/errors/updateagent.js +36 -12
- package/models/errors/updateagent.js.map +1 -1
- package/models/errors/updatephoneagent.d.ts.map +1 -1
- package/models/errors/updatephoneagent.js +36 -12
- package/models/errors/updatephoneagent.js.map +1 -1
- package/models/operations/createagent.d.ts +3 -16
- package/models/operations/createagent.d.ts.map +1 -1
- package/models/operations/createagent.js +4 -12
- package/models/operations/createagent.js.map +1 -1
- package/models/operations/createphonecall.d.ts.map +1 -1
- package/models/operations/createphonecall.js +18 -6
- package/models/operations/createphonecall.js.map +1 -1
- package/models/operations/createphonenumber.d.ts.map +1 -1
- package/models/operations/createphonenumber.js +6 -2
- package/models/operations/createphonenumber.js.map +1 -1
- package/models/operations/createwebcall.d.ts.map +1 -1
- package/models/operations/deleteagent.d.ts.map +1 -1
- package/models/operations/deleteagent.js.map +1 -1
- package/models/operations/deletephonenumber.d.ts.map +1 -1
- package/models/operations/deletephonenumber.js.map +1 -1
- package/models/operations/getagent.d.ts.map +1 -1
- package/models/operations/getagent.js.map +1 -1
- package/models/operations/getcall.d.ts +1 -1
- package/models/operations/getcall.d.ts.map +1 -1
- package/models/operations/getcall.js.map +1 -1
- package/models/operations/getphonenumber.d.ts.map +1 -1
- package/models/operations/getphonenumber.js +6 -2
- package/models/operations/getphonenumber.js.map +1 -1
- package/models/operations/index.d.ts +1 -7
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -7
- package/models/operations/index.js.map +1 -1
- package/models/operations/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listcalls.d.ts +1 -7
- package/models/operations/listcalls.d.ts.map +1 -1
- package/models/operations/listcalls.js +6 -6
- package/models/operations/listcalls.js.map +1 -1
- package/models/operations/listphonenumbers.d.ts.map +1 -1
- package/models/operations/listphonenumbers.js +6 -2
- package/models/operations/listphonenumbers.js.map +1 -1
- package/models/operations/registercall.d.ts +74 -0
- package/models/operations/registercall.d.ts.map +1 -0
- package/models/operations/registercall.js +104 -0
- package/models/operations/registercall.js.map +1 -0
- package/models/operations/updateagent.d.ts +3 -16
- package/models/operations/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +9 -13
- package/models/operations/updateagent.js.map +1 -1
- package/models/operations/updatephoneagent.d.ts.map +1 -1
- package/models/operations/updatephoneagent.js +6 -2
- package/models/operations/updatephoneagent.js.map +1 -1
- package/package.json +1 -1
- package/sdk/audioWsClient.d.ts +10 -0
- package/sdk/audioWsClient.d.ts.map +1 -0
- package/sdk/audioWsClient.js +60 -0
- package/sdk/audioWsClient.js.map +1 -0
- package/sdk/index.d.ts +1 -1
- package/sdk/index.d.ts.map +1 -1
- package/sdk/index.js +1 -1
- package/sdk/index.js.map +1 -1
- package/sdk/liveClient.d.ts.map +1 -1
- package/sdk/liveClient.js +7 -2
- package/sdk/liveClient.js.map +1 -1
- package/sdk/sdk.d.ts +1 -23
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +21 -430
- package/sdk/sdk.js.map +1 -1
- package/src/example.ts +136 -88
- package/src/lib/config.ts +32 -32
- package/src/lib/sdks.ts +91 -82
- package/src/lib/security.ts +133 -118
- package/src/models/components/agent.ts +71 -451
- package/src/models/components/calldetail.ts +147 -130
- package/src/models/components/index.ts +0 -3
- package/src/models/components/security.ts +1 -1
- package/src/models/errors/createagent.ts +359 -311
- package/src/models/errors/deleteagent.ts +359 -311
- package/src/models/errors/getagent.ts +358 -302
- package/src/models/errors/getcall.ts +348 -294
- package/src/models/errors/index.ts +1 -6
- package/src/models/errors/listagents.ts +174 -147
- package/src/models/errors/listcalls.ts +251 -211
- package/src/models/errors/registercall.ts +662 -0
- package/src/models/errors/updateagent.ts +359 -311
- package/src/models/operations/createagent.ts +124 -130
- package/src/models/operations/deleteagent.ts +94 -78
- package/src/models/operations/getagent.ts +104 -88
- package/src/models/operations/getcall.ts +101 -88
- package/src/models/operations/index.ts +1 -7
- package/src/models/operations/listagents.ts +68 -60
- package/src/models/operations/listcalls.ts +228 -213
- package/src/models/operations/registercall.ts +167 -0
- package/src/models/operations/updateagent.ts +180 -174
- package/src/sdk/audioWsClient.ts +63 -0
- package/src/sdk/index.ts +1 -1
- package/src/sdk/sdk.ts +802 -1162
- package/src/models/components/agentpromptparams.ts +0 -53
- package/src/models/components/callphonenumber.ts +0 -56
- package/src/models/components/phonenumber.ts +0 -83
- package/src/models/errors/createphonecall.ts +0 -597
- package/src/models/errors/createphonenumber.ts +0 -500
- package/src/models/errors/deletephonenumber.ts +0 -400
- package/src/models/errors/getphonenumber.ts +0 -397
- package/src/models/errors/listphonenumbers.ts +0 -297
- package/src/models/errors/updatephoneagent.ts +0 -397
- package/src/models/operations/createphonecall.ts +0 -308
- package/src/models/operations/createphonenumber.ts +0 -124
- package/src/models/operations/createwebcall.ts +0 -16
- package/src/models/operations/deletephonenumber.ts +0 -103
- package/src/models/operations/getphonenumber.ts +0 -114
- package/src/models/operations/listphonenumbers.ts +0 -76
- package/src/models/operations/updatephoneagent.ts +0 -159
- package/src/sdk/liveClient.ts +0 -109
|
@@ -2,159 +2,176 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { AgentPromptParams, AgentPromptParams$ } from "./agentpromptparams";
|
|
6
|
-
import { CallPhoneNumber, CallPhoneNumber$ } from "./callphonenumber";
|
|
7
5
|
import { z } from "zod";
|
|
8
6
|
|
|
9
7
|
/**
|
|
10
8
|
* Status of call.
|
|
11
9
|
*/
|
|
12
10
|
export enum CallStatus {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
Registered = "registered",
|
|
12
|
+
Ongoing = "ongoing",
|
|
13
|
+
Ended = "ended",
|
|
14
|
+
Error = "error",
|
|
16
15
|
}
|
|
17
16
|
|
|
18
17
|
/**
|
|
19
|
-
*
|
|
18
|
+
* The audio encoding of the call.
|
|
20
19
|
*/
|
|
21
|
-
export enum
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
20
|
+
export enum AudioEncoding {
|
|
21
|
+
S16le = "s16le",
|
|
22
|
+
Mulaw = "mulaw",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The protocol how audio websocket read and send audio bytes.
|
|
27
|
+
*/
|
|
28
|
+
export enum AudioWebsocketProtocol {
|
|
29
|
+
Web = "web",
|
|
30
|
+
Twilio = "twilio",
|
|
31
|
+
Vonage = "vonage",
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
export type CallDetail = {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Corresponding agent id of this call.
|
|
37
|
+
*/
|
|
38
|
+
agentId: string;
|
|
39
|
+
/**
|
|
40
|
+
* Unique id of the call. Used to identify in LLM websocket and used to authenticate in audio websocket.
|
|
41
|
+
*/
|
|
42
|
+
callId: string;
|
|
43
|
+
/**
|
|
44
|
+
* Status of call.
|
|
45
|
+
*/
|
|
46
|
+
callStatus: CallStatus;
|
|
47
|
+
/**
|
|
48
|
+
* The audio encoding of the call.
|
|
49
|
+
*/
|
|
50
|
+
audioEncoding: AudioEncoding;
|
|
51
|
+
/**
|
|
52
|
+
* Sample rate of the conversation, the input and output audio bytes will all conform to this rate. Check the audio source, audio format, and voice used for the agent to select one that works.
|
|
53
|
+
*/
|
|
54
|
+
sampleRate: number;
|
|
55
|
+
/**
|
|
56
|
+
* The protocol how audio websocket read and send audio bytes.
|
|
57
|
+
*/
|
|
58
|
+
audioWebsocketProtocol: AudioWebsocketProtocol;
|
|
59
|
+
/**
|
|
60
|
+
* End timestamp (milliseconds since epoch) of the call. Available after call ends.
|
|
61
|
+
*/
|
|
62
|
+
endTimestamp?: number | undefined;
|
|
63
|
+
/**
|
|
64
|
+
* Recording of the call. Available after call ends.
|
|
65
|
+
*/
|
|
66
|
+
recordingUrl?: string | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Begin timestamp (milliseconds since epoch) of the call.
|
|
69
|
+
*/
|
|
70
|
+
startTimestamp: number;
|
|
71
|
+
/**
|
|
72
|
+
* Transcription of the call. Available after call ends.
|
|
73
|
+
*/
|
|
74
|
+
transcript?: string | undefined;
|
|
65
75
|
};
|
|
66
76
|
|
|
67
77
|
/** @internal */
|
|
68
78
|
export const CallStatus$ = z.nativeEnum(CallStatus);
|
|
69
79
|
|
|
70
80
|
/** @internal */
|
|
71
|
-
export const
|
|
81
|
+
export const AudioWebsocketProtocol$ = z.nativeEnum(AudioWebsocketProtocol);
|
|
82
|
+
|
|
83
|
+
/** @internal */
|
|
84
|
+
export const AudioEncoding$ = z.nativeEnum(AudioEncoding);
|
|
72
85
|
|
|
73
86
|
/** @internal */
|
|
74
87
|
export namespace CallDetail$ {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
88
|
+
export type Inbound = {
|
|
89
|
+
agent_id: string;
|
|
90
|
+
call_id: string;
|
|
91
|
+
call_status: CallStatus;
|
|
92
|
+
audio_encoding: AudioEncoding;
|
|
93
|
+
sample_rate: number;
|
|
94
|
+
audio_websocket_protocol: AudioWebsocketProtocol;
|
|
95
|
+
end_timestamp?: number | undefined;
|
|
96
|
+
recording_url?: string | undefined;
|
|
97
|
+
start_timestamp: number;
|
|
98
|
+
transcript?: string | undefined;
|
|
99
|
+
};
|
|
87
100
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
})
|
|
101
|
+
export const inboundSchema: z.ZodType<CallDetail, z.ZodTypeDef, Inbound> = z
|
|
102
|
+
.object({
|
|
103
|
+
agent_id: z.string(),
|
|
104
|
+
call_id: z.string(),
|
|
105
|
+
call_status: CallStatus$,
|
|
106
|
+
audio_encoding: AudioEncoding$,
|
|
107
|
+
sample_rate: z.number().int(),
|
|
108
|
+
audio_websocket_protocol: AudioWebsocketProtocol$,
|
|
109
|
+
end_timestamp: z.number().int().optional(),
|
|
110
|
+
recording_url: z.string().optional(),
|
|
111
|
+
start_timestamp: z.number().int(),
|
|
112
|
+
transcript: z.string().optional(),
|
|
113
|
+
})
|
|
114
|
+
.transform((v) => {
|
|
115
|
+
return {
|
|
116
|
+
agentId: v.agent_id,
|
|
117
|
+
callId: v.call_id,
|
|
118
|
+
callStatus: v.call_status,
|
|
119
|
+
audioEncoding: v.audio_encoding,
|
|
120
|
+
sampleRate: v.sample_rate,
|
|
121
|
+
audioWebsocketProtocol: v.audio_websocket_protocol,
|
|
122
|
+
...(v.end_timestamp === undefined
|
|
123
|
+
? null
|
|
124
|
+
: { endTimestamp: v.end_timestamp }),
|
|
125
|
+
...(v.recording_url === undefined
|
|
126
|
+
? null
|
|
127
|
+
: { recordingUrl: v.recording_url }),
|
|
128
|
+
startTimestamp: v.start_timestamp,
|
|
129
|
+
...(v.transcript === undefined ? null : { transcript: v.transcript }),
|
|
130
|
+
};
|
|
131
|
+
});
|
|
117
132
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
export type Outbound = {
|
|
134
|
+
agent_id: string;
|
|
135
|
+
call_id: string;
|
|
136
|
+
call_status: CallStatus;
|
|
137
|
+
audio_encoding: AudioEncoding;
|
|
138
|
+
sample_rate: number;
|
|
139
|
+
audio_websocket_protocol: AudioWebsocketProtocol;
|
|
140
|
+
end_timestamp?: number | undefined;
|
|
141
|
+
recording_url?: string | undefined;
|
|
142
|
+
start_timestamp: number;
|
|
143
|
+
transcript?: string | undefined;
|
|
144
|
+
};
|
|
130
145
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
})
|
|
146
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CallDetail> = z
|
|
147
|
+
.object({
|
|
148
|
+
agentId: z.string(),
|
|
149
|
+
callId: z.string(),
|
|
150
|
+
callStatus: CallStatus$,
|
|
151
|
+
audioEncoding: AudioEncoding$,
|
|
152
|
+
sampleRate: z.number().int(),
|
|
153
|
+
audioWebsocketProtocol: AudioWebsocketProtocol$,
|
|
154
|
+
endTimestamp: z.number().int().optional(),
|
|
155
|
+
recordingUrl: z.string().optional(),
|
|
156
|
+
startTimestamp: z.number().int(),
|
|
157
|
+
transcript: z.string().optional(),
|
|
158
|
+
})
|
|
159
|
+
.transform((v) => {
|
|
160
|
+
return {
|
|
161
|
+
agent_id: v.agentId,
|
|
162
|
+
call_id: v.callId,
|
|
163
|
+
call_status: v.callStatus,
|
|
164
|
+
audio_encoding: v.audioEncoding,
|
|
165
|
+
sample_rate: v.sampleRate,
|
|
166
|
+
audio_websocket_protocol: v.audioWebsocketProtocol,
|
|
167
|
+
...(v.endTimestamp === undefined
|
|
168
|
+
? null
|
|
169
|
+
: { end_timestamp: v.endTimestamp }),
|
|
170
|
+
...(v.recordingUrl === undefined
|
|
171
|
+
? null
|
|
172
|
+
: { recording_url: v.recordingUrl }),
|
|
173
|
+
start_timestamp: v.startTimestamp,
|
|
174
|
+
...(v.transcript === undefined ? null : { transcript: v.transcript }),
|
|
175
|
+
};
|
|
176
|
+
});
|
|
160
177
|
}
|