retell-sdk 2.2.4 → 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 +15 -4
- package/example.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 -221
- package/models/components/agent.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 +32 -31
- package/models/components/calldetail.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/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/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/operations/createagent.d.ts +3 -16
- package/models/operations/createagent.d.ts.map +1 -1
- package/models/operations/createagent.js +4 -22
- package/models/operations/createagent.js.map +1 -1
- package/models/operations/getcall.d.ts +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/listcalls.d.ts +1 -7
- package/models/operations/listcalls.d.ts.map +1 -1
- package/models/operations/listcalls.js +0 -4
- package/models/operations/listcalls.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 +7 -25
- package/models/operations/updateagent.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/sdk.d.ts +1 -23
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +11 -437
- package/sdk/sdk.js.map +1 -1
- package/src/example.ts +18 -4
- package/src/models/components/agent.ts +8 -460
- package/src/models/components/calldetail.ts +47 -42
- package/src/models/components/index.ts +0 -3
- package/src/models/errors/index.ts +1 -6
- package/src/models/errors/{createphonecall.ts → registercall.ts} +60 -60
- package/src/models/operations/createagent.ts +8 -50
- package/src/models/operations/getcall.ts +1 -1
- package/src/models/operations/index.ts +1 -7
- package/src/models/operations/listcalls.ts +1 -11
- package/src/models/operations/registercall.ts +167 -0
- package/src/models/operations/updateagent.ts +11 -58
- package/src/sdk/audioWsClient.ts +63 -0
- package/src/sdk/index.ts +1 -1
- package/src/sdk/sdk.ts +13 -526
- package/src/models/components/agentpromptparams.ts +0 -61
- package/src/models/components/callphonenumber.ts +0 -64
- package/src/models/components/phonenumber.ts +0 -84
- package/src/models/errors/createphonenumber.ts +0 -552
- package/src/models/errors/deletephonenumber.ts +0 -442
- package/src/models/errors/getphonenumber.ts +0 -442
- package/src/models/errors/listphonenumbers.ts +0 -332
- package/src/models/errors/updatephoneagent.ts +0 -442
- package/src/models/operations/createphonecall.ts +0 -353
- package/src/models/operations/createphonenumber.ts +0 -144
- package/src/models/operations/createwebcall.ts +0 -16
- package/src/models/operations/deletephonenumber.ts +0 -119
- package/src/models/operations/getphonenumber.ts +0 -134
- package/src/models/operations/listphonenumbers.ts +0 -88
- package/src/models/operations/updatephoneagent.ts +0 -187
- package/src/sdk/liveClient.ts +0 -113
|
@@ -1,353 +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> =
|
|
129
|
-
z
|
|
130
|
-
.object({
|
|
131
|
-
from: z.string(),
|
|
132
|
-
to: z.string(),
|
|
133
|
-
})
|
|
134
|
-
.transform((v) => {
|
|
135
|
-
return {
|
|
136
|
-
from: v.from,
|
|
137
|
-
to: v.to,
|
|
138
|
-
};
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
/** @internal */
|
|
143
|
-
export namespace CreatePhoneCallRequestBody$ {
|
|
144
|
-
export type Inbound = {
|
|
145
|
-
agent_prompt_params?:
|
|
146
|
-
| Array<components.AgentPromptParams$.Inbound>
|
|
147
|
-
| undefined;
|
|
148
|
-
phone_number: PhoneNumber$.Inbound;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
export const inboundSchema: z.ZodType<
|
|
152
|
-
CreatePhoneCallRequestBody,
|
|
153
|
-
z.ZodTypeDef,
|
|
154
|
-
Inbound
|
|
155
|
-
> = z
|
|
156
|
-
.object({
|
|
157
|
-
agent_prompt_params: z
|
|
158
|
-
.array(components.AgentPromptParams$.inboundSchema)
|
|
159
|
-
.optional(),
|
|
160
|
-
phone_number: z.lazy(() => PhoneNumber$.inboundSchema),
|
|
161
|
-
})
|
|
162
|
-
.transform((v) => {
|
|
163
|
-
return {
|
|
164
|
-
...(v.agent_prompt_params === undefined
|
|
165
|
-
? null
|
|
166
|
-
: { agentPromptParams: v.agent_prompt_params }),
|
|
167
|
-
phoneNumber: v.phone_number,
|
|
168
|
-
};
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
export type Outbound = {
|
|
172
|
-
agent_prompt_params?:
|
|
173
|
-
| Array<components.AgentPromptParams$.Outbound>
|
|
174
|
-
| undefined;
|
|
175
|
-
phone_number: PhoneNumber$.Outbound;
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
export const outboundSchema: z.ZodType<
|
|
179
|
-
Outbound,
|
|
180
|
-
z.ZodTypeDef,
|
|
181
|
-
CreatePhoneCallRequestBody
|
|
182
|
-
> = z
|
|
183
|
-
.object({
|
|
184
|
-
agentPromptParams: z
|
|
185
|
-
.array(components.AgentPromptParams$.outboundSchema)
|
|
186
|
-
.optional(),
|
|
187
|
-
phoneNumber: z.lazy(() => PhoneNumber$.outboundSchema),
|
|
188
|
-
})
|
|
189
|
-
.transform((v) => {
|
|
190
|
-
return {
|
|
191
|
-
...(v.agentPromptParams === undefined
|
|
192
|
-
? null
|
|
193
|
-
: { agent_prompt_params: v.agentPromptParams }),
|
|
194
|
-
phone_number: v.phoneNumber,
|
|
195
|
-
};
|
|
196
|
-
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
/** @internal */
|
|
200
|
-
export const CallStatus$ = z.nativeEnum(CallStatus);
|
|
201
|
-
|
|
202
|
-
/** @internal */
|
|
203
|
-
export const CreatePhoneCallCallType$ = z.nativeEnum(CreatePhoneCallCallType);
|
|
204
|
-
|
|
205
|
-
/** @internal */
|
|
206
|
-
export namespace CreatePhoneCallResponseBody$ {
|
|
207
|
-
export type Inbound = {
|
|
208
|
-
agent_id: string;
|
|
209
|
-
agent_prompt_params?:
|
|
210
|
-
| Array<components.AgentPromptParams$.Inbound>
|
|
211
|
-
| undefined;
|
|
212
|
-
call_id: string;
|
|
213
|
-
call_status: CallStatus;
|
|
214
|
-
call_type: CreatePhoneCallCallType;
|
|
215
|
-
phone_number: components.CallPhoneNumber$.Inbound;
|
|
216
|
-
start_timestamp: number;
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
export const inboundSchema: z.ZodType<
|
|
220
|
-
CreatePhoneCallResponseBody,
|
|
221
|
-
z.ZodTypeDef,
|
|
222
|
-
Inbound
|
|
223
|
-
> = z
|
|
224
|
-
.object({
|
|
225
|
-
agent_id: z.string(),
|
|
226
|
-
agent_prompt_params: z
|
|
227
|
-
.array(components.AgentPromptParams$.inboundSchema)
|
|
228
|
-
.optional(),
|
|
229
|
-
call_id: z.string(),
|
|
230
|
-
call_status: CallStatus$,
|
|
231
|
-
call_type: CreatePhoneCallCallType$,
|
|
232
|
-
phone_number: components.CallPhoneNumber$.inboundSchema,
|
|
233
|
-
start_timestamp: z.number().int(),
|
|
234
|
-
})
|
|
235
|
-
.transform((v) => {
|
|
236
|
-
return {
|
|
237
|
-
agentId: v.agent_id,
|
|
238
|
-
...(v.agent_prompt_params === undefined
|
|
239
|
-
? null
|
|
240
|
-
: { agentPromptParams: v.agent_prompt_params }),
|
|
241
|
-
callId: v.call_id,
|
|
242
|
-
callStatus: v.call_status,
|
|
243
|
-
callType: v.call_type,
|
|
244
|
-
phoneNumber: v.phone_number,
|
|
245
|
-
startTimestamp: v.start_timestamp,
|
|
246
|
-
};
|
|
247
|
-
});
|
|
248
|
-
|
|
249
|
-
export type Outbound = {
|
|
250
|
-
agent_id: string;
|
|
251
|
-
agent_prompt_params?:
|
|
252
|
-
| Array<components.AgentPromptParams$.Outbound>
|
|
253
|
-
| undefined;
|
|
254
|
-
call_id: string;
|
|
255
|
-
call_status: CallStatus;
|
|
256
|
-
call_type: CreatePhoneCallCallType;
|
|
257
|
-
phone_number: components.CallPhoneNumber$.Outbound;
|
|
258
|
-
start_timestamp: number;
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
export const outboundSchema: z.ZodType<
|
|
262
|
-
Outbound,
|
|
263
|
-
z.ZodTypeDef,
|
|
264
|
-
CreatePhoneCallResponseBody
|
|
265
|
-
> = z
|
|
266
|
-
.object({
|
|
267
|
-
agentId: z.string(),
|
|
268
|
-
agentPromptParams: z
|
|
269
|
-
.array(components.AgentPromptParams$.outboundSchema)
|
|
270
|
-
.optional(),
|
|
271
|
-
callId: z.string(),
|
|
272
|
-
callStatus: CallStatus$,
|
|
273
|
-
callType: CreatePhoneCallCallType$,
|
|
274
|
-
phoneNumber: components.CallPhoneNumber$.outboundSchema,
|
|
275
|
-
startTimestamp: z.number().int(),
|
|
276
|
-
})
|
|
277
|
-
.transform((v) => {
|
|
278
|
-
return {
|
|
279
|
-
agent_id: v.agentId,
|
|
280
|
-
...(v.agentPromptParams === undefined
|
|
281
|
-
? null
|
|
282
|
-
: { agent_prompt_params: v.agentPromptParams }),
|
|
283
|
-
call_id: v.callId,
|
|
284
|
-
call_status: v.callStatus,
|
|
285
|
-
call_type: v.callType,
|
|
286
|
-
phone_number: v.phoneNumber,
|
|
287
|
-
start_timestamp: v.startTimestamp,
|
|
288
|
-
};
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
/** @internal */
|
|
293
|
-
export namespace CreatePhoneCallResponse$ {
|
|
294
|
-
export type Inbound = {
|
|
295
|
-
ContentType: string;
|
|
296
|
-
StatusCode: number;
|
|
297
|
-
RawResponse: Response;
|
|
298
|
-
callDetail?: CreatePhoneCallResponseBody$.Inbound | undefined;
|
|
299
|
-
};
|
|
300
|
-
|
|
301
|
-
export const inboundSchema: z.ZodType<
|
|
302
|
-
CreatePhoneCallResponse,
|
|
303
|
-
z.ZodTypeDef,
|
|
304
|
-
Inbound
|
|
305
|
-
> = z
|
|
306
|
-
.object({
|
|
307
|
-
ContentType: z.string(),
|
|
308
|
-
StatusCode: z.number().int(),
|
|
309
|
-
RawResponse: z.instanceof(Response),
|
|
310
|
-
callDetail: z
|
|
311
|
-
.lazy(() => CreatePhoneCallResponseBody$.inboundSchema)
|
|
312
|
-
.optional(),
|
|
313
|
-
})
|
|
314
|
-
.transform((v) => {
|
|
315
|
-
return {
|
|
316
|
-
contentType: v.ContentType,
|
|
317
|
-
statusCode: v.StatusCode,
|
|
318
|
-
rawResponse: v.RawResponse,
|
|
319
|
-
...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
|
|
320
|
-
};
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
export type Outbound = {
|
|
324
|
-
ContentType: string;
|
|
325
|
-
StatusCode: number;
|
|
326
|
-
RawResponse: never;
|
|
327
|
-
callDetail?: CreatePhoneCallResponseBody$.Outbound | undefined;
|
|
328
|
-
};
|
|
329
|
-
|
|
330
|
-
export const outboundSchema: z.ZodType<
|
|
331
|
-
Outbound,
|
|
332
|
-
z.ZodTypeDef,
|
|
333
|
-
CreatePhoneCallResponse
|
|
334
|
-
> = z
|
|
335
|
-
.object({
|
|
336
|
-
contentType: z.string(),
|
|
337
|
-
statusCode: z.number().int(),
|
|
338
|
-
rawResponse: z.instanceof(Response).transform(() => {
|
|
339
|
-
throw new Error("Response cannot be serialized");
|
|
340
|
-
}),
|
|
341
|
-
callDetail: z
|
|
342
|
-
.lazy(() => CreatePhoneCallResponseBody$.outboundSchema)
|
|
343
|
-
.optional(),
|
|
344
|
-
})
|
|
345
|
-
.transform((v) => {
|
|
346
|
-
return {
|
|
347
|
-
ContentType: v.contentType,
|
|
348
|
-
StatusCode: v.statusCode,
|
|
349
|
-
RawResponse: v.rawResponse,
|
|
350
|
-
...(v.callDetail === undefined ? null : { callDetail: v.callDetail }),
|
|
351
|
-
};
|
|
352
|
-
});
|
|
353
|
-
}
|
|
@@ -1,144 +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
|
-
export type CreatePhoneNumberRequestBody = {
|
|
9
|
-
/**
|
|
10
|
-
* Unique agent id to associate with this phone number. Can be updated.
|
|
11
|
-
*/
|
|
12
|
-
agentId: string;
|
|
13
|
-
/**
|
|
14
|
-
* The desired area code of the number. Must be valid US area code, which is a 3 digit integer.
|
|
15
|
-
*/
|
|
16
|
-
areaCode?: number | undefined;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export type CreatePhoneNumberResponse = {
|
|
20
|
-
/**
|
|
21
|
-
* HTTP response content type for this operation
|
|
22
|
-
*/
|
|
23
|
-
contentType: string;
|
|
24
|
-
/**
|
|
25
|
-
* Successfully created a new phone number.
|
|
26
|
-
*/
|
|
27
|
-
phoneNumber?: components.PhoneNumber | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* HTTP response status code for this operation
|
|
30
|
-
*/
|
|
31
|
-
statusCode: number;
|
|
32
|
-
/**
|
|
33
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
34
|
-
*/
|
|
35
|
-
rawResponse: Response;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
/** @internal */
|
|
39
|
-
export namespace CreatePhoneNumberRequestBody$ {
|
|
40
|
-
export type Inbound = {
|
|
41
|
-
agent_id: string;
|
|
42
|
-
area_code?: number | undefined;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const inboundSchema: z.ZodType<
|
|
46
|
-
CreatePhoneNumberRequestBody,
|
|
47
|
-
z.ZodTypeDef,
|
|
48
|
-
Inbound
|
|
49
|
-
> = z
|
|
50
|
-
.object({
|
|
51
|
-
agent_id: z.string(),
|
|
52
|
-
area_code: z.number().int().optional(),
|
|
53
|
-
})
|
|
54
|
-
.transform((v) => {
|
|
55
|
-
return {
|
|
56
|
-
agentId: v.agent_id,
|
|
57
|
-
...(v.area_code === undefined ? null : { areaCode: v.area_code }),
|
|
58
|
-
};
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
export type Outbound = {
|
|
62
|
-
agent_id: string;
|
|
63
|
-
area_code?: number | undefined;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export const outboundSchema: z.ZodType<
|
|
67
|
-
Outbound,
|
|
68
|
-
z.ZodTypeDef,
|
|
69
|
-
CreatePhoneNumberRequestBody
|
|
70
|
-
> = z
|
|
71
|
-
.object({
|
|
72
|
-
agentId: z.string(),
|
|
73
|
-
areaCode: z.number().int().optional(),
|
|
74
|
-
})
|
|
75
|
-
.transform((v) => {
|
|
76
|
-
return {
|
|
77
|
-
agent_id: v.agentId,
|
|
78
|
-
...(v.areaCode === undefined ? null : { area_code: v.areaCode }),
|
|
79
|
-
};
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
/** @internal */
|
|
84
|
-
export namespace CreatePhoneNumberResponse$ {
|
|
85
|
-
export type Inbound = {
|
|
86
|
-
ContentType: string;
|
|
87
|
-
PhoneNumber?: components.PhoneNumber$.Inbound | undefined;
|
|
88
|
-
StatusCode: number;
|
|
89
|
-
RawResponse: Response;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
export const inboundSchema: z.ZodType<
|
|
93
|
-
CreatePhoneNumberResponse,
|
|
94
|
-
z.ZodTypeDef,
|
|
95
|
-
Inbound
|
|
96
|
-
> = z
|
|
97
|
-
.object({
|
|
98
|
-
ContentType: z.string(),
|
|
99
|
-
PhoneNumber: components.PhoneNumber$.inboundSchema.optional(),
|
|
100
|
-
StatusCode: z.number().int(),
|
|
101
|
-
RawResponse: z.instanceof(Response),
|
|
102
|
-
})
|
|
103
|
-
.transform((v) => {
|
|
104
|
-
return {
|
|
105
|
-
contentType: v.ContentType,
|
|
106
|
-
...(v.PhoneNumber === undefined
|
|
107
|
-
? null
|
|
108
|
-
: { phoneNumber: v.PhoneNumber }),
|
|
109
|
-
statusCode: v.StatusCode,
|
|
110
|
-
rawResponse: v.RawResponse,
|
|
111
|
-
};
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
export type Outbound = {
|
|
115
|
-
ContentType: string;
|
|
116
|
-
PhoneNumber?: components.PhoneNumber$.Outbound | undefined;
|
|
117
|
-
StatusCode: number;
|
|
118
|
-
RawResponse: never;
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export const outboundSchema: z.ZodType<
|
|
122
|
-
Outbound,
|
|
123
|
-
z.ZodTypeDef,
|
|
124
|
-
CreatePhoneNumberResponse
|
|
125
|
-
> = z
|
|
126
|
-
.object({
|
|
127
|
-
contentType: z.string(),
|
|
128
|
-
phoneNumber: components.PhoneNumber$.outboundSchema.optional(),
|
|
129
|
-
statusCode: z.number().int(),
|
|
130
|
-
rawResponse: z.instanceof(Response).transform(() => {
|
|
131
|
-
throw new Error("Response cannot be serialized");
|
|
132
|
-
}),
|
|
133
|
-
})
|
|
134
|
-
.transform((v) => {
|
|
135
|
-
return {
|
|
136
|
-
ContentType: v.contentType,
|
|
137
|
-
...(v.phoneNumber === undefined
|
|
138
|
-
? null
|
|
139
|
-
: { PhoneNumber: v.phoneNumber }),
|
|
140
|
-
StatusCode: v.statusCode,
|
|
141
|
-
RawResponse: v.rawResponse,
|
|
142
|
-
};
|
|
143
|
-
});
|
|
144
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as components from "../../models/components";
|
|
2
|
-
|
|
3
|
-
export type CreateWebCallRequestBody = {
|
|
4
|
-
/**
|
|
5
|
-
* Unique agent id to associate with this phone number. Can be updated.
|
|
6
|
-
*/
|
|
7
|
-
agentId: string;
|
|
8
|
-
/**
|
|
9
|
-
* Supply values to your agent prompt parameters. If the given key value cannot match any param in prompt, it would have have any effect.
|
|
10
|
-
*/
|
|
11
|
-
agentPromptParams?: Array<components.AgentPromptParams> | undefined;
|
|
12
|
-
/**
|
|
13
|
-
* Sample rate for the call.
|
|
14
|
-
*/
|
|
15
|
-
sampleRate?: number | undefined;
|
|
16
|
-
};
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { z } from "zod";
|
|
6
|
-
|
|
7
|
-
export type DeletePhoneNumberRequest = {
|
|
8
|
-
/**
|
|
9
|
-
* Phone number to delete in E.164 format.
|
|
10
|
-
*/
|
|
11
|
-
phoneNumber: string;
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export type DeletePhoneNumberResponse = {
|
|
15
|
-
/**
|
|
16
|
-
* HTTP response content type for this operation
|
|
17
|
-
*/
|
|
18
|
-
contentType: string;
|
|
19
|
-
/**
|
|
20
|
-
* HTTP response status code for this operation
|
|
21
|
-
*/
|
|
22
|
-
statusCode: number;
|
|
23
|
-
/**
|
|
24
|
-
* Raw HTTP response; suitable for custom response parsing
|
|
25
|
-
*/
|
|
26
|
-
rawResponse: Response;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
/** @internal */
|
|
30
|
-
export namespace DeletePhoneNumberRequest$ {
|
|
31
|
-
export type Inbound = {
|
|
32
|
-
phone_number: string;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export const inboundSchema: z.ZodType<
|
|
36
|
-
DeletePhoneNumberRequest,
|
|
37
|
-
z.ZodTypeDef,
|
|
38
|
-
Inbound
|
|
39
|
-
> = z
|
|
40
|
-
.object({
|
|
41
|
-
phone_number: z.string(),
|
|
42
|
-
})
|
|
43
|
-
.transform((v) => {
|
|
44
|
-
return {
|
|
45
|
-
phoneNumber: v.phone_number,
|
|
46
|
-
};
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
export type Outbound = {
|
|
50
|
-
phone_number: string;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const outboundSchema: z.ZodType<
|
|
54
|
-
Outbound,
|
|
55
|
-
z.ZodTypeDef,
|
|
56
|
-
DeletePhoneNumberRequest
|
|
57
|
-
> = z
|
|
58
|
-
.object({
|
|
59
|
-
phoneNumber: z.string(),
|
|
60
|
-
})
|
|
61
|
-
.transform((v) => {
|
|
62
|
-
return {
|
|
63
|
-
phone_number: v.phoneNumber,
|
|
64
|
-
};
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** @internal */
|
|
69
|
-
export namespace DeletePhoneNumberResponse$ {
|
|
70
|
-
export type Inbound = {
|
|
71
|
-
ContentType: string;
|
|
72
|
-
StatusCode: number;
|
|
73
|
-
RawResponse: Response;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
|
-
export const inboundSchema: z.ZodType<
|
|
77
|
-
DeletePhoneNumberResponse,
|
|
78
|
-
z.ZodTypeDef,
|
|
79
|
-
Inbound
|
|
80
|
-
> = z
|
|
81
|
-
.object({
|
|
82
|
-
ContentType: z.string(),
|
|
83
|
-
StatusCode: z.number().int(),
|
|
84
|
-
RawResponse: z.instanceof(Response),
|
|
85
|
-
})
|
|
86
|
-
.transform((v) => {
|
|
87
|
-
return {
|
|
88
|
-
contentType: v.ContentType,
|
|
89
|
-
statusCode: v.StatusCode,
|
|
90
|
-
rawResponse: v.RawResponse,
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
export type Outbound = {
|
|
95
|
-
ContentType: string;
|
|
96
|
-
StatusCode: number;
|
|
97
|
-
RawResponse: never;
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export const outboundSchema: z.ZodType<
|
|
101
|
-
Outbound,
|
|
102
|
-
z.ZodTypeDef,
|
|
103
|
-
DeletePhoneNumberResponse
|
|
104
|
-
> = z
|
|
105
|
-
.object({
|
|
106
|
-
contentType: z.string(),
|
|
107
|
-
statusCode: z.number().int(),
|
|
108
|
-
rawResponse: z.instanceof(Response).transform(() => {
|
|
109
|
-
throw new Error("Response cannot be serialized");
|
|
110
|
-
}),
|
|
111
|
-
})
|
|
112
|
-
.transform((v) => {
|
|
113
|
-
return {
|
|
114
|
-
ContentType: v.contentType,
|
|
115
|
-
StatusCode: v.statusCode,
|
|
116
|
-
RawResponse: v.rawResponse,
|
|
117
|
-
};
|
|
118
|
-
});
|
|
119
|
-
}
|