@l7mp/tivadar-ai-api-sdk 0.2.16 → 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.
@@ -216,6 +216,7 @@ export declare class Api {
216
216
  };
217
217
  readonly outboundCalls: {
218
218
  create: (organizationId: string, outboundCallRequest: OutboundCallRequest, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsPost"]>;
219
+ listNumbers: (organizationId: string, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsNumbersGet"]>;
219
220
  };
220
221
  readonly voiceUsage: {
221
222
  report: (voiceUsageReportRequest: VoiceUsageReportRequest, options?: RequestInit) => ReturnType<VoiceUsageApi["voiceUsageReportPost"]>;
@@ -245,6 +245,7 @@ class Api {
245
245
  };
246
246
  this.outboundCalls = {
247
247
  create: (organizationId, outboundCallRequest, options) => this.outboundCallsApi.organizationsOrganizationIdOutboundCallsPost({ organizationId, outboundCallRequest }, options),
248
+ listNumbers: (organizationId, options) => this.outboundCallsApi.organizationsOrganizationIdOutboundCallsNumbersGet({ organizationId }, options),
248
249
  };
249
250
  this.voiceUsage = {
250
251
  report: (voiceUsageReportRequest, options) => this.voiceUsageApi.voiceUsageReportPost({ voiceUsageReportRequest }, options),
@@ -10,7 +10,10 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { OutboundCall, OutboundCallRequest } from '../models/index';
13
+ import type { OutboundCall, OutboundCallRequest, OutboundNumber } from '../models/index';
14
+ export interface OrganizationsOrganizationIdOutboundCallsNumbersGetRequest {
15
+ organizationId: string;
16
+ }
14
17
  export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
15
18
  organizationId: string;
16
19
  outboundCallRequest: OutboundCallRequest;
@@ -19,6 +22,16 @@ export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
19
22
  *
20
23
  */
21
24
  export declare class OutboundCallsApi extends runtime.BaseAPI {
25
+ /**
26
+ * 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.
27
+ * List the organization\'s outbound-capable caller-ID numbers
28
+ */
29
+ organizationsOrganizationIdOutboundCallsNumbersGetRaw(requestParameters: OrganizationsOrganizationIdOutboundCallsNumbersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OutboundNumber>>>;
30
+ /**
31
+ * 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.
32
+ * List the organization\'s outbound-capable caller-ID numbers
33
+ */
34
+ organizationsOrganizationIdOutboundCallsNumbersGet(requestParameters: OrganizationsOrganizationIdOutboundCallsNumbersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OutboundNumber>>;
22
35
  /**
23
36
  * 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
37
  * Place an outbound call with a voice agent
@@ -29,6 +29,45 @@ const index_1 = require("../models/index");
29
29
  *
30
30
  */
31
31
  class OutboundCallsApi extends runtime.BaseAPI {
32
+ /**
33
+ * 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.
34
+ * List the organization\'s outbound-capable caller-ID numbers
35
+ */
36
+ organizationsOrganizationIdOutboundCallsNumbersGetRaw(requestParameters, initOverrides) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ if (requestParameters['organizationId'] == null) {
39
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdOutboundCallsNumbersGet().');
40
+ }
41
+ const queryParameters = {};
42
+ const headerParameters = {};
43
+ if (this.configuration && this.configuration.accessToken) {
44
+ const token = this.configuration.accessToken;
45
+ const tokenString = yield token("bearerAuth", []);
46
+ if (tokenString) {
47
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
48
+ }
49
+ }
50
+ let urlPath = `/organizations/{organizationId}/outbound-calls/numbers`;
51
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
52
+ const response = yield this.request({
53
+ path: urlPath,
54
+ method: 'GET',
55
+ headers: headerParameters,
56
+ query: queryParameters,
57
+ }, initOverrides);
58
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.OutboundNumberFromJSON));
59
+ });
60
+ }
61
+ /**
62
+ * 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.
63
+ * List the organization\'s outbound-capable caller-ID numbers
64
+ */
65
+ organizationsOrganizationIdOutboundCallsNumbersGet(requestParameters, initOverrides) {
66
+ return __awaiter(this, void 0, void 0, function* () {
67
+ const response = yield this.organizationsOrganizationIdOutboundCallsNumbersGetRaw(requestParameters, initOverrides);
68
+ return yield response.value();
69
+ });
70
+ }
32
71
  /**
33
72
  * 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).
34
73
  * Place an outbound call with a voice agent
@@ -216,6 +216,7 @@ export declare class Api {
216
216
  };
217
217
  readonly outboundCalls: {
218
218
  create: (organizationId: string, outboundCallRequest: OutboundCallRequest, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsPost"]>;
219
+ listNumbers: (organizationId: string, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsNumbersGet"]>;
219
220
  };
220
221
  readonly voiceUsage: {
221
222
  report: (voiceUsageReportRequest: VoiceUsageReportRequest, options?: RequestInit) => ReturnType<VoiceUsageApi["voiceUsageReportPost"]>;
@@ -242,6 +242,7 @@ export class Api {
242
242
  };
243
243
  this.outboundCalls = {
244
244
  create: (organizationId, outboundCallRequest, options) => this.outboundCallsApi.organizationsOrganizationIdOutboundCallsPost({ organizationId, outboundCallRequest }, options),
245
+ listNumbers: (organizationId, options) => this.outboundCallsApi.organizationsOrganizationIdOutboundCallsNumbersGet({ organizationId }, options),
245
246
  };
246
247
  this.voiceUsage = {
247
248
  report: (voiceUsageReportRequest, options) => this.voiceUsageApi.voiceUsageReportPost({ voiceUsageReportRequest }, options),
@@ -10,7 +10,10 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { OutboundCall, OutboundCallRequest } from '../models/index';
13
+ import type { OutboundCall, OutboundCallRequest, OutboundNumber } from '../models/index';
14
+ export interface OrganizationsOrganizationIdOutboundCallsNumbersGetRequest {
15
+ organizationId: string;
16
+ }
14
17
  export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
15
18
  organizationId: string;
16
19
  outboundCallRequest: OutboundCallRequest;
@@ -19,6 +22,16 @@ export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
19
22
  *
20
23
  */
21
24
  export declare class OutboundCallsApi extends runtime.BaseAPI {
25
+ /**
26
+ * 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.
27
+ * List the organization\'s outbound-capable caller-ID numbers
28
+ */
29
+ organizationsOrganizationIdOutboundCallsNumbersGetRaw(requestParameters: OrganizationsOrganizationIdOutboundCallsNumbersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<OutboundNumber>>>;
30
+ /**
31
+ * 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.
32
+ * List the organization\'s outbound-capable caller-ID numbers
33
+ */
34
+ organizationsOrganizationIdOutboundCallsNumbersGet(requestParameters: OrganizationsOrganizationIdOutboundCallsNumbersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<OutboundNumber>>;
22
35
  /**
23
36
  * 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
37
  * Place an outbound call with a voice agent
@@ -21,11 +21,50 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
21
21
  });
22
22
  };
23
23
  import * as runtime from '../runtime';
24
- import { OutboundCallFromJSON, OutboundCallRequestToJSON, } from '../models/index';
24
+ import { OutboundCallFromJSON, OutboundCallRequestToJSON, OutboundNumberFromJSON, } from '../models/index';
25
25
  /**
26
26
  *
27
27
  */
28
28
  export class OutboundCallsApi extends runtime.BaseAPI {
29
+ /**
30
+ * 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.
31
+ * List the organization\'s outbound-capable caller-ID numbers
32
+ */
33
+ organizationsOrganizationIdOutboundCallsNumbersGetRaw(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 organizationsOrganizationIdOutboundCallsNumbersGet().');
37
+ }
38
+ const queryParameters = {};
39
+ const headerParameters = {};
40
+ if (this.configuration && this.configuration.accessToken) {
41
+ const token = this.configuration.accessToken;
42
+ const tokenString = yield token("bearerAuth", []);
43
+ if (tokenString) {
44
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
45
+ }
46
+ }
47
+ let urlPath = `/organizations/{organizationId}/outbound-calls/numbers`;
48
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
49
+ const response = yield this.request({
50
+ path: urlPath,
51
+ method: 'GET',
52
+ headers: headerParameters,
53
+ query: queryParameters,
54
+ }, initOverrides);
55
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(OutboundNumberFromJSON));
56
+ });
57
+ }
58
+ /**
59
+ * 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.
60
+ * List the organization\'s outbound-capable caller-ID numbers
61
+ */
62
+ organizationsOrganizationIdOutboundCallsNumbersGet(requestParameters, initOverrides) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ const response = yield this.organizationsOrganizationIdOutboundCallsNumbersGetRaw(requestParameters, initOverrides);
65
+ return yield response.value();
66
+ });
67
+ }
29
68
  /**
30
69
  * 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
70
  * Place an outbound call with a voice agent
@@ -33,6 +33,12 @@ export interface OutboundCallRequest {
33
33
  * @memberof OutboundCallRequest
34
34
  */
35
35
  destination_number?: string;
36
+ /**
37
+ * Which of the org's outbound-capable numbers to use as caller-ID (From). Omit to auto-select.
38
+ * @type {number}
39
+ * @memberof OutboundCallRequest
40
+ */
41
+ from_phone_number_id?: number;
36
42
  }
37
43
  /**
38
44
  * Check if a given object implements the OutboundCallRequest interface.
@@ -30,6 +30,7 @@ export function OutboundCallRequestFromJSONTyped(json, ignoreDiscriminator) {
30
30
  'voice_agent_id': json['voice_agent_id'],
31
31
  'phonebook_entry_id': json['phonebook_entry_id'] == null ? undefined : json['phonebook_entry_id'],
32
32
  'destination_number': json['destination_number'] == null ? undefined : json['destination_number'],
33
+ 'from_phone_number_id': json['from_phone_number_id'] == null ? undefined : json['from_phone_number_id'],
33
34
  };
34
35
  }
35
36
  export function OutboundCallRequestToJSON(json) {
@@ -43,5 +44,6 @@ export function OutboundCallRequestToJSONTyped(value, ignoreDiscriminator = fals
43
44
  'voice_agent_id': value['voice_agent_id'],
44
45
  'phonebook_entry_id': value['phonebook_entry_id'],
45
46
  'destination_number': value['destination_number'],
47
+ 'from_phone_number_id': value['from_phone_number_id'],
46
48
  };
47
49
  }
@@ -0,0 +1,38 @@
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
+ * An outbound-capable number assigned to the organization, usable as caller-ID.
14
+ * @export
15
+ * @interface OutboundNumber
16
+ */
17
+ export interface OutboundNumber {
18
+ /**
19
+ *
20
+ * @type {number}
21
+ * @memberof OutboundNumber
22
+ */
23
+ id?: number;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof OutboundNumber
28
+ */
29
+ number?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the OutboundNumber interface.
33
+ */
34
+ export declare function instanceOfOutboundNumber(value: object): value is OutboundNumber;
35
+ export declare function OutboundNumberFromJSON(json: any): OutboundNumber;
36
+ export declare function OutboundNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean): OutboundNumber;
37
+ export declare function OutboundNumberToJSON(json: any): OutboundNumber;
38
+ export declare function OutboundNumberToJSONTyped(value?: OutboundNumber | 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 OutboundNumber interface.
16
+ */
17
+ export function instanceOfOutboundNumber(value) {
18
+ return true;
19
+ }
20
+ export function OutboundNumberFromJSON(json) {
21
+ return OutboundNumberFromJSONTyped(json, false);
22
+ }
23
+ export function OutboundNumberFromJSONTyped(json, ignoreDiscriminator) {
24
+ if (json == null) {
25
+ return json;
26
+ }
27
+ return {
28
+ 'id': json['id'] == null ? undefined : json['id'],
29
+ 'number': json['number'] == null ? undefined : json['number'],
30
+ };
31
+ }
32
+ export function OutboundNumberToJSON(json) {
33
+ return OutboundNumberToJSONTyped(json, false);
34
+ }
35
+ export function OutboundNumberToJSONTyped(value, ignoreDiscriminator = false) {
36
+ if (value == null) {
37
+ return value;
38
+ }
39
+ return {
40
+ 'id': value['id'],
41
+ 'number': value['number'],
42
+ };
43
+ }
@@ -72,6 +72,7 @@ export * from './OrganizationsOrganizationIdVoiceAgentsBasicGet200ResponseInner'
72
72
  export * from './OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdSandboxTokenPostRequest';
73
73
  export * from './OutboundCall';
74
74
  export * from './OutboundCallRequest';
75
+ export * from './OutboundNumber';
75
76
  export * from './PauseSubscriptionRequest';
76
77
  export * from './PhoneNumber';
77
78
  export * from './PhoneNumberCreate';
@@ -74,6 +74,7 @@ export * from './OrganizationsOrganizationIdVoiceAgentsBasicGet200ResponseInner'
74
74
  export * from './OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdSandboxTokenPostRequest';
75
75
  export * from './OutboundCall';
76
76
  export * from './OutboundCallRequest';
77
+ export * from './OutboundNumber';
77
78
  export * from './PauseSubscriptionRequest';
78
79
  export * from './PhoneNumber';
79
80
  export * from './PhoneNumberCreate';
@@ -33,6 +33,12 @@ export interface OutboundCallRequest {
33
33
  * @memberof OutboundCallRequest
34
34
  */
35
35
  destination_number?: string;
36
+ /**
37
+ * Which of the org's outbound-capable numbers to use as caller-ID (From). Omit to auto-select.
38
+ * @type {number}
39
+ * @memberof OutboundCallRequest
40
+ */
41
+ from_phone_number_id?: number;
36
42
  }
37
43
  /**
38
44
  * Check if a given object implements the OutboundCallRequest interface.
@@ -37,6 +37,7 @@ function OutboundCallRequestFromJSONTyped(json, ignoreDiscriminator) {
37
37
  'voice_agent_id': json['voice_agent_id'],
38
38
  'phonebook_entry_id': json['phonebook_entry_id'] == null ? undefined : json['phonebook_entry_id'],
39
39
  'destination_number': json['destination_number'] == null ? undefined : json['destination_number'],
40
+ 'from_phone_number_id': json['from_phone_number_id'] == null ? undefined : json['from_phone_number_id'],
40
41
  };
41
42
  }
42
43
  function OutboundCallRequestToJSON(json) {
@@ -50,5 +51,6 @@ function OutboundCallRequestToJSONTyped(value, ignoreDiscriminator = false) {
50
51
  'voice_agent_id': value['voice_agent_id'],
51
52
  'phonebook_entry_id': value['phonebook_entry_id'],
52
53
  'destination_number': value['destination_number'],
54
+ 'from_phone_number_id': value['from_phone_number_id'],
53
55
  };
54
56
  }
@@ -0,0 +1,38 @@
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
+ * An outbound-capable number assigned to the organization, usable as caller-ID.
14
+ * @export
15
+ * @interface OutboundNumber
16
+ */
17
+ export interface OutboundNumber {
18
+ /**
19
+ *
20
+ * @type {number}
21
+ * @memberof OutboundNumber
22
+ */
23
+ id?: number;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof OutboundNumber
28
+ */
29
+ number?: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the OutboundNumber interface.
33
+ */
34
+ export declare function instanceOfOutboundNumber(value: object): value is OutboundNumber;
35
+ export declare function OutboundNumberFromJSON(json: any): OutboundNumber;
36
+ export declare function OutboundNumberFromJSONTyped(json: any, ignoreDiscriminator: boolean): OutboundNumber;
37
+ export declare function OutboundNumberToJSON(json: any): OutboundNumber;
38
+ export declare function OutboundNumberToJSONTyped(value?: OutboundNumber | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Tivadar AI Backend API
6
+ * Unified REST API for Tivadar AI Voice Agents platform
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfOutboundNumber = instanceOfOutboundNumber;
17
+ exports.OutboundNumberFromJSON = OutboundNumberFromJSON;
18
+ exports.OutboundNumberFromJSONTyped = OutboundNumberFromJSONTyped;
19
+ exports.OutboundNumberToJSON = OutboundNumberToJSON;
20
+ exports.OutboundNumberToJSONTyped = OutboundNumberToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the OutboundNumber interface.
23
+ */
24
+ function instanceOfOutboundNumber(value) {
25
+ return true;
26
+ }
27
+ function OutboundNumberFromJSON(json) {
28
+ return OutboundNumberFromJSONTyped(json, false);
29
+ }
30
+ function OutboundNumberFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'id': json['id'] == null ? undefined : json['id'],
36
+ 'number': json['number'] == null ? undefined : json['number'],
37
+ };
38
+ }
39
+ function OutboundNumberToJSON(json) {
40
+ return OutboundNumberToJSONTyped(json, false);
41
+ }
42
+ function OutboundNumberToJSONTyped(value, ignoreDiscriminator = false) {
43
+ if (value == null) {
44
+ return value;
45
+ }
46
+ return {
47
+ 'id': value['id'],
48
+ 'number': value['number'],
49
+ };
50
+ }
@@ -72,6 +72,7 @@ export * from './OrganizationsOrganizationIdVoiceAgentsBasicGet200ResponseInner'
72
72
  export * from './OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdSandboxTokenPostRequest';
73
73
  export * from './OutboundCall';
74
74
  export * from './OutboundCallRequest';
75
+ export * from './OutboundNumber';
75
76
  export * from './PauseSubscriptionRequest';
76
77
  export * from './PhoneNumber';
77
78
  export * from './PhoneNumberCreate';
@@ -90,6 +90,7 @@ __exportStar(require("./OrganizationsOrganizationIdVoiceAgentsBasicGet200Respons
90
90
  __exportStar(require("./OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdSandboxTokenPostRequest"), exports);
91
91
  __exportStar(require("./OutboundCall"), exports);
92
92
  __exportStar(require("./OutboundCallRequest"), exports);
93
+ __exportStar(require("./OutboundNumber"), exports);
93
94
  __exportStar(require("./PauseSubscriptionRequest"), exports);
94
95
  __exportStar(require("./PhoneNumber"), exports);
95
96
  __exportStar(require("./PhoneNumberCreate"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@l7mp/tivadar-ai-api-sdk",
3
- "version": "0.2.16",
3
+ "version": "0.2.17",
4
4
  "description": "TypeScript/JavaScript SDK for Tivadar AI Backend API",
5
5
  "author": "L7mp Technologies",
6
6
  "repository": {
package/src/api-client.ts CHANGED
@@ -241,6 +241,7 @@ export class Api {
241
241
  };
242
242
  public readonly outboundCalls: {
243
243
  create: (organizationId: string, outboundCallRequest: OutboundCallRequest, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsPost"]>;
244
+ listNumbers: (organizationId: string, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsNumbersGet"]>;
244
245
  };
245
246
  public readonly voiceUsage: {
246
247
  report: (voiceUsageReportRequest: VoiceUsageReportRequest, options?: RequestInit) => ReturnType<VoiceUsageApi["voiceUsageReportPost"]>;
@@ -534,6 +535,7 @@ export class Api {
534
535
 
535
536
  this.outboundCalls = {
536
537
  create: (organizationId, outboundCallRequest, options) => this.outboundCallsApi.organizationsOrganizationIdOutboundCallsPost({ organizationId, outboundCallRequest }, options),
538
+ listNumbers: (organizationId, options) => this.outboundCallsApi.organizationsOrganizationIdOutboundCallsNumbersGet({ organizationId }, options),
537
539
  };
538
540
 
539
541
  this.voiceUsage = {
@@ -17,14 +17,21 @@ import * as runtime from '../runtime';
17
17
  import type {
18
18
  OutboundCall,
19
19
  OutboundCallRequest,
20
+ OutboundNumber,
20
21
  } from '../models/index';
21
22
  import {
22
23
  OutboundCallFromJSON,
23
24
  OutboundCallToJSON,
24
25
  OutboundCallRequestFromJSON,
25
26
  OutboundCallRequestToJSON,
27
+ OutboundNumberFromJSON,
28
+ OutboundNumberToJSON,
26
29
  } from '../models/index';
27
30
 
31
+ export interface OrganizationsOrganizationIdOutboundCallsNumbersGetRequest {
32
+ organizationId: string;
33
+ }
34
+
28
35
  export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
29
36
  organizationId: string;
30
37
  outboundCallRequest: OutboundCallRequest;
@@ -35,6 +42,53 @@ export interface OrganizationsOrganizationIdOutboundCallsPostRequest {
35
42
  */
36
43
  export class OutboundCallsApi extends runtime.BaseAPI {
37
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
+
38
92
  /**
39
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).
40
94
  * Place an outbound call with a voice agent
@@ -37,6 +37,12 @@ export interface OutboundCallRequest {
37
37
  * @memberof OutboundCallRequest
38
38
  */
39
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;
40
46
  }
41
47
 
42
48
  /**
@@ -60,6 +66,7 @@ export function OutboundCallRequestFromJSONTyped(json: any, ignoreDiscriminator:
60
66
  'voice_agent_id': json['voice_agent_id'],
61
67
  'phonebook_entry_id': json['phonebook_entry_id'] == null ? undefined : json['phonebook_entry_id'],
62
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'],
63
70
  };
64
71
  }
65
72
 
@@ -77,6 +84,7 @@ export function OutboundCallRequestToJSONTyped(value?: OutboundCallRequest | nul
77
84
  'voice_agent_id': value['voice_agent_id'],
78
85
  'phonebook_entry_id': value['phonebook_entry_id'],
79
86
  'destination_number': value['destination_number'],
87
+ 'from_phone_number_id': value['from_phone_number_id'],
80
88
  };
81
89
  }
82
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
+
@@ -74,6 +74,7 @@ export * from './OrganizationsOrganizationIdVoiceAgentsBasicGet200ResponseInner'
74
74
  export * from './OrganizationsOrganizationIdVoiceAgentsVoiceAgentIdSandboxTokenPostRequest';
75
75
  export * from './OutboundCall';
76
76
  export * from './OutboundCallRequest';
77
+ export * from './OutboundNumber';
77
78
  export * from './PauseSubscriptionRequest';
78
79
  export * from './PhoneNumber';
79
80
  export * from './PhoneNumberCreate';