@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
@@ -16,15 +16,21 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  AdminPhoneNumberAssign,
19
+ AdminPhoneNumberAssignOutbound,
19
20
  AdminPhoneNumberDetail,
20
21
  AdminPhoneNumberUpdate,
21
22
  AdminPhoneNumbersListResponse,
22
23
  PhoneNumber,
23
24
  PhoneNumberCreate,
25
+ PhoneNumberOrder,
26
+ PhoneNumberOrdersListResponse,
27
+ ProcessOrdersResult,
24
28
  } from '../models/index';
25
29
  import {
26
30
  AdminPhoneNumberAssignFromJSON,
27
31
  AdminPhoneNumberAssignToJSON,
32
+ AdminPhoneNumberAssignOutboundFromJSON,
33
+ AdminPhoneNumberAssignOutboundToJSON,
28
34
  AdminPhoneNumberDetailFromJSON,
29
35
  AdminPhoneNumberDetailToJSON,
30
36
  AdminPhoneNumberUpdateFromJSON,
@@ -35,6 +41,12 @@ import {
35
41
  PhoneNumberToJSON,
36
42
  PhoneNumberCreateFromJSON,
37
43
  PhoneNumberCreateToJSON,
44
+ PhoneNumberOrderFromJSON,
45
+ PhoneNumberOrderToJSON,
46
+ PhoneNumberOrdersListResponseFromJSON,
47
+ PhoneNumberOrdersListResponseToJSON,
48
+ ProcessOrdersResultFromJSON,
49
+ ProcessOrdersResultToJSON,
38
50
  } from '../models/index';
39
51
 
40
52
  export interface AdminPhoneNumbersGetRequest {
@@ -46,6 +58,27 @@ export interface AdminPhoneNumbersGetRequest {
46
58
  offset?: number;
47
59
  }
48
60
 
61
+ export interface AdminPhoneNumbersOrdersGetRequest {
62
+ status?: AdminPhoneNumbersOrdersGetStatusEnum;
63
+ organizationId?: string;
64
+ requiresCallRedirect?: boolean;
65
+ limit?: number;
66
+ offset?: number;
67
+ }
68
+
69
+ export interface AdminPhoneNumbersOrdersOrderIdCancelPostRequest {
70
+ orderId: string;
71
+ }
72
+
73
+ export interface AdminPhoneNumbersOrdersOrderIdFulfillPostRequest {
74
+ orderId: string;
75
+ }
76
+
77
+ export interface AdminPhoneNumbersPhoneNumberIdAssignOutboundPostRequest {
78
+ phoneNumberId: number;
79
+ adminPhoneNumberAssignOutbound: AdminPhoneNumberAssignOutbound;
80
+ }
81
+
49
82
  export interface AdminPhoneNumbersPhoneNumberIdAssignPostRequest {
50
83
  phoneNumberId: number;
51
84
  adminPhoneNumberAssign: AdminPhoneNumberAssign;
@@ -64,6 +97,10 @@ export interface AdminPhoneNumbersPhoneNumberIdPatchRequest {
64
97
  adminPhoneNumberUpdate: AdminPhoneNumberUpdate;
65
98
  }
66
99
 
100
+ export interface AdminPhoneNumbersPhoneNumberIdUnassignOutboundPostRequest {
101
+ phoneNumberId: number;
102
+ }
103
+
67
104
  export interface AdminPhoneNumbersPhoneNumberIdUnassignPostRequest {
68
105
  phoneNumberId: number;
69
106
  }
@@ -138,6 +175,247 @@ export class AdminPhoneNumbersApi extends runtime.BaseAPI {
138
175
  return await response.value();
139
176
  }
140
177
 
178
+ /**
179
+ * List the phone-number backorder queue (app-admin only)
180
+ */
181
+ async adminPhoneNumbersOrdersGetRaw(requestParameters: AdminPhoneNumbersOrdersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneNumberOrdersListResponse>> {
182
+ const queryParameters: any = {};
183
+
184
+ if (requestParameters['status'] != null) {
185
+ queryParameters['status'] = requestParameters['status'];
186
+ }
187
+
188
+ if (requestParameters['organizationId'] != null) {
189
+ queryParameters['organization_id'] = requestParameters['organizationId'];
190
+ }
191
+
192
+ if (requestParameters['requiresCallRedirect'] != null) {
193
+ queryParameters['requires_call_redirect'] = requestParameters['requiresCallRedirect'];
194
+ }
195
+
196
+ if (requestParameters['limit'] != null) {
197
+ queryParameters['limit'] = requestParameters['limit'];
198
+ }
199
+
200
+ if (requestParameters['offset'] != null) {
201
+ queryParameters['offset'] = requestParameters['offset'];
202
+ }
203
+
204
+ const headerParameters: runtime.HTTPHeaders = {};
205
+
206
+ if (this.configuration && this.configuration.accessToken) {
207
+ const token = this.configuration.accessToken;
208
+ const tokenString = await token("bearerAuth", []);
209
+
210
+ if (tokenString) {
211
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
212
+ }
213
+ }
214
+
215
+ let urlPath = `/admin/phone-numbers/orders`;
216
+
217
+ const response = await this.request({
218
+ path: urlPath,
219
+ method: 'GET',
220
+ headers: headerParameters,
221
+ query: queryParameters,
222
+ }, initOverrides);
223
+
224
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhoneNumberOrdersListResponseFromJSON(jsonValue));
225
+ }
226
+
227
+ /**
228
+ * List the phone-number backorder queue (app-admin only)
229
+ */
230
+ async adminPhoneNumbersOrdersGet(requestParameters: AdminPhoneNumbersOrdersGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneNumberOrdersListResponse> {
231
+ const response = await this.adminPhoneNumbersOrdersGetRaw(requestParameters, initOverrides);
232
+ return await response.value();
233
+ }
234
+
235
+ /**
236
+ * Cancel a pending order (app-admin only)
237
+ */
238
+ async adminPhoneNumbersOrdersOrderIdCancelPostRaw(requestParameters: AdminPhoneNumbersOrdersOrderIdCancelPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneNumberOrder>> {
239
+ if (requestParameters['orderId'] == null) {
240
+ throw new runtime.RequiredError(
241
+ 'orderId',
242
+ 'Required parameter "orderId" was null or undefined when calling adminPhoneNumbersOrdersOrderIdCancelPost().'
243
+ );
244
+ }
245
+
246
+ const queryParameters: any = {};
247
+
248
+ const headerParameters: runtime.HTTPHeaders = {};
249
+
250
+ if (this.configuration && this.configuration.accessToken) {
251
+ const token = this.configuration.accessToken;
252
+ const tokenString = await token("bearerAuth", []);
253
+
254
+ if (tokenString) {
255
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
256
+ }
257
+ }
258
+
259
+ let urlPath = `/admin/phone-numbers/orders/{orderId}/cancel`;
260
+ urlPath = urlPath.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters['orderId'])));
261
+
262
+ const response = await this.request({
263
+ path: urlPath,
264
+ method: 'POST',
265
+ headers: headerParameters,
266
+ query: queryParameters,
267
+ }, initOverrides);
268
+
269
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhoneNumberOrderFromJSON(jsonValue));
270
+ }
271
+
272
+ /**
273
+ * Cancel a pending order (app-admin only)
274
+ */
275
+ async adminPhoneNumbersOrdersOrderIdCancelPost(requestParameters: AdminPhoneNumbersOrdersOrderIdCancelPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneNumberOrder> {
276
+ const response = await this.adminPhoneNumbersOrdersOrderIdCancelPostRaw(requestParameters, initOverrides);
277
+ return await response.value();
278
+ }
279
+
280
+ /**
281
+ * Attempt to fulfill a specific pending order now (app-admin only)
282
+ */
283
+ async adminPhoneNumbersOrdersOrderIdFulfillPostRaw(requestParameters: AdminPhoneNumbersOrdersOrderIdFulfillPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PhoneNumberOrder>> {
284
+ if (requestParameters['orderId'] == null) {
285
+ throw new runtime.RequiredError(
286
+ 'orderId',
287
+ 'Required parameter "orderId" was null or undefined when calling adminPhoneNumbersOrdersOrderIdFulfillPost().'
288
+ );
289
+ }
290
+
291
+ const queryParameters: any = {};
292
+
293
+ const headerParameters: runtime.HTTPHeaders = {};
294
+
295
+ if (this.configuration && this.configuration.accessToken) {
296
+ const token = this.configuration.accessToken;
297
+ const tokenString = await token("bearerAuth", []);
298
+
299
+ if (tokenString) {
300
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
301
+ }
302
+ }
303
+
304
+ let urlPath = `/admin/phone-numbers/orders/{orderId}/fulfill`;
305
+ urlPath = urlPath.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters['orderId'])));
306
+
307
+ const response = await this.request({
308
+ path: urlPath,
309
+ method: 'POST',
310
+ headers: headerParameters,
311
+ query: queryParameters,
312
+ }, initOverrides);
313
+
314
+ return new runtime.JSONApiResponse(response, (jsonValue) => PhoneNumberOrderFromJSON(jsonValue));
315
+ }
316
+
317
+ /**
318
+ * Attempt to fulfill a specific pending order now (app-admin only)
319
+ */
320
+ async adminPhoneNumbersOrdersOrderIdFulfillPost(requestParameters: AdminPhoneNumbersOrdersOrderIdFulfillPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PhoneNumberOrder> {
321
+ const response = await this.adminPhoneNumbersOrdersOrderIdFulfillPostRaw(requestParameters, initOverrides);
322
+ return await response.value();
323
+ }
324
+
325
+ /**
326
+ * Run the backorder fulfillment queue on demand (app-admin only)
327
+ */
328
+ async adminPhoneNumbersOrdersProcessPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ProcessOrdersResult>> {
329
+ const queryParameters: any = {};
330
+
331
+ const headerParameters: runtime.HTTPHeaders = {};
332
+
333
+ if (this.configuration && this.configuration.accessToken) {
334
+ const token = this.configuration.accessToken;
335
+ const tokenString = await token("bearerAuth", []);
336
+
337
+ if (tokenString) {
338
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
339
+ }
340
+ }
341
+
342
+ let urlPath = `/admin/phone-numbers/orders/process`;
343
+
344
+ const response = await this.request({
345
+ path: urlPath,
346
+ method: 'POST',
347
+ headers: headerParameters,
348
+ query: queryParameters,
349
+ }, initOverrides);
350
+
351
+ return new runtime.JSONApiResponse(response, (jsonValue) => ProcessOrdersResultFromJSON(jsonValue));
352
+ }
353
+
354
+ /**
355
+ * Run the backorder fulfillment queue on demand (app-admin only)
356
+ */
357
+ async adminPhoneNumbersOrdersProcessPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ProcessOrdersResult> {
358
+ const response = await this.adminPhoneNumbersOrdersProcessPostRaw(initOverrides);
359
+ return await response.value();
360
+ }
361
+
362
+ /**
363
+ * Grants the organization ownership of an outbound number (no inbound trunk). The org can then place outbound calls using it as caller-ID.
364
+ * Assign an outbound-capable number to an organization (app-admin only)
365
+ */
366
+ async adminPhoneNumbersPhoneNumberIdAssignOutboundPostRaw(requestParameters: AdminPhoneNumbersPhoneNumberIdAssignOutboundPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminPhoneNumberDetail>> {
367
+ if (requestParameters['phoneNumberId'] == null) {
368
+ throw new runtime.RequiredError(
369
+ 'phoneNumberId',
370
+ 'Required parameter "phoneNumberId" was null or undefined when calling adminPhoneNumbersPhoneNumberIdAssignOutboundPost().'
371
+ );
372
+ }
373
+
374
+ if (requestParameters['adminPhoneNumberAssignOutbound'] == null) {
375
+ throw new runtime.RequiredError(
376
+ 'adminPhoneNumberAssignOutbound',
377
+ 'Required parameter "adminPhoneNumberAssignOutbound" was null or undefined when calling adminPhoneNumbersPhoneNumberIdAssignOutboundPost().'
378
+ );
379
+ }
380
+
381
+ const queryParameters: any = {};
382
+
383
+ const headerParameters: runtime.HTTPHeaders = {};
384
+
385
+ headerParameters['Content-Type'] = 'application/json';
386
+
387
+ if (this.configuration && this.configuration.accessToken) {
388
+ const token = this.configuration.accessToken;
389
+ const tokenString = await token("bearerAuth", []);
390
+
391
+ if (tokenString) {
392
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
393
+ }
394
+ }
395
+
396
+ let urlPath = `/admin/phone-numbers/{phoneNumberId}/assign-outbound`;
397
+ urlPath = urlPath.replace(`{${"phoneNumberId"}}`, encodeURIComponent(String(requestParameters['phoneNumberId'])));
398
+
399
+ const response = await this.request({
400
+ path: urlPath,
401
+ method: 'POST',
402
+ headers: headerParameters,
403
+ query: queryParameters,
404
+ body: AdminPhoneNumberAssignOutboundToJSON(requestParameters['adminPhoneNumberAssignOutbound']),
405
+ }, initOverrides);
406
+
407
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminPhoneNumberDetailFromJSON(jsonValue));
408
+ }
409
+
410
+ /**
411
+ * Grants the organization ownership of an outbound number (no inbound trunk). The org can then place outbound calls using it as caller-ID.
412
+ * Assign an outbound-capable number to an organization (app-admin only)
413
+ */
414
+ async adminPhoneNumbersPhoneNumberIdAssignOutboundPost(requestParameters: AdminPhoneNumbersPhoneNumberIdAssignOutboundPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminPhoneNumberDetail> {
415
+ const response = await this.adminPhoneNumbersPhoneNumberIdAssignOutboundPostRaw(requestParameters, initOverrides);
416
+ return await response.value();
417
+ }
418
+
141
419
  /**
142
420
  * Creates a SIP trunk (and, if an agent is given, a dispatch rule) and links the number.
143
421
  * Assign a phone number to an organization (app-admin only)
@@ -341,6 +619,51 @@ export class AdminPhoneNumbersApi extends runtime.BaseAPI {
341
619
  return await response.value();
342
620
  }
343
621
 
622
+ /**
623
+ * Release an outbound number\'s organization ownership (app-admin only)
624
+ */
625
+ async adminPhoneNumbersPhoneNumberIdUnassignOutboundPostRaw(requestParameters: AdminPhoneNumbersPhoneNumberIdUnassignOutboundPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminPhoneNumberDetail>> {
626
+ if (requestParameters['phoneNumberId'] == null) {
627
+ throw new runtime.RequiredError(
628
+ 'phoneNumberId',
629
+ 'Required parameter "phoneNumberId" was null or undefined when calling adminPhoneNumbersPhoneNumberIdUnassignOutboundPost().'
630
+ );
631
+ }
632
+
633
+ const queryParameters: any = {};
634
+
635
+ const headerParameters: runtime.HTTPHeaders = {};
636
+
637
+ if (this.configuration && this.configuration.accessToken) {
638
+ const token = this.configuration.accessToken;
639
+ const tokenString = await token("bearerAuth", []);
640
+
641
+ if (tokenString) {
642
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
643
+ }
644
+ }
645
+
646
+ let urlPath = `/admin/phone-numbers/{phoneNumberId}/unassign-outbound`;
647
+ urlPath = urlPath.replace(`{${"phoneNumberId"}}`, encodeURIComponent(String(requestParameters['phoneNumberId'])));
648
+
649
+ const response = await this.request({
650
+ path: urlPath,
651
+ method: 'POST',
652
+ headers: headerParameters,
653
+ query: queryParameters,
654
+ }, initOverrides);
655
+
656
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminPhoneNumberDetailFromJSON(jsonValue));
657
+ }
658
+
659
+ /**
660
+ * Release an outbound number\'s organization ownership (app-admin only)
661
+ */
662
+ async adminPhoneNumbersPhoneNumberIdUnassignOutboundPost(requestParameters: AdminPhoneNumbersPhoneNumberIdUnassignOutboundPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminPhoneNumberDetail> {
663
+ const response = await this.adminPhoneNumbersPhoneNumberIdUnassignOutboundPostRaw(requestParameters, initOverrides);
664
+ return await response.value();
665
+ }
666
+
344
667
  /**
345
668
  * Deletes the LiveKit dispatch rule + trunk and frees the number back to the pool.
346
669
  * Release a phone number from its organization (app-admin only)
@@ -445,3 +768,12 @@ export const AdminPhoneNumbersGetStatusEnum = {
445
768
  Assigned: 'assigned'
446
769
  } as const;
447
770
  export type AdminPhoneNumbersGetStatusEnum = typeof AdminPhoneNumbersGetStatusEnum[keyof typeof AdminPhoneNumbersGetStatusEnum];
771
+ /**
772
+ * @export
773
+ */
774
+ export const AdminPhoneNumbersOrdersGetStatusEnum = {
775
+ Pending: 'pending',
776
+ Active: 'active',
777
+ Canceled: 'canceled'
778
+ } as const;
779
+ export type AdminPhoneNumbersOrdersGetStatusEnum = typeof AdminPhoneNumbersOrdersGetStatusEnum[keyof typeof AdminPhoneNumbersOrdersGetStatusEnum];
@@ -0,0 +1,95 @@
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
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ OutboundCall,
19
+ OutboundCallRequest,
20
+ } from '../models/index';
21
+ import {
22
+ OutboundCallFromJSON,
23
+ OutboundCallToJSON,
24
+ OutboundCallRequestFromJSON,
25
+ OutboundCallRequestToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
29
+ organizationId: string;
30
+ outboundCallRequest: OutboundCallRequest;
31
+ }
32
+
33
+ /**
34
+ *
35
+ */
36
+ export class OutboundCallsApi extends runtime.BaseAPI {
37
+
38
+ /**
39
+ * 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).
40
+ * Place an outbound call with a voice agent
41
+ */
42
+ async organizationsOrganizationIdOutboundCallsPostRaw(requestParameters: OrganizationsOrganizationIdOutboundCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OutboundCall>> {
43
+ if (requestParameters['organizationId'] == null) {
44
+ throw new runtime.RequiredError(
45
+ 'organizationId',
46
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdOutboundCallsPost().'
47
+ );
48
+ }
49
+
50
+ if (requestParameters['outboundCallRequest'] == null) {
51
+ throw new runtime.RequiredError(
52
+ 'outboundCallRequest',
53
+ 'Required parameter "outboundCallRequest" was null or undefined when calling organizationsOrganizationIdOutboundCallsPost().'
54
+ );
55
+ }
56
+
57
+ const queryParameters: any = {};
58
+
59
+ const headerParameters: runtime.HTTPHeaders = {};
60
+
61
+ headerParameters['Content-Type'] = 'application/json';
62
+
63
+ if (this.configuration && this.configuration.accessToken) {
64
+ const token = this.configuration.accessToken;
65
+ const tokenString = await token("bearerAuth", []);
66
+
67
+ if (tokenString) {
68
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
69
+ }
70
+ }
71
+
72
+ let urlPath = `/organizations/{organizationId}/outbound-calls`;
73
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
74
+
75
+ const response = await this.request({
76
+ path: urlPath,
77
+ method: 'POST',
78
+ headers: headerParameters,
79
+ query: queryParameters,
80
+ body: OutboundCallRequestToJSON(requestParameters['outboundCallRequest']),
81
+ }, initOverrides);
82
+
83
+ return new runtime.JSONApiResponse(response, (jsonValue) => OutboundCallFromJSON(jsonValue));
84
+ }
85
+
86
+ /**
87
+ * 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).
88
+ * Place an outbound call with a voice agent
89
+ */
90
+ async organizationsOrganizationIdOutboundCallsPost(requestParameters: OrganizationsOrganizationIdOutboundCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OutboundCall> {
91
+ const response = await this.organizationsOrganizationIdOutboundCallsPostRaw(requestParameters, initOverrides);
92
+ return await response.value();
93
+ }
94
+
95
+ }
@@ -19,6 +19,7 @@ import type {
19
19
  OrganizationsOrganizationIdSipDispatchRulesPost200Response,
20
20
  PhoneNumber,
21
21
  PhoneNumberCreate,
22
+ PhoneNumberOrder,
22
23
  SipTrunkCreate,
23
24
  SipTrunkWithAgent,
24
25
  } from '../models/index';
@@ -31,6 +32,8 @@ import {
31
32
  PhoneNumberToJSON,
32
33
  PhoneNumberCreateFromJSON,
33
34
  PhoneNumberCreateToJSON,
35
+ PhoneNumberOrderFromJSON,
36
+ PhoneNumberOrderToJSON,
34
37
  SipTrunkCreateFromJSON,
35
38
  SipTrunkCreateToJSON,
36
39
  SipTrunkWithAgentFromJSON,
@@ -51,6 +54,16 @@ export interface OrganizationsOrganizationIdSipPhoneNumbersAssignPostRequest {
51
54
  organizationId: string;
52
55
  }
53
56
 
57
+ export interface OrganizationsOrganizationIdSipPhoneNumbersOrdersGetRequest {
58
+ organizationId: string;
59
+ status?: OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum;
60
+ }
61
+
62
+ export interface OrganizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRequest {
63
+ organizationId: string;
64
+ orderId: string;
65
+ }
66
+
54
67
  export interface OrganizationsOrganizationIdSipTrunksGetRequest {
55
68
  organizationId: string;
56
69
  }
@@ -236,6 +249,107 @@ export class SIPApi extends runtime.BaseAPI {
236
249
  return await response.value();
237
250
  }
238
251
 
252
+ /**
253
+ * List this organization\'s phone-number backorders
254
+ */
255
+ async organizationsOrganizationIdSipPhoneNumbersOrdersGetRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<PhoneNumberOrder>>> {
256
+ if (requestParameters['organizationId'] == null) {
257
+ throw new runtime.RequiredError(
258
+ 'organizationId',
259
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersOrdersGet().'
260
+ );
261
+ }
262
+
263
+ const queryParameters: any = {};
264
+
265
+ if (requestParameters['status'] != null) {
266
+ queryParameters['status'] = requestParameters['status'];
267
+ }
268
+
269
+ const headerParameters: runtime.HTTPHeaders = {};
270
+
271
+ if (this.configuration && this.configuration.accessToken) {
272
+ const token = this.configuration.accessToken;
273
+ const tokenString = await token("bearerAuth", []);
274
+
275
+ if (tokenString) {
276
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
277
+ }
278
+ }
279
+
280
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/orders`;
281
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
282
+
283
+ const response = await this.request({
284
+ path: urlPath,
285
+ method: 'GET',
286
+ headers: headerParameters,
287
+ query: queryParameters,
288
+ }, initOverrides);
289
+
290
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(PhoneNumberOrderFromJSON));
291
+ }
292
+
293
+ /**
294
+ * List this organization\'s phone-number backorders
295
+ */
296
+ async organizationsOrganizationIdSipPhoneNumbersOrdersGet(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<PhoneNumberOrder>> {
297
+ const response = await this.organizationsOrganizationIdSipPhoneNumbersOrdersGetRaw(requestParameters, initOverrides);
298
+ return await response.value();
299
+ }
300
+
301
+ /**
302
+ * Cancel a pending phone-number backorder
303
+ */
304
+ async organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRaw(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
305
+ if (requestParameters['organizationId'] == null) {
306
+ throw new runtime.RequiredError(
307
+ 'organizationId',
308
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDelete().'
309
+ );
310
+ }
311
+
312
+ if (requestParameters['orderId'] == null) {
313
+ throw new runtime.RequiredError(
314
+ 'orderId',
315
+ 'Required parameter "orderId" was null or undefined when calling organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDelete().'
316
+ );
317
+ }
318
+
319
+ const queryParameters: any = {};
320
+
321
+ const headerParameters: runtime.HTTPHeaders = {};
322
+
323
+ if (this.configuration && this.configuration.accessToken) {
324
+ const token = this.configuration.accessToken;
325
+ const tokenString = await token("bearerAuth", []);
326
+
327
+ if (tokenString) {
328
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
329
+ }
330
+ }
331
+
332
+ let urlPath = `/organizations/{organizationId}/sip/phone-numbers/orders/{orderId}`;
333
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
334
+ urlPath = urlPath.replace(`{${"orderId"}}`, encodeURIComponent(String(requestParameters['orderId'])));
335
+
336
+ const response = await this.request({
337
+ path: urlPath,
338
+ method: 'DELETE',
339
+ headers: headerParameters,
340
+ query: queryParameters,
341
+ }, initOverrides);
342
+
343
+ return new runtime.VoidApiResponse(response);
344
+ }
345
+
346
+ /**
347
+ * Cancel a pending phone-number backorder
348
+ */
349
+ async organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDelete(requestParameters: OrganizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
350
+ await this.organizationsOrganizationIdSipPhoneNumbersOrdersOrderIdDeleteRaw(requestParameters, initOverrides);
351
+ }
352
+
239
353
  /**
240
354
  * List all SIP trunks for an organization
241
355
  */
@@ -521,3 +635,13 @@ export class SIPApi extends runtime.BaseAPI {
521
635
  }
522
636
 
523
637
  }
638
+
639
+ /**
640
+ * @export
641
+ */
642
+ export const OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum = {
643
+ Pending: 'pending',
644
+ Active: 'active',
645
+ Canceled: 'canceled'
646
+ } as const;
647
+ export type OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum = typeof OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum[keyof typeof OrganizationsOrganizationIdSipPhoneNumbersOrdersGetStatusEnum];
package/src/apis/index.ts CHANGED
@@ -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';