retell-sdk 2.2.3 → 2.2.4
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 +34 -2
- 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 -3
- package/models/components/agent.d.ts.map +1 -1
- package/models/components/agent.js +60 -26
- 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.map +1 -1
- package/models/components/calldetail.js +18 -6
- 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/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/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/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.map +1 -1
- package/models/operations/createagent.js +16 -6
- 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.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/listagents.d.ts.map +1 -1
- package/models/operations/listagents.js.map +1 -1
- package/models/operations/listcalls.d.ts.map +1 -1
- package/models/operations/listcalls.js +6 -2
- 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/updateagent.d.ts.map +1 -1
- package/models/operations/updateagent.js +18 -4
- 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/liveClient.d.ts.map +1 -1
- package/sdk/liveClient.js +7 -2
- package/sdk/liveClient.js.map +1 -1
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +22 -5
- package/sdk/sdk.js.map +1 -1
- package/src/example.ts +121 -87
- 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 +459 -387
- package/src/models/components/agentpromptparams.ts +46 -38
- package/src/models/components/calldetail.ts +137 -125
- package/src/models/components/callphonenumber.ts +46 -38
- package/src/models/components/phonenumber.ts +69 -68
- package/src/models/components/security.ts +1 -1
- package/src/models/errors/createagent.ts +359 -311
- package/src/models/errors/createphonecall.ts +537 -472
- package/src/models/errors/createphonenumber.ts +447 -395
- package/src/models/errors/deleteagent.ts +359 -311
- package/src/models/errors/deletephonenumber.ts +357 -315
- package/src/models/errors/getagent.ts +358 -302
- package/src/models/errors/getcall.ts +348 -294
- package/src/models/errors/getphonenumber.ts +357 -312
- package/src/models/errors/listagents.ts +174 -147
- package/src/models/errors/listcalls.ts +251 -211
- package/src/models/errors/listphonenumbers.ts +252 -217
- package/src/models/errors/updateagent.ts +359 -311
- package/src/models/errors/updatephoneagent.ts +357 -312
- package/src/models/operations/createagent.ts +165 -129
- package/src/models/operations/createphonecall.ts +283 -238
- package/src/models/operations/createphonenumber.ts +118 -98
- package/src/models/operations/createwebcall.ts +13 -13
- package/src/models/operations/deleteagent.ts +94 -78
- package/src/models/operations/deletephonenumber.ts +94 -78
- package/src/models/operations/getagent.ts +104 -88
- package/src/models/operations/getcall.ts +101 -88
- package/src/models/operations/getphonenumber.ts +108 -88
- package/src/models/operations/listagents.ts +68 -60
- package/src/models/operations/listcalls.ts +238 -213
- package/src/models/operations/listphonenumbers.ts +72 -60
- package/src/models/operations/updateagent.ts +226 -173
- package/src/models/operations/updatephoneagent.ts +160 -132
- package/src/sdk/liveClient.ts +11 -7
- package/src/sdk/sdk.ts +1313 -1160
|
@@ -9,174 +9,191 @@ import { z } from "zod";
|
|
|
9
9
|
* Phone number associated with the call.
|
|
10
10
|
*/
|
|
11
11
|
export type PhoneNumber = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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
20
|
};
|
|
21
21
|
|
|
22
22
|
export type CreatePhoneCallRequestBody = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
31
|
};
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Status of call.
|
|
35
35
|
*/
|
|
36
36
|
export enum CallStatus {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
Ongoing = "ongoing",
|
|
38
|
+
Ended = "ended",
|
|
39
|
+
Error = "error",
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Web call or phone call.
|
|
44
44
|
*/
|
|
45
45
|
export enum CreatePhoneCallCallType {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
InboundPhoneCall = "inbound_phone_call",
|
|
47
|
+
OutboundPhoneCall = "outbound_phone_call",
|
|
48
|
+
WebCall = "web_call",
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/**
|
|
52
52
|
* Successfully retrieved an agent.
|
|
53
53
|
*/
|
|
54
54
|
export type CreatePhoneCallResponseBody = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
83
|
};
|
|
84
84
|
|
|
85
85
|
export type CreatePhoneCallResponse = {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
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
102
|
};
|
|
103
103
|
|
|
104
104
|
/** @internal */
|
|
105
105
|
export namespace PhoneNumber$ {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
export type Inbound = {
|
|
107
|
+
from: string;
|
|
108
|
+
to: string;
|
|
109
|
+
};
|
|
110
110
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
122
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
export type Outbound = {
|
|
124
|
+
from: string;
|
|
125
|
+
to: string;
|
|
126
|
+
};
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
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
|
+
});
|
|
139
140
|
}
|
|
140
141
|
|
|
141
142
|
/** @internal */
|
|
142
143
|
export namespace CreatePhoneCallRequestBody$ {
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
export type Inbound = {
|
|
145
|
+
agent_prompt_params?:
|
|
146
|
+
| Array<components.AgentPromptParams$.Inbound>
|
|
147
|
+
| undefined;
|
|
148
|
+
phone_number: PhoneNumber$.Inbound;
|
|
149
|
+
};
|
|
147
150
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
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
|
+
});
|
|
161
170
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
171
|
+
export type Outbound = {
|
|
172
|
+
agent_prompt_params?:
|
|
173
|
+
| Array<components.AgentPromptParams$.Outbound>
|
|
174
|
+
| undefined;
|
|
175
|
+
phone_number: PhoneNumber$.Outbound;
|
|
176
|
+
};
|
|
166
177
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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
|
+
});
|
|
180
197
|
}
|
|
181
198
|
|
|
182
199
|
/** @internal */
|
|
@@ -187,122 +204,150 @@ export const CreatePhoneCallCallType$ = z.nativeEnum(CreatePhoneCallCallType);
|
|
|
187
204
|
|
|
188
205
|
/** @internal */
|
|
189
206
|
export namespace CreatePhoneCallResponseBody$ {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
+
};
|
|
199
218
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
+
});
|
|
223
248
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
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
|
+
};
|
|
233
260
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
+
});
|
|
257
290
|
}
|
|
258
291
|
|
|
259
292
|
/** @internal */
|
|
260
293
|
export namespace CreatePhoneCallResponse$ {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
294
|
+
export type Inbound = {
|
|
295
|
+
ContentType: string;
|
|
296
|
+
StatusCode: number;
|
|
297
|
+
RawResponse: Response;
|
|
298
|
+
callDetail?: CreatePhoneCallResponseBody$.Inbound | undefined;
|
|
299
|
+
};
|
|
267
300
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
+
});
|
|
283
322
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
323
|
+
export type Outbound = {
|
|
324
|
+
ContentType: string;
|
|
325
|
+
StatusCode: number;
|
|
326
|
+
RawResponse: never;
|
|
327
|
+
callDetail?: CreatePhoneCallResponseBody$.Outbound | undefined;
|
|
328
|
+
};
|
|
290
329
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
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
|
+
});
|
|
308
353
|
}
|