whio-api-sdk 1.0.241-beta-staging → 1.0.242-beta-staging

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,11 +1,11 @@
1
1
  import { BaseClient } from './base-client';
2
- import { Session, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse } from '../types';
2
+ import { Session, SessionsResponse, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse } from '../types';
3
3
  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
7
  getSessionsByUser(userId: string): Promise<Session[]>;
8
- getSessionsByOrganization(): Promise<Session[]>;
8
+ getSessionsByOrganization(limit?: number, offset?: number): Promise<SessionsResponse>;
9
9
  updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
10
10
  deleteSession(id: string): Promise<void>;
11
11
  setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
@@ -30,9 +30,12 @@ export class SessionModule extends BaseClient {
30
30
  return this.request(`${urls.sessions}/user/${userId}`, 'GET');
31
31
  });
32
32
  }
33
- getSessionsByOrganization() {
33
+ getSessionsByOrganization(limit = 100, offset = 0) {
34
34
  return __awaiter(this, void 0, void 0, function* () {
35
- return this.request(`${urls.sessions}/organization`, 'GET');
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');
36
39
  });
37
40
  }
38
41
  updateSession(id, sessionData) {
@@ -124,7 +124,7 @@ export declare class ApiSDK extends BaseClient {
124
124
  getSessions(...args: Parameters<SessionModule['getSessions']>): Promise<import("./types").Session[]>;
125
125
  getSession(...args: Parameters<SessionModule['getSession']>): Promise<import("./types").Session>;
126
126
  getSessionsByUser(...args: Parameters<SessionModule['getSessionsByUser']>): Promise<import("./types").Session[]>;
127
- getSessionsByOrganization(...args: Parameters<SessionModule['getSessionsByOrganization']>): Promise<import("./types").Session[]>;
127
+ getSessionsByOrganization(...args: Parameters<SessionModule['getSessionsByOrganization']>): Promise<import("./types").SessionsResponse>;
128
128
  updateSession(...args: Parameters<SessionModule['updateSession']>): Promise<import("./types").Session>;
129
129
  deleteSession(...args: Parameters<SessionModule['deleteSession']>): Promise<void>;
130
130
  setPrimaryTranscriptionSummary(...args: Parameters<SessionModule['setPrimaryTranscriptionSummary']>): Promise<import("./types").Session>;
@@ -71,3 +71,10 @@ export interface ForwardToTiakiResponse {
71
71
  success: boolean;
72
72
  message?: string;
73
73
  }
74
+ export interface SessionsResponse {
75
+ sessions: Session[];
76
+ total: number;
77
+ limit: number;
78
+ offset: number;
79
+ hasMore: boolean;
80
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whio-api-sdk",
3
- "version": "1.0.241-beta-staging",
3
+ "version": "1.0.242-beta-staging",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -1,5 +1,5 @@
1
1
  import { BaseClient } from './base-client';
2
- import { Session, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse } from '../types';
2
+ import { Session, SessionsResponse, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, ForwardToTiakiResponse } from '../types';
3
3
  import urls from '../urls';
4
4
 
5
5
  export class SessionModule extends BaseClient {
@@ -19,8 +19,11 @@ export class SessionModule extends BaseClient {
19
19
  return this.request<Session[]>(`${urls.sessions}/user/${userId}`, 'GET');
20
20
  }
21
21
 
22
- public async getSessionsByOrganization(): Promise<Session[]> {
23
- return this.request<Session[]>(`${urls.sessions}/organization`, 'GET');
22
+ public async getSessionsByOrganization(limit = 100, offset = 0): Promise<SessionsResponse> {
23
+ const params = new URLSearchParams();
24
+ params.append('limit', limit.toString());
25
+ params.append('offset', offset.toString());
26
+ return this.request<SessionsResponse>(`${urls.sessions}/organization?${params.toString()}`, 'GET');
24
27
  }
25
28
 
26
29
  public async updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session> {
@@ -82,3 +82,11 @@ export interface ForwardToTiakiResponse {
82
82
  success: boolean;
83
83
  message?: string;
84
84
  }
85
+
86
+ export interface SessionsResponse {
87
+ sessions: Session[];
88
+ total: number;
89
+ limit: number;
90
+ offset: number;
91
+ hasMore: boolean;
92
+ }