@l7mp/tivadar-ai-api-sdk 0.2.15 → 0.2.17

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 (66) hide show
  1. package/dist/api-client.d.ts +9 -1
  2. package/dist/api-client.js +8 -0
  3. package/dist/apis/AdminPhoneNumbersApi.d.ts +26 -1
  4. package/dist/apis/AdminPhoneNumbersApi.js +81 -0
  5. package/dist/apis/OutboundCallsApi.d.ts +45 -0
  6. package/dist/apis/OutboundCallsApi.js +116 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/esm/api-client.d.ts +9 -1
  10. package/dist/esm/api-client.js +8 -0
  11. package/dist/esm/apis/AdminPhoneNumbersApi.d.ts +26 -1
  12. package/dist/esm/apis/AdminPhoneNumbersApi.js +82 -1
  13. package/dist/esm/apis/OutboundCallsApi.d.ts +45 -0
  14. package/dist/esm/apis/OutboundCallsApi.js +112 -0
  15. package/dist/esm/apis/index.d.ts +1 -0
  16. package/dist/esm/apis/index.js +1 -0
  17. package/dist/esm/models/AdminPhoneNumberAssignOutbound.d.ts +32 -0
  18. package/dist/esm/models/AdminPhoneNumberAssignOutbound.js +43 -0
  19. package/dist/esm/models/AdminPhoneNumberDetail.d.ts +30 -0
  20. package/dist/esm/models/AdminPhoneNumberDetail.js +10 -0
  21. package/dist/esm/models/AdminPhoneNumberUpdate.d.ts +18 -0
  22. package/dist/esm/models/AdminPhoneNumberUpdate.js +6 -0
  23. package/dist/esm/models/OutboundCall.d.ts +68 -0
  24. package/dist/esm/models/OutboundCall.js +53 -0
  25. package/dist/esm/models/OutboundCallRequest.d.ts +50 -0
  26. package/dist/esm/models/OutboundCallRequest.js +49 -0
  27. package/dist/esm/models/OutboundNumber.d.ts +38 -0
  28. package/dist/esm/models/OutboundNumber.js +43 -0
  29. package/dist/esm/models/PhoneNumber.d.ts +18 -0
  30. package/dist/esm/models/PhoneNumber.js +6 -0
  31. package/dist/esm/models/PhoneNumberCreate.d.ts +24 -0
  32. package/dist/esm/models/PhoneNumberCreate.js +8 -0
  33. package/dist/esm/models/index.d.ts +4 -0
  34. package/dist/esm/models/index.js +4 -0
  35. package/dist/models/AdminPhoneNumberAssignOutbound.d.ts +32 -0
  36. package/dist/models/AdminPhoneNumberAssignOutbound.js +50 -0
  37. package/dist/models/AdminPhoneNumberDetail.d.ts +30 -0
  38. package/dist/models/AdminPhoneNumberDetail.js +10 -0
  39. package/dist/models/AdminPhoneNumberUpdate.d.ts +18 -0
  40. package/dist/models/AdminPhoneNumberUpdate.js +6 -0
  41. package/dist/models/OutboundCall.d.ts +68 -0
  42. package/dist/models/OutboundCall.js +60 -0
  43. package/dist/models/OutboundCallRequest.d.ts +50 -0
  44. package/dist/models/OutboundCallRequest.js +56 -0
  45. package/dist/models/OutboundNumber.d.ts +38 -0
  46. package/dist/models/OutboundNumber.js +50 -0
  47. package/dist/models/PhoneNumber.d.ts +18 -0
  48. package/dist/models/PhoneNumber.js +6 -0
  49. package/dist/models/PhoneNumberCreate.d.ts +24 -0
  50. package/dist/models/PhoneNumberCreate.js +8 -0
  51. package/dist/models/index.d.ts +4 -0
  52. package/dist/models/index.js +4 -0
  53. package/package.json +1 -1
  54. package/src/api-client.ts +18 -0
  55. package/src/apis/AdminPhoneNumbersApi.ts +114 -0
  56. package/src/apis/OutboundCallsApi.ts +149 -0
  57. package/src/apis/index.ts +1 -0
  58. package/src/models/AdminPhoneNumberAssignOutbound.ts +66 -0
  59. package/src/models/AdminPhoneNumberDetail.ts +40 -0
  60. package/src/models/AdminPhoneNumberUpdate.ts +24 -0
  61. package/src/models/OutboundCall.ts +113 -0
  62. package/src/models/OutboundCallRequest.ts +90 -0
  63. package/src/models/OutboundNumber.ts +73 -0
  64. package/src/models/PhoneNumber.ts +24 -0
  65. package/src/models/PhoneNumberCreate.ts +32 -0
  66. package/src/models/index.ts +4 -0
@@ -0,0 +1,149 @@
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
+ OutboundNumber,
21
+ } from '../models/index';
22
+ import {
23
+ OutboundCallFromJSON,
24
+ OutboundCallToJSON,
25
+ OutboundCallRequestFromJSON,
26
+ OutboundCallRequestToJSON,
27
+ OutboundNumberFromJSON,
28
+ OutboundNumberToJSON,
29
+ } from '../models/index';
30
+
31
+ export interface OrganizationsOrganizationIdOutboundCallsNumbersGetRequest {
32
+ organizationId: string;
33
+ }
34
+
35
+ export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
36
+ organizationId: string;
37
+ outboundCallRequest: OutboundCallRequest;
38
+ }
39
+
40
+ /**
41
+ *
42
+ */
43
+ export class OutboundCallsApi extends runtime.BaseAPI {
44
+
45
+ /**
46
+ * Returns the outbound-ready numbers assigned to the organization, for selecting which one to use as caller-ID (From) when placing a call. Requires the `outbound_calls` feature.
47
+ * List the organization\'s outbound-capable caller-ID numbers
48
+ */
49
+ async organizationsOrganizationIdOutboundCallsNumbersGetRaw(requestParameters: OrganizationsOrganizationIdOutboundCallsNumbersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OutboundNumber>>> {
50
+ if (requestParameters['organizationId'] == null) {
51
+ throw new runtime.RequiredError(
52
+ 'organizationId',
53
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdOutboundCallsNumbersGet().'
54
+ );
55
+ }
56
+
57
+ const queryParameters: any = {};
58
+
59
+ const headerParameters: runtime.HTTPHeaders = {};
60
+
61
+ if (this.configuration && this.configuration.accessToken) {
62
+ const token = this.configuration.accessToken;
63
+ const tokenString = await token("bearerAuth", []);
64
+
65
+ if (tokenString) {
66
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
67
+ }
68
+ }
69
+
70
+ let urlPath = `/organizations/{organizationId}/outbound-calls/numbers`;
71
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
72
+
73
+ const response = await this.request({
74
+ path: urlPath,
75
+ method: 'GET',
76
+ headers: headerParameters,
77
+ query: queryParameters,
78
+ }, initOverrides);
79
+
80
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OutboundNumberFromJSON));
81
+ }
82
+
83
+ /**
84
+ * Returns the outbound-ready numbers assigned to the organization, for selecting which one to use as caller-ID (From) when placing a call. Requires the `outbound_calls` feature.
85
+ * List the organization\'s outbound-capable caller-ID numbers
86
+ */
87
+ async organizationsOrganizationIdOutboundCallsNumbersGet(requestParameters: OrganizationsOrganizationIdOutboundCallsNumbersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OutboundNumber>> {
88
+ const response = await this.organizationsOrganizationIdOutboundCallsNumbersGetRaw(requestParameters, initOverrides);
89
+ return await response.value();
90
+ }
91
+
92
+ /**
93
+ * 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).
94
+ * Place an outbound call with a voice agent
95
+ */
96
+ async organizationsOrganizationIdOutboundCallsPostRaw(requestParameters: OrganizationsOrganizationIdOutboundCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OutboundCall>> {
97
+ if (requestParameters['organizationId'] == null) {
98
+ throw new runtime.RequiredError(
99
+ 'organizationId',
100
+ 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdOutboundCallsPost().'
101
+ );
102
+ }
103
+
104
+ if (requestParameters['outboundCallRequest'] == null) {
105
+ throw new runtime.RequiredError(
106
+ 'outboundCallRequest',
107
+ 'Required parameter "outboundCallRequest" was null or undefined when calling organizationsOrganizationIdOutboundCallsPost().'
108
+ );
109
+ }
110
+
111
+ const queryParameters: any = {};
112
+
113
+ const headerParameters: runtime.HTTPHeaders = {};
114
+
115
+ headerParameters['Content-Type'] = 'application/json';
116
+
117
+ if (this.configuration && this.configuration.accessToken) {
118
+ const token = this.configuration.accessToken;
119
+ const tokenString = await token("bearerAuth", []);
120
+
121
+ if (tokenString) {
122
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
123
+ }
124
+ }
125
+
126
+ let urlPath = `/organizations/{organizationId}/outbound-calls`;
127
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
128
+
129
+ const response = await this.request({
130
+ path: urlPath,
131
+ method: 'POST',
132
+ headers: headerParameters,
133
+ query: queryParameters,
134
+ body: OutboundCallRequestToJSON(requestParameters['outboundCallRequest']),
135
+ }, initOverrides);
136
+
137
+ return new runtime.JSONApiResponse(response, (jsonValue) => OutboundCallFromJSON(jsonValue));
138
+ }
139
+
140
+ /**
141
+ * 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).
142
+ * Place an outbound call with a voice agent
143
+ */
144
+ async organizationsOrganizationIdOutboundCallsPost(requestParameters: OrganizationsOrganizationIdOutboundCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<OutboundCall> {
145
+ const response = await this.organizationsOrganizationIdOutboundCallsPostRaw(requestParameters, initOverrides);
146
+ return await response.value();
147
+ }
148
+
149
+ }
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';
@@ -0,0 +1,66 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface AdminPhoneNumberAssignOutbound
20
+ */
21
+ export interface AdminPhoneNumberAssignOutbound {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof AdminPhoneNumberAssignOutbound
26
+ */
27
+ organization_id: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the AdminPhoneNumberAssignOutbound interface.
32
+ */
33
+ export function instanceOfAdminPhoneNumberAssignOutbound(value: object): value is AdminPhoneNumberAssignOutbound {
34
+ if (!('organization_id' in value) || value['organization_id'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function AdminPhoneNumberAssignOutboundFromJSON(json: any): AdminPhoneNumberAssignOutbound {
39
+ return AdminPhoneNumberAssignOutboundFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function AdminPhoneNumberAssignOutboundFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminPhoneNumberAssignOutbound {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'organization_id': json['organization_id'],
49
+ };
50
+ }
51
+
52
+ export function AdminPhoneNumberAssignOutboundToJSON(json: any): AdminPhoneNumberAssignOutbound {
53
+ return AdminPhoneNumberAssignOutboundToJSONTyped(json, false);
54
+ }
55
+
56
+ export function AdminPhoneNumberAssignOutboundToJSONTyped(value?: AdminPhoneNumberAssignOutbound | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'organization_id': value['organization_id'],
64
+ };
65
+ }
66
+
@@ -37,6 +37,36 @@ export interface AdminPhoneNumberDetail {
37
37
  * @memberof AdminPhoneNumberDetail
38
38
  */
39
39
  supports_call_redirect?: boolean;
40
+ /**
41
+ *
42
+ * @type {boolean}
43
+ * @memberof AdminPhoneNumberDetail
44
+ */
45
+ supports_outbound?: boolean;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof AdminPhoneNumberDetail
50
+ */
51
+ sip_address?: string | null;
52
+ /**
53
+ *
54
+ * @type {boolean}
55
+ * @memberof AdminPhoneNumberDetail
56
+ */
57
+ outbound_configured?: boolean;
58
+ /**
59
+ *
60
+ * @type {string}
61
+ * @memberof AdminPhoneNumberDetail
62
+ */
63
+ outbound_organization_id?: string | null;
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof AdminPhoneNumberDetail
68
+ */
69
+ outbound_organization_name?: string | null;
40
70
  /**
41
71
  *
42
72
  * @type {string}
@@ -118,6 +148,11 @@ export function AdminPhoneNumberDetailFromJSONTyped(json: any, ignoreDiscriminat
118
148
  'id': json['id'] == null ? undefined : json['id'],
119
149
  'number': json['number'] == null ? undefined : json['number'],
120
150
  'supports_call_redirect': json['supports_call_redirect'] == null ? undefined : json['supports_call_redirect'],
151
+ 'supports_outbound': json['supports_outbound'] == null ? undefined : json['supports_outbound'],
152
+ 'sip_address': json['sip_address'] == null ? undefined : json['sip_address'],
153
+ 'outbound_configured': json['outbound_configured'] == null ? undefined : json['outbound_configured'],
154
+ 'outbound_organization_id': json['outbound_organization_id'] == null ? undefined : json['outbound_organization_id'],
155
+ 'outbound_organization_name': json['outbound_organization_name'] == null ? undefined : json['outbound_organization_name'],
121
156
  'status': json['status'] == null ? undefined : json['status'],
122
157
  'created_at': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
123
158
  'sip_trunk_id': json['sip_trunk_id'] == null ? undefined : json['sip_trunk_id'],
@@ -143,6 +178,11 @@ export function AdminPhoneNumberDetailToJSONTyped(value?: AdminPhoneNumberDetail
143
178
  'id': value['id'],
144
179
  'number': value['number'],
145
180
  'supports_call_redirect': value['supports_call_redirect'],
181
+ 'supports_outbound': value['supports_outbound'],
182
+ 'sip_address': value['sip_address'],
183
+ 'outbound_configured': value['outbound_configured'],
184
+ 'outbound_organization_id': value['outbound_organization_id'],
185
+ 'outbound_organization_name': value['outbound_organization_name'],
146
186
  'status': value['status'],
147
187
  'created_at': value['created_at'] == null ? value['created_at'] : value['created_at'].toISOString(),
148
188
  'sip_trunk_id': value['sip_trunk_id'],
@@ -31,6 +31,24 @@ export interface AdminPhoneNumberUpdate {
31
31
  * @memberof AdminPhoneNumberUpdate
32
32
  */
33
33
  supports_call_redirect?: boolean;
34
+ /**
35
+ * Update the outbound SIP address (outbound numbers only).
36
+ * @type {string}
37
+ * @memberof AdminPhoneNumberUpdate
38
+ */
39
+ sip_address?: string;
40
+ /**
41
+ * Update the outbound SIP auth username (re-encrypted).
42
+ * @type {string}
43
+ * @memberof AdminPhoneNumberUpdate
44
+ */
45
+ auth_username?: string;
46
+ /**
47
+ * Update the outbound SIP auth password (re-encrypted).
48
+ * @type {string}
49
+ * @memberof AdminPhoneNumberUpdate
50
+ */
51
+ auth_password?: string;
34
52
  }
35
53
 
36
54
  /**
@@ -52,6 +70,9 @@ export function AdminPhoneNumberUpdateFromJSONTyped(json: any, ignoreDiscriminat
52
70
 
53
71
  'number': json['number'] == null ? undefined : json['number'],
54
72
  'supports_call_redirect': json['supports_call_redirect'] == null ? undefined : json['supports_call_redirect'],
73
+ 'sip_address': json['sip_address'] == null ? undefined : json['sip_address'],
74
+ 'auth_username': json['auth_username'] == null ? undefined : json['auth_username'],
75
+ 'auth_password': json['auth_password'] == null ? undefined : json['auth_password'],
55
76
  };
56
77
  }
57
78
 
@@ -68,6 +89,9 @@ export function AdminPhoneNumberUpdateToJSONTyped(value?: AdminPhoneNumberUpdate
68
89
 
69
90
  'number': value['number'],
70
91
  'supports_call_redirect': value['supports_call_redirect'],
92
+ 'sip_address': value['sip_address'],
93
+ 'auth_username': value['auth_username'],
94
+ 'auth_password': value['auth_password'],
71
95
  };
72
96
  }
73
97
 
@@ -0,0 +1,113 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface OutboundCall
20
+ */
21
+ export interface OutboundCall {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof OutboundCall
26
+ */
27
+ call_id?: string | null;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof OutboundCall
32
+ */
33
+ room_name?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof OutboundCall
38
+ */
39
+ destination?: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof OutboundCall
44
+ */
45
+ from_number?: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof OutboundCall
50
+ */
51
+ participant_identity?: string;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof OutboundCall
56
+ */
57
+ sip_participant_id?: string | null;
58
+ /**
59
+ *
60
+ * @type {boolean}
61
+ * @memberof OutboundCall
62
+ */
63
+ dispatched?: boolean;
64
+ }
65
+
66
+ /**
67
+ * Check if a given object implements the OutboundCall interface.
68
+ */
69
+ export function instanceOfOutboundCall(value: object): value is OutboundCall {
70
+ return true;
71
+ }
72
+
73
+ export function OutboundCallFromJSON(json: any): OutboundCall {
74
+ return OutboundCallFromJSONTyped(json, false);
75
+ }
76
+
77
+ export function OutboundCallFromJSONTyped(json: any, ignoreDiscriminator: boolean): OutboundCall {
78
+ if (json == null) {
79
+ return json;
80
+ }
81
+ return {
82
+
83
+ 'call_id': json['call_id'] == null ? undefined : json['call_id'],
84
+ 'room_name': json['room_name'] == null ? undefined : json['room_name'],
85
+ 'destination': json['destination'] == null ? undefined : json['destination'],
86
+ 'from_number': json['from_number'] == null ? undefined : json['from_number'],
87
+ 'participant_identity': json['participant_identity'] == null ? undefined : json['participant_identity'],
88
+ 'sip_participant_id': json['sip_participant_id'] == null ? undefined : json['sip_participant_id'],
89
+ 'dispatched': json['dispatched'] == null ? undefined : json['dispatched'],
90
+ };
91
+ }
92
+
93
+ export function OutboundCallToJSON(json: any): OutboundCall {
94
+ return OutboundCallToJSONTyped(json, false);
95
+ }
96
+
97
+ export function OutboundCallToJSONTyped(value?: OutboundCall | null, ignoreDiscriminator: boolean = false): any {
98
+ if (value == null) {
99
+ return value;
100
+ }
101
+
102
+ return {
103
+
104
+ 'call_id': value['call_id'],
105
+ 'room_name': value['room_name'],
106
+ 'destination': value['destination'],
107
+ 'from_number': value['from_number'],
108
+ 'participant_identity': value['participant_identity'],
109
+ 'sip_participant_id': value['sip_participant_id'],
110
+ 'dispatched': value['dispatched'],
111
+ };
112
+ }
113
+
@@ -0,0 +1,90 @@
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
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface OutboundCallRequest
20
+ */
21
+ export interface OutboundCallRequest {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof OutboundCallRequest
26
+ */
27
+ voice_agent_id: string;
28
+ /**
29
+ * Destination from a phonebook entry. Provide this OR destination_number.
30
+ * @type {string}
31
+ * @memberof OutboundCallRequest
32
+ */
33
+ phonebook_entry_id?: string;
34
+ /**
35
+ * Custom destination phone number. Provide this OR phonebook_entry_id.
36
+ * @type {string}
37
+ * @memberof OutboundCallRequest
38
+ */
39
+ destination_number?: string;
40
+ /**
41
+ * Which of the org's outbound-capable numbers to use as caller-ID (From). Omit to auto-select.
42
+ * @type {number}
43
+ * @memberof OutboundCallRequest
44
+ */
45
+ from_phone_number_id?: number;
46
+ }
47
+
48
+ /**
49
+ * Check if a given object implements the OutboundCallRequest interface.
50
+ */
51
+ export function instanceOfOutboundCallRequest(value: object): value is OutboundCallRequest {
52
+ if (!('voice_agent_id' in value) || value['voice_agent_id'] === undefined) return false;
53
+ return true;
54
+ }
55
+
56
+ export function OutboundCallRequestFromJSON(json: any): OutboundCallRequest {
57
+ return OutboundCallRequestFromJSONTyped(json, false);
58
+ }
59
+
60
+ export function OutboundCallRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OutboundCallRequest {
61
+ if (json == null) {
62
+ return json;
63
+ }
64
+ return {
65
+
66
+ 'voice_agent_id': json['voice_agent_id'],
67
+ 'phonebook_entry_id': json['phonebook_entry_id'] == null ? undefined : json['phonebook_entry_id'],
68
+ 'destination_number': json['destination_number'] == null ? undefined : json['destination_number'],
69
+ 'from_phone_number_id': json['from_phone_number_id'] == null ? undefined : json['from_phone_number_id'],
70
+ };
71
+ }
72
+
73
+ export function OutboundCallRequestToJSON(json: any): OutboundCallRequest {
74
+ return OutboundCallRequestToJSONTyped(json, false);
75
+ }
76
+
77
+ export function OutboundCallRequestToJSONTyped(value?: OutboundCallRequest | null, ignoreDiscriminator: boolean = false): any {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+
82
+ return {
83
+
84
+ 'voice_agent_id': value['voice_agent_id'],
85
+ 'phonebook_entry_id': value['phonebook_entry_id'],
86
+ 'destination_number': value['destination_number'],
87
+ 'from_phone_number_id': value['from_phone_number_id'],
88
+ };
89
+ }
90
+
@@ -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
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * An outbound-capable number assigned to the organization, usable as caller-ID.
18
+ * @export
19
+ * @interface OutboundNumber
20
+ */
21
+ export interface OutboundNumber {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof OutboundNumber
26
+ */
27
+ id?: number;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof OutboundNumber
32
+ */
33
+ number?: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the OutboundNumber interface.
38
+ */
39
+ export function instanceOfOutboundNumber(value: object): value is OutboundNumber {
40
+ return true;
41
+ }
42
+
43
+ export function OutboundNumberFromJSON(json: any): OutboundNumber {
44
+ return OutboundNumberFromJSONTyped(json, false);
45
+ }
46
+
47
+ export function OutboundNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean): OutboundNumber {
48
+ if (json == null) {
49
+ return json;
50
+ }
51
+ return {
52
+
53
+ 'id': json['id'] == null ? undefined : json['id'],
54
+ 'number': json['number'] == null ? undefined : json['number'],
55
+ };
56
+ }
57
+
58
+ export function OutboundNumberToJSON(json: any): OutboundNumber {
59
+ return OutboundNumberToJSONTyped(json, false);
60
+ }
61
+
62
+ export function OutboundNumberToJSONTyped(value?: OutboundNumber | null, ignoreDiscriminator: boolean = false): any {
63
+ if (value == null) {
64
+ return value;
65
+ }
66
+
67
+ return {
68
+
69
+ 'id': value['id'],
70
+ 'number': value['number'],
71
+ };
72
+ }
73
+
@@ -43,6 +43,24 @@ export interface PhoneNumber {
43
43
  * @memberof PhoneNumber
44
44
  */
45
45
  supports_call_redirect?: boolean;
46
+ /**
47
+ * Whether this number can place outbound calls (has an outbound trunk).
48
+ * @type {boolean}
49
+ * @memberof PhoneNumber
50
+ */
51
+ supports_outbound?: boolean;
52
+ /**
53
+ * Outbound SIP provider host/address (outbound numbers only).
54
+ * @type {string}
55
+ * @memberof PhoneNumber
56
+ */
57
+ sip_address?: string | null;
58
+ /**
59
+ * Whether the outbound trunk + credentials are configured. Secrets are never returned.
60
+ * @type {boolean}
61
+ * @memberof PhoneNumber
62
+ */
63
+ outbound_configured?: boolean;
46
64
  /**
47
65
  *
48
66
  * @type {Date}
@@ -72,6 +90,9 @@ export function PhoneNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean
72
90
  'number': json['number'] == null ? undefined : json['number'],
73
91
  'sip_trunk_id': json['sip_trunk_id'] == null ? undefined : json['sip_trunk_id'],
74
92
  'supports_call_redirect': json['supports_call_redirect'] == null ? undefined : json['supports_call_redirect'],
93
+ 'supports_outbound': json['supports_outbound'] == null ? undefined : json['supports_outbound'],
94
+ 'sip_address': json['sip_address'] == null ? undefined : json['sip_address'],
95
+ 'outbound_configured': json['outbound_configured'] == null ? undefined : json['outbound_configured'],
75
96
  'created_at': json['created_at'] == null ? undefined : (new Date(json['created_at'])),
76
97
  };
77
98
  }
@@ -91,6 +112,9 @@ export function PhoneNumberToJSONTyped(value?: PhoneNumber | null, ignoreDiscrim
91
112
  'number': value['number'],
92
113
  'sip_trunk_id': value['sip_trunk_id'],
93
114
  'supports_call_redirect': value['supports_call_redirect'],
115
+ 'supports_outbound': value['supports_outbound'],
116
+ 'sip_address': value['sip_address'],
117
+ 'outbound_configured': value['outbound_configured'],
94
118
  'created_at': value['created_at'] == null ? value['created_at'] : value['created_at'].toISOString(),
95
119
  };
96
120
  }