whio-api-sdk 1.1.20 → 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/sdk.d.ts +1 -0
- package/dist/src/sdk/sdk.js +5 -0
- package/dist/src/sdk/types/session.types.d.ts +43 -0
- package/package.json +1 -1
- package/src/sdk/modules/session.module.ts +20 -1
- package/src/sdk/sdk.ts +4 -0
- package/src/sdk/types/session.types.ts +43 -0
|
@@ -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
|
}
|
package/dist/src/sdk/sdk.d.ts
CHANGED
|
@@ -140,6 +140,7 @@ export declare class ApiSDK extends BaseClient {
|
|
|
140
140
|
}>;
|
|
141
141
|
setAudioStreamStatus(...args: Parameters<SessionModule['setAudioStreamStatus']>): Promise<import("./types").Session>;
|
|
142
142
|
forwardToTiaki(...args: Parameters<SessionModule['forwardToTiaki']>): Promise<import("./types").ForwardToTiakiResponse>;
|
|
143
|
+
searchSessions(...args: Parameters<SessionModule['searchSessions']>): Promise<import("./types").SearchSessionsResponse>;
|
|
143
144
|
createAgent(...args: Parameters<AgentModule['createAgent']>): Promise<import("./types").Agent>;
|
|
144
145
|
getAgents(...args: Parameters<AgentModule['getAgents']>): Promise<import("./types").Agent[]>;
|
|
145
146
|
getAgent(...args: Parameters<AgentModule['getAgent']>): Promise<import("./types").Agent>;
|
package/dist/src/sdk/sdk.js
CHANGED
|
@@ -531,6 +531,11 @@ export class ApiSDK extends BaseClient {
|
|
|
531
531
|
return this.sessions.forwardToTiaki(...args);
|
|
532
532
|
});
|
|
533
533
|
}
|
|
534
|
+
searchSessions(...args) {
|
|
535
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
536
|
+
return this.sessions.searchSessions(...args);
|
|
537
|
+
});
|
|
538
|
+
}
|
|
534
539
|
// Agent methods
|
|
535
540
|
createAgent(...args) {
|
|
536
541
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -83,3 +83,46 @@ export interface SessionsResponse {
|
|
|
83
83
|
offset: number;
|
|
84
84
|
hasMore: boolean;
|
|
85
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
|
+
}
|
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
|
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -480,6 +480,10 @@ export class ApiSDK extends BaseClient {
|
|
|
480
480
|
return this.sessions.forwardToTiaki(...args);
|
|
481
481
|
}
|
|
482
482
|
|
|
483
|
+
public async searchSessions(...args: Parameters<SessionModule['searchSessions']>) {
|
|
484
|
+
return this.sessions.searchSessions(...args);
|
|
485
|
+
}
|
|
486
|
+
|
|
483
487
|
// Agent methods
|
|
484
488
|
public async createAgent(...args: Parameters<AgentModule['createAgent']>) {
|
|
485
489
|
return this.agents.createAgent(...args);
|
|
@@ -95,3 +95,46 @@ export interface SessionsResponse {
|
|
|
95
95
|
offset: number;
|
|
96
96
|
hasMore: boolean;
|
|
97
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
|
+
}
|