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
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
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 { TranscriptionSummaryModule } from './modules/transcription-summary.module';
|
|
17
|
+
import { SessionModule } from './modules/session/session.module';
|
|
18
|
+
import { AgentModule } from './modules/agent.module';
|
|
19
|
+
import { AudioModule } from './modules/audio.module';
|
|
20
|
+
import { WorkflowModule } from './modules/workflow.module';
|
|
21
|
+
import { IntegrationActionModule } from './modules/integration-action.module';
|
|
22
|
+
import { LogModule } from './modules/log.module';
|
|
23
|
+
import { DebugModule } from './modules/debug.module';
|
|
24
|
+
import { ExternalIntegrationModule } from './modules/external-integration.module';
|
|
25
|
+
import { WebSocketModule } from './modules/websocket.module';
|
|
26
|
+
import { ReportsModule } from './modules/reports.module';
|
|
27
|
+
import { PatientModule } from './modules/patient.module';
|
|
28
|
+
import { DataStrategyModule } from './modules/data-strategy.module';
|
|
29
|
+
import { SystemSnapshotModule } from './modules/system-snapshot.module';
|
|
30
|
+
import { RatingModule } from './modules/rating.module';
|
|
31
|
+
import { TiakiModule } from './modules/tiaki.module';
|
|
32
|
+
/**
|
|
33
|
+
* WhioTeamAdminSDK - SDK for team administrators
|
|
34
|
+
* Provides access to team-level operations
|
|
35
|
+
*
|
|
36
|
+
* Note: Team admin specific modules will be added as endpoints are implemented
|
|
37
|
+
*/
|
|
38
|
+
export class WhioTeamAdminSDK extends BaseClient {
|
|
39
|
+
constructor(config = {}) {
|
|
40
|
+
super(config);
|
|
41
|
+
this.sdkInitialized = false;
|
|
42
|
+
this.authModule = new AuthModule(config);
|
|
43
|
+
this.usersModule = new UserModule(config);
|
|
44
|
+
this.organizationsModule = new OrganizationModule(config);
|
|
45
|
+
this.teamsModule = new TeamModule(config);
|
|
46
|
+
this.templatesModule = new TemplateModule(config);
|
|
47
|
+
this.transcriptionSummariesModule = new TranscriptionSummaryModule(config);
|
|
48
|
+
this.sessionsModule = new SessionModule(config);
|
|
49
|
+
this.agentsModule = new AgentModule(config);
|
|
50
|
+
this.audioModule = new AudioModule(config);
|
|
51
|
+
this.workflowsModule = new WorkflowModule(config);
|
|
52
|
+
this.integrationActionsModule = new IntegrationActionModule(config);
|
|
53
|
+
this.logsModule = new LogModule(config);
|
|
54
|
+
this.debugModule = new DebugModule(config);
|
|
55
|
+
this.externalIntegrationsModule = new ExternalIntegrationModule(config);
|
|
56
|
+
this.websocketModule = config.skipWebsocket ? null : new WebSocketModule(config);
|
|
57
|
+
this.reportsModule = new ReportsModule(config);
|
|
58
|
+
this.patientsModule = new PatientModule(config);
|
|
59
|
+
this.dataStrategiesModule = new DataStrategyModule(config);
|
|
60
|
+
this.systemSnapshotsModule = new SystemSnapshotModule(config);
|
|
61
|
+
this.ratingsModule = new RatingModule(config);
|
|
62
|
+
this.tiakiModule = new TiakiModule(config);
|
|
63
|
+
this.modules = [
|
|
64
|
+
this.authModule, this.usersModule, this.organizationsModule, this.teamsModule, this.templatesModule,
|
|
65
|
+
this.transcriptionSummariesModule, this.sessionsModule, this.agentsModule, this.audioModule,
|
|
66
|
+
this.workflowsModule, this.integrationActionsModule, this.logsModule, this.debugModule, this.externalIntegrationsModule,
|
|
67
|
+
this.reportsModule, this.patientsModule, this.dataStrategiesModule, this.systemSnapshotsModule, this.ratingsModule,
|
|
68
|
+
this.tiakiModule,
|
|
69
|
+
...(this.websocketModule ? [this.websocketModule] : [])
|
|
70
|
+
];
|
|
71
|
+
this.initialize().catch(error => {
|
|
72
|
+
console.error('Failed to initialize SDK:', error);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
initialize() {
|
|
76
|
+
const _super = Object.create(null, {
|
|
77
|
+
initialize: { get: () => super.initialize }
|
|
78
|
+
});
|
|
79
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
80
|
+
if (this.sdkInitialized) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
yield _super.initialize.call(this);
|
|
84
|
+
yield Promise.all(this.modules.map(module => module.initialize()));
|
|
85
|
+
yield this.syncUserStateAcrossModules();
|
|
86
|
+
this.sdkInitialized = true;
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
isReady() {
|
|
90
|
+
return this.sdkInitialized;
|
|
91
|
+
}
|
|
92
|
+
syncUserStateAcrossModules() {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const currentUser = this.getCurrentUser();
|
|
95
|
+
const accessToken = this.getAccessToken();
|
|
96
|
+
const refreshToken = this.getRefreshToken();
|
|
97
|
+
yield Promise.all(this.modules.map(module => module.syncUserState(currentUser, accessToken, refreshToken)));
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
syncUserState(user, accessToken, refreshToken) {
|
|
101
|
+
const _super = Object.create(null, {
|
|
102
|
+
syncUserState: { get: () => super.syncUserState }
|
|
103
|
+
});
|
|
104
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
105
|
+
yield _super.syncUserState.call(this, user, accessToken, refreshToken);
|
|
106
|
+
yield Promise.all(this.modules.map(module => module.syncUserState(user, accessToken, refreshToken)));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
// ======================
|
|
110
|
+
// AUTH METHODS
|
|
111
|
+
// ======================
|
|
112
|
+
login(...args) {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
|
+
const result = yield this.authModule.login(...args);
|
|
115
|
+
yield this.syncUserState(result.user, result.access_token, result.refresh_token);
|
|
116
|
+
return result;
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
logout(...args) {
|
|
120
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
121
|
+
const result = yield this.authModule.logout(...args);
|
|
122
|
+
yield this.syncUserState(null, null, null);
|
|
123
|
+
return result;
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
loginWithCode(...args) {
|
|
127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
128
|
+
const result = yield this.authModule.loginWithCode(...args);
|
|
129
|
+
yield this.syncUserState(result.user, result.access_token, result.refresh_token);
|
|
130
|
+
return result;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
getProfile(...args) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
135
|
+
return this.authModule.getProfile(...args);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
changePassword(...args) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
return this.authModule.changePassword(...args);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
requestLoginCode(...args) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
+
return this.authModule.requestLoginCode(...args);
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
// ======================
|
|
149
|
+
// SESSION METHODS (User - own sessions only)
|
|
150
|
+
// ======================
|
|
151
|
+
createSession(...args) {
|
|
152
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
153
|
+
return this.sessionsModule.createSession(...args);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
getSessions(...args) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
return this.sessionsModule.getSessions(...args);
|
|
159
|
+
});
|
|
160
|
+
}
|
|
161
|
+
getSession(...args) {
|
|
162
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
+
return this.sessionsModule.getSession(...args);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
updateSession(...args) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
return this.sessionsModule.updateSession(...args);
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
deleteSession(...args) {
|
|
172
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
+
return this.sessionsModule.deleteSession(...args);
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
searchSessions(...args) {
|
|
177
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
178
|
+
return this.sessionsModule.searchSessions(...args);
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
setPrimaryTranscriptionSummary(...args) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
return this.sessionsModule.setPrimaryTranscriptionSummary(...args);
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
rerunTranscription(...args) {
|
|
187
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
188
|
+
return this.sessionsModule.rerunTranscription(...args);
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
setAudioStreamStatus(...args) {
|
|
192
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
193
|
+
return this.sessionsModule.setAudioStreamStatus(...args);
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
forwardToTiaki(...args) {
|
|
197
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
198
|
+
return this.sessionsModule.forwardToTiaki(...args);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
// ======================
|
|
202
|
+
// USER METHODS
|
|
203
|
+
// ======================
|
|
204
|
+
getUser(...args) {
|
|
205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
return this.usersModule.getUser(...args);
|
|
207
|
+
});
|
|
208
|
+
}
|
|
209
|
+
updateUser(...args) {
|
|
210
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
211
|
+
return this.usersModule.updateUser(...args);
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
addExpoPushToken(...args) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
+
return this.usersModule.addExpoPushToken(...args);
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
// ======================
|
|
220
|
+
// TEMPLATE METHODS
|
|
221
|
+
// ======================
|
|
222
|
+
getTemplates(...args) {
|
|
223
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
224
|
+
return this.templatesModule.getTemplates(...args);
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
getTemplate(...args) {
|
|
228
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
229
|
+
return this.templatesModule.getTemplate(...args);
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
getTemplatesByOrganization(...args) {
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
234
|
+
return this.templatesModule.getTemplatesByOrganization(...args);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
getTemplateCategories(...args) {
|
|
238
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
239
|
+
return this.templatesModule.getTemplateCategories(...args);
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
getTemplateCategory(...args) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
return this.templatesModule.getTemplateCategory(...args);
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
// ======================
|
|
248
|
+
// TRANSCRIPTION SUMMARY METHODS
|
|
249
|
+
// ======================
|
|
250
|
+
generateTranscriptionSummary(...args) {
|
|
251
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
252
|
+
return this.transcriptionSummariesModule.generateTranscriptionSummary(...args);
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
updateTranscriptionSummary(...args) {
|
|
256
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
257
|
+
return this.transcriptionSummariesModule.updateTranscriptionSummary(...args);
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
getTranscriptionSummaries(...args) {
|
|
261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
+
return this.transcriptionSummariesModule.getTranscriptionSummaries(...args);
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
getTranscriptionSummary(...args) {
|
|
266
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
267
|
+
return this.transcriptionSummariesModule.getTranscriptionSummary(...args);
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
cloneTranscriptionSummary(...args) {
|
|
271
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
272
|
+
return this.transcriptionSummariesModule.cloneTranscriptionSummary(...args);
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
deleteTranscriptionSummary(...args) {
|
|
276
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
277
|
+
return this.transcriptionSummariesModule.deleteTranscriptionSummary(...args);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
// ======================
|
|
281
|
+
// AUDIO METHODS
|
|
282
|
+
// ======================
|
|
283
|
+
uploadAudioFile(...args) {
|
|
284
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
285
|
+
return this.templatesModule.uploadAudioFile(...args);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
uploadLargeAudioFile(...args) {
|
|
289
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
290
|
+
return this.templatesModule.uploadLargeAudioFile(...args);
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
transcribeBase64Audio(...args) {
|
|
294
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
295
|
+
return this.templatesModule.transcribeBase64Audio(...args);
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
uploadAudioFileToSession(...args) {
|
|
299
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
300
|
+
return this.audioModule.uploadAudioFileToSession(...args);
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
getMyAudioFiles(...args) {
|
|
304
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
305
|
+
return this.audioModule.getMyAudioFiles(...args);
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
getAudioFilesBySession(...args) {
|
|
309
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
310
|
+
return this.audioModule.getAudioFilesBySession(...args);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
getAudioFile(...args) {
|
|
314
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
315
|
+
return this.audioModule.getAudioFile(...args);
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
downloadAudioFile(...args) {
|
|
319
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
320
|
+
return this.audioModule.downloadAudioFile(...args);
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
downloadAudioFileAsUrl(...args) {
|
|
324
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
325
|
+
return this.audioModule.downloadAudioFileAsUrl(...args);
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
// ======================
|
|
329
|
+
// WORKFLOW METHODS
|
|
330
|
+
// ======================
|
|
331
|
+
getWorkflows(...args) {
|
|
332
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
333
|
+
return this.workflowsModule.getWorkflows(...args);
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
getWorkflow(...args) {
|
|
337
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
+
return this.workflowsModule.getWorkflow(...args);
|
|
339
|
+
});
|
|
340
|
+
}
|
|
341
|
+
getWorkflowsByOrganization(...args) {
|
|
342
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
343
|
+
return this.workflowsModule.getWorkflowsByOrganization(...args);
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
// ======================
|
|
347
|
+
// AGENT METHODS
|
|
348
|
+
// ======================
|
|
349
|
+
getAgents(...args) {
|
|
350
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
351
|
+
return this.agentsModule.getAgents(...args);
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
getAgent(...args) {
|
|
355
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
356
|
+
return this.agentsModule.getAgent(...args);
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
// ======================
|
|
360
|
+
// RATING METHODS
|
|
361
|
+
// ======================
|
|
362
|
+
createRating(...args) {
|
|
363
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
364
|
+
return this.ratingsModule.createRating(...args);
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
getRatingsBySession(...args) {
|
|
368
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
369
|
+
return this.ratingsModule.getRatingsBySession(...args);
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
// ======================
|
|
373
|
+
// TIAKI METHODS
|
|
374
|
+
// ======================
|
|
375
|
+
createTiakiCalendarEvent(...args) {
|
|
376
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
377
|
+
return this.tiakiModule.createCalendarEvent(...args);
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
// ======================
|
|
381
|
+
// PATIENT METHODS
|
|
382
|
+
// ======================
|
|
383
|
+
getPatientsFromIntegration(...args) {
|
|
384
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
385
|
+
return this.patientsModule.getPatientsFromIntegration(...args);
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
}
|
package/package.json
CHANGED
package/src/sdk/exampleuse.ts
CHANGED
|
@@ -65,18 +65,6 @@ export async function main() {
|
|
|
65
65
|
template.id,
|
|
66
66
|
);
|
|
67
67
|
|
|
68
|
-
const userTemplate = await sdk.createUserTemplate(
|
|
69
|
-
"User Template",
|
|
70
|
-
"This is a user template",
|
|
71
|
-
template.id,
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const updatedUserTemplate = await sdk.updateUserTemplate(
|
|
75
|
-
"User templated updated",
|
|
76
|
-
"This is an updated user template",
|
|
77
|
-
userTemplate.id,
|
|
78
|
-
);
|
|
79
|
-
|
|
80
68
|
// Create a workflow example
|
|
81
69
|
const workflow = await sdk.createWorkflow("Test Workflow");
|
|
82
70
|
console.log("Created workflow:", workflow);
|
|
@@ -95,11 +83,7 @@ export async function main() {
|
|
|
95
83
|
const workflows = await sdk.getWorkflows();
|
|
96
84
|
console.log("All workflows:", workflows);
|
|
97
85
|
|
|
98
|
-
//console.log("Usertemplate", userTemplate);
|
|
99
|
-
//console.log("Updated User Template", updatedUserTemplate);
|
|
100
|
-
|
|
101
86
|
const templates = await sdk.getTemplates();
|
|
102
|
-
const userTemplates = await sdk.getUserTemplates();
|
|
103
87
|
|
|
104
88
|
const filepath = "/Users/rimu/Downloads/combined_1749168962192.m4a"; // Replace with your actual file path
|
|
105
89
|
const formData = new FormData();
|
package/src/sdk/index.ts
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
1
|
+
// Role-specific SDK classes
|
|
2
|
+
export { WhioSDK } from './whio-sdk';
|
|
3
|
+
export { WhioSuperuserSDK } from './whio-superuser-sdk';
|
|
4
|
+
export { WhioOrgAdminSDK } from './whio-orgadmin-sdk';
|
|
5
|
+
export { WhioTeamAdminSDK } from './whio-teamadmin-sdk';
|
|
6
|
+
|
|
7
|
+
// Backward compatibility - ApiSDK is deprecated, use WhioSDK instead
|
|
8
|
+
export { ApiSDK } from './sdk';
|
|
9
|
+
|
|
10
|
+
// Types and utilities
|
|
11
|
+
export * from './types';
|
|
12
|
+
export { AxiosError } from 'axios';
|
|
13
|
+
|
|
14
|
+
// Session modules (for advanced usage)
|
|
15
|
+
export { SessionModule } from './modules/session/session.module';
|
|
16
|
+
export { SuperuserSessionModule } from './modules/session/superuser-session.module';
|
|
17
|
+
export { OrgAdminSessionModule } from './modules/session/orgadmin-session.module';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseClient } from '../base-client';
|
|
2
|
+
import {
|
|
3
|
+
Session,
|
|
4
|
+
SessionsResponse,
|
|
5
|
+
UpdateSessionDto,
|
|
6
|
+
SearchSessionsDto,
|
|
7
|
+
SearchSessionsResponse,
|
|
8
|
+
} from '../../types';
|
|
9
|
+
import urls from '../../urls';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Session module for organization admins - provides access to sessions within their organization
|
|
13
|
+
*/
|
|
14
|
+
export class OrgAdminSessionModule extends BaseClient {
|
|
15
|
+
public async getSessionsByUser(userId: string): Promise<Session[]> {
|
|
16
|
+
return this.request<Session[]>(`${urls.sessions}/orgadmin/user/${userId}`, 'GET');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public async getSessionsByOrganization(limit = 100, offset = 0): Promise<SessionsResponse> {
|
|
20
|
+
const params = new URLSearchParams();
|
|
21
|
+
params.append('limit', limit.toString());
|
|
22
|
+
params.append('offset', offset.toString());
|
|
23
|
+
return this.request<SessionsResponse>(`${urls.sessions}/orgadmin/organization?${params.toString()}`, 'GET');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public async searchSessions(filters: SearchSessionsDto = {}): Promise<SearchSessionsResponse> {
|
|
27
|
+
const params = this.buildSearchParams(filters);
|
|
28
|
+
const queryString = params.toString();
|
|
29
|
+
const url = queryString ? `${urls.sessions}/orgadmin/search?${queryString}` : `${urls.sessions}/orgadmin/search`;
|
|
30
|
+
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session> {
|
|
34
|
+
return this.request<Session>(`${urls.sessions}/orgadmin/${id}`, 'PATCH', sessionData);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public async deleteSession(id: string): Promise<void> {
|
|
38
|
+
await this.request(`${urls.sessions}/orgadmin/${id}`, 'DELETE');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session> {
|
|
42
|
+
return this.request<Session>(`${urls.sessions}/orgadmin/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async getSession(id: string): Promise<Session> {
|
|
46
|
+
return this.request<Session>(`${urls.sessions}/${id}`, 'GET');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private buildSearchParams(filters: SearchSessionsDto): URLSearchParams {
|
|
50
|
+
const params = new URLSearchParams();
|
|
51
|
+
if (filters.startDate) params.append('startDate', filters.startDate);
|
|
52
|
+
if (filters.endDate) params.append('endDate', filters.endDate);
|
|
53
|
+
if (filters.userId) params.append('userId', filters.userId);
|
|
54
|
+
if (filters.userEmail) params.append('userEmail', filters.userEmail);
|
|
55
|
+
if (filters.patientName) params.append('patientName', filters.patientName);
|
|
56
|
+
if (filters.templateName) params.append('templateName', filters.templateName);
|
|
57
|
+
if (filters.templateId) params.append('templateId', filters.templateId);
|
|
58
|
+
if (filters.hasSummary !== undefined) params.append('hasSummary', filters.hasSummary.toString());
|
|
59
|
+
if (filters.includeTranscriptions !== undefined) params.append('includeTranscriptions', filters.includeTranscriptions.toString());
|
|
60
|
+
if (filters.limit !== undefined) params.append('limit', filters.limit.toString());
|
|
61
|
+
if (filters.offset !== undefined) params.append('offset', filters.offset.toString());
|
|
62
|
+
return params;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { BaseClient } from '../base-client';
|
|
2
|
+
import {
|
|
3
|
+
Session,
|
|
4
|
+
CreateSessionDto,
|
|
5
|
+
UpdateSessionDto,
|
|
6
|
+
SetAudioStreamStatusDto,
|
|
7
|
+
ForwardToTiakiResponse,
|
|
8
|
+
SearchSessionsDto,
|
|
9
|
+
SearchSessionsResponse,
|
|
10
|
+
} from '../../types';
|
|
11
|
+
import urls from '../../urls';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Session module for regular users - provides access to own sessions only
|
|
15
|
+
*/
|
|
16
|
+
export class SessionModule extends BaseClient {
|
|
17
|
+
public async createSession(sessionData: CreateSessionDto): Promise<Session> {
|
|
18
|
+
return this.request<Session>(urls.sessions, 'POST', sessionData);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
public async getSessions(): Promise<Session[]> {
|
|
22
|
+
return this.request<Session[]>(`${urls.sessions}/my-sessions`, 'GET');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async getSession(id: string): Promise<Session> {
|
|
26
|
+
return this.request<Session>(`${urls.sessions}/${id}`, 'GET');
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public async updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session> {
|
|
30
|
+
return this.request<Session>(`${urls.sessions}/${id}`, 'PATCH', sessionData);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async deleteSession(id: string): Promise<void> {
|
|
34
|
+
await this.request(`${urls.sessions}/${id}`, 'DELETE');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public async setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session> {
|
|
38
|
+
return this.request<Session>(`${urls.sessions}/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async rerunTranscription(sessionId: string): Promise<{ message: string; sessionId: string }> {
|
|
42
|
+
return this.request<{ message: string; sessionId: string }>(`${urls.sessions}/${sessionId}/rerun-transcription`, 'POST');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async setAudioStreamStatus(data: SetAudioStreamStatusDto): Promise<Session> {
|
|
46
|
+
return this.request<Session>(`${urls.sessions}/set-audio-stream-status`, 'PATCH', data);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
public async forwardToTiaki(sessionId: string): Promise<ForwardToTiakiResponse> {
|
|
50
|
+
return this.request<ForwardToTiakiResponse>(`${urls.sessions}/forward-to-tiaki/${sessionId}`, 'POST');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
public async searchSessions(filters: SearchSessionsDto = {}): Promise<SearchSessionsResponse> {
|
|
54
|
+
const params = this.buildSearchParams(filters);
|
|
55
|
+
const queryString = params.toString();
|
|
56
|
+
const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
|
|
57
|
+
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
protected buildSearchParams(filters: SearchSessionsDto): URLSearchParams {
|
|
61
|
+
const params = new URLSearchParams();
|
|
62
|
+
if (filters.startDate) params.append('startDate', filters.startDate);
|
|
63
|
+
if (filters.endDate) params.append('endDate', filters.endDate);
|
|
64
|
+
if (filters.userId) params.append('userId', filters.userId);
|
|
65
|
+
if (filters.userEmail) params.append('userEmail', filters.userEmail);
|
|
66
|
+
if (filters.patientName) params.append('patientName', filters.patientName);
|
|
67
|
+
if (filters.templateName) params.append('templateName', filters.templateName);
|
|
68
|
+
if (filters.templateId) params.append('templateId', filters.templateId);
|
|
69
|
+
if (filters.hasSummary !== undefined) params.append('hasSummary', filters.hasSummary.toString());
|
|
70
|
+
if (filters.includeTranscriptions !== undefined) params.append('includeTranscriptions', filters.includeTranscriptions.toString());
|
|
71
|
+
if (filters.limit !== undefined) params.append('limit', filters.limit.toString());
|
|
72
|
+
if (filters.offset !== undefined) params.append('offset', filters.offset.toString());
|
|
73
|
+
return params;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { BaseClient } from '../base-client';
|
|
2
|
+
import {
|
|
3
|
+
Session,
|
|
4
|
+
SessionsResponse,
|
|
5
|
+
UpdateSessionDto,
|
|
6
|
+
SearchSessionsDto,
|
|
7
|
+
SearchSessionsResponse,
|
|
8
|
+
} from '../../types';
|
|
9
|
+
import urls from '../../urls';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Session module for superusers - provides access to all sessions across the system
|
|
13
|
+
*/
|
|
14
|
+
export class SuperuserSessionModule extends BaseClient {
|
|
15
|
+
public async getSessionsByUser(userId: string): Promise<Session[]> {
|
|
16
|
+
return this.request<Session[]>(`${urls.sessions}/superuser/user/${userId}`, 'GET');
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
public async getSessionsByOrganization(limit = 100, offset = 0): Promise<SessionsResponse> {
|
|
20
|
+
const params = new URLSearchParams();
|
|
21
|
+
params.append('limit', limit.toString());
|
|
22
|
+
params.append('offset', offset.toString());
|
|
23
|
+
return this.request<SessionsResponse>(`${urls.sessions}/organization?${params.toString()}`, 'GET');
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
public async searchSessions(filters: SearchSessionsDto = {}): Promise<SearchSessionsResponse> {
|
|
27
|
+
const params = this.buildSearchParams(filters);
|
|
28
|
+
const queryString = params.toString();
|
|
29
|
+
const url = queryString ? `${urls.sessions}/superuser/search?${queryString}` : `${urls.sessions}/superuser/search`;
|
|
30
|
+
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session> {
|
|
34
|
+
return this.request<Session>(`${urls.sessions}/superuser/${id}`, 'PATCH', sessionData);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
public async deleteSession(id: string): Promise<void> {
|
|
38
|
+
await this.request(`${urls.sessions}/superuser/${id}`, 'DELETE');
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session> {
|
|
42
|
+
return this.request<Session>(`${urls.sessions}/superuser/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
public async getSession(id: string): Promise<Session> {
|
|
46
|
+
return this.request<Session>(`${urls.sessions}/${id}`, 'GET');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
private buildSearchParams(filters: SearchSessionsDto): URLSearchParams {
|
|
50
|
+
const params = new URLSearchParams();
|
|
51
|
+
if (filters.startDate) params.append('startDate', filters.startDate);
|
|
52
|
+
if (filters.endDate) params.append('endDate', filters.endDate);
|
|
53
|
+
if (filters.userId) params.append('userId', filters.userId);
|
|
54
|
+
if (filters.userEmail) params.append('userEmail', filters.userEmail);
|
|
55
|
+
if (filters.patientName) params.append('patientName', filters.patientName);
|
|
56
|
+
if (filters.templateName) params.append('templateName', filters.templateName);
|
|
57
|
+
if (filters.templateId) params.append('templateId', filters.templateId);
|
|
58
|
+
if (filters.hasSummary !== undefined) params.append('hasSummary', filters.hasSummary.toString());
|
|
59
|
+
if (filters.includeTranscriptions !== undefined) params.append('includeTranscriptions', filters.includeTranscriptions.toString());
|
|
60
|
+
if (filters.limit !== undefined) params.append('limit', filters.limit.toString());
|
|
61
|
+
if (filters.offset !== undefined) params.append('offset', filters.offset.toString());
|
|
62
|
+
return params;
|
|
63
|
+
}
|
|
64
|
+
}
|