whio-api-sdk 1.1.27 → 1.1.29
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 +90 -5
- package/dist/src/sdk/modules/agent.module.js +87 -2
- package/dist/src/sdk/modules/audio.module.d.ts +143 -2
- package/dist/src/sdk/modules/audio.module.js +144 -5
- package/dist/src/sdk/modules/auth.module.d.ts +43 -0
- package/dist/src/sdk/modules/auth.module.js +43 -0
- package/dist/src/sdk/modules/data-strategy.module.d.ts +45 -7
- package/dist/src/sdk/modules/data-strategy.module.js +39 -1
- package/dist/src/sdk/modules/external-integration.module.d.ts +30 -0
- package/dist/src/sdk/modules/external-integration.module.js +30 -0
- package/dist/src/sdk/modules/integration-action.module.d.ts +39 -0
- package/dist/src/sdk/modules/integration-action.module.js +39 -0
- package/dist/src/sdk/modules/log.module.d.ts +4 -4
- package/dist/src/sdk/modules/organization.module.d.ts +62 -3
- package/dist/src/sdk/modules/organization.module.js +61 -2
- package/dist/src/sdk/modules/patient.module.d.ts +5 -2
- package/dist/src/sdk/modules/patient.module.js +5 -2
- package/dist/src/sdk/modules/reports.module.d.ts +4 -4
- package/dist/src/sdk/modules/reports.module.js +6 -6
- package/dist/src/sdk/modules/session/orgadmin-session.module.d.ts +46 -1
- package/dist/src/sdk/modules/session/orgadmin-session.module.js +53 -6
- package/dist/src/sdk/modules/session/session.module.d.ts +62 -1
- package/dist/src/sdk/modules/session/session.module.js +64 -1
- package/dist/src/sdk/modules/session/superuser-session.module.d.ts +46 -1
- package/dist/src/sdk/modules/session/superuser-session.module.js +52 -5
- package/dist/src/sdk/modules/session.module.d.ts +142 -3
- package/dist/src/sdk/modules/session.module.js +153 -12
- package/dist/src/sdk/modules/team.module.d.ts +56 -4
- package/dist/src/sdk/modules/team.module.js +54 -6
- package/dist/src/sdk/modules/template.module.d.ts +96 -4
- package/dist/src/sdk/modules/template.module.js +95 -24
- package/dist/src/sdk/modules/transcription-summary.module.d.ts +60 -3
- package/dist/src/sdk/modules/transcription-summary.module.js +60 -7
- package/dist/src/sdk/modules/user.module.d.ts +106 -0
- package/dist/src/sdk/modules/user.module.js +107 -1
- package/dist/src/sdk/modules/websocket.module.d.ts +25 -8
- package/dist/src/sdk/modules/websocket.module.js +23 -6
- package/dist/src/sdk/modules/workflow.module.d.ts +39 -0
- package/dist/src/sdk/modules/workflow.module.js +39 -0
- package/dist/src/sdk/sdk.d.ts +19 -29
- package/dist/src/sdk/sdk.js +1 -44
- package/dist/src/sdk/types/agent.types.d.ts +3 -0
- package/dist/src/sdk/types/audio.types.d.ts +8 -9
- package/dist/src/sdk/types/data-strategy.types.d.ts +3 -0
- package/dist/src/sdk/types/external-integration.types.d.ts +6 -0
- package/dist/src/sdk/types/log.types.d.ts +2 -21
- package/dist/src/sdk/types/patient.types.d.ts +2 -3
- package/dist/src/sdk/types/reports.types.d.ts +1 -1
- package/dist/src/sdk/types/session.types.d.ts +8 -8
- package/dist/src/sdk/types/team.types.d.ts +4 -3
- package/dist/src/sdk/types/template.types.d.ts +15 -7
- package/dist/src/sdk/types/user.types.d.ts +6 -0
- package/dist/src/sdk/types/websocket.types.d.ts +5 -7
- package/dist/src/sdk/urls.d.ts +0 -4
- package/dist/src/sdk/urls.js +0 -5
- package/dist/src/sdk/whio-orgadmin-sdk.d.ts +7 -7
- package/dist/src/sdk/whio-sdk.d.ts +11 -8
- package/dist/src/sdk/whio-sdk.js +34 -18
- package/dist/src/sdk/whio-superuser-sdk.d.ts +12 -16
- package/dist/src/sdk/whio-superuser-sdk.js +1 -16
- package/dist/src/sdk/whio-teamadmin-sdk.d.ts +4 -8
- package/dist/src/sdk/whio-teamadmin-sdk.js +1 -18
- package/package.json +1 -1
- package/src/sdk/modules/agent.module.ts +94 -9
- package/src/sdk/modules/audio.module.ts +146 -8
- package/src/sdk/modules/auth.module.ts +43 -0
- package/src/sdk/modules/data-strategy.module.ts +51 -13
- package/src/sdk/modules/external-integration.module.ts +30 -0
- package/src/sdk/modules/integration-action.module.ts +39 -0
- package/src/sdk/modules/log.module.ts +4 -4
- package/src/sdk/modules/organization.module.ts +64 -5
- package/src/sdk/modules/patient.module.ts +5 -2
- package/src/sdk/modules/reports.module.ts +6 -6
- package/src/sdk/modules/session/orgadmin-session.module.ts +53 -7
- package/src/sdk/modules/session/session.module.ts +64 -2
- package/src/sdk/modules/session/superuser-session.module.ts +52 -6
- package/src/sdk/modules/session.module.ts +155 -15
- package/src/sdk/modules/team.module.ts +58 -9
- package/src/sdk/modules/template.module.ts +95 -32
- package/src/sdk/modules/transcription-summary.module.ts +62 -8
- package/src/sdk/modules/user.module.ts +108 -2
- package/src/sdk/modules/websocket.module.ts +26 -8
- package/src/sdk/modules/workflow.module.ts +39 -0
- package/src/sdk/sdk.ts +1 -37
- package/src/sdk/types/agent.types.ts +5 -0
- package/src/sdk/types/audio.types.ts +8 -10
- package/src/sdk/types/data-strategy.types.ts +3 -0
- package/src/sdk/types/external-integration.types.ts +6 -0
- package/src/sdk/types/log.types.ts +4 -23
- package/src/sdk/types/patient.types.ts +2 -3
- package/src/sdk/types/reports.types.ts +1 -1
- package/src/sdk/types/session.types.ts +8 -8
- package/src/sdk/types/team.types.ts +5 -3
- package/src/sdk/types/template.types.ts +18 -7
- package/src/sdk/types/user.types.ts +6 -0
- package/src/sdk/types/websocket.types.ts +12 -7
- package/src/sdk/urls.ts +0 -7
- package/src/sdk/whio-sdk.ts +29 -16
- package/src/sdk/whio-superuser-sdk.ts +1 -16
- package/src/sdk/whio-teamadmin-sdk.ts +1 -16
- package/tsconfig.json +1 -1
- package/src/sdk/modules/debug.module.ts +0 -44
|
@@ -13,6 +13,17 @@ export class TemplateModule extends BaseClient {
|
|
|
13
13
|
// ======================
|
|
14
14
|
// TEMPLATE METHODS
|
|
15
15
|
// ======================
|
|
16
|
+
/**
|
|
17
|
+
* Create a template for the current user's organization, defaulting to the first category if none is given.
|
|
18
|
+
*
|
|
19
|
+
* @param title - Title of the template.
|
|
20
|
+
* @param content - Body content of the template.
|
|
21
|
+
* @param categoryId - Optional category UUID; the first available category is used when omitted.
|
|
22
|
+
* @param workflowId - Optional workflow UUID to associate with the template.
|
|
23
|
+
* @param agentId - Optional agent UUID to associate with the template.
|
|
24
|
+
* @param summaryQueueType - Optional queue type (PRIMARY or SECONDARY) for generated summaries.
|
|
25
|
+
* @returns The created template.
|
|
26
|
+
*/
|
|
16
27
|
createTemplate(title, content, categoryId, workflowId, agentId, summaryQueueType) {
|
|
17
28
|
var _a;
|
|
18
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -38,6 +49,17 @@ export class TemplateModule extends BaseClient {
|
|
|
38
49
|
return this.request(urls.templates, 'POST', createTemplateDto);
|
|
39
50
|
});
|
|
40
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* Update an existing template.
|
|
54
|
+
*
|
|
55
|
+
* @param title - New title of the template.
|
|
56
|
+
* @param content - New body content of the template.
|
|
57
|
+
* @param id - UUID of the template to update.
|
|
58
|
+
* @param workflowId - Optional workflow UUID to associate with the template.
|
|
59
|
+
* @param agentId - Optional agent UUID to associate with the template.
|
|
60
|
+
* @param summaryQueueType - Optional queue type (PRIMARY or SECONDARY), or null to clear it.
|
|
61
|
+
* @returns The updated template.
|
|
62
|
+
*/
|
|
41
63
|
updateTemplate(title, content, id, workflowId, agentId, summaryQueueType) {
|
|
42
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
65
|
const templateDto = {
|
|
@@ -52,21 +74,43 @@ export class TemplateModule extends BaseClient {
|
|
|
52
74
|
return this.request(`${urls.templates}/${id}`, 'PATCH', templateDto);
|
|
53
75
|
});
|
|
54
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Retrieve all templates accessible to the current user.
|
|
79
|
+
*
|
|
80
|
+
* @returns An array of templates.
|
|
81
|
+
*/
|
|
55
82
|
getTemplates() {
|
|
56
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
57
84
|
return this.request(urls.templates, 'GET');
|
|
58
85
|
});
|
|
59
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Retrieve all templates belonging to the current user's organization.
|
|
89
|
+
*
|
|
90
|
+
* @returns An array of templates.
|
|
91
|
+
*/
|
|
60
92
|
getTemplatesByOrganization() {
|
|
61
93
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
94
|
return this.request(`${urls.templates}/organization`, 'GET');
|
|
63
95
|
});
|
|
64
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Retrieve a single template by id.
|
|
99
|
+
*
|
|
100
|
+
* @param id - UUID of the template.
|
|
101
|
+
* @returns The requested template.
|
|
102
|
+
*/
|
|
65
103
|
getTemplate(id) {
|
|
66
104
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
105
|
return this.request(`${urls.templates}/${id}`, 'GET');
|
|
68
106
|
});
|
|
69
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Delete a template by id.
|
|
110
|
+
*
|
|
111
|
+
* @param id - UUID of the template to delete.
|
|
112
|
+
* @returns A promise that resolves once the template is deleted.
|
|
113
|
+
*/
|
|
70
114
|
deleteTemplate(id) {
|
|
71
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
72
116
|
yield this.request(`${urls.templates}/${id}`, 'DELETE');
|
|
@@ -75,16 +119,37 @@ export class TemplateModule extends BaseClient {
|
|
|
75
119
|
// ======================
|
|
76
120
|
// TEMPLATE INTEGRATION ACTION METHODS
|
|
77
121
|
// ======================
|
|
122
|
+
/**
|
|
123
|
+
* Replace the full set of integration actions linked to a template.
|
|
124
|
+
*
|
|
125
|
+
* @param templateId - UUID of the template.
|
|
126
|
+
* @param integrationActionIds - The complete list of integration action UUIDs to set.
|
|
127
|
+
* @returns The updated template.
|
|
128
|
+
*/
|
|
78
129
|
setTemplateIntegrationActions(templateId, integrationActionIds) {
|
|
79
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
131
|
return this.request(`${urls.templates}/${templateId}/integration-actions`, 'PUT', { integrationActionIds });
|
|
81
132
|
});
|
|
82
133
|
}
|
|
134
|
+
/**
|
|
135
|
+
* Add integration actions to a template without removing existing ones.
|
|
136
|
+
*
|
|
137
|
+
* @param templateId - UUID of the template.
|
|
138
|
+
* @param integrationActionIds - The integration action UUIDs to add.
|
|
139
|
+
* @returns The updated template.
|
|
140
|
+
*/
|
|
83
141
|
addTemplateIntegrationActions(templateId, integrationActionIds) {
|
|
84
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
85
143
|
return this.request(`${urls.templates}/${templateId}/integration-actions`, 'POST', { integrationActionIds });
|
|
86
144
|
});
|
|
87
145
|
}
|
|
146
|
+
/**
|
|
147
|
+
* Remove integration actions from a template.
|
|
148
|
+
*
|
|
149
|
+
* @param templateId - UUID of the template.
|
|
150
|
+
* @param integrationActionIds - The integration action UUIDs to remove.
|
|
151
|
+
* @returns The updated template.
|
|
152
|
+
*/
|
|
88
153
|
removeTemplateIntegrationActions(templateId, integrationActionIds) {
|
|
89
154
|
return __awaiter(this, void 0, void 0, function* () {
|
|
90
155
|
return this.request(`${urls.templates}/${templateId}/integration-actions`, 'DELETE', { integrationActionIds });
|
|
@@ -93,55 +158,61 @@ export class TemplateModule extends BaseClient {
|
|
|
93
158
|
// ======================
|
|
94
159
|
// TEMPLATE CATEGORY METHODS
|
|
95
160
|
// ======================
|
|
161
|
+
/**
|
|
162
|
+
* Retrieve all template categories.
|
|
163
|
+
*
|
|
164
|
+
* @returns An array of template categories.
|
|
165
|
+
*/
|
|
96
166
|
getTemplateCategories() {
|
|
97
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
98
168
|
return this.request(urls.templateCategories, 'GET');
|
|
99
169
|
});
|
|
100
170
|
}
|
|
171
|
+
/**
|
|
172
|
+
* Retrieve a single template category by id.
|
|
173
|
+
*
|
|
174
|
+
* @param id - UUID of the template category.
|
|
175
|
+
* @returns The requested template category.
|
|
176
|
+
*/
|
|
101
177
|
getTemplateCategory(id) {
|
|
102
178
|
return __awaiter(this, void 0, void 0, function* () {
|
|
103
179
|
return this.request(`${urls.templateCategories}/${id}`, 'GET');
|
|
104
180
|
});
|
|
105
181
|
}
|
|
182
|
+
/**
|
|
183
|
+
* Create a template category.
|
|
184
|
+
*
|
|
185
|
+
* @param name - Name of the new category.
|
|
186
|
+
* @returns The created template category.
|
|
187
|
+
*/
|
|
106
188
|
createTemplateCategory(name) {
|
|
107
189
|
return __awaiter(this, void 0, void 0, function* () {
|
|
108
190
|
const dto = { name };
|
|
109
191
|
return this.request(urls.templateCategories, 'POST', dto);
|
|
110
192
|
});
|
|
111
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* Update a template category's name.
|
|
196
|
+
*
|
|
197
|
+
* @param id - UUID of the template category to update.
|
|
198
|
+
* @param name - New name for the category.
|
|
199
|
+
* @returns The updated template category.
|
|
200
|
+
*/
|
|
112
201
|
updateTemplateCategory(id, name) {
|
|
113
202
|
return __awaiter(this, void 0, void 0, function* () {
|
|
114
203
|
const dto = { name };
|
|
115
204
|
return this.request(`${urls.templateCategories}/${id}`, 'PATCH', dto);
|
|
116
205
|
});
|
|
117
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* Delete a template category by id.
|
|
209
|
+
*
|
|
210
|
+
* @param id - UUID of the template category to delete.
|
|
211
|
+
* @returns A promise that resolves once the category is deleted.
|
|
212
|
+
*/
|
|
118
213
|
deleteTemplateCategory(id) {
|
|
119
214
|
return __awaiter(this, void 0, void 0, function* () {
|
|
120
215
|
yield this.request(`${urls.templateCategories}/${id}`, 'DELETE');
|
|
121
216
|
});
|
|
122
217
|
}
|
|
123
|
-
// ======================
|
|
124
|
-
// AUDIO UPLOAD METHODS (for transcription)
|
|
125
|
-
// ======================
|
|
126
|
-
uploadLargeAudioFile(formData, onProgress) {
|
|
127
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
const uploadId = yield this.fileUploadRequest(urls.uploadAudioLarge, formData, {}, onProgress);
|
|
129
|
-
const uploadIds = (yield this.storage.getItem('uploadIds')) || '[]';
|
|
130
|
-
const uploadIdsArray = JSON.parse(uploadIds);
|
|
131
|
-
yield this.storage.setItem('uploadIds', JSON.stringify([...uploadIdsArray, uploadId]));
|
|
132
|
-
return uploadId;
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
uploadAudioFile(formData, onProgress) {
|
|
136
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
137
|
-
const data = yield this.fileUploadRequest(urls.uploadAudio, formData, {}, onProgress);
|
|
138
|
-
return data;
|
|
139
|
-
});
|
|
140
|
-
}
|
|
141
|
-
transcribeBase64Audio(base64String) {
|
|
142
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
-
const transcript = yield this.request(urls.transcribeBase64Audio, 'POST', { base64Audio: base64String });
|
|
144
|
-
return transcript.transcript;
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
218
|
}
|
|
@@ -1,13 +1,70 @@
|
|
|
1
1
|
import { BaseClient } from './base-client';
|
|
2
|
-
import { TranscriptionSummary, CreateTranscriptionSummaryDto } from '../types';
|
|
2
|
+
import { TranscriptionSummary, GenerateSummaryResponse, CreateTranscriptionSummaryDto, UpdateTranscriptionSummaryDto } from '../types';
|
|
3
3
|
export declare class TranscriptionSummaryModule extends BaseClient {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Queue a transcription summary for generation, or update the template if no transcription exists yet.
|
|
6
|
+
*
|
|
7
|
+
* @param templateId - UUID of the template to apply.
|
|
8
|
+
* @param sessionId - UUID of the session whose transcription is summarised.
|
|
9
|
+
* @returns Either a queued-job response (`{ message, jobId, sessionId }`) or a template-updated
|
|
10
|
+
* response (`{ message, sessionId }`).
|
|
11
|
+
*/
|
|
12
|
+
generateTranscriptionSummary(templateId: string, sessionId: string): Promise<GenerateSummaryResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Create a transcription summary record; the current user is supplied server-side.
|
|
15
|
+
*
|
|
16
|
+
* @param dto - Summary fields (template, content, optional session and anonymised transcript).
|
|
17
|
+
* @returns The created transcription summary.
|
|
18
|
+
*/
|
|
5
19
|
createTranscriptionSummary(dto: Omit<CreateTranscriptionSummaryDto, 'userId'>): Promise<TranscriptionSummary>;
|
|
6
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Update a transcription summary.
|
|
22
|
+
*
|
|
23
|
+
* @param id - UUID of the transcription summary to update.
|
|
24
|
+
* @param dto - Fields to update (content, anonymised transcript, and/or template).
|
|
25
|
+
* @returns The updated transcription summary.
|
|
26
|
+
*/
|
|
27
|
+
updateTranscriptionSummary(id: string, dto: UpdateTranscriptionSummaryDto): Promise<TranscriptionSummary>;
|
|
28
|
+
/**
|
|
29
|
+
* Retrieve all transcription summaries accessible to the current user.
|
|
30
|
+
*
|
|
31
|
+
* @returns An array of transcription summaries.
|
|
32
|
+
*/
|
|
7
33
|
getTranscriptionSummaries(): Promise<TranscriptionSummary[]>;
|
|
34
|
+
/**
|
|
35
|
+
* Retrieve a single transcription summary by id.
|
|
36
|
+
*
|
|
37
|
+
* @param id - UUID of the transcription summary.
|
|
38
|
+
* @returns The requested transcription summary.
|
|
39
|
+
*/
|
|
8
40
|
getTranscriptionSummary(id: string): Promise<TranscriptionSummary>;
|
|
41
|
+
/**
|
|
42
|
+
* Retrieve all transcription summaries belonging to a specific user.
|
|
43
|
+
*
|
|
44
|
+
* @param userId - UUID of the user whose summaries are returned.
|
|
45
|
+
* @returns An array of transcription summaries.
|
|
46
|
+
*/
|
|
9
47
|
getTranscriptionSummariesByUser(userId: string): Promise<TranscriptionSummary[]>;
|
|
48
|
+
/**
|
|
49
|
+
* Retrieve all transcription summaries belonging to a specific organization.
|
|
50
|
+
*
|
|
51
|
+
* @param organizationId - UUID of the organization whose summaries are returned.
|
|
52
|
+
* @returns An array of transcription summaries.
|
|
53
|
+
*/
|
|
10
54
|
getByOrganizationTranscriptionSummaries(organizationId: string): Promise<TranscriptionSummary[]>;
|
|
55
|
+
/**
|
|
56
|
+
* Clone an existing transcription summary with new content.
|
|
57
|
+
*
|
|
58
|
+
* @param id - UUID of the transcription summary to clone.
|
|
59
|
+
* @param content - Content for the cloned summary.
|
|
60
|
+
* @returns The newly created clone.
|
|
61
|
+
*/
|
|
11
62
|
cloneTranscriptionSummary(id: string, content: string): Promise<TranscriptionSummary>;
|
|
63
|
+
/**
|
|
64
|
+
* Delete a transcription summary by id.
|
|
65
|
+
*
|
|
66
|
+
* @param id - UUID of the transcription summary to delete.
|
|
67
|
+
* @returns A promise that resolves once the summary is deleted.
|
|
68
|
+
*/
|
|
12
69
|
deleteTranscriptionSummary(id: string): Promise<void>;
|
|
13
70
|
}
|
|
@@ -13,6 +13,14 @@ export class TranscriptionSummaryModule extends BaseClient {
|
|
|
13
13
|
// ======================
|
|
14
14
|
// TRANSCRIPTION SUMMARY METHODS
|
|
15
15
|
// ======================
|
|
16
|
+
/**
|
|
17
|
+
* Queue a transcription summary for generation, or update the template if no transcription exists yet.
|
|
18
|
+
*
|
|
19
|
+
* @param templateId - UUID of the template to apply.
|
|
20
|
+
* @param sessionId - UUID of the session whose transcription is summarised.
|
|
21
|
+
* @returns Either a queued-job response (`{ message, jobId, sessionId }`) or a template-updated
|
|
22
|
+
* response (`{ message, sessionId }`).
|
|
23
|
+
*/
|
|
16
24
|
generateTranscriptionSummary(templateId, sessionId) {
|
|
17
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
26
|
const user = this.validateUser();
|
|
@@ -21,43 +29,82 @@ export class TranscriptionSummaryModule extends BaseClient {
|
|
|
21
29
|
userId: user.id,
|
|
22
30
|
sessionId: sessionId,
|
|
23
31
|
};
|
|
24
|
-
|
|
25
|
-
return transcriptionSummary;
|
|
32
|
+
return this.request(urls.transcriptionSummary, 'POST', generateSummaryDto);
|
|
26
33
|
});
|
|
27
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Create a transcription summary record; the current user is supplied server-side.
|
|
37
|
+
*
|
|
38
|
+
* @param dto - Summary fields (template, content, optional session and anonymised transcript).
|
|
39
|
+
* @returns The created transcription summary.
|
|
40
|
+
*/
|
|
28
41
|
createTranscriptionSummary(dto) {
|
|
29
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
43
|
return this.request(urls.transcriptionSummaryCreate, 'POST', dto);
|
|
31
44
|
});
|
|
32
45
|
}
|
|
33
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Update a transcription summary.
|
|
48
|
+
*
|
|
49
|
+
* @param id - UUID of the transcription summary to update.
|
|
50
|
+
* @param dto - Fields to update (content, anonymised transcript, and/or template).
|
|
51
|
+
* @returns The updated transcription summary.
|
|
52
|
+
*/
|
|
53
|
+
updateTranscriptionSummary(id, dto) {
|
|
34
54
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
|
|
36
|
-
content,
|
|
37
|
-
};
|
|
38
|
-
return this.request(`${urls.transcriptionSummaries}/${id}`, 'PATCH', updateSummaryDto);
|
|
55
|
+
return this.request(`${urls.transcriptionSummaries}/${id}`, 'PATCH', dto);
|
|
39
56
|
});
|
|
40
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Retrieve all transcription summaries accessible to the current user.
|
|
60
|
+
*
|
|
61
|
+
* @returns An array of transcription summaries.
|
|
62
|
+
*/
|
|
41
63
|
getTranscriptionSummaries() {
|
|
42
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
65
|
return this.request(urls.transcriptionSummaries, 'GET');
|
|
44
66
|
});
|
|
45
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Retrieve a single transcription summary by id.
|
|
70
|
+
*
|
|
71
|
+
* @param id - UUID of the transcription summary.
|
|
72
|
+
* @returns The requested transcription summary.
|
|
73
|
+
*/
|
|
46
74
|
getTranscriptionSummary(id) {
|
|
47
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
76
|
return this.request(`${urls.transcriptionSummaries}/${id}`, 'GET');
|
|
49
77
|
});
|
|
50
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Retrieve all transcription summaries belonging to a specific user.
|
|
81
|
+
*
|
|
82
|
+
* @param userId - UUID of the user whose summaries are returned.
|
|
83
|
+
* @returns An array of transcription summaries.
|
|
84
|
+
*/
|
|
51
85
|
getTranscriptionSummariesByUser(userId) {
|
|
52
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
87
|
return this.request(`${urls.transcriptionSummaries}/user/${userId}`, 'GET');
|
|
54
88
|
});
|
|
55
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Retrieve all transcription summaries belonging to a specific organization.
|
|
92
|
+
*
|
|
93
|
+
* @param organizationId - UUID of the organization whose summaries are returned.
|
|
94
|
+
* @returns An array of transcription summaries.
|
|
95
|
+
*/
|
|
56
96
|
getByOrganizationTranscriptionSummaries(organizationId) {
|
|
57
97
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
98
|
return this.request(`${urls.transcriptionSummaries}/organization/${organizationId}`, 'GET');
|
|
59
99
|
});
|
|
60
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* Clone an existing transcription summary with new content.
|
|
103
|
+
*
|
|
104
|
+
* @param id - UUID of the transcription summary to clone.
|
|
105
|
+
* @param content - Content for the cloned summary.
|
|
106
|
+
* @returns The newly created clone.
|
|
107
|
+
*/
|
|
61
108
|
cloneTranscriptionSummary(id, content) {
|
|
62
109
|
return __awaiter(this, void 0, void 0, function* () {
|
|
63
110
|
const cloneDto = {
|
|
@@ -66,6 +113,12 @@ export class TranscriptionSummaryModule extends BaseClient {
|
|
|
66
113
|
return this.request(`${urls.transcriptionSummaries}/${id}/clone`, 'POST', cloneDto);
|
|
67
114
|
});
|
|
68
115
|
}
|
|
116
|
+
/**
|
|
117
|
+
* Delete a transcription summary by id.
|
|
118
|
+
*
|
|
119
|
+
* @param id - UUID of the transcription summary to delete.
|
|
120
|
+
* @returns A promise that resolves once the summary is deleted.
|
|
121
|
+
*/
|
|
69
122
|
deleteTranscriptionSummary(id) {
|
|
70
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
124
|
yield this.request(`${urls.transcriptionSummaries}/${id}`, 'DELETE');
|
|
@@ -1,21 +1,127 @@
|
|
|
1
1
|
import { BaseClient } from './base-client';
|
|
2
2
|
import { User, UpdateUserDto, UpdateUserNamesDto } from '../types';
|
|
3
3
|
export declare class UserModule extends BaseClient {
|
|
4
|
+
/**
|
|
5
|
+
* Create a user in the current user's organization.
|
|
6
|
+
*
|
|
7
|
+
* @param firstName - First name of the new user.
|
|
8
|
+
* @param lastName - Last name of the new user.
|
|
9
|
+
* @param email - Email address of the new user.
|
|
10
|
+
* @param password - Initial password for the new user.
|
|
11
|
+
* @returns The newly created user.
|
|
12
|
+
*/
|
|
4
13
|
createUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
|
|
5
14
|
private assignRoleToUser;
|
|
15
|
+
/**
|
|
16
|
+
* Assign the editor organization role to a user.
|
|
17
|
+
*
|
|
18
|
+
* @param userId - UUID of the user to assign the role to.
|
|
19
|
+
* @param organizationId - Optional organization UUID; defaults to the current user's organization.
|
|
20
|
+
* @returns The user with the assigned organization role.
|
|
21
|
+
*/
|
|
6
22
|
assignEditorToRoleToUser(userId: string, organizationId?: string): Promise<User>;
|
|
23
|
+
/**
|
|
24
|
+
* Assign the admin organization role to a user.
|
|
25
|
+
*
|
|
26
|
+
* @param userId - UUID of the user to assign the role to.
|
|
27
|
+
* @param organizationId - Optional organization UUID; defaults to the current user's organization.
|
|
28
|
+
* @returns The user with the assigned organization role.
|
|
29
|
+
*/
|
|
7
30
|
assignAdminToRoleToUser(userId: string, organizationId?: string): Promise<User>;
|
|
31
|
+
/**
|
|
32
|
+
* Assign the disabled organization role to a user.
|
|
33
|
+
*
|
|
34
|
+
* @param userId - UUID of the user to assign the role to.
|
|
35
|
+
* @param organizationId - Optional organization UUID; defaults to the current user's organization.
|
|
36
|
+
* @returns The user with the assigned organization role.
|
|
37
|
+
*/
|
|
8
38
|
assignDisabledToRoleToUser(userId: string, organizationId?: string): Promise<User>;
|
|
39
|
+
/**
|
|
40
|
+
* Remove an organization role from a user.
|
|
41
|
+
*
|
|
42
|
+
* @param userId - UUID of the user.
|
|
43
|
+
* @param organizationRoleId - UUID of the organization role to remove.
|
|
44
|
+
* @returns A promise that resolves when the role is removed.
|
|
45
|
+
*/
|
|
9
46
|
removeRoleFromUser(userId: string, organizationRoleId: string): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a user and assign them the editor organization role.
|
|
49
|
+
*
|
|
50
|
+
* @param firstName - First name of the new user.
|
|
51
|
+
* @param lastName - Last name of the new user.
|
|
52
|
+
* @param email - Email address of the new user.
|
|
53
|
+
* @param password - Initial password for the new user.
|
|
54
|
+
* @returns The newly created user with the editor role assigned.
|
|
55
|
+
*/
|
|
10
56
|
createEditorUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
|
|
57
|
+
/**
|
|
58
|
+
* Create a user and assign them the admin organization role.
|
|
59
|
+
*
|
|
60
|
+
* @param firstName - First name of the new user.
|
|
61
|
+
* @param lastName - Last name of the new user.
|
|
62
|
+
* @param email - Email address of the new user.
|
|
63
|
+
* @param password - Initial password for the new user.
|
|
64
|
+
* @returns The newly created user with the admin role assigned.
|
|
65
|
+
*/
|
|
11
66
|
createAdminUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
|
|
67
|
+
/**
|
|
68
|
+
* Create a user and assign them the disabled organization role.
|
|
69
|
+
*
|
|
70
|
+
* @param firstName - First name of the new user.
|
|
71
|
+
* @param lastName - Last name of the new user.
|
|
72
|
+
* @param email - Email address of the new user.
|
|
73
|
+
* @param password - Initial password for the new user.
|
|
74
|
+
* @returns The newly created user with the disabled role assigned.
|
|
75
|
+
*/
|
|
12
76
|
createDisabledUser(firstName: string, lastName: string, email: string, password: string): Promise<User>;
|
|
77
|
+
/**
|
|
78
|
+
* List all users the current user can access.
|
|
79
|
+
*
|
|
80
|
+
* @returns An array of users.
|
|
81
|
+
*/
|
|
13
82
|
getUsers(): Promise<User[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Get a single user by ID.
|
|
85
|
+
*
|
|
86
|
+
* @param id - UUID of the user.
|
|
87
|
+
* @returns The requested user.
|
|
88
|
+
*/
|
|
14
89
|
getUser(id: string): Promise<User>;
|
|
90
|
+
/**
|
|
91
|
+
* List all users belonging to an organization.
|
|
92
|
+
*
|
|
93
|
+
* @param organizationId - UUID of the organization.
|
|
94
|
+
* @returns An array of users in the organization.
|
|
95
|
+
*/
|
|
15
96
|
getUsersByOrganization(organizationId: string): Promise<User[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Update a user by ID.
|
|
99
|
+
*
|
|
100
|
+
* @param id - UUID of the user to update.
|
|
101
|
+
* @param data - Fields to update on the user.
|
|
102
|
+
* @returns The updated user.
|
|
103
|
+
*/
|
|
16
104
|
updateUser(id: string, data: UpdateUserDto): Promise<User>;
|
|
105
|
+
/**
|
|
106
|
+
* Delete a user by ID.
|
|
107
|
+
*
|
|
108
|
+
* @param id - UUID of the user to delete.
|
|
109
|
+
* @returns A promise that resolves when the user is deleted.
|
|
110
|
+
*/
|
|
17
111
|
deleteUser(id: string): Promise<void>;
|
|
112
|
+
/**
|
|
113
|
+
* Update the current user's first and/or last name.
|
|
114
|
+
*
|
|
115
|
+
* @param data - The name fields to update.
|
|
116
|
+
* @returns The updated user.
|
|
117
|
+
*/
|
|
18
118
|
updateNames(data: UpdateUserNamesDto): Promise<User>;
|
|
119
|
+
/**
|
|
120
|
+
* Register an Expo push token for the current user.
|
|
121
|
+
*
|
|
122
|
+
* @param token - The Expo push token to add.
|
|
123
|
+
* @returns A confirmation message.
|
|
124
|
+
*/
|
|
19
125
|
addExpoPushToken(token: string): Promise<{
|
|
20
126
|
message: string;
|
|
21
127
|
}>;
|