whio-api-sdk 1.0.192-bet-staging → 1.0.194-beta-staging
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/src/sdk/modules/agent.module.d.ts +17 -0
- package/dist/src/sdk/modules/agent.module.js +93 -0
- package/dist/src/sdk/modules/audio.module.d.ts +31 -0
- package/dist/src/sdk/modules/audio.module.js +147 -0
- package/dist/src/sdk/modules/auth.module.d.ts +9 -0
- package/dist/src/sdk/modules/auth.module.js +59 -0
- package/dist/src/sdk/modules/base-client.d.ts +25 -0
- package/dist/src/sdk/modules/base-client.js +183 -0
- package/dist/src/sdk/modules/debug.module.d.ts +20 -0
- package/dist/src/sdk/modules/debug.module.js +54 -0
- package/dist/src/sdk/modules/external-integration.module.d.ts +9 -0
- package/dist/src/sdk/modules/external-integration.module.js +38 -0
- package/dist/src/sdk/modules/log.module.d.ts +63 -0
- package/dist/src/sdk/modules/log.module.js +222 -0
- package/dist/src/sdk/modules/organization.module.d.ts +11 -0
- package/dist/src/sdk/modules/organization.module.js +50 -0
- package/dist/src/sdk/modules/session.module.d.ts +16 -0
- package/dist/src/sdk/modules/session.module.js +58 -0
- package/dist/src/sdk/modules/team.module.d.ts +13 -0
- package/dist/src/sdk/modules/team.module.js +72 -0
- package/dist/src/sdk/modules/template.module.d.ts +33 -0
- package/dist/src/sdk/modules/template.module.js +240 -0
- package/dist/src/sdk/modules/user.module.d.ts +17 -0
- package/dist/src/sdk/modules/user.module.js +104 -0
- package/dist/src/sdk/modules/workflow.module.d.ts +10 -0
- package/dist/src/sdk/modules/workflow.module.js +53 -0
- package/dist/src/sdk/sdk.d.ts +167 -206
- package/dist/src/sdk/sdk.js +375 -853
- package/dist/src/sdk/sdk.old.d.ts +222 -0
- package/dist/src/sdk/sdk.old.js +1238 -0
- package/dist/src/sdk/types/agent.types.d.ts +51 -0
- package/dist/src/sdk/types/agent.types.js +1 -0
- package/dist/src/sdk/types/audio.types.d.ts +72 -0
- package/dist/src/sdk/types/audio.types.js +8 -0
- package/dist/src/sdk/types/auth.types.d.ts +21 -0
- package/dist/src/sdk/types/auth.types.js +1 -0
- package/dist/src/sdk/types/common.types.d.ts +20 -0
- package/dist/src/sdk/types/common.types.js +9 -0
- package/dist/src/sdk/types/external-integration.types.d.ts +31 -0
- package/dist/src/sdk/types/external-integration.types.js +1 -0
- package/dist/src/sdk/types/index.d.ts +12 -0
- package/dist/src/sdk/types/index.js +13 -0
- package/dist/src/sdk/types/log.types.d.ts +61 -0
- package/dist/src/sdk/types/log.types.js +1 -0
- package/dist/src/sdk/types/organization.types.d.ts +42 -0
- package/dist/src/sdk/types/organization.types.js +6 -0
- package/dist/src/sdk/types/session.types.d.ts +54 -0
- package/dist/src/sdk/types/session.types.js +1 -0
- package/dist/src/sdk/types/team.types.d.ts +39 -0
- package/dist/src/sdk/types/team.types.js +1 -0
- package/dist/src/sdk/types/template.types.d.ts +118 -0
- package/dist/src/sdk/types/template.types.js +1 -0
- package/dist/src/sdk/types/user.types.d.ts +41 -0
- package/dist/src/sdk/types/user.types.js +1 -0
- package/dist/src/sdk/types/workflow.types.d.ts +19 -0
- package/dist/src/sdk/types/workflow.types.js +1 -0
- package/dist/src/sdk/types.d.ts +1 -517
- package/dist/src/sdk/types.js +2 -23
- package/dist/src/sdk/types.old.d.ts +517 -0
- package/dist/src/sdk/types.old.js +23 -0
- package/dist/src/sdk/urls.d.ts +1 -0
- package/dist/src/sdk/urls.js +2 -0
- package/package.json +1 -1
- package/src/sdk/modules/agent.module.ts +74 -0
- package/src/sdk/modules/audio.module.ts +131 -0
- package/src/sdk/modules/auth.module.ts +53 -0
- package/src/sdk/modules/base-client.ts +214 -0
- package/src/sdk/modules/debug.module.ts +44 -0
- package/src/sdk/modules/external-integration.module.ts +50 -0
- package/src/sdk/modules/log.module.ts +213 -0
- package/src/sdk/modules/organization.module.ts +35 -0
- package/src/sdk/modules/session.module.ts +41 -0
- package/src/sdk/modules/team.module.ts +55 -0
- package/src/sdk/modules/template.module.ts +242 -0
- package/src/sdk/modules/user.module.ts +89 -0
- package/src/sdk/modules/workflow.module.ts +39 -0
- package/src/sdk/sdk.old.ts +1312 -0
- package/src/sdk/sdk.ts +393 -1074
- package/src/sdk/types/agent.types.ts +65 -0
- package/src/sdk/types/audio.types.ts +89 -0
- package/src/sdk/types/auth.types.ts +29 -0
- package/src/sdk/types/common.types.ts +26 -0
- package/src/sdk/types/external-integration.types.ts +37 -0
- package/src/sdk/types/index.ts +13 -0
- package/src/sdk/types/log.types.ts +68 -0
- package/src/sdk/types/organization.types.ts +55 -0
- package/src/sdk/types/session.types.ts +63 -0
- package/src/sdk/types/team.types.ts +48 -0
- package/src/sdk/types/template.types.ts +142 -0
- package/src/sdk/types/user.types.ts +50 -0
- package/src/sdk/types/workflow.types.ts +26 -0
- package/src/sdk/types.old.ts +649 -0
- package/src/sdk/types.ts +2 -649
- package/src/sdk/urls.ts +3 -0
package/dist/src/sdk/sdk.js
CHANGED
|
@@ -7,1216 +7,738 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import {
|
|
14
|
-
|
|
10
|
+
import { BaseClient } from './modules/base-client';
|
|
11
|
+
import { AuthModule } from './modules/auth.module';
|
|
12
|
+
import { UserModule } from './modules/user.module';
|
|
13
|
+
import { OrganizationModule } from './modules/organization.module';
|
|
14
|
+
import { TeamModule } from './modules/team.module';
|
|
15
|
+
import { TemplateModule } from './modules/template.module';
|
|
16
|
+
import { SessionModule } from './modules/session.module';
|
|
17
|
+
import { AgentModule } from './modules/agent.module';
|
|
18
|
+
import { AudioModule } from './modules/audio.module';
|
|
19
|
+
import { WorkflowModule } from './modules/workflow.module';
|
|
20
|
+
import { LogModule } from './modules/log.module';
|
|
21
|
+
import { DebugModule } from './modules/debug.module';
|
|
22
|
+
import { ExternalIntegrationModule } from './modules/external-integration.module';
|
|
23
|
+
/**
|
|
24
|
+
* Main SDK class that provides access to all domain-specific modules
|
|
25
|
+
*/
|
|
26
|
+
export class ApiSDK extends BaseClient {
|
|
15
27
|
constructor(config = {}) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
this.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.baseUrl = conf.baseUrl || this.baseUrl;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
getToken() {
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
const accessToken = yield this.storage.getItem('access_token');
|
|
36
|
-
this.accessToken = accessToken ? JSON.parse(accessToken) : null;
|
|
37
|
-
if (!this.accessToken) {
|
|
38
|
-
throw new Error('Access token not found');
|
|
39
|
-
}
|
|
40
|
-
// Check if token is expired or expiring soon
|
|
41
|
-
if (this.isTokenExpired(this.accessToken)) {
|
|
42
|
-
// Try to refresh the token
|
|
43
|
-
if (this.refreshToken) {
|
|
44
|
-
yield this.refreshAccessToken();
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
throw new Error('Access token expired and no refresh token available');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
initialize() {
|
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
-
const accessToken = yield this.storage.getItem('access_token');
|
|
55
|
-
const refreshToken = yield this.storage.getItem('refresh_token');
|
|
56
|
-
const userString = yield this.storage.getItem('user');
|
|
57
|
-
this.user = userString ? JSON.parse(userString) : null;
|
|
58
|
-
this.accessToken = accessToken ? JSON.parse(accessToken) : null;
|
|
59
|
-
this.refreshToken = refreshToken ? JSON.parse(refreshToken) : null;
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
request(endpoint, method = 'GET', body, headers = {}, noToken = false) {
|
|
63
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
const url = `${this.baseUrl}${endpoint}`;
|
|
65
|
-
const defaultHeaders = {
|
|
66
|
-
'Content-Type': 'application/json',
|
|
67
|
-
'ngrok-skip-browser-warning': 'true'
|
|
68
|
-
};
|
|
69
|
-
if (noToken) {
|
|
70
|
-
defaultHeaders['Authorization'] = '';
|
|
71
|
-
}
|
|
72
|
-
else {
|
|
73
|
-
// If no token is available, try to get it
|
|
74
|
-
yield this.getToken();
|
|
75
|
-
}
|
|
76
|
-
if (this.accessToken) {
|
|
77
|
-
defaultHeaders['Authorization'] = `Bearer ${this.accessToken}`;
|
|
78
|
-
}
|
|
79
|
-
const response = yield fetch(url, {
|
|
80
|
-
method,
|
|
81
|
-
headers: Object.assign(Object.assign({}, defaultHeaders), headers),
|
|
82
|
-
body: body ? JSON.stringify(body) : undefined,
|
|
83
|
-
});
|
|
84
|
-
if (!response.ok) {
|
|
85
|
-
const errorData = yield response.json().catch(() => ({}));
|
|
86
|
-
throw new Error(errorData.message || `Request failed with status ${response.status}`);
|
|
87
|
-
}
|
|
88
|
-
return response.json();
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
fileUploadRequest(endpoint, body, headers = {}) {
|
|
92
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
const url = `${this.baseUrl}${endpoint}`;
|
|
94
|
-
const defaultHeaders = {
|
|
95
|
-
'ngrok-skip-browser-warning': 'true'
|
|
96
|
-
};
|
|
97
|
-
if (this.accessToken) {
|
|
98
|
-
defaultHeaders['Authorization'] = `Bearer ${this.accessToken}`;
|
|
99
|
-
}
|
|
100
|
-
// Don't set Content-Type for FormData - let browser set it with boundary
|
|
101
|
-
const response = yield fetch(url, {
|
|
102
|
-
method: 'POST',
|
|
103
|
-
headers: Object.assign(Object.assign({}, defaultHeaders), headers),
|
|
104
|
-
body,
|
|
105
|
-
});
|
|
106
|
-
if (!response.ok) {
|
|
107
|
-
const errorData = yield response.json().catch(() => ({}));
|
|
108
|
-
throw new Error(errorData.message || `Request failed with status ${response.status}`);
|
|
109
|
-
}
|
|
110
|
-
return response.json();
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
login(credentials) {
|
|
114
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
-
try {
|
|
116
|
-
const response = yield this.request('/auth/login', 'POST', credentials, {}, true);
|
|
117
|
-
this.accessToken = response.access_token;
|
|
118
|
-
this.refreshToken = response.refresh_token;
|
|
119
|
-
this.user = response.user;
|
|
120
|
-
yield this.storage.setItem('access_token', JSON.stringify(response.access_token));
|
|
121
|
-
yield this.storage.setItem('refresh_token', JSON.stringify(response.refresh_token));
|
|
122
|
-
yield this.storage.setItem('user', JSON.stringify(response.user));
|
|
123
|
-
return response;
|
|
124
|
-
}
|
|
125
|
-
catch (error) {
|
|
126
|
-
yield this.clearAuth();
|
|
127
|
-
throw error;
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
logout() {
|
|
132
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
yield this.clearAuth();
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
clearAuth() {
|
|
137
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
138
|
-
this.accessToken = null;
|
|
139
|
-
this.refreshToken = null;
|
|
140
|
-
this.user = null;
|
|
141
|
-
yield this.storage.removeItem('access_token');
|
|
142
|
-
yield this.storage.removeItem('refresh_token');
|
|
143
|
-
yield this.storage.removeItem('user');
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
isTokenExpired(token, bufferMinutes = 5) {
|
|
147
|
-
try {
|
|
148
|
-
const decoded = jwtDecode(token);
|
|
149
|
-
const currentTime = Date.now() / 1000;
|
|
150
|
-
const bufferTime = bufferMinutes * 60;
|
|
151
|
-
return decoded.exp <= (currentTime + bufferTime);
|
|
152
|
-
}
|
|
153
|
-
catch (error) {
|
|
154
|
-
// If we can't decode the token, consider it expired
|
|
155
|
-
return true;
|
|
156
|
-
}
|
|
28
|
+
super(config);
|
|
29
|
+
// Initialize all domain modules with the same config
|
|
30
|
+
this.auth = new AuthModule(config);
|
|
31
|
+
this.users = new UserModule(config);
|
|
32
|
+
this.organizations = new OrganizationModule(config);
|
|
33
|
+
this.teams = new TeamModule(config);
|
|
34
|
+
this.templates = new TemplateModule(config);
|
|
35
|
+
this.sessions = new SessionModule(config);
|
|
36
|
+
this.agents = new AgentModule(config);
|
|
37
|
+
this.audio = new AudioModule(config);
|
|
38
|
+
this.workflows = new WorkflowModule(config);
|
|
39
|
+
this.logs = new LogModule(config);
|
|
40
|
+
this.debug = new DebugModule(config);
|
|
41
|
+
this.externalIntegrations = new ExternalIntegrationModule(config);
|
|
157
42
|
}
|
|
158
|
-
|
|
43
|
+
// ======================
|
|
44
|
+
// BACKWARD COMPATIBILITY LAYER
|
|
45
|
+
// Delegate methods to appropriate modules to maintain existing API
|
|
46
|
+
// ======================
|
|
47
|
+
// Auth methods
|
|
48
|
+
login(...args) {
|
|
159
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
160
|
-
|
|
161
|
-
throw new Error('No refresh token available');
|
|
162
|
-
}
|
|
163
|
-
try {
|
|
164
|
-
const response = yield this.request('/auth/refresh', 'POST', { refresh_token: this.refreshToken }, {}, true // Skip token validation for this request
|
|
165
|
-
);
|
|
166
|
-
this.accessToken = response.access_token;
|
|
167
|
-
this.refreshToken = response.refresh_token;
|
|
168
|
-
this.user = response.user;
|
|
169
|
-
yield this.storage.setItem('access_token', JSON.stringify(response.access_token));
|
|
170
|
-
yield this.storage.setItem('refresh_token', JSON.stringify(response.refresh_token));
|
|
171
|
-
yield this.storage.setItem('user', JSON.stringify(response.user));
|
|
172
|
-
}
|
|
173
|
-
catch (error) {
|
|
174
|
-
yield this.clearAuth();
|
|
175
|
-
throw new Error('Failed to refresh access token');
|
|
176
|
-
}
|
|
50
|
+
return this.auth.login(...args);
|
|
177
51
|
});
|
|
178
52
|
}
|
|
179
|
-
|
|
180
|
-
return
|
|
53
|
+
logout(...args) {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
+
return this.auth.logout(...args);
|
|
56
|
+
});
|
|
181
57
|
}
|
|
182
|
-
|
|
183
|
-
return this
|
|
58
|
+
getProfile(...args) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
return this.auth.getProfile(...args);
|
|
61
|
+
});
|
|
184
62
|
}
|
|
185
|
-
|
|
186
|
-
return this
|
|
63
|
+
changePassword(...args) {
|
|
64
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
return this.auth.changePassword(...args);
|
|
66
|
+
});
|
|
187
67
|
}
|
|
188
|
-
|
|
189
|
-
return this
|
|
68
|
+
adminChangePassword(...args) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
return this.auth.adminChangePassword(...args);
|
|
71
|
+
});
|
|
190
72
|
}
|
|
191
|
-
|
|
192
|
-
|
|
73
|
+
// User methods
|
|
74
|
+
createUser(...args) {
|
|
193
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
194
|
-
|
|
195
|
-
firstName,
|
|
196
|
-
lastName,
|
|
197
|
-
email,
|
|
198
|
-
password,
|
|
199
|
-
organizationId: (_a = this.user) === null || _a === void 0 ? void 0 : _a.organizationId,
|
|
200
|
-
};
|
|
201
|
-
const user = yield this.request(urls.users, 'POST', createUserDto);
|
|
202
|
-
return user;
|
|
76
|
+
return this.users.createUser(...args);
|
|
203
77
|
});
|
|
204
78
|
}
|
|
205
|
-
|
|
206
|
-
var _a;
|
|
79
|
+
assignEditorToRoleToUser(...args) {
|
|
207
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
208
|
-
|
|
209
|
-
const organization = yield this.request(`${urls.organizations}/${orgId}`, 'GET');
|
|
210
|
-
const orgRoleEditor = organization.roles.find(r => r.name === roleName);
|
|
211
|
-
const assignRoleDto = {
|
|
212
|
-
userId: userId,
|
|
213
|
-
organizationRoleId: orgRoleEditor.id,
|
|
214
|
-
};
|
|
215
|
-
this.request(urls.userOrganizationRoles, 'POST', assignRoleDto);
|
|
216
|
-
const userWithOrgRole = yield this.request(`${urls.user}/${userId}`, 'GET');
|
|
217
|
-
return userWithOrgRole;
|
|
81
|
+
return this.users.assignEditorToRoleToUser(...args);
|
|
218
82
|
});
|
|
219
83
|
}
|
|
220
|
-
|
|
84
|
+
assignAdminToRoleToUser(...args) {
|
|
221
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
222
|
-
return this.
|
|
86
|
+
return this.users.assignAdminToRoleToUser(...args);
|
|
223
87
|
});
|
|
224
88
|
}
|
|
225
|
-
|
|
89
|
+
assignDisabledToRoleToUser(...args) {
|
|
226
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
227
|
-
return this.
|
|
91
|
+
return this.users.assignDisabledToRoleToUser(...args);
|
|
228
92
|
});
|
|
229
93
|
}
|
|
230
|
-
|
|
94
|
+
createEditorUser(...args) {
|
|
231
95
|
return __awaiter(this, void 0, void 0, function* () {
|
|
232
|
-
return this.
|
|
96
|
+
return this.users.createEditorUser(...args);
|
|
233
97
|
});
|
|
234
98
|
}
|
|
235
|
-
|
|
99
|
+
createAdminUser(...args) {
|
|
236
100
|
return __awaiter(this, void 0, void 0, function* () {
|
|
237
|
-
|
|
238
|
-
const userWithOrgRole = yield this.assignEditorToRoleToUser(user.id);
|
|
239
|
-
return userWithOrgRole;
|
|
101
|
+
return this.users.createAdminUser(...args);
|
|
240
102
|
});
|
|
241
103
|
}
|
|
242
|
-
|
|
104
|
+
createDisabledUser(...args) {
|
|
243
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
-
|
|
245
|
-
const userWithOrgRole = yield this.assignAdminToRoleToUser(user.id);
|
|
246
|
-
return userWithOrgRole;
|
|
106
|
+
return this.users.createDisabledUser(...args);
|
|
247
107
|
});
|
|
248
108
|
}
|
|
249
|
-
|
|
109
|
+
getUsers(...args) {
|
|
250
110
|
return __awaiter(this, void 0, void 0, function* () {
|
|
251
|
-
|
|
252
|
-
const userWithOrgRole = yield this.assignDisabledToRoleToUser(user.id);
|
|
253
|
-
return userWithOrgRole;
|
|
111
|
+
return this.users.getUsers(...args);
|
|
254
112
|
});
|
|
255
113
|
}
|
|
256
|
-
|
|
114
|
+
getUser(...args) {
|
|
257
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
-
|
|
259
|
-
name,
|
|
260
|
-
description,
|
|
261
|
-
organizationId: this.user.organizationId,
|
|
262
|
-
};
|
|
263
|
-
return this.request(urls.teams, 'POST', teamDto);
|
|
116
|
+
return this.users.getUser(...args);
|
|
264
117
|
});
|
|
265
118
|
}
|
|
266
|
-
|
|
119
|
+
getUsersByOrganization(...args) {
|
|
267
120
|
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
-
|
|
269
|
-
name,
|
|
270
|
-
description,
|
|
271
|
-
};
|
|
272
|
-
return this.request(`${urls.teams}/${id}`, 'PATCH', teamDto);
|
|
121
|
+
return this.users.getUsersByOrganization(...args);
|
|
273
122
|
});
|
|
274
123
|
}
|
|
275
|
-
|
|
124
|
+
updateUser(...args) {
|
|
276
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
277
|
-
|
|
278
|
-
teamId,
|
|
279
|
-
userId,
|
|
280
|
-
name: roleName,
|
|
281
|
-
};
|
|
282
|
-
return this.request(urls.teamRoles, 'POST', assignRoleDto);
|
|
126
|
+
return this.users.updateUser(...args);
|
|
283
127
|
});
|
|
284
128
|
}
|
|
285
|
-
|
|
129
|
+
deleteUser(...args) {
|
|
286
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
287
|
-
|
|
131
|
+
return this.users.deleteUser(...args);
|
|
288
132
|
});
|
|
289
133
|
}
|
|
290
|
-
|
|
291
|
-
|
|
134
|
+
// Organization methods
|
|
135
|
+
createOrganization(...args) {
|
|
292
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
293
|
-
|
|
294
|
-
if (!finalCategoryId) {
|
|
295
|
-
const templateCategories = yield this.request(urls.templateCategories, 'GET');
|
|
296
|
-
finalCategoryId = (_a = templateCategories[0]) === null || _a === void 0 ? void 0 : _a.id;
|
|
297
|
-
if (!finalCategoryId) {
|
|
298
|
-
throw new Error('No template categories available. Please create one first.');
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
const createTemplateDto = {
|
|
302
|
-
title,
|
|
303
|
-
content,
|
|
304
|
-
isGlobal: false,
|
|
305
|
-
categoryId: finalCategoryId,
|
|
306
|
-
createdById: this.user.id,
|
|
307
|
-
organizationId: this.user.organizationId,
|
|
308
|
-
workflowId,
|
|
309
|
-
agentId,
|
|
310
|
-
};
|
|
311
|
-
return this.request(urls.templates, 'POST', createTemplateDto);
|
|
137
|
+
return this.organizations.createOrganization(...args);
|
|
312
138
|
});
|
|
313
139
|
}
|
|
314
|
-
|
|
140
|
+
getOrganizations(...args) {
|
|
315
141
|
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
-
|
|
317
|
-
title,
|
|
318
|
-
content,
|
|
319
|
-
originalTemplateId,
|
|
320
|
-
userId: this.user.id,
|
|
321
|
-
};
|
|
322
|
-
return this.request(urls.userTemplates, 'POST', createUserTemplateDto);
|
|
142
|
+
return this.organizations.getOrganizations(...args);
|
|
323
143
|
});
|
|
324
144
|
}
|
|
325
|
-
|
|
145
|
+
getOrganization(...args) {
|
|
326
146
|
return __awaiter(this, void 0, void 0, function* () {
|
|
327
|
-
|
|
328
|
-
title,
|
|
329
|
-
content,
|
|
330
|
-
isGlobal: false,
|
|
331
|
-
organizationId: this.user.organizationId,
|
|
332
|
-
workflowId,
|
|
333
|
-
agentId,
|
|
334
|
-
};
|
|
335
|
-
return this.request(`${urls.templates}/${id}`, 'PATCH', templateDto);
|
|
147
|
+
return this.organizations.getOrganization(...args);
|
|
336
148
|
});
|
|
337
149
|
}
|
|
338
|
-
|
|
150
|
+
updateOrganization(...args) {
|
|
339
151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
340
|
-
|
|
341
|
-
title,
|
|
342
|
-
content,
|
|
343
|
-
};
|
|
344
|
-
return this.request(`${urls.userTemplates}/${id}`, 'PATCH', userTemplateDto);
|
|
152
|
+
return this.organizations.updateOrganization(...args);
|
|
345
153
|
});
|
|
346
154
|
}
|
|
347
|
-
|
|
155
|
+
deleteOrganization(...args) {
|
|
348
156
|
return __awaiter(this, void 0, void 0, function* () {
|
|
349
|
-
return this.
|
|
157
|
+
return this.organizations.deleteOrganization(...args);
|
|
350
158
|
});
|
|
351
159
|
}
|
|
352
|
-
|
|
160
|
+
addUserToOrganization(...args) {
|
|
353
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
354
|
-
return this.
|
|
162
|
+
return this.organizations.addUserToOrganization(...args);
|
|
355
163
|
});
|
|
356
164
|
}
|
|
357
|
-
|
|
165
|
+
removeUserFromOrganization(...args) {
|
|
358
166
|
return __awaiter(this, void 0, void 0, function* () {
|
|
359
|
-
|
|
360
|
-
return this.request(url, 'GET');
|
|
167
|
+
return this.organizations.removeUserFromOrganization(...args);
|
|
361
168
|
});
|
|
362
169
|
}
|
|
363
|
-
//
|
|
364
|
-
|
|
365
|
-
// ======================
|
|
366
|
-
generateTranscriptionSummary(templateId, sessionId) {
|
|
170
|
+
// Team methods
|
|
171
|
+
createTeam(...args) {
|
|
367
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
368
|
-
|
|
369
|
-
templateId,
|
|
370
|
-
userId: this.user.id,
|
|
371
|
-
fromUserTemplate: false,
|
|
372
|
-
sessionId: sessionId,
|
|
373
|
-
};
|
|
374
|
-
const transcriptionSummary = yield this.request(urls.transcriptionSummary, 'POST', generateSummaryDto);
|
|
375
|
-
return transcriptionSummary;
|
|
173
|
+
return this.teams.createTeam(...args);
|
|
376
174
|
});
|
|
377
175
|
}
|
|
378
|
-
|
|
176
|
+
updateTeam(...args) {
|
|
379
177
|
return __awaiter(this, void 0, void 0, function* () {
|
|
380
|
-
return this.
|
|
178
|
+
return this.teams.updateTeam(...args);
|
|
381
179
|
});
|
|
382
180
|
}
|
|
383
|
-
|
|
181
|
+
addUserToTeam(...args) {
|
|
384
182
|
return __awaiter(this, void 0, void 0, function* () {
|
|
385
|
-
|
|
386
|
-
templateId: userTemplateId,
|
|
387
|
-
userId: this.user.id,
|
|
388
|
-
fromUserTemplate: true,
|
|
389
|
-
sessionId: sessionId,
|
|
390
|
-
};
|
|
391
|
-
const transcriptionSummary = yield this.request(urls.transcriptionSummary, 'POST', generateSummaryDto);
|
|
392
|
-
return transcriptionSummary;
|
|
183
|
+
return this.teams.addUserToTeam(...args);
|
|
393
184
|
});
|
|
394
185
|
}
|
|
395
|
-
|
|
186
|
+
removeUserFromTeam(...args) {
|
|
396
187
|
return __awaiter(this, void 0, void 0, function* () {
|
|
397
|
-
|
|
398
|
-
content,
|
|
399
|
-
};
|
|
400
|
-
return this.request(`${urls.transcriptionSummary}/${id}`, 'PATCH', updateSummaryDto);
|
|
188
|
+
return this.teams.removeUserFromTeam(...args);
|
|
401
189
|
});
|
|
402
190
|
}
|
|
403
|
-
|
|
191
|
+
getTeams(...args) {
|
|
404
192
|
return __awaiter(this, void 0, void 0, function* () {
|
|
405
|
-
|
|
406
|
-
const uploadIds = (yield this.storage.getItem('uploadIds')) || '[]';
|
|
407
|
-
const uploadIdsArray = JSON.parse(uploadIds);
|
|
408
|
-
yield this.storage.setItem('uploadIds', JSON.stringify([...uploadIdsArray, uploadId]));
|
|
409
|
-
return uploadId;
|
|
193
|
+
return this.teams.getTeams(...args);
|
|
410
194
|
});
|
|
411
195
|
}
|
|
412
|
-
|
|
196
|
+
getTeam(...args) {
|
|
413
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
414
|
-
|
|
415
|
-
return data;
|
|
198
|
+
return this.teams.getTeam(...args);
|
|
416
199
|
});
|
|
417
200
|
}
|
|
418
|
-
|
|
201
|
+
getTeamsByOrganization(...args) {
|
|
419
202
|
return __awaiter(this, void 0, void 0, function* () {
|
|
420
|
-
|
|
421
|
-
return transcript.transcript;
|
|
203
|
+
return this.teams.getTeamsByOrganization(...args);
|
|
422
204
|
});
|
|
423
205
|
}
|
|
424
|
-
|
|
425
|
-
// AUTH METHODS
|
|
426
|
-
// ======================
|
|
427
|
-
getProfile() {
|
|
206
|
+
deleteTeam(...args) {
|
|
428
207
|
return __awaiter(this, void 0, void 0, function* () {
|
|
429
|
-
return this.
|
|
208
|
+
return this.teams.deleteTeam(...args);
|
|
430
209
|
});
|
|
431
210
|
}
|
|
432
|
-
|
|
211
|
+
removeUserFromTeamFixed(...args) {
|
|
433
212
|
return __awaiter(this, void 0, void 0, function* () {
|
|
434
|
-
|
|
435
|
-
currentPassword,
|
|
436
|
-
newPassword,
|
|
437
|
-
};
|
|
438
|
-
return this.request(urls.changePassword, 'PATCH', dto);
|
|
213
|
+
return this.teams.removeUserFromTeamFixed(...args);
|
|
439
214
|
});
|
|
440
215
|
}
|
|
441
|
-
|
|
216
|
+
// Template methods
|
|
217
|
+
createTemplate(...args) {
|
|
442
218
|
return __awaiter(this, void 0, void 0, function* () {
|
|
443
|
-
|
|
444
|
-
userId,
|
|
445
|
-
newPassword,
|
|
446
|
-
};
|
|
447
|
-
return this.request(urls.adminChangePassword, 'PATCH', dto);
|
|
219
|
+
return this.templates.createTemplate(...args);
|
|
448
220
|
});
|
|
449
221
|
}
|
|
450
|
-
|
|
451
|
-
// ORGANIZATION METHODS
|
|
452
|
-
// ======================
|
|
453
|
-
createOrganization(name, description) {
|
|
222
|
+
updateTemplate(...args) {
|
|
454
223
|
return __awaiter(this, void 0, void 0, function* () {
|
|
455
|
-
|
|
456
|
-
return this.request(urls.organizations, 'POST', dto);
|
|
224
|
+
return this.templates.updateTemplate(...args);
|
|
457
225
|
});
|
|
458
226
|
}
|
|
459
|
-
|
|
227
|
+
getTemplates(...args) {
|
|
460
228
|
return __awaiter(this, void 0, void 0, function* () {
|
|
461
|
-
return this.
|
|
229
|
+
return this.templates.getTemplates(...args);
|
|
462
230
|
});
|
|
463
231
|
}
|
|
464
|
-
|
|
232
|
+
getTemplatesByOrganization(...args) {
|
|
465
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
466
|
-
return this.
|
|
234
|
+
return this.templates.getTemplatesByOrganization(...args);
|
|
467
235
|
});
|
|
468
236
|
}
|
|
469
|
-
|
|
237
|
+
getTemplate(...args) {
|
|
470
238
|
return __awaiter(this, void 0, void 0, function* () {
|
|
471
|
-
|
|
472
|
-
return this.request(`${urls.organizations}/${id}`, 'PATCH', dto);
|
|
239
|
+
return this.templates.getTemplate(...args);
|
|
473
240
|
});
|
|
474
241
|
}
|
|
475
|
-
|
|
242
|
+
deleteTemplate(...args) {
|
|
476
243
|
return __awaiter(this, void 0, void 0, function* () {
|
|
477
|
-
|
|
244
|
+
return this.templates.deleteTemplate(...args);
|
|
478
245
|
});
|
|
479
246
|
}
|
|
480
|
-
|
|
247
|
+
createUserTemplate(...args) {
|
|
481
248
|
return __awaiter(this, void 0, void 0, function* () {
|
|
482
|
-
|
|
249
|
+
return this.templates.createUserTemplate(...args);
|
|
483
250
|
});
|
|
484
251
|
}
|
|
485
|
-
|
|
252
|
+
updateUserTemplate(...args) {
|
|
486
253
|
return __awaiter(this, void 0, void 0, function* () {
|
|
487
|
-
|
|
254
|
+
return this.templates.updateUserTemplate(...args);
|
|
488
255
|
});
|
|
489
256
|
}
|
|
490
|
-
|
|
491
|
-
// USER METHODS
|
|
492
|
-
// ======================
|
|
493
|
-
getUsers() {
|
|
257
|
+
getUserTemplates(...args) {
|
|
494
258
|
return __awaiter(this, void 0, void 0, function* () {
|
|
495
|
-
return this.
|
|
259
|
+
return this.templates.getUserTemplates(...args);
|
|
496
260
|
});
|
|
497
261
|
}
|
|
498
|
-
|
|
262
|
+
getUserTemplate(...args) {
|
|
499
263
|
return __awaiter(this, void 0, void 0, function* () {
|
|
500
|
-
return this.
|
|
264
|
+
return this.templates.getUserTemplate(...args);
|
|
501
265
|
});
|
|
502
266
|
}
|
|
503
|
-
|
|
267
|
+
deleteUserTemplate(...args) {
|
|
504
268
|
return __awaiter(this, void 0, void 0, function* () {
|
|
505
|
-
return this.
|
|
269
|
+
return this.templates.deleteUserTemplate(...args);
|
|
506
270
|
});
|
|
507
271
|
}
|
|
508
|
-
|
|
272
|
+
getTemplateCategories(...args) {
|
|
509
273
|
return __awaiter(this, void 0, void 0, function* () {
|
|
510
|
-
return this.
|
|
274
|
+
return this.templates.getTemplateCategories(...args);
|
|
511
275
|
});
|
|
512
276
|
}
|
|
513
|
-
|
|
277
|
+
getTemplateCategory(...args) {
|
|
514
278
|
return __awaiter(this, void 0, void 0, function* () {
|
|
515
|
-
|
|
279
|
+
return this.templates.getTemplateCategory(...args);
|
|
516
280
|
});
|
|
517
281
|
}
|
|
518
|
-
|
|
519
|
-
// TEAM METHODS
|
|
520
|
-
// ======================
|
|
521
|
-
getTeams() {
|
|
282
|
+
createTemplateCategory(...args) {
|
|
522
283
|
return __awaiter(this, void 0, void 0, function* () {
|
|
523
|
-
return this.
|
|
284
|
+
return this.templates.createTemplateCategory(...args);
|
|
524
285
|
});
|
|
525
286
|
}
|
|
526
|
-
|
|
287
|
+
updateTemplateCategory(...args) {
|
|
527
288
|
return __awaiter(this, void 0, void 0, function* () {
|
|
528
|
-
return this.
|
|
289
|
+
return this.templates.updateTemplateCategory(...args);
|
|
529
290
|
});
|
|
530
291
|
}
|
|
531
|
-
|
|
292
|
+
deleteTemplateCategory(...args) {
|
|
532
293
|
return __awaiter(this, void 0, void 0, function* () {
|
|
533
|
-
return this.
|
|
294
|
+
return this.templates.deleteTemplateCategory(...args);
|
|
534
295
|
});
|
|
535
296
|
}
|
|
536
|
-
|
|
297
|
+
assignTemplateToTeam(...args) {
|
|
537
298
|
return __awaiter(this, void 0, void 0, function* () {
|
|
538
|
-
|
|
299
|
+
return this.templates.assignTemplateToTeam(...args);
|
|
539
300
|
});
|
|
540
301
|
}
|
|
541
|
-
|
|
542
|
-
// TEMPLATE CATEGORY METHODS
|
|
543
|
-
// ======================
|
|
544
|
-
getTemplateCategories() {
|
|
302
|
+
removeTemplateFromTeam(...args) {
|
|
545
303
|
return __awaiter(this, void 0, void 0, function* () {
|
|
546
|
-
return this.
|
|
304
|
+
return this.templates.removeTemplateFromTeam(...args);
|
|
547
305
|
});
|
|
548
306
|
}
|
|
549
|
-
|
|
307
|
+
generateTranscriptionSummary(...args) {
|
|
550
308
|
return __awaiter(this, void 0, void 0, function* () {
|
|
551
|
-
return this.
|
|
309
|
+
return this.templates.generateTranscriptionSummary(...args);
|
|
552
310
|
});
|
|
553
311
|
}
|
|
554
|
-
|
|
312
|
+
generateTranscriptionSummaryFromUserTemplate(...args) {
|
|
555
313
|
return __awaiter(this, void 0, void 0, function* () {
|
|
556
|
-
|
|
557
|
-
return this.request(urls.templateCategories, 'POST', dto);
|
|
314
|
+
return this.templates.generateTranscriptionSummaryFromUserTemplate(...args);
|
|
558
315
|
});
|
|
559
316
|
}
|
|
560
|
-
|
|
317
|
+
updateTranscriptionSummary(...args) {
|
|
561
318
|
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
-
|
|
563
|
-
return this.request(`${urls.templateCategories}/${id}`, 'PATCH', dto);
|
|
319
|
+
return this.templates.updateTranscriptionSummary(...args);
|
|
564
320
|
});
|
|
565
321
|
}
|
|
566
|
-
|
|
322
|
+
getTranscriptionSummaries(...args) {
|
|
567
323
|
return __awaiter(this, void 0, void 0, function* () {
|
|
568
|
-
|
|
324
|
+
return this.templates.getTranscriptionSummaries(...args);
|
|
569
325
|
});
|
|
570
326
|
}
|
|
571
|
-
|
|
572
|
-
// ENHANCED TEMPLATE METHODS
|
|
573
|
-
// ======================
|
|
574
|
-
getTemplate(id) {
|
|
327
|
+
getTranscriptionSummary(...args) {
|
|
575
328
|
return __awaiter(this, void 0, void 0, function* () {
|
|
576
|
-
return this.
|
|
329
|
+
return this.templates.getTranscriptionSummary(...args);
|
|
577
330
|
});
|
|
578
331
|
}
|
|
579
|
-
|
|
332
|
+
getTranscriptionSummariesByUser(...args) {
|
|
580
333
|
return __awaiter(this, void 0, void 0, function* () {
|
|
581
|
-
|
|
334
|
+
return this.templates.getTranscriptionSummariesByUser(...args);
|
|
582
335
|
});
|
|
583
336
|
}
|
|
584
|
-
|
|
337
|
+
getByOrganizationTranscriptionSummaries(...args) {
|
|
585
338
|
return __awaiter(this, void 0, void 0, function* () {
|
|
586
|
-
return this.
|
|
339
|
+
return this.templates.getByOrganizationTranscriptionSummaries(...args);
|
|
587
340
|
});
|
|
588
341
|
}
|
|
589
|
-
|
|
342
|
+
deleteTranscriptionSummary(...args) {
|
|
590
343
|
return __awaiter(this, void 0, void 0, function* () {
|
|
591
|
-
|
|
344
|
+
return this.templates.deleteTranscriptionSummary(...args);
|
|
592
345
|
});
|
|
593
346
|
}
|
|
594
|
-
|
|
595
|
-
// TEAM TEMPLATE METHODS
|
|
596
|
-
// ======================
|
|
597
|
-
assignTemplateToTeam(teamId, templateId) {
|
|
347
|
+
uploadLargeAudioFile(...args) {
|
|
598
348
|
return __awaiter(this, void 0, void 0, function* () {
|
|
599
|
-
|
|
600
|
-
yield this.request(urls.teamTemplates, 'POST', dto);
|
|
349
|
+
return this.templates.uploadLargeAudioFile(...args);
|
|
601
350
|
});
|
|
602
351
|
}
|
|
603
|
-
|
|
352
|
+
uploadAudioFile(...args) {
|
|
604
353
|
return __awaiter(this, void 0, void 0, function* () {
|
|
605
|
-
|
|
354
|
+
return this.templates.uploadAudioFile(...args);
|
|
606
355
|
});
|
|
607
356
|
}
|
|
608
|
-
|
|
609
|
-
// TRANSCRIPTION SUMMARY METHODS
|
|
610
|
-
// ======================
|
|
611
|
-
getTranscriptionSummaries() {
|
|
357
|
+
transcribeBase64Audio(...args) {
|
|
612
358
|
return __awaiter(this, void 0, void 0, function* () {
|
|
613
|
-
return this.
|
|
359
|
+
return this.templates.transcribeBase64Audio(...args);
|
|
614
360
|
});
|
|
615
361
|
}
|
|
616
|
-
|
|
362
|
+
// Session methods
|
|
363
|
+
createSession(...args) {
|
|
617
364
|
return __awaiter(this, void 0, void 0, function* () {
|
|
618
|
-
return this.
|
|
365
|
+
return this.sessions.createSession(...args);
|
|
619
366
|
});
|
|
620
367
|
}
|
|
621
|
-
|
|
368
|
+
getSessions(...args) {
|
|
622
369
|
return __awaiter(this, void 0, void 0, function* () {
|
|
623
|
-
return this.
|
|
370
|
+
return this.sessions.getSessions(...args);
|
|
624
371
|
});
|
|
625
372
|
}
|
|
626
|
-
|
|
373
|
+
getSession(...args) {
|
|
627
374
|
return __awaiter(this, void 0, void 0, function* () {
|
|
628
|
-
|
|
375
|
+
return this.sessions.getSession(...args);
|
|
629
376
|
});
|
|
630
377
|
}
|
|
631
|
-
|
|
632
|
-
// ENHANCED TEAM ROLE METHODS
|
|
633
|
-
// ======================
|
|
634
|
-
removeUserFromTeamFixed(teamId, userId) {
|
|
378
|
+
getSessionsByUser(...args) {
|
|
635
379
|
return __awaiter(this, void 0, void 0, function* () {
|
|
636
|
-
|
|
380
|
+
return this.sessions.getSessionsByUser(...args);
|
|
637
381
|
});
|
|
638
382
|
}
|
|
639
|
-
|
|
640
|
-
// SESSION METHODS
|
|
641
|
-
// ======================
|
|
642
|
-
createSession(sessionData) {
|
|
383
|
+
getSessionsByOrganization(...args) {
|
|
643
384
|
return __awaiter(this, void 0, void 0, function* () {
|
|
644
|
-
return this.
|
|
385
|
+
return this.sessions.getSessionsByOrganization(...args);
|
|
645
386
|
});
|
|
646
387
|
}
|
|
647
|
-
|
|
388
|
+
updateSession(...args) {
|
|
648
389
|
return __awaiter(this, void 0, void 0, function* () {
|
|
649
|
-
return this.
|
|
390
|
+
return this.sessions.updateSession(...args);
|
|
650
391
|
});
|
|
651
392
|
}
|
|
652
|
-
|
|
393
|
+
deleteSession(...args) {
|
|
653
394
|
return __awaiter(this, void 0, void 0, function* () {
|
|
654
|
-
return this.
|
|
395
|
+
return this.sessions.deleteSession(...args);
|
|
655
396
|
});
|
|
656
397
|
}
|
|
657
|
-
|
|
398
|
+
setPrimaryTranscriptionSummary(...args) {
|
|
658
399
|
return __awaiter(this, void 0, void 0, function* () {
|
|
659
|
-
return this.
|
|
400
|
+
return this.sessions.setPrimaryTranscriptionSummary(...args);
|
|
660
401
|
});
|
|
661
402
|
}
|
|
662
|
-
|
|
403
|
+
rerunTranscription(...args) {
|
|
663
404
|
return __awaiter(this, void 0, void 0, function* () {
|
|
664
|
-
return this.
|
|
405
|
+
return this.sessions.rerunTranscription(...args);
|
|
665
406
|
});
|
|
666
407
|
}
|
|
667
|
-
|
|
408
|
+
// Agent methods
|
|
409
|
+
createAgent(...args) {
|
|
668
410
|
return __awaiter(this, void 0, void 0, function* () {
|
|
669
|
-
return this.
|
|
411
|
+
return this.agents.createAgent(...args);
|
|
670
412
|
});
|
|
671
413
|
}
|
|
672
|
-
|
|
414
|
+
getAgents(...args) {
|
|
673
415
|
return __awaiter(this, void 0, void 0, function* () {
|
|
674
|
-
|
|
416
|
+
return this.agents.getAgents(...args);
|
|
675
417
|
});
|
|
676
418
|
}
|
|
677
|
-
|
|
419
|
+
getAgent(...args) {
|
|
678
420
|
return __awaiter(this, void 0, void 0, function* () {
|
|
679
|
-
return this.
|
|
421
|
+
return this.agents.getAgent(...args);
|
|
680
422
|
});
|
|
681
423
|
}
|
|
682
|
-
|
|
424
|
+
updateAgent(...args) {
|
|
683
425
|
return __awaiter(this, void 0, void 0, function* () {
|
|
684
|
-
return this.
|
|
426
|
+
return this.agents.updateAgent(...args);
|
|
685
427
|
});
|
|
686
428
|
}
|
|
687
|
-
|
|
688
|
-
// AGENT METHODS
|
|
689
|
-
// ======================
|
|
690
|
-
createAgent(name, templateTextReplacement) {
|
|
429
|
+
deleteAgent(...args) {
|
|
691
430
|
return __awaiter(this, void 0, void 0, function* () {
|
|
692
|
-
|
|
693
|
-
return this.request(urls.agents, 'POST', dto);
|
|
431
|
+
return this.agents.deleteAgent(...args);
|
|
694
432
|
});
|
|
695
433
|
}
|
|
696
|
-
|
|
434
|
+
addAgentToOrganization(...args) {
|
|
697
435
|
return __awaiter(this, void 0, void 0, function* () {
|
|
698
|
-
return this.
|
|
436
|
+
return this.agents.addAgentToOrganization(...args);
|
|
699
437
|
});
|
|
700
438
|
}
|
|
701
|
-
|
|
439
|
+
removeAgentFromOrganization(...args) {
|
|
702
440
|
return __awaiter(this, void 0, void 0, function* () {
|
|
703
|
-
return this.
|
|
441
|
+
return this.agents.removeAgentFromOrganization(...args);
|
|
704
442
|
});
|
|
705
443
|
}
|
|
706
|
-
|
|
444
|
+
createAgentSettings(...args) {
|
|
707
445
|
return __awaiter(this, void 0, void 0, function* () {
|
|
708
|
-
|
|
709
|
-
return this.request(`${urls.agents}/${id}`, 'PATCH', dto);
|
|
446
|
+
return this.agents.createAgentSettings(...args);
|
|
710
447
|
});
|
|
711
448
|
}
|
|
712
|
-
|
|
449
|
+
getAgentSettings(...args) {
|
|
713
450
|
return __awaiter(this, void 0, void 0, function* () {
|
|
714
|
-
|
|
451
|
+
return this.agents.getAgentSettings(...args);
|
|
715
452
|
});
|
|
716
453
|
}
|
|
717
|
-
|
|
454
|
+
getAgentSettingsById(...args) {
|
|
718
455
|
return __awaiter(this, void 0, void 0, function* () {
|
|
719
|
-
|
|
456
|
+
return this.agents.getAgentSettingsById(...args);
|
|
720
457
|
});
|
|
721
458
|
}
|
|
722
|
-
|
|
459
|
+
getAgentSettingsByAgentAndOrganization(...args) {
|
|
723
460
|
return __awaiter(this, void 0, void 0, function* () {
|
|
724
|
-
|
|
461
|
+
return this.agents.getAgentSettingsByAgentAndOrganization(...args);
|
|
725
462
|
});
|
|
726
463
|
}
|
|
727
|
-
|
|
728
|
-
// AGENT SETTINGS METHODS
|
|
729
|
-
// ======================
|
|
730
|
-
createAgentSettings(settingsData) {
|
|
464
|
+
updateAgentSettings(...args) {
|
|
731
465
|
return __awaiter(this, void 0, void 0, function* () {
|
|
732
|
-
return this.
|
|
466
|
+
return this.agents.updateAgentSettings(...args);
|
|
733
467
|
});
|
|
734
468
|
}
|
|
735
|
-
|
|
469
|
+
deleteAgentSettings(...args) {
|
|
736
470
|
return __awaiter(this, void 0, void 0, function* () {
|
|
737
|
-
|
|
738
|
-
if (organizationId)
|
|
739
|
-
params.append('organizationId', organizationId);
|
|
740
|
-
if (agentId)
|
|
741
|
-
params.append('agentId', agentId);
|
|
742
|
-
const queryString = params.toString();
|
|
743
|
-
const endpoint = queryString ? `${urls.agentSettings}?${queryString}` : urls.agentSettings;
|
|
744
|
-
return this.request(endpoint, 'GET');
|
|
471
|
+
return this.agents.deleteAgentSettings(...args);
|
|
745
472
|
});
|
|
746
473
|
}
|
|
747
|
-
|
|
474
|
+
// Audio methods
|
|
475
|
+
uploadAudioFileToSession(...args) {
|
|
748
476
|
return __awaiter(this, void 0, void 0, function* () {
|
|
749
|
-
return this.
|
|
477
|
+
return this.audio.uploadAudioFileToSession(...args);
|
|
750
478
|
});
|
|
751
479
|
}
|
|
752
|
-
|
|
480
|
+
uploadAudioFileWithTranscriptionQueue(...args) {
|
|
753
481
|
return __awaiter(this, void 0, void 0, function* () {
|
|
754
|
-
return this.
|
|
482
|
+
return this.audio.uploadAudioFileWithTranscriptionQueue(...args);
|
|
755
483
|
});
|
|
756
484
|
}
|
|
757
|
-
|
|
485
|
+
getMyAudioFiles(...args) {
|
|
758
486
|
return __awaiter(this, void 0, void 0, function* () {
|
|
759
|
-
return this.
|
|
487
|
+
return this.audio.getMyAudioFiles(...args);
|
|
760
488
|
});
|
|
761
489
|
}
|
|
762
|
-
|
|
490
|
+
getAllAudioFiles(...args) {
|
|
763
491
|
return __awaiter(this, void 0, void 0, function* () {
|
|
764
|
-
|
|
492
|
+
return this.audio.getAllAudioFiles(...args);
|
|
765
493
|
});
|
|
766
494
|
}
|
|
767
|
-
|
|
768
|
-
// AUDIO FILE METHODS
|
|
769
|
-
// ======================
|
|
770
|
-
uploadAudioFileToSession(sessionId, file, fileName, culturalTranscription) {
|
|
495
|
+
getOrganizationAudioFiles(...args) {
|
|
771
496
|
return __awaiter(this, void 0, void 0, function* () {
|
|
772
|
-
|
|
773
|
-
formData.append('file', file, fileName);
|
|
774
|
-
if (culturalTranscription) {
|
|
775
|
-
formData.append('cultural_transcription', culturalTranscription);
|
|
776
|
-
}
|
|
777
|
-
return this.fileUploadRequest(`${urls.audioFiles}/upload/${sessionId}`, formData);
|
|
497
|
+
return this.audio.getOrganizationAudioFiles(...args);
|
|
778
498
|
});
|
|
779
499
|
}
|
|
780
|
-
|
|
500
|
+
getAudioFilesBySession(...args) {
|
|
781
501
|
return __awaiter(this, void 0, void 0, function* () {
|
|
782
|
-
|
|
783
|
-
formData.append('file', file, options === null || options === void 0 ? void 0 : options.fileName);
|
|
784
|
-
if (options === null || options === void 0 ? void 0 : options.culturalTranscription) {
|
|
785
|
-
formData.append('cultural_transcription', options.culturalTranscription);
|
|
786
|
-
}
|
|
787
|
-
// This will automatically trigger the transcription queue
|
|
788
|
-
return this.fileUploadRequest(`${urls.audioFiles}/upload/${sessionId}`, formData);
|
|
502
|
+
return this.audio.getAudioFilesBySession(...args);
|
|
789
503
|
});
|
|
790
504
|
}
|
|
791
|
-
|
|
505
|
+
getAudioFile(...args) {
|
|
792
506
|
return __awaiter(this, void 0, void 0, function* () {
|
|
793
|
-
return this.
|
|
507
|
+
return this.audio.getAudioFile(...args);
|
|
794
508
|
});
|
|
795
509
|
}
|
|
796
|
-
|
|
510
|
+
updateAudioFile(...args) {
|
|
797
511
|
return __awaiter(this, void 0, void 0, function* () {
|
|
798
|
-
return this.
|
|
512
|
+
return this.audio.updateAudioFile(...args);
|
|
799
513
|
});
|
|
800
514
|
}
|
|
801
|
-
|
|
515
|
+
deleteAudioFile(...args) {
|
|
802
516
|
return __awaiter(this, void 0, void 0, function* () {
|
|
803
|
-
return this.
|
|
517
|
+
return this.audio.deleteAudioFile(...args);
|
|
804
518
|
});
|
|
805
519
|
}
|
|
806
|
-
|
|
520
|
+
downloadAudioFile(...args) {
|
|
807
521
|
return __awaiter(this, void 0, void 0, function* () {
|
|
808
|
-
return this.
|
|
522
|
+
return this.audio.downloadAudioFile(...args);
|
|
809
523
|
});
|
|
810
524
|
}
|
|
811
|
-
|
|
525
|
+
downloadAudioFileAsUrl(...args) {
|
|
812
526
|
return __awaiter(this, void 0, void 0, function* () {
|
|
813
|
-
return this.
|
|
527
|
+
return this.audio.downloadAudioFileAsUrl(...args);
|
|
814
528
|
});
|
|
815
529
|
}
|
|
816
|
-
|
|
530
|
+
getTranscribedAudioFiles(...args) {
|
|
817
531
|
return __awaiter(this, void 0, void 0, function* () {
|
|
818
|
-
return this.
|
|
532
|
+
return this.audio.getTranscribedAudioFiles(...args);
|
|
819
533
|
});
|
|
820
534
|
}
|
|
821
|
-
|
|
535
|
+
getProcessingAudioFiles(...args) {
|
|
822
536
|
return __awaiter(this, void 0, void 0, function* () {
|
|
823
|
-
|
|
537
|
+
return this.audio.getProcessingAudioFiles(...args);
|
|
824
538
|
});
|
|
825
539
|
}
|
|
826
|
-
|
|
540
|
+
getFailedAudioFiles(...args) {
|
|
827
541
|
return __awaiter(this, void 0, void 0, function* () {
|
|
828
|
-
|
|
829
|
-
const url = `${this.baseUrl}${urls.audioFiles}/${id}/download`;
|
|
830
|
-
// Get token first
|
|
831
|
-
yield this.getToken();
|
|
832
|
-
const defaultHeaders = {
|
|
833
|
-
'ngrok-skip-browser-warning': 'true'
|
|
834
|
-
};
|
|
835
|
-
if (this.accessToken) {
|
|
836
|
-
defaultHeaders['Authorization'] = `Bearer ${this.accessToken}`;
|
|
837
|
-
}
|
|
838
|
-
const response = yield fetch(url, {
|
|
839
|
-
method: 'GET',
|
|
840
|
-
headers: defaultHeaders,
|
|
841
|
-
});
|
|
842
|
-
if (!response.ok) {
|
|
843
|
-
const errorData = yield response.json().catch(() => ({}));
|
|
844
|
-
throw new Error(errorData.message || `Download failed with status ${response.status}`);
|
|
845
|
-
}
|
|
846
|
-
return response.blob();
|
|
542
|
+
return this.audio.getFailedAudioFiles(...args);
|
|
847
543
|
});
|
|
848
544
|
}
|
|
849
|
-
|
|
545
|
+
createBase64AudioFile(...args) {
|
|
850
546
|
return __awaiter(this, void 0, void 0, function* () {
|
|
851
|
-
|
|
852
|
-
return URL.createObjectURL(blob);
|
|
547
|
+
return this.audio.createBase64AudioFile(...args);
|
|
853
548
|
});
|
|
854
549
|
}
|
|
855
|
-
|
|
856
|
-
// TRANSCRIPTION QUEUE HELPER METHODS
|
|
857
|
-
// ======================
|
|
858
|
-
getTranscribedAudioFiles() {
|
|
550
|
+
getAllBase64AudioFiles(...args) {
|
|
859
551
|
return __awaiter(this, void 0, void 0, function* () {
|
|
860
|
-
|
|
861
|
-
return audioFiles.filter(file => file.status === AudioFileStatus.TRANSCRIBED && file.transcription);
|
|
552
|
+
return this.audio.getAllBase64AudioFiles(...args);
|
|
862
553
|
});
|
|
863
554
|
}
|
|
864
|
-
|
|
555
|
+
getBase64AudioFilesBySession(...args) {
|
|
865
556
|
return __awaiter(this, void 0, void 0, function* () {
|
|
866
|
-
|
|
867
|
-
return audioFiles.filter(file => file.status === AudioFileStatus.PROCESSING);
|
|
557
|
+
return this.audio.getBase64AudioFilesBySession(...args);
|
|
868
558
|
});
|
|
869
559
|
}
|
|
870
|
-
|
|
560
|
+
getBase64AudioFile(...args) {
|
|
871
561
|
return __awaiter(this, void 0, void 0, function* () {
|
|
872
|
-
|
|
873
|
-
return audioFiles.filter(file => file.status === AudioFileStatus.FAILED);
|
|
562
|
+
return this.audio.getBase64AudioFile(...args);
|
|
874
563
|
});
|
|
875
564
|
}
|
|
876
|
-
|
|
877
|
-
// BASE64 AUDIO FILE METHODS
|
|
878
|
-
// ======================
|
|
879
|
-
createBase64AudioFile(dto) {
|
|
565
|
+
updateBase64AudioFile(...args) {
|
|
880
566
|
return __awaiter(this, void 0, void 0, function* () {
|
|
881
|
-
return this.
|
|
567
|
+
return this.audio.updateBase64AudioFile(...args);
|
|
882
568
|
});
|
|
883
569
|
}
|
|
884
|
-
|
|
570
|
+
deleteBase64AudioFile(...args) {
|
|
885
571
|
return __awaiter(this, void 0, void 0, function* () {
|
|
886
|
-
return this.
|
|
572
|
+
return this.audio.deleteBase64AudioFile(...args);
|
|
887
573
|
});
|
|
888
574
|
}
|
|
889
|
-
|
|
575
|
+
addBase64Chunk(...args) {
|
|
890
576
|
return __awaiter(this, void 0, void 0, function* () {
|
|
891
|
-
return this.
|
|
577
|
+
return this.audio.addBase64Chunk(...args);
|
|
892
578
|
});
|
|
893
579
|
}
|
|
894
|
-
|
|
580
|
+
queueSessionBase64AudioForTranscription(...args) {
|
|
895
581
|
return __awaiter(this, void 0, void 0, function* () {
|
|
896
|
-
return this.
|
|
582
|
+
return this.audio.queueSessionBase64AudioForTranscription(...args);
|
|
897
583
|
});
|
|
898
584
|
}
|
|
899
|
-
|
|
585
|
+
// Workflow methods
|
|
586
|
+
createWorkflow(...args) {
|
|
900
587
|
return __awaiter(this, void 0, void 0, function* () {
|
|
901
|
-
return this.
|
|
588
|
+
return this.workflows.createWorkflow(...args);
|
|
902
589
|
});
|
|
903
590
|
}
|
|
904
|
-
|
|
591
|
+
getWorkflows(...args) {
|
|
905
592
|
return __awaiter(this, void 0, void 0, function* () {
|
|
906
|
-
|
|
593
|
+
return this.workflows.getWorkflows(...args);
|
|
907
594
|
});
|
|
908
595
|
}
|
|
909
|
-
|
|
596
|
+
getWorkflow(...args) {
|
|
910
597
|
return __awaiter(this, void 0, void 0, function* () {
|
|
911
|
-
return this.
|
|
598
|
+
return this.workflows.getWorkflow(...args);
|
|
912
599
|
});
|
|
913
600
|
}
|
|
914
|
-
|
|
601
|
+
getWorkflowsByOrganization(...args) {
|
|
915
602
|
return __awaiter(this, void 0, void 0, function* () {
|
|
916
|
-
return this.
|
|
603
|
+
return this.workflows.getWorkflowsByOrganization(...args);
|
|
917
604
|
});
|
|
918
605
|
}
|
|
919
|
-
|
|
920
|
-
// WORKFLOW METHODS
|
|
921
|
-
// ======================
|
|
922
|
-
createWorkflow(name, organizationId) {
|
|
606
|
+
updateWorkflow(...args) {
|
|
923
607
|
return __awaiter(this, void 0, void 0, function* () {
|
|
924
|
-
|
|
925
|
-
name,
|
|
926
|
-
organizationId: organizationId || this.user.organizationId,
|
|
927
|
-
};
|
|
928
|
-
return this.request(urls.workflows, 'POST', dto);
|
|
608
|
+
return this.workflows.updateWorkflow(...args);
|
|
929
609
|
});
|
|
930
610
|
}
|
|
931
|
-
|
|
611
|
+
deleteWorkflow(...args) {
|
|
932
612
|
return __awaiter(this, void 0, void 0, function* () {
|
|
933
|
-
|
|
934
|
-
return this.request(`${urls.workflows}${params}`, 'GET');
|
|
613
|
+
return this.workflows.deleteWorkflow(...args);
|
|
935
614
|
});
|
|
936
615
|
}
|
|
937
|
-
|
|
616
|
+
// Log methods
|
|
617
|
+
getLogs(...args) {
|
|
938
618
|
return __awaiter(this, void 0, void 0, function* () {
|
|
939
|
-
return this.
|
|
619
|
+
return this.logs.getLogs(...args);
|
|
940
620
|
});
|
|
941
621
|
}
|
|
942
|
-
|
|
622
|
+
getLogsByUser(...args) {
|
|
943
623
|
return __awaiter(this, void 0, void 0, function* () {
|
|
944
|
-
|
|
945
|
-
return this.request(`${urls.workflows}?organizationId=${orgId}`, 'GET');
|
|
624
|
+
return this.logs.getLogsByUser(...args);
|
|
946
625
|
});
|
|
947
626
|
}
|
|
948
|
-
|
|
627
|
+
getLogsByController(...args) {
|
|
949
628
|
return __awaiter(this, void 0, void 0, function* () {
|
|
950
|
-
|
|
951
|
-
name,
|
|
952
|
-
organizationId: organizationId || this.user.organizationId,
|
|
953
|
-
};
|
|
954
|
-
return this.request(`${urls.workflows}/${id}`, 'PATCH', dto);
|
|
629
|
+
return this.logs.getLogsByController(...args);
|
|
955
630
|
});
|
|
956
631
|
}
|
|
957
|
-
|
|
632
|
+
getMyLogs(...args) {
|
|
958
633
|
return __awaiter(this, void 0, void 0, function* () {
|
|
959
|
-
|
|
634
|
+
return this.logs.getMyLogs(...args);
|
|
960
635
|
});
|
|
961
636
|
}
|
|
962
|
-
|
|
963
|
-
/**
|
|
964
|
-
* Get logs with advanced filtering options
|
|
965
|
-
*/
|
|
966
|
-
getLogs(filters) {
|
|
637
|
+
getLogsByDateRange(...args) {
|
|
967
638
|
return __awaiter(this, void 0, void 0, function* () {
|
|
968
|
-
|
|
969
|
-
if (filters) {
|
|
970
|
-
Object.entries(filters).forEach(([key, value]) => {
|
|
971
|
-
if (value !== undefined && value !== null) {
|
|
972
|
-
params.append(key, value.toString());
|
|
973
|
-
}
|
|
974
|
-
});
|
|
975
|
-
}
|
|
976
|
-
const queryString = params.toString();
|
|
977
|
-
const url = queryString ? `${urls.logs}?${queryString}` : urls.logs;
|
|
978
|
-
return this.request(url, 'GET');
|
|
639
|
+
return this.logs.getLogsByDateRange(...args);
|
|
979
640
|
});
|
|
980
641
|
}
|
|
981
|
-
|
|
982
|
-
* Get logs for a specific user
|
|
983
|
-
*/
|
|
984
|
-
getLogsByUser(userId, limit, offset) {
|
|
642
|
+
getLogStats(...args) {
|
|
985
643
|
return __awaiter(this, void 0, void 0, function* () {
|
|
986
|
-
|
|
987
|
-
if (limit !== undefined)
|
|
988
|
-
params.append('limit', limit.toString());
|
|
989
|
-
if (offset !== undefined)
|
|
990
|
-
params.append('offset', offset.toString());
|
|
991
|
-
const queryString = params.toString();
|
|
992
|
-
const url = queryString ? `${urls.logs}/user/${userId}?${queryString}` : `${urls.logs}/user/${userId}`;
|
|
993
|
-
return this.request(url, 'GET');
|
|
644
|
+
return this.logs.getLogStats(...args);
|
|
994
645
|
});
|
|
995
646
|
}
|
|
996
|
-
|
|
997
|
-
* Get logs for a specific controller
|
|
998
|
-
*/
|
|
999
|
-
getLogsByController(controller, limit, offset) {
|
|
647
|
+
createLog(...args) {
|
|
1000
648
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1001
|
-
|
|
1002
|
-
if (limit !== undefined)
|
|
1003
|
-
params.append('limit', limit.toString());
|
|
1004
|
-
if (offset !== undefined)
|
|
1005
|
-
params.append('offset', offset.toString());
|
|
1006
|
-
const queryString = params.toString();
|
|
1007
|
-
const url = queryString ? `${urls.logs}/controller/${controller}?${queryString}` : `${urls.logs}/controller/${controller}`;
|
|
1008
|
-
return this.request(url, 'GET');
|
|
649
|
+
return this.logs.createLog(...args);
|
|
1009
650
|
});
|
|
1010
651
|
}
|
|
1011
|
-
|
|
1012
|
-
* Get logs for the current authenticated user
|
|
1013
|
-
*/
|
|
1014
|
-
getMyLogs(limit, offset) {
|
|
652
|
+
logInfo(...args) {
|
|
1015
653
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1016
|
-
|
|
1017
|
-
if (limit !== undefined)
|
|
1018
|
-
params.append('limit', limit.toString());
|
|
1019
|
-
if (offset !== undefined)
|
|
1020
|
-
params.append('offset', offset.toString());
|
|
1021
|
-
const queryString = params.toString();
|
|
1022
|
-
const url = queryString ? `${urls.logs}/my-logs?${queryString}` : `${urls.logs}/my-logs`;
|
|
1023
|
-
return this.request(url, 'GET');
|
|
654
|
+
return this.logs.logInfo(...args);
|
|
1024
655
|
});
|
|
1025
656
|
}
|
|
1026
|
-
|
|
1027
|
-
* Get logs within a date range
|
|
1028
|
-
*/
|
|
1029
|
-
getLogsByDateRange(startDate, endDate, limit, offset) {
|
|
657
|
+
logError(...args) {
|
|
1030
658
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1031
|
-
|
|
1032
|
-
params.append('startDate', startDate);
|
|
1033
|
-
params.append('endDate', endDate);
|
|
1034
|
-
if (limit !== undefined)
|
|
1035
|
-
params.append('limit', limit.toString());
|
|
1036
|
-
if (offset !== undefined)
|
|
1037
|
-
params.append('offset', offset.toString());
|
|
1038
|
-
return this.request(`${urls.logs}/date-range?${params.toString()}`, 'GET');
|
|
659
|
+
return this.logs.logError(...args);
|
|
1039
660
|
});
|
|
1040
661
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
});
|
|
1070
|
-
}
|
|
1071
|
-
|
|
1072
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1073
|
-
return this.
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
});
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1084
|
-
return this.
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
*/
|
|
1122
|
-
getLogsByOrganizationRole(organizationRole, limit, offset) {
|
|
1123
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1124
|
-
const params = new URLSearchParams();
|
|
1125
|
-
if (limit !== undefined)
|
|
1126
|
-
params.append('limit', limit.toString());
|
|
1127
|
-
if (offset !== undefined)
|
|
1128
|
-
params.append('offset', offset.toString());
|
|
1129
|
-
const queryString = params.toString();
|
|
1130
|
-
const url = queryString ? `${urls.logs}/organization-role/${organizationRole}?${queryString}` : `${urls.logs}/organization-role/${organizationRole}`;
|
|
1131
|
-
return this.request(url, 'GET');
|
|
1132
|
-
});
|
|
1133
|
-
}
|
|
1134
|
-
/**
|
|
1135
|
-
* Get logs by team role
|
|
1136
|
-
*/
|
|
1137
|
-
getLogsByTeamRole(teamRole, limit, offset) {
|
|
1138
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1139
|
-
const params = new URLSearchParams();
|
|
1140
|
-
if (limit !== undefined)
|
|
1141
|
-
params.append('limit', limit.toString());
|
|
1142
|
-
if (offset !== undefined)
|
|
1143
|
-
params.append('offset', offset.toString());
|
|
1144
|
-
const queryString = params.toString();
|
|
1145
|
-
const url = queryString ? `${urls.logs}/team-role/${teamRole}?${queryString}` : `${urls.logs}/team-role/${teamRole}`;
|
|
1146
|
-
return this.request(url, 'GET');
|
|
1147
|
-
});
|
|
1148
|
-
}
|
|
1149
|
-
/**
|
|
1150
|
-
* Get available roles for filtering
|
|
1151
|
-
*/
|
|
1152
|
-
getAvailableRoles() {
|
|
1153
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1154
|
-
return this.request(`${urls.logs}/available-roles`, 'GET');
|
|
1155
|
-
});
|
|
1156
|
-
}
|
|
1157
|
-
// ===== DEBUG METHODS =====
|
|
1158
|
-
/**
|
|
1159
|
-
* Get sessions that do not have medical transcriptions and primary transcription summaries
|
|
1160
|
-
* for the current user's organization
|
|
1161
|
-
*/
|
|
1162
|
-
getSessionsWithoutMedicalTranscriptions() {
|
|
1163
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1164
|
-
return this.request(`${urls.debug}/sessions/missing-medical-transcriptions`, 'GET');
|
|
1165
|
-
});
|
|
1166
|
-
}
|
|
1167
|
-
/**
|
|
1168
|
-
* Download a session as a ZIP file containing all related data (decrypted)
|
|
1169
|
-
* Returns a Blob that can be used to create a download link
|
|
1170
|
-
*/
|
|
1171
|
-
downloadSessionAsZip(sessionId) {
|
|
1172
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1173
|
-
const url = `${this.baseUrl}${urls.debug}/sessions/${sessionId}/download`;
|
|
1174
|
-
// Get token first
|
|
1175
|
-
yield this.getToken();
|
|
1176
|
-
const defaultHeaders = {
|
|
1177
|
-
'ngrok-skip-browser-warning': 'true'
|
|
1178
|
-
};
|
|
1179
|
-
if (this.accessToken) {
|
|
1180
|
-
defaultHeaders['Authorization'] = `Bearer ${this.accessToken}`;
|
|
1181
|
-
}
|
|
1182
|
-
const response = yield fetch(url, {
|
|
1183
|
-
method: 'GET',
|
|
1184
|
-
headers: defaultHeaders,
|
|
1185
|
-
});
|
|
1186
|
-
if (!response.ok) {
|
|
1187
|
-
const errorData = yield response.json().catch(() => ({}));
|
|
1188
|
-
throw new Error(errorData.message || `Download failed with status ${response.status}`);
|
|
1189
|
-
}
|
|
1190
|
-
return response.blob();
|
|
1191
|
-
});
|
|
1192
|
-
}
|
|
1193
|
-
/**
|
|
1194
|
-
* Download a session as a ZIP file and create a download URL
|
|
1195
|
-
* Returns a URL that can be used for direct download
|
|
1196
|
-
*/
|
|
1197
|
-
downloadSessionAsZipUrl(sessionId) {
|
|
1198
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1199
|
-
const blob = yield this.downloadSessionAsZip(sessionId);
|
|
1200
|
-
return URL.createObjectURL(blob);
|
|
1201
|
-
});
|
|
1202
|
-
}
|
|
1203
|
-
/**
|
|
1204
|
-
* Download a session as a ZIP file and trigger browser download
|
|
1205
|
-
* Optionally provide a custom filename
|
|
1206
|
-
*/
|
|
1207
|
-
downloadSessionAndTriggerDownload(sessionId, filename) {
|
|
1208
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1209
|
-
const blob = yield this.downloadSessionAsZip(sessionId);
|
|
1210
|
-
const url = URL.createObjectURL(blob);
|
|
1211
|
-
// Create temporary download link and click it
|
|
1212
|
-
const link = document.createElement('a');
|
|
1213
|
-
link.href = url;
|
|
1214
|
-
link.download = filename || `session_${sessionId}_${new Date().toISOString().split('T')[0]}.zip`;
|
|
1215
|
-
document.body.appendChild(link);
|
|
1216
|
-
link.click();
|
|
1217
|
-
document.body.removeChild(link);
|
|
1218
|
-
// Clean up the URL object
|
|
1219
|
-
URL.revokeObjectURL(url);
|
|
662
|
+
logWarn(...args) {
|
|
663
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
664
|
+
return this.logs.logWarn(...args);
|
|
665
|
+
});
|
|
666
|
+
}
|
|
667
|
+
logDebug(...args) {
|
|
668
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
669
|
+
return this.logs.logDebug(...args);
|
|
670
|
+
});
|
|
671
|
+
}
|
|
672
|
+
getLogsByRole(...args) {
|
|
673
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
674
|
+
return this.logs.getLogsByRole(...args);
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
getLogsByOrganizationRole(...args) {
|
|
678
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
679
|
+
return this.logs.getLogsByOrganizationRole(...args);
|
|
680
|
+
});
|
|
681
|
+
}
|
|
682
|
+
getLogsByTeamRole(...args) {
|
|
683
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
684
|
+
return this.logs.getLogsByTeamRole(...args);
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
getAvailableRoles(...args) {
|
|
688
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
689
|
+
return this.logs.getAvailableRoles(...args);
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
getSessionLogs(...args) {
|
|
693
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
694
|
+
return this.logs.getSessionLogs(...args);
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
// Debug methods
|
|
698
|
+
getSessionsWithoutMedicalTranscriptions(...args) {
|
|
699
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
700
|
+
return this.debug.getSessionsWithoutMedicalTranscriptions(...args);
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
downloadSessionAsZip(...args) {
|
|
704
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
705
|
+
return this.debug.downloadSessionAsZip(...args);
|
|
706
|
+
});
|
|
707
|
+
}
|
|
708
|
+
downloadSessionAsZipUrl(...args) {
|
|
709
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
710
|
+
return this.debug.downloadSessionAsZipUrl(...args);
|
|
711
|
+
});
|
|
712
|
+
}
|
|
713
|
+
downloadSessionAndTriggerDownload(...args) {
|
|
714
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
715
|
+
return this.debug.downloadSessionAndTriggerDownload(...args);
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
// External Integration methods
|
|
719
|
+
createExternalIntegration(...args) {
|
|
720
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
721
|
+
return this.externalIntegrations.createExternalIntegration(...args);
|
|
722
|
+
});
|
|
723
|
+
}
|
|
724
|
+
getExternalIntegrations(...args) {
|
|
725
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
726
|
+
return this.externalIntegrations.getExternalIntegrations(...args);
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
getExternalIntegration(...args) {
|
|
730
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
731
|
+
return this.externalIntegrations.getExternalIntegration(...args);
|
|
732
|
+
});
|
|
733
|
+
}
|
|
734
|
+
updateExternalIntegration(...args) {
|
|
735
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
736
|
+
return this.externalIntegrations.updateExternalIntegration(...args);
|
|
737
|
+
});
|
|
738
|
+
}
|
|
739
|
+
deleteExternalIntegration(...args) {
|
|
740
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
741
|
+
return this.externalIntegrations.deleteExternalIntegration(...args);
|
|
1220
742
|
});
|
|
1221
743
|
}
|
|
1222
744
|
}
|