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
|
@@ -5,49 +5,57 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
export type AgentPromptParams = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
/**
|
|
9
|
+
* The name of the parameter enclosed as `${YOUR_PARAM_NAME}` in agent prompt.
|
|
10
|
+
*/
|
|
11
|
+
name: string;
|
|
12
|
+
/**
|
|
13
|
+
* The value of parameter to substitute in agent prompt.
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
/** @internal */
|
|
19
19
|
export namespace AgentPromptParams$ {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export type Inbound = {
|
|
21
|
+
name: string;
|
|
22
|
+
value: string;
|
|
23
|
+
};
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
25
|
+
export const inboundSchema: z.ZodType<
|
|
26
|
+
AgentPromptParams,
|
|
27
|
+
z.ZodTypeDef,
|
|
28
|
+
Inbound
|
|
29
|
+
> = z
|
|
30
|
+
.object({
|
|
31
|
+
name: z.string(),
|
|
32
|
+
value: z.string(),
|
|
33
|
+
})
|
|
34
|
+
.transform((v) => {
|
|
35
|
+
return {
|
|
36
|
+
name: v.name,
|
|
37
|
+
value: v.value,
|
|
38
|
+
};
|
|
39
|
+
});
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
export type Outbound = {
|
|
42
|
+
name: string;
|
|
43
|
+
value: string;
|
|
44
|
+
};
|
|
41
45
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
export const outboundSchema: z.ZodType<
|
|
47
|
+
Outbound,
|
|
48
|
+
z.ZodTypeDef,
|
|
49
|
+
AgentPromptParams
|
|
50
|
+
> = z
|
|
51
|
+
.object({
|
|
52
|
+
name: z.string(),
|
|
53
|
+
value: z.string(),
|
|
54
|
+
})
|
|
55
|
+
.transform((v) => {
|
|
56
|
+
return {
|
|
57
|
+
name: v.name,
|
|
58
|
+
value: v.value,
|
|
59
|
+
};
|
|
60
|
+
});
|
|
53
61
|
}
|
|
@@ -10,58 +10,58 @@ import { z } from "zod";
|
|
|
10
10
|
* Status of call.
|
|
11
11
|
*/
|
|
12
12
|
export enum CallStatus {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
Ongoing = "ongoing",
|
|
14
|
+
Ended = "ended",
|
|
15
|
+
Error = "error",
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Web call or phone call.
|
|
20
20
|
*/
|
|
21
21
|
export enum CallType {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
InboundPhoneCall = "inbound_phone_call",
|
|
23
|
+
OutboundPhoneCall = "outbound_phone_call",
|
|
24
|
+
WebCall = "web_call",
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
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
|
-
|
|
28
|
+
/**
|
|
29
|
+
* Corresponding agent id of this call.
|
|
30
|
+
*/
|
|
31
|
+
agentId: string;
|
|
32
|
+
/**
|
|
33
|
+
* 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).
|
|
34
|
+
*/
|
|
35
|
+
agentPromptParams?: Array<AgentPromptParams> | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Unique id of the call.
|
|
38
|
+
*/
|
|
39
|
+
callId: string;
|
|
40
|
+
/**
|
|
41
|
+
* Status of call.
|
|
42
|
+
*/
|
|
43
|
+
callStatus: CallStatus;
|
|
44
|
+
/**
|
|
45
|
+
* Web call or phone call.
|
|
46
|
+
*/
|
|
47
|
+
callType: CallType;
|
|
48
|
+
/**
|
|
49
|
+
* End timestamp (milliseconds since epoch) of the call. Available after call ends.
|
|
50
|
+
*/
|
|
51
|
+
endTimestamp?: number | undefined;
|
|
52
|
+
phoneNumber?: CallPhoneNumber | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* Recording of the call. Available after call ends.
|
|
55
|
+
*/
|
|
56
|
+
recordingUrl?: string | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* Begin timestamp (milliseconds since epoch) of the call.
|
|
59
|
+
*/
|
|
60
|
+
startTimestamp: number;
|
|
61
|
+
/**
|
|
62
|
+
* Transcription of the call. Available after call ends.
|
|
63
|
+
*/
|
|
64
|
+
transcript?: string | undefined;
|
|
65
65
|
};
|
|
66
66
|
|
|
67
67
|
/** @internal */
|
|
@@ -72,89 +72,101 @@ export const CallType$ = z.nativeEnum(CallType);
|
|
|
72
72
|
|
|
73
73
|
/** @internal */
|
|
74
74
|
export namespace CallDetail$ {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
export type Inbound = {
|
|
76
|
+
agent_id: string;
|
|
77
|
+
agent_prompt_params?: Array<AgentPromptParams$.Inbound> | undefined;
|
|
78
|
+
call_id: string;
|
|
79
|
+
call_status: CallStatus;
|
|
80
|
+
call_type: CallType;
|
|
81
|
+
end_timestamp?: number | undefined;
|
|
82
|
+
phone_number?: CallPhoneNumber$.Inbound | undefined;
|
|
83
|
+
recording_url?: string | undefined;
|
|
84
|
+
start_timestamp: number;
|
|
85
|
+
transcript?: string | undefined;
|
|
86
|
+
};
|
|
87
87
|
|
|
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
|
-
|
|
88
|
+
export const inboundSchema: z.ZodType<CallDetail, z.ZodTypeDef, Inbound> = z
|
|
89
|
+
.object({
|
|
90
|
+
agent_id: z.string(),
|
|
91
|
+
agent_prompt_params: z.array(AgentPromptParams$.inboundSchema).optional(),
|
|
92
|
+
call_id: z.string(),
|
|
93
|
+
call_status: CallStatus$,
|
|
94
|
+
call_type: CallType$,
|
|
95
|
+
end_timestamp: z.number().int().optional(),
|
|
96
|
+
phone_number: CallPhoneNumber$.inboundSchema.optional(),
|
|
97
|
+
recording_url: z.string().optional(),
|
|
98
|
+
start_timestamp: z.number().int(),
|
|
99
|
+
transcript: z.string().optional(),
|
|
100
|
+
})
|
|
101
|
+
.transform((v) => {
|
|
102
|
+
return {
|
|
103
|
+
agentId: v.agent_id,
|
|
104
|
+
...(v.agent_prompt_params === undefined
|
|
105
|
+
? null
|
|
106
|
+
: { agentPromptParams: v.agent_prompt_params }),
|
|
107
|
+
callId: v.call_id,
|
|
108
|
+
callStatus: v.call_status,
|
|
109
|
+
callType: v.call_type,
|
|
110
|
+
...(v.end_timestamp === undefined
|
|
111
|
+
? null
|
|
112
|
+
: { endTimestamp: v.end_timestamp }),
|
|
113
|
+
...(v.phone_number === undefined
|
|
114
|
+
? null
|
|
115
|
+
: { phoneNumber: v.phone_number }),
|
|
116
|
+
...(v.recording_url === undefined
|
|
117
|
+
? null
|
|
118
|
+
: { recordingUrl: v.recording_url }),
|
|
119
|
+
startTimestamp: v.start_timestamp,
|
|
120
|
+
...(v.transcript === undefined ? null : { transcript: v.transcript }),
|
|
121
|
+
};
|
|
122
|
+
});
|
|
117
123
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
124
|
+
export type Outbound = {
|
|
125
|
+
agent_id: string;
|
|
126
|
+
agent_prompt_params?: Array<AgentPromptParams$.Outbound> | undefined;
|
|
127
|
+
call_id: string;
|
|
128
|
+
call_status: CallStatus;
|
|
129
|
+
call_type: CallType;
|
|
130
|
+
end_timestamp?: number | undefined;
|
|
131
|
+
phone_number?: CallPhoneNumber$.Outbound | undefined;
|
|
132
|
+
recording_url?: string | undefined;
|
|
133
|
+
start_timestamp: number;
|
|
134
|
+
transcript?: string | undefined;
|
|
135
|
+
};
|
|
130
136
|
|
|
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
|
-
|
|
137
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CallDetail> = z
|
|
138
|
+
.object({
|
|
139
|
+
agentId: z.string(),
|
|
140
|
+
agentPromptParams: z.array(AgentPromptParams$.outboundSchema).optional(),
|
|
141
|
+
callId: z.string(),
|
|
142
|
+
callStatus: CallStatus$,
|
|
143
|
+
callType: CallType$,
|
|
144
|
+
endTimestamp: z.number().int().optional(),
|
|
145
|
+
phoneNumber: CallPhoneNumber$.outboundSchema.optional(),
|
|
146
|
+
recordingUrl: z.string().optional(),
|
|
147
|
+
startTimestamp: z.number().int(),
|
|
148
|
+
transcript: z.string().optional(),
|
|
149
|
+
})
|
|
150
|
+
.transform((v) => {
|
|
151
|
+
return {
|
|
152
|
+
agent_id: v.agentId,
|
|
153
|
+
...(v.agentPromptParams === undefined
|
|
154
|
+
? null
|
|
155
|
+
: { agent_prompt_params: v.agentPromptParams }),
|
|
156
|
+
call_id: v.callId,
|
|
157
|
+
call_status: v.callStatus,
|
|
158
|
+
call_type: v.callType,
|
|
159
|
+
...(v.endTimestamp === undefined
|
|
160
|
+
? null
|
|
161
|
+
: { end_timestamp: v.endTimestamp }),
|
|
162
|
+
...(v.phoneNumber === undefined
|
|
163
|
+
? null
|
|
164
|
+
: { phone_number: v.phoneNumber }),
|
|
165
|
+
...(v.recordingUrl === undefined
|
|
166
|
+
? null
|
|
167
|
+
: { recording_url: v.recordingUrl }),
|
|
168
|
+
start_timestamp: v.startTimestamp,
|
|
169
|
+
...(v.transcript === undefined ? null : { transcript: v.transcript }),
|
|
170
|
+
};
|
|
171
|
+
});
|
|
160
172
|
}
|
|
@@ -8,49 +8,57 @@ import { z } from "zod";
|
|
|
8
8
|
* Phone number associated with the call. Only populated when call_type is `inbound_phone_call` or `outbound_phone_call`.
|
|
9
9
|
*/
|
|
10
10
|
export type CallPhoneNumber = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Caller phone number in E.164 format.
|
|
13
|
+
*/
|
|
14
|
+
from: string;
|
|
15
|
+
/**
|
|
16
|
+
* Callee phone number in E.164 format.
|
|
17
|
+
*/
|
|
18
|
+
to: string;
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
/** @internal */
|
|
22
22
|
export namespace CallPhoneNumber$ {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
export type Inbound = {
|
|
24
|
+
from: string;
|
|
25
|
+
to: string;
|
|
26
|
+
};
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
export const inboundSchema: z.ZodType<
|
|
29
|
+
CallPhoneNumber,
|
|
30
|
+
z.ZodTypeDef,
|
|
31
|
+
Inbound
|
|
32
|
+
> = z
|
|
33
|
+
.object({
|
|
34
|
+
from: z.string(),
|
|
35
|
+
to: z.string(),
|
|
36
|
+
})
|
|
37
|
+
.transform((v) => {
|
|
38
|
+
return {
|
|
39
|
+
from: v.from,
|
|
40
|
+
to: v.to,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
39
43
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
export type Outbound = {
|
|
45
|
+
from: string;
|
|
46
|
+
to: string;
|
|
47
|
+
};
|
|
44
48
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
49
|
+
export const outboundSchema: z.ZodType<
|
|
50
|
+
Outbound,
|
|
51
|
+
z.ZodTypeDef,
|
|
52
|
+
CallPhoneNumber
|
|
53
|
+
> = z
|
|
54
|
+
.object({
|
|
55
|
+
from: z.string(),
|
|
56
|
+
to: z.string(),
|
|
57
|
+
})
|
|
58
|
+
.transform((v) => {
|
|
59
|
+
return {
|
|
60
|
+
from: v.from,
|
|
61
|
+
to: v.to,
|
|
62
|
+
};
|
|
63
|
+
});
|
|
56
64
|
}
|
|
@@ -5,79 +5,80 @@
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
|
|
7
7
|
export type PhoneNumber = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Unique agent id to associate with this phone number. Can be updated with [Update Phone Agent](/api/update-phone-agent).
|
|
10
|
+
*/
|
|
11
|
+
agentId: string;
|
|
12
|
+
/**
|
|
13
|
+
* The area code of the number. This is a 3 digit integer.
|
|
14
|
+
*/
|
|
15
|
+
areaCode: number;
|
|
16
|
+
/**
|
|
17
|
+
* Last modification timestamp (milliseconds since epoch). Either the time of last update or creation if no updates available.
|
|
18
|
+
*/
|
|
19
|
+
lastModificationTimestamp: number;
|
|
20
|
+
/**
|
|
21
|
+
* Unique phone number you purchased in E.164 format. This number is set up to handle inbound phone calls, and can be used for outbound phone calls with [Create Phone Call](/api/create-phone-call).
|
|
22
|
+
*/
|
|
23
|
+
phoneNumber: string;
|
|
24
|
+
/**
|
|
25
|
+
* Unique phone number you purchased in pretty human readable format. Example: (415) 909-5857.
|
|
26
|
+
*/
|
|
27
|
+
phoneNumberPretty: string;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
/** @internal */
|
|
31
31
|
export namespace PhoneNumber$ {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
export type Inbound = {
|
|
33
|
+
agent_id: string;
|
|
34
|
+
area_code: number;
|
|
35
|
+
last_modification_timestamp: number;
|
|
36
|
+
phone_number: string;
|
|
37
|
+
phone_number_pretty: string;
|
|
38
|
+
};
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
40
|
+
export const inboundSchema: z.ZodType<PhoneNumber, z.ZodTypeDef, Inbound> = z
|
|
41
|
+
.object({
|
|
42
|
+
agent_id: z.string(),
|
|
43
|
+
area_code: z.number().int(),
|
|
44
|
+
last_modification_timestamp: z.number().int(),
|
|
45
|
+
phone_number: z.string(),
|
|
46
|
+
phone_number_pretty: z.string(),
|
|
47
|
+
})
|
|
48
|
+
.transform((v) => {
|
|
49
|
+
return {
|
|
50
|
+
agentId: v.agent_id,
|
|
51
|
+
areaCode: v.area_code,
|
|
52
|
+
lastModificationTimestamp: v.last_modification_timestamp,
|
|
53
|
+
phoneNumber: v.phone_number,
|
|
54
|
+
phoneNumberPretty: v.phone_number_pretty,
|
|
55
|
+
};
|
|
56
|
+
});
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
export type Outbound = {
|
|
59
|
+
agent_id: string;
|
|
60
|
+
area_code: number;
|
|
61
|
+
last_modification_timestamp: number;
|
|
62
|
+
phone_number: string;
|
|
63
|
+
phone_number_pretty: string;
|
|
64
|
+
};
|
|
65
65
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
66
|
+
export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PhoneNumber> =
|
|
67
|
+
z
|
|
68
|
+
.object({
|
|
69
|
+
agentId: z.string(),
|
|
70
|
+
areaCode: z.number().int(),
|
|
71
|
+
lastModificationTimestamp: z.number().int(),
|
|
72
|
+
phoneNumber: z.string(),
|
|
73
|
+
phoneNumberPretty: z.string(),
|
|
74
|
+
})
|
|
75
|
+
.transform((v) => {
|
|
76
|
+
return {
|
|
77
|
+
agent_id: v.agentId,
|
|
78
|
+
area_code: v.areaCode,
|
|
79
|
+
last_modification_timestamp: v.lastModificationTimestamp,
|
|
80
|
+
phone_number: v.phoneNumber,
|
|
81
|
+
phone_number_pretty: v.phoneNumberPretty,
|
|
82
|
+
};
|
|
83
|
+
});
|
|
83
84
|
}
|