@l7mp/tivadar-ai-api-sdk 0.1.5 → 0.1.7

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 (41) hide show
  1. package/dist/api-client.d.ts +11 -2
  2. package/dist/api-client.js +10 -1
  3. package/dist/apis/CallsApi.d.ts +92 -0
  4. package/dist/apis/CallsApi.js +256 -0
  5. package/dist/apis/RecordingsApi.d.ts +6 -6
  6. package/dist/apis/RecordingsApi.js +10 -10
  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 +11 -2
  10. package/dist/esm/api-client.js +10 -1
  11. package/dist/esm/apis/CallsApi.d.ts +92 -0
  12. package/dist/esm/apis/CallsApi.js +252 -0
  13. package/dist/esm/apis/RecordingsApi.d.ts +6 -6
  14. package/dist/esm/apis/RecordingsApi.js +10 -10
  15. package/dist/esm/apis/index.d.ts +1 -0
  16. package/dist/esm/apis/index.js +1 -0
  17. package/dist/esm/models/Call.d.ts +64 -0
  18. package/dist/esm/models/Call.js +55 -0
  19. package/dist/esm/models/CallCreate.d.ts +52 -0
  20. package/dist/esm/models/CallCreate.js +47 -0
  21. package/dist/esm/models/CallUpdate.d.ts +52 -0
  22. package/dist/esm/models/CallUpdate.js +47 -0
  23. package/dist/esm/models/index.d.ts +3 -0
  24. package/dist/esm/models/index.js +3 -0
  25. package/dist/models/Call.d.ts +64 -0
  26. package/dist/models/Call.js +62 -0
  27. package/dist/models/CallCreate.d.ts +52 -0
  28. package/dist/models/CallCreate.js +54 -0
  29. package/dist/models/CallUpdate.d.ts +52 -0
  30. package/dist/models/CallUpdate.js +54 -0
  31. package/dist/models/index.d.ts +3 -0
  32. package/dist/models/index.js +3 -0
  33. package/package.json +1 -2
  34. package/src/api-client.ts +22 -2
  35. package/src/apis/CallsApi.ts +352 -0
  36. package/src/apis/RecordingsApi.ts +13 -13
  37. package/src/apis/index.ts +1 -0
  38. package/src/models/Call.ts +107 -0
  39. package/src/models/CallCreate.ts +89 -0
  40. package/src/models/CallUpdate.ts +89 -0
  41. package/src/models/index.ts +3 -0
@@ -1,3 +1,4 @@
1
+ import { CallsApi, type OrganizationsOrganizationIdCallsGetSandboxEnum } from "./apis/CallsApi";
1
2
  import { CalendarApi } from "./apis/CalendarApi";
2
3
  import { ChatAgentsApi } from "./apis/ChatAgentsApi";
3
4
  import { HistoryApi } from "./apis/HistoryApi";
@@ -14,7 +15,7 @@ import { STTProvidersApi } from "./apis/STTProvidersApi";
14
15
  import { TTSProvidersApi } from "./apis/TTSProvidersApi";
15
16
  import { SubscriptionApi } from "./apis/SubscriptionApi";
16
17
  import { VoiceAgentsApi } from "./apis/VoiceAgentsApi";
17
- import type { VoiceAgentCreate, VoiceAgentUpdate, ChatAgentCreate, ChatAgentUpdate, Calendar, CalendarCreate, CalendarUpdate, CalendarEventCreate, CalendarEventUpdate, InvitationAccept, InvitationCreate, RagConfigCreate, SipTrunkCreate, DispatchRuleCreate, OrganizationCreate, CreateCheckoutSessionRequest, CancelSubscriptionRequest, UpdatePlanRequest, PauseSubscriptionRequest, BillingPortalRequest } from "./models";
18
+ import type { CallCreate, CallUpdate, VoiceAgentCreate, VoiceAgentUpdate, ChatAgentCreate, ChatAgentUpdate, Calendar, CalendarCreate, CalendarUpdate, CalendarEventCreate, CalendarEventUpdate, InvitationAccept, InvitationCreate, RagConfigCreate, SipTrunkCreate, DispatchRuleCreate, OrganizationCreate, CreateCheckoutSessionRequest, CancelSubscriptionRequest, UpdatePlanRequest, PauseSubscriptionRequest, BillingPortalRequest } from "./models";
18
19
  export interface ApiClientConfig {
19
20
  baseUrl: string;
20
21
  options?: {
@@ -22,6 +23,13 @@ export interface ApiClientConfig {
22
23
  };
23
24
  }
24
25
  export declare class Api {
26
+ readonly calls: {
27
+ list: (organizationId: string, voiceAgentId?: string, sandbox?: OrganizationsOrganizationIdCallsGetSandboxEnum, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsGet"]>;
28
+ get: (organizationId: string, callId: string, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsCallIdGet"]>;
29
+ create: (organizationId: string, callCreate: CallCreate, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsPost"]>;
30
+ update: (organizationId: string, callId: string, callUpdate: CallUpdate, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsCallIdPut"]>;
31
+ delete: (organizationId: string, callId: string, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsCallIdDelete"]>;
32
+ };
25
33
  readonly voiceAgents: {
26
34
  list: (organizationId: string, options?: RequestInit) => ReturnType<VoiceAgentsApi["organizationsOrganizationIdVoiceAgentsGet"]>;
27
35
  listBasic: (organizationId: string, options?: RequestInit) => ReturnType<VoiceAgentsApi["organizationsOrganizationIdVoiceAgentsBasicGet"]>;
@@ -63,7 +71,7 @@ export declare class Api {
63
71
  create: (organizationId: string, invitationCreate: InvitationCreate, options?: RequestInit) => ReturnType<InvitationsApi["organizationsOrganizationIdInvitationsPost"]>;
64
72
  };
65
73
  readonly recordings: {
66
- get: (organizationId: string, conversationId: string, options?: RequestInit) => ReturnType<RecordingsApi["organizationsOrganizationIdRecordingsConversationIdGet"]>;
74
+ get: (organizationId: string, callId: string, options?: RequestInit) => ReturnType<RecordingsApi["organizationsOrganizationIdRecordingsCallIdGet"]>;
67
75
  };
68
76
  readonly members: {
69
77
  list: (organizationId: string, options?: RequestInit) => ReturnType<MembersApi["organizationsOrganizationIdMembersGet"]>;
@@ -120,6 +128,7 @@ export declare class Api {
120
128
  readonly embeddingProviders: {
121
129
  list: (organizationId: string, options?: RequestInit) => ReturnType<EmbeddingProvidersApi["organizationsOrganizationIdEmbeddingProvidersGet"]>;
122
130
  };
131
+ private readonly callsApi;
123
132
  private readonly voiceAgentsApi;
124
133
  private readonly chatAgentsApi;
125
134
  private readonly calendarApi;
@@ -10,6 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.Api = void 0;
13
+ const CallsApi_1 = require("./apis/CallsApi");
13
14
  const CalendarApi_1 = require("./apis/CalendarApi");
14
15
  const ChatAgentsApi_1 = require("./apis/ChatAgentsApi");
15
16
  const HistoryApi_1 = require("./apis/HistoryApi");
@@ -45,6 +46,7 @@ class Api {
45
46
  // Pass the headers object by reference so mutations are picked up at request time
46
47
  headers: this._auth.headers,
47
48
  });
49
+ this.callsApi = new CallsApi_1.CallsApi(configuration);
48
50
  this.voiceAgentsApi = new VoiceAgentsApi_1.VoiceAgentsApi(configuration);
49
51
  this.chatAgentsApi = new ChatAgentsApi_1.ChatAgentsApi(configuration);
50
52
  this.calendarApi = new CalendarApi_1.CalendarApi(configuration);
@@ -61,6 +63,13 @@ class Api {
61
63
  this.llmProvidersApi = new LLMProvidersApi_1.LLMProvidersApi(configuration);
62
64
  this.sttProvidersApi = new STTProvidersApi_1.STTProvidersApi(configuration);
63
65
  this.ttsProvidersApi = new TTSProvidersApi_1.TTSProvidersApi(configuration);
66
+ this.calls = {
67
+ list: (organizationId, voiceAgentId, sandbox, options) => this.callsApi.organizationsOrganizationIdCallsGet({ organizationId, voiceAgentId, sandbox }, options),
68
+ get: (organizationId, callId, options) => this.callsApi.organizationsOrganizationIdCallsCallIdGet({ organizationId, callId }, options),
69
+ create: (organizationId, callCreate, options) => this.callsApi.organizationsOrganizationIdCallsPost({ organizationId, callCreate }, options),
70
+ update: (organizationId, callId, callUpdate, options) => this.callsApi.organizationsOrganizationIdCallsCallIdPut({ organizationId, callId, callUpdate }, options),
71
+ delete: (organizationId, callId, options) => this.callsApi.organizationsOrganizationIdCallsCallIdDelete({ organizationId, callId }, options),
72
+ };
64
73
  this.voiceAgents = {
65
74
  list: (organizationId, options) => this.voiceAgentsApi.organizationsOrganizationIdVoiceAgentsGet({ organizationId }, options),
66
75
  listBasic: (organizationId, options) => this.voiceAgentsApi.organizationsOrganizationIdVoiceAgentsBasicGet({ organizationId }, options),
@@ -106,7 +115,7 @@ class Api {
106
115
  create: (organizationId, invitationCreate, options) => this.invitationsApi.organizationsOrganizationIdInvitationsPost({ organizationId, invitationCreate }, options),
107
116
  };
108
117
  this.recordings = {
109
- get: (organizationId, conversationId, options) => this.recordingsApi.organizationsOrganizationIdRecordingsConversationIdGet({ organizationId, conversationId }, options),
118
+ get: (organizationId, callId, options) => this.recordingsApi.organizationsOrganizationIdRecordingsCallIdGet({ organizationId, callId }, options),
110
119
  };
111
120
  this.members = {
112
121
  list: (organizationId, options) => this.membersApi.organizationsOrganizationIdMembersGet({ organizationId }, options),
@@ -0,0 +1,92 @@
1
+ /**
2
+ * Tivadar AI Backend API
3
+ * Unified REST API for Tivadar AI Voice Agents platform
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import type { Call, CallCreate, CallUpdate } from '../models/index';
14
+ export interface OrganizationsOrganizationIdCallsCallIdDeleteRequest {
15
+ organizationId: string;
16
+ callId: string;
17
+ }
18
+ export interface OrganizationsOrganizationIdCallsCallIdGetRequest {
19
+ organizationId: string;
20
+ callId: string;
21
+ }
22
+ export interface OrganizationsOrganizationIdCallsCallIdPutRequest {
23
+ organizationId: string;
24
+ callId: string;
25
+ callUpdate: CallUpdate;
26
+ }
27
+ export interface OrganizationsOrganizationIdCallsGetRequest {
28
+ organizationId: string;
29
+ voiceAgentId?: string;
30
+ sandbox?: OrganizationsOrganizationIdCallsGetSandboxEnum;
31
+ }
32
+ export interface OrganizationsOrganizationIdCallsPostRequest {
33
+ organizationId: string;
34
+ callCreate: CallCreate;
35
+ }
36
+ /**
37
+ *
38
+ */
39
+ export declare class CallsApi extends runtime.BaseAPI {
40
+ /**
41
+ * Delete a call
42
+ */
43
+ organizationsOrganizationIdCallsCallIdDeleteRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
44
+ /**
45
+ * Delete a call
46
+ */
47
+ organizationsOrganizationIdCallsCallIdDelete(requestParameters: OrganizationsOrganizationIdCallsCallIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
48
+ /**
49
+ * Get a call by ID
50
+ */
51
+ organizationsOrganizationIdCallsCallIdGetRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Call>>;
52
+ /**
53
+ * Get a call by ID
54
+ */
55
+ organizationsOrganizationIdCallsCallIdGet(requestParameters: OrganizationsOrganizationIdCallsCallIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Call>;
56
+ /**
57
+ * Partial update — only provided fields are modified.
58
+ * Update a call
59
+ */
60
+ organizationsOrganizationIdCallsCallIdPutRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Call>>;
61
+ /**
62
+ * Partial update — only provided fields are modified.
63
+ * Update a call
64
+ */
65
+ organizationsOrganizationIdCallsCallIdPut(requestParameters: OrganizationsOrganizationIdCallsCallIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Call>;
66
+ /**
67
+ * Returns calls scoped to the organization via their associated voice agent. Calls without a voice_agent_id are not returned.
68
+ * List calls for an organization
69
+ */
70
+ organizationsOrganizationIdCallsGetRaw(requestParameters: OrganizationsOrganizationIdCallsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<Call>>>;
71
+ /**
72
+ * Returns calls scoped to the organization via their associated voice agent. Calls without a voice_agent_id are not returned.
73
+ * List calls for an organization
74
+ */
75
+ organizationsOrganizationIdCallsGet(requestParameters: OrganizationsOrganizationIdCallsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<Call>>;
76
+ /**
77
+ * Create a new call record
78
+ */
79
+ organizationsOrganizationIdCallsPostRaw(requestParameters: OrganizationsOrganizationIdCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Call>>;
80
+ /**
81
+ * Create a new call record
82
+ */
83
+ organizationsOrganizationIdCallsPost(requestParameters: OrganizationsOrganizationIdCallsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Call>;
84
+ }
85
+ /**
86
+ * @export
87
+ */
88
+ export declare const OrganizationsOrganizationIdCallsGetSandboxEnum: {
89
+ readonly True: "true";
90
+ readonly False: "false";
91
+ };
92
+ export type OrganizationsOrganizationIdCallsGetSandboxEnum = typeof OrganizationsOrganizationIdCallsGetSandboxEnum[keyof typeof OrganizationsOrganizationIdCallsGetSandboxEnum];
@@ -0,0 +1,256 @@
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
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.OrganizationsOrganizationIdCallsGetSandboxEnum = exports.CallsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const index_1 = require("../models/index");
28
+ /**
29
+ *
30
+ */
31
+ class CallsApi extends runtime.BaseAPI {
32
+ /**
33
+ * Delete a call
34
+ */
35
+ organizationsOrganizationIdCallsCallIdDeleteRaw(requestParameters, initOverrides) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['organizationId'] == null) {
38
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdDelete().');
39
+ }
40
+ if (requestParameters['callId'] == null) {
41
+ throw new runtime.RequiredError('callId', 'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdDelete().');
42
+ }
43
+ const queryParameters = {};
44
+ const headerParameters = {};
45
+ if (this.configuration && this.configuration.accessToken) {
46
+ const token = this.configuration.accessToken;
47
+ const tokenString = yield token("bearerAuth", []);
48
+ if (tokenString) {
49
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
50
+ }
51
+ }
52
+ let urlPath = `/organizations/{organizationId}/calls/{callId}`;
53
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
54
+ urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
55
+ const response = yield this.request({
56
+ path: urlPath,
57
+ method: 'DELETE',
58
+ headers: headerParameters,
59
+ query: queryParameters,
60
+ }, initOverrides);
61
+ return new runtime.VoidApiResponse(response);
62
+ });
63
+ }
64
+ /**
65
+ * Delete a call
66
+ */
67
+ organizationsOrganizationIdCallsCallIdDelete(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ yield this.organizationsOrganizationIdCallsCallIdDeleteRaw(requestParameters, initOverrides);
70
+ });
71
+ }
72
+ /**
73
+ * Get a call by ID
74
+ */
75
+ organizationsOrganizationIdCallsCallIdGetRaw(requestParameters, initOverrides) {
76
+ return __awaiter(this, void 0, void 0, function* () {
77
+ if (requestParameters['organizationId'] == null) {
78
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdGet().');
79
+ }
80
+ if (requestParameters['callId'] == null) {
81
+ throw new runtime.RequiredError('callId', 'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdGet().');
82
+ }
83
+ const queryParameters = {};
84
+ const headerParameters = {};
85
+ if (this.configuration && this.configuration.accessToken) {
86
+ const token = this.configuration.accessToken;
87
+ const tokenString = yield token("bearerAuth", []);
88
+ if (tokenString) {
89
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
90
+ }
91
+ }
92
+ let urlPath = `/organizations/{organizationId}/calls/{callId}`;
93
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
94
+ urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
95
+ const response = yield this.request({
96
+ path: urlPath,
97
+ method: 'GET',
98
+ headers: headerParameters,
99
+ query: queryParameters,
100
+ }, initOverrides);
101
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CallFromJSON)(jsonValue));
102
+ });
103
+ }
104
+ /**
105
+ * Get a call by ID
106
+ */
107
+ organizationsOrganizationIdCallsCallIdGet(requestParameters, initOverrides) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ const response = yield this.organizationsOrganizationIdCallsCallIdGetRaw(requestParameters, initOverrides);
110
+ return yield response.value();
111
+ });
112
+ }
113
+ /**
114
+ * Partial update — only provided fields are modified.
115
+ * Update a call
116
+ */
117
+ organizationsOrganizationIdCallsCallIdPutRaw(requestParameters, initOverrides) {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ if (requestParameters['organizationId'] == null) {
120
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdPut().');
121
+ }
122
+ if (requestParameters['callId'] == null) {
123
+ throw new runtime.RequiredError('callId', 'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdPut().');
124
+ }
125
+ if (requestParameters['callUpdate'] == null) {
126
+ throw new runtime.RequiredError('callUpdate', 'Required parameter "callUpdate" was null or undefined when calling organizationsOrganizationIdCallsCallIdPut().');
127
+ }
128
+ const queryParameters = {};
129
+ const headerParameters = {};
130
+ headerParameters['Content-Type'] = 'application/json';
131
+ if (this.configuration && this.configuration.accessToken) {
132
+ const token = this.configuration.accessToken;
133
+ const tokenString = yield token("bearerAuth", []);
134
+ if (tokenString) {
135
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
136
+ }
137
+ }
138
+ let urlPath = `/organizations/{organizationId}/calls/{callId}`;
139
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
140
+ urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
141
+ const response = yield this.request({
142
+ path: urlPath,
143
+ method: 'PUT',
144
+ headers: headerParameters,
145
+ query: queryParameters,
146
+ body: (0, index_1.CallUpdateToJSON)(requestParameters['callUpdate']),
147
+ }, initOverrides);
148
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CallFromJSON)(jsonValue));
149
+ });
150
+ }
151
+ /**
152
+ * Partial update — only provided fields are modified.
153
+ * Update a call
154
+ */
155
+ organizationsOrganizationIdCallsCallIdPut(requestParameters, initOverrides) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ const response = yield this.organizationsOrganizationIdCallsCallIdPutRaw(requestParameters, initOverrides);
158
+ return yield response.value();
159
+ });
160
+ }
161
+ /**
162
+ * Returns calls scoped to the organization via their associated voice agent. Calls without a voice_agent_id are not returned.
163
+ * List calls for an organization
164
+ */
165
+ organizationsOrganizationIdCallsGetRaw(requestParameters, initOverrides) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ if (requestParameters['organizationId'] == null) {
168
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsGet().');
169
+ }
170
+ const queryParameters = {};
171
+ if (requestParameters['voiceAgentId'] != null) {
172
+ queryParameters['voice_agent_id'] = requestParameters['voiceAgentId'];
173
+ }
174
+ if (requestParameters['sandbox'] != null) {
175
+ queryParameters['sandbox'] = requestParameters['sandbox'];
176
+ }
177
+ const headerParameters = {};
178
+ if (this.configuration && this.configuration.accessToken) {
179
+ const token = this.configuration.accessToken;
180
+ const tokenString = yield token("bearerAuth", []);
181
+ if (tokenString) {
182
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
183
+ }
184
+ }
185
+ let urlPath = `/organizations/{organizationId}/calls`;
186
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
187
+ const response = yield this.request({
188
+ path: urlPath,
189
+ method: 'GET',
190
+ headers: headerParameters,
191
+ query: queryParameters,
192
+ }, initOverrides);
193
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.CallFromJSON));
194
+ });
195
+ }
196
+ /**
197
+ * Returns calls scoped to the organization via their associated voice agent. Calls without a voice_agent_id are not returned.
198
+ * List calls for an organization
199
+ */
200
+ organizationsOrganizationIdCallsGet(requestParameters, initOverrides) {
201
+ return __awaiter(this, void 0, void 0, function* () {
202
+ const response = yield this.organizationsOrganizationIdCallsGetRaw(requestParameters, initOverrides);
203
+ return yield response.value();
204
+ });
205
+ }
206
+ /**
207
+ * Create a new call record
208
+ */
209
+ organizationsOrganizationIdCallsPostRaw(requestParameters, initOverrides) {
210
+ return __awaiter(this, void 0, void 0, function* () {
211
+ if (requestParameters['organizationId'] == null) {
212
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsPost().');
213
+ }
214
+ if (requestParameters['callCreate'] == null) {
215
+ throw new runtime.RequiredError('callCreate', 'Required parameter "callCreate" was null or undefined when calling organizationsOrganizationIdCallsPost().');
216
+ }
217
+ const queryParameters = {};
218
+ const headerParameters = {};
219
+ headerParameters['Content-Type'] = 'application/json';
220
+ if (this.configuration && this.configuration.accessToken) {
221
+ const token = this.configuration.accessToken;
222
+ const tokenString = yield token("bearerAuth", []);
223
+ if (tokenString) {
224
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
225
+ }
226
+ }
227
+ let urlPath = `/organizations/{organizationId}/calls`;
228
+ urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
229
+ const response = yield this.request({
230
+ path: urlPath,
231
+ method: 'POST',
232
+ headers: headerParameters,
233
+ query: queryParameters,
234
+ body: (0, index_1.CallCreateToJSON)(requestParameters['callCreate']),
235
+ }, initOverrides);
236
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.CallFromJSON)(jsonValue));
237
+ });
238
+ }
239
+ /**
240
+ * Create a new call record
241
+ */
242
+ organizationsOrganizationIdCallsPost(requestParameters, initOverrides) {
243
+ return __awaiter(this, void 0, void 0, function* () {
244
+ const response = yield this.organizationsOrganizationIdCallsPostRaw(requestParameters, initOverrides);
245
+ return yield response.value();
246
+ });
247
+ }
248
+ }
249
+ exports.CallsApi = CallsApi;
250
+ /**
251
+ * @export
252
+ */
253
+ exports.OrganizationsOrganizationIdCallsGetSandboxEnum = {
254
+ True: 'true',
255
+ False: 'false'
256
+ };
@@ -11,20 +11,20 @@
11
11
  */
12
12
  import * as runtime from '../runtime';
13
13
  import type { RecordingSignedUrl } from '../models/index';
14
- export interface OrganizationsOrganizationIdRecordingsConversationIdGetRequest {
14
+ export interface OrganizationsOrganizationIdRecordingsCallIdGetRequest {
15
15
  organizationId: string;
16
- conversationId: string;
16
+ callId: string;
17
17
  }
18
18
  /**
19
19
  *
20
20
  */
21
21
  export declare class RecordingsApi extends runtime.BaseAPI {
22
22
  /**
23
- * Get a signed URL for a conversation recording
23
+ * Get a signed URL for a call recording
24
24
  */
25
- organizationsOrganizationIdRecordingsConversationIdGetRaw(requestParameters: OrganizationsOrganizationIdRecordingsConversationIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecordingSignedUrl>>;
25
+ organizationsOrganizationIdRecordingsCallIdGetRaw(requestParameters: OrganizationsOrganizationIdRecordingsCallIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<RecordingSignedUrl>>;
26
26
  /**
27
- * Get a signed URL for a conversation recording
27
+ * Get a signed URL for a call recording
28
28
  */
29
- organizationsOrganizationIdRecordingsConversationIdGet(requestParameters: OrganizationsOrganizationIdRecordingsConversationIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecordingSignedUrl>;
29
+ organizationsOrganizationIdRecordingsCallIdGet(requestParameters: OrganizationsOrganizationIdRecordingsCallIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<RecordingSignedUrl>;
30
30
  }
@@ -30,15 +30,15 @@ const index_1 = require("../models/index");
30
30
  */
31
31
  class RecordingsApi extends runtime.BaseAPI {
32
32
  /**
33
- * Get a signed URL for a conversation recording
33
+ * Get a signed URL for a call recording
34
34
  */
35
- organizationsOrganizationIdRecordingsConversationIdGetRaw(requestParameters, initOverrides) {
35
+ organizationsOrganizationIdRecordingsCallIdGetRaw(requestParameters, initOverrides) {
36
36
  return __awaiter(this, void 0, void 0, function* () {
37
37
  if (requestParameters['organizationId'] == null) {
38
- throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdRecordingsConversationIdGet().');
38
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdRecordingsCallIdGet().');
39
39
  }
40
- if (requestParameters['conversationId'] == null) {
41
- throw new runtime.RequiredError('conversationId', 'Required parameter "conversationId" was null or undefined when calling organizationsOrganizationIdRecordingsConversationIdGet().');
40
+ if (requestParameters['callId'] == null) {
41
+ throw new runtime.RequiredError('callId', 'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdRecordingsCallIdGet().');
42
42
  }
43
43
  const queryParameters = {};
44
44
  const headerParameters = {};
@@ -49,9 +49,9 @@ class RecordingsApi extends runtime.BaseAPI {
49
49
  headerParameters["Authorization"] = `Bearer ${tokenString}`;
50
50
  }
51
51
  }
52
- let urlPath = `/organizations/{organizationId}/recordings/{conversationId}`;
52
+ let urlPath = `/organizations/{organizationId}/recordings/{callId}`;
53
53
  urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
54
- urlPath = urlPath.replace(`{${"conversationId"}}`, encodeURIComponent(String(requestParameters['conversationId'])));
54
+ urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
55
55
  const response = yield this.request({
56
56
  path: urlPath,
57
57
  method: 'GET',
@@ -62,11 +62,11 @@ class RecordingsApi extends runtime.BaseAPI {
62
62
  });
63
63
  }
64
64
  /**
65
- * Get a signed URL for a conversation recording
65
+ * Get a signed URL for a call recording
66
66
  */
67
- organizationsOrganizationIdRecordingsConversationIdGet(requestParameters, initOverrides) {
67
+ organizationsOrganizationIdRecordingsCallIdGet(requestParameters, initOverrides) {
68
68
  return __awaiter(this, void 0, void 0, function* () {
69
- const response = yield this.organizationsOrganizationIdRecordingsConversationIdGetRaw(requestParameters, initOverrides);
69
+ const response = yield this.organizationsOrganizationIdRecordingsCallIdGetRaw(requestParameters, initOverrides);
70
70
  return yield response.value();
71
71
  });
72
72
  }
@@ -1,4 +1,5 @@
1
1
  export * from './CalendarApi';
2
+ export * from './CallsApi';
2
3
  export * from './ChatAgentsApi';
3
4
  export * from './EmbeddingProvidersApi';
4
5
  export * from './HistoryApi';
@@ -17,6 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  /* tslint:disable */
18
18
  /* eslint-disable */
19
19
  __exportStar(require("./CalendarApi"), exports);
20
+ __exportStar(require("./CallsApi"), exports);
20
21
  __exportStar(require("./ChatAgentsApi"), exports);
21
22
  __exportStar(require("./EmbeddingProvidersApi"), exports);
22
23
  __exportStar(require("./HistoryApi"), exports);
@@ -1,3 +1,4 @@
1
+ import { CallsApi, type OrganizationsOrganizationIdCallsGetSandboxEnum } from "./apis/CallsApi";
1
2
  import { CalendarApi } from "./apis/CalendarApi";
2
3
  import { ChatAgentsApi } from "./apis/ChatAgentsApi";
3
4
  import { HistoryApi } from "./apis/HistoryApi";
@@ -14,7 +15,7 @@ import { STTProvidersApi } from "./apis/STTProvidersApi";
14
15
  import { TTSProvidersApi } from "./apis/TTSProvidersApi";
15
16
  import { SubscriptionApi } from "./apis/SubscriptionApi";
16
17
  import { VoiceAgentsApi } from "./apis/VoiceAgentsApi";
17
- import type { VoiceAgentCreate, VoiceAgentUpdate, ChatAgentCreate, ChatAgentUpdate, Calendar, CalendarCreate, CalendarUpdate, CalendarEventCreate, CalendarEventUpdate, InvitationAccept, InvitationCreate, RagConfigCreate, SipTrunkCreate, DispatchRuleCreate, OrganizationCreate, CreateCheckoutSessionRequest, CancelSubscriptionRequest, UpdatePlanRequest, PauseSubscriptionRequest, BillingPortalRequest } from "./models";
18
+ import type { CallCreate, CallUpdate, VoiceAgentCreate, VoiceAgentUpdate, ChatAgentCreate, ChatAgentUpdate, Calendar, CalendarCreate, CalendarUpdate, CalendarEventCreate, CalendarEventUpdate, InvitationAccept, InvitationCreate, RagConfigCreate, SipTrunkCreate, DispatchRuleCreate, OrganizationCreate, CreateCheckoutSessionRequest, CancelSubscriptionRequest, UpdatePlanRequest, PauseSubscriptionRequest, BillingPortalRequest } from "./models";
18
19
  export interface ApiClientConfig {
19
20
  baseUrl: string;
20
21
  options?: {
@@ -22,6 +23,13 @@ export interface ApiClientConfig {
22
23
  };
23
24
  }
24
25
  export declare class Api {
26
+ readonly calls: {
27
+ list: (organizationId: string, voiceAgentId?: string, sandbox?: OrganizationsOrganizationIdCallsGetSandboxEnum, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsGet"]>;
28
+ get: (organizationId: string, callId: string, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsCallIdGet"]>;
29
+ create: (organizationId: string, callCreate: CallCreate, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsPost"]>;
30
+ update: (organizationId: string, callId: string, callUpdate: CallUpdate, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsCallIdPut"]>;
31
+ delete: (organizationId: string, callId: string, options?: RequestInit) => ReturnType<CallsApi["organizationsOrganizationIdCallsCallIdDelete"]>;
32
+ };
25
33
  readonly voiceAgents: {
26
34
  list: (organizationId: string, options?: RequestInit) => ReturnType<VoiceAgentsApi["organizationsOrganizationIdVoiceAgentsGet"]>;
27
35
  listBasic: (organizationId: string, options?: RequestInit) => ReturnType<VoiceAgentsApi["organizationsOrganizationIdVoiceAgentsBasicGet"]>;
@@ -63,7 +71,7 @@ export declare class Api {
63
71
  create: (organizationId: string, invitationCreate: InvitationCreate, options?: RequestInit) => ReturnType<InvitationsApi["organizationsOrganizationIdInvitationsPost"]>;
64
72
  };
65
73
  readonly recordings: {
66
- get: (organizationId: string, conversationId: string, options?: RequestInit) => ReturnType<RecordingsApi["organizationsOrganizationIdRecordingsConversationIdGet"]>;
74
+ get: (organizationId: string, callId: string, options?: RequestInit) => ReturnType<RecordingsApi["organizationsOrganizationIdRecordingsCallIdGet"]>;
67
75
  };
68
76
  readonly members: {
69
77
  list: (organizationId: string, options?: RequestInit) => ReturnType<MembersApi["organizationsOrganizationIdMembersGet"]>;
@@ -120,6 +128,7 @@ export declare class Api {
120
128
  readonly embeddingProviders: {
121
129
  list: (organizationId: string, options?: RequestInit) => ReturnType<EmbeddingProvidersApi["organizationsOrganizationIdEmbeddingProvidersGet"]>;
122
130
  };
131
+ private readonly callsApi;
123
132
  private readonly voiceAgentsApi;
124
133
  private readonly chatAgentsApi;
125
134
  private readonly calendarApi;
@@ -7,6 +7,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ import { CallsApi } from "./apis/CallsApi";
10
11
  import { CalendarApi } from "./apis/CalendarApi";
11
12
  import { ChatAgentsApi } from "./apis/ChatAgentsApi";
12
13
  import { HistoryApi } from "./apis/HistoryApi";
@@ -42,6 +43,7 @@ export class Api {
42
43
  // Pass the headers object by reference so mutations are picked up at request time
43
44
  headers: this._auth.headers,
44
45
  });
46
+ this.callsApi = new CallsApi(configuration);
45
47
  this.voiceAgentsApi = new VoiceAgentsApi(configuration);
46
48
  this.chatAgentsApi = new ChatAgentsApi(configuration);
47
49
  this.calendarApi = new CalendarApi(configuration);
@@ -58,6 +60,13 @@ export class Api {
58
60
  this.llmProvidersApi = new LLMProvidersApi(configuration);
59
61
  this.sttProvidersApi = new STTProvidersApi(configuration);
60
62
  this.ttsProvidersApi = new TTSProvidersApi(configuration);
63
+ this.calls = {
64
+ list: (organizationId, voiceAgentId, sandbox, options) => this.callsApi.organizationsOrganizationIdCallsGet({ organizationId, voiceAgentId, sandbox }, options),
65
+ get: (organizationId, callId, options) => this.callsApi.organizationsOrganizationIdCallsCallIdGet({ organizationId, callId }, options),
66
+ create: (organizationId, callCreate, options) => this.callsApi.organizationsOrganizationIdCallsPost({ organizationId, callCreate }, options),
67
+ update: (organizationId, callId, callUpdate, options) => this.callsApi.organizationsOrganizationIdCallsCallIdPut({ organizationId, callId, callUpdate }, options),
68
+ delete: (organizationId, callId, options) => this.callsApi.organizationsOrganizationIdCallsCallIdDelete({ organizationId, callId }, options),
69
+ };
61
70
  this.voiceAgents = {
62
71
  list: (organizationId, options) => this.voiceAgentsApi.organizationsOrganizationIdVoiceAgentsGet({ organizationId }, options),
63
72
  listBasic: (organizationId, options) => this.voiceAgentsApi.organizationsOrganizationIdVoiceAgentsBasicGet({ organizationId }, options),
@@ -103,7 +112,7 @@ export class Api {
103
112
  create: (organizationId, invitationCreate, options) => this.invitationsApi.organizationsOrganizationIdInvitationsPost({ organizationId, invitationCreate }, options),
104
113
  };
105
114
  this.recordings = {
106
- get: (organizationId, conversationId, options) => this.recordingsApi.organizationsOrganizationIdRecordingsConversationIdGet({ organizationId, conversationId }, options),
115
+ get: (organizationId, callId, options) => this.recordingsApi.organizationsOrganizationIdRecordingsCallIdGet({ organizationId, callId }, options),
107
116
  };
108
117
  this.members = {
109
118
  list: (organizationId, options) => this.membersApi.organizationsOrganizationIdMembersGet({ organizationId }, options),