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
|
@@ -1,397 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internal Server Error
|
|
9
|
-
*/
|
|
10
|
-
export type UpdatePhoneAgentResponse500ResponseBodyData = {
|
|
11
|
-
/**
|
|
12
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
13
|
-
*/
|
|
14
|
-
rawResponse?: Response | undefined;
|
|
15
|
-
errorMessage?: string | undefined;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Internal Server Error
|
|
20
|
-
*/
|
|
21
|
-
export class UpdatePhoneAgentResponse500ResponseBody extends Error {
|
|
22
|
-
/**
|
|
23
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
24
|
-
*/
|
|
25
|
-
rawResponse?: Response | undefined;
|
|
26
|
-
errorMessage?: string | undefined;
|
|
27
|
-
|
|
28
|
-
/** The original data that was passed to this error instance. */
|
|
29
|
-
data$: UpdatePhoneAgentResponse500ResponseBodyData;
|
|
30
|
-
|
|
31
|
-
constructor(err: UpdatePhoneAgentResponse500ResponseBodyData, options?: ErrorOptions) {
|
|
32
|
-
super("", options);
|
|
33
|
-
this.data$ = err;
|
|
34
|
-
|
|
35
|
-
if (err.rawResponse != null) {
|
|
36
|
-
this.rawResponse = err.rawResponse;
|
|
37
|
-
}
|
|
38
|
-
if (err.errorMessage != null) {
|
|
39
|
-
this.errorMessage = err.errorMessage;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
|
43
|
-
const { rawResponse, ...data } = err;
|
|
44
|
-
const content = JSON.stringify(data);
|
|
45
|
-
this.message = [msg, content].filter(Boolean).join("\n");
|
|
46
|
-
|
|
47
|
-
this.name = "UpdatePhoneAgentResponse500ResponseBody";
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Unprocessable Content
|
|
53
|
-
*/
|
|
54
|
-
export type UpdatePhoneAgentResponse422ResponseBodyData = {
|
|
55
|
-
/**
|
|
56
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
57
|
-
*/
|
|
58
|
-
rawResponse?: Response | undefined;
|
|
59
|
-
errorMessage?: string | undefined;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* Unprocessable Content
|
|
64
|
-
*/
|
|
65
|
-
export class UpdatePhoneAgentResponse422ResponseBody extends Error {
|
|
66
|
-
/**
|
|
67
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
68
|
-
*/
|
|
69
|
-
rawResponse?: Response | undefined;
|
|
70
|
-
errorMessage?: string | undefined;
|
|
71
|
-
|
|
72
|
-
/** The original data that was passed to this error instance. */
|
|
73
|
-
data$: UpdatePhoneAgentResponse422ResponseBodyData;
|
|
74
|
-
|
|
75
|
-
constructor(err: UpdatePhoneAgentResponse422ResponseBodyData, options?: ErrorOptions) {
|
|
76
|
-
super("", options);
|
|
77
|
-
this.data$ = err;
|
|
78
|
-
|
|
79
|
-
if (err.rawResponse != null) {
|
|
80
|
-
this.rawResponse = err.rawResponse;
|
|
81
|
-
}
|
|
82
|
-
if (err.errorMessage != null) {
|
|
83
|
-
this.errorMessage = err.errorMessage;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
|
87
|
-
const { rawResponse, ...data } = err;
|
|
88
|
-
const content = JSON.stringify(data);
|
|
89
|
-
this.message = [msg, content].filter(Boolean).join("\n");
|
|
90
|
-
|
|
91
|
-
this.name = "UpdatePhoneAgentResponse422ResponseBody";
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Unauthorized
|
|
97
|
-
*/
|
|
98
|
-
export type UpdatePhoneAgentResponseResponseBodyData = {
|
|
99
|
-
/**
|
|
100
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
101
|
-
*/
|
|
102
|
-
rawResponse?: Response | undefined;
|
|
103
|
-
errorMessage?: string | undefined;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Unauthorized
|
|
108
|
-
*/
|
|
109
|
-
export class UpdatePhoneAgentResponseResponseBody extends Error {
|
|
110
|
-
/**
|
|
111
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
112
|
-
*/
|
|
113
|
-
rawResponse?: Response | undefined;
|
|
114
|
-
errorMessage?: string | undefined;
|
|
115
|
-
|
|
116
|
-
/** The original data that was passed to this error instance. */
|
|
117
|
-
data$: UpdatePhoneAgentResponseResponseBodyData;
|
|
118
|
-
|
|
119
|
-
constructor(err: UpdatePhoneAgentResponseResponseBodyData, options?: ErrorOptions) {
|
|
120
|
-
super("", options);
|
|
121
|
-
this.data$ = err;
|
|
122
|
-
|
|
123
|
-
if (err.rawResponse != null) {
|
|
124
|
-
this.rawResponse = err.rawResponse;
|
|
125
|
-
}
|
|
126
|
-
if (err.errorMessage != null) {
|
|
127
|
-
this.errorMessage = err.errorMessage;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
|
131
|
-
const { rawResponse, ...data } = err;
|
|
132
|
-
const content = JSON.stringify(data);
|
|
133
|
-
this.message = [msg, content].filter(Boolean).join("\n");
|
|
134
|
-
|
|
135
|
-
this.name = "UpdatePhoneAgentResponseResponseBody";
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Bad Request
|
|
141
|
-
*/
|
|
142
|
-
export type UpdatePhoneAgentResponseBodyData = {
|
|
143
|
-
/**
|
|
144
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
145
|
-
*/
|
|
146
|
-
rawResponse?: Response | undefined;
|
|
147
|
-
errorMessage?: string | undefined;
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Bad Request
|
|
152
|
-
*/
|
|
153
|
-
export class UpdatePhoneAgentResponseBody extends Error {
|
|
154
|
-
/**
|
|
155
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
156
|
-
*/
|
|
157
|
-
rawResponse?: Response | undefined;
|
|
158
|
-
errorMessage?: string | undefined;
|
|
159
|
-
|
|
160
|
-
/** The original data that was passed to this error instance. */
|
|
161
|
-
data$: UpdatePhoneAgentResponseBodyData;
|
|
162
|
-
|
|
163
|
-
constructor(err: UpdatePhoneAgentResponseBodyData, options?: ErrorOptions) {
|
|
164
|
-
super("", options);
|
|
165
|
-
this.data$ = err;
|
|
166
|
-
|
|
167
|
-
if (err.rawResponse != null) {
|
|
168
|
-
this.rawResponse = err.rawResponse;
|
|
169
|
-
}
|
|
170
|
-
if (err.errorMessage != null) {
|
|
171
|
-
this.errorMessage = err.errorMessage;
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
const msg = "message" in err && typeof err.message === "string" ? err.message : "";
|
|
175
|
-
const { rawResponse, ...data } = err;
|
|
176
|
-
const content = JSON.stringify(data);
|
|
177
|
-
this.message = [msg, content].filter(Boolean).join("\n");
|
|
178
|
-
|
|
179
|
-
this.name = "UpdatePhoneAgentResponseBody";
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
/** @internal */
|
|
184
|
-
export namespace UpdatePhoneAgentResponse500ResponseBody$ {
|
|
185
|
-
export type Inbound = {
|
|
186
|
-
RawResponse?: Response | undefined;
|
|
187
|
-
error_message?: string | undefined;
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
export const inboundSchema: z.ZodType<
|
|
191
|
-
UpdatePhoneAgentResponse500ResponseBody,
|
|
192
|
-
z.ZodTypeDef,
|
|
193
|
-
Inbound
|
|
194
|
-
> = z
|
|
195
|
-
.object({
|
|
196
|
-
RawResponse: z.instanceof(Response).optional(),
|
|
197
|
-
error_message: z.string().optional(),
|
|
198
|
-
})
|
|
199
|
-
.transform((v) => {
|
|
200
|
-
return new UpdatePhoneAgentResponse500ResponseBody({
|
|
201
|
-
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
|
202
|
-
...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
|
|
203
|
-
});
|
|
204
|
-
});
|
|
205
|
-
export type Outbound = {
|
|
206
|
-
RawResponse?: never | undefined;
|
|
207
|
-
error_message?: string | undefined;
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
export const outboundSchema: z.ZodType<
|
|
211
|
-
Outbound,
|
|
212
|
-
z.ZodTypeDef,
|
|
213
|
-
UpdatePhoneAgentResponse500ResponseBody
|
|
214
|
-
> = z
|
|
215
|
-
.instanceof(UpdatePhoneAgentResponse500ResponseBody)
|
|
216
|
-
.transform((v) => v.data$)
|
|
217
|
-
.pipe(
|
|
218
|
-
z
|
|
219
|
-
.object({
|
|
220
|
-
rawResponse: z
|
|
221
|
-
.instanceof(Response)
|
|
222
|
-
.transform(() => {
|
|
223
|
-
throw new Error("Response cannot be serialized");
|
|
224
|
-
})
|
|
225
|
-
.optional(),
|
|
226
|
-
errorMessage: z.string().optional(),
|
|
227
|
-
})
|
|
228
|
-
.transform((v) => {
|
|
229
|
-
return {
|
|
230
|
-
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
|
231
|
-
...(v.errorMessage === undefined
|
|
232
|
-
? null
|
|
233
|
-
: { error_message: v.errorMessage }),
|
|
234
|
-
};
|
|
235
|
-
})
|
|
236
|
-
);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/** @internal */
|
|
240
|
-
export namespace UpdatePhoneAgentResponse422ResponseBody$ {
|
|
241
|
-
export type Inbound = {
|
|
242
|
-
RawResponse?: Response | undefined;
|
|
243
|
-
error_message?: string | undefined;
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
export const inboundSchema: z.ZodType<
|
|
247
|
-
UpdatePhoneAgentResponse422ResponseBody,
|
|
248
|
-
z.ZodTypeDef,
|
|
249
|
-
Inbound
|
|
250
|
-
> = z
|
|
251
|
-
.object({
|
|
252
|
-
RawResponse: z.instanceof(Response).optional(),
|
|
253
|
-
error_message: z.string().optional(),
|
|
254
|
-
})
|
|
255
|
-
.transform((v) => {
|
|
256
|
-
return new UpdatePhoneAgentResponse422ResponseBody({
|
|
257
|
-
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
|
258
|
-
...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
|
|
259
|
-
});
|
|
260
|
-
});
|
|
261
|
-
export type Outbound = {
|
|
262
|
-
RawResponse?: never | undefined;
|
|
263
|
-
error_message?: string | undefined;
|
|
264
|
-
};
|
|
265
|
-
|
|
266
|
-
export const outboundSchema: z.ZodType<
|
|
267
|
-
Outbound,
|
|
268
|
-
z.ZodTypeDef,
|
|
269
|
-
UpdatePhoneAgentResponse422ResponseBody
|
|
270
|
-
> = z
|
|
271
|
-
.instanceof(UpdatePhoneAgentResponse422ResponseBody)
|
|
272
|
-
.transform((v) => v.data$)
|
|
273
|
-
.pipe(
|
|
274
|
-
z
|
|
275
|
-
.object({
|
|
276
|
-
rawResponse: z
|
|
277
|
-
.instanceof(Response)
|
|
278
|
-
.transform(() => {
|
|
279
|
-
throw new Error("Response cannot be serialized");
|
|
280
|
-
})
|
|
281
|
-
.optional(),
|
|
282
|
-
errorMessage: z.string().optional(),
|
|
283
|
-
})
|
|
284
|
-
.transform((v) => {
|
|
285
|
-
return {
|
|
286
|
-
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
|
287
|
-
...(v.errorMessage === undefined
|
|
288
|
-
? null
|
|
289
|
-
: { error_message: v.errorMessage }),
|
|
290
|
-
};
|
|
291
|
-
})
|
|
292
|
-
);
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
/** @internal */
|
|
296
|
-
export namespace UpdatePhoneAgentResponseResponseBody$ {
|
|
297
|
-
export type Inbound = {
|
|
298
|
-
RawResponse?: Response | undefined;
|
|
299
|
-
error_message?: string | undefined;
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
export const inboundSchema: z.ZodType<
|
|
303
|
-
UpdatePhoneAgentResponseResponseBody,
|
|
304
|
-
z.ZodTypeDef,
|
|
305
|
-
Inbound
|
|
306
|
-
> = z
|
|
307
|
-
.object({
|
|
308
|
-
RawResponse: z.instanceof(Response).optional(),
|
|
309
|
-
error_message: z.string().optional(),
|
|
310
|
-
})
|
|
311
|
-
.transform((v) => {
|
|
312
|
-
return new UpdatePhoneAgentResponseResponseBody({
|
|
313
|
-
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
|
314
|
-
...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
export type Outbound = {
|
|
318
|
-
RawResponse?: never | undefined;
|
|
319
|
-
error_message?: string | undefined;
|
|
320
|
-
};
|
|
321
|
-
|
|
322
|
-
export const outboundSchema: z.ZodType<
|
|
323
|
-
Outbound,
|
|
324
|
-
z.ZodTypeDef,
|
|
325
|
-
UpdatePhoneAgentResponseResponseBody
|
|
326
|
-
> = z
|
|
327
|
-
.instanceof(UpdatePhoneAgentResponseResponseBody)
|
|
328
|
-
.transform((v) => v.data$)
|
|
329
|
-
.pipe(
|
|
330
|
-
z
|
|
331
|
-
.object({
|
|
332
|
-
rawResponse: z
|
|
333
|
-
.instanceof(Response)
|
|
334
|
-
.transform(() => {
|
|
335
|
-
throw new Error("Response cannot be serialized");
|
|
336
|
-
})
|
|
337
|
-
.optional(),
|
|
338
|
-
errorMessage: z.string().optional(),
|
|
339
|
-
})
|
|
340
|
-
.transform((v) => {
|
|
341
|
-
return {
|
|
342
|
-
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
|
343
|
-
...(v.errorMessage === undefined
|
|
344
|
-
? null
|
|
345
|
-
: { error_message: v.errorMessage }),
|
|
346
|
-
};
|
|
347
|
-
})
|
|
348
|
-
);
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
/** @internal */
|
|
352
|
-
export namespace UpdatePhoneAgentResponseBody$ {
|
|
353
|
-
export type Inbound = {
|
|
354
|
-
RawResponse?: Response | undefined;
|
|
355
|
-
error_message?: string | undefined;
|
|
356
|
-
};
|
|
357
|
-
|
|
358
|
-
export const inboundSchema: z.ZodType<UpdatePhoneAgentResponseBody, z.ZodTypeDef, Inbound> = z
|
|
359
|
-
.object({
|
|
360
|
-
RawResponse: z.instanceof(Response).optional(),
|
|
361
|
-
error_message: z.string().optional(),
|
|
362
|
-
})
|
|
363
|
-
.transform((v) => {
|
|
364
|
-
return new UpdatePhoneAgentResponseBody({
|
|
365
|
-
...(v.RawResponse === undefined ? null : { rawResponse: v.RawResponse }),
|
|
366
|
-
...(v.error_message === undefined ? null : { errorMessage: v.error_message }),
|
|
367
|
-
});
|
|
368
|
-
});
|
|
369
|
-
export type Outbound = {
|
|
370
|
-
RawResponse?: never | undefined;
|
|
371
|
-
error_message?: string | undefined;
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, UpdatePhoneAgentResponseBody> = z
|
|
375
|
-
.instanceof(UpdatePhoneAgentResponseBody)
|
|
376
|
-
.transform((v) => v.data$)
|
|
377
|
-
.pipe(
|
|
378
|
-
z
|
|
379
|
-
.object({
|
|
380
|
-
rawResponse: z
|
|
381
|
-
.instanceof(Response)
|
|
382
|
-
.transform(() => {
|
|
383
|
-
throw new Error("Response cannot be serialized");
|
|
384
|
-
})
|
|
385
|
-
.optional(),
|
|
386
|
-
errorMessage: z.string().optional(),
|
|
387
|
-
})
|
|
388
|
-
.transform((v) => {
|
|
389
|
-
return {
|
|
390
|
-
...(v.rawResponse === undefined ? null : { RawResponse: v.rawResponse }),
|
|
391
|
-
...(v.errorMessage === undefined
|
|
392
|
-
? null
|
|
393
|
-
: { error_message: v.errorMessage }),
|
|
394
|
-
};
|
|
395
|
-
})
|
|
396
|
-
);
|
|
397
|
-
}
|
|
@@ -1,308 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import * as components from "../../models/components";
|
|
6
|
-
import { z } from "zod";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Phone number associated with the call.
|
|
10
|
-
*/
|
|
11
|
-
export type PhoneNumber = {
|
|
12
|
-
/**
|
|
13
|
-
* Phone number you purchased in E.164 format. It would have an agent id associated with it.
|
|
14
|
-
*/
|
|
15
|
-
from: string;
|
|
16
|
-
/**
|
|
17
|
-
* Callee phone number in E.164 format.
|
|
18
|
-
*/
|
|
19
|
-
to: string;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type CreatePhoneCallRequestBody = {
|
|
23
|
-
/**
|
|
24
|
-
* Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect.
|
|
25
|
-
*/
|
|
26
|
-
agentPromptParams?: Array<components.AgentPromptParams> | undefined;
|
|
27
|
-
/**
|
|
28
|
-
* Phone number associated with the call.
|
|
29
|
-
*/
|
|
30
|
-
phoneNumber: PhoneNumber;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Status of call.
|
|
35
|
-
*/
|
|
36
|
-
export enum CallStatus {
|
|
37
|
-
Ongoing = "ongoing",
|
|
38
|
-
Ended = "ended",
|
|
39
|
-
Error = "error",
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Web call or phone call.
|
|
44
|
-
*/
|
|
45
|
-
export enum CreatePhoneCallCallType {
|
|
46
|
-
InboundPhoneCall = "inbound_phone_call",
|
|
47
|
-
OutboundPhoneCall = "outbound_phone_call",
|
|
48
|
-
WebCall = "web_call",
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Successfully retrieved an agent.
|
|
53
|
-
*/
|
|
54
|
-
export type CreatePhoneCallResponseBody = {
|
|
55
|
-
/**
|
|
56
|
-
* Corresponding agent id of this call.
|
|
57
|
-
*/
|
|
58
|
-
agentId: string;
|
|
59
|
-
/**
|
|
60
|
-
* Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect. Learn more about [Agent Prompt Parameters](/features/agent-prompt-parameter).
|
|
61
|
-
*/
|
|
62
|
-
agentPromptParams?: Array<components.AgentPromptParams> | undefined;
|
|
63
|
-
/**
|
|
64
|
-
* Unique id of the call.
|
|
65
|
-
*/
|
|
66
|
-
callId: string;
|
|
67
|
-
/**
|
|
68
|
-
* Status of call.
|
|
69
|
-
*/
|
|
70
|
-
callStatus: CallStatus;
|
|
71
|
-
/**
|
|
72
|
-
* Web call or phone call.
|
|
73
|
-
*/
|
|
74
|
-
callType: CreatePhoneCallCallType;
|
|
75
|
-
/**
|
|
76
|
-
* Phone number associated with the call.
|
|
77
|
-
*/
|
|
78
|
-
phoneNumber: components.CallPhoneNumber;
|
|
79
|
-
/**
|
|
80
|
-
* Begin timestamp (milliseconds since epoch) of the call.
|
|
81
|
-
*/
|
|
82
|
-
startTimestamp: number;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
export type CreatePhoneCallResponse = {
|
|
86
|
-
/**
|
|
87
|
-
* HTTP response content type for this operation
|
|
88
|
-
*/
|
|
89
|
-
contentType: string;
|
|
90
|
-
/**
|
|
91
|
-
* HTTP response status code for this operation
|
|
92
|
-
*/
|
|
93
|
-
statusCode: number;
|
|
94
|
-
/**
|
|
95
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
96
|
-
*/
|
|
97
|
-
rawResponse: Response;
|
|
98
|
-
/**
|
|
99
|
-
* Successfully retrieved an agent.
|
|
100
|
-
*/
|
|
101
|
-
object?: CreatePhoneCallResponseBody | undefined;
|
|
102
|
-
};
|
|
103
|
-
|
|
104
|
-
/** @internal */
|
|
105
|
-
export namespace PhoneNumber$ {
|
|
106
|
-
export type Inbound = {
|
|
107
|
-
from: string;
|
|
108
|
-
to: string;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const inboundSchema: z.ZodType<PhoneNumber, z.ZodTypeDef, Inbound> = z
|
|
112
|
-
.object({
|
|
113
|
-
from: z.string(),
|
|
114
|
-
to: z.string(),
|
|
115
|
-
})
|
|
116
|
-
.transform((v) => {
|
|
117
|
-
return {
|
|
118
|
-
from: v.from,
|
|
119
|
-
to: v.to,
|
|
120
|
-
};
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
export type Outbound = {
|
|
124
|
-
from: string;
|
|
125
|
-
to: string;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PhoneNumber> = z
|
|
129
|
-
.object({
|
|
130
|
-
from: z.string(),
|
|
131
|
-
to: z.string(),
|
|
132
|
-
})
|
|
133
|
-
.transform((v) => {
|
|
134
|
-
return {
|
|
135
|
-
from: v.from,
|
|
136
|
-
to: v.to,
|
|
137
|
-
};
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/** @internal */
|
|
142
|
-
export namespace CreatePhoneCallRequestBody$ {
|
|
143
|
-
export type Inbound = {
|
|
144
|
-
agent_prompt_params?: Array<components.AgentPromptParams$.Inbound> | undefined;
|
|
145
|
-
phone_number: PhoneNumber$.Inbound;
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
export const inboundSchema: z.ZodType<CreatePhoneCallRequestBody, z.ZodTypeDef, Inbound> = z
|
|
149
|
-
.object({
|
|
150
|
-
agent_prompt_params: z.array(components.AgentPromptParams$.inboundSchema).optional(),
|
|
151
|
-
phone_number: z.lazy(() => PhoneNumber$.inboundSchema),
|
|
152
|
-
})
|
|
153
|
-
.transform((v) => {
|
|
154
|
-
return {
|
|
155
|
-
...(v.agent_prompt_params === undefined
|
|
156
|
-
? null
|
|
157
|
-
: { agentPromptParams: v.agent_prompt_params }),
|
|
158
|
-
phoneNumber: v.phone_number,
|
|
159
|
-
};
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
export type Outbound = {
|
|
163
|
-
agent_prompt_params?: Array<components.AgentPromptParams$.Outbound> | undefined;
|
|
164
|
-
phone_number: PhoneNumber$.Outbound;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallRequestBody> = z
|
|
168
|
-
.object({
|
|
169
|
-
agentPromptParams: z.array(components.AgentPromptParams$.outboundSchema).optional(),
|
|
170
|
-
phoneNumber: z.lazy(() => PhoneNumber$.outboundSchema),
|
|
171
|
-
})
|
|
172
|
-
.transform((v) => {
|
|
173
|
-
return {
|
|
174
|
-
...(v.agentPromptParams === undefined
|
|
175
|
-
? null
|
|
176
|
-
: { agent_prompt_params: v.agentPromptParams }),
|
|
177
|
-
phone_number: v.phoneNumber,
|
|
178
|
-
};
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
/** @internal */
|
|
183
|
-
export const CallStatus$ = z.nativeEnum(CallStatus);
|
|
184
|
-
|
|
185
|
-
/** @internal */
|
|
186
|
-
export const CreatePhoneCallCallType$ = z.nativeEnum(CreatePhoneCallCallType);
|
|
187
|
-
|
|
188
|
-
/** @internal */
|
|
189
|
-
export namespace CreatePhoneCallResponseBody$ {
|
|
190
|
-
export type Inbound = {
|
|
191
|
-
agent_id: string;
|
|
192
|
-
agent_prompt_params?: Array<components.AgentPromptParams$.Inbound> | undefined;
|
|
193
|
-
call_id: string;
|
|
194
|
-
call_status: CallStatus;
|
|
195
|
-
call_type: CreatePhoneCallCallType;
|
|
196
|
-
phone_number: components.CallPhoneNumber$.Inbound;
|
|
197
|
-
start_timestamp: number;
|
|
198
|
-
};
|
|
199
|
-
|
|
200
|
-
export const inboundSchema: z.ZodType<CreatePhoneCallResponseBody, z.ZodTypeDef, Inbound> = z
|
|
201
|
-
.object({
|
|
202
|
-
agent_id: z.string(),
|
|
203
|
-
agent_prompt_params: z.array(components.AgentPromptParams$.inboundSchema).optional(),
|
|
204
|
-
call_id: z.string(),
|
|
205
|
-
call_status: CallStatus$,
|
|
206
|
-
call_type: CreatePhoneCallCallType$,
|
|
207
|
-
phone_number: components.CallPhoneNumber$.inboundSchema,
|
|
208
|
-
start_timestamp: z.number().int(),
|
|
209
|
-
})
|
|
210
|
-
.transform((v) => {
|
|
211
|
-
return {
|
|
212
|
-
agentId: v.agent_id,
|
|
213
|
-
...(v.agent_prompt_params === undefined
|
|
214
|
-
? null
|
|
215
|
-
: { agentPromptParams: v.agent_prompt_params }),
|
|
216
|
-
callId: v.call_id,
|
|
217
|
-
callStatus: v.call_status,
|
|
218
|
-
callType: v.call_type,
|
|
219
|
-
phoneNumber: v.phone_number,
|
|
220
|
-
startTimestamp: v.start_timestamp,
|
|
221
|
-
};
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
export type Outbound = {
|
|
225
|
-
agent_id: string;
|
|
226
|
-
agent_prompt_params?: Array<components.AgentPromptParams$.Outbound> | undefined;
|
|
227
|
-
call_id: string;
|
|
228
|
-
call_status: CallStatus;
|
|
229
|
-
call_type: CreatePhoneCallCallType;
|
|
230
|
-
phone_number: components.CallPhoneNumber$.Outbound;
|
|
231
|
-
start_timestamp: number;
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallResponseBody> = z
|
|
235
|
-
.object({
|
|
236
|
-
agentId: z.string(),
|
|
237
|
-
agentPromptParams: z.array(components.AgentPromptParams$.outboundSchema).optional(),
|
|
238
|
-
callId: z.string(),
|
|
239
|
-
callStatus: CallStatus$,
|
|
240
|
-
callType: CreatePhoneCallCallType$,
|
|
241
|
-
phoneNumber: components.CallPhoneNumber$.outboundSchema,
|
|
242
|
-
startTimestamp: z.number().int(),
|
|
243
|
-
})
|
|
244
|
-
.transform((v) => {
|
|
245
|
-
return {
|
|
246
|
-
agent_id: v.agentId,
|
|
247
|
-
...(v.agentPromptParams === undefined
|
|
248
|
-
? null
|
|
249
|
-
: { agent_prompt_params: v.agentPromptParams }),
|
|
250
|
-
call_id: v.callId,
|
|
251
|
-
call_status: v.callStatus,
|
|
252
|
-
call_type: v.callType,
|
|
253
|
-
phone_number: v.phoneNumber,
|
|
254
|
-
start_timestamp: v.startTimestamp,
|
|
255
|
-
};
|
|
256
|
-
});
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/** @internal */
|
|
260
|
-
export namespace CreatePhoneCallResponse$ {
|
|
261
|
-
export type Inbound = {
|
|
262
|
-
ContentType: string;
|
|
263
|
-
StatusCode: number;
|
|
264
|
-
RawResponse: Response;
|
|
265
|
-
callDetail?: CreatePhoneCallResponseBody$.Inbound | undefined;
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
export const inboundSchema: z.ZodType<CreatePhoneCallResponse, z.ZodTypeDef, Inbound> = z
|
|
269
|
-
.object({
|
|
270
|
-
ContentType: z.string(),
|
|
271
|
-
StatusCode: z.number().int(),
|
|
272
|
-
RawResponse: z.instanceof(Response),
|
|
273
|
-
callDetail: z.lazy(() => CreatePhoneCallResponseBody$.inboundSchema).optional(),
|
|
274
|
-
})
|
|
275
|
-
.transform((v) => {
|
|
276
|
-
return {
|
|
277
|
-
contentType: v.ContentType,
|
|
278
|
-
statusCode: v.StatusCode,
|
|
279
|
-
rawResponse: v.RawResponse,
|
|
280
|
-
...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
|
|
281
|
-
};
|
|
282
|
-
});
|
|
283
|
-
|
|
284
|
-
export type Outbound = {
|
|
285
|
-
ContentType: string;
|
|
286
|
-
StatusCode: number;
|
|
287
|
-
RawResponse: never;
|
|
288
|
-
callDetail?: CreatePhoneCallResponseBody$.Outbound | undefined;
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CreatePhoneCallResponse> = z
|
|
292
|
-
.object({
|
|
293
|
-
contentType: z.string(),
|
|
294
|
-
statusCode: z.number().int(),
|
|
295
|
-
rawResponse: z.instanceof(Response).transform(() => {
|
|
296
|
-
throw new Error("Response cannot be serialized");
|
|
297
|
-
}),
|
|
298
|
-
callDetail: z.lazy(() => CreatePhoneCallResponseBody$.outboundSchema).optional(),
|
|
299
|
-
})
|
|
300
|
-
.transform((v) => {
|
|
301
|
-
return {
|
|
302
|
-
ContentType: v.contentType,
|
|
303
|
-
StatusCode: v.statusCode,
|
|
304
|
-
RawResponse: v.rawResponse,
|
|
305
|
-
...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
|
|
306
|
-
};
|
|
307
|
-
});
|
|
308
|
-
}
|