whio-api-sdk 1.1.27 → 1.1.29

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.
Files changed (102) hide show
  1. package/dist/src/sdk/modules/agent.module.d.ts +90 -5
  2. package/dist/src/sdk/modules/agent.module.js +87 -2
  3. package/dist/src/sdk/modules/audio.module.d.ts +143 -2
  4. package/dist/src/sdk/modules/audio.module.js +144 -5
  5. package/dist/src/sdk/modules/auth.module.d.ts +43 -0
  6. package/dist/src/sdk/modules/auth.module.js +43 -0
  7. package/dist/src/sdk/modules/data-strategy.module.d.ts +45 -7
  8. package/dist/src/sdk/modules/data-strategy.module.js +39 -1
  9. package/dist/src/sdk/modules/external-integration.module.d.ts +30 -0
  10. package/dist/src/sdk/modules/external-integration.module.js +30 -0
  11. package/dist/src/sdk/modules/integration-action.module.d.ts +39 -0
  12. package/dist/src/sdk/modules/integration-action.module.js +39 -0
  13. package/dist/src/sdk/modules/log.module.d.ts +4 -4
  14. package/dist/src/sdk/modules/organization.module.d.ts +62 -3
  15. package/dist/src/sdk/modules/organization.module.js +61 -2
  16. package/dist/src/sdk/modules/patient.module.d.ts +5 -2
  17. package/dist/src/sdk/modules/patient.module.js +5 -2
  18. package/dist/src/sdk/modules/reports.module.d.ts +4 -4
  19. package/dist/src/sdk/modules/reports.module.js +6 -6
  20. package/dist/src/sdk/modules/session/orgadmin-session.module.d.ts +46 -1
  21. package/dist/src/sdk/modules/session/orgadmin-session.module.js +53 -6
  22. package/dist/src/sdk/modules/session/session.module.d.ts +62 -1
  23. package/dist/src/sdk/modules/session/session.module.js +64 -1
  24. package/dist/src/sdk/modules/session/superuser-session.module.d.ts +46 -1
  25. package/dist/src/sdk/modules/session/superuser-session.module.js +52 -5
  26. package/dist/src/sdk/modules/session.module.d.ts +142 -3
  27. package/dist/src/sdk/modules/session.module.js +153 -12
  28. package/dist/src/sdk/modules/team.module.d.ts +56 -4
  29. package/dist/src/sdk/modules/team.module.js +54 -6
  30. package/dist/src/sdk/modules/template.module.d.ts +96 -4
  31. package/dist/src/sdk/modules/template.module.js +95 -24
  32. package/dist/src/sdk/modules/transcription-summary.module.d.ts +60 -3
  33. package/dist/src/sdk/modules/transcription-summary.module.js +60 -7
  34. package/dist/src/sdk/modules/user.module.d.ts +106 -0
  35. package/dist/src/sdk/modules/user.module.js +107 -1
  36. package/dist/src/sdk/modules/websocket.module.d.ts +25 -8
  37. package/dist/src/sdk/modules/websocket.module.js +23 -6
  38. package/dist/src/sdk/modules/workflow.module.d.ts +39 -0
  39. package/dist/src/sdk/modules/workflow.module.js +39 -0
  40. package/dist/src/sdk/sdk.d.ts +19 -29
  41. package/dist/src/sdk/sdk.js +1 -44
  42. package/dist/src/sdk/types/agent.types.d.ts +3 -0
  43. package/dist/src/sdk/types/audio.types.d.ts +8 -9
  44. package/dist/src/sdk/types/data-strategy.types.d.ts +3 -0
  45. package/dist/src/sdk/types/external-integration.types.d.ts +6 -0
  46. package/dist/src/sdk/types/log.types.d.ts +2 -21
  47. package/dist/src/sdk/types/patient.types.d.ts +2 -3
  48. package/dist/src/sdk/types/reports.types.d.ts +1 -1
  49. package/dist/src/sdk/types/session.types.d.ts +8 -8
  50. package/dist/src/sdk/types/team.types.d.ts +4 -3
  51. package/dist/src/sdk/types/template.types.d.ts +15 -7
  52. package/dist/src/sdk/types/user.types.d.ts +6 -0
  53. package/dist/src/sdk/types/websocket.types.d.ts +5 -7
  54. package/dist/src/sdk/urls.d.ts +0 -4
  55. package/dist/src/sdk/urls.js +0 -5
  56. package/dist/src/sdk/whio-orgadmin-sdk.d.ts +7 -7
  57. package/dist/src/sdk/whio-sdk.d.ts +11 -8
  58. package/dist/src/sdk/whio-sdk.js +34 -18
  59. package/dist/src/sdk/whio-superuser-sdk.d.ts +12 -16
  60. package/dist/src/sdk/whio-superuser-sdk.js +1 -16
  61. package/dist/src/sdk/whio-teamadmin-sdk.d.ts +4 -8
  62. package/dist/src/sdk/whio-teamadmin-sdk.js +1 -18
  63. package/package.json +1 -1
  64. package/src/sdk/modules/agent.module.ts +94 -9
  65. package/src/sdk/modules/audio.module.ts +146 -8
  66. package/src/sdk/modules/auth.module.ts +43 -0
  67. package/src/sdk/modules/data-strategy.module.ts +51 -13
  68. package/src/sdk/modules/external-integration.module.ts +30 -0
  69. package/src/sdk/modules/integration-action.module.ts +39 -0
  70. package/src/sdk/modules/log.module.ts +4 -4
  71. package/src/sdk/modules/organization.module.ts +64 -5
  72. package/src/sdk/modules/patient.module.ts +5 -2
  73. package/src/sdk/modules/reports.module.ts +6 -6
  74. package/src/sdk/modules/session/orgadmin-session.module.ts +53 -7
  75. package/src/sdk/modules/session/session.module.ts +64 -2
  76. package/src/sdk/modules/session/superuser-session.module.ts +52 -6
  77. package/src/sdk/modules/session.module.ts +155 -15
  78. package/src/sdk/modules/team.module.ts +58 -9
  79. package/src/sdk/modules/template.module.ts +95 -32
  80. package/src/sdk/modules/transcription-summary.module.ts +62 -8
  81. package/src/sdk/modules/user.module.ts +108 -2
  82. package/src/sdk/modules/websocket.module.ts +26 -8
  83. package/src/sdk/modules/workflow.module.ts +39 -0
  84. package/src/sdk/sdk.ts +1 -37
  85. package/src/sdk/types/agent.types.ts +5 -0
  86. package/src/sdk/types/audio.types.ts +8 -10
  87. package/src/sdk/types/data-strategy.types.ts +3 -0
  88. package/src/sdk/types/external-integration.types.ts +6 -0
  89. package/src/sdk/types/log.types.ts +4 -23
  90. package/src/sdk/types/patient.types.ts +2 -3
  91. package/src/sdk/types/reports.types.ts +1 -1
  92. package/src/sdk/types/session.types.ts +8 -8
  93. package/src/sdk/types/team.types.ts +5 -3
  94. package/src/sdk/types/template.types.ts +18 -7
  95. package/src/sdk/types/user.types.ts +6 -0
  96. package/src/sdk/types/websocket.types.ts +12 -7
  97. package/src/sdk/urls.ts +0 -7
  98. package/src/sdk/whio-sdk.ts +29 -16
  99. package/src/sdk/whio-superuser-sdk.ts +1 -16
  100. package/src/sdk/whio-teamadmin-sdk.ts +1 -16
  101. package/tsconfig.json +1 -1
  102. package/src/sdk/modules/debug.module.ts +0 -44
@@ -1,10 +1,49 @@
1
1
  import { BaseClient } from './base-client';
2
2
  import { IntegrationAction } from '../types';
3
3
  export declare class IntegrationActionModule extends BaseClient {
4
+ /**
5
+ * Create an integration action for an organization.
6
+ *
7
+ * @param name - Display name of the integration action.
8
+ * @param organizationId - Optional organization UUID; defaults to the current user's organization.
9
+ * @returns The created integration action.
10
+ */
4
11
  createIntegrationAction(name: string, organizationId?: string): Promise<IntegrationAction>;
12
+ /**
13
+ * List integration actions, optionally filtered by organization.
14
+ *
15
+ * @param organizationId - Optional organization UUID to filter by.
16
+ * @returns An array of integration actions.
17
+ */
5
18
  getIntegrationActions(organizationId?: string): Promise<IntegrationAction[]>;
19
+ /**
20
+ * Get a single integration action by id.
21
+ *
22
+ * @param id - UUID of the integration action.
23
+ * @returns The integration action.
24
+ */
6
25
  getIntegrationAction(id: string): Promise<IntegrationAction>;
26
+ /**
27
+ * Get the integration actions for a specific organization.
28
+ *
29
+ * @param organizationId - Optional organization UUID; defaults to the current user's organization.
30
+ * @returns An array of integration actions for the organization.
31
+ */
7
32
  getIntegrationActionsByOrganization(organizationId?: string): Promise<IntegrationAction[]>;
33
+ /**
34
+ * Update an integration action.
35
+ *
36
+ * @param id - UUID of the integration action to update.
37
+ * @param name - New display name of the integration action.
38
+ * @param organizationId - Optional organization UUID; defaults to the current user's organization.
39
+ * @returns The updated integration action.
40
+ */
8
41
  updateIntegrationAction(id: string, name: string, organizationId?: string): Promise<IntegrationAction>;
42
+ /**
43
+ * Delete an integration action.
44
+ *
45
+ * @param id - UUID of the integration action to delete.
46
+ * @returns A promise that resolves when the integration action has been deleted.
47
+ */
9
48
  deleteIntegrationAction(id: string): Promise<void>;
10
49
  }
@@ -10,6 +10,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { BaseClient } from './base-client';
11
11
  import urls from '../urls';
12
12
  export class IntegrationActionModule extends BaseClient {
13
+ /**
14
+ * Create an integration action for an organization.
15
+ *
16
+ * @param name - Display name of the integration action.
17
+ * @param organizationId - Optional organization UUID; defaults to the current user's organization.
18
+ * @returns The created integration action.
19
+ */
13
20
  createIntegrationAction(name, organizationId) {
14
21
  return __awaiter(this, void 0, void 0, function* () {
15
22
  const dto = {
@@ -19,23 +26,49 @@ export class IntegrationActionModule extends BaseClient {
19
26
  return this.request(urls.integrationActions, 'POST', dto);
20
27
  });
21
28
  }
29
+ /**
30
+ * List integration actions, optionally filtered by organization.
31
+ *
32
+ * @param organizationId - Optional organization UUID to filter by.
33
+ * @returns An array of integration actions.
34
+ */
22
35
  getIntegrationActions(organizationId) {
23
36
  return __awaiter(this, void 0, void 0, function* () {
24
37
  const params = organizationId ? `?organizationId=${organizationId}` : '';
25
38
  return this.request(`${urls.integrationActions}${params}`, 'GET');
26
39
  });
27
40
  }
41
+ /**
42
+ * Get a single integration action by id.
43
+ *
44
+ * @param id - UUID of the integration action.
45
+ * @returns The integration action.
46
+ */
28
47
  getIntegrationAction(id) {
29
48
  return __awaiter(this, void 0, void 0, function* () {
30
49
  return this.request(`${urls.integrationActions}/${id}`, 'GET');
31
50
  });
32
51
  }
52
+ /**
53
+ * Get the integration actions for a specific organization.
54
+ *
55
+ * @param organizationId - Optional organization UUID; defaults to the current user's organization.
56
+ * @returns An array of integration actions for the organization.
57
+ */
33
58
  getIntegrationActionsByOrganization(organizationId) {
34
59
  return __awaiter(this, void 0, void 0, function* () {
35
60
  const orgId = organizationId || this.user.organizationId;
36
61
  return this.request(`${urls.integrationActions}?organizationId=${orgId}`, 'GET');
37
62
  });
38
63
  }
64
+ /**
65
+ * Update an integration action.
66
+ *
67
+ * @param id - UUID of the integration action to update.
68
+ * @param name - New display name of the integration action.
69
+ * @param organizationId - Optional organization UUID; defaults to the current user's organization.
70
+ * @returns The updated integration action.
71
+ */
39
72
  updateIntegrationAction(id, name, organizationId) {
40
73
  return __awaiter(this, void 0, void 0, function* () {
41
74
  const dto = {
@@ -45,6 +78,12 @@ export class IntegrationActionModule extends BaseClient {
45
78
  return this.request(`${urls.integrationActions}/${id}`, 'PATCH', dto);
46
79
  });
47
80
  }
81
+ /**
82
+ * Delete an integration action.
83
+ *
84
+ * @param id - UUID of the integration action to delete.
85
+ * @returns A promise that resolves when the integration action has been deleted.
86
+ */
48
87
  deleteIntegrationAction(id) {
49
88
  return __awaiter(this, void 0, void 0, function* () {
50
89
  yield this.request(`${urls.integrationActions}/${id}`, 'DELETE');
@@ -32,10 +32,10 @@ export declare class LogModule extends BaseClient {
32
32
  /**
33
33
  * Convenience methods for different log levels
34
34
  */
35
- logInfo(message: string, context?: string, action?: string, data?: any): Promise<Log>;
36
- logError(message: string, context?: string, action?: string, data?: any): Promise<Log>;
37
- logWarn(message: string, context?: string, action?: string, data?: any): Promise<Log>;
38
- logDebug(message: string, context?: string, action?: string, data?: any): Promise<Log>;
35
+ logInfo(message: string, context?: string, action?: string, data?: Record<string, unknown>): Promise<Log>;
36
+ logError(message: string, context?: string, action?: string, data?: Record<string, unknown>): Promise<Log>;
37
+ logWarn(message: string, context?: string, action?: string, data?: Record<string, unknown>): Promise<Log>;
38
+ logDebug(message: string, context?: string, action?: string, data?: Record<string, unknown>): Promise<Log>;
39
39
  /**
40
40
  * Get logs by role
41
41
  */
@@ -1,13 +1,72 @@
1
1
  import { BaseClient } from './base-client';
2
- import { Organization } from '../types';
2
+ import { Organization, User } from '../types';
3
3
  export declare class OrganizationModule extends BaseClient {
4
+ /**
5
+ * Create a new organization.
6
+ *
7
+ * @param name - Display name of the organization.
8
+ * @param description - Optional description of the organization.
9
+ * @returns The newly created organization.
10
+ */
4
11
  createOrganization(name: string, description?: string): Promise<Organization>;
12
+ /**
13
+ * List all organizations the current user can access.
14
+ *
15
+ * @returns An array of organizations.
16
+ */
5
17
  getOrganizations(): Promise<Organization[]>;
18
+ /**
19
+ * Get a single organization by ID.
20
+ *
21
+ * @param id - UUID of the organization.
22
+ * @returns The requested organization.
23
+ */
6
24
  getOrganization(id: string): Promise<Organization>;
25
+ /**
26
+ * Update an organization's name and/or description.
27
+ *
28
+ * @param id - UUID of the organization to update.
29
+ * @param name - New display name for the organization.
30
+ * @param description - New description for the organization.
31
+ * @returns The updated organization.
32
+ */
7
33
  updateOrganization(id: string, name?: string, description?: string): Promise<Organization>;
34
+ /**
35
+ * Delete an organization by ID.
36
+ *
37
+ * @param id - UUID of the organization to delete.
38
+ * @returns A promise that resolves when the organization is deleted.
39
+ */
8
40
  deleteOrganization(id: string): Promise<void>;
9
- addUserToOrganization(organizationId: string, userId: string): Promise<void>;
10
- removeUserFromOrganization(organizationId: string, userId: string): Promise<void>;
41
+ /**
42
+ * Add a user to an organization.
43
+ *
44
+ * @param organizationId - UUID of the organization.
45
+ * @param userId - UUID of the user to add.
46
+ * @returns The user as a member of the organization.
47
+ */
48
+ addUserToOrganization(organizationId: string, userId: string): Promise<User>;
49
+ /**
50
+ * Remove a user from an organization.
51
+ *
52
+ * @param organizationId - UUID of the organization.
53
+ * @param userId - UUID of the user to remove.
54
+ * @returns The removed organization member.
55
+ */
56
+ removeUserFromOrganization(organizationId: string, userId: string): Promise<User>;
57
+ /**
58
+ * Link an external integration to an organization.
59
+ *
60
+ * @param organizationId - UUID of the organization.
61
+ * @param integrationId - UUID of the external integration to link.
62
+ * @returns The updated organization.
63
+ */
11
64
  linkExternalIntegration(organizationId: string, integrationId: string): Promise<Organization>;
65
+ /**
66
+ * Unlink the external integration from an organization.
67
+ *
68
+ * @param organizationId - UUID of the organization.
69
+ * @returns The updated organization.
70
+ */
12
71
  unlinkExternalIntegration(organizationId: string): Promise<Organization>;
13
72
  }
@@ -10,48 +10,107 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  import { BaseClient } from './base-client';
11
11
  import urls from '../urls';
12
12
  export class OrganizationModule extends BaseClient {
13
+ /**
14
+ * Create a new organization.
15
+ *
16
+ * @param name - Display name of the organization.
17
+ * @param description - Optional description of the organization.
18
+ * @returns The newly created organization.
19
+ */
13
20
  createOrganization(name, description) {
14
21
  return __awaiter(this, void 0, void 0, function* () {
15
22
  const dto = { name, description };
16
23
  return this.request(urls.organizations, 'POST', dto);
17
24
  });
18
25
  }
26
+ /**
27
+ * List all organizations the current user can access.
28
+ *
29
+ * @returns An array of organizations.
30
+ */
19
31
  getOrganizations() {
20
32
  return __awaiter(this, void 0, void 0, function* () {
21
33
  return this.request(urls.organizations, 'GET');
22
34
  });
23
35
  }
36
+ /**
37
+ * Get a single organization by ID.
38
+ *
39
+ * @param id - UUID of the organization.
40
+ * @returns The requested organization.
41
+ */
24
42
  getOrganization(id) {
25
43
  return __awaiter(this, void 0, void 0, function* () {
26
44
  return this.request(`${urls.organizations}/${id}`, 'GET');
27
45
  });
28
46
  }
47
+ /**
48
+ * Update an organization's name and/or description.
49
+ *
50
+ * @param id - UUID of the organization to update.
51
+ * @param name - New display name for the organization.
52
+ * @param description - New description for the organization.
53
+ * @returns The updated organization.
54
+ */
29
55
  updateOrganization(id, name, description) {
30
56
  return __awaiter(this, void 0, void 0, function* () {
31
57
  const dto = { name, description };
32
58
  return this.request(`${urls.organizations}/${id}`, 'PATCH', dto);
33
59
  });
34
60
  }
61
+ /**
62
+ * Delete an organization by ID.
63
+ *
64
+ * @param id - UUID of the organization to delete.
65
+ * @returns A promise that resolves when the organization is deleted.
66
+ */
35
67
  deleteOrganization(id) {
36
68
  return __awaiter(this, void 0, void 0, function* () {
37
69
  yield this.request(`${urls.organizations}/${id}`, 'DELETE');
38
70
  });
39
71
  }
72
+ /**
73
+ * Add a user to an organization.
74
+ *
75
+ * @param organizationId - UUID of the organization.
76
+ * @param userId - UUID of the user to add.
77
+ * @returns The user as a member of the organization.
78
+ */
40
79
  addUserToOrganization(organizationId, userId) {
41
80
  return __awaiter(this, void 0, void 0, function* () {
42
- yield this.request(`${urls.organizations}/${organizationId}/users/${userId}`, 'POST');
81
+ return this.request(`${urls.organizations}/${organizationId}/users/${userId}`, 'POST');
43
82
  });
44
83
  }
84
+ /**
85
+ * Remove a user from an organization.
86
+ *
87
+ * @param organizationId - UUID of the organization.
88
+ * @param userId - UUID of the user to remove.
89
+ * @returns The removed organization member.
90
+ */
45
91
  removeUserFromOrganization(organizationId, userId) {
46
92
  return __awaiter(this, void 0, void 0, function* () {
47
- yield this.request(`${urls.organizations}/${organizationId}/users/${userId}`, 'DELETE');
93
+ return this.request(`${urls.organizations}/${organizationId}/users/${userId}`, 'DELETE');
48
94
  });
49
95
  }
96
+ /**
97
+ * Link an external integration to an organization.
98
+ *
99
+ * @param organizationId - UUID of the organization.
100
+ * @param integrationId - UUID of the external integration to link.
101
+ * @returns The updated organization.
102
+ */
50
103
  linkExternalIntegration(organizationId, integrationId) {
51
104
  return __awaiter(this, void 0, void 0, function* () {
52
105
  return this.request(`${urls.organizations}/${organizationId}/external-integration/${integrationId}`, 'POST');
53
106
  });
54
107
  }
108
+ /**
109
+ * Unlink the external integration from an organization.
110
+ *
111
+ * @param organizationId - UUID of the organization.
112
+ * @returns The updated organization.
113
+ */
55
114
  unlinkExternalIntegration(organizationId) {
56
115
  return __awaiter(this, void 0, void 0, function* () {
57
116
  return this.request(`${urls.organizations}/${organizationId}/external-integration`, 'DELETE');
@@ -5,8 +5,11 @@ import { PatientsFromIntegrationResponse } from '../types/patient.types';
5
5
  */
6
6
  export declare class PatientModule extends BaseClient {
7
7
  /**
8
- * Get patients from external integration (Tiaki)
9
- * Returns an empty array if no integration is configured
8
+ * Get patients from the external integration (Tiaki).
9
+ *
10
+ * The API strips sensitive fields (e.g. national id), so only safe fields are returned.
11
+ *
12
+ * @returns An array of safe patient records, or an empty array if no integration is configured.
10
13
  */
11
14
  getPatientsFromIntegration(): Promise<PatientsFromIntegrationResponse>;
12
15
  }
@@ -14,8 +14,11 @@ import urls from '../urls';
14
14
  */
15
15
  export class PatientModule extends BaseClient {
16
16
  /**
17
- * Get patients from external integration (Tiaki)
18
- * Returns an empty array if no integration is configured
17
+ * Get patients from the external integration (Tiaki).
18
+ *
19
+ * The API strips sensitive fields (e.g. national id), so only safe fields are returned.
20
+ *
21
+ * @returns An array of safe patient records, or an empty array if no integration is configured.
19
22
  */
20
23
  getPatientsFromIntegration() {
21
24
  return __awaiter(this, void 0, void 0, function* () {
@@ -2,14 +2,14 @@ import { BaseClient } from './base-client';
2
2
  export declare class ReportsModule extends BaseClient {
3
3
  /**
4
4
  * Get company daily report as CSV
5
- * @param companyId - The organization/company ID to generate the report for
5
+ * @param organizationId - The organization/company ID to generate the report for
6
6
  * @returns Promise<string> - CSV content with daily user counts and session counts
7
7
  */
8
- getCompanyDailyReportCsv(companyId: string): Promise<string>;
8
+ getCompanyDailyReportCsv(organizationId: string): Promise<string>;
9
9
  /**
10
10
  * Download company daily report as CSV file
11
- * @param companyId - The organization/company ID to generate the report for
11
+ * @param organizationId - The organization/company ID to generate the report for
12
12
  * @returns Promise<Blob> - CSV file as blob for download
13
13
  */
14
- downloadCompanyDailyReport(companyId: string): Promise<Blob>;
14
+ downloadCompanyDailyReport(organizationId: string): Promise<Blob>;
15
15
  }
@@ -12,22 +12,22 @@ import urls from '../urls';
12
12
  export class ReportsModule extends BaseClient {
13
13
  /**
14
14
  * Get company daily report as CSV
15
- * @param companyId - The organization/company ID to generate the report for
15
+ * @param organizationId - The organization/company ID to generate the report for
16
16
  * @returns Promise<string> - CSV content with daily user counts and session counts
17
17
  */
18
- getCompanyDailyReportCsv(companyId) {
18
+ getCompanyDailyReportCsv(organizationId) {
19
19
  return __awaiter(this, void 0, void 0, function* () {
20
- return this.textRequest(`${urls.reports}/company-daily?companyId=${companyId}`);
20
+ return this.textRequest(`${urls.reports}/company-daily?organizationId=${organizationId}`);
21
21
  });
22
22
  }
23
23
  /**
24
24
  * Download company daily report as CSV file
25
- * @param companyId - The organization/company ID to generate the report for
25
+ * @param organizationId - The organization/company ID to generate the report for
26
26
  * @returns Promise<Blob> - CSV file as blob for download
27
27
  */
28
- downloadCompanyDailyReport(companyId) {
28
+ downloadCompanyDailyReport(organizationId) {
29
29
  return __awaiter(this, void 0, void 0, function* () {
30
- return this.downloadRequest(`${urls.reports}/company-daily?companyId=${companyId}`);
30
+ return this.downloadRequest(`${urls.reports}/company-daily?organizationId=${organizationId}`);
31
31
  });
32
32
  }
33
33
  }
@@ -4,12 +4,57 @@ import { Session, SessionsResponse, UpdateSessionDto, SearchSessionsDto, SearchS
4
4
  * Session module for organization admins - provides access to sessions within their organization
5
5
  */
6
6
  export declare class OrgAdminSessionModule extends BaseClient {
7
+ /**
8
+ * Retrieve all sessions belonging to a specific user.
9
+ *
10
+ * @param userId - UUID of the user whose sessions to fetch.
11
+ * @returns The user's sessions.
12
+ */
7
13
  getSessionsByUser(userId: string): Promise<Session[]>;
14
+ /**
15
+ * Retrieve a paginated list of sessions for the organization.
16
+ *
17
+ * @param limit - Maximum number of sessions to return (default 100).
18
+ * @param offset - Number of sessions to skip for pagination (default 0).
19
+ * @returns A paginated sessions response.
20
+ */
8
21
  getSessionsByOrganization(limit?: number, offset?: number): Promise<SessionsResponse>;
22
+ /**
23
+ * Search sessions using the provided filters.
24
+ *
25
+ * @param filters - Optional search filters (date range, user, template, pagination, etc.).
26
+ * @returns A paginated search response of matching sessions.
27
+ */
9
28
  searchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
29
+ /**
30
+ * Update a session.
31
+ *
32
+ * @param id - UUID of the session to update.
33
+ * @param sessionData - Fields to update on the session.
34
+ * @returns The updated session.
35
+ */
10
36
  updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
11
- deleteSession(id: string): Promise<void>;
37
+ /**
38
+ * Delete a session.
39
+ *
40
+ * @param id - UUID of the session to delete.
41
+ * @returns The deleted session.
42
+ */
43
+ deleteSession(id: string): Promise<Session>;
44
+ /**
45
+ * Set the primary transcription summary for a session.
46
+ *
47
+ * @param sessionId - UUID of the session.
48
+ * @param summaryId - UUID of the transcription summary to mark as primary.
49
+ * @returns The updated session.
50
+ */
12
51
  setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
52
+ /**
53
+ * Retrieve a single session by its id.
54
+ *
55
+ * @param id - UUID of the session to fetch.
56
+ * @returns The requested session.
57
+ */
13
58
  getSession(id: string): Promise<Session>;
14
59
  private buildSearchParams;
15
60
  }
@@ -13,42 +13,87 @@ import urls from '../../urls';
13
13
  * Session module for organization admins - provides access to sessions within their organization
14
14
  */
15
15
  export class OrgAdminSessionModule extends BaseClient {
16
+ /**
17
+ * Retrieve all sessions belonging to a specific user.
18
+ *
19
+ * @param userId - UUID of the user whose sessions to fetch.
20
+ * @returns The user's sessions.
21
+ */
16
22
  getSessionsByUser(userId) {
17
23
  return __awaiter(this, void 0, void 0, function* () {
18
- return this.request(`${urls.sessions}/orgadmin/user/${userId}`, 'GET');
24
+ return this.request(`${urls.sessions}/user/${userId}`, 'GET');
19
25
  });
20
26
  }
27
+ /**
28
+ * Retrieve a paginated list of sessions for the organization.
29
+ *
30
+ * @param limit - Maximum number of sessions to return (default 100).
31
+ * @param offset - Number of sessions to skip for pagination (default 0).
32
+ * @returns A paginated sessions response.
33
+ */
21
34
  getSessionsByOrganization(limit = 100, offset = 0) {
22
35
  return __awaiter(this, void 0, void 0, function* () {
23
36
  const params = new URLSearchParams();
24
37
  params.append('limit', limit.toString());
25
38
  params.append('offset', offset.toString());
26
- return this.request(`${urls.sessions}/orgadmin/organization?${params.toString()}`, 'GET');
39
+ return this.request(`${urls.sessions}/organization?${params.toString()}`, 'GET');
27
40
  });
28
41
  }
42
+ /**
43
+ * Search sessions using the provided filters.
44
+ *
45
+ * @param filters - Optional search filters (date range, user, template, pagination, etc.).
46
+ * @returns A paginated search response of matching sessions.
47
+ */
29
48
  searchSessions(filters = {}) {
30
49
  return __awaiter(this, void 0, void 0, function* () {
31
50
  const params = this.buildSearchParams(filters);
32
51
  const queryString = params.toString();
33
- const url = queryString ? `${urls.sessions}/orgadmin/search?${queryString}` : `${urls.sessions}/orgadmin/search`;
52
+ const url = queryString ? `${urls.sessions}/search?${queryString}` : `${urls.sessions}/search`;
34
53
  return this.request(url, 'GET');
35
54
  });
36
55
  }
56
+ /**
57
+ * Update a session.
58
+ *
59
+ * @param id - UUID of the session to update.
60
+ * @param sessionData - Fields to update on the session.
61
+ * @returns The updated session.
62
+ */
37
63
  updateSession(id, sessionData) {
38
64
  return __awaiter(this, void 0, void 0, function* () {
39
- return this.request(`${urls.sessions}/orgadmin/${id}`, 'PATCH', sessionData);
65
+ return this.request(`${urls.sessions}/${id}`, 'PATCH', sessionData);
40
66
  });
41
67
  }
68
+ /**
69
+ * Delete a session.
70
+ *
71
+ * @param id - UUID of the session to delete.
72
+ * @returns The deleted session.
73
+ */
42
74
  deleteSession(id) {
43
75
  return __awaiter(this, void 0, void 0, function* () {
44
- yield this.request(`${urls.sessions}/orgadmin/${id}`, 'DELETE');
76
+ return this.request(`${urls.sessions}/${id}`, 'DELETE');
45
77
  });
46
78
  }
79
+ /**
80
+ * Set the primary transcription summary for a session.
81
+ *
82
+ * @param sessionId - UUID of the session.
83
+ * @param summaryId - UUID of the transcription summary to mark as primary.
84
+ * @returns The updated session.
85
+ */
47
86
  setPrimaryTranscriptionSummary(sessionId, summaryId) {
48
87
  return __awaiter(this, void 0, void 0, function* () {
49
- return this.request(`${urls.sessions}/orgadmin/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
88
+ return this.request(`${urls.sessions}/${sessionId}/primary-summary/${summaryId}`, 'PATCH');
50
89
  });
51
90
  }
91
+ /**
92
+ * Retrieve a single session by its id.
93
+ *
94
+ * @param id - UUID of the session to fetch.
95
+ * @returns The requested session.
96
+ */
52
97
  getSession(id) {
53
98
  return __awaiter(this, void 0, void 0, function* () {
54
99
  return this.request(`${urls.sessions}/${id}`, 'GET');
@@ -74,6 +119,8 @@ export class OrgAdminSessionModule extends BaseClient {
74
119
  params.append('hasSummary', filters.hasSummary.toString());
75
120
  if (filters.includeTranscriptions !== undefined)
76
121
  params.append('includeTranscriptions', filters.includeTranscriptions.toString());
122
+ if (filters.includeArchived !== undefined)
123
+ params.append('includeArchived', filters.includeArchived.toString());
77
124
  if (filters.limit !== undefined)
78
125
  params.append('limit', filters.limit.toString());
79
126
  if (filters.offset !== undefined)
@@ -4,18 +4,79 @@ import { Session, CreateSessionDto, UpdateSessionDto, SetAudioStreamStatusDto, F
4
4
  * Session module for regular users - provides access to own sessions only
5
5
  */
6
6
  export declare class SessionModule extends BaseClient {
7
+ /**
8
+ * Create a new session.
9
+ *
10
+ * @param sessionData - The session payload to create.
11
+ * @returns The created session.
12
+ */
7
13
  createSession(sessionData: CreateSessionDto): Promise<Session>;
14
+ /**
15
+ * Retrieve the authenticated user's own sessions.
16
+ *
17
+ * @returns The current user's sessions.
18
+ */
8
19
  getSessions(): Promise<Session[]>;
20
+ /**
21
+ * Retrieve a single session by its id.
22
+ *
23
+ * @param id - UUID of the session to fetch.
24
+ * @returns The requested session.
25
+ */
9
26
  getSession(id: string): Promise<Session>;
27
+ /**
28
+ * Update a session.
29
+ *
30
+ * @param id - UUID of the session to update.
31
+ * @param sessionData - Fields to update on the session.
32
+ * @returns The updated session.
33
+ */
10
34
  updateSession(id: string, sessionData: UpdateSessionDto): Promise<Session>;
11
- deleteSession(id: string): Promise<void>;
35
+ /**
36
+ * Delete a session.
37
+ *
38
+ * @param id - UUID of the session to delete.
39
+ * @returns The deleted session.
40
+ */
41
+ deleteSession(id: string): Promise<Session>;
42
+ /**
43
+ * Set the primary transcription summary for a session.
44
+ *
45
+ * @param sessionId - UUID of the session.
46
+ * @param summaryId - UUID of the transcription summary to mark as primary.
47
+ * @returns The updated session.
48
+ */
12
49
  setPrimaryTranscriptionSummary(sessionId: string, summaryId: string): Promise<Session>;
50
+ /**
51
+ * Re-run transcription for a session.
52
+ *
53
+ * @param sessionId - UUID of the session to re-transcribe.
54
+ * @returns A confirmation message with the session id.
55
+ */
13
56
  rerunTranscription(sessionId: string): Promise<{
14
57
  message: string;
15
58
  sessionId: string;
16
59
  }>;
60
+ /**
61
+ * Update the audio stream status of a session.
62
+ *
63
+ * @param data - The session id and the new audio stream status.
64
+ * @returns The updated session.
65
+ */
17
66
  setAudioStreamStatus(data: SetAudioStreamStatusDto): Promise<Session>;
67
+ /**
68
+ * Forward a session to Tiaki.
69
+ *
70
+ * @param sessionId - UUID of the session to forward.
71
+ * @returns A response containing a status message.
72
+ */
18
73
  forwardToTiaki(sessionId: string): Promise<ForwardToTiakiResponse>;
74
+ /**
75
+ * Search the authenticated user's sessions using the provided filters.
76
+ *
77
+ * @param filters - Optional search filters (date range, user, template, pagination, etc.).
78
+ * @returns A paginated search response of matching sessions.
79
+ */
19
80
  searchSessions(filters?: SearchSessionsDto): Promise<SearchSessionsResponse>;
20
81
  protected buildSearchParams(filters: SearchSessionsDto): URLSearchParams;
21
82
  }