whio-api-sdk 1.1.14 → 1.1.15

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.
@@ -0,0 +1,41 @@
1
+ import { BaseClient } from './base-client';
2
+ import { SummaryRating, CreateSummaryRatingDto, FilterSummaryRatingsDto, SummaryRatingsResponse } from '../types';
3
+ export declare class RatingModule extends BaseClient {
4
+ /**
5
+ * Create a new summary rating
6
+ * @param ratingData - The rating data including datetime, rating (0-5), optional notes and transcriptionSummaryId
7
+ * @returns The created SummaryRating with user and transcriptionSummary relations
8
+ */
9
+ createRating(ratingData: CreateSummaryRatingDto): Promise<SummaryRating>;
10
+ /**
11
+ * Get all ratings with optional filters (Superuser only)
12
+ * @param filters - Optional filters including userId, transcriptionSummaryId, date range, and pagination
13
+ * @returns Paginated response with ratings array, total count, limit, and offset
14
+ */
15
+ getRatings(filters?: FilterSummaryRatingsDto): Promise<SummaryRatingsResponse>;
16
+ /**
17
+ * Get ratings by user ID (Superuser only)
18
+ * @param userId - The user ID to filter ratings by
19
+ * @param limit - Maximum number of ratings to return
20
+ * @param offset - Number of ratings to skip
21
+ * @returns Paginated response with ratings for the specified user
22
+ */
23
+ getRatingsByUser(userId: string, limit?: number, offset?: number): Promise<SummaryRatingsResponse>;
24
+ /**
25
+ * Get ratings by transcription summary ID (Superuser only)
26
+ * @param transcriptionSummaryId - The transcription summary ID to filter ratings by
27
+ * @param limit - Maximum number of ratings to return
28
+ * @param offset - Number of ratings to skip
29
+ * @returns Paginated response with ratings for the specified transcription summary
30
+ */
31
+ getRatingsByTranscriptionSummary(transcriptionSummaryId: string, limit?: number, offset?: number): Promise<SummaryRatingsResponse>;
32
+ /**
33
+ * Get ratings within a date range (Superuser only)
34
+ * @param startDate - ISO date string for the start of the range
35
+ * @param endDate - ISO date string for the end of the range
36
+ * @param limit - Maximum number of ratings to return
37
+ * @param offset - Number of ratings to skip
38
+ * @returns Paginated response with ratings within the specified date range
39
+ */
40
+ getRatingsByDateRange(startDate: string, endDate: string, limit?: number, offset?: number): Promise<SummaryRatingsResponse>;
41
+ }
@@ -0,0 +1,94 @@
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 RatingModule extends BaseClient {
13
+ /**
14
+ * Create a new summary rating
15
+ * @param ratingData - The rating data including datetime, rating (0-5), optional notes and transcriptionSummaryId
16
+ * @returns The created SummaryRating with user and transcriptionSummary relations
17
+ */
18
+ createRating(ratingData) {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ return this.request(urls.ratings, 'POST', ratingData);
21
+ });
22
+ }
23
+ /**
24
+ * Get all ratings with optional filters (Superuser only)
25
+ * @param filters - Optional filters including userId, transcriptionSummaryId, date range, and pagination
26
+ * @returns Paginated response with ratings array, total count, limit, and offset
27
+ */
28
+ getRatings(filters) {
29
+ return __awaiter(this, void 0, void 0, function* () {
30
+ if (!filters || Object.keys(filters).length === 0) {
31
+ return this.request(urls.ratings, 'GET');
32
+ }
33
+ const params = new URLSearchParams();
34
+ if (filters.userId) {
35
+ params.append('userId', filters.userId);
36
+ }
37
+ if (filters.transcriptionSummaryId) {
38
+ params.append('transcriptionSummaryId', filters.transcriptionSummaryId);
39
+ }
40
+ if (filters.startDate) {
41
+ params.append('startDate', filters.startDate);
42
+ }
43
+ if (filters.endDate) {
44
+ params.append('endDate', filters.endDate);
45
+ }
46
+ if (filters.limit !== undefined) {
47
+ params.append('limit', filters.limit.toString());
48
+ }
49
+ if (filters.offset !== undefined) {
50
+ params.append('offset', filters.offset.toString());
51
+ }
52
+ const queryString = params.toString();
53
+ const endpoint = `${urls.ratings}?${queryString}`;
54
+ return this.request(endpoint, 'GET');
55
+ });
56
+ }
57
+ /**
58
+ * Get ratings by user ID (Superuser only)
59
+ * @param userId - The user ID to filter ratings by
60
+ * @param limit - Maximum number of ratings to return
61
+ * @param offset - Number of ratings to skip
62
+ * @returns Paginated response with ratings for the specified user
63
+ */
64
+ getRatingsByUser(userId, limit, offset) {
65
+ return __awaiter(this, void 0, void 0, function* () {
66
+ return this.getRatings({ userId, limit, offset });
67
+ });
68
+ }
69
+ /**
70
+ * Get ratings by transcription summary ID (Superuser only)
71
+ * @param transcriptionSummaryId - The transcription summary ID to filter ratings by
72
+ * @param limit - Maximum number of ratings to return
73
+ * @param offset - Number of ratings to skip
74
+ * @returns Paginated response with ratings for the specified transcription summary
75
+ */
76
+ getRatingsByTranscriptionSummary(transcriptionSummaryId, limit, offset) {
77
+ return __awaiter(this, void 0, void 0, function* () {
78
+ return this.getRatings({ transcriptionSummaryId, limit, offset });
79
+ });
80
+ }
81
+ /**
82
+ * Get ratings within a date range (Superuser only)
83
+ * @param startDate - ISO date string for the start of the range
84
+ * @param endDate - ISO date string for the end of the range
85
+ * @param limit - Maximum number of ratings to return
86
+ * @param offset - Number of ratings to skip
87
+ * @returns Paginated response with ratings within the specified date range
88
+ */
89
+ getRatingsByDateRange(startDate, endDate, limit, offset) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ return this.getRatings({ startDate, endDate, limit, offset });
92
+ });
93
+ }
94
+ }
@@ -19,6 +19,7 @@ import { ReportsModule } from './modules/reports.module';
19
19
  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
+ import { RatingModule } from './modules/rating.module';
22
23
  /**
23
24
  * Main SDK class that provides access to all domain-specific modules
24
25
  */
@@ -42,6 +43,7 @@ export declare class ApiSDK extends BaseClient {
42
43
  readonly patients: PatientModule;
43
44
  readonly dataStrategies: DataStrategyModule;
44
45
  readonly systemSnapshots: SystemSnapshotModule;
46
+ readonly ratings: RatingModule;
45
47
  private modules;
46
48
  private sdkInitialized;
47
49
  constructor(config?: SDKConfig);
@@ -235,4 +237,9 @@ export declare class ApiSDK extends BaseClient {
235
237
  getSystemSnapshots(...args: Parameters<SystemSnapshotModule['getSnapshots']>): Promise<import("./types").SystemSnapshotsResponse>;
236
238
  getLatestSystemSnapshot(...args: Parameters<SystemSnapshotModule['getLatestSnapshot']>): Promise<import("./types").SystemSnapshot | null>;
237
239
  getCurrentSystemMetrics(...args: Parameters<SystemSnapshotModule['getCurrentMetrics']>): Promise<import("./types").CurrentMetrics>;
240
+ createRating(...args: Parameters<RatingModule['createRating']>): Promise<import("./types").SummaryRating>;
241
+ getRatings(...args: Parameters<RatingModule['getRatings']>): Promise<import("./types").SummaryRatingsResponse>;
242
+ getRatingsByUser(...args: Parameters<RatingModule['getRatingsByUser']>): Promise<import("./types").SummaryRatingsResponse>;
243
+ getRatingsByTranscriptionSummary(...args: Parameters<RatingModule['getRatingsByTranscriptionSummary']>): Promise<import("./types").SummaryRatingsResponse>;
244
+ getRatingsByDateRange(...args: Parameters<RatingModule['getRatingsByDateRange']>): Promise<import("./types").SummaryRatingsResponse>;
238
245
  }
@@ -27,6 +27,7 @@ import { ReportsModule } from './modules/reports.module';
27
27
  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
+ import { RatingModule } from './modules/rating.module';
30
31
  /**
31
32
  * Main SDK class that provides access to all domain-specific modules
32
33
  */
@@ -54,12 +55,13 @@ export class ApiSDK extends BaseClient {
54
55
  this.patients = new PatientModule(config);
55
56
  this.dataStrategies = new DataStrategyModule(config);
56
57
  this.systemSnapshots = new SystemSnapshotModule(config);
58
+ this.ratings = new RatingModule(config);
57
59
  // Store all modules for batch operations
58
60
  this.modules = [
59
61
  this.auth, this.users, this.organizations, this.teams, this.templates,
60
62
  this.transcriptionSummaries, this.sessions, this.agents, this.audio,
61
63
  this.workflows, this.integrationActions, this.logs, this.debug, this.externalIntegrations,
62
- this.reports, this.patients, this.dataStrategies, this.systemSnapshots,
64
+ this.reports, this.patients, this.dataStrategies, this.systemSnapshots, this.ratings,
63
65
  ...(this.websocket ? [this.websocket] : [])
64
66
  ];
65
67
  // Auto-initialize the SDK
@@ -974,4 +976,30 @@ export class ApiSDK extends BaseClient {
974
976
  return this.systemSnapshots.getCurrentMetrics(...args);
975
977
  });
976
978
  }
979
+ // Rating methods
980
+ createRating(...args) {
981
+ return __awaiter(this, void 0, void 0, function* () {
982
+ return this.ratings.createRating(...args);
983
+ });
984
+ }
985
+ getRatings(...args) {
986
+ return __awaiter(this, void 0, void 0, function* () {
987
+ return this.ratings.getRatings(...args);
988
+ });
989
+ }
990
+ getRatingsByUser(...args) {
991
+ return __awaiter(this, void 0, void 0, function* () {
992
+ return this.ratings.getRatingsByUser(...args);
993
+ });
994
+ }
995
+ getRatingsByTranscriptionSummary(...args) {
996
+ return __awaiter(this, void 0, void 0, function* () {
997
+ return this.ratings.getRatingsByTranscriptionSummary(...args);
998
+ });
999
+ }
1000
+ getRatingsByDateRange(...args) {
1001
+ return __awaiter(this, void 0, void 0, function* () {
1002
+ return this.ratings.getRatingsByDateRange(...args);
1003
+ });
1004
+ }
977
1005
  }
@@ -16,3 +16,4 @@ export * from './reports.types';
16
16
  export * from './patient.types';
17
17
  export * from './data-strategy.types';
18
18
  export * from './system-snapshot.types';
19
+ export * from './rating.types';
@@ -17,3 +17,4 @@ export * from './reports.types';
17
17
  export * from './patient.types';
18
18
  export * from './data-strategy.types';
19
19
  export * from './system-snapshot.types';
20
+ export * from './rating.types';
@@ -0,0 +1,34 @@
1
+ import { User } from './user.types';
2
+ import { TranscriptionSummary } from './template.types';
3
+ export interface SummaryRating {
4
+ id: string;
5
+ userId: string;
6
+ datetime: string;
7
+ transcriptionSummaryId: string | null;
8
+ notes: string | null;
9
+ rating: number;
10
+ createdAt: string;
11
+ updatedAt: string;
12
+ user?: User;
13
+ transcriptionSummary?: TranscriptionSummary;
14
+ }
15
+ export interface CreateSummaryRatingDto {
16
+ datetime: string;
17
+ transcriptionSummaryId?: string;
18
+ notes?: string;
19
+ rating: number;
20
+ }
21
+ export interface FilterSummaryRatingsDto {
22
+ userId?: string;
23
+ transcriptionSummaryId?: string;
24
+ startDate?: string;
25
+ endDate?: string;
26
+ limit?: number;
27
+ offset?: number;
28
+ }
29
+ export interface SummaryRatingsResponse {
30
+ ratings: SummaryRating[];
31
+ total: number;
32
+ limit: number;
33
+ offset: number;
34
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -37,5 +37,6 @@ declare const urls: {
37
37
  patients: string;
38
38
  dataStrategies: string;
39
39
  systemSnapshots: string;
40
+ ratings: string;
40
41
  };
41
42
  export default urls;
@@ -57,5 +57,7 @@ const urls = {
57
57
  dataStrategies: '/data-strategies',
58
58
  // System Snapshots
59
59
  systemSnapshots: '/system-snapshots',
60
+ // Ratings
61
+ ratings: '/ratings',
60
62
  };
61
63
  export default urls;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whio-api-sdk",
3
- "version": "1.1.14",
3
+ "version": "1.1.15",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -0,0 +1,107 @@
1
+ import { BaseClient } from './base-client';
2
+ import {
3
+ SummaryRating,
4
+ CreateSummaryRatingDto,
5
+ FilterSummaryRatingsDto,
6
+ SummaryRatingsResponse,
7
+ } from '../types';
8
+ import urls from '../urls';
9
+
10
+ export class RatingModule extends BaseClient {
11
+ /**
12
+ * Create a new summary rating
13
+ * @param ratingData - The rating data including datetime, rating (0-5), optional notes and transcriptionSummaryId
14
+ * @returns The created SummaryRating with user and transcriptionSummary relations
15
+ */
16
+ public async createRating(
17
+ ratingData: CreateSummaryRatingDto,
18
+ ): Promise<SummaryRating> {
19
+ return this.request<SummaryRating>(urls.ratings, 'POST', ratingData);
20
+ }
21
+
22
+ /**
23
+ * Get all ratings with optional filters (Superuser only)
24
+ * @param filters - Optional filters including userId, transcriptionSummaryId, date range, and pagination
25
+ * @returns Paginated response with ratings array, total count, limit, and offset
26
+ */
27
+ public async getRatings(
28
+ filters?: FilterSummaryRatingsDto,
29
+ ): Promise<SummaryRatingsResponse> {
30
+ if (!filters || Object.keys(filters).length === 0) {
31
+ return this.request<SummaryRatingsResponse>(urls.ratings, 'GET');
32
+ }
33
+
34
+ const params = new URLSearchParams();
35
+
36
+ if (filters.userId) {
37
+ params.append('userId', filters.userId);
38
+ }
39
+ if (filters.transcriptionSummaryId) {
40
+ params.append('transcriptionSummaryId', filters.transcriptionSummaryId);
41
+ }
42
+ if (filters.startDate) {
43
+ params.append('startDate', filters.startDate);
44
+ }
45
+ if (filters.endDate) {
46
+ params.append('endDate', filters.endDate);
47
+ }
48
+ if (filters.limit !== undefined) {
49
+ params.append('limit', filters.limit.toString());
50
+ }
51
+ if (filters.offset !== undefined) {
52
+ params.append('offset', filters.offset.toString());
53
+ }
54
+
55
+ const queryString = params.toString();
56
+ const endpoint = `${urls.ratings}?${queryString}`;
57
+
58
+ return this.request<SummaryRatingsResponse>(endpoint, 'GET');
59
+ }
60
+
61
+ /**
62
+ * Get ratings by user ID (Superuser only)
63
+ * @param userId - The user ID to filter ratings by
64
+ * @param limit - Maximum number of ratings to return
65
+ * @param offset - Number of ratings to skip
66
+ * @returns Paginated response with ratings for the specified user
67
+ */
68
+ public async getRatingsByUser(
69
+ userId: string,
70
+ limit?: number,
71
+ offset?: number,
72
+ ): Promise<SummaryRatingsResponse> {
73
+ return this.getRatings({ userId, limit, offset });
74
+ }
75
+
76
+ /**
77
+ * Get ratings by transcription summary ID (Superuser only)
78
+ * @param transcriptionSummaryId - The transcription summary ID to filter ratings by
79
+ * @param limit - Maximum number of ratings to return
80
+ * @param offset - Number of ratings to skip
81
+ * @returns Paginated response with ratings for the specified transcription summary
82
+ */
83
+ public async getRatingsByTranscriptionSummary(
84
+ transcriptionSummaryId: string,
85
+ limit?: number,
86
+ offset?: number,
87
+ ): Promise<SummaryRatingsResponse> {
88
+ return this.getRatings({ transcriptionSummaryId, limit, offset });
89
+ }
90
+
91
+ /**
92
+ * Get ratings within a date range (Superuser only)
93
+ * @param startDate - ISO date string for the start of the range
94
+ * @param endDate - ISO date string for the end of the range
95
+ * @param limit - Maximum number of ratings to return
96
+ * @param offset - Number of ratings to skip
97
+ * @returns Paginated response with ratings within the specified date range
98
+ */
99
+ public async getRatingsByDateRange(
100
+ startDate: string,
101
+ endDate: string,
102
+ limit?: number,
103
+ offset?: number,
104
+ ): Promise<SummaryRatingsResponse> {
105
+ return this.getRatings({ startDate, endDate, limit, offset });
106
+ }
107
+ }
package/src/sdk/sdk.ts CHANGED
@@ -20,6 +20,7 @@ import { ReportsModule } from './modules/reports.module';
20
20
  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
+ import { RatingModule } from './modules/rating.module';
23
24
 
24
25
  /**
25
26
  * Main SDK class that provides access to all domain-specific modules
@@ -44,6 +45,7 @@ export class ApiSDK extends BaseClient {
44
45
  public readonly patients: PatientModule;
45
46
  public readonly dataStrategies: DataStrategyModule;
46
47
  public readonly systemSnapshots: SystemSnapshotModule;
48
+ public readonly ratings: RatingModule;
47
49
 
48
50
  private modules: BaseClient[];
49
51
  private sdkInitialized: boolean = false;
@@ -71,13 +73,14 @@ export class ApiSDK extends BaseClient {
71
73
  this.patients = new PatientModule(config);
72
74
  this.dataStrategies = new DataStrategyModule(config);
73
75
  this.systemSnapshots = new SystemSnapshotModule(config);
76
+ this.ratings = new RatingModule(config);
74
77
 
75
78
  // Store all modules for batch operations
76
79
  this.modules = [
77
80
  this.auth, this.users, this.organizations, this.teams, this.templates,
78
81
  this.transcriptionSummaries, this.sessions, this.agents, this.audio,
79
82
  this.workflows, this.integrationActions, this.logs, this.debug, this.externalIntegrations,
80
- this.reports, this.patients, this.dataStrategies, this.systemSnapshots,
83
+ this.reports, this.patients, this.dataStrategies, this.systemSnapshots, this.ratings,
81
84
  ...(this.websocket ? [this.websocket] : [])
82
85
  ];
83
86
 
@@ -851,4 +854,25 @@ export class ApiSDK extends BaseClient {
851
854
  return this.systemSnapshots.getCurrentMetrics(...args);
852
855
  }
853
856
 
857
+ // Rating methods
858
+ public async createRating(...args: Parameters<RatingModule['createRating']>) {
859
+ return this.ratings.createRating(...args);
860
+ }
861
+
862
+ public async getRatings(...args: Parameters<RatingModule['getRatings']>) {
863
+ return this.ratings.getRatings(...args);
864
+ }
865
+
866
+ public async getRatingsByUser(...args: Parameters<RatingModule['getRatingsByUser']>) {
867
+ return this.ratings.getRatingsByUser(...args);
868
+ }
869
+
870
+ public async getRatingsByTranscriptionSummary(...args: Parameters<RatingModule['getRatingsByTranscriptionSummary']>) {
871
+ return this.ratings.getRatingsByTranscriptionSummary(...args);
872
+ }
873
+
874
+ public async getRatingsByDateRange(...args: Parameters<RatingModule['getRatingsByDateRange']>) {
875
+ return this.ratings.getRatingsByDateRange(...args);
876
+ }
877
+
854
878
  }
@@ -17,3 +17,4 @@ export * from './reports.types';
17
17
  export * from './patient.types';
18
18
  export * from './data-strategy.types';
19
19
  export * from './system-snapshot.types';
20
+ export * from './rating.types';
@@ -0,0 +1,38 @@
1
+ import { User } from './user.types';
2
+ import { TranscriptionSummary } from './template.types';
3
+
4
+ export interface SummaryRating {
5
+ id: string;
6
+ userId: string;
7
+ datetime: string;
8
+ transcriptionSummaryId: string | null;
9
+ notes: string | null;
10
+ rating: number;
11
+ createdAt: string;
12
+ updatedAt: string;
13
+ user?: User;
14
+ transcriptionSummary?: TranscriptionSummary;
15
+ }
16
+
17
+ export interface CreateSummaryRatingDto {
18
+ datetime: string;
19
+ transcriptionSummaryId?: string;
20
+ notes?: string;
21
+ rating: number;
22
+ }
23
+
24
+ export interface FilterSummaryRatingsDto {
25
+ userId?: string;
26
+ transcriptionSummaryId?: string;
27
+ startDate?: string;
28
+ endDate?: string;
29
+ limit?: number;
30
+ offset?: number;
31
+ }
32
+
33
+ export interface SummaryRatingsResponse {
34
+ ratings: SummaryRating[];
35
+ total: number;
36
+ limit: number;
37
+ offset: number;
38
+ }
package/src/sdk/urls.ts CHANGED
@@ -76,6 +76,9 @@ const urls = {
76
76
 
77
77
  // System Snapshots
78
78
  systemSnapshots: '/system-snapshots',
79
+
80
+ // Ratings
81
+ ratings: '/ratings',
79
82
  }
80
83
 
81
84
  export default urls;