@l7mp/tivadar-ai-api-sdk 0.2.14 → 0.2.16

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 (86) hide show
  1. package/dist/api-client.d.ts +20 -1
  2. package/dist/api-client.js +13 -0
  3. package/dist/apis/AdminPhoneNumbersApi.d.ts +80 -1
  4. package/dist/apis/AdminPhoneNumbersApi.js +245 -1
  5. package/dist/apis/OutboundCallsApi.d.ts +32 -0
  6. package/dist/apis/OutboundCallsApi.js +77 -0
  7. package/dist/apis/SIPApi.d.ts +34 -1
  8. package/dist/apis/SIPApi.js +89 -1
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/api-client.d.ts +20 -1
  12. package/dist/esm/api-client.js +13 -0
  13. package/dist/esm/apis/AdminPhoneNumbersApi.d.ts +80 -1
  14. package/dist/esm/apis/AdminPhoneNumbersApi.js +245 -1
  15. package/dist/esm/apis/OutboundCallsApi.d.ts +32 -0
  16. package/dist/esm/apis/OutboundCallsApi.js +73 -0
  17. package/dist/esm/apis/SIPApi.d.ts +34 -1
  18. package/dist/esm/apis/SIPApi.js +89 -1
  19. package/dist/esm/apis/index.d.ts +1 -0
  20. package/dist/esm/apis/index.js +1 -0
  21. package/dist/esm/models/AdminPhoneNumberAssignOutbound.d.ts +32 -0
  22. package/dist/esm/models/AdminPhoneNumberAssignOutbound.js +43 -0
  23. package/dist/esm/models/AdminPhoneNumberDetail.d.ts +30 -0
  24. package/dist/esm/models/AdminPhoneNumberDetail.js +10 -0
  25. package/dist/esm/models/AdminPhoneNumberUpdate.d.ts +18 -0
  26. package/dist/esm/models/AdminPhoneNumberUpdate.js +6 -0
  27. package/dist/esm/models/OutboundCall.d.ts +68 -0
  28. package/dist/esm/models/OutboundCall.js +53 -0
  29. package/dist/esm/models/OutboundCallRequest.d.ts +44 -0
  30. package/dist/esm/models/OutboundCallRequest.js +47 -0
  31. package/dist/esm/models/PhoneNumber.d.ts +18 -0
  32. package/dist/esm/models/PhoneNumber.js +6 -0
  33. package/dist/esm/models/PhoneNumberCreate.d.ts +24 -0
  34. package/dist/esm/models/PhoneNumberCreate.js +8 -0
  35. package/dist/esm/models/PhoneNumberOrder.d.ts +101 -0
  36. package/dist/esm/models/PhoneNumberOrder.js +69 -0
  37. package/dist/esm/models/PhoneNumberOrderDetail.d.ts +119 -0
  38. package/dist/esm/models/PhoneNumberOrderDetail.js +75 -0
  39. package/dist/esm/models/PhoneNumberOrdersListResponse.d.ts +39 -0
  40. package/dist/esm/models/PhoneNumberOrdersListResponse.js +44 -0
  41. package/dist/esm/models/ProcessOrdersResult.d.ts +38 -0
  42. package/dist/esm/models/ProcessOrdersResult.js +43 -0
  43. package/dist/esm/models/index.d.ts +7 -0
  44. package/dist/esm/models/index.js +7 -0
  45. package/dist/models/AdminPhoneNumberAssignOutbound.d.ts +32 -0
  46. package/dist/models/AdminPhoneNumberAssignOutbound.js +50 -0
  47. package/dist/models/AdminPhoneNumberDetail.d.ts +30 -0
  48. package/dist/models/AdminPhoneNumberDetail.js +10 -0
  49. package/dist/models/AdminPhoneNumberUpdate.d.ts +18 -0
  50. package/dist/models/AdminPhoneNumberUpdate.js +6 -0
  51. package/dist/models/OutboundCall.d.ts +68 -0
  52. package/dist/models/OutboundCall.js +60 -0
  53. package/dist/models/OutboundCallRequest.d.ts +44 -0
  54. package/dist/models/OutboundCallRequest.js +54 -0
  55. package/dist/models/PhoneNumber.d.ts +18 -0
  56. package/dist/models/PhoneNumber.js +6 -0
  57. package/dist/models/PhoneNumberCreate.d.ts +24 -0
  58. package/dist/models/PhoneNumberCreate.js +8 -0
  59. package/dist/models/PhoneNumberOrder.d.ts +101 -0
  60. package/dist/models/PhoneNumberOrder.js +77 -0
  61. package/dist/models/PhoneNumberOrderDetail.d.ts +119 -0
  62. package/dist/models/PhoneNumberOrderDetail.js +83 -0
  63. package/dist/models/PhoneNumberOrdersListResponse.d.ts +39 -0
  64. package/dist/models/PhoneNumberOrdersListResponse.js +51 -0
  65. package/dist/models/ProcessOrdersResult.d.ts +38 -0
  66. package/dist/models/ProcessOrdersResult.js +50 -0
  67. package/dist/models/index.d.ts +7 -0
  68. package/dist/models/index.js +7 -0
  69. package/package.json +1 -1
  70. package/src/api-client.ts +28 -0
  71. package/src/apis/AdminPhoneNumbersApi.ts +332 -0
  72. package/src/apis/OutboundCallsApi.ts +95 -0
  73. package/src/apis/SIPApi.ts +124 -0
  74. package/src/apis/index.ts +1 -0
  75. package/src/models/AdminPhoneNumberAssignOutbound.ts +66 -0
  76. package/src/models/AdminPhoneNumberDetail.ts +40 -0
  77. package/src/models/AdminPhoneNumberUpdate.ts +24 -0
  78. package/src/models/OutboundCall.ts +113 -0
  79. package/src/models/OutboundCallRequest.ts +82 -0
  80. package/src/models/PhoneNumber.ts +24 -0
  81. package/src/models/PhoneNumberCreate.ts +32 -0
  82. package/src/models/PhoneNumberOrder.ts +157 -0
  83. package/src/models/PhoneNumberOrderDetail.ts +181 -0
  84. package/src/models/PhoneNumberOrdersListResponse.ts +81 -0
  85. package/src/models/ProcessOrdersResult.ts +73 -0
  86. package/src/models/index.ts +7 -0
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { AdminPhoneNumberAssignToJSON, AdminPhoneNumberDetailFromJSON, AdminPhoneNumberUpdateToJSON, AdminPhoneNumbersListResponseFromJSON, PhoneNumberFromJSON, PhoneNumberCreateToJSON, } from '../models/index';
24
+ import { AdminPhoneNumberAssignToJSON, AdminPhoneNumberAssignOutboundToJSON, AdminPhoneNumberDetailFromJSON, AdminPhoneNumberUpdateToJSON, AdminPhoneNumbersListResponseFromJSON, PhoneNumberFromJSON, PhoneNumberCreateToJSON, PhoneNumberOrderFromJSON, PhoneNumberOrdersListResponseFromJSON, ProcessOrdersResultFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -77,6 +77,205 @@ export class AdminPhoneNumbersApi extends runtime.BaseAPI {
77
77
  return yield response.value();
78
78
  });
79
79
  }
80
+ /**
81
+ * List the phone-number backorder queue (app-admin only)
82
+ */
83
+ adminPhoneNumbersOrdersGetRaw(requestParameters, initOverrides) {
84
+ return __awaiter(this, void 0, void 0, function* () {
85
+ const queryParameters = {};
86
+ if (requestParameters['status'] != null) {
87
+ queryParameters['status'] = requestParameters['status'];
88
+ }
89
+ if (requestParameters['organizationId'] != null) {
90
+ queryParameters['organization_id'] = requestParameters['organizationId'];
91
+ }
92
+ if (requestParameters['requiresCallRedirect'] != null) {
93
+ queryParameters['requires_call_redirect'] = requestParameters['requiresCallRedirect'];
94
+ }
95
+ if (requestParameters['limit'] != null) {
96
+ queryParameters['limit'] = requestParameters['limit'];
97
+ }
98
+ if (requestParameters['offset'] != null) {
99
+ queryParameters['offset'] = requestParameters['offset'];
100
+ }
101
+ const headerParameters = {};
102
+ if (this.configuration && this.configuration.accessToken) {
103
+ const token = this.configuration.accessToken;
104
+ const tokenString = yield token("bearerAuth", []);
105
+ if (tokenString) {
106
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
107
+ }
108
+ }
109
+ let urlPath = `/admin/phone-numbers/orders`;
110
+ const response = yield this.request({
111
+ path: urlPath,
112
+ method: 'GET',
113
+ headers: headerParameters,
114
+ query: queryParameters,
115
+ }, initOverrides);
116
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhoneNumberOrdersListResponseFromJSON(jsonValue));
117
+ });
118
+ }
119
+ /**
120
+ * List the phone-number backorder queue (app-admin only)
121
+ */
122
+ adminPhoneNumbersOrdersGet() {
123
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
124
+ const response = yield this.adminPhoneNumbersOrdersGetRaw(requestParameters, initOverrides);
125
+ return yield response.value();
126
+ });
127
+ }
128
+ /**
129
+ * Cancel a pending order (app-admin only)
130
+ */
131
+ adminPhoneNumbersOrdersOrderIdCancelPostRaw(requestParameters, initOverrides) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ if (requestParameters['orderId'] == null) {
134
+ throw new runtime.RequiredError('orderId', 'Required parameter "orderId" was null or undefined when calling adminPhoneNumbersOrdersOrderIdCancelPost().');
135
+ }
136
+ const queryParameters = {};
137
+ const headerParameters = {};
138
+ if (this.configuration && this.configuration.accessToken) {
139
+ const token = this.configuration.accessToken;
140
+ const tokenString = yield token("bearerAuth", []);
141
+ if (tokenString) {
142
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
143
+ }
144
+ }
145
+ let urlPath = `/admin/phone-numbers/orders/{orderId}/cancel`;
146
+ urlPath = urlPath.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters['orderId'])));
147
+ const response = yield this.request({
148
+ path: urlPath,
149
+ method: 'POST',
150
+ headers: headerParameters,
151
+ query: queryParameters,
152
+ }, initOverrides);
153
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhoneNumberOrderFromJSON(jsonValue));
154
+ });
155
+ }
156
+ /**
157
+ * Cancel a pending order (app-admin only)
158
+ */
159
+ adminPhoneNumbersOrdersOrderIdCancelPost(requestParameters, initOverrides) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const response = yield this.adminPhoneNumbersOrdersOrderIdCancelPostRaw(requestParameters, initOverrides);
162
+ return yield response.value();
163
+ });
164
+ }
165
+ /**
166
+ * Attempt to fulfill a specific pending order now (app-admin only)
167
+ */
168
+ adminPhoneNumbersOrdersOrderIdFulfillPostRaw(requestParameters, initOverrides) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ if (requestParameters['orderId'] == null) {
171
+ throw new runtime.RequiredError('orderId', 'Required parameter "orderId" was null or undefined when calling adminPhoneNumbersOrdersOrderIdFulfillPost().');
172
+ }
173
+ const queryParameters = {};
174
+ const headerParameters = {};
175
+ if (this.configuration && this.configuration.accessToken) {
176
+ const token = this.configuration.accessToken;
177
+ const tokenString = yield token("bearerAuth", []);
178
+ if (tokenString) {
179
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
180
+ }
181
+ }
182
+ let urlPath = `/admin/phone-numbers/orders/{orderId}/fulfill`;
183
+ urlPath = urlPath.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters['orderId'])));
184
+ const response = yield this.request({
185
+ path: urlPath,
186
+ method: 'POST',
187
+ headers: headerParameters,
188
+ query: queryParameters,
189
+ }, initOverrides);
190
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhoneNumberOrderFromJSON(jsonValue));
191
+ });
192
+ }
193
+ /**
194
+ * Attempt to fulfill a specific pending order now (app-admin only)
195
+ */
196
+ adminPhoneNumbersOrdersOrderIdFulfillPost(requestParameters, initOverrides) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ const response = yield this.adminPhoneNumbersOrdersOrderIdFulfillPostRaw(requestParameters, initOverrides);
199
+ return yield response.value();
200
+ });
201
+ }
202
+ /**
203
+ * Run the backorder fulfillment queue on demand (app-admin only)
204
+ */
205
+ adminPhoneNumbersOrdersProcessPostRaw(initOverrides) {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ const queryParameters = {};
208
+ const headerParameters = {};
209
+ if (this.configuration && this.configuration.accessToken) {
210
+ const token = this.configuration.accessToken;
211
+ const tokenString = yield token("bearerAuth", []);
212
+ if (tokenString) {
213
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
214
+ }
215
+ }
216
+ let urlPath = `/admin/phone-numbers/orders/process`;
217
+ const response = yield this.request({
218
+ path: urlPath,
219
+ method: 'POST',
220
+ headers: headerParameters,
221
+ query: queryParameters,
222
+ }, initOverrides);
223
+ return new runtime.JSONApiResponse(response, (jsonValue) => ProcessOrdersResultFromJSON(jsonValue));
224
+ });
225
+ }
226
+ /**
227
+ * Run the backorder fulfillment queue on demand (app-admin only)
228
+ */
229
+ adminPhoneNumbersOrdersProcessPost(initOverrides) {
230
+ return __awaiter(this, void 0, void 0, function* () {
231
+ const response = yield this.adminPhoneNumbersOrdersProcessPostRaw(initOverrides);
232
+ return yield response.value();
233
+ });
234
+ }
235
+ /**
236
+ * Grants the organization ownership of an outbound number (no inbound trunk). The org can then place outbound calls using it as caller-ID.
237
+ * Assign an outbound-capable number to an organization (app-admin only)
238
+ */
239
+ adminPhoneNumbersPhoneNumberIdAssignOutboundPostRaw(requestParameters, initOverrides) {
240
+ return __awaiter(this, void 0, void 0, function* () {
241
+ if (requestParameters['phoneNumberId'] == null) {
242
+ throw new runtime.RequiredError('phoneNumberId', 'Required parameter "phoneNumberId" was null or undefined when calling adminPhoneNumbersPhoneNumberIdAssignOutboundPost().');
243
+ }
244
+ if (requestParameters['adminPhoneNumberAssignOutbound'] == null) {
245
+ throw new runtime.RequiredError('adminPhoneNumberAssignOutbound', 'Required parameter "adminPhoneNumberAssignOutbound" was null or undefined when calling adminPhoneNumbersPhoneNumberIdAssignOutboundPost().');
246
+ }
247
+ const queryParameters = {};
248
+ const headerParameters = {};
249
+ headerParameters['Content-Type'] = 'application/json';
250
+ if (this.configuration && this.configuration.accessToken) {
251
+ const token = this.configuration.accessToken;
252
+ const tokenString = yield token("bearerAuth", []);
253
+ if (tokenString) {
254
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
255
+ }
256
+ }
257
+ let urlPath = `/admin/phone-numbers/{phoneNumberId}/assign-outbound`;
258
+ urlPath = urlPath.replace(`{${"phoneNumberId"}}`, encodeURIComponent(String(requestParameters['phoneNumberId'])));
259
+ const response = yield this.request({
260
+ path: urlPath,
261
+ method: 'POST',
262
+ headers: headerParameters,
263
+ query: queryParameters,
264
+ body: AdminPhoneNumberAssignOutboundToJSON(requestParameters['adminPhoneNumberAssignOutbound']),
265
+ }, initOverrides);
266
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminPhoneNumberDetailFromJSON(jsonValue));
267
+ });
268
+ }
269
+ /**
270
+ * Grants the organization ownership of an outbound number (no inbound trunk). The org can then place outbound calls using it as caller-ID.
271
+ * Assign an outbound-capable number to an organization (app-admin only)
272
+ */
273
+ adminPhoneNumbersPhoneNumberIdAssignOutboundPost(requestParameters, initOverrides) {
274
+ return __awaiter(this, void 0, void 0, function* () {
275
+ const response = yield this.adminPhoneNumbersPhoneNumberIdAssignOutboundPostRaw(requestParameters, initOverrides);
276
+ return yield response.value();
277
+ });
278
+ }
80
279
  /**
81
280
  * Creates a SIP trunk (and, if an agent is given, a dispatch rule) and links the number.
82
281
  * Assign a phone number to an organization (app-admin only)
@@ -238,6 +437,43 @@ export class AdminPhoneNumbersApi extends runtime.BaseAPI {
238
437
  return yield response.value();
239
438
  });
240
439
  }
440
+ /**
441
+ * Release an outbound number\'s organization ownership (app-admin only)
442
+ */
443
+ adminPhoneNumbersPhoneNumberIdUnassignOutboundPostRaw(requestParameters, initOverrides) {
444
+ return __awaiter(this, void 0, void 0, function* () {
445
+ if (requestParameters['phoneNumberId'] == null) {
446
+ throw new runtime.RequiredError('phoneNumberId', 'Required parameter "phoneNumberId" was null or undefined when calling adminPhoneNumbersPhoneNumberIdUnassignOutboundPost().');
447
+ }
448
+ const queryParameters = {};
449
+ const headerParameters = {};
450
+ if (this.configuration && this.configuration.accessToken) {
451
+ const token = this.configuration.accessToken;
452
+ const tokenString = yield token("bearerAuth", []);
453
+ if (tokenString) {
454
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
455
+ }
456
+ }
457
+ let urlPath = `/admin/phone-numbers/{phoneNumberId}/unassign-outbound`;
458
+ urlPath = urlPath.replace(`{${"phoneNumberId"}}`, encodeURIComponent(String(requestParameters['phoneNumberId'])));
459
+ const response = yield this.request({
460
+ path: urlPath,
461
+ method: 'POST',
462
+ headers: headerParameters,
463
+ query: queryParameters,
464
+ }, initOverrides);
465
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminPhoneNumberDetailFromJSON(jsonValue));
466
+ });
467
+ }
468
+ /**
469
+ * Release an outbound number\'s organization ownership (app-admin only)
470
+ */
471
+ adminPhoneNumbersPhoneNumberIdUnassignOutboundPost(requestParameters, initOverrides) {
472
+ return __awaiter(this, void 0, void 0, function* () {
473
+ const response = yield this.adminPhoneNumbersPhoneNumberIdUnassignOutboundPostRaw(requestParameters, initOverrides);
474
+ return yield response.value();
475
+ });
476
+ }
241
477
  /**
242
478
  * Deletes the LiveKit dispatch rule + trunk and frees the number back to the pool.
243
479
  * Release a phone number from its organization (app-admin only)
@@ -323,3 +559,11 @@ export const AdminPhoneNumbersGetStatusEnum = {
323
559
  Available: 'available',
324
560
  Assigned: 'assigned'
325
561
  };
562
+ /**
563
+ * @export
564
+ */
565
+ export const AdminPhoneNumbersOrdersGetStatusEnum = {
566
+ Pending: 'pending',
567
+ Active: 'active',
568
+ Canceled: 'canceled'
569
+ };
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Tivadar AI Backend API
3
+ * Unified REST API for Tivadar AI Voice Agents platform
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { OutboundCall, OutboundCallRequest } from '../models/index';
14
+ export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
15
+ organizationId: string;
16
+ outboundCallRequest: OutboundCallRequest;
17
+ }
18
+ /**
19
+ *
20
+ */
21
+ export declare class OutboundCallsApi extends runtime.BaseAPI {
22
+ /**
23
+ * Dials a destination (a phonebook entry or a custom number) using one of the organization\'s voice agents. The caller-ID (From) is the org\'s assigned outbound-capable number. Requires the `outbound_calls` feature (business + enterprise plans).
24
+ * Place an outbound call with a voice agent
25
+ */
26
+ organizationsOrganizationIdOutboundCallsPostRaw(requestParameters: OrganizationsOrganizationIdOutboundCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OutboundCall>>;
27
+ /**
28
+ * Dials a destination (a phonebook entry or a custom number) using one of the organization\'s voice agents. The caller-ID (From) is the org\'s assigned outbound-capable number. Requires the `outbound_calls` feature (business + enterprise plans).
29
+ * Place an outbound call with a voice agent
30
+ */
31
+ organizationsOrganizationIdOutboundCallsPost(requestParameters: OrganizationsOrganizationIdOutboundCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OutboundCall>;
32
+ }
@@ -0,0 +1,73 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Tivadar AI Backend API
5
+ * Unified REST API for Tivadar AI Voice Agents platform
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { OutboundCallFromJSON, OutboundCallRequestToJSON, } from '../models/index';
25
+ /**
26
+ *
27
+ */
28
+ export class OutboundCallsApi extends runtime.BaseAPI {
29
+ /**
30
+ * Dials a destination (a phonebook entry or a custom number) using one of the organization\'s voice agents. The caller-ID (From) is the org\'s assigned outbound-capable number. Requires the `outbound_calls` feature (business + enterprise plans).
31
+ * Place an outbound call with a voice agent
32
+ */
33
+ organizationsOrganizationIdOutboundCallsPostRaw(requestParameters, initOverrides) {
34
+ return __awaiter(this, void 0, void 0, function* () {
35
+ if (requestParameters['organizationId'] == null) {
36
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdOutboundCallsPost().');
37
+ }
38
+ if (requestParameters['outboundCallRequest'] == null) {
39
+ throw new runtime.RequiredError('outboundCallRequest', 'Required parameter "outboundCallRequest" was null or undefined when calling organizationsOrganizationIdOutboundCallsPost().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ headerParameters['Content-Type'] = 'application/json';
44
+ if (this.configuration && this.configuration.accessToken) {
45
+ const token = this.configuration.accessToken;
46
+ const tokenString = yield token("bearerAuth", []);
47
+ if (tokenString) {
48
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
49
+ }
50
+ }
51
+ let urlPath = `/organizations/{organizationId}/outbound-calls`;
52
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
53
+ const response = yield this.request({
54
+ path: urlPath,
55
+ method: 'POST',
56
+ headers: headerParameters,
57
+ query: queryParameters,
58
+ body: OutboundCallRequestToJSON(requestParameters['outboundCallRequest']),
59
+ }, initOverrides);
60
+ return new runtime.JSONApiResponse(response, (jsonValue) => OutboundCallFromJSON(jsonValue));
61
+ });
62
+ }
63
+ /**
64
+ * Dials a destination (a phonebook entry or a custom number) using one of the organization\'s voice agents. The caller-ID (From) is the org\'s assigned outbound-capable number. Requires the `outbound_calls` feature (business + enterprise plans).
65
+ * Place an outbound call with a voice agent
66
+ */
67
+ organizationsOrganizationIdOutboundCallsPost(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const response = yield this.organizationsOrganizationIdOutboundCallsPostRaw(requestParameters, initOverrides);
70
+ return yield response.value();
71
+ });
72
+ }
73
+ }
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { DispatchRuleCreate, OrganizationsOrganizationIdSipDispatchRulesPost200Response, PhoneNumber, PhoneNumberCreate, SipTrunkCreate, SipTrunkWithAgent } from '../models/index';
13
+ import type { DispatchRuleCreate, OrganizationsOrganizationIdSipDispatchRulesPost200Response, PhoneNumber, PhoneNumberCreate, PhoneNumberOrder, SipTrunkCreate, SipTrunkWithAgent } from '../models/index';
14
14
  export interface OrganizationsOrganizationIdSipDispatchRulesDispatchIdDeleteRequest {
15
15
  organizationId: string;
16
16
  dispatchId: string;
@@ -22,6 +22,14 @@ export interface OrganizationsOrganizationIdSipDispatchRulesPostRequest {
22
22
  export interface OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest {
23
23
  organizationId: string;
24
24
  }
25
+ export interface OrganizationsOrganizationIdSipPhoneNumbersOrdersGetRequest {
26
+ organizationId: string;
27
+ status?: OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum;
28
+ }
29
+ export interface OrganizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRequest {
30
+ organizationId: string;
31
+ orderId: string;
32
+ }
25
33
  export interface OrganizationsOrganizationIdSipTrunksGetRequest {
26
34
  organizationId: string;
27
35
  }
@@ -72,6 +80,22 @@ export declare class SIPApi extends runtime.BaseAPI {
72
80
  * Assign an available phone number to the organization
73
81
  */
74
82
  organizationsOrganizationIdSipPhoneNumbersAssignPost(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<SipTrunkWithAgent>;
83
+ /**
84
+ * List this organization\'s phone-number backorders
85
+ */
86
+ organizationsOrganizationIdSipPhoneNumbersOrdersGetRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PhoneNumberOrder>>>;
87
+ /**
88
+ * List this organization\'s phone-number backorders
89
+ */
90
+ organizationsOrganizationIdSipPhoneNumbersOrdersGet(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PhoneNumberOrder>>;
91
+ /**
92
+ * Cancel a pending phone-number backorder
93
+ */
94
+ organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
95
+ /**
96
+ * Cancel a pending phone-number backorder
97
+ */
98
+ organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDelete(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
75
99
  /**
76
100
  * List all SIP trunks for an organization
77
101
  */
@@ -121,3 +145,12 @@ export declare class SIPApi extends runtime.BaseAPI {
121
145
  */
122
146
  phoneNumbersPost(requestParameters: PhoneNumbersPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneNumber>;
123
147
  }
148
+ /**
149
+ * @export
150
+ */
151
+ export declare const OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum: {
152
+ readonly Pending: "pending";
153
+ readonly Active: "active";
154
+ readonly Canceled: "canceled";
155
+ };
156
+ export type OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum = typeof OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum[keyof typeof OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum];
@@ -21,7 +21,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { DispatchRuleCreateToJSON, OrganizationsOrganizationIdSipDispatchRulesPost200ResponseFromJSON, PhoneNumberFromJSON, PhoneNumberCreateToJSON, SipTrunkCreateToJSON, SipTrunkWithAgentFromJSON, } from '../models/index';
24
+ import { DispatchRuleCreateToJSON, OrganizationsOrganizationIdSipDispatchRulesPost200ResponseFromJSON, PhoneNumberFromJSON, PhoneNumberCreateToJSON, PhoneNumberOrderFromJSON, SipTrunkCreateToJSON, SipTrunkWithAgentFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
@@ -147,6 +147,86 @@ export class SIPApi extends runtime.BaseAPI {
147
147
  return yield response.value();
148
148
  });
149
149
  }
150
+ /**
151
+ * List this organization\'s phone-number backorders
152
+ */
153
+ organizationsOrganizationIdSipPhoneNumbersOrdersGetRaw(requestParameters, initOverrides) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ if (requestParameters['organizationId'] == null) {
156
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersOrdersGet().');
157
+ }
158
+ const queryParameters = {};
159
+ if (requestParameters['status'] != null) {
160
+ queryParameters['status'] = requestParameters['status'];
161
+ }
162
+ const headerParameters = {};
163
+ if (this.configuration && this.configuration.accessToken) {
164
+ const token = this.configuration.accessToken;
165
+ const tokenString = yield token("bearerAuth", []);
166
+ if (tokenString) {
167
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
168
+ }
169
+ }
170
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/orders`;
171
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
172
+ const response = yield this.request({
173
+ path: urlPath,
174
+ method: 'GET',
175
+ headers: headerParameters,
176
+ query: queryParameters,
177
+ }, initOverrides);
178
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PhoneNumberOrderFromJSON));
179
+ });
180
+ }
181
+ /**
182
+ * List this organization\'s phone-number backorders
183
+ */
184
+ organizationsOrganizationIdSipPhoneNumbersOrdersGet(requestParameters, initOverrides) {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ const response = yield this.organizationsOrganizationIdSipPhoneNumbersOrdersGetRaw(requestParameters, initOverrides);
187
+ return yield response.value();
188
+ });
189
+ }
190
+ /**
191
+ * Cancel a pending phone-number backorder
192
+ */
193
+ organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRaw(requestParameters, initOverrides) {
194
+ return __awaiter(this, void 0, void 0, function* () {
195
+ if (requestParameters['organizationId'] == null) {
196
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDelete().');
197
+ }
198
+ if (requestParameters['orderId'] == null) {
199
+ throw new runtime.RequiredError('orderId', 'Required parameter "orderId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDelete().');
200
+ }
201
+ const queryParameters = {};
202
+ const headerParameters = {};
203
+ if (this.configuration && this.configuration.accessToken) {
204
+ const token = this.configuration.accessToken;
205
+ const tokenString = yield token("bearerAuth", []);
206
+ if (tokenString) {
207
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
208
+ }
209
+ }
210
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/orders/{orderId}`;
211
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
212
+ urlPath = urlPath.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters['orderId'])));
213
+ const response = yield this.request({
214
+ path: urlPath,
215
+ method: 'DELETE',
216
+ headers: headerParameters,
217
+ query: queryParameters,
218
+ }, initOverrides);
219
+ return new runtime.VoidApiResponse(response);
220
+ });
221
+ }
222
+ /**
223
+ * Cancel a pending phone-number backorder
224
+ */
225
+ organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDelete(requestParameters, initOverrides) {
226
+ return __awaiter(this, void 0, void 0, function* () {
227
+ yield this.organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRaw(requestParameters, initOverrides);
228
+ });
229
+ }
150
230
  /**
151
231
  * List all SIP trunks for an organization
152
232
  */
@@ -377,3 +457,11 @@ export class SIPApi extends runtime.BaseAPI {
377
457
  });
378
458
  }
379
459
  }
460
+ /**
461
+ * @export
462
+ */
463
+ export const OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum = {
464
+ Pending: 'pending',
465
+ Active: 'active',
466
+ Canceled: 'canceled'
467
+ };
@@ -12,6 +12,7 @@ export * from './LLMProvidersApi';
12
12
  export * from './MembersApi';
13
13
  export * from './NotificationsApi';
14
14
  export * from './OrganizationsApi';
15
+ export * from './OutboundCallsApi';
15
16
  export * from './PhonebookApi';
16
17
  export * from './PlaygroundApi';
17
18
  export * from './ProfileApi';
@@ -14,6 +14,7 @@ export * from './LLMProvidersApi';
14
14
  export * from './MembersApi';
15
15
  export * from './NotificationsApi';
16
16
  export * from './OrganizationsApi';
17
+ export * from './OutboundCallsApi';
17
18
  export * from './PhonebookApi';
18
19
  export * from './PlaygroundApi';
19
20
  export * from './ProfileApi';
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Tivadar AI Backend API
3
+ * Unified REST API for Tivadar AI Voice Agents platform
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AdminPhoneNumberAssignOutbound
16
+ */
17
+ export interface AdminPhoneNumberAssignOutbound {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof AdminPhoneNumberAssignOutbound
22
+ */
23
+ organization_id: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the AdminPhoneNumberAssignOutbound interface.
27
+ */
28
+ export declare function instanceOfAdminPhoneNumberAssignOutbound(value: object): value is AdminPhoneNumberAssignOutbound;
29
+ export declare function AdminPhoneNumberAssignOutboundFromJSON(json: any): AdminPhoneNumberAssignOutbound;
30
+ export declare function AdminPhoneNumberAssignOutboundFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminPhoneNumberAssignOutbound;
31
+ export declare function AdminPhoneNumberAssignOutboundToJSON(json: any): AdminPhoneNumberAssignOutbound;
32
+ export declare function AdminPhoneNumberAssignOutboundToJSONTyped(value?: AdminPhoneNumberAssignOutbound | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,43 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Tivadar AI Backend API
5
+ * Unified REST API for Tivadar AI Voice Agents platform
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ /**
15
+ * Check if a given object implements the AdminPhoneNumberAssignOutbound interface.
16
+ */
17
+ export function instanceOfAdminPhoneNumberAssignOutbound(value) {
18
+ if (!('organization_id' in value) || value['organization_id'] === undefined)
19
+ return false;
20
+ return true;
21
+ }
22
+ export function AdminPhoneNumberAssignOutboundFromJSON(json) {
23
+ return AdminPhoneNumberAssignOutboundFromJSONTyped(json, false);
24
+ }
25
+ export function AdminPhoneNumberAssignOutboundFromJSONTyped(json, ignoreDiscriminator) {
26
+ if (json == null) {
27
+ return json;
28
+ }
29
+ return {
30
+ 'organization_id': json['organization_id'],
31
+ };
32
+ }
33
+ export function AdminPhoneNumberAssignOutboundToJSON(json) {
34
+ return AdminPhoneNumberAssignOutboundToJSONTyped(json, false);
35
+ }
36
+ export function AdminPhoneNumberAssignOutboundToJSONTyped(value, ignoreDiscriminator = false) {
37
+ if (value == null) {
38
+ return value;
39
+ }
40
+ return {
41
+ 'organization_id': value['organization_id'],
42
+ };
43
+ }