@l7mp/tivadar-ai-api-sdk 0.2.11 → 0.2.13
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 +18 -1
- package/dist/api-client.js +11 -0
- package/dist/apis/AdminSubscriptionsApi.d.ts +3 -3
- package/dist/apis/AdminSubscriptionsApi.js +3 -2
- package/dist/apis/CallFlagsApi.d.ts +133 -0
- package/dist/apis/CallFlagsApi.js +376 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/api-client.d.ts +18 -1
- package/dist/esm/api-client.js +11 -0
- package/dist/esm/apis/AdminSubscriptionsApi.d.ts +3 -3
- package/dist/esm/apis/AdminSubscriptionsApi.js +4 -3
- package/dist/esm/apis/CallFlagsApi.d.ts +133 -0
- package/dist/esm/apis/CallFlagsApi.js +372 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/AdminSubscriptionsListResponse.d.ts +39 -0
- package/dist/esm/models/AdminSubscriptionsListResponse.js +48 -0
- package/dist/esm/models/Call.d.ts +7 -0
- package/dist/esm/models/Call.js +3 -0
- package/dist/esm/models/CallFlag.d.ts +110 -0
- package/dist/esm/models/CallFlag.js +89 -0
- package/dist/esm/models/CallFlagCreate.d.ts +48 -0
- package/dist/esm/models/CallFlagCreate.js +54 -0
- package/dist/esm/models/CallFlagResolve.d.ts +32 -0
- package/dist/esm/models/CallFlagResolve.js +41 -0
- package/dist/esm/models/CallFlagUpdate.d.ts +48 -0
- package/dist/esm/models/CallFlagUpdate.js +52 -0
- package/dist/esm/models/CallFlagWithCall.d.ts +117 -0
- package/dist/esm/models/CallFlagWithCall.js +92 -0
- package/dist/esm/models/CallFlagWithCallAllOfCall.d.ts +56 -0
- package/dist/esm/models/CallFlagWithCallAllOfCall.js +49 -0
- package/dist/esm/models/VoiceAgent.d.ts +12 -0
- package/dist/esm/models/VoiceAgent.js +4 -0
- package/dist/esm/models/VoiceAgentCreate.d.ts +12 -0
- package/dist/esm/models/VoiceAgentCreate.js +4 -0
- package/dist/esm/models/VoiceAgentMetadata.d.ts +8 -0
- package/dist/esm/models/VoiceAgentMetadata.js +2 -0
- package/dist/esm/models/VoiceAgentUpdate.d.ts +12 -0
- package/dist/esm/models/VoiceAgentUpdate.js +4 -0
- package/dist/esm/models/VoiceAgentWithSipTrunks.d.ts +12 -0
- package/dist/esm/models/VoiceAgentWithSipTrunks.js +4 -0
- package/dist/esm/models/index.d.ts +7 -0
- package/dist/esm/models/index.js +7 -0
- package/dist/models/AdminSubscriptionsListResponse.d.ts +39 -0
- package/dist/models/AdminSubscriptionsListResponse.js +55 -0
- package/dist/models/Call.d.ts +7 -0
- package/dist/models/Call.js +3 -0
- package/dist/models/CallFlag.d.ts +110 -0
- package/dist/models/CallFlag.js +97 -0
- package/dist/models/CallFlagCreate.d.ts +48 -0
- package/dist/models/CallFlagCreate.js +62 -0
- package/dist/models/CallFlagResolve.d.ts +32 -0
- package/dist/models/CallFlagResolve.js +48 -0
- package/dist/models/CallFlagUpdate.d.ts +48 -0
- package/dist/models/CallFlagUpdate.js +60 -0
- package/dist/models/CallFlagWithCall.d.ts +117 -0
- package/dist/models/CallFlagWithCall.js +100 -0
- package/dist/models/CallFlagWithCallAllOfCall.d.ts +56 -0
- package/dist/models/CallFlagWithCallAllOfCall.js +56 -0
- package/dist/models/VoiceAgent.d.ts +12 -0
- package/dist/models/VoiceAgent.js +4 -0
- package/dist/models/VoiceAgentCreate.d.ts +12 -0
- package/dist/models/VoiceAgentCreate.js +4 -0
- package/dist/models/VoiceAgentMetadata.d.ts +8 -0
- package/dist/models/VoiceAgentMetadata.js +2 -0
- package/dist/models/VoiceAgentUpdate.d.ts +12 -0
- package/dist/models/VoiceAgentUpdate.js +4 -0
- package/dist/models/VoiceAgentWithSipTrunks.d.ts +12 -0
- package/dist/models/VoiceAgentWithSipTrunks.js +4 -0
- package/dist/models/index.d.ts +7 -0
- package/dist/models/index.js +7 -0
- package/package.json +1 -1
- package/src/api-client.ts +29 -0
- package/src/apis/AdminSubscriptionsApi.ts +8 -4
- package/src/apis/CallFlagsApi.ts +546 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AdminSubscriptionsListResponse.ts +83 -0
- package/src/models/Call.ts +16 -0
- package/src/models/CallFlag.ts +173 -0
- package/src/models/CallFlagCreate.ts +87 -0
- package/src/models/CallFlagResolve.ts +65 -0
- package/src/models/CallFlagUpdate.ts +86 -0
- package/src/models/CallFlagWithCall.ts +189 -0
- package/src/models/CallFlagWithCallAllOfCall.ts +97 -0
- package/src/models/VoiceAgent.ts +16 -0
- package/src/models/VoiceAgentCreate.ts +16 -0
- package/src/models/VoiceAgentMetadata.ts +8 -0
- package/src/models/VoiceAgentUpdate.ts +16 -0
- package/src/models/VoiceAgentWithSipTrunks.ts +16 -0
- package/src/models/index.ts +7 -0
|
@@ -0,0 +1,546 @@
|
|
|
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
|
+
CallFlag,
|
|
19
|
+
CallFlagCreate,
|
|
20
|
+
CallFlagResolve,
|
|
21
|
+
CallFlagUpdate,
|
|
22
|
+
CallFlagWithCall,
|
|
23
|
+
} from '../models/index';
|
|
24
|
+
import {
|
|
25
|
+
CallFlagFromJSON,
|
|
26
|
+
CallFlagToJSON,
|
|
27
|
+
CallFlagCreateFromJSON,
|
|
28
|
+
CallFlagCreateToJSON,
|
|
29
|
+
CallFlagResolveFromJSON,
|
|
30
|
+
CallFlagResolveToJSON,
|
|
31
|
+
CallFlagUpdateFromJSON,
|
|
32
|
+
CallFlagUpdateToJSON,
|
|
33
|
+
CallFlagWithCallFromJSON,
|
|
34
|
+
CallFlagWithCallToJSON,
|
|
35
|
+
} from '../models/index';
|
|
36
|
+
|
|
37
|
+
export interface OrganizationsOrganizationIdCallFlagsGetRequest {
|
|
38
|
+
organizationId: string;
|
|
39
|
+
status?: OrganizationsOrganizationIdCallFlagsGetStatusEnum;
|
|
40
|
+
flagType?: OrganizationsOrganizationIdCallFlagsGetFlagTypeEnum;
|
|
41
|
+
voiceAgentId?: string;
|
|
42
|
+
limit?: number;
|
|
43
|
+
offset?: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface OrganizationsOrganizationIdCallsCallIdFlagsFlagIdDeleteRequest {
|
|
47
|
+
organizationId: string;
|
|
48
|
+
callId: string;
|
|
49
|
+
flagId: string;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface OrganizationsOrganizationIdCallsCallIdFlagsFlagIdPatchRequest {
|
|
53
|
+
organizationId: string;
|
|
54
|
+
callId: string;
|
|
55
|
+
flagId: string;
|
|
56
|
+
callFlagUpdate: CallFlagUpdate;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface OrganizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPostRequest {
|
|
60
|
+
organizationId: string;
|
|
61
|
+
callId: string;
|
|
62
|
+
flagId: string;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface OrganizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePostRequest {
|
|
66
|
+
organizationId: string;
|
|
67
|
+
callId: string;
|
|
68
|
+
flagId: string;
|
|
69
|
+
callFlagResolve?: CallFlagResolve;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface OrganizationsOrganizationIdCallsCallIdFlagsGetRequest {
|
|
73
|
+
organizationId: string;
|
|
74
|
+
callId: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface OrganizationsOrganizationIdCallsCallIdFlagsPostRequest {
|
|
78
|
+
organizationId: string;
|
|
79
|
+
callId: string;
|
|
80
|
+
callFlagCreate: CallFlagCreate;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
*/
|
|
86
|
+
export class CallFlagsApi extends runtime.BaseAPI {
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Returns flags for all calls in the organization, each with a lightweight call summary. Useful for locating problematic calls that need follow-up or manual intervention.
|
|
90
|
+
* List call flags across the organization (triage view)
|
|
91
|
+
*/
|
|
92
|
+
async organizationsOrganizationIdCallFlagsGetRaw(requestParameters: OrganizationsOrganizationIdCallFlagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CallFlagWithCall>>> {
|
|
93
|
+
if (requestParameters['organizationId'] == null) {
|
|
94
|
+
throw new runtime.RequiredError(
|
|
95
|
+
'organizationId',
|
|
96
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallFlagsGet().'
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const queryParameters: any = {};
|
|
101
|
+
|
|
102
|
+
if (requestParameters['status'] != null) {
|
|
103
|
+
queryParameters['status'] = requestParameters['status'];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (requestParameters['flagType'] != null) {
|
|
107
|
+
queryParameters['flag_type'] = requestParameters['flagType'];
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
if (requestParameters['voiceAgentId'] != null) {
|
|
111
|
+
queryParameters['voice_agent_id'] = requestParameters['voiceAgentId'];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (requestParameters['limit'] != null) {
|
|
115
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (requestParameters['offset'] != null) {
|
|
119
|
+
queryParameters['offset'] = requestParameters['offset'];
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
123
|
+
|
|
124
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
125
|
+
const token = this.configuration.accessToken;
|
|
126
|
+
const tokenString = await token("bearerAuth", []);
|
|
127
|
+
|
|
128
|
+
if (tokenString) {
|
|
129
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
let urlPath = `/organizations/{organizationId}/call-flags`;
|
|
134
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
135
|
+
|
|
136
|
+
const response = await this.request({
|
|
137
|
+
path: urlPath,
|
|
138
|
+
method: 'GET',
|
|
139
|
+
headers: headerParameters,
|
|
140
|
+
query: queryParameters,
|
|
141
|
+
}, initOverrides);
|
|
142
|
+
|
|
143
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CallFlagWithCallFromJSON));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Returns flags for all calls in the organization, each with a lightweight call summary. Useful for locating problematic calls that need follow-up or manual intervention.
|
|
148
|
+
* List call flags across the organization (triage view)
|
|
149
|
+
*/
|
|
150
|
+
async organizationsOrganizationIdCallFlagsGet(requestParameters: OrganizationsOrganizationIdCallFlagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CallFlagWithCall>> {
|
|
151
|
+
const response = await this.organizationsOrganizationIdCallFlagsGetRaw(requestParameters, initOverrides);
|
|
152
|
+
return await response.value();
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Delete a flag
|
|
157
|
+
*/
|
|
158
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdDeleteRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
|
159
|
+
if (requestParameters['organizationId'] == null) {
|
|
160
|
+
throw new runtime.RequiredError(
|
|
161
|
+
'organizationId',
|
|
162
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdDelete().'
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (requestParameters['callId'] == null) {
|
|
167
|
+
throw new runtime.RequiredError(
|
|
168
|
+
'callId',
|
|
169
|
+
'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdDelete().'
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (requestParameters['flagId'] == null) {
|
|
174
|
+
throw new runtime.RequiredError(
|
|
175
|
+
'flagId',
|
|
176
|
+
'Required parameter "flagId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdDelete().'
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const queryParameters: any = {};
|
|
181
|
+
|
|
182
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
183
|
+
|
|
184
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
185
|
+
const token = this.configuration.accessToken;
|
|
186
|
+
const tokenString = await token("bearerAuth", []);
|
|
187
|
+
|
|
188
|
+
if (tokenString) {
|
|
189
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
let urlPath = `/organizations/{organizationId}/calls/{callId}/flags/{flagId}`;
|
|
194
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
195
|
+
urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
|
|
196
|
+
urlPath = urlPath.replace(`{${"flagId"}}`, encodeURIComponent(String(requestParameters['flagId'])));
|
|
197
|
+
|
|
198
|
+
const response = await this.request({
|
|
199
|
+
path: urlPath,
|
|
200
|
+
method: 'DELETE',
|
|
201
|
+
headers: headerParameters,
|
|
202
|
+
query: queryParameters,
|
|
203
|
+
}, initOverrides);
|
|
204
|
+
|
|
205
|
+
return new runtime.VoidApiResponse(response);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Delete a flag
|
|
210
|
+
*/
|
|
211
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdDelete(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
|
212
|
+
await this.organizationsOrganizationIdCallsCallIdFlagsFlagIdDeleteRaw(requestParameters, initOverrides);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Update a flag\'s type or reason
|
|
217
|
+
*/
|
|
218
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdPatchRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CallFlag>> {
|
|
219
|
+
if (requestParameters['organizationId'] == null) {
|
|
220
|
+
throw new runtime.RequiredError(
|
|
221
|
+
'organizationId',
|
|
222
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdPatch().'
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
if (requestParameters['callId'] == null) {
|
|
227
|
+
throw new runtime.RequiredError(
|
|
228
|
+
'callId',
|
|
229
|
+
'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdPatch().'
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
if (requestParameters['flagId'] == null) {
|
|
234
|
+
throw new runtime.RequiredError(
|
|
235
|
+
'flagId',
|
|
236
|
+
'Required parameter "flagId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdPatch().'
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (requestParameters['callFlagUpdate'] == null) {
|
|
241
|
+
throw new runtime.RequiredError(
|
|
242
|
+
'callFlagUpdate',
|
|
243
|
+
'Required parameter "callFlagUpdate" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdPatch().'
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const queryParameters: any = {};
|
|
248
|
+
|
|
249
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
250
|
+
|
|
251
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
252
|
+
|
|
253
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
254
|
+
const token = this.configuration.accessToken;
|
|
255
|
+
const tokenString = await token("bearerAuth", []);
|
|
256
|
+
|
|
257
|
+
if (tokenString) {
|
|
258
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
let urlPath = `/organizations/{organizationId}/calls/{callId}/flags/{flagId}`;
|
|
263
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
264
|
+
urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
|
|
265
|
+
urlPath = urlPath.replace(`{${"flagId"}}`, encodeURIComponent(String(requestParameters['flagId'])));
|
|
266
|
+
|
|
267
|
+
const response = await this.request({
|
|
268
|
+
path: urlPath,
|
|
269
|
+
method: 'PATCH',
|
|
270
|
+
headers: headerParameters,
|
|
271
|
+
query: queryParameters,
|
|
272
|
+
body: CallFlagUpdateToJSON(requestParameters['callFlagUpdate']),
|
|
273
|
+
}, initOverrides);
|
|
274
|
+
|
|
275
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CallFlagFromJSON(jsonValue));
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Update a flag\'s type or reason
|
|
280
|
+
*/
|
|
281
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdPatch(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdPatchRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CallFlag> {
|
|
282
|
+
const response = await this.organizationsOrganizationIdCallsCallIdFlagsFlagIdPatchRaw(requestParameters, initOverrides);
|
|
283
|
+
return await response.value();
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Reopen a resolved flag
|
|
288
|
+
*/
|
|
289
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPostRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CallFlag>> {
|
|
290
|
+
if (requestParameters['organizationId'] == null) {
|
|
291
|
+
throw new runtime.RequiredError(
|
|
292
|
+
'organizationId',
|
|
293
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPost().'
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
if (requestParameters['callId'] == null) {
|
|
298
|
+
throw new runtime.RequiredError(
|
|
299
|
+
'callId',
|
|
300
|
+
'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPost().'
|
|
301
|
+
);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
if (requestParameters['flagId'] == null) {
|
|
305
|
+
throw new runtime.RequiredError(
|
|
306
|
+
'flagId',
|
|
307
|
+
'Required parameter "flagId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPost().'
|
|
308
|
+
);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
const queryParameters: any = {};
|
|
312
|
+
|
|
313
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
314
|
+
|
|
315
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
316
|
+
const token = this.configuration.accessToken;
|
|
317
|
+
const tokenString = await token("bearerAuth", []);
|
|
318
|
+
|
|
319
|
+
if (tokenString) {
|
|
320
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
let urlPath = `/organizations/{organizationId}/calls/{callId}/flags/{flagId}/reopen`;
|
|
325
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
326
|
+
urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
|
|
327
|
+
urlPath = urlPath.replace(`{${"flagId"}}`, encodeURIComponent(String(requestParameters['flagId'])));
|
|
328
|
+
|
|
329
|
+
const response = await this.request({
|
|
330
|
+
path: urlPath,
|
|
331
|
+
method: 'POST',
|
|
332
|
+
headers: headerParameters,
|
|
333
|
+
query: queryParameters,
|
|
334
|
+
}, initOverrides);
|
|
335
|
+
|
|
336
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CallFlagFromJSON(jsonValue));
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Reopen a resolved flag
|
|
341
|
+
*/
|
|
342
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPost(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CallFlag> {
|
|
343
|
+
const response = await this.organizationsOrganizationIdCallsCallIdFlagsFlagIdReopenPostRaw(requestParameters, initOverrides);
|
|
344
|
+
return await response.value();
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Mark a flag resolved (preserves the original flag data)
|
|
349
|
+
*/
|
|
350
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePostRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CallFlag>> {
|
|
351
|
+
if (requestParameters['organizationId'] == null) {
|
|
352
|
+
throw new runtime.RequiredError(
|
|
353
|
+
'organizationId',
|
|
354
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePost().'
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
if (requestParameters['callId'] == null) {
|
|
359
|
+
throw new runtime.RequiredError(
|
|
360
|
+
'callId',
|
|
361
|
+
'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePost().'
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if (requestParameters['flagId'] == null) {
|
|
366
|
+
throw new runtime.RequiredError(
|
|
367
|
+
'flagId',
|
|
368
|
+
'Required parameter "flagId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePost().'
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const queryParameters: any = {};
|
|
373
|
+
|
|
374
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
375
|
+
|
|
376
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
377
|
+
|
|
378
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
379
|
+
const token = this.configuration.accessToken;
|
|
380
|
+
const tokenString = await token("bearerAuth", []);
|
|
381
|
+
|
|
382
|
+
if (tokenString) {
|
|
383
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
let urlPath = `/organizations/{organizationId}/calls/{callId}/flags/{flagId}/resolve`;
|
|
388
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
389
|
+
urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
|
|
390
|
+
urlPath = urlPath.replace(`{${"flagId"}}`, encodeURIComponent(String(requestParameters['flagId'])));
|
|
391
|
+
|
|
392
|
+
const response = await this.request({
|
|
393
|
+
path: urlPath,
|
|
394
|
+
method: 'POST',
|
|
395
|
+
headers: headerParameters,
|
|
396
|
+
query: queryParameters,
|
|
397
|
+
body: CallFlagResolveToJSON(requestParameters['callFlagResolve']),
|
|
398
|
+
}, initOverrides);
|
|
399
|
+
|
|
400
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CallFlagFromJSON(jsonValue));
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Mark a flag resolved (preserves the original flag data)
|
|
405
|
+
*/
|
|
406
|
+
async organizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePost(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CallFlag> {
|
|
407
|
+
const response = await this.organizationsOrganizationIdCallsCallIdFlagsFlagIdResolvePostRaw(requestParameters, initOverrides);
|
|
408
|
+
return await response.value();
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* List flags raised on a call
|
|
413
|
+
*/
|
|
414
|
+
async organizationsOrganizationIdCallsCallIdFlagsGetRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<CallFlag>>> {
|
|
415
|
+
if (requestParameters['organizationId'] == null) {
|
|
416
|
+
throw new runtime.RequiredError(
|
|
417
|
+
'organizationId',
|
|
418
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsGet().'
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
if (requestParameters['callId'] == null) {
|
|
423
|
+
throw new runtime.RequiredError(
|
|
424
|
+
'callId',
|
|
425
|
+
'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsGet().'
|
|
426
|
+
);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
const queryParameters: any = {};
|
|
430
|
+
|
|
431
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
432
|
+
|
|
433
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
434
|
+
const token = this.configuration.accessToken;
|
|
435
|
+
const tokenString = await token("bearerAuth", []);
|
|
436
|
+
|
|
437
|
+
if (tokenString) {
|
|
438
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
let urlPath = `/organizations/{organizationId}/calls/{callId}/flags`;
|
|
443
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
444
|
+
urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
|
|
445
|
+
|
|
446
|
+
const response = await this.request({
|
|
447
|
+
path: urlPath,
|
|
448
|
+
method: 'GET',
|
|
449
|
+
headers: headerParameters,
|
|
450
|
+
query: queryParameters,
|
|
451
|
+
}, initOverrides);
|
|
452
|
+
|
|
453
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CallFlagFromJSON));
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* List flags raised on a call
|
|
458
|
+
*/
|
|
459
|
+
async organizationsOrganizationIdCallsCallIdFlagsGet(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<CallFlag>> {
|
|
460
|
+
const response = await this.organizationsOrganizationIdCallsCallIdFlagsGetRaw(requestParameters, initOverrides);
|
|
461
|
+
return await response.value();
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Flag a call for follow-up or manual intervention
|
|
466
|
+
*/
|
|
467
|
+
async organizationsOrganizationIdCallsCallIdFlagsPostRaw(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CallFlag>> {
|
|
468
|
+
if (requestParameters['organizationId'] == null) {
|
|
469
|
+
throw new runtime.RequiredError(
|
|
470
|
+
'organizationId',
|
|
471
|
+
'Required parameter "organizationId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsPost().'
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (requestParameters['callId'] == null) {
|
|
476
|
+
throw new runtime.RequiredError(
|
|
477
|
+
'callId',
|
|
478
|
+
'Required parameter "callId" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsPost().'
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (requestParameters['callFlagCreate'] == null) {
|
|
483
|
+
throw new runtime.RequiredError(
|
|
484
|
+
'callFlagCreate',
|
|
485
|
+
'Required parameter "callFlagCreate" was null or undefined when calling organizationsOrganizationIdCallsCallIdFlagsPost().'
|
|
486
|
+
);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
const queryParameters: any = {};
|
|
490
|
+
|
|
491
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
492
|
+
|
|
493
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
494
|
+
|
|
495
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
496
|
+
const token = this.configuration.accessToken;
|
|
497
|
+
const tokenString = await token("bearerAuth", []);
|
|
498
|
+
|
|
499
|
+
if (tokenString) {
|
|
500
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
let urlPath = `/organizations/{organizationId}/calls/{callId}/flags`;
|
|
505
|
+
urlPath = urlPath.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId'])));
|
|
506
|
+
urlPath = urlPath.replace(`{${"callId"}}`, encodeURIComponent(String(requestParameters['callId'])));
|
|
507
|
+
|
|
508
|
+
const response = await this.request({
|
|
509
|
+
path: urlPath,
|
|
510
|
+
method: 'POST',
|
|
511
|
+
headers: headerParameters,
|
|
512
|
+
query: queryParameters,
|
|
513
|
+
body: CallFlagCreateToJSON(requestParameters['callFlagCreate']),
|
|
514
|
+
}, initOverrides);
|
|
515
|
+
|
|
516
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CallFlagFromJSON(jsonValue));
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Flag a call for follow-up or manual intervention
|
|
521
|
+
*/
|
|
522
|
+
async organizationsOrganizationIdCallsCallIdFlagsPost(requestParameters: OrganizationsOrganizationIdCallsCallIdFlagsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CallFlag> {
|
|
523
|
+
const response = await this.organizationsOrganizationIdCallsCallIdFlagsPostRaw(requestParameters, initOverrides);
|
|
524
|
+
return await response.value();
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* @export
|
|
531
|
+
*/
|
|
532
|
+
export const OrganizationsOrganizationIdCallFlagsGetStatusEnum = {
|
|
533
|
+
Open: 'open',
|
|
534
|
+
Resolved: 'resolved'
|
|
535
|
+
} as const;
|
|
536
|
+
export type OrganizationsOrganizationIdCallFlagsGetStatusEnum = typeof OrganizationsOrganizationIdCallFlagsGetStatusEnum[keyof typeof OrganizationsOrganizationIdCallFlagsGetStatusEnum];
|
|
537
|
+
/**
|
|
538
|
+
* @export
|
|
539
|
+
*/
|
|
540
|
+
export const OrganizationsOrganizationIdCallFlagsGetFlagTypeEnum = {
|
|
541
|
+
Error: 'error',
|
|
542
|
+
FollowUp: 'follow_up',
|
|
543
|
+
ManualReview: 'manual_review',
|
|
544
|
+
Other: 'other'
|
|
545
|
+
} as const;
|
|
546
|
+
export type OrganizationsOrganizationIdCallFlagsGetFlagTypeEnum = typeof OrganizationsOrganizationIdCallFlagsGetFlagTypeEnum[keyof typeof OrganizationsOrganizationIdCallFlagsGetFlagTypeEnum];
|
package/src/apis/index.ts
CHANGED
|
@@ -0,0 +1,83 @@
|
|
|
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 { SubscriptionStatus } from './SubscriptionStatus';
|
|
17
|
+
import {
|
|
18
|
+
SubscriptionStatusFromJSON,
|
|
19
|
+
SubscriptionStatusFromJSONTyped,
|
|
20
|
+
SubscriptionStatusToJSON,
|
|
21
|
+
SubscriptionStatusToJSONTyped,
|
|
22
|
+
} from './SubscriptionStatus';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface AdminSubscriptionsListResponse
|
|
28
|
+
*/
|
|
29
|
+
export interface AdminSubscriptionsListResponse {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<SubscriptionStatus>}
|
|
33
|
+
* @memberof AdminSubscriptionsListResponse
|
|
34
|
+
*/
|
|
35
|
+
items: Array<SubscriptionStatus>;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof AdminSubscriptionsListResponse
|
|
40
|
+
*/
|
|
41
|
+
total: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the AdminSubscriptionsListResponse interface.
|
|
46
|
+
*/
|
|
47
|
+
export function instanceOfAdminSubscriptionsListResponse(value: object): value is AdminSubscriptionsListResponse {
|
|
48
|
+
if (!('items' in value) || value['items'] === undefined) return false;
|
|
49
|
+
if (!('total' in value) || value['total'] === undefined) return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function AdminSubscriptionsListResponseFromJSON(json: any): AdminSubscriptionsListResponse {
|
|
54
|
+
return AdminSubscriptionsListResponseFromJSONTyped(json, false);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function AdminSubscriptionsListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminSubscriptionsListResponse {
|
|
58
|
+
if (json == null) {
|
|
59
|
+
return json;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'items': ((json['items'] as Array<any>).map(SubscriptionStatusFromJSON)),
|
|
64
|
+
'total': json['total'],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function AdminSubscriptionsListResponseToJSON(json: any): AdminSubscriptionsListResponse {
|
|
69
|
+
return AdminSubscriptionsListResponseToJSONTyped(json, false);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function AdminSubscriptionsListResponseToJSONTyped(value?: AdminSubscriptionsListResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
73
|
+
if (value == null) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'items': ((value['items'] as Array<any>).map(SubscriptionStatusToJSON)),
|
|
80
|
+
'total': value['total'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
package/src/models/Call.ts
CHANGED
|
@@ -13,6 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
+
import type { CallFlag } from './CallFlag';
|
|
17
|
+
import {
|
|
18
|
+
CallFlagFromJSON,
|
|
19
|
+
CallFlagFromJSONTyped,
|
|
20
|
+
CallFlagToJSON,
|
|
21
|
+
CallFlagToJSONTyped,
|
|
22
|
+
} from './CallFlag';
|
|
23
|
+
|
|
16
24
|
/**
|
|
17
25
|
*
|
|
18
26
|
* @export
|
|
@@ -61,6 +69,12 @@ export interface Call {
|
|
|
61
69
|
* @memberof Call
|
|
62
70
|
*/
|
|
63
71
|
created_at: Date;
|
|
72
|
+
/**
|
|
73
|
+
* Flags raised on this call (empty when none)
|
|
74
|
+
* @type {Array<CallFlag>}
|
|
75
|
+
* @memberof Call
|
|
76
|
+
*/
|
|
77
|
+
flags?: Array<CallFlag>;
|
|
64
78
|
}
|
|
65
79
|
|
|
66
80
|
/**
|
|
@@ -89,6 +103,7 @@ export function CallFromJSONTyped(json: any, ignoreDiscriminator: boolean): Call
|
|
|
89
103
|
'caller': json['caller'] == null ? undefined : json['caller'],
|
|
90
104
|
'sandbox': json['sandbox'] == null ? undefined : json['sandbox'],
|
|
91
105
|
'created_at': (new Date(json['created_at'])),
|
|
106
|
+
'flags': json['flags'] == null ? undefined : ((json['flags'] as Array<any>).map(CallFlagFromJSON)),
|
|
92
107
|
};
|
|
93
108
|
}
|
|
94
109
|
|
|
@@ -110,6 +125,7 @@ export function CallToJSONTyped(value?: Call | null, ignoreDiscriminator: boolea
|
|
|
110
125
|
'caller': value['caller'],
|
|
111
126
|
'sandbox': value['sandbox'],
|
|
112
127
|
'created_at': value['created_at'].toISOString(),
|
|
128
|
+
'flags': value['flags'] == null ? undefined : ((value['flags'] as Array<any>).map(CallFlagToJSON)),
|
|
113
129
|
};
|
|
114
130
|
}
|
|
115
131
|
|