@l7mp/tivadar-ai-api-sdk 0.2.17 → 0.2.19
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.
- package/dist/api-client.d.ts +7 -3
- package/dist/api-client.js +6 -2
- package/dist/apis/AdminPhoneNumbersApi.d.ts +1 -26
- package/dist/apis/AdminPhoneNumbersApi.js +0 -81
- package/dist/apis/LiveCallsApi.d.ts +45 -0
- package/dist/apis/LiveCallsApi.js +115 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/api-client.d.ts +7 -3
- package/dist/esm/api-client.js +6 -2
- package/dist/esm/apis/AdminPhoneNumbersApi.d.ts +1 -26
- package/dist/esm/apis/AdminPhoneNumbersApi.js +1 -82
- package/dist/esm/apis/LiveCallsApi.d.ts +45 -0
- package/dist/esm/apis/LiveCallsApi.js +111 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/AdminPhoneNumberUpdate.d.ts +6 -0
- package/dist/esm/models/AdminPhoneNumberUpdate.js +2 -0
- package/dist/esm/models/LiveCall.d.ts +57 -0
- package/dist/esm/models/LiveCall.js +50 -0
- package/dist/esm/models/LiveCallParticipant.d.ts +95 -0
- package/dist/esm/models/LiveCallParticipant.js +81 -0
- package/dist/esm/models/LiveCallToken.d.ts +44 -0
- package/dist/esm/models/LiveCallToken.js +45 -0
- package/dist/esm/models/PhoneNumberCreate.d.ts +6 -0
- package/dist/esm/models/PhoneNumberCreate.js +2 -0
- package/dist/esm/models/index.d.ts +3 -1
- package/dist/esm/models/index.js +3 -1
- package/dist/models/AdminPhoneNumberUpdate.d.ts +6 -0
- package/dist/models/AdminPhoneNumberUpdate.js +2 -0
- package/dist/models/LiveCall.d.ts +57 -0
- package/dist/models/LiveCall.js +57 -0
- package/dist/models/LiveCallParticipant.d.ts +95 -0
- package/dist/models/LiveCallParticipant.js +89 -0
- package/dist/models/LiveCallToken.d.ts +44 -0
- package/dist/models/LiveCallToken.js +52 -0
- package/dist/models/PhoneNumberCreate.d.ts +6 -0
- package/dist/models/PhoneNumberCreate.js +2 -0
- package/dist/models/index.d.ts +3 -1
- package/dist/models/index.js +3 -1
- package/package.json +1 -1
- package/src/api-client.ts +12 -5
- package/src/apis/AdminPhoneNumbersApi.ts +0 -114
- package/src/apis/LiveCallsApi.ts +144 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AdminPhoneNumberUpdate.ts +8 -0
- package/src/models/LiveCall.ts +105 -0
- package/src/models/LiveCallParticipant.ts +143 -0
- package/src/models/LiveCallToken.ts +81 -0
- package/src/models/PhoneNumberCreate.ts +8 -0
- package/src/models/index.ts +3 -1
package/src/api-client.ts
CHANGED
|
@@ -27,6 +27,7 @@ import { AdminSubscriptionsApi } from "./apis/AdminSubscriptionsApi";
|
|
|
27
27
|
import { AdminPhoneNumbersApi } from "./apis/AdminPhoneNumbersApi";
|
|
28
28
|
import { AdminSIPApi } from "./apis/AdminSIPApi";
|
|
29
29
|
import { OutboundCallsApi } from "./apis/OutboundCallsApi";
|
|
30
|
+
import { LiveCallsApi } from "./apis/LiveCallsApi";
|
|
30
31
|
import { VoiceUsageApi } from "./apis/VoiceUsageApi";
|
|
31
32
|
import { VoiceAgentsApi } from "./apis/VoiceAgentsApi";
|
|
32
33
|
import { ToolsApi } from "./apis/ToolsApi";
|
|
@@ -68,7 +69,6 @@ import type {
|
|
|
68
69
|
AdminGrantMinutesRequest,
|
|
69
70
|
AdminPhoneNumberUpdate,
|
|
70
71
|
AdminPhoneNumberAssign,
|
|
71
|
-
AdminPhoneNumberAssignOutbound,
|
|
72
72
|
AdminSipTrunkCreate,
|
|
73
73
|
AdminDispatchRuleCreate,
|
|
74
74
|
OutboundCallRequest,
|
|
@@ -222,8 +222,6 @@ export class Api {
|
|
|
222
222
|
delete: (phoneNumberId: number, options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersPhoneNumberIdDelete"]>;
|
|
223
223
|
assign: (phoneNumberId: number, adminPhoneNumberAssign: AdminPhoneNumberAssign, options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersPhoneNumberIdAssignPost"]>;
|
|
224
224
|
unassign: (phoneNumberId: number, options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersPhoneNumberIdUnassignPost"]>;
|
|
225
|
-
assignOutbound: (phoneNumberId: number, adminPhoneNumberAssignOutbound: AdminPhoneNumberAssignOutbound, options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersPhoneNumberIdAssignOutboundPost"]>;
|
|
226
|
-
unassignOutbound: (phoneNumberId: number, options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersPhoneNumberIdUnassignOutboundPost"]>;
|
|
227
225
|
listOrders: (params?: { status?: "pending" | "active" | "canceled"; organizationId?: string; requiresCallRedirect?: boolean; limit?: number; offset?: number }, options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersOrdersGet"]>;
|
|
228
226
|
processOrders: (options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersOrdersProcessPost"]>;
|
|
229
227
|
fulfillOrder: (orderId: string, options?: RequestInit) => ReturnType<AdminPhoneNumbersApi["adminPhoneNumbersOrdersOrderIdFulfillPost"]>;
|
|
@@ -243,6 +241,10 @@ export class Api {
|
|
|
243
241
|
create: (organizationId: string, outboundCallRequest: OutboundCallRequest, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsPost"]>;
|
|
244
242
|
listNumbers: (organizationId: string, options?: RequestInit) => ReturnType<OutboundCallsApi["organizationsOrganizationIdOutboundCallsNumbersGet"]>;
|
|
245
243
|
};
|
|
244
|
+
public readonly liveCalls: {
|
|
245
|
+
list: (organizationId: string, options?: RequestInit) => ReturnType<LiveCallsApi["organizationsOrganizationIdLiveCallsGet"]>;
|
|
246
|
+
createToken: (organizationId: string, roomName: string, options?: RequestInit) => ReturnType<LiveCallsApi["organizationsOrganizationIdLiveCallsRoomNameTokenPost"]>;
|
|
247
|
+
};
|
|
246
248
|
public readonly voiceUsage: {
|
|
247
249
|
report: (voiceUsageReportRequest: VoiceUsageReportRequest, options?: RequestInit) => ReturnType<VoiceUsageApi["voiceUsageReportPost"]>;
|
|
248
250
|
};
|
|
@@ -305,6 +307,7 @@ export class Api {
|
|
|
305
307
|
private readonly adminPhoneNumbersApi: AdminPhoneNumbersApi;
|
|
306
308
|
private readonly adminSipApi: AdminSIPApi;
|
|
307
309
|
private readonly outboundCallsApi: OutboundCallsApi;
|
|
310
|
+
private readonly liveCallsApi: LiveCallsApi;
|
|
308
311
|
private readonly voiceUsageApi: VoiceUsageApi;
|
|
309
312
|
private readonly embeddingProvidersApi: EmbeddingProvidersApi;
|
|
310
313
|
private readonly llmProvidersApi: LLMProvidersApi;
|
|
@@ -352,6 +355,7 @@ export class Api {
|
|
|
352
355
|
this.adminPhoneNumbersApi = new AdminPhoneNumbersApi(configuration);
|
|
353
356
|
this.adminSipApi = new AdminSIPApi(configuration);
|
|
354
357
|
this.outboundCallsApi = new OutboundCallsApi(configuration);
|
|
358
|
+
this.liveCallsApi = new LiveCallsApi(configuration);
|
|
355
359
|
this.voiceUsageApi = new VoiceUsageApi(configuration);
|
|
356
360
|
this.embeddingProvidersApi = new EmbeddingProvidersApi(configuration);
|
|
357
361
|
this.llmProvidersApi = new LLMProvidersApi(configuration);
|
|
@@ -514,8 +518,6 @@ export class Api {
|
|
|
514
518
|
delete: (phoneNumberId, options) => this.adminPhoneNumbersApi.adminPhoneNumbersPhoneNumberIdDelete({ phoneNumberId }, options),
|
|
515
519
|
assign: (phoneNumberId, adminPhoneNumberAssign, options) => this.adminPhoneNumbersApi.adminPhoneNumbersPhoneNumberIdAssignPost({ phoneNumberId, adminPhoneNumberAssign }, options),
|
|
516
520
|
unassign: (phoneNumberId, options) => this.adminPhoneNumbersApi.adminPhoneNumbersPhoneNumberIdUnassignPost({ phoneNumberId }, options),
|
|
517
|
-
assignOutbound: (phoneNumberId, adminPhoneNumberAssignOutbound, options) => this.adminPhoneNumbersApi.adminPhoneNumbersPhoneNumberIdAssignOutboundPost({ phoneNumberId, adminPhoneNumberAssignOutbound }, options),
|
|
518
|
-
unassignOutbound: (phoneNumberId, options) => this.adminPhoneNumbersApi.adminPhoneNumbersPhoneNumberIdUnassignOutboundPost({ phoneNumberId }, options),
|
|
519
521
|
listOrders: (params, options) => this.adminPhoneNumbersApi.adminPhoneNumbersOrdersGet({ status: params?.status, organizationId: params?.organizationId, requiresCallRedirect: params?.requiresCallRedirect, limit: params?.limit, offset: params?.offset }, options),
|
|
520
522
|
processOrders: (options) => this.adminPhoneNumbersApi.adminPhoneNumbersOrdersProcessPost(options),
|
|
521
523
|
fulfillOrder: (orderId, options) => this.adminPhoneNumbersApi.adminPhoneNumbersOrdersOrderIdFulfillPost({ orderId }, options),
|
|
@@ -538,6 +540,11 @@ export class Api {
|
|
|
538
540
|
listNumbers: (organizationId, options) => this.outboundCallsApi.organizationsOrganizationIdOutboundCallsNumbersGet({ organizationId }, options),
|
|
539
541
|
};
|
|
540
542
|
|
|
543
|
+
this.liveCalls = {
|
|
544
|
+
list: (organizationId, options) => this.liveCallsApi.organizationsOrganizationIdLiveCallsGet({ organizationId }, options),
|
|
545
|
+
createToken: (organizationId, roomName, options) => this.liveCallsApi.organizationsOrganizationIdLiveCallsRoomNameTokenPost({ organizationId, roomName }, options),
|
|
546
|
+
};
|
|
547
|
+
|
|
541
548
|
this.voiceUsage = {
|
|
542
549
|
report: (voiceUsageReportRequest, options) => this.voiceUsageApi.voiceUsageReportPost({ voiceUsageReportRequest }, options),
|
|
543
550
|
};
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
18
|
AdminPhoneNumberAssign,
|
|
19
|
-
AdminPhoneNumberAssignOutbound,
|
|
20
19
|
AdminPhoneNumberDetail,
|
|
21
20
|
AdminPhoneNumberUpdate,
|
|
22
21
|
AdminPhoneNumbersListResponse,
|
|
@@ -29,8 +28,6 @@ import type {
|
|
|
29
28
|
import {
|
|
30
29
|
AdminPhoneNumberAssignFromJSON,
|
|
31
30
|
AdminPhoneNumberAssignToJSON,
|
|
32
|
-
AdminPhoneNumberAssignOutboundFromJSON,
|
|
33
|
-
AdminPhoneNumberAssignOutboundToJSON,
|
|
34
31
|
AdminPhoneNumberDetailFromJSON,
|
|
35
32
|
AdminPhoneNumberDetailToJSON,
|
|
36
33
|
AdminPhoneNumberUpdateFromJSON,
|
|
@@ -74,11 +71,6 @@ export interface AdminPhoneNumbersOrdersOrderIdFulfillPostRequest {
|
|
|
74
71
|
orderId: string;
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
export interface AdminPhoneNumbersPhoneNumberIdAssignOutboundPostRequest {
|
|
78
|
-
phoneNumberId: number;
|
|
79
|
-
adminPhoneNumberAssignOutbound: AdminPhoneNumberAssignOutbound;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
74
|
export interface AdminPhoneNumbersPhoneNumberIdAssignPostRequest {
|
|
83
75
|
phoneNumberId: number;
|
|
84
76
|
adminPhoneNumberAssign: AdminPhoneNumberAssign;
|
|
@@ -97,10 +89,6 @@ export interface AdminPhoneNumbersPhoneNumberIdPatchRequest {
|
|
|
97
89
|
adminPhoneNumberUpdate: AdminPhoneNumberUpdate;
|
|
98
90
|
}
|
|
99
91
|
|
|
100
|
-
export interface AdminPhoneNumbersPhoneNumberIdUnassignOutboundPostRequest {
|
|
101
|
-
phoneNumberId: number;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
92
|
export interface AdminPhoneNumbersPhoneNumberIdUnassignPostRequest {
|
|
105
93
|
phoneNumberId: number;
|
|
106
94
|
}
|
|
@@ -359,63 +347,6 @@ export class AdminPhoneNumbersApi extends runtime.BaseAPI {
|
|
|
359
347
|
return await response.value();
|
|
360
348
|
}
|
|
361
349
|
|
|
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
|
-
|
|
419
350
|
/**
|
|
420
351
|
* Creates a SIP trunk (and, if an agent is given, a dispatch rule) and links the number.
|
|
421
352
|
* Assign a phone number to an organization (app-admin only)
|
|
@@ -619,51 +550,6 @@ export class AdminPhoneNumbersApi extends runtime.BaseAPI {
|
|
|
619
550
|
return await response.value();
|
|
620
551
|
}
|
|
621
552
|
|
|
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
|
-
|
|
667
553
|
/**
|
|
668
554
|
* Deletes the LiveKit dispatch rule + trunk and frees the number back to the pool.
|
|
669
555
|
* Release a phone number from its organization (app-admin only)
|
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
LiveCall,
|
|
19
|
+
LiveCallToken,
|
|
20
|
+
} from '../models/index';
|
|
21
|
+
import {
|
|
22
|
+
LiveCallFromJSON,
|
|
23
|
+
LiveCallToJSON,
|
|
24
|
+
LiveCallTokenFromJSON,
|
|
25
|
+
LiveCallTokenToJSON,
|
|
26
|
+
} from '../models/index';
|
|
27
|
+
|
|
28
|
+
export interface OrganizationsOrganizationIdLiveCallsGetRequest {
|
|
29
|
+
organizationId: string;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface OrganizationsOrganizationIdLiveCallsRoomNameTokenPostRequest {
|
|
33
|
+
organizationId: string;
|
|
34
|
+
roomName: string;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
*/
|
|
40
|
+
export class LiveCallsApi extends runtime.BaseAPI {
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Returns the organization\'s live calls, each with its participants (caller, agent, operators). Rooms are attributed to the org by their metadata or by matching the org\'s own agents/trunks (fail-closed).
|
|
44
|
+
* List ongoing calls (live LiveKit rooms) for the organization (app-admin only)
|
|
45
|
+
*/
|
|
46
|
+
async organizationsOrganizationIdLiveCallsGetRaw(requestParameters: OrganizationsOrganizationIdLiveCallsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<LiveCall>>> {
|
|
47
|
+
if (requestParameters['organizationId'] == null) {
|
|
48
|
+
throw new runtime.RequiredError(
|
|
49
|
+
'organizationId',
|
|
50
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdLiveCallsGet().'
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const queryParameters: any = {};
|
|
55
|
+
|
|
56
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
57
|
+
|
|
58
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
59
|
+
const token = this.configuration.accessToken;
|
|
60
|
+
const tokenString = await token("bearerAuth", []);
|
|
61
|
+
|
|
62
|
+
if (tokenString) {
|
|
63
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
let urlPath = `/organizations/{organizationId}/live-calls`;
|
|
68
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
69
|
+
|
|
70
|
+
const response = await this.request({
|
|
71
|
+
path: urlPath,
|
|
72
|
+
method: 'GET',
|
|
73
|
+
headers: headerParameters,
|
|
74
|
+
query: queryParameters,
|
|
75
|
+
}, initOverrides);
|
|
76
|
+
|
|
77
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(LiveCallFromJSON));
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Returns the organization\'s live calls, each with its participants (caller, agent, operators). Rooms are attributed to the org by their metadata or by matching the org\'s own agents/trunks (fail-closed).
|
|
82
|
+
* List ongoing calls (live LiveKit rooms) for the organization (app-admin only)
|
|
83
|
+
*/
|
|
84
|
+
async organizationsOrganizationIdLiveCallsGet(requestParameters: OrganizationsOrganizationIdLiveCallsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<LiveCall>> {
|
|
85
|
+
const response = await this.organizationsOrganizationIdLiveCallsGetRaw(requestParameters, initOverrides);
|
|
86
|
+
return await response.value();
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Returns a LiveKit access token with talk + listen + room-admin grants so an operator can join the call. The room must belong to the organization.
|
|
91
|
+
* Mint an admin access token to join a live call (app-admin only)
|
|
92
|
+
*/
|
|
93
|
+
async organizationsOrganizationIdLiveCallsRoomNameTokenPostRaw(requestParameters: OrganizationsOrganizationIdLiveCallsRoomNameTokenPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LiveCallToken>> {
|
|
94
|
+
if (requestParameters['organizationId'] == null) {
|
|
95
|
+
throw new runtime.RequiredError(
|
|
96
|
+
'organizationId',
|
|
97
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdLiveCallsRoomNameTokenPost().'
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (requestParameters['roomName'] == null) {
|
|
102
|
+
throw new runtime.RequiredError(
|
|
103
|
+
'roomName',
|
|
104
|
+
'Required parameter "roomName" was null or undefined when calling organizationsOrganizationIdLiveCallsRoomNameTokenPost().'
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const queryParameters: any = {};
|
|
109
|
+
|
|
110
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
111
|
+
|
|
112
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
113
|
+
const token = this.configuration.accessToken;
|
|
114
|
+
const tokenString = await token("bearerAuth", []);
|
|
115
|
+
|
|
116
|
+
if (tokenString) {
|
|
117
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let urlPath = `/organizations/{organizationId}/live-calls/{roomName}/token`;
|
|
122
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
123
|
+
urlPath = urlPath.replace(`{${"roomName"}}`, encodeURIComponent(String(requestParameters['roomName'])));
|
|
124
|
+
|
|
125
|
+
const response = await this.request({
|
|
126
|
+
path: urlPath,
|
|
127
|
+
method: 'POST',
|
|
128
|
+
headers: headerParameters,
|
|
129
|
+
query: queryParameters,
|
|
130
|
+
}, initOverrides);
|
|
131
|
+
|
|
132
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => LiveCallTokenFromJSON(jsonValue));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Returns a LiveKit access token with talk + listen + room-admin grants so an operator can join the call. The room must belong to the organization.
|
|
137
|
+
* Mint an admin access token to join a live call (app-admin only)
|
|
138
|
+
*/
|
|
139
|
+
async organizationsOrganizationIdLiveCallsRoomNameTokenPost(requestParameters: OrganizationsOrganizationIdLiveCallsRoomNameTokenPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LiveCallToken> {
|
|
140
|
+
const response = await this.organizationsOrganizationIdLiveCallsRoomNameTokenPostRaw(requestParameters, initOverrides);
|
|
141
|
+
return await response.value();
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -11,6 +11,7 @@ export * from './EmbeddingProvidersApi';
|
|
|
11
11
|
export * from './HistoryApi';
|
|
12
12
|
export * from './InvitationsApi';
|
|
13
13
|
export * from './LLMProvidersApi';
|
|
14
|
+
export * from './LiveCallsApi';
|
|
14
15
|
export * from './MembersApi';
|
|
15
16
|
export * from './NotificationsApi';
|
|
16
17
|
export * from './OrganizationsApi';
|
|
@@ -49,6 +49,12 @@ export interface AdminPhoneNumberUpdate {
|
|
|
49
49
|
* @memberof AdminPhoneNumberUpdate
|
|
50
50
|
*/
|
|
51
51
|
auth_password?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Associate the outbound number with an org (uuid), or null to clear.
|
|
54
|
+
* @type {string}
|
|
55
|
+
* @memberof AdminPhoneNumberUpdate
|
|
56
|
+
*/
|
|
57
|
+
outbound_organization_id?: string | null;
|
|
52
58
|
}
|
|
53
59
|
|
|
54
60
|
/**
|
|
@@ -73,6 +79,7 @@ export function AdminPhoneNumberUpdateFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
73
79
|
'sip_address': json['sip_address'] == null ? undefined : json['sip_address'],
|
|
74
80
|
'auth_username': json['auth_username'] == null ? undefined : json['auth_username'],
|
|
75
81
|
'auth_password': json['auth_password'] == null ? undefined : json['auth_password'],
|
|
82
|
+
'outbound_organization_id': json['outbound_organization_id'] == null ? undefined : json['outbound_organization_id'],
|
|
76
83
|
};
|
|
77
84
|
}
|
|
78
85
|
|
|
@@ -92,6 +99,7 @@ export function AdminPhoneNumberUpdateToJSONTyped(value?: AdminPhoneNumberUpdate
|
|
|
92
99
|
'sip_address': value['sip_address'],
|
|
93
100
|
'auth_username': value['auth_username'],
|
|
94
101
|
'auth_password': value['auth_password'],
|
|
102
|
+
'outbound_organization_id': value['outbound_organization_id'],
|
|
95
103
|
};
|
|
96
104
|
}
|
|
97
105
|
|
|
@@ -0,0 +1,105 @@
|
|
|
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
|
+
import type { LiveCallParticipant } from './LiveCallParticipant';
|
|
17
|
+
import {
|
|
18
|
+
LiveCallParticipantFromJSON,
|
|
19
|
+
LiveCallParticipantFromJSONTyped,
|
|
20
|
+
LiveCallParticipantToJSON,
|
|
21
|
+
LiveCallParticipantToJSONTyped,
|
|
22
|
+
} from './LiveCallParticipant';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface LiveCall
|
|
28
|
+
*/
|
|
29
|
+
export interface LiveCall {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof LiveCall
|
|
34
|
+
*/
|
|
35
|
+
room_name?: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {string}
|
|
39
|
+
* @memberof LiveCall
|
|
40
|
+
*/
|
|
41
|
+
room_sid?: string;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {Date}
|
|
45
|
+
* @memberof LiveCall
|
|
46
|
+
*/
|
|
47
|
+
started_at?: Date | null;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @type {number}
|
|
51
|
+
* @memberof LiveCall
|
|
52
|
+
*/
|
|
53
|
+
num_participants?: number;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* @type {Array<LiveCallParticipant>}
|
|
57
|
+
* @memberof LiveCall
|
|
58
|
+
*/
|
|
59
|
+
participants?: Array<LiveCallParticipant>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Check if a given object implements the LiveCall interface.
|
|
64
|
+
*/
|
|
65
|
+
export function instanceOfLiveCall(value: object): value is LiveCall {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function LiveCallFromJSON(json: any): LiveCall {
|
|
70
|
+
return LiveCallFromJSONTyped(json, false);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function LiveCallFromJSONTyped(json: any, ignoreDiscriminator: boolean): LiveCall {
|
|
74
|
+
if (json == null) {
|
|
75
|
+
return json;
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'room_name': json['room_name'] == null ? undefined : json['room_name'],
|
|
80
|
+
'room_sid': json['room_sid'] == null ? undefined : json['room_sid'],
|
|
81
|
+
'started_at': json['started_at'] == null ? undefined : (new Date(json['started_at'])),
|
|
82
|
+
'num_participants': json['num_participants'] == null ? undefined : json['num_participants'],
|
|
83
|
+
'participants': json['participants'] == null ? undefined : ((json['participants'] as Array<any>).map(LiveCallParticipantFromJSON)),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function LiveCallToJSON(json: any): LiveCall {
|
|
88
|
+
return LiveCallToJSONTyped(json, false);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export function LiveCallToJSONTyped(value?: LiveCall | null, ignoreDiscriminator: boolean = false): any {
|
|
92
|
+
if (value == null) {
|
|
93
|
+
return value;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
|
|
98
|
+
'room_name': value['room_name'],
|
|
99
|
+
'room_sid': value['room_sid'],
|
|
100
|
+
'started_at': value['started_at'] == null ? value['started_at'] : value['started_at'].toISOString(),
|
|
101
|
+
'num_participants': value['num_participants'],
|
|
102
|
+
'participants': value['participants'] == null ? undefined : ((value['participants'] as Array<any>).map(LiveCallParticipantToJSON)),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
@@ -0,0 +1,143 @@
|
|
|
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 LiveCallParticipant
|
|
20
|
+
*/
|
|
21
|
+
export interface LiveCallParticipant {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {string}
|
|
25
|
+
* @memberof LiveCallParticipant
|
|
26
|
+
*/
|
|
27
|
+
identity?: string;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {string}
|
|
31
|
+
* @memberof LiveCallParticipant
|
|
32
|
+
*/
|
|
33
|
+
name?: string | null;
|
|
34
|
+
/**
|
|
35
|
+
* LiveKit participant kind.
|
|
36
|
+
* @type {string}
|
|
37
|
+
* @memberof LiveCallParticipant
|
|
38
|
+
*/
|
|
39
|
+
kind?: LiveCallParticipantKindEnum;
|
|
40
|
+
/**
|
|
41
|
+
* Interpreted role — sip→caller, agent→agent, standard→operator.
|
|
42
|
+
* @type {string}
|
|
43
|
+
* @memberof LiveCallParticipant
|
|
44
|
+
*/
|
|
45
|
+
role?: LiveCallParticipantRoleEnum;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof LiveCallParticipant
|
|
50
|
+
*/
|
|
51
|
+
state?: LiveCallParticipantStateEnum;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @type {Date}
|
|
55
|
+
* @memberof LiveCallParticipant
|
|
56
|
+
*/
|
|
57
|
+
joined_at?: Date | null;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* @export
|
|
63
|
+
*/
|
|
64
|
+
export const LiveCallParticipantKindEnum = {
|
|
65
|
+
Standard: 'standard',
|
|
66
|
+
Sip: 'sip',
|
|
67
|
+
Agent: 'agent',
|
|
68
|
+
Ingress: 'ingress',
|
|
69
|
+
Egress: 'egress',
|
|
70
|
+
Unknown: 'unknown'
|
|
71
|
+
} as const;
|
|
72
|
+
export type LiveCallParticipantKindEnum = typeof LiveCallParticipantKindEnum[keyof typeof LiveCallParticipantKindEnum];
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* @export
|
|
76
|
+
*/
|
|
77
|
+
export const LiveCallParticipantRoleEnum = {
|
|
78
|
+
Caller: 'caller',
|
|
79
|
+
Agent: 'agent',
|
|
80
|
+
Operator: 'operator',
|
|
81
|
+
Other: 'other'
|
|
82
|
+
} as const;
|
|
83
|
+
export type LiveCallParticipantRoleEnum = typeof LiveCallParticipantRoleEnum[keyof typeof LiveCallParticipantRoleEnum];
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* @export
|
|
87
|
+
*/
|
|
88
|
+
export const LiveCallParticipantStateEnum = {
|
|
89
|
+
Joining: 'joining',
|
|
90
|
+
Joined: 'joined',
|
|
91
|
+
Active: 'active',
|
|
92
|
+
Disconnected: 'disconnected',
|
|
93
|
+
Unknown: 'unknown'
|
|
94
|
+
} as const;
|
|
95
|
+
export type LiveCallParticipantStateEnum = typeof LiveCallParticipantStateEnum[keyof typeof LiveCallParticipantStateEnum];
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Check if a given object implements the LiveCallParticipant interface.
|
|
100
|
+
*/
|
|
101
|
+
export function instanceOfLiveCallParticipant(value: object): value is LiveCallParticipant {
|
|
102
|
+
return true;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function LiveCallParticipantFromJSON(json: any): LiveCallParticipant {
|
|
106
|
+
return LiveCallParticipantFromJSONTyped(json, false);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function LiveCallParticipantFromJSONTyped(json: any, ignoreDiscriminator: boolean): LiveCallParticipant {
|
|
110
|
+
if (json == null) {
|
|
111
|
+
return json;
|
|
112
|
+
}
|
|
113
|
+
return {
|
|
114
|
+
|
|
115
|
+
'identity': json['identity'] == null ? undefined : json['identity'],
|
|
116
|
+
'name': json['name'] == null ? undefined : json['name'],
|
|
117
|
+
'kind': json['kind'] == null ? undefined : json['kind'],
|
|
118
|
+
'role': json['role'] == null ? undefined : json['role'],
|
|
119
|
+
'state': json['state'] == null ? undefined : json['state'],
|
|
120
|
+
'joined_at': json['joined_at'] == null ? undefined : (new Date(json['joined_at'])),
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export function LiveCallParticipantToJSON(json: any): LiveCallParticipant {
|
|
125
|
+
return LiveCallParticipantToJSONTyped(json, false);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export function LiveCallParticipantToJSONTyped(value?: LiveCallParticipant | null, ignoreDiscriminator: boolean = false): any {
|
|
129
|
+
if (value == null) {
|
|
130
|
+
return value;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
|
|
135
|
+
'identity': value['identity'],
|
|
136
|
+
'name': value['name'],
|
|
137
|
+
'kind': value['kind'],
|
|
138
|
+
'role': value['role'],
|
|
139
|
+
'state': value['state'],
|
|
140
|
+
'joined_at': value['joined_at'] == null ? value['joined_at'] : value['joined_at'].toISOString(),
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|