retell-sdk 2.2.2 → 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.
Files changed (145) hide show
  1. package/example.js +61 -7
  2. package/example.js.map +1 -1
  3. package/lib/config.d.ts.map +1 -1
  4. package/lib/config.js.map +1 -1
  5. package/lib/sdks.d.ts.map +1 -1
  6. package/lib/sdks.js.map +1 -1
  7. package/lib/security.d.ts.map +1 -1
  8. package/lib/security.js +5 -1
  9. package/lib/security.js.map +1 -1
  10. package/models/components/agent.d.ts +62 -0
  11. package/models/components/agent.d.ts.map +1 -1
  12. package/models/components/agent.js +95 -15
  13. package/models/components/agent.js.map +1 -1
  14. package/models/components/agentpromptparams.d.ts.map +1 -1
  15. package/models/components/agentpromptparams.js.map +1 -1
  16. package/models/components/calldetail.d.ts.map +1 -1
  17. package/models/components/calldetail.js +18 -6
  18. package/models/components/calldetail.js.map +1 -1
  19. package/models/components/callphonenumber.d.ts.map +1 -1
  20. package/models/components/callphonenumber.js.map +1 -1
  21. package/models/components/phonenumber.d.ts.map +1 -1
  22. package/models/components/phonenumber.js.map +1 -1
  23. package/models/components/security.d.ts.map +1 -1
  24. package/models/errors/createagent.d.ts.map +1 -1
  25. package/models/errors/createagent.js +36 -12
  26. package/models/errors/createagent.js.map +1 -1
  27. package/models/errors/createphonecall.d.ts.map +1 -1
  28. package/models/errors/createphonecall.js +54 -18
  29. package/models/errors/createphonecall.js.map +1 -1
  30. package/models/errors/createphonenumber.d.ts.map +1 -1
  31. package/models/errors/createphonenumber.js +42 -14
  32. package/models/errors/createphonenumber.js.map +1 -1
  33. package/models/errors/deleteagent.d.ts.map +1 -1
  34. package/models/errors/deleteagent.js +36 -12
  35. package/models/errors/deleteagent.js.map +1 -1
  36. package/models/errors/deletephonenumber.d.ts.map +1 -1
  37. package/models/errors/deletephonenumber.js +33 -11
  38. package/models/errors/deletephonenumber.js.map +1 -1
  39. package/models/errors/getagent.d.ts.map +1 -1
  40. package/models/errors/getagent.js +36 -12
  41. package/models/errors/getagent.js.map +1 -1
  42. package/models/errors/getcall.d.ts.map +1 -1
  43. package/models/errors/getcall.js +30 -10
  44. package/models/errors/getcall.js.map +1 -1
  45. package/models/errors/getphonenumber.d.ts.map +1 -1
  46. package/models/errors/getphonenumber.js +36 -12
  47. package/models/errors/getphonenumber.js.map +1 -1
  48. package/models/errors/listagents.d.ts.map +1 -1
  49. package/models/errors/listagents.js +15 -5
  50. package/models/errors/listagents.js.map +1 -1
  51. package/models/errors/listcalls.d.ts.map +1 -1
  52. package/models/errors/listcalls.js +24 -8
  53. package/models/errors/listcalls.js.map +1 -1
  54. package/models/errors/listphonenumbers.d.ts.map +1 -1
  55. package/models/errors/listphonenumbers.js +27 -9
  56. package/models/errors/listphonenumbers.js.map +1 -1
  57. package/models/errors/updateagent.d.ts.map +1 -1
  58. package/models/errors/updateagent.js +36 -12
  59. package/models/errors/updateagent.js.map +1 -1
  60. package/models/errors/updatephoneagent.d.ts.map +1 -1
  61. package/models/errors/updatephoneagent.js +36 -12
  62. package/models/errors/updatephoneagent.js.map +1 -1
  63. package/models/operations/createagent.d.ts +7 -0
  64. package/models/operations/createagent.d.ts.map +1 -1
  65. package/models/operations/createagent.js +18 -4
  66. package/models/operations/createagent.js.map +1 -1
  67. package/models/operations/createphonecall.d.ts.map +1 -1
  68. package/models/operations/createphonecall.js +18 -6
  69. package/models/operations/createphonecall.js.map +1 -1
  70. package/models/operations/createphonenumber.d.ts.map +1 -1
  71. package/models/operations/createphonenumber.js +6 -2
  72. package/models/operations/createphonenumber.js.map +1 -1
  73. package/models/operations/createwebcall.d.ts.map +1 -1
  74. package/models/operations/deleteagent.d.ts.map +1 -1
  75. package/models/operations/deleteagent.js.map +1 -1
  76. package/models/operations/deletephonenumber.d.ts.map +1 -1
  77. package/models/operations/deletephonenumber.js.map +1 -1
  78. package/models/operations/getagent.d.ts.map +1 -1
  79. package/models/operations/getagent.js.map +1 -1
  80. package/models/operations/getcall.d.ts.map +1 -1
  81. package/models/operations/getcall.js.map +1 -1
  82. package/models/operations/getphonenumber.d.ts.map +1 -1
  83. package/models/operations/getphonenumber.js +6 -2
  84. package/models/operations/getphonenumber.js.map +1 -1
  85. package/models/operations/listagents.d.ts.map +1 -1
  86. package/models/operations/listagents.js.map +1 -1
  87. package/models/operations/listcalls.d.ts.map +1 -1
  88. package/models/operations/listcalls.js +6 -2
  89. package/models/operations/listcalls.js.map +1 -1
  90. package/models/operations/listphonenumbers.d.ts.map +1 -1
  91. package/models/operations/listphonenumbers.js +6 -2
  92. package/models/operations/listphonenumbers.js.map +1 -1
  93. package/models/operations/updateagent.d.ts +7 -0
  94. package/models/operations/updateagent.d.ts.map +1 -1
  95. package/models/operations/updateagent.js +22 -4
  96. package/models/operations/updateagent.js.map +1 -1
  97. package/models/operations/updatephoneagent.d.ts.map +1 -1
  98. package/models/operations/updatephoneagent.js +6 -2
  99. package/models/operations/updatephoneagent.js.map +1 -1
  100. package/package.json +1 -1
  101. package/sdk/liveClient.d.ts.map +1 -1
  102. package/sdk/liveClient.js +7 -2
  103. package/sdk/liveClient.js.map +1 -1
  104. package/sdk/sdk.d.ts.map +1 -1
  105. package/sdk/sdk.js +22 -5
  106. package/sdk/sdk.js.map +1 -1
  107. package/src/example.ts +122 -65
  108. package/src/lib/config.ts +32 -32
  109. package/src/lib/sdks.ts +91 -82
  110. package/src/lib/security.ts +133 -118
  111. package/src/models/components/agent.ts +482 -303
  112. package/src/models/components/agentpromptparams.ts +46 -38
  113. package/src/models/components/calldetail.ts +137 -125
  114. package/src/models/components/callphonenumber.ts +46 -38
  115. package/src/models/components/phonenumber.ts +69 -68
  116. package/src/models/components/security.ts +1 -1
  117. package/src/models/errors/createagent.ts +359 -311
  118. package/src/models/errors/createphonecall.ts +537 -472
  119. package/src/models/errors/createphonenumber.ts +447 -395
  120. package/src/models/errors/deleteagent.ts +359 -311
  121. package/src/models/errors/deletephonenumber.ts +357 -315
  122. package/src/models/errors/getagent.ts +358 -302
  123. package/src/models/errors/getcall.ts +348 -294
  124. package/src/models/errors/getphonenumber.ts +357 -312
  125. package/src/models/errors/listagents.ts +174 -147
  126. package/src/models/errors/listcalls.ts +251 -211
  127. package/src/models/errors/listphonenumbers.ts +252 -217
  128. package/src/models/errors/updateagent.ts +359 -311
  129. package/src/models/errors/updatephoneagent.ts +357 -312
  130. package/src/models/operations/createagent.ts +166 -119
  131. package/src/models/operations/createphonecall.ts +283 -238
  132. package/src/models/operations/createphonenumber.ts +118 -98
  133. package/src/models/operations/createwebcall.ts +13 -13
  134. package/src/models/operations/deleteagent.ts +94 -78
  135. package/src/models/operations/deletephonenumber.ts +94 -78
  136. package/src/models/operations/getagent.ts +104 -88
  137. package/src/models/operations/getcall.ts +101 -88
  138. package/src/models/operations/getphonenumber.ts +108 -88
  139. package/src/models/operations/listagents.ts +68 -60
  140. package/src/models/operations/listcalls.ts +238 -213
  141. package/src/models/operations/listphonenumbers.ts +72 -60
  142. package/src/models/operations/updateagent.ts +227 -163
  143. package/src/models/operations/updatephoneagent.ts +160 -132
  144. package/src/sdk/liveClient.ts +11 -7
  145. 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
- * 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;
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
- export type Inbound = {
21
- name: string;
22
- value: string;
23
- };
20
+ export type Inbound = {
21
+ name: string;
22
+ value: string;
23
+ };
24
24
 
25
- export const inboundSchema: z.ZodType<AgentPromptParams, z.ZodTypeDef, Inbound> = z
26
- .object({
27
- name: z.string(),
28
- value: z.string(),
29
- })
30
- .transform((v) => {
31
- return {
32
- name: v.name,
33
- value: v.value,
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
- export type Outbound = {
38
- name: string;
39
- value: string;
40
- };
41
+ export type Outbound = {
42
+ name: string;
43
+ value: string;
44
+ };
41
45
 
42
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, AgentPromptParams> = z
43
- .object({
44
- name: z.string(),
45
- value: z.string(),
46
- })
47
- .transform((v) => {
48
- return {
49
- name: v.name,
50
- value: v.value,
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
- Ongoing = "ongoing",
14
- Ended = "ended",
15
- Error = "error",
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
- InboundPhoneCall = "inbound_phone_call",
23
- OutboundPhoneCall = "outbound_phone_call",
24
- WebCall = "web_call",
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
- * 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;
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
- 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
- };
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
- 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 ? null : { endTimestamp: v.end_timestamp }),
111
- ...(v.phone_number === undefined ? null : { phoneNumber: v.phone_number }),
112
- ...(v.recording_url === undefined ? null : { recordingUrl: v.recording_url }),
113
- startTimestamp: v.start_timestamp,
114
- ...(v.transcript === undefined ? null : { transcript: v.transcript }),
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
- export type Outbound = {
119
- agent_id: string;
120
- agent_prompt_params?: Array<AgentPromptParams$.Outbound> | undefined;
121
- call_id: string;
122
- call_status: CallStatus;
123
- call_type: CallType;
124
- end_timestamp?: number | undefined;
125
- phone_number?: CallPhoneNumber$.Outbound | undefined;
126
- recording_url?: string | undefined;
127
- start_timestamp: number;
128
- transcript?: string | undefined;
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
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CallDetail> = z
132
- .object({
133
- agentId: z.string(),
134
- agentPromptParams: z.array(AgentPromptParams$.outboundSchema).optional(),
135
- callId: z.string(),
136
- callStatus: CallStatus$,
137
- callType: CallType$,
138
- endTimestamp: z.number().int().optional(),
139
- phoneNumber: CallPhoneNumber$.outboundSchema.optional(),
140
- recordingUrl: z.string().optional(),
141
- startTimestamp: z.number().int(),
142
- transcript: z.string().optional(),
143
- })
144
- .transform((v) => {
145
- return {
146
- agent_id: v.agentId,
147
- ...(v.agentPromptParams === undefined
148
- ? null
149
- : { agent_prompt_params: v.agentPromptParams }),
150
- call_id: v.callId,
151
- call_status: v.callStatus,
152
- call_type: v.callType,
153
- ...(v.endTimestamp === undefined ? null : { end_timestamp: v.endTimestamp }),
154
- ...(v.phoneNumber === undefined ? null : { phone_number: v.phoneNumber }),
155
- ...(v.recordingUrl === undefined ? null : { recording_url: v.recordingUrl }),
156
- start_timestamp: v.startTimestamp,
157
- ...(v.transcript === undefined ? null : { transcript: v.transcript }),
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
- * Caller phone number in E.164 format.
13
- */
14
- from: string;
15
- /**
16
- * Callee phone number in E.164 format.
17
- */
18
- to: string;
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
- export type Inbound = {
24
- from: string;
25
- to: string;
26
- };
23
+ export type Inbound = {
24
+ from: string;
25
+ to: string;
26
+ };
27
27
 
28
- export const inboundSchema: z.ZodType<CallPhoneNumber, z.ZodTypeDef, Inbound> = z
29
- .object({
30
- from: z.string(),
31
- to: z.string(),
32
- })
33
- .transform((v) => {
34
- return {
35
- from: v.from,
36
- to: v.to,
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
- export type Outbound = {
41
- from: string;
42
- to: string;
43
- };
44
+ export type Outbound = {
45
+ from: string;
46
+ to: string;
47
+ };
44
48
 
45
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, CallPhoneNumber> = z
46
- .object({
47
- from: z.string(),
48
- to: z.string(),
49
- })
50
- .transform((v) => {
51
- return {
52
- from: v.from,
53
- to: v.to,
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
- * 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;
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
- 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
- };
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
- 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
- });
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
- 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
- };
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
- export const outboundSchema: z.ZodType<Outbound, z.ZodTypeDef, PhoneNumber> = z
67
- .object({
68
- agentId: z.string(),
69
- areaCode: z.number().int(),
70
- lastModificationTimestamp: z.number().int(),
71
- phoneNumber: z.string(),
72
- phoneNumberPretty: z.string(),
73
- })
74
- .transform((v) => {
75
- return {
76
- agent_id: v.agentId,
77
- area_code: v.areaCode,
78
- last_modification_timestamp: v.lastModificationTimestamp,
79
- phone_number: v.phoneNumber,
80
- phone_number_pretty: v.phoneNumberPretty,
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
  }
@@ -3,5 +3,5 @@
3
3
  */
4
4
 
5
5
  export type Security = {
6
- apiKey?: string | undefined;
6
+ apiKey?: string | undefined;
7
7
  };