whio-api-sdk 1.1.15 → 1.1.17

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.
@@ -1,2 +1,3 @@
1
1
  export { ApiSDK } from "./sdk";
2
2
  export * from "./types";
3
+ export { AxiosError } from 'axios';
@@ -1,2 +1,3 @@
1
1
  export { ApiSDK } from "./sdk";
2
2
  export * from "./types";
3
+ export { AxiosError } from 'axios';
@@ -3,13 +3,13 @@ import { SummaryRating, CreateSummaryRatingDto, FilterSummaryRatingsDto, Summary
3
3
  export declare class RatingModule extends BaseClient {
4
4
  /**
5
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
6
+ * @param ratingData - The rating data including datetime, rating (0-5), and optional fields: notes, transcriptionSummaryId, sessionId, templateId, templateName
7
+ * @returns The created SummaryRating with user, transcriptionSummary, session, and template relations
8
8
  */
9
9
  createRating(ratingData: CreateSummaryRatingDto): Promise<SummaryRating>;
10
10
  /**
11
11
  * Get all ratings with optional filters (Superuser only)
12
- * @param filters - Optional filters including userId, transcriptionSummaryId, date range, and pagination
12
+ * @param filters - Optional filters including userId, transcriptionSummaryId, sessionId, templateId, date range, and pagination
13
13
  * @returns Paginated response with ratings array, total count, limit, and offset
14
14
  */
15
15
  getRatings(filters?: FilterSummaryRatingsDto): Promise<SummaryRatingsResponse>;
@@ -38,4 +38,20 @@ export declare class RatingModule extends BaseClient {
38
38
  * @returns Paginated response with ratings within the specified date range
39
39
  */
40
40
  getRatingsByDateRange(startDate: string, endDate: string, limit?: number, offset?: number): Promise<SummaryRatingsResponse>;
41
+ /**
42
+ * Get ratings by session ID (Superuser only)
43
+ * @param sessionId - The session ID to filter ratings by
44
+ * @param limit - Maximum number of ratings to return
45
+ * @param offset - Number of ratings to skip
46
+ * @returns Paginated response with ratings for the specified session
47
+ */
48
+ getRatingsBySession(sessionId: string, limit?: number, offset?: number): Promise<SummaryRatingsResponse>;
49
+ /**
50
+ * Get ratings by template ID (Superuser only)
51
+ * @param templateId - The template ID to filter ratings by
52
+ * @param limit - Maximum number of ratings to return
53
+ * @param offset - Number of ratings to skip
54
+ * @returns Paginated response with ratings for the specified template
55
+ */
56
+ getRatingsByTemplate(templateId: string, limit?: number, offset?: number): Promise<SummaryRatingsResponse>;
41
57
  }
@@ -12,8 +12,8 @@ import urls from '../urls';
12
12
  export class RatingModule extends BaseClient {
13
13
  /**
14
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
15
+ * @param ratingData - The rating data including datetime, rating (0-5), and optional fields: notes, transcriptionSummaryId, sessionId, templateId, templateName
16
+ * @returns The created SummaryRating with user, transcriptionSummary, session, and template relations
17
17
  */
18
18
  createRating(ratingData) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
@@ -22,7 +22,7 @@ export class RatingModule extends BaseClient {
22
22
  }
23
23
  /**
24
24
  * Get all ratings with optional filters (Superuser only)
25
- * @param filters - Optional filters including userId, transcriptionSummaryId, date range, and pagination
25
+ * @param filters - Optional filters including userId, transcriptionSummaryId, sessionId, templateId, date range, and pagination
26
26
  * @returns Paginated response with ratings array, total count, limit, and offset
27
27
  */
28
28
  getRatings(filters) {
@@ -37,6 +37,12 @@ export class RatingModule extends BaseClient {
37
37
  if (filters.transcriptionSummaryId) {
38
38
  params.append('transcriptionSummaryId', filters.transcriptionSummaryId);
39
39
  }
40
+ if (filters.sessionId) {
41
+ params.append('sessionId', filters.sessionId);
42
+ }
43
+ if (filters.templateId) {
44
+ params.append('templateId', filters.templateId);
45
+ }
40
46
  if (filters.startDate) {
41
47
  params.append('startDate', filters.startDate);
42
48
  }
@@ -91,4 +97,28 @@ export class RatingModule extends BaseClient {
91
97
  return this.getRatings({ startDate, endDate, limit, offset });
92
98
  });
93
99
  }
100
+ /**
101
+ * Get ratings by session ID (Superuser only)
102
+ * @param sessionId - The session ID to filter ratings by
103
+ * @param limit - Maximum number of ratings to return
104
+ * @param offset - Number of ratings to skip
105
+ * @returns Paginated response with ratings for the specified session
106
+ */
107
+ getRatingsBySession(sessionId, limit, offset) {
108
+ return __awaiter(this, void 0, void 0, function* () {
109
+ return this.getRatings({ sessionId, limit, offset });
110
+ });
111
+ }
112
+ /**
113
+ * Get ratings by template ID (Superuser only)
114
+ * @param templateId - The template ID to filter ratings by
115
+ * @param limit - Maximum number of ratings to return
116
+ * @param offset - Number of ratings to skip
117
+ * @returns Paginated response with ratings for the specified template
118
+ */
119
+ getRatingsByTemplate(templateId, limit, offset) {
120
+ return __awaiter(this, void 0, void 0, function* () {
121
+ return this.getRatings({ templateId, limit, offset });
122
+ });
123
+ }
94
124
  }
@@ -242,4 +242,6 @@ export declare class ApiSDK extends BaseClient {
242
242
  getRatingsByUser(...args: Parameters<RatingModule['getRatingsByUser']>): Promise<import("./types").SummaryRatingsResponse>;
243
243
  getRatingsByTranscriptionSummary(...args: Parameters<RatingModule['getRatingsByTranscriptionSummary']>): Promise<import("./types").SummaryRatingsResponse>;
244
244
  getRatingsByDateRange(...args: Parameters<RatingModule['getRatingsByDateRange']>): Promise<import("./types").SummaryRatingsResponse>;
245
+ getRatingsBySession(...args: Parameters<RatingModule['getRatingsBySession']>): Promise<import("./types").SummaryRatingsResponse>;
246
+ getRatingsByTemplate(...args: Parameters<RatingModule['getRatingsByTemplate']>): Promise<import("./types").SummaryRatingsResponse>;
245
247
  }
@@ -1002,4 +1002,14 @@ export class ApiSDK extends BaseClient {
1002
1002
  return this.ratings.getRatingsByDateRange(...args);
1003
1003
  });
1004
1004
  }
1005
+ getRatingsBySession(...args) {
1006
+ return __awaiter(this, void 0, void 0, function* () {
1007
+ return this.ratings.getRatingsBySession(...args);
1008
+ });
1009
+ }
1010
+ getRatingsByTemplate(...args) {
1011
+ return __awaiter(this, void 0, void 0, function* () {
1012
+ return this.ratings.getRatingsByTemplate(...args);
1013
+ });
1014
+ }
1005
1015
  }
@@ -1,26 +1,37 @@
1
1
  import { User } from './user.types';
2
- import { TranscriptionSummary } from './template.types';
2
+ import { TranscriptionSummary, Template } from './template.types';
3
+ import { Session } from './session.types';
3
4
  export interface SummaryRating {
4
5
  id: string;
5
6
  userId: string;
6
7
  datetime: string;
7
8
  transcriptionSummaryId: string | null;
9
+ sessionId: string | null;
10
+ templateId: string | null;
11
+ templateName: string | null;
8
12
  notes: string | null;
9
13
  rating: number;
10
14
  createdAt: string;
11
15
  updatedAt: string;
12
16
  user?: User;
13
17
  transcriptionSummary?: TranscriptionSummary;
18
+ session?: Session;
19
+ template?: Template;
14
20
  }
15
21
  export interface CreateSummaryRatingDto {
16
22
  datetime: string;
17
23
  transcriptionSummaryId?: string;
24
+ sessionId?: string;
25
+ templateId?: string;
26
+ templateName?: string;
18
27
  notes?: string;
19
28
  rating: number;
20
29
  }
21
30
  export interface FilterSummaryRatingsDto {
22
31
  userId?: string;
23
32
  transcriptionSummaryId?: string;
33
+ sessionId?: string;
34
+ templateId?: string;
24
35
  startDate?: string;
25
36
  endDate?: string;
26
37
  limit?: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whio-api-sdk",
3
- "version": "1.1.15",
3
+ "version": "1.1.17",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
package/src/sdk/index.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { ApiSDK } from "./sdk";
2
- export * from "./types";
2
+ export * from "./types";
3
+ export { AxiosError } from 'axios';
@@ -10,8 +10,8 @@ import urls from '../urls';
10
10
  export class RatingModule extends BaseClient {
11
11
  /**
12
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
13
+ * @param ratingData - The rating data including datetime, rating (0-5), and optional fields: notes, transcriptionSummaryId, sessionId, templateId, templateName
14
+ * @returns The created SummaryRating with user, transcriptionSummary, session, and template relations
15
15
  */
16
16
  public async createRating(
17
17
  ratingData: CreateSummaryRatingDto,
@@ -21,7 +21,7 @@ export class RatingModule extends BaseClient {
21
21
 
22
22
  /**
23
23
  * Get all ratings with optional filters (Superuser only)
24
- * @param filters - Optional filters including userId, transcriptionSummaryId, date range, and pagination
24
+ * @param filters - Optional filters including userId, transcriptionSummaryId, sessionId, templateId, date range, and pagination
25
25
  * @returns Paginated response with ratings array, total count, limit, and offset
26
26
  */
27
27
  public async getRatings(
@@ -39,6 +39,12 @@ export class RatingModule extends BaseClient {
39
39
  if (filters.transcriptionSummaryId) {
40
40
  params.append('transcriptionSummaryId', filters.transcriptionSummaryId);
41
41
  }
42
+ if (filters.sessionId) {
43
+ params.append('sessionId', filters.sessionId);
44
+ }
45
+ if (filters.templateId) {
46
+ params.append('templateId', filters.templateId);
47
+ }
42
48
  if (filters.startDate) {
43
49
  params.append('startDate', filters.startDate);
44
50
  }
@@ -104,4 +110,34 @@ export class RatingModule extends BaseClient {
104
110
  ): Promise<SummaryRatingsResponse> {
105
111
  return this.getRatings({ startDate, endDate, limit, offset });
106
112
  }
113
+
114
+ /**
115
+ * Get ratings by session ID (Superuser only)
116
+ * @param sessionId - The session ID to filter ratings by
117
+ * @param limit - Maximum number of ratings to return
118
+ * @param offset - Number of ratings to skip
119
+ * @returns Paginated response with ratings for the specified session
120
+ */
121
+ public async getRatingsBySession(
122
+ sessionId: string,
123
+ limit?: number,
124
+ offset?: number,
125
+ ): Promise<SummaryRatingsResponse> {
126
+ return this.getRatings({ sessionId, limit, offset });
127
+ }
128
+
129
+ /**
130
+ * Get ratings by template ID (Superuser only)
131
+ * @param templateId - The template ID to filter ratings by
132
+ * @param limit - Maximum number of ratings to return
133
+ * @param offset - Number of ratings to skip
134
+ * @returns Paginated response with ratings for the specified template
135
+ */
136
+ public async getRatingsByTemplate(
137
+ templateId: string,
138
+ limit?: number,
139
+ offset?: number,
140
+ ): Promise<SummaryRatingsResponse> {
141
+ return this.getRatings({ templateId, limit, offset });
142
+ }
107
143
  }
package/src/sdk/sdk.ts CHANGED
@@ -875,4 +875,12 @@ export class ApiSDK extends BaseClient {
875
875
  return this.ratings.getRatingsByDateRange(...args);
876
876
  }
877
877
 
878
+ public async getRatingsBySession(...args: Parameters<RatingModule['getRatingsBySession']>) {
879
+ return this.ratings.getRatingsBySession(...args);
880
+ }
881
+
882
+ public async getRatingsByTemplate(...args: Parameters<RatingModule['getRatingsByTemplate']>) {
883
+ return this.ratings.getRatingsByTemplate(...args);
884
+ }
885
+
878
886
  }
@@ -1,22 +1,31 @@
1
1
  import { User } from './user.types';
2
- import { TranscriptionSummary } from './template.types';
2
+ import { TranscriptionSummary, Template } from './template.types';
3
+ import { Session } from './session.types';
3
4
 
4
5
  export interface SummaryRating {
5
6
  id: string;
6
7
  userId: string;
7
8
  datetime: string;
8
9
  transcriptionSummaryId: string | null;
10
+ sessionId: string | null;
11
+ templateId: string | null;
12
+ templateName: string | null;
9
13
  notes: string | null;
10
14
  rating: number;
11
15
  createdAt: string;
12
16
  updatedAt: string;
13
17
  user?: User;
14
18
  transcriptionSummary?: TranscriptionSummary;
19
+ session?: Session;
20
+ template?: Template;
15
21
  }
16
22
 
17
23
  export interface CreateSummaryRatingDto {
18
24
  datetime: string;
19
25
  transcriptionSummaryId?: string;
26
+ sessionId?: string;
27
+ templateId?: string;
28
+ templateName?: string;
20
29
  notes?: string;
21
30
  rating: number;
22
31
  }
@@ -24,6 +33,8 @@ export interface CreateSummaryRatingDto {
24
33
  export interface FilterSummaryRatingsDto {
25
34
  userId?: string;
26
35
  transcriptionSummaryId?: string;
36
+ sessionId?: string;
37
+ templateId?: string;
27
38
  startDate?: string;
28
39
  endDate?: string;
29
40
  limit?: number;