whio-api-sdk 1.1.18 → 1.1.21
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/session.module.d.ts +2 -1
- package/dist/src/sdk/modules/session.module.js +30 -0
- package/dist/src/sdk/modules/tiaki.module.d.ts +11 -0
- package/dist/src/sdk/modules/tiaki.module.js +24 -0
- package/dist/src/sdk/sdk.d.ts +4 -0
- package/dist/src/sdk/sdk.js +14 -0
- package/dist/src/sdk/types/index.d.ts +1 -0
- package/dist/src/sdk/types/index.js +1 -0
- package/dist/src/sdk/types/session.types.d.ts +49 -1
- package/dist/src/sdk/types/tiaki.types.d.ts +24 -0
- package/dist/src/sdk/types/tiaki.types.js +1 -0
- package/dist/src/sdk/urls.d.ts +1 -0
- package/dist/src/sdk/urls.js +2 -0
- package/package.json +1 -1
- package/src/sdk/modules/session.module.ts +20 -1
- package/src/sdk/modules/tiaki.module.ts +24 -0
- package/src/sdk/sdk.ts +13 -0
- package/src/sdk/types/index.ts +1 -0
- package/src/sdk/types/session.types.ts +49 -1
- package/src/sdk/types/tiaki.types.ts +25 -0
- package/src/sdk/urls.ts +3 -0
- package/src/sdk/types.old.ts +0 -649
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './base-client';
|
|
2
|
-
import { Session, SessionsResponse, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse } from '../types';
|
|
2
|
+
import { Session, SessionsResponse, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse, SearchSessionsDto, SearchSessionsResponse } from '../types';
|
|
3
3
|
export declare class SessionModule extends BaseClient {
|
|
4
4
|
createSession(sessionData: CreateSessionDto): Promise<Session>;
|
|
5
5
|
getSessions(): Promise<Session[]>;
|
|
@@ -15,4 +15,5 @@ export declare class SessionModule extends BaseClient {
|
|
|
15
15
|
}>;
|
|
16
16
|
setAudioStreamStatus(data: SetAudioStreamStatusDto): Promise<Session>;
|
|
17
17
|
forwardToTiaki(sessionId: string): Promise<ForwardToTiakiResponse>;
|
|
18
|
+
searchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
|
|
18
19
|
}
|
|
@@ -68,4 +68,34 @@ export class SessionModule extends BaseClient {
|
|
|
68
68
|
return this.request(`${urls.sessions}/forward-to-tiaki/${sessionId}`, 'POST');
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
|
+
searchSessions(filters = {}) {
|
|
72
|
+
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());
|
|
96
|
+
const queryString = params.toString();
|
|
97
|
+
const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
|
|
98
|
+
return this.request(url, 'GET');
|
|
99
|
+
});
|
|
100
|
+
}
|
|
71
101
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BaseClient } from './base-client';
|
|
2
|
+
import { CreateTiakiCalendarEventDto, TiakiCalendarEventResponse } from '../types';
|
|
3
|
+
export declare class TiakiModule extends BaseClient {
|
|
4
|
+
/**
|
|
5
|
+
* Create a calendar event in Tiaki
|
|
6
|
+
* The tiaki_midwife_id is automatically added from the authenticated user's customFields
|
|
7
|
+
* @param eventData - The calendar event data
|
|
8
|
+
* @returns Response with success status and optional message
|
|
9
|
+
*/
|
|
10
|
+
createCalendarEvent(eventData: CreateTiakiCalendarEventDto): Promise<TiakiCalendarEventResponse>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
export class TiakiModule extends BaseClient {
|
|
13
|
+
/**
|
|
14
|
+
* Create a calendar event in Tiaki
|
|
15
|
+
* The tiaki_midwife_id is automatically added from the authenticated user's customFields
|
|
16
|
+
* @param eventData - The calendar event data
|
|
17
|
+
* @returns Response with success status and optional message
|
|
18
|
+
*/
|
|
19
|
+
createCalendarEvent(eventData) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
return this.request(urls.tiakiCalendarEvents, 'POST', eventData);
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
}
|
package/dist/src/sdk/sdk.d.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { PatientModule } from './modules/patient.module';
|
|
|
20
20
|
import { DataStrategyModule } from './modules/data-strategy.module';
|
|
21
21
|
import { SystemSnapshotModule } from './modules/system-snapshot.module';
|
|
22
22
|
import { RatingModule } from './modules/rating.module';
|
|
23
|
+
import { TiakiModule } from './modules/tiaki.module';
|
|
23
24
|
/**
|
|
24
25
|
* Main SDK class that provides access to all domain-specific modules
|
|
25
26
|
*/
|
|
@@ -44,6 +45,7 @@ export declare class ApiSDK extends BaseClient {
|
|
|
44
45
|
readonly dataStrategies: DataStrategyModule;
|
|
45
46
|
readonly systemSnapshots: SystemSnapshotModule;
|
|
46
47
|
readonly ratings: RatingModule;
|
|
48
|
+
readonly tiaki: TiakiModule;
|
|
47
49
|
private modules;
|
|
48
50
|
private sdkInitialized;
|
|
49
51
|
constructor(config?: SDKConfig);
|
|
@@ -138,6 +140,7 @@ export declare class ApiSDK extends BaseClient {
|
|
|
138
140
|
}>;
|
|
139
141
|
setAudioStreamStatus(...args: Parameters<SessionModule['setAudioStreamStatus']>): Promise<import("./types").Session>;
|
|
140
142
|
forwardToTiaki(...args: Parameters<SessionModule['forwardToTiaki']>): Promise<import("./types").ForwardToTiakiResponse>;
|
|
143
|
+
searchSessions(...args: Parameters<SessionModule['searchSessions']>): Promise<import("./types").SearchSessionsResponse>;
|
|
141
144
|
createAgent(...args: Parameters<AgentModule['createAgent']>): Promise<import("./types").Agent>;
|
|
142
145
|
getAgents(...args: Parameters<AgentModule['getAgents']>): Promise<import("./types").Agent[]>;
|
|
143
146
|
getAgent(...args: Parameters<AgentModule['getAgent']>): Promise<import("./types").Agent>;
|
|
@@ -244,4 +247,5 @@ export declare class ApiSDK extends BaseClient {
|
|
|
244
247
|
getRatingsByDateRange(...args: Parameters<RatingModule['getRatingsByDateRange']>): Promise<import("./types").SummaryRatingsResponse>;
|
|
245
248
|
getRatingsBySession(...args: Parameters<RatingModule['getRatingsBySession']>): Promise<import("./types").SummaryRatingsResponse>;
|
|
246
249
|
getRatingsByTemplate(...args: Parameters<RatingModule['getRatingsByTemplate']>): Promise<import("./types").SummaryRatingsResponse>;
|
|
250
|
+
createTiakiCalendarEvent(...args: Parameters<TiakiModule['createCalendarEvent']>): Promise<import("./types").TiakiCalendarEventResponse>;
|
|
247
251
|
}
|
package/dist/src/sdk/sdk.js
CHANGED
|
@@ -28,6 +28,7 @@ import { PatientModule } from './modules/patient.module';
|
|
|
28
28
|
import { DataStrategyModule } from './modules/data-strategy.module';
|
|
29
29
|
import { SystemSnapshotModule } from './modules/system-snapshot.module';
|
|
30
30
|
import { RatingModule } from './modules/rating.module';
|
|
31
|
+
import { TiakiModule } from './modules/tiaki.module';
|
|
31
32
|
/**
|
|
32
33
|
* Main SDK class that provides access to all domain-specific modules
|
|
33
34
|
*/
|
|
@@ -56,12 +57,14 @@ export class ApiSDK extends BaseClient {
|
|
|
56
57
|
this.dataStrategies = new DataStrategyModule(config);
|
|
57
58
|
this.systemSnapshots = new SystemSnapshotModule(config);
|
|
58
59
|
this.ratings = new RatingModule(config);
|
|
60
|
+
this.tiaki = new TiakiModule(config);
|
|
59
61
|
// Store all modules for batch operations
|
|
60
62
|
this.modules = [
|
|
61
63
|
this.auth, this.users, this.organizations, this.teams, this.templates,
|
|
62
64
|
this.transcriptionSummaries, this.sessions, this.agents, this.audio,
|
|
63
65
|
this.workflows, this.integrationActions, this.logs, this.debug, this.externalIntegrations,
|
|
64
66
|
this.reports, this.patients, this.dataStrategies, this.systemSnapshots, this.ratings,
|
|
67
|
+
this.tiaki,
|
|
65
68
|
...(this.websocket ? [this.websocket] : [])
|
|
66
69
|
];
|
|
67
70
|
// Auto-initialize the SDK
|
|
@@ -528,6 +531,11 @@ export class ApiSDK extends BaseClient {
|
|
|
528
531
|
return this.sessions.forwardToTiaki(...args);
|
|
529
532
|
});
|
|
530
533
|
}
|
|
534
|
+
searchSessions(...args) {
|
|
535
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
536
|
+
return this.sessions.searchSessions(...args);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
531
539
|
// Agent methods
|
|
532
540
|
createAgent(...args) {
|
|
533
541
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1012,4 +1020,10 @@ export class ApiSDK extends BaseClient {
|
|
|
1012
1020
|
return this.ratings.getRatingsByTemplate(...args);
|
|
1013
1021
|
});
|
|
1014
1022
|
}
|
|
1023
|
+
// Tiaki methods
|
|
1024
|
+
createTiakiCalendarEvent(...args) {
|
|
1025
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1026
|
+
return this.tiaki.createCalendarEvent(...args);
|
|
1027
|
+
});
|
|
1028
|
+
}
|
|
1015
1029
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { User } from './user.types';
|
|
2
2
|
import { Template, TranscriptionSummary } from './template.types';
|
|
3
|
-
import { AudioFile } from './audio.types';
|
|
3
|
+
import { AudioFile, Base64AudioFile } from './audio.types';
|
|
4
|
+
import { SummaryRating } from './rating.types';
|
|
4
5
|
import { SummaryStatus, AudioStreamStatus } from './common.types';
|
|
5
6
|
export interface Session {
|
|
6
7
|
id: string;
|
|
@@ -15,6 +16,7 @@ export interface Session {
|
|
|
15
16
|
sessionName?: string;
|
|
16
17
|
patientName?: string;
|
|
17
18
|
integrationMeta?: any;
|
|
19
|
+
generationMeta?: any;
|
|
18
20
|
summaryStatus: SummaryStatus;
|
|
19
21
|
audioStreamStatus: AudioStreamStatus;
|
|
20
22
|
createdAt: string;
|
|
@@ -30,6 +32,8 @@ export interface Session {
|
|
|
30
32
|
transcriptionSummaries?: TranscriptionSummary[];
|
|
31
33
|
primaryTranscriptionSummary?: TranscriptionSummary;
|
|
32
34
|
audioFiles?: AudioFile[];
|
|
35
|
+
base64AudioFiles?: Base64AudioFile[];
|
|
36
|
+
summaryRatings?: SummaryRating[];
|
|
33
37
|
}
|
|
34
38
|
export interface CreateSessionDto {
|
|
35
39
|
transcript: string;
|
|
@@ -59,6 +63,7 @@ export interface UpdateSessionDto {
|
|
|
59
63
|
sessionName?: string;
|
|
60
64
|
patientName?: string;
|
|
61
65
|
integrationMeta?: any;
|
|
66
|
+
generationMeta?: any;
|
|
62
67
|
summaryStatus?: SummaryStatus;
|
|
63
68
|
audioStreamStatus?: AudioStreamStatus;
|
|
64
69
|
primaryTranscriptionSummaryId?: string;
|
|
@@ -78,3 +83,46 @@ export interface SessionsResponse {
|
|
|
78
83
|
offset: number;
|
|
79
84
|
hasMore: boolean;
|
|
80
85
|
}
|
|
86
|
+
export interface SearchSessionsDto {
|
|
87
|
+
startDate?: string;
|
|
88
|
+
endDate?: string;
|
|
89
|
+
userId?: string;
|
|
90
|
+
userEmail?: string;
|
|
91
|
+
patientName?: string;
|
|
92
|
+
templateName?: string;
|
|
93
|
+
templateId?: string;
|
|
94
|
+
hasSummary?: boolean;
|
|
95
|
+
includeTranscriptions?: boolean;
|
|
96
|
+
limit?: number;
|
|
97
|
+
offset?: number;
|
|
98
|
+
}
|
|
99
|
+
export interface SearchSessionResult {
|
|
100
|
+
id: string;
|
|
101
|
+
sessionName?: string;
|
|
102
|
+
patientName?: string;
|
|
103
|
+
templateName?: string;
|
|
104
|
+
createdAt: string;
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
summaryStatus: SummaryStatus;
|
|
107
|
+
audioStreamStatus: AudioStreamStatus;
|
|
108
|
+
medicalTranscription: string | null;
|
|
109
|
+
culturalTranscription: string | null;
|
|
110
|
+
integrationMeta?: any;
|
|
111
|
+
generationMeta?: any;
|
|
112
|
+
templateId?: string;
|
|
113
|
+
userId: string;
|
|
114
|
+
primaryTranscriptionSummaryId?: string;
|
|
115
|
+
user?: User;
|
|
116
|
+
template?: {
|
|
117
|
+
id: string;
|
|
118
|
+
title: string;
|
|
119
|
+
};
|
|
120
|
+
primaryTranscriptionSummary?: TranscriptionSummary;
|
|
121
|
+
}
|
|
122
|
+
export interface SearchSessionsResponse {
|
|
123
|
+
sessions: SearchSessionResult[];
|
|
124
|
+
total: number;
|
|
125
|
+
limit: number;
|
|
126
|
+
offset: number;
|
|
127
|
+
hasMore: boolean;
|
|
128
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DTO for creating a calendar event in Tiaki
|
|
3
|
+
* The tiaki_midwife_id is automatically added from the authenticated user
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateTiakiCalendarEventDto {
|
|
6
|
+
tiaki_woman_id?: number;
|
|
7
|
+
location: string;
|
|
8
|
+
subject: string;
|
|
9
|
+
notes?: string;
|
|
10
|
+
start_time: string;
|
|
11
|
+
end_time: string;
|
|
12
|
+
start_date: string;
|
|
13
|
+
end_date: string;
|
|
14
|
+
appointment_type: string;
|
|
15
|
+
email_reminder?: boolean;
|
|
16
|
+
sms_reminder?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Response from creating a calendar event in Tiaki
|
|
20
|
+
*/
|
|
21
|
+
export interface TiakiCalendarEventResponse {
|
|
22
|
+
success: boolean;
|
|
23
|
+
message?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/sdk/urls.d.ts
CHANGED
package/dist/src/sdk/urls.js
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseClient } from './base-client';
|
|
2
|
-
import { Session, SessionsResponse, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse } from '../types';
|
|
2
|
+
import { Session, SessionsResponse, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse, SearchSessionsDto, SearchSessionsResponse } from '../types';
|
|
3
3
|
import urls from '../urls';
|
|
4
4
|
|
|
5
5
|
export class SessionModule extends BaseClient {
|
|
@@ -49,4 +49,23 @@ export class SessionModule extends BaseClient {
|
|
|
49
49
|
public async forwardToTiaki(sessionId: string): Promise<ForwardToTiakiResponse> {
|
|
50
50
|
return this.request<ForwardToTiakiResponse>(`${urls.sessions}/forward-to-tiaki/${sessionId}`, 'POST');
|
|
51
51
|
}
|
|
52
|
+
|
|
53
|
+
public async searchSessions(filters: SearchSessionsDto = {}): Promise<SearchSessionsResponse> {
|
|
54
|
+
const params = new URLSearchParams();
|
|
55
|
+
if (filters.startDate) params.append('startDate', filters.startDate);
|
|
56
|
+
if (filters.endDate) params.append('endDate', filters.endDate);
|
|
57
|
+
if (filters.userId) params.append('userId', filters.userId);
|
|
58
|
+
if (filters.userEmail) params.append('userEmail', filters.userEmail);
|
|
59
|
+
if (filters.patientName) params.append('patientName', filters.patientName);
|
|
60
|
+
if (filters.templateName) params.append('templateName', filters.templateName);
|
|
61
|
+
if (filters.templateId) params.append('templateId', filters.templateId);
|
|
62
|
+
if (filters.hasSummary !== undefined) params.append('hasSummary', filters.hasSummary.toString());
|
|
63
|
+
if (filters.includeTranscriptions !== undefined) params.append('includeTranscriptions', filters.includeTranscriptions.toString());
|
|
64
|
+
if (filters.limit !== undefined) params.append('limit', filters.limit.toString());
|
|
65
|
+
if (filters.offset !== undefined) params.append('offset', filters.offset.toString());
|
|
66
|
+
|
|
67
|
+
const queryString = params.toString();
|
|
68
|
+
const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
|
|
69
|
+
return this.request<SearchSessionsResponse>(url, 'GET');
|
|
70
|
+
}
|
|
52
71
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseClient } from './base-client';
|
|
2
|
+
import {
|
|
3
|
+
CreateTiakiCalendarEventDto,
|
|
4
|
+
TiakiCalendarEventResponse,
|
|
5
|
+
} from '../types';
|
|
6
|
+
import urls from '../urls';
|
|
7
|
+
|
|
8
|
+
export class TiakiModule extends BaseClient {
|
|
9
|
+
/**
|
|
10
|
+
* Create a calendar event in Tiaki
|
|
11
|
+
* The tiaki_midwife_id is automatically added from the authenticated user's customFields
|
|
12
|
+
* @param eventData - The calendar event data
|
|
13
|
+
* @returns Response with success status and optional message
|
|
14
|
+
*/
|
|
15
|
+
public async createCalendarEvent(
|
|
16
|
+
eventData: CreateTiakiCalendarEventDto,
|
|
17
|
+
): Promise<TiakiCalendarEventResponse> {
|
|
18
|
+
return this.request<TiakiCalendarEventResponse>(
|
|
19
|
+
urls.tiakiCalendarEvents,
|
|
20
|
+
'POST',
|
|
21
|
+
eventData,
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -21,6 +21,7 @@ import { PatientModule } from './modules/patient.module';
|
|
|
21
21
|
import { DataStrategyModule } from './modules/data-strategy.module';
|
|
22
22
|
import { SystemSnapshotModule } from './modules/system-snapshot.module';
|
|
23
23
|
import { RatingModule } from './modules/rating.module';
|
|
24
|
+
import { TiakiModule } from './modules/tiaki.module';
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
27
|
* Main SDK class that provides access to all domain-specific modules
|
|
@@ -46,6 +47,7 @@ export class ApiSDK extends BaseClient {
|
|
|
46
47
|
public readonly dataStrategies: DataStrategyModule;
|
|
47
48
|
public readonly systemSnapshots: SystemSnapshotModule;
|
|
48
49
|
public readonly ratings: RatingModule;
|
|
50
|
+
public readonly tiaki: TiakiModule;
|
|
49
51
|
|
|
50
52
|
private modules: BaseClient[];
|
|
51
53
|
private sdkInitialized: boolean = false;
|
|
@@ -74,6 +76,7 @@ export class ApiSDK extends BaseClient {
|
|
|
74
76
|
this.dataStrategies = new DataStrategyModule(config);
|
|
75
77
|
this.systemSnapshots = new SystemSnapshotModule(config);
|
|
76
78
|
this.ratings = new RatingModule(config);
|
|
79
|
+
this.tiaki = new TiakiModule(config);
|
|
77
80
|
|
|
78
81
|
// Store all modules for batch operations
|
|
79
82
|
this.modules = [
|
|
@@ -81,6 +84,7 @@ export class ApiSDK extends BaseClient {
|
|
|
81
84
|
this.transcriptionSummaries, this.sessions, this.agents, this.audio,
|
|
82
85
|
this.workflows, this.integrationActions, this.logs, this.debug, this.externalIntegrations,
|
|
83
86
|
this.reports, this.patients, this.dataStrategies, this.systemSnapshots, this.ratings,
|
|
87
|
+
this.tiaki,
|
|
84
88
|
...(this.websocket ? [this.websocket] : [])
|
|
85
89
|
];
|
|
86
90
|
|
|
@@ -476,6 +480,10 @@ export class ApiSDK extends BaseClient {
|
|
|
476
480
|
return this.sessions.forwardToTiaki(...args);
|
|
477
481
|
}
|
|
478
482
|
|
|
483
|
+
public async searchSessions(...args: Parameters<SessionModule['searchSessions']>) {
|
|
484
|
+
return this.sessions.searchSessions(...args);
|
|
485
|
+
}
|
|
486
|
+
|
|
479
487
|
// Agent methods
|
|
480
488
|
public async createAgent(...args: Parameters<AgentModule['createAgent']>) {
|
|
481
489
|
return this.agents.createAgent(...args);
|
|
@@ -883,4 +891,9 @@ export class ApiSDK extends BaseClient {
|
|
|
883
891
|
return this.ratings.getRatingsByTemplate(...args);
|
|
884
892
|
}
|
|
885
893
|
|
|
894
|
+
// Tiaki methods
|
|
895
|
+
public async createTiakiCalendarEvent(...args: Parameters<TiakiModule['createCalendarEvent']>) {
|
|
896
|
+
return this.tiaki.createCalendarEvent(...args);
|
|
897
|
+
}
|
|
898
|
+
|
|
886
899
|
}
|
package/src/sdk/types/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { User } from './user.types';
|
|
2
2
|
import { Template, TranscriptionSummary } from './template.types';
|
|
3
|
-
import { AudioFile } from './audio.types';
|
|
3
|
+
import { AudioFile, Base64AudioFile } from './audio.types';
|
|
4
|
+
import { SummaryRating } from './rating.types';
|
|
4
5
|
import { SummaryStatus, AudioStreamStatus } from './common.types';
|
|
5
6
|
|
|
6
7
|
// Session types
|
|
@@ -17,6 +18,7 @@ export interface Session {
|
|
|
17
18
|
sessionName?: string;
|
|
18
19
|
patientName?: string;
|
|
19
20
|
integrationMeta?: any;
|
|
21
|
+
generationMeta?: any;
|
|
20
22
|
summaryStatus: SummaryStatus;
|
|
21
23
|
audioStreamStatus: AudioStreamStatus;
|
|
22
24
|
createdAt: string;
|
|
@@ -36,6 +38,8 @@ export interface Session {
|
|
|
36
38
|
transcriptionSummaries?: TranscriptionSummary[];
|
|
37
39
|
primaryTranscriptionSummary?: TranscriptionSummary;
|
|
38
40
|
audioFiles?: AudioFile[];
|
|
41
|
+
base64AudioFiles?: Base64AudioFile[];
|
|
42
|
+
summaryRatings?: SummaryRating[];
|
|
39
43
|
}
|
|
40
44
|
|
|
41
45
|
// Session DTOs
|
|
@@ -68,6 +72,7 @@ export interface UpdateSessionDto {
|
|
|
68
72
|
sessionName?: string;
|
|
69
73
|
patientName?: string;
|
|
70
74
|
integrationMeta?: any;
|
|
75
|
+
generationMeta?: any;
|
|
71
76
|
summaryStatus?: SummaryStatus;
|
|
72
77
|
audioStreamStatus?: AudioStreamStatus;
|
|
73
78
|
primaryTranscriptionSummaryId?: string;
|
|
@@ -90,3 +95,46 @@ export interface SessionsResponse {
|
|
|
90
95
|
offset: number;
|
|
91
96
|
hasMore: boolean;
|
|
92
97
|
}
|
|
98
|
+
|
|
99
|
+
export interface SearchSessionsDto {
|
|
100
|
+
startDate?: string;
|
|
101
|
+
endDate?: string;
|
|
102
|
+
userId?: string;
|
|
103
|
+
userEmail?: string;
|
|
104
|
+
patientName?: string;
|
|
105
|
+
templateName?: string;
|
|
106
|
+
templateId?: string;
|
|
107
|
+
hasSummary?: boolean;
|
|
108
|
+
includeTranscriptions?: boolean;
|
|
109
|
+
limit?: number;
|
|
110
|
+
offset?: number;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface SearchSessionResult {
|
|
114
|
+
id: string;
|
|
115
|
+
sessionName?: string;
|
|
116
|
+
patientName?: string;
|
|
117
|
+
templateName?: string;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
updatedAt: string;
|
|
120
|
+
summaryStatus: SummaryStatus;
|
|
121
|
+
audioStreamStatus: AudioStreamStatus;
|
|
122
|
+
medicalTranscription: string | null;
|
|
123
|
+
culturalTranscription: string | null;
|
|
124
|
+
integrationMeta?: any;
|
|
125
|
+
generationMeta?: any;
|
|
126
|
+
templateId?: string;
|
|
127
|
+
userId: string;
|
|
128
|
+
primaryTranscriptionSummaryId?: string;
|
|
129
|
+
user?: User;
|
|
130
|
+
template?: { id: string; title: string };
|
|
131
|
+
primaryTranscriptionSummary?: TranscriptionSummary;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface SearchSessionsResponse {
|
|
135
|
+
sessions: SearchSessionResult[];
|
|
136
|
+
total: number;
|
|
137
|
+
limit: number;
|
|
138
|
+
offset: number;
|
|
139
|
+
hasMore: boolean;
|
|
140
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DTO for creating a calendar event in Tiaki
|
|
3
|
+
* The tiaki_midwife_id is automatically added from the authenticated user
|
|
4
|
+
*/
|
|
5
|
+
export interface CreateTiakiCalendarEventDto {
|
|
6
|
+
tiaki_woman_id?: number;
|
|
7
|
+
location: string;
|
|
8
|
+
subject: string;
|
|
9
|
+
notes?: string;
|
|
10
|
+
start_time: string;
|
|
11
|
+
end_time: string;
|
|
12
|
+
start_date: string;
|
|
13
|
+
end_date: string;
|
|
14
|
+
appointment_type: string;
|
|
15
|
+
email_reminder?: boolean;
|
|
16
|
+
sms_reminder?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Response from creating a calendar event in Tiaki
|
|
21
|
+
*/
|
|
22
|
+
export interface TiakiCalendarEventResponse {
|
|
23
|
+
success: boolean;
|
|
24
|
+
message?: string;
|
|
25
|
+
}
|
package/src/sdk/urls.ts
CHANGED
package/src/sdk/types.old.ts
DELETED
|
@@ -1,649 +0,0 @@
|
|
|
1
|
-
// types.ts
|
|
2
|
-
|
|
3
|
-
// Role type
|
|
4
|
-
export interface Role {
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
createdAt: string;
|
|
8
|
-
updatedAt: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
// Organization Role type
|
|
12
|
-
export interface OrganizationRole {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
createdAt: string;
|
|
16
|
-
updatedAt: string;
|
|
17
|
-
organizationId: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// User Role association
|
|
21
|
-
export interface UserRole {
|
|
22
|
-
userId: string;
|
|
23
|
-
roleId: string;
|
|
24
|
-
createdAt: string;
|
|
25
|
-
role: Role;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
// User Organization Role association
|
|
29
|
-
export interface UserOrganizationRole {
|
|
30
|
-
userId: string;
|
|
31
|
-
organizationRoleId: string;
|
|
32
|
-
createdAt: string;
|
|
33
|
-
organizationRole: OrganizationRole;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Organization type
|
|
37
|
-
export interface Organization {
|
|
38
|
-
id: string;
|
|
39
|
-
name: string;
|
|
40
|
-
description: string;
|
|
41
|
-
createdAt: string;
|
|
42
|
-
updatedAt: string;
|
|
43
|
-
|
|
44
|
-
users?: User[];
|
|
45
|
-
roles?: OrganizationRole[];
|
|
46
|
-
agents?: AgentOrganization[];
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
// User type
|
|
50
|
-
export interface User {
|
|
51
|
-
id: string;
|
|
52
|
-
email: string;
|
|
53
|
-
firstName: string;
|
|
54
|
-
lastName: string;
|
|
55
|
-
createdAt: string;
|
|
56
|
-
updatedAt: string;
|
|
57
|
-
organizationId: string;
|
|
58
|
-
organization: Organization;
|
|
59
|
-
roles: UserRole[];
|
|
60
|
-
organizationRoles: UserOrganizationRole[];
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Login response type
|
|
64
|
-
export interface LoginResponse {
|
|
65
|
-
access_token: string;
|
|
66
|
-
refresh_token: string;
|
|
67
|
-
user: User;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
// Login credentials type
|
|
71
|
-
export interface LoginCredentials {
|
|
72
|
-
email: string;
|
|
73
|
-
password: string;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// SDK configuration type
|
|
77
|
-
export interface SDKConfig {
|
|
78
|
-
baseUrl?: string;
|
|
79
|
-
storage?: {
|
|
80
|
-
getItem: (key: string) => string | null | Promise<string | null>;
|
|
81
|
-
setItem: (key: string, value: string) => void | Promise<void>;
|
|
82
|
-
removeItem: (key: string) => void | Promise<void>;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Team Role assignment DTO
|
|
87
|
-
export interface AssignTeamRoleDto {
|
|
88
|
-
userId: string;
|
|
89
|
-
teamId: string;
|
|
90
|
-
name: string;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Team creation DTO
|
|
94
|
-
export interface CreateTeamDto {
|
|
95
|
-
name: string;
|
|
96
|
-
description?: string;
|
|
97
|
-
organizationId: string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// Team update DTO
|
|
101
|
-
export interface UpdateTeamDto {
|
|
102
|
-
name?: string;
|
|
103
|
-
description?: string;
|
|
104
|
-
organizationId?: string;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Template creation DTO
|
|
108
|
-
export interface CreateTemplateDto {
|
|
109
|
-
title: string;
|
|
110
|
-
content: string;
|
|
111
|
-
isGlobal?: boolean;
|
|
112
|
-
organizationId: string;
|
|
113
|
-
categoryId: string;
|
|
114
|
-
createdById: string;
|
|
115
|
-
workflowId?: string;
|
|
116
|
-
agentId?: string;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// Template update DTO
|
|
120
|
-
export interface UpdateTemplateDto {
|
|
121
|
-
title?: string;
|
|
122
|
-
content?: string;
|
|
123
|
-
isGlobal?: boolean;
|
|
124
|
-
organizationId: string;
|
|
125
|
-
categoryId?: string;
|
|
126
|
-
workflowId?: string;
|
|
127
|
-
agentId?: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Transcription summary generation DTO
|
|
131
|
-
export interface GenerateTranscriptionSummaryDto {
|
|
132
|
-
templateId: string;
|
|
133
|
-
userId?: string;
|
|
134
|
-
fromUserTemplate?: boolean;
|
|
135
|
-
sessionId: string; // Required session ID for linking to a session
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Transcription summary update DTO
|
|
139
|
-
export interface UpdateTranscriptionSummaryDto {
|
|
140
|
-
anonymisedTranscript?: string;
|
|
141
|
-
content?: string;
|
|
142
|
-
metadata?: Record<string, any>;
|
|
143
|
-
templateId?: string;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
// Organization role assignment DTO
|
|
147
|
-
export interface AssignOrganizationRoleDto {
|
|
148
|
-
userId: string;
|
|
149
|
-
organizationRoleId: string;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// User template creation DTO
|
|
153
|
-
export interface CreateUserTemplateDto {
|
|
154
|
-
title: string;
|
|
155
|
-
content: string;
|
|
156
|
-
userId: string;
|
|
157
|
-
originalTemplateId?: string;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
// User template update DTO
|
|
161
|
-
export interface UpdateUserTemplateDto {
|
|
162
|
-
title?: string;
|
|
163
|
-
content?: string;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// User creation DTO
|
|
167
|
-
export interface CreateUserDto {
|
|
168
|
-
email: string;
|
|
169
|
-
password: string;
|
|
170
|
-
firstName?: string;
|
|
171
|
-
lastName?: string;
|
|
172
|
-
organizationId?: string;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
// User update DTO
|
|
176
|
-
export interface UpdateUserDto {
|
|
177
|
-
email?: string;
|
|
178
|
-
password?: string;
|
|
179
|
-
firstName?: string;
|
|
180
|
-
lastName?: string;
|
|
181
|
-
organizationId?: string;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export enum OrganizationRoleType {
|
|
185
|
-
ADMIN = 'ADMIN',
|
|
186
|
-
EDITOR = 'EDITOR',
|
|
187
|
-
DISABLED = 'DISABLED',
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
export interface AdminUser {
|
|
191
|
-
id: string;
|
|
192
|
-
email: string;
|
|
193
|
-
password_hash: string;
|
|
194
|
-
role: string;
|
|
195
|
-
created_at: Date;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
export interface TemplateCategory {
|
|
199
|
-
id: string;
|
|
200
|
-
name: string;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export interface Template {
|
|
204
|
-
id: string;
|
|
205
|
-
title: string;
|
|
206
|
-
content: string;
|
|
207
|
-
createdAt: string;
|
|
208
|
-
updatesAt: string;
|
|
209
|
-
isGlobal: boolean;
|
|
210
|
-
organizationId?: string;
|
|
211
|
-
categoryId: string;
|
|
212
|
-
createdById: string;
|
|
213
|
-
workflowId?: string;
|
|
214
|
-
agentId?: string;
|
|
215
|
-
|
|
216
|
-
organization?: Organization;
|
|
217
|
-
category?: TemplateCategory;
|
|
218
|
-
createdBy?: User;
|
|
219
|
-
workflow?: Workflow;
|
|
220
|
-
agent?: Agent;
|
|
221
|
-
userTemplates?: UserTemplate[];
|
|
222
|
-
transcriptionSummaries?: TranscriptionSummary[];
|
|
223
|
-
teamTemplates?: TeamTemplate[];
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
export interface UserTemplate {
|
|
227
|
-
id: string;
|
|
228
|
-
title: string;
|
|
229
|
-
content: string;
|
|
230
|
-
createdAt: string;
|
|
231
|
-
updatesAt: string;
|
|
232
|
-
userId: string;
|
|
233
|
-
originalTemplateId?: string;
|
|
234
|
-
|
|
235
|
-
user?: User;
|
|
236
|
-
originalTemplate?: Template;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export interface TranscriptionSummary {
|
|
240
|
-
id: string;
|
|
241
|
-
anonymisedTranscript?: string;
|
|
242
|
-
content: string;
|
|
243
|
-
metadata?: any;
|
|
244
|
-
createdAt: string;
|
|
245
|
-
updatesAt: string;
|
|
246
|
-
templateId: string;
|
|
247
|
-
userId: string;
|
|
248
|
-
|
|
249
|
-
template?: Template;
|
|
250
|
-
user?: User;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
export interface TeamTemplate {
|
|
254
|
-
teamId: string;
|
|
255
|
-
templateId: string;
|
|
256
|
-
createdAt: string;
|
|
257
|
-
|
|
258
|
-
team?: Team;
|
|
259
|
-
template?: Template;
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
export interface TeamRole {
|
|
263
|
-
id: string;
|
|
264
|
-
name: string;
|
|
265
|
-
createdAt: string;
|
|
266
|
-
updatesAt: string;
|
|
267
|
-
userId: string;
|
|
268
|
-
teamId: string;
|
|
269
|
-
|
|
270
|
-
user?: User;
|
|
271
|
-
team?: Team;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export interface Team {
|
|
275
|
-
id: string;
|
|
276
|
-
name: string;
|
|
277
|
-
description?: string;
|
|
278
|
-
createdAt: string;
|
|
279
|
-
updatesAt: string;
|
|
280
|
-
organizationId: string;
|
|
281
|
-
|
|
282
|
-
organization?: Organization;
|
|
283
|
-
teamRoles?: TeamRole[];
|
|
284
|
-
teamTemplates?: TeamTemplate[];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export interface TranscriptionAudioUploadResponse {
|
|
288
|
-
success: boolean;
|
|
289
|
-
transcription: string;
|
|
290
|
-
model_version: string;
|
|
291
|
-
metadata: any[];
|
|
292
|
-
duration: number;
|
|
293
|
-
log: string;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
// Additional DTOs for missing functionality
|
|
297
|
-
export interface CreateOrganizationDto {
|
|
298
|
-
name: string;
|
|
299
|
-
description?: string;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
export interface UpdateOrganizationDto {
|
|
303
|
-
name?: string;
|
|
304
|
-
description?: string;
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
export interface CreateTemplateCategoryDto {
|
|
308
|
-
name: string;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
export interface UpdateTemplateCategoryDto {
|
|
312
|
-
name?: string;
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
export interface CreateTranscriptionSummaryDto {
|
|
316
|
-
userId: string;
|
|
317
|
-
templateId: string;
|
|
318
|
-
content: string;
|
|
319
|
-
anonymisedTranscript?: string;
|
|
320
|
-
metadata?: Record<string, any>;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
export interface AssignTeamTemplateDto {
|
|
324
|
-
teamId: string;
|
|
325
|
-
templateId: string;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
// Enum for global role types to match API
|
|
329
|
-
export enum RoleType {
|
|
330
|
-
SUPERUSER = 'SUPERUSER',
|
|
331
|
-
ADMIN = 'ADMIN',
|
|
332
|
-
TRIAL = 'TRIAL',
|
|
333
|
-
PAID = 'PAID',
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
// Password change DTOs
|
|
337
|
-
export interface ChangePasswordDto {
|
|
338
|
-
currentPassword: string;
|
|
339
|
-
newPassword: string;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
export interface AdminChangePasswordDto {
|
|
343
|
-
userId: string;
|
|
344
|
-
newPassword: string;
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
export interface PasswordChangeResponse {
|
|
348
|
-
message: string;
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
// Session types
|
|
352
|
-
export interface Session {
|
|
353
|
-
id: string;
|
|
354
|
-
transcript: string;
|
|
355
|
-
medicalTranscription?: string;
|
|
356
|
-
culturalTranscription?: string;
|
|
357
|
-
dateTime: string;
|
|
358
|
-
startDateTime?: string;
|
|
359
|
-
stopDateTime?: string;
|
|
360
|
-
templateName?: string;
|
|
361
|
-
summary?: string;
|
|
362
|
-
sessionName?: string;
|
|
363
|
-
createdAt: string;
|
|
364
|
-
updatedAt: string;
|
|
365
|
-
templateId: string;
|
|
366
|
-
userId: string;
|
|
367
|
-
primaryTranscriptionSummaryId?: string;
|
|
368
|
-
|
|
369
|
-
// Derived fields (computed by API)
|
|
370
|
-
hasSummaryType?: boolean;
|
|
371
|
-
hasServerAudioFile?: boolean;
|
|
372
|
-
hasSummary?: boolean;
|
|
373
|
-
|
|
374
|
-
// Relationships (populated by API)
|
|
375
|
-
user?: User;
|
|
376
|
-
template?: Template;
|
|
377
|
-
transcriptionSummaries?: TranscriptionSummary[];
|
|
378
|
-
primaryTranscriptionSummary?: TranscriptionSummary;
|
|
379
|
-
audioFiles?: AudioFile[];
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
// Session DTOs
|
|
383
|
-
export interface CreateSessionDto {
|
|
384
|
-
transcript: string;
|
|
385
|
-
medicalTranscription?: string;
|
|
386
|
-
culturalTranscription?: string;
|
|
387
|
-
dateTime: string;
|
|
388
|
-
startDateTime?: string;
|
|
389
|
-
stopDateTime?: string;
|
|
390
|
-
templateId?: string;
|
|
391
|
-
templateName?: string;
|
|
392
|
-
summary?: string;
|
|
393
|
-
sessionName?: string;
|
|
394
|
-
primaryTranscriptionSummaryId?: string;
|
|
395
|
-
// userId will be auto-injected by API
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
export interface UpdateSessionDto {
|
|
399
|
-
transcript?: string;
|
|
400
|
-
medicalTranscription?: string;
|
|
401
|
-
culturalTranscription?: string;
|
|
402
|
-
dateTime?: string;
|
|
403
|
-
startDateTime?: string;
|
|
404
|
-
stopDateTime?: string;
|
|
405
|
-
templateId?: string;
|
|
406
|
-
templateName?: string;
|
|
407
|
-
summary?: string;
|
|
408
|
-
sessionName?: string;
|
|
409
|
-
primaryTranscriptionSummaryId?: string;
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
-
// Agent types
|
|
413
|
-
export interface Agent {
|
|
414
|
-
id: string;
|
|
415
|
-
name: string;
|
|
416
|
-
templateTextReplacement?: string;
|
|
417
|
-
createdAt: string;
|
|
418
|
-
updatedAt: string;
|
|
419
|
-
organizations?: AgentOrganization[];
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
// Agent Organization association
|
|
423
|
-
export interface AgentOrganization {
|
|
424
|
-
agentId: string;
|
|
425
|
-
organizationId: string;
|
|
426
|
-
createdAt: string;
|
|
427
|
-
agent?: Agent;
|
|
428
|
-
organization?: Organization;
|
|
429
|
-
}
|
|
430
|
-
|
|
431
|
-
// Agent DTOs
|
|
432
|
-
export interface CreateAgentDto {
|
|
433
|
-
name: string;
|
|
434
|
-
templateTextReplacement?: string;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
export interface UpdateAgentDto {
|
|
438
|
-
name?: string;
|
|
439
|
-
templateTextReplacement?: string;
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
// Audio File types
|
|
443
|
-
export enum AudioFileStatus {
|
|
444
|
-
UPLOADED = 'UPLOADED',
|
|
445
|
-
PROCESSING = 'PROCESSING',
|
|
446
|
-
TRANSCRIBED = 'TRANSCRIBED',
|
|
447
|
-
FAILED = 'FAILED',
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
export interface AudioFile {
|
|
451
|
-
id: string;
|
|
452
|
-
originalName: string;
|
|
453
|
-
fileName: string;
|
|
454
|
-
filePath: string;
|
|
455
|
-
fileSize: number;
|
|
456
|
-
mimeType: string;
|
|
457
|
-
uploadId?: string;
|
|
458
|
-
transcriptionUrl?: string;
|
|
459
|
-
transcription?: string;
|
|
460
|
-
cultural_transcription?: string;
|
|
461
|
-
status: AudioFileStatus;
|
|
462
|
-
createdAt: string;
|
|
463
|
-
updatedAt: string;
|
|
464
|
-
sessionId: string;
|
|
465
|
-
userId: string;
|
|
466
|
-
|
|
467
|
-
// Relationships (populated by API)
|
|
468
|
-
session?: Session;
|
|
469
|
-
user?: User;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
// Audio File DTOs
|
|
473
|
-
export interface CreateAudioFileDto {
|
|
474
|
-
originalName: string;
|
|
475
|
-
fileName: string;
|
|
476
|
-
filePath: string;
|
|
477
|
-
fileSize: number;
|
|
478
|
-
mimeType: string;
|
|
479
|
-
uploadId?: string;
|
|
480
|
-
sessionId: string;
|
|
481
|
-
// userId will be auto-injected by API
|
|
482
|
-
}
|
|
483
|
-
|
|
484
|
-
export interface UpdateAudioFileDto {
|
|
485
|
-
transcriptionUrl?: string;
|
|
486
|
-
transcription?: string;
|
|
487
|
-
cultural_transcription?: string;
|
|
488
|
-
status?: AudioFileStatus;
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
// Audio File Upload DTO (for transcription queue)
|
|
492
|
-
export interface UploadAudioFileDto {
|
|
493
|
-
cultural_transcription?: string;
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
// Agent Settings types
|
|
497
|
-
export interface AgentSettings {
|
|
498
|
-
id: string;
|
|
499
|
-
temperature: number;
|
|
500
|
-
topK: number;
|
|
501
|
-
topP: number;
|
|
502
|
-
repetitionPenalty: number;
|
|
503
|
-
createdAt: string;
|
|
504
|
-
updatedAt: string;
|
|
505
|
-
agentId: string;
|
|
506
|
-
organizationId: string;
|
|
507
|
-
|
|
508
|
-
// Relationships (populated by API)
|
|
509
|
-
agent?: Agent;
|
|
510
|
-
organization?: Organization;
|
|
511
|
-
}
|
|
512
|
-
|
|
513
|
-
// Agent Settings DTOs
|
|
514
|
-
export interface CreateAgentSettingsDto {
|
|
515
|
-
agentId: string;
|
|
516
|
-
organizationId: string;
|
|
517
|
-
temperature?: number;
|
|
518
|
-
topK?: number;
|
|
519
|
-
topP?: number;
|
|
520
|
-
repetitionPenalty?: number;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
export interface UpdateAgentSettingsDto {
|
|
524
|
-
temperature?: number;
|
|
525
|
-
topK?: number;
|
|
526
|
-
topP?: number;
|
|
527
|
-
repetitionPenalty?: number;
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
// Workflow types
|
|
531
|
-
export interface Workflow {
|
|
532
|
-
id: string;
|
|
533
|
-
name: string;
|
|
534
|
-
createdAt: string;
|
|
535
|
-
updatedAt: string;
|
|
536
|
-
organizationId: string;
|
|
537
|
-
|
|
538
|
-
// Relationships (populated by API)
|
|
539
|
-
organization?: Organization;
|
|
540
|
-
templates?: Template[];
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
// Workflow DTOs
|
|
544
|
-
export interface CreateWorkflowDto {
|
|
545
|
-
name: string;
|
|
546
|
-
organizationId: string;
|
|
547
|
-
}
|
|
548
|
-
|
|
549
|
-
export interface UpdateWorkflowDto {
|
|
550
|
-
name?: string;
|
|
551
|
-
organizationId: string;
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
// Base64 Audio File types
|
|
555
|
-
export interface Base64AudioFile {
|
|
556
|
-
id: string;
|
|
557
|
-
sessionId: string;
|
|
558
|
-
audioChunks: string[];
|
|
559
|
-
createdAt: string;
|
|
560
|
-
updatedAt: string;
|
|
561
|
-
|
|
562
|
-
// Relationships (populated by API)
|
|
563
|
-
session?: Session;
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
// Base64 Audio File DTOs
|
|
567
|
-
export interface CreateBase64AudioFileDto {
|
|
568
|
-
sessionId: string;
|
|
569
|
-
audioChunks: string[];
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
export interface UpdateBase64AudioFileDto {
|
|
573
|
-
sessionId?: string;
|
|
574
|
-
audioChunks?: string[];
|
|
575
|
-
}
|
|
576
|
-
|
|
577
|
-
// Add chunk response
|
|
578
|
-
export interface AddBase64ChunkResponse {
|
|
579
|
-
count: number;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
// Log types
|
|
583
|
-
export interface Log {
|
|
584
|
-
id: number;
|
|
585
|
-
level: string;
|
|
586
|
-
message: string;
|
|
587
|
-
meta: any;
|
|
588
|
-
timestamp: string;
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
export interface LogsResponse {
|
|
592
|
-
logs: Log[];
|
|
593
|
-
total: number;
|
|
594
|
-
limit: number;
|
|
595
|
-
offset: number;
|
|
596
|
-
hasMore: boolean;
|
|
597
|
-
}
|
|
598
|
-
|
|
599
|
-
export interface LogStats {
|
|
600
|
-
totalLogs: number;
|
|
601
|
-
errorLogs: number;
|
|
602
|
-
warnLogs: number;
|
|
603
|
-
infoLogs: number;
|
|
604
|
-
recentLogs: number;
|
|
605
|
-
}
|
|
606
|
-
|
|
607
|
-
export interface FilterLogsDto {
|
|
608
|
-
controller?: string;
|
|
609
|
-
userId?: string;
|
|
610
|
-
organizationId?: string;
|
|
611
|
-
level?: 'error' | 'warn' | 'info' | 'debug' | 'verbose';
|
|
612
|
-
role?: string;
|
|
613
|
-
organizationRole?: string;
|
|
614
|
-
teamRole?: string;
|
|
615
|
-
startDate?: string;
|
|
616
|
-
endDate?: string;
|
|
617
|
-
limit?: number;
|
|
618
|
-
offset?: number;
|
|
619
|
-
}
|
|
620
|
-
|
|
621
|
-
export interface CreateLogDto {
|
|
622
|
-
level: 'error' | 'warn' | 'info' | 'debug' | 'verbose';
|
|
623
|
-
message: string;
|
|
624
|
-
context?: string;
|
|
625
|
-
action?: string;
|
|
626
|
-
data?: any;
|
|
627
|
-
additionalMeta?: Record<string, any>;
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
// Debug types
|
|
631
|
-
export interface DebugSessionSummary {
|
|
632
|
-
id: string;
|
|
633
|
-
sessionName?: string;
|
|
634
|
-
dateTime: string;
|
|
635
|
-
createdAt: string;
|
|
636
|
-
user: {
|
|
637
|
-
id: string;
|
|
638
|
-
email: string;
|
|
639
|
-
firstName?: string;
|
|
640
|
-
lastName?: string;
|
|
641
|
-
organizationId?: string;
|
|
642
|
-
};
|
|
643
|
-
template?: {
|
|
644
|
-
id: string;
|
|
645
|
-
title: string;
|
|
646
|
-
};
|
|
647
|
-
hasMedicalTranscription: boolean;
|
|
648
|
-
hasPrimaryTranscriptionSummary: boolean;
|
|
649
|
-
}
|