whio-api-sdk 1.1.28 → 1.1.33
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/agent.module.d.ts +90 -5
- package/dist/src/sdk/modules/agent.module.js +87 -2
- package/dist/src/sdk/modules/audio.module.d.ts +143 -2
- package/dist/src/sdk/modules/audio.module.js +144 -5
- package/dist/src/sdk/modules/auth.module.d.ts +67 -0
- package/dist/src/sdk/modules/auth.module.js +81 -0
- package/dist/src/sdk/modules/data-strategy.module.d.ts +45 -7
- package/dist/src/sdk/modules/data-strategy.module.js +39 -1
- package/dist/src/sdk/modules/external-integration.module.d.ts +30 -0
- package/dist/src/sdk/modules/external-integration.module.js +30 -0
- package/dist/src/sdk/modules/integration-action.module.d.ts +39 -0
- package/dist/src/sdk/modules/integration-action.module.js +39 -0
- package/dist/src/sdk/modules/log.module.d.ts +4 -4
- package/dist/src/sdk/modules/organization.module.d.ts +62 -3
- package/dist/src/sdk/modules/organization.module.js +61 -2
- package/dist/src/sdk/modules/patient.module.d.ts +5 -2
- package/dist/src/sdk/modules/patient.module.js +5 -2
- package/dist/src/sdk/modules/reports.module.d.ts +4 -4
- package/dist/src/sdk/modules/reports.module.js +6 -6
- package/dist/src/sdk/modules/session/orgadmin-session.module.d.ts +46 -1
- package/dist/src/sdk/modules/session/orgadmin-session.module.js +53 -6
- package/dist/src/sdk/modules/session/session.module.d.ts +62 -1
- package/dist/src/sdk/modules/session/session.module.js +64 -1
- package/dist/src/sdk/modules/session/superuser-session.module.d.ts +46 -1
- package/dist/src/sdk/modules/session/superuser-session.module.js +52 -5
- package/dist/src/sdk/modules/session.module.d.ts +142 -3
- package/dist/src/sdk/modules/session.module.js +153 -12
- package/dist/src/sdk/modules/team.module.d.ts +56 -4
- package/dist/src/sdk/modules/team.module.js +54 -6
- package/dist/src/sdk/modules/template.module.d.ts +96 -4
- package/dist/src/sdk/modules/template.module.js +95 -24
- package/dist/src/sdk/modules/transcription-summary.module.d.ts +60 -3
- package/dist/src/sdk/modules/transcription-summary.module.js +60 -7
- package/dist/src/sdk/modules/user.module.d.ts +127 -0
- package/dist/src/sdk/modules/user.module.js +136 -1
- package/dist/src/sdk/modules/websocket.module.d.ts +25 -8
- package/dist/src/sdk/modules/websocket.module.js +23 -6
- package/dist/src/sdk/modules/workflow.module.d.ts +39 -0
- package/dist/src/sdk/modules/workflow.module.js +39 -0
- package/dist/src/sdk/sdk.d.ts +23 -29
- package/dist/src/sdk/sdk.js +14 -44
- package/dist/src/sdk/types/agent.types.d.ts +3 -0
- package/dist/src/sdk/types/audio.types.d.ts +8 -9
- package/dist/src/sdk/types/data-strategy.types.d.ts +3 -0
- package/dist/src/sdk/types/external-integration.types.d.ts +6 -0
- package/dist/src/sdk/types/log.types.d.ts +2 -21
- package/dist/src/sdk/types/patient.types.d.ts +2 -3
- package/dist/src/sdk/types/reports.types.d.ts +1 -1
- package/dist/src/sdk/types/session.types.d.ts +8 -8
- package/dist/src/sdk/types/team.types.d.ts +4 -3
- package/dist/src/sdk/types/template.types.d.ts +15 -7
- package/dist/src/sdk/types/user.types.d.ts +6 -0
- package/dist/src/sdk/types/websocket.types.d.ts +4 -10
- package/dist/src/sdk/urls.d.ts +2 -4
- package/dist/src/sdk/urls.js +2 -5
- package/dist/src/sdk/whio-orgadmin-sdk.d.ts +9 -7
- package/dist/src/sdk/whio-orgadmin-sdk.js +10 -0
- package/dist/src/sdk/whio-sdk.d.ts +15 -8
- package/dist/src/sdk/whio-sdk.js +46 -18
- package/dist/src/sdk/whio-superuser-sdk.d.ts +14 -16
- package/dist/src/sdk/whio-superuser-sdk.js +11 -16
- package/dist/src/sdk/whio-teamadmin-sdk.d.ts +4 -8
- package/dist/src/sdk/whio-teamadmin-sdk.js +1 -18
- package/package.json +1 -1
- package/src/sdk/modules/agent.module.ts +94 -9
- package/src/sdk/modules/audio.module.ts +146 -8
- package/src/sdk/modules/auth.module.ts +88 -0
- package/src/sdk/modules/data-strategy.module.ts +51 -13
- package/src/sdk/modules/external-integration.module.ts +30 -0
- package/src/sdk/modules/integration-action.module.ts +39 -0
- package/src/sdk/modules/log.module.ts +4 -4
- package/src/sdk/modules/organization.module.ts +64 -5
- package/src/sdk/modules/patient.module.ts +5 -2
- package/src/sdk/modules/reports.module.ts +6 -6
- package/src/sdk/modules/session/orgadmin-session.module.ts +53 -7
- package/src/sdk/modules/session/session.module.ts +64 -2
- package/src/sdk/modules/session/superuser-session.module.ts +52 -6
- package/src/sdk/modules/session.module.ts +155 -15
- package/src/sdk/modules/team.module.ts +58 -9
- package/src/sdk/modules/template.module.ts +95 -32
- package/src/sdk/modules/transcription-summary.module.ts +62 -8
- package/src/sdk/modules/user.module.ts +135 -2
- package/src/sdk/modules/websocket.module.ts +26 -8
- package/src/sdk/modules/workflow.module.ts +39 -0
- package/src/sdk/sdk.ts +12 -37
- package/src/sdk/types/agent.types.ts +5 -0
- package/src/sdk/types/audio.types.ts +8 -10
- package/src/sdk/types/data-strategy.types.ts +3 -0
- package/src/sdk/types/external-integration.types.ts +6 -0
- package/src/sdk/types/log.types.ts +4 -23
- package/src/sdk/types/patient.types.ts +2 -3
- package/src/sdk/types/reports.types.ts +1 -1
- package/src/sdk/types/session.types.ts +8 -8
- package/src/sdk/types/team.types.ts +5 -3
- package/src/sdk/types/template.types.ts +18 -7
- package/src/sdk/types/user.types.ts +6 -0
- package/src/sdk/types/websocket.types.ts +8 -7
- package/src/sdk/urls.ts +3 -8
- package/src/sdk/whio-orgadmin-sdk.ts +8 -0
- package/src/sdk/whio-sdk.ts +39 -16
- package/src/sdk/whio-superuser-sdk.ts +9 -16
- package/src/sdk/whio-teamadmin-sdk.ts +1 -16
- package/tsconfig.json +1 -1
- package/src/sdk/modules/debug.module.ts +0 -44
|
@@ -10,26 +10,56 @@ 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 ExternalIntegrationModule extends BaseClient {
|
|
13
|
+
/**
|
|
14
|
+
* Create an external integration. The `apiKey` is sent as plaintext and stored encrypted at rest.
|
|
15
|
+
*
|
|
16
|
+
* @param data - The external integration payload (endpoints, apiKey, headerName, etc.).
|
|
17
|
+
* @returns The created external integration (its `apiKey` is returned masked).
|
|
18
|
+
*/
|
|
13
19
|
createExternalIntegration(data) {
|
|
14
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
15
21
|
return this.request(urls.externalIntegrations, 'POST', data);
|
|
16
22
|
});
|
|
17
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* List all external integrations.
|
|
26
|
+
*
|
|
27
|
+
* @returns An array of external integrations (each `apiKey` is returned masked).
|
|
28
|
+
*/
|
|
18
29
|
getExternalIntegrations() {
|
|
19
30
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
31
|
return this.request(urls.externalIntegrations, 'GET');
|
|
21
32
|
});
|
|
22
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Get a single external integration by id.
|
|
36
|
+
*
|
|
37
|
+
* @param id - UUID of the external integration.
|
|
38
|
+
* @returns The external integration (its `apiKey` is returned masked).
|
|
39
|
+
*/
|
|
23
40
|
getExternalIntegration(id) {
|
|
24
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
42
|
return this.request(`${urls.externalIntegrations}/${id}`, 'GET');
|
|
26
43
|
});
|
|
27
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Update an external integration. A supplied `apiKey` is sent as plaintext and stored encrypted at rest.
|
|
47
|
+
*
|
|
48
|
+
* @param id - UUID of the external integration to update.
|
|
49
|
+
* @param data - The fields to update.
|
|
50
|
+
* @returns The updated external integration (its `apiKey` is returned masked).
|
|
51
|
+
*/
|
|
28
52
|
updateExternalIntegration(id, data) {
|
|
29
53
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
54
|
return this.request(`${urls.externalIntegrations}/${id}`, 'PATCH', data);
|
|
31
55
|
});
|
|
32
56
|
}
|
|
57
|
+
/**
|
|
58
|
+
* Delete an external integration.
|
|
59
|
+
*
|
|
60
|
+
* @param id - UUID of the external integration to delete.
|
|
61
|
+
* @returns A promise that resolves when the integration has been deleted.
|
|
62
|
+
*/
|
|
33
63
|
deleteExternalIntegration(id) {
|
|
34
64
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
65
|
yield this.request(`${urls.externalIntegrations}/${id}`, 'DELETE');
|
|
@@ -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?:
|
|
36
|
-
logError(message: string, context?: string, action?: string, data?:
|
|
37
|
-
logWarn(message: string, context?: string, action?: string, data?:
|
|
38
|
-
logDebug(message: string, context?: string, action?: string, data?:
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
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
|
-
*
|
|
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
|
|
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(
|
|
8
|
+
getCompanyDailyReportCsv(organizationId: string): Promise<string>;
|
|
9
9
|
/**
|
|
10
10
|
* Download company daily report as CSV file
|
|
11
|
-
* @param
|
|
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(
|
|
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
|
|
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(
|
|
18
|
+
getCompanyDailyReportCsv(organizationId) {
|
|
19
19
|
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
return this.textRequest(`${urls.reports}/company-daily?
|
|
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
|
|
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(
|
|
28
|
+
downloadCompanyDailyReport(organizationId) {
|
|
29
29
|
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
return this.downloadRequest(`${urls.reports}/company-daily?
|
|
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
|
-
|
|
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}/
|
|
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}/
|
|
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}/
|
|
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}
|
|
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
|
-
|
|
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}
|
|
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)
|