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.
Files changed (54) hide show
  1. package/dist/src/sdk/exampleuse.js +0 -5
  2. package/dist/src/sdk/index.d.ts +9 -2
  3. package/dist/src/sdk/index.js +13 -2
  4. package/dist/src/sdk/modules/session/index.d.ts +3 -0
  5. package/dist/src/sdk/modules/session/index.js +3 -0
  6. package/dist/src/sdk/modules/session/orgadmin-session.module.d.ts +15 -0
  7. package/dist/src/sdk/modules/session/orgadmin-session.module.js +83 -0
  8. package/dist/src/sdk/modules/session/session.module.d.ts +21 -0
  9. package/dist/src/sdk/modules/session/session.module.js +95 -0
  10. package/dist/src/sdk/modules/session/superuser-session.module.d.ts +15 -0
  11. package/dist/src/sdk/modules/session/superuser-session.module.js +83 -0
  12. package/dist/src/sdk/modules/session.module.d.ts +13 -2
  13. package/dist/src/sdk/modules/session.module.js +111 -36
  14. package/dist/src/sdk/modules/template.module.d.ts +1 -8
  15. package/dist/src/sdk/modules/template.module.js +0 -53
  16. package/dist/src/sdk/modules/transcription-summary.module.d.ts +0 -1
  17. package/dist/src/sdk/modules/transcription-summary.module.js +0 -14
  18. package/dist/src/sdk/modules/websocket.module.d.ts +5 -2
  19. package/dist/src/sdk/modules/websocket.module.js +6 -5
  20. package/dist/src/sdk/sdk.d.ts +12 -10
  21. package/dist/src/sdk/sdk.js +63 -51
  22. package/dist/src/sdk/types/team.types.d.ts +0 -2
  23. package/dist/src/sdk/types/template.types.d.ts +0 -36
  24. package/dist/src/sdk/types/websocket.types.d.ts +7 -0
  25. package/dist/src/sdk/urls.d.ts +0 -2
  26. package/dist/src/sdk/urls.js +0 -2
  27. package/dist/src/sdk/whio-orgadmin-sdk.d.ts +104 -0
  28. package/dist/src/sdk/whio-orgadmin-sdk.js +437 -0
  29. package/dist/src/sdk/whio-sdk.d.ts +102 -0
  30. package/dist/src/sdk/whio-sdk.js +389 -0
  31. package/dist/src/sdk/whio-superuser-sdk.d.ts +135 -0
  32. package/dist/src/sdk/whio-superuser-sdk.js +576 -0
  33. package/dist/src/sdk/whio-teamadmin-sdk.d.ts +104 -0
  34. package/dist/src/sdk/whio-teamadmin-sdk.js +388 -0
  35. package/package.json +1 -1
  36. package/src/sdk/exampleuse.ts +0 -16
  37. package/src/sdk/index.ts +17 -3
  38. package/src/sdk/modules/session/index.ts +3 -0
  39. package/src/sdk/modules/session/orgadmin-session.module.ts +64 -0
  40. package/src/sdk/modules/session/session.module.ts +75 -0
  41. package/src/sdk/modules/session/superuser-session.module.ts +64 -0
  42. package/src/sdk/modules/session.module.ts +84 -15
  43. package/src/sdk/modules/template.module.ts +0 -54
  44. package/src/sdk/modules/transcription-summary.module.ts +0 -17
  45. package/src/sdk/modules/websocket.module.ts +15 -8
  46. package/src/sdk/sdk.ts +51 -41
  47. package/src/sdk/types/team.types.ts +0 -2
  48. package/src/sdk/types/template.types.ts +0 -45
  49. package/src/sdk/types/websocket.types.ts +12 -4
  50. package/src/sdk/urls.ts +1 -3
  51. package/src/sdk/whio-orgadmin-sdk.ts +408 -0
  52. package/src/sdk/whio-sdk.ts +374 -0
  53. package/src/sdk/whio-superuser-sdk.ts +530 -0
  54. package/src/sdk/whio-teamadmin-sdk.ts +372 -0
@@ -43,8 +43,6 @@ export function main() {
43
43
  const assignRes = yield sdk.addUserToTeam(team.id, newUser.id, "admin");
44
44
  const template = yield sdk.createTemplate("Test Template", "This is a test template");
45
45
  const updatedTemplate = yield sdk.updateTemplate("Updated Template", "This is an updated test template", template.id);
46
- const userTemplate = yield sdk.createUserTemplate("User Template", "This is a user template", template.id);
47
- const updatedUserTemplate = yield sdk.updateUserTemplate("User templated updated", "This is an updated user template", userTemplate.id);
48
46
  // Create a workflow example
49
47
  const workflow = yield sdk.createWorkflow("Test Workflow");
50
48
  console.log("Created workflow:", workflow);
@@ -57,10 +55,7 @@ export function main() {
57
55
  // Get workflows
58
56
  const workflows = yield sdk.getWorkflows();
59
57
  console.log("All workflows:", workflows);
60
- //console.log("Usertemplate", userTemplate);
61
- //console.log("Updated User Template", updatedUserTemplate);
62
58
  const templates = yield sdk.getTemplates();
63
- const userTemplates = yield sdk.getUserTemplates();
64
59
  const filepath = "/Users/rimu/Downloads/combined_1749168962192.m4a"; // Replace with your actual file path
65
60
  const formData = new FormData();
66
61
  formData.append('file', new Blob([filepath]), 'audio.m4a'); // Adjust the Blob as necessary
@@ -1,3 +1,10 @@
1
- export { ApiSDK } from "./sdk";
2
- export * from "./types";
1
+ export { WhioSDK } from './whio-sdk';
2
+ export { WhioSuperuserSDK } from './whio-superuser-sdk';
3
+ export { WhioOrgAdminSDK } from './whio-orgadmin-sdk';
4
+ export { WhioTeamAdminSDK } from './whio-teamadmin-sdk';
5
+ export { ApiSDK } from './sdk';
6
+ export * from './types';
3
7
  export { AxiosError } from 'axios';
8
+ export { SessionModule } from './modules/session/session.module';
9
+ export { SuperuserSessionModule } from './modules/session/superuser-session.module';
10
+ export { OrgAdminSessionModule } from './modules/session/orgadmin-session.module';
@@ -1,3 +1,14 @@
1
- export { ApiSDK } from "./sdk";
2
- export * from "./types";
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
+ // Backward compatibility - ApiSDK is deprecated, use WhioSDK instead
7
+ export { ApiSDK } from './sdk';
8
+ // Types and utilities
9
+ export * from './types';
3
10
  export { AxiosError } from 'axios';
11
+ // Session modules (for advanced usage)
12
+ export { SessionModule } from './modules/session/session.module';
13
+ export { SuperuserSessionModule } from './modules/session/superuser-session.module';
14
+ export { OrgAdminSessionModule } from './modules/session/orgadmin-session.module';
@@ -0,0 +1,3 @@
1
+ export { SessionModule } from './session.module';
2
+ export { SuperuserSessionModule } from './superuser-session.module';
3
+ export { OrgAdminSessionModule } from './orgadmin-session.module';
@@ -0,0 +1,3 @@
1
+ export { SessionModule } from './session.module';
2
+ export { SuperuserSessionModule } from './superuser-session.module';
3
+ export { OrgAdminSessionModule } from './orgadmin-session.module';
@@ -0,0 +1,15 @@
1
+ import { BaseClient } from '../base-client';
2
+ import { Session, SessionsResponse, UpdateSessionDto, SearchSessionsDto, SearchSessionsResponse } from '../../types';
3
+ /**
4
+ * Session module for organization admins - provides access to sessions within their organization
5
+ */
6
+ export declare class OrgAdminSessionModule extends BaseClient {
7
+ getSessionsByUser(userId: string): Promise<Session[]>;
8
+ getSessionsByOrganization(limit?: number, offset?: number): Promise<SessionsResponse>;
9
+ searchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
10
+ updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
11
+ deleteSession(id: string): Promise<void>;
12
+ setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
13
+ getSession(id: string): Promise<Session>;
14
+ private buildSearchParams;
15
+ }
@@ -0,0 +1,83 @@
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 '../base-client';
11
+ import urls from '../../urls';
12
+ /**
13
+ * Session module for organization admins - provides access to sessions within their organization
14
+ */
15
+ export class OrgAdminSessionModule extends BaseClient {
16
+ getSessionsByUser(userId) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ return this.request(`${urls.sessions}/orgadmin/user/${userId}`, 'GET');
19
+ });
20
+ }
21
+ getSessionsByOrganization(limit = 100, offset = 0) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const params = new URLSearchParams();
24
+ params.append('limit', limit.toString());
25
+ params.append('offset', offset.toString());
26
+ return this.request(`${urls.sessions}/orgadmin/organization?${params.toString()}`, 'GET');
27
+ });
28
+ }
29
+ searchSessions(filters = {}) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ const params = this.buildSearchParams(filters);
32
+ const queryString = params.toString();
33
+ const url = queryString ? `${urls.sessions}/orgadmin/search?${queryString}` : `${urls.sessions}/orgadmin/search`;
34
+ return this.request(url, 'GET');
35
+ });
36
+ }
37
+ updateSession(id, sessionData) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return this.request(`${urls.sessions}/orgadmin/${id}`, 'PATCH', sessionData);
40
+ });
41
+ }
42
+ deleteSession(id) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ yield this.request(`${urls.sessions}/orgadmin/${id}`, 'DELETE');
45
+ });
46
+ }
47
+ setPrimaryTranscriptionSummary(sessionId, summaryId) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ return this.request(`${urls.sessions}/orgadmin/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
50
+ });
51
+ }
52
+ getSession(id) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ return this.request(`${urls.sessions}/${id}`, 'GET');
55
+ });
56
+ }
57
+ buildSearchParams(filters) {
58
+ const params = new URLSearchParams();
59
+ if (filters.startDate)
60
+ params.append('startDate', filters.startDate);
61
+ if (filters.endDate)
62
+ params.append('endDate', filters.endDate);
63
+ if (filters.userId)
64
+ params.append('userId', filters.userId);
65
+ if (filters.userEmail)
66
+ params.append('userEmail', filters.userEmail);
67
+ if (filters.patientName)
68
+ params.append('patientName', filters.patientName);
69
+ if (filters.templateName)
70
+ params.append('templateName', filters.templateName);
71
+ if (filters.templateId)
72
+ params.append('templateId', filters.templateId);
73
+ if (filters.hasSummary !== undefined)
74
+ params.append('hasSummary', filters.hasSummary.toString());
75
+ if (filters.includeTranscriptions !== undefined)
76
+ params.append('includeTranscriptions', filters.includeTranscriptions.toString());
77
+ if (filters.limit !== undefined)
78
+ params.append('limit', filters.limit.toString());
79
+ if (filters.offset !== undefined)
80
+ params.append('offset', filters.offset.toString());
81
+ return params;
82
+ }
83
+ }
@@ -0,0 +1,21 @@
1
+ import { BaseClient } from '../base-client';
2
+ import { Session, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse, SearchSessionsDto, SearchSessionsResponse } from '../../types';
3
+ /**
4
+ * Session module for regular users - provides access to own sessions only
5
+ */
6
+ export declare class SessionModule extends BaseClient {
7
+ createSession(sessionData: CreateSessionDto): Promise<Session>;
8
+ getSessions(): Promise<Session[]>;
9
+ getSession(id: string): Promise<Session>;
10
+ updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
11
+ deleteSession(id: string): Promise<void>;
12
+ setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
13
+ rerunTranscription(sessionId: string): Promise<{
14
+ message: string;
15
+ sessionId: string;
16
+ }>;
17
+ setAudioStreamStatus(data: SetAudioStreamStatusDto): Promise<Session>;
18
+ forwardToTiaki(sessionId: string): Promise<ForwardToTiakiResponse>;
19
+ searchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
20
+ protected buildSearchParams(filters: SearchSessionsDto): URLSearchParams;
21
+ }
@@ -0,0 +1,95 @@
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 '../base-client';
11
+ import urls from '../../urls';
12
+ /**
13
+ * Session module for regular users - provides access to own sessions only
14
+ */
15
+ export class SessionModule extends BaseClient {
16
+ createSession(sessionData) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ return this.request(urls.sessions, 'POST', sessionData);
19
+ });
20
+ }
21
+ getSessions() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ return this.request(`${urls.sessions}/my-sessions`, 'GET');
24
+ });
25
+ }
26
+ getSession(id) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return this.request(`${urls.sessions}/${id}`, 'GET');
29
+ });
30
+ }
31
+ updateSession(id, sessionData) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ return this.request(`${urls.sessions}/${id}`, 'PATCH', sessionData);
34
+ });
35
+ }
36
+ deleteSession(id) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ yield this.request(`${urls.sessions}/${id}`, 'DELETE');
39
+ });
40
+ }
41
+ setPrimaryTranscriptionSummary(sessionId, summaryId) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ return this.request(`${urls.sessions}/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
44
+ });
45
+ }
46
+ rerunTranscription(sessionId) {
47
+ return __awaiter(this, void 0, void 0, function* () {
48
+ return this.request(`${urls.sessions}/${sessionId}/rerun-transcription`, 'POST');
49
+ });
50
+ }
51
+ setAudioStreamStatus(data) {
52
+ return __awaiter(this, void 0, void 0, function* () {
53
+ return this.request(`${urls.sessions}/set-audio-stream-status`, 'PATCH', data);
54
+ });
55
+ }
56
+ forwardToTiaki(sessionId) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return this.request(`${urls.sessions}/forward-to-tiaki/${sessionId}`, 'POST');
59
+ });
60
+ }
61
+ searchSessions(filters = {}) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ const params = this.buildSearchParams(filters);
64
+ const queryString = params.toString();
65
+ const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
66
+ return this.request(url, 'GET');
67
+ });
68
+ }
69
+ buildSearchParams(filters) {
70
+ const params = new URLSearchParams();
71
+ if (filters.startDate)
72
+ params.append('startDate', filters.startDate);
73
+ if (filters.endDate)
74
+ params.append('endDate', filters.endDate);
75
+ if (filters.userId)
76
+ params.append('userId', filters.userId);
77
+ if (filters.userEmail)
78
+ params.append('userEmail', filters.userEmail);
79
+ if (filters.patientName)
80
+ params.append('patientName', filters.patientName);
81
+ if (filters.templateName)
82
+ params.append('templateName', filters.templateName);
83
+ if (filters.templateId)
84
+ params.append('templateId', filters.templateId);
85
+ if (filters.hasSummary !== undefined)
86
+ params.append('hasSummary', filters.hasSummary.toString());
87
+ if (filters.includeTranscriptions !== undefined)
88
+ params.append('includeTranscriptions', filters.includeTranscriptions.toString());
89
+ if (filters.limit !== undefined)
90
+ params.append('limit', filters.limit.toString());
91
+ if (filters.offset !== undefined)
92
+ params.append('offset', filters.offset.toString());
93
+ return params;
94
+ }
95
+ }
@@ -0,0 +1,15 @@
1
+ import { BaseClient } from '../base-client';
2
+ import { Session, SessionsResponse, UpdateSessionDto, SearchSessionsDto, SearchSessionsResponse } from '../../types';
3
+ /**
4
+ * Session module for superusers - provides access to all sessions across the system
5
+ */
6
+ export declare class SuperuserSessionModule extends BaseClient {
7
+ getSessionsByUser(userId: string): Promise<Session[]>;
8
+ getSessionsByOrganization(limit?: number, offset?: number): Promise<SessionsResponse>;
9
+ searchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
10
+ updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
11
+ deleteSession(id: string): Promise<void>;
12
+ setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
13
+ getSession(id: string): Promise<Session>;
14
+ private buildSearchParams;
15
+ }
@@ -0,0 +1,83 @@
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 '../base-client';
11
+ import urls from '../../urls';
12
+ /**
13
+ * Session module for superusers - provides access to all sessions across the system
14
+ */
15
+ export class SuperuserSessionModule extends BaseClient {
16
+ getSessionsByUser(userId) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ return this.request(`${urls.sessions}/superuser/user/${userId}`, 'GET');
19
+ });
20
+ }
21
+ getSessionsByOrganization(limit = 100, offset = 0) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const params = new URLSearchParams();
24
+ params.append('limit', limit.toString());
25
+ params.append('offset', offset.toString());
26
+ return this.request(`${urls.sessions}/organization?${params.toString()}`, 'GET');
27
+ });
28
+ }
29
+ searchSessions(filters = {}) {
30
+ return __awaiter(this, void 0, void 0, function* () {
31
+ const params = this.buildSearchParams(filters);
32
+ const queryString = params.toString();
33
+ const url = queryString ? `${urls.sessions}/superuser/search?${queryString}` : `${urls.sessions}/superuser/search`;
34
+ return this.request(url, 'GET');
35
+ });
36
+ }
37
+ updateSession(id, sessionData) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return this.request(`${urls.sessions}/superuser/${id}`, 'PATCH', sessionData);
40
+ });
41
+ }
42
+ deleteSession(id) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ yield this.request(`${urls.sessions}/superuser/${id}`, 'DELETE');
45
+ });
46
+ }
47
+ setPrimaryTranscriptionSummary(sessionId, summaryId) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ return this.request(`${urls.sessions}/superuser/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
50
+ });
51
+ }
52
+ getSession(id) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ return this.request(`${urls.sessions}/${id}`, 'GET');
55
+ });
56
+ }
57
+ buildSearchParams(filters) {
58
+ const params = new URLSearchParams();
59
+ if (filters.startDate)
60
+ params.append('startDate', filters.startDate);
61
+ if (filters.endDate)
62
+ params.append('endDate', filters.endDate);
63
+ if (filters.userId)
64
+ params.append('userId', filters.userId);
65
+ if (filters.userEmail)
66
+ params.append('userEmail', filters.userEmail);
67
+ if (filters.patientName)
68
+ params.append('patientName', filters.patientName);
69
+ if (filters.templateName)
70
+ params.append('templateName', filters.templateName);
71
+ if (filters.templateId)
72
+ params.append('templateId', filters.templateId);
73
+ if (filters.hasSummary !== undefined)
74
+ params.append('hasSummary', filters.hasSummary.toString());
75
+ if (filters.includeTranscriptions !== undefined)
76
+ params.append('includeTranscriptions', filters.includeTranscriptions.toString());
77
+ if (filters.limit !== undefined)
78
+ params.append('limit', filters.limit.toString());
79
+ if (filters.offset !== undefined)
80
+ params.append('offset', filters.offset.toString());
81
+ return params;
82
+ }
83
+ }
@@ -4,8 +4,6 @@ export declare class SessionModule extends BaseClient {
4
4
  createSession(sessionData: CreateSessionDto): Promise<Session>;
5
5
  getSessions(): Promise<Session[]>;
6
6
  getSession(id: string): Promise<Session>;
7
- getSessionsByUser(userId: string): Promise<Session[]>;
8
- getSessionsByOrganization(limit?: number, offset?: number): Promise<SessionsResponse>;
9
7
  updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
10
8
  deleteSession(id: string): Promise<void>;
11
9
  setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
@@ -16,4 +14,17 @@ export declare class SessionModule extends BaseClient {
16
14
  setAudioStreamStatus(data: SetAudioStreamStatusDto): Promise<Session>;
17
15
  forwardToTiaki(sessionId: string): Promise<ForwardToTiakiResponse>;
18
16
  searchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
17
+ superuserGetSessionsByUser(userId: string): Promise<Session[]>;
18
+ superuserGetSessionsByOrganization(limit?: number, offset?: number): Promise<SessionsResponse>;
19
+ superuserSearchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
20
+ superuserUpdateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
21
+ superuserDeleteSession(id: string): Promise<void>;
22
+ superuserSetPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
23
+ orgAdminGetSessionsByUser(userId: string): Promise<Session[]>;
24
+ orgAdminGetSessionsByOrganization(limit?: number, offset?: number): Promise<SessionsResponse>;
25
+ orgAdminSearchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
26
+ orgAdminUpdateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
27
+ orgAdminDeleteSession(id: string): Promise<void>;
28
+ orgAdminSetPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
29
+ private buildSearchParams;
19
30
  }
@@ -10,6 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { BaseClient } from './base-client';
11
11
  import urls from '../urls';
12
12
  export class SessionModule extends BaseClient {
13
+ // ======================
14
+ // USER METHODS (own sessions only)
15
+ // ======================
13
16
  createSession(sessionData) {
14
17
  return __awaiter(this, void 0, void 0, function* () {
15
18
  return this.request(urls.sessions, 'POST', sessionData);
@@ -25,19 +28,6 @@ export class SessionModule extends BaseClient {
25
28
  return this.request(`${urls.sessions}/${id}`, 'GET');
26
29
  });
27
30
  }
28
- getSessionsByUser(userId) {
29
- return __awaiter(this, void 0, void 0, function* () {
30
- return this.request(`${urls.sessions}/user/${userId}`, 'GET');
31
- });
32
- }
33
- getSessionsByOrganization(limit = 100, offset = 0) {
34
- return __awaiter(this, void 0, void 0, function* () {
35
- const params = new URLSearchParams();
36
- params.append('limit', limit.toString());
37
- params.append('offset', offset.toString());
38
- return this.request(`${urls.sessions}/organization?${params.toString()}`, 'GET');
39
- });
40
- }
41
31
  updateSession(id, sessionData) {
42
32
  return __awaiter(this, void 0, void 0, function* () {
43
33
  return this.request(`${urls.sessions}/${id}`, 'PATCH', sessionData);
@@ -70,32 +60,117 @@ export class SessionModule extends BaseClient {
70
60
  }
71
61
  searchSessions(filters = {}) {
72
62
  return __awaiter(this, void 0, void 0, function* () {
73
- const params = new URLSearchParams();
74
- if (filters.startDate)
75
- params.append('startDate', filters.startDate);
76
- if (filters.endDate)
77
- params.append('endDate', filters.endDate);
78
- if (filters.userId)
79
- params.append('userId', filters.userId);
80
- if (filters.userEmail)
81
- params.append('userEmail', filters.userEmail);
82
- if (filters.patientName)
83
- params.append('patientName', filters.patientName);
84
- if (filters.templateName)
85
- params.append('templateName', filters.templateName);
86
- if (filters.templateId)
87
- params.append('templateId', filters.templateId);
88
- if (filters.hasSummary !== undefined)
89
- params.append('hasSummary', filters.hasSummary.toString());
90
- if (filters.includeTranscriptions !== undefined)
91
- params.append('includeTranscriptions', filters.includeTranscriptions.toString());
92
- if (filters.limit !== undefined)
93
- params.append('limit', filters.limit.toString());
94
- if (filters.offset !== undefined)
95
- params.append('offset', filters.offset.toString());
63
+ const params = this.buildSearchParams(filters);
96
64
  const queryString = params.toString();
97
65
  const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
98
66
  return this.request(url, 'GET');
99
67
  });
100
68
  }
69
+ // ======================
70
+ // SUPERUSER METHODS
71
+ // ======================
72
+ superuserGetSessionsByUser(userId) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ return this.request(`${urls.sessions}/superuser/user/${userId}`, 'GET');
75
+ });
76
+ }
77
+ superuserGetSessionsByOrganization(limit = 100, offset = 0) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ const params = new URLSearchParams();
80
+ params.append('limit', limit.toString());
81
+ params.append('offset', offset.toString());
82
+ return this.request(`${urls.sessions}/organization?${params.toString()}`, 'GET');
83
+ });
84
+ }
85
+ superuserSearchSessions(filters = {}) {
86
+ return __awaiter(this, void 0, void 0, function* () {
87
+ const params = this.buildSearchParams(filters);
88
+ const queryString = params.toString();
89
+ const url = queryString ? `${urls.sessions}/superuser/search?${queryString}` : `${urls.sessions}/superuser/search`;
90
+ return this.request(url, 'GET');
91
+ });
92
+ }
93
+ superuserUpdateSession(id, sessionData) {
94
+ return __awaiter(this, void 0, void 0, function* () {
95
+ return this.request(`${urls.sessions}/superuser/${id}`, 'PATCH', sessionData);
96
+ });
97
+ }
98
+ superuserDeleteSession(id) {
99
+ return __awaiter(this, void 0, void 0, function* () {
100
+ yield this.request(`${urls.sessions}/superuser/${id}`, 'DELETE');
101
+ });
102
+ }
103
+ superuserSetPrimaryTranscriptionSummary(sessionId, summaryId) {
104
+ return __awaiter(this, void 0, void 0, function* () {
105
+ return this.request(`${urls.sessions}/superuser/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
106
+ });
107
+ }
108
+ // ======================
109
+ // ORG ADMIN METHODS
110
+ // ======================
111
+ orgAdminGetSessionsByUser(userId) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ return this.request(`${urls.sessions}/orgadmin/user/${userId}`, 'GET');
114
+ });
115
+ }
116
+ orgAdminGetSessionsByOrganization(limit = 100, offset = 0) {
117
+ return __awaiter(this, void 0, void 0, function* () {
118
+ const params = new URLSearchParams();
119
+ params.append('limit', limit.toString());
120
+ params.append('offset', offset.toString());
121
+ return this.request(`${urls.sessions}/orgadmin/organization?${params.toString()}`, 'GET');
122
+ });
123
+ }
124
+ orgAdminSearchSessions(filters = {}) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const params = this.buildSearchParams(filters);
127
+ const queryString = params.toString();
128
+ const url = queryString ? `${urls.sessions}/orgadmin/search?${queryString}` : `${urls.sessions}/orgadmin/search`;
129
+ return this.request(url, 'GET');
130
+ });
131
+ }
132
+ orgAdminUpdateSession(id, sessionData) {
133
+ return __awaiter(this, void 0, void 0, function* () {
134
+ return this.request(`${urls.sessions}/orgadmin/${id}`, 'PATCH', sessionData);
135
+ });
136
+ }
137
+ orgAdminDeleteSession(id) {
138
+ return __awaiter(this, void 0, void 0, function* () {
139
+ yield this.request(`${urls.sessions}/orgadmin/${id}`, 'DELETE');
140
+ });
141
+ }
142
+ orgAdminSetPrimaryTranscriptionSummary(sessionId, summaryId) {
143
+ return __awaiter(this, void 0, void 0, function* () {
144
+ return this.request(`${urls.sessions}/orgadmin/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
145
+ });
146
+ }
147
+ // ======================
148
+ // HELPER METHODS
149
+ // ======================
150
+ buildSearchParams(filters) {
151
+ const params = new URLSearchParams();
152
+ if (filters.startDate)
153
+ params.append('startDate', filters.startDate);
154
+ if (filters.endDate)
155
+ params.append('endDate', filters.endDate);
156
+ if (filters.userId)
157
+ params.append('userId', filters.userId);
158
+ if (filters.userEmail)
159
+ params.append('userEmail', filters.userEmail);
160
+ if (filters.patientName)
161
+ params.append('patientName', filters.patientName);
162
+ if (filters.templateName)
163
+ params.append('templateName', filters.templateName);
164
+ if (filters.templateId)
165
+ params.append('templateId', filters.templateId);
166
+ if (filters.hasSummary !== undefined)
167
+ params.append('hasSummary', filters.hasSummary.toString());
168
+ if (filters.includeTranscriptions !== undefined)
169
+ params.append('includeTranscriptions', filters.includeTranscriptions.toString());
170
+ if (filters.limit !== undefined)
171
+ params.append('limit', filters.limit.toString());
172
+ if (filters.offset !== undefined)
173
+ params.append('offset', filters.offset.toString());
174
+ return params;
175
+ }
101
176
  }
@@ -1,5 +1,5 @@
1
1
  import { BaseClient } from './base-client';
2
- import { Template, TemplateCategory, UserTemplate, TranscriptionAudioUploadResponse } from '../types';
2
+ import { Template, TemplateCategory, TranscriptionAudioUploadResponse } from '../types';
3
3
  export declare class TemplateModule extends BaseClient {
4
4
  createTemplate(title: string, content: string, categoryId?: string, workflowId?: string, agentId?: string): Promise<Template>;
5
5
  updateTemplate(title: string, content: string, id: string, workflowId?: string, agentId?: string): Promise<Template>;
@@ -10,18 +10,11 @@ export declare class TemplateModule extends BaseClient {
10
10
  setTemplateIntegrationActions(templateId: string, integrationActionIds: string[]): Promise<Template>;
11
11
  addTemplateIntegrationActions(templateId: string, integrationActionIds: string[]): Promise<Template>;
12
12
  removeTemplateIntegrationActions(templateId: string, integrationActionIds: string[]): Promise<Template>;
13
- createUserTemplate(title: string, content: string, originalTemplateId: string | undefined): Promise<UserTemplate>;
14
- updateUserTemplate(title: string, content: string, id: string): Promise<UserTemplate>;
15
- getUserTemplates(): Promise<UserTemplate[]>;
16
- getUserTemplate(id: string): Promise<UserTemplate>;
17
- deleteUserTemplate(id: string): Promise<void>;
18
13
  getTemplateCategories(): Promise<TemplateCategory[]>;
19
14
  getTemplateCategory(id: string): Promise<TemplateCategory>;
20
15
  createTemplateCategory(name: string): Promise<TemplateCategory>;
21
16
  updateTemplateCategory(id: string, name: string): Promise<TemplateCategory>;
22
17
  deleteTemplateCategory(id: string): Promise<void>;
23
- assignTemplateToTeam(teamId: string, templateId: string): Promise<void>;
24
- removeTemplateFromTeam(teamId: string, templateId: string): Promise<void>;
25
18
  uploadLargeAudioFile(formData: FormData, onProgress?: (percentage: number) => void): Promise<string>;
26
19
  uploadAudioFile(formData: FormData, onProgress?: (percentage: number) => void): Promise<TranscriptionAudioUploadResponse | null>;
27
20
  transcribeBase64Audio(base64String: string): Promise<string>;