whio-api-sdk 1.1.21 → 1.1.23
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/exampleuse.js +0 -5
- package/dist/src/sdk/index.d.ts +9 -2
- package/dist/src/sdk/index.js +13 -2
- package/dist/src/sdk/modules/session/index.d.ts +3 -0
- package/dist/src/sdk/modules/session/index.js +3 -0
- package/dist/src/sdk/modules/session/orgadmin-session.module.d.ts +15 -0
- package/dist/src/sdk/modules/session/orgadmin-session.module.js +83 -0
- package/dist/src/sdk/modules/session/session.module.d.ts +21 -0
- package/dist/src/sdk/modules/session/session.module.js +95 -0
- package/dist/src/sdk/modules/session/superuser-session.module.d.ts +15 -0
- package/dist/src/sdk/modules/session/superuser-session.module.js +83 -0
- package/dist/src/sdk/modules/session.module.d.ts +13 -2
- package/dist/src/sdk/modules/session.module.js +111 -36
- package/dist/src/sdk/modules/template.module.d.ts +1 -8
- package/dist/src/sdk/modules/template.module.js +0 -53
- package/dist/src/sdk/modules/transcription-summary.module.d.ts +0 -1
- package/dist/src/sdk/modules/transcription-summary.module.js +0 -14
- package/dist/src/sdk/modules/websocket.module.d.ts +5 -2
- package/dist/src/sdk/modules/websocket.module.js +6 -5
- package/dist/src/sdk/sdk.d.ts +12 -10
- package/dist/src/sdk/sdk.js +63 -51
- package/dist/src/sdk/types/team.types.d.ts +0 -2
- package/dist/src/sdk/types/template.types.d.ts +0 -36
- package/dist/src/sdk/types/websocket.types.d.ts +7 -0
- package/dist/src/sdk/urls.d.ts +0 -2
- package/dist/src/sdk/urls.js +0 -2
- package/dist/src/sdk/whio-orgadmin-sdk.d.ts +104 -0
- package/dist/src/sdk/whio-orgadmin-sdk.js +437 -0
- package/dist/src/sdk/whio-sdk.d.ts +102 -0
- package/dist/src/sdk/whio-sdk.js +389 -0
- package/dist/src/sdk/whio-superuser-sdk.d.ts +135 -0
- package/dist/src/sdk/whio-superuser-sdk.js +576 -0
- package/dist/src/sdk/whio-teamadmin-sdk.d.ts +104 -0
- package/dist/src/sdk/whio-teamadmin-sdk.js +388 -0
- package/package.json +1 -1
- package/src/sdk/exampleuse.ts +0 -16
- package/src/sdk/index.ts +17 -3
- package/src/sdk/modules/session/index.ts +3 -0
- package/src/sdk/modules/session/orgadmin-session.module.ts +64 -0
- package/src/sdk/modules/session/session.module.ts +75 -0
- package/src/sdk/modules/session/superuser-session.module.ts +64 -0
- package/src/sdk/modules/session.module.ts +84 -15
- package/src/sdk/modules/template.module.ts +0 -54
- package/src/sdk/modules/transcription-summary.module.ts +0 -17
- package/src/sdk/modules/websocket.module.ts +15 -8
- package/src/sdk/sdk.ts +51 -41
- package/src/sdk/types/team.types.ts +0 -2
- package/src/sdk/types/template.types.ts +0 -45
- package/src/sdk/types/websocket.types.ts +12 -4
- package/src/sdk/urls.ts +1 -3
- package/src/sdk/whio-orgadmin-sdk.ts +408 -0
- package/src/sdk/whio-sdk.ts +374 -0
- package/src/sdk/whio-superuser-sdk.ts +530 -0
- package/src/sdk/whio-teamadmin-sdk.ts +372 -0
|
@@ -3,6 +3,10 @@ import { Session, SessionsResponse, CreateSessionDto, UpdateSessionDto, SetAudio
|
|
|
3
3
|
import urls from '../urls';
|
|
4
4
|
|
|
5
5
|
export class SessionModule extends BaseClient {
|
|
6
|
+
// ======================
|
|
7
|
+
// USER METHODS (own sessions only)
|
|
8
|
+
// ======================
|
|
9
|
+
|
|
6
10
|
public async createSession(sessionData: CreateSessionDto): Promise<Session> {
|
|
7
11
|
return this.request<Session>(urls.sessions, 'POST', sessionData);
|
|
8
12
|
}
|
|
@@ -15,17 +19,6 @@ export class SessionModule extends BaseClient {
|
|
|
15
19
|
return this.request<Session>(`${urls.sessions}/${id}`, 'GET');
|
|
16
20
|
}
|
|
17
21
|
|
|
18
|
-
public async getSessionsByUser(userId: string): Promise<Session[]> {
|
|
19
|
-
return this.request<Session[]>(`${urls.sessions}/user/${userId}`, 'GET');
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public async getSessionsByOrganization(limit = 100, offset = 0): Promise<SessionsResponse> {
|
|
23
|
-
const params = new URLSearchParams();
|
|
24
|
-
params.append('limit', limit.toString());
|
|
25
|
-
params.append('offset', offset.toString());
|
|
26
|
-
return this.request<SessionsResponse>(`${urls.sessions}/organization?${params.toString()}`, 'GET');
|
|
27
|
-
}
|
|
28
|
-
|
|
29
22
|
public async updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session> {
|
|
30
23
|
return this.request<Session>(`${urls.sessions}/${id}`, 'PATCH', sessionData);
|
|
31
24
|
}
|
|
@@ -51,6 +44,85 @@ export class SessionModule extends BaseClient {
|
|
|
51
44
|
}
|
|
52
45
|
|
|
53
46
|
public async searchSessions(filters: SearchSessionsDto = {}): Promise<SearchSessionsResponse> {
|
|
47
|
+
const params = this.buildSearchParams(filters);
|
|
48
|
+
const queryString = params.toString();
|
|
49
|
+
const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
|
|
50
|
+
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// ======================
|
|
54
|
+
// SUPERUSER METHODS
|
|
55
|
+
// ======================
|
|
56
|
+
|
|
57
|
+
public async superuserGetSessionsByUser(userId: string): Promise<Session[]> {
|
|
58
|
+
return this.request<Session[]>(`${urls.sessions}/superuser/user/${userId}`, 'GET');
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
public async superuserGetSessionsByOrganization(limit = 100, offset = 0): Promise<SessionsResponse> {
|
|
62
|
+
const params = new URLSearchParams();
|
|
63
|
+
params.append('limit', limit.toString());
|
|
64
|
+
params.append('offset', offset.toString());
|
|
65
|
+
return this.request<SessionsResponse>(`${urls.sessions}/organization?${params.toString()}`, 'GET');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
public async superuserSearchSessions(filters: SearchSessionsDto = {}): Promise<SearchSessionsResponse> {
|
|
69
|
+
const params = this.buildSearchParams(filters);
|
|
70
|
+
const queryString = params.toString();
|
|
71
|
+
const url = queryString ? `${urls.sessions}/superuser/search?${queryString}` : `${urls.sessions}/superuser/search`;
|
|
72
|
+
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
public async superuserUpdateSession(id: string, sessionData: UpdateSessionDto): Promise<Session> {
|
|
76
|
+
return this.request<Session>(`${urls.sessions}/superuser/${id}`, 'PATCH', sessionData);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
public async superuserDeleteSession(id: string): Promise<void> {
|
|
80
|
+
await this.request(`${urls.sessions}/superuser/${id}`, 'DELETE');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public async superuserSetPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session> {
|
|
84
|
+
return this.request<Session>(`${urls.sessions}/superuser/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// ======================
|
|
88
|
+
// ORG ADMIN METHODS
|
|
89
|
+
// ======================
|
|
90
|
+
|
|
91
|
+
public async orgAdminGetSessionsByUser(userId: string): Promise<Session[]> {
|
|
92
|
+
return this.request<Session[]>(`${urls.sessions}/orgadmin/user/${userId}`, 'GET');
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public async orgAdminGetSessionsByOrganization(limit = 100, offset = 0): Promise<SessionsResponse> {
|
|
96
|
+
const params = new URLSearchParams();
|
|
97
|
+
params.append('limit', limit.toString());
|
|
98
|
+
params.append('offset', offset.toString());
|
|
99
|
+
return this.request<SessionsResponse>(`${urls.sessions}/orgadmin/organization?${params.toString()}`, 'GET');
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
public async orgAdminSearchSessions(filters: SearchSessionsDto = {}): Promise<SearchSessionsResponse> {
|
|
103
|
+
const params = this.buildSearchParams(filters);
|
|
104
|
+
const queryString = params.toString();
|
|
105
|
+
const url = queryString ? `${urls.sessions}/orgadmin/search?${queryString}` : `${urls.sessions}/orgadmin/search`;
|
|
106
|
+
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
public async orgAdminUpdateSession(id: string, sessionData: UpdateSessionDto): Promise<Session> {
|
|
110
|
+
return this.request<Session>(`${urls.sessions}/orgadmin/${id}`, 'PATCH', sessionData);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
public async orgAdminDeleteSession(id: string): Promise<void> {
|
|
114
|
+
await this.request(`${urls.sessions}/orgadmin/${id}`, 'DELETE');
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
public async orgAdminSetPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session> {
|
|
118
|
+
return this.request<Session>(`${urls.sessions}/orgadmin/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// ======================
|
|
122
|
+
// HELPER METHODS
|
|
123
|
+
// ======================
|
|
124
|
+
|
|
125
|
+
private buildSearchParams(filters: SearchSessionsDto): URLSearchParams {
|
|
54
126
|
const params = new URLSearchParams();
|
|
55
127
|
if (filters.startDate) params.append('startDate', filters.startDate);
|
|
56
128
|
if (filters.endDate) params.append('endDate', filters.endDate);
|
|
@@ -63,9 +135,6 @@ export class SessionModule extends BaseClient {
|
|
|
63
135
|
if (filters.includeTranscriptions !== undefined) params.append('includeTranscriptions', filters.includeTranscriptions.toString());
|
|
64
136
|
if (filters.limit !== undefined) params.append('limit', filters.limit.toString());
|
|
65
137
|
if (filters.offset !== undefined) params.append('offset', filters.offset.toString());
|
|
66
|
-
|
|
67
|
-
const queryString = params.toString();
|
|
68
|
-
const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
|
|
69
|
-
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
138
|
+
return params;
|
|
70
139
|
}
|
|
71
140
|
}
|
|
@@ -2,16 +2,11 @@ import { BaseClient } from './base-client';
|
|
|
2
2
|
import {
|
|
3
3
|
Template,
|
|
4
4
|
TemplateCategory,
|
|
5
|
-
UserTemplate,
|
|
6
5
|
CreateTemplateDto,
|
|
7
6
|
UpdateTemplateDto,
|
|
8
|
-
CreateUserTemplateDto,
|
|
9
|
-
UpdateUserTemplateDto,
|
|
10
7
|
CreateTemplateCategoryDto,
|
|
11
8
|
UpdateTemplateCategoryDto,
|
|
12
|
-
AssignTeamTemplateDto,
|
|
13
9
|
TranscriptionAudioUploadResponse,
|
|
14
|
-
SDKConfig,
|
|
15
10
|
} from '../types';
|
|
16
11
|
import urls from '../urls';
|
|
17
12
|
|
|
@@ -102,41 +97,6 @@ export class TemplateModule extends BaseClient {
|
|
|
102
97
|
);
|
|
103
98
|
}
|
|
104
99
|
|
|
105
|
-
// ======================
|
|
106
|
-
// USER TEMPLATE METHODS
|
|
107
|
-
// ======================
|
|
108
|
-
|
|
109
|
-
public async createUserTemplate(title: string, content: string, originalTemplateId: string | undefined): Promise<UserTemplate> {
|
|
110
|
-
const createUserTemplateDto: CreateUserTemplateDto = {
|
|
111
|
-
title,
|
|
112
|
-
content,
|
|
113
|
-
originalTemplateId,
|
|
114
|
-
userId: this.user!.id,
|
|
115
|
-
};
|
|
116
|
-
return this.request(urls.userTemplates, 'POST', createUserTemplateDto);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
public async updateUserTemplate(title: string, content: string, id: string): Promise<UserTemplate> {
|
|
120
|
-
const userTemplateDto: UpdateUserTemplateDto = {
|
|
121
|
-
title,
|
|
122
|
-
content,
|
|
123
|
-
};
|
|
124
|
-
return this.request<UserTemplate>(`${urls.userTemplates}/${id}`, 'PATCH', userTemplateDto);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
public async getUserTemplates(): Promise<UserTemplate[]> {
|
|
128
|
-
const url = `${urls.userTemplates}/user/${this.user!.id}`;
|
|
129
|
-
return this.request<UserTemplate[]>(url, 'GET');
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
public async getUserTemplate(id: string): Promise<UserTemplate> {
|
|
133
|
-
return this.request<UserTemplate>(`${urls.userTemplates}/${id}`, 'GET');
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
public async deleteUserTemplate(id: string): Promise<void> {
|
|
137
|
-
await this.request(`${urls.userTemplates}/${id}`, 'DELETE');
|
|
138
|
-
}
|
|
139
|
-
|
|
140
100
|
// ======================
|
|
141
101
|
// TEMPLATE CATEGORY METHODS
|
|
142
102
|
// ======================
|
|
@@ -163,20 +123,6 @@ export class TemplateModule extends BaseClient {
|
|
|
163
123
|
await this.request(`${urls.templateCategories}/${id}`, 'DELETE');
|
|
164
124
|
}
|
|
165
125
|
|
|
166
|
-
// ======================
|
|
167
|
-
// TEAM TEMPLATE METHODS
|
|
168
|
-
// ======================
|
|
169
|
-
|
|
170
|
-
public async assignTemplateToTeam(teamId: string, templateId: string): Promise<void> {
|
|
171
|
-
const dto: AssignTeamTemplateDto = { teamId, templateId };
|
|
172
|
-
await this.request(urls.teamTemplates, 'POST', dto);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
public async removeTemplateFromTeam(teamId: string, templateId: string): Promise<void> {
|
|
176
|
-
await this.request(`${urls.teamTemplates}/team/${teamId}/template/${templateId}`, 'DELETE');
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
126
|
// ======================
|
|
181
127
|
// AUDIO UPLOAD METHODS (for transcription)
|
|
182
128
|
// ======================
|
|
@@ -17,23 +17,6 @@ export class TranscriptionSummaryModule extends BaseClient {
|
|
|
17
17
|
const generateSummaryDto: GenerateTranscriptionSummaryDto = {
|
|
18
18
|
templateId,
|
|
19
19
|
userId: user.id,
|
|
20
|
-
fromUserTemplate: false,
|
|
21
|
-
sessionId: sessionId,
|
|
22
|
-
};
|
|
23
|
-
const transcriptionSummary: TranscriptionSummary = await this.request(
|
|
24
|
-
urls.transcriptionSummary,
|
|
25
|
-
'POST',
|
|
26
|
-
generateSummaryDto
|
|
27
|
-
);
|
|
28
|
-
return transcriptionSummary;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
public async generateTranscriptionSummaryFromUserTemplate(userTemplateId: string, sessionId: string): Promise<TranscriptionSummary> {
|
|
32
|
-
const user = this.validateUser();
|
|
33
|
-
const generateSummaryDto: GenerateTranscriptionSummaryDto = {
|
|
34
|
-
templateId: userTemplateId,
|
|
35
|
-
userId: user.id,
|
|
36
|
-
fromUserTemplate: true,
|
|
37
20
|
sessionId: sessionId,
|
|
38
21
|
};
|
|
39
22
|
const transcriptionSummary: TranscriptionSummary = await this.request(
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { io, Socket } from 'socket.io-client';
|
|
2
2
|
import { BaseClient } from './base-client';
|
|
3
|
-
import {
|
|
4
|
-
WebSocketConfig,
|
|
5
|
-
WebSocketConnectionStats,
|
|
3
|
+
import {
|
|
4
|
+
WebSocketConfig,
|
|
5
|
+
WebSocketConnectionStats,
|
|
6
6
|
WebSocketEvents,
|
|
7
7
|
AudioChunkPayload,
|
|
8
|
-
|
|
8
|
+
AudioChunkOptions,
|
|
9
|
+
AudioStreamingOptions
|
|
9
10
|
} from '../types';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -157,21 +158,27 @@ export class WebSocketModule extends BaseClient {
|
|
|
157
158
|
|
|
158
159
|
/**
|
|
159
160
|
* Stream audio chunk to server
|
|
161
|
+
* @param sessionId - Session ID to associate the chunk with
|
|
162
|
+
* @param audioChunk - Base64 encoded audio data
|
|
163
|
+
* @param options - Optional sequence tracking options
|
|
160
164
|
*/
|
|
161
165
|
public async streamAudioChunk(
|
|
162
|
-
sessionId: string,
|
|
163
|
-
audioChunk: string
|
|
166
|
+
sessionId: string,
|
|
167
|
+
audioChunk: string,
|
|
168
|
+
options?: AudioChunkOptions
|
|
164
169
|
): Promise<void> {
|
|
165
170
|
// CRITICAL: Validate token and reconnect if needed BEFORE sending
|
|
166
171
|
await this.ensureValidConnection();
|
|
167
|
-
|
|
172
|
+
|
|
168
173
|
if (!this.socket?.connected) {
|
|
169
174
|
throw new Error('WebSocket not connected after token validation');
|
|
170
175
|
}
|
|
171
176
|
|
|
172
177
|
const payload: AudioChunkPayload = {
|
|
173
178
|
sessionId,
|
|
174
|
-
audioChunk
|
|
179
|
+
audioChunk,
|
|
180
|
+
...(options?.sequenceId !== undefined && { sequenceId: options.sequenceId }),
|
|
181
|
+
...(options?.clientTimestamp !== undefined && { clientTimestamp: options.clientTimestamp }),
|
|
175
182
|
};
|
|
176
183
|
|
|
177
184
|
this.socket.emit('audio-chunk', payload);
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -339,26 +339,6 @@ export class ApiSDK extends BaseClient {
|
|
|
339
339
|
return this.templates.deleteTemplate(...args);
|
|
340
340
|
}
|
|
341
341
|
|
|
342
|
-
public async createUserTemplate(...args: Parameters<TemplateModule['createUserTemplate']>) {
|
|
343
|
-
return this.templates.createUserTemplate(...args);
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
public async updateUserTemplate(...args: Parameters<TemplateModule['updateUserTemplate']>) {
|
|
347
|
-
return this.templates.updateUserTemplate(...args);
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
public async getUserTemplates(...args: Parameters<TemplateModule['getUserTemplates']>) {
|
|
351
|
-
return this.templates.getUserTemplates(...args);
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
public async getUserTemplate(...args: Parameters<TemplateModule['getUserTemplate']>) {
|
|
355
|
-
return this.templates.getUserTemplate(...args);
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
public async deleteUserTemplate(...args: Parameters<TemplateModule['deleteUserTemplate']>) {
|
|
359
|
-
return this.templates.deleteUserTemplate(...args);
|
|
360
|
-
}
|
|
361
|
-
|
|
362
342
|
public async getTemplateCategories(...args: Parameters<TemplateModule['getTemplateCategories']>) {
|
|
363
343
|
return this.templates.getTemplateCategories(...args);
|
|
364
344
|
}
|
|
@@ -379,22 +359,10 @@ export class ApiSDK extends BaseClient {
|
|
|
379
359
|
return this.templates.deleteTemplateCategory(...args);
|
|
380
360
|
}
|
|
381
361
|
|
|
382
|
-
public async assignTemplateToTeam(...args: Parameters<TemplateModule['assignTemplateToTeam']>) {
|
|
383
|
-
return this.templates.assignTemplateToTeam(...args);
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
public async removeTemplateFromTeam(...args: Parameters<TemplateModule['removeTemplateFromTeam']>) {
|
|
387
|
-
return this.templates.removeTemplateFromTeam(...args);
|
|
388
|
-
}
|
|
389
|
-
|
|
390
362
|
public async generateTranscriptionSummary(...args: Parameters<TranscriptionSummaryModule['generateTranscriptionSummary']>) {
|
|
391
363
|
return this.transcriptionSummaries.generateTranscriptionSummary(...args);
|
|
392
364
|
}
|
|
393
365
|
|
|
394
|
-
public async generateTranscriptionSummaryFromUserTemplate(...args: Parameters<TranscriptionSummaryModule['generateTranscriptionSummaryFromUserTemplate']>) {
|
|
395
|
-
return this.transcriptionSummaries.generateTranscriptionSummaryFromUserTemplate(...args);
|
|
396
|
-
}
|
|
397
|
-
|
|
398
366
|
public async updateTranscriptionSummary(...args: Parameters<TranscriptionSummaryModule['updateTranscriptionSummary']>) {
|
|
399
367
|
return this.transcriptionSummaries.updateTranscriptionSummary(...args);
|
|
400
368
|
}
|
|
@@ -435,7 +403,7 @@ export class ApiSDK extends BaseClient {
|
|
|
435
403
|
return this.templates.transcribeBase64Audio(...args);
|
|
436
404
|
}
|
|
437
405
|
|
|
438
|
-
// Session methods
|
|
406
|
+
// Session methods (user - own sessions only)
|
|
439
407
|
public async createSession(...args: Parameters<SessionModule['createSession']>) {
|
|
440
408
|
return this.sessions.createSession(...args);
|
|
441
409
|
}
|
|
@@ -448,14 +416,6 @@ export class ApiSDK extends BaseClient {
|
|
|
448
416
|
return this.sessions.getSession(...args);
|
|
449
417
|
}
|
|
450
418
|
|
|
451
|
-
public async getSessionsByUser(...args: Parameters<SessionModule['getSessionsByUser']>) {
|
|
452
|
-
return this.sessions.getSessionsByUser(...args);
|
|
453
|
-
}
|
|
454
|
-
|
|
455
|
-
public async getSessionsByOrganization(...args: Parameters<SessionModule['getSessionsByOrganization']>) {
|
|
456
|
-
return this.sessions.getSessionsByOrganization(...args);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
419
|
public async updateSession(...args: Parameters<SessionModule['updateSession']>) {
|
|
460
420
|
return this.sessions.updateSession(...args);
|
|
461
421
|
}
|
|
@@ -484,6 +444,56 @@ export class ApiSDK extends BaseClient {
|
|
|
484
444
|
return this.sessions.searchSessions(...args);
|
|
485
445
|
}
|
|
486
446
|
|
|
447
|
+
// Session methods (superuser)
|
|
448
|
+
public async superuserGetSessionsByUser(...args: Parameters<SessionModule['superuserGetSessionsByUser']>) {
|
|
449
|
+
return this.sessions.superuserGetSessionsByUser(...args);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
public async superuserGetSessionsByOrganization(...args: Parameters<SessionModule['superuserGetSessionsByOrganization']>) {
|
|
453
|
+
return this.sessions.superuserGetSessionsByOrganization(...args);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
public async superuserSearchSessions(...args: Parameters<SessionModule['superuserSearchSessions']>) {
|
|
457
|
+
return this.sessions.superuserSearchSessions(...args);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
public async superuserUpdateSession(...args: Parameters<SessionModule['superuserUpdateSession']>) {
|
|
461
|
+
return this.sessions.superuserUpdateSession(...args);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
public async superuserDeleteSession(...args: Parameters<SessionModule['superuserDeleteSession']>) {
|
|
465
|
+
return this.sessions.superuserDeleteSession(...args);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
public async superuserSetPrimaryTranscriptionSummary(...args: Parameters<SessionModule['superuserSetPrimaryTranscriptionSummary']>) {
|
|
469
|
+
return this.sessions.superuserSetPrimaryTranscriptionSummary(...args);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
// Session methods (org admin)
|
|
473
|
+
public async orgAdminGetSessionsByUser(...args: Parameters<SessionModule['orgAdminGetSessionsByUser']>) {
|
|
474
|
+
return this.sessions.orgAdminGetSessionsByUser(...args);
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
public async orgAdminGetSessionsByOrganization(...args: Parameters<SessionModule['orgAdminGetSessionsByOrganization']>) {
|
|
478
|
+
return this.sessions.orgAdminGetSessionsByOrganization(...args);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
public async orgAdminSearchSessions(...args: Parameters<SessionModule['orgAdminSearchSessions']>) {
|
|
482
|
+
return this.sessions.orgAdminSearchSessions(...args);
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
public async orgAdminUpdateSession(...args: Parameters<SessionModule['orgAdminUpdateSession']>) {
|
|
486
|
+
return this.sessions.orgAdminUpdateSession(...args);
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
public async orgAdminDeleteSession(...args: Parameters<SessionModule['orgAdminDeleteSession']>) {
|
|
490
|
+
return this.sessions.orgAdminDeleteSession(...args);
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
public async orgAdminSetPrimaryTranscriptionSummary(...args: Parameters<SessionModule['orgAdminSetPrimaryTranscriptionSummary']>) {
|
|
494
|
+
return this.sessions.orgAdminSetPrimaryTranscriptionSummary(...args);
|
|
495
|
+
}
|
|
496
|
+
|
|
487
497
|
// Agent methods
|
|
488
498
|
public async createAgent(...args: Parameters<AgentModule['createAgent']>) {
|
|
489
499
|
return this.agents.createAgent(...args);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Organization } from './organization.types';
|
|
2
2
|
import { User } from './user.types';
|
|
3
|
-
import { TeamTemplate } from './template.types';
|
|
4
3
|
|
|
5
4
|
export interface TeamRole {
|
|
6
5
|
id: string;
|
|
@@ -24,7 +23,6 @@ export interface Team {
|
|
|
24
23
|
|
|
25
24
|
organization?: Organization;
|
|
26
25
|
teamRoles?: TeamRole[];
|
|
27
|
-
teamTemplates?: TeamTemplate[];
|
|
28
26
|
}
|
|
29
27
|
|
|
30
28
|
// Team DTOs
|
|
@@ -3,7 +3,6 @@ import { User } from './user.types';
|
|
|
3
3
|
import { Workflow } from './workflow.types';
|
|
4
4
|
import { IntegrationAction, TemplateIntegrationAction } from './integration-action.types';
|
|
5
5
|
import { Agent } from './agent.types';
|
|
6
|
-
import { Team } from './team.types';
|
|
7
6
|
|
|
8
7
|
export interface TemplateCategory {
|
|
9
8
|
id: string;
|
|
@@ -29,22 +28,7 @@ export interface Template {
|
|
|
29
28
|
workflow?: Workflow;
|
|
30
29
|
agent?: Agent;
|
|
31
30
|
integrationActions?: TemplateIntegrationAction[];
|
|
32
|
-
userTemplates?: UserTemplate[];
|
|
33
31
|
transcriptionSummaries?: TranscriptionSummary[];
|
|
34
|
-
teamTemplates?: TeamTemplate[];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export interface UserTemplate {
|
|
38
|
-
id: string;
|
|
39
|
-
title: string;
|
|
40
|
-
content: string;
|
|
41
|
-
createdAt: string;
|
|
42
|
-
updatesAt: string;
|
|
43
|
-
userId: string;
|
|
44
|
-
originalTemplateId?: string;
|
|
45
|
-
|
|
46
|
-
user?: User;
|
|
47
|
-
originalTemplate?: Template;
|
|
48
32
|
}
|
|
49
33
|
|
|
50
34
|
export interface TranscriptionSummary {
|
|
@@ -61,15 +45,6 @@ export interface TranscriptionSummary {
|
|
|
61
45
|
user?: User;
|
|
62
46
|
}
|
|
63
47
|
|
|
64
|
-
export interface TeamTemplate {
|
|
65
|
-
teamId: string;
|
|
66
|
-
templateId: string;
|
|
67
|
-
createdAt: string;
|
|
68
|
-
|
|
69
|
-
team?: Team;
|
|
70
|
-
template?: Template;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
48
|
// Template DTOs
|
|
74
49
|
export interface CreateTemplateDto {
|
|
75
50
|
title: string;
|
|
@@ -101,30 +76,10 @@ export interface UpdateTemplateCategoryDto {
|
|
|
101
76
|
name?: string;
|
|
102
77
|
}
|
|
103
78
|
|
|
104
|
-
// User Template DTOs
|
|
105
|
-
export interface CreateUserTemplateDto {
|
|
106
|
-
title: string;
|
|
107
|
-
content: string;
|
|
108
|
-
userId: string;
|
|
109
|
-
originalTemplateId?: string;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
export interface UpdateUserTemplateDto {
|
|
113
|
-
title?: string;
|
|
114
|
-
content?: string;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
// Team Template DTOs
|
|
118
|
-
export interface AssignTeamTemplateDto {
|
|
119
|
-
teamId: string;
|
|
120
|
-
templateId: string;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
79
|
// Transcription Summary DTOs
|
|
124
80
|
export interface GenerateTranscriptionSummaryDto {
|
|
125
81
|
templateId: string;
|
|
126
82
|
userId?: string;
|
|
127
|
-
fromUserTemplate?: boolean;
|
|
128
83
|
sessionId: string;
|
|
129
84
|
}
|
|
130
85
|
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
export interface AudioChunkPayload {
|
|
4
4
|
sessionId: string;
|
|
5
5
|
audioChunk: string; // Base64 encoded audio data
|
|
6
|
+
sequenceId?: number; // Client-assigned sequence number for tracking
|
|
7
|
+
clientTimestamp?: number; // Client timestamp for latency tracking
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface AudioChunkOptions {
|
|
11
|
+
sequenceId?: number;
|
|
12
|
+
clientTimestamp?: number;
|
|
6
13
|
}
|
|
7
14
|
|
|
8
15
|
export interface WebSocketConfig {
|
|
@@ -28,10 +35,11 @@ export interface AudioStreamingOptions {
|
|
|
28
35
|
export interface WebSocketEvents {
|
|
29
36
|
connected: (data: { message: string; userId: string; timestamp: string }) => void;
|
|
30
37
|
disconnected: (reason: string) => void;
|
|
31
|
-
'audio-chunk-received': (data: {
|
|
32
|
-
sessionId: string;
|
|
33
|
-
chunkCount: number;
|
|
34
|
-
timestamp: string;
|
|
38
|
+
'audio-chunk-received': (data: {
|
|
39
|
+
sessionId: string;
|
|
40
|
+
chunkCount: number;
|
|
41
|
+
timestamp: string;
|
|
42
|
+
lastSequenceId?: number; // Highest sequence ID received by server
|
|
35
43
|
}) => void;
|
|
36
44
|
'transcription-queued': (data: {
|
|
37
45
|
sessionId: string;
|
package/src/sdk/urls.ts
CHANGED
|
@@ -20,12 +20,10 @@ const urls = {
|
|
|
20
20
|
// Teams
|
|
21
21
|
teams: '/teams',
|
|
22
22
|
teamRoles: '/team-roles',
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
|
|
25
24
|
// Templates
|
|
26
25
|
templates: '/templates',
|
|
27
26
|
templateCategories: '/template-categories',
|
|
28
|
-
userTemplates: '/user-templates',
|
|
29
27
|
|
|
30
28
|
// Transcription Summaries
|
|
31
29
|
transcriptionSummaries: '/transcription-summaries',
|