whio-api-sdk 1.0.223-beta-staging → 1.0.225-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.
- package/dist/src/sdk/modules/auth.module.js +1 -0
- package/dist/src/sdk/modules/patient.module.d.ts +12 -0
- package/dist/src/sdk/modules/patient.module.js +25 -0
- package/dist/src/sdk/sdk.d.ts +3 -3
- package/dist/src/sdk/sdk.js +8 -0
- package/dist/src/sdk/types/index.d.ts +1 -0
- package/dist/src/sdk/types/index.js +1 -0
- package/dist/src/sdk/types/patient.types.d.ts +7 -0
- package/dist/src/sdk/types/patient.types.js +1 -0
- package/dist/src/sdk/urls.d.ts +1 -0
- package/dist/src/sdk/urls.js +2 -0
- package/package.json +1 -1
- package/src/sdk/modules/auth.module.ts +2 -1
- package/src/sdk/modules/patient.module.ts +17 -0
- package/src/sdk/sdk.ts +8 -0
- package/src/sdk/types/index.ts +1 -0
- package/src/sdk/types/patient.types.ts +9 -0
- package/src/sdk/urls.ts +3 -0
|
@@ -37,6 +37,7 @@ export class AuthModule extends BaseClient {
|
|
|
37
37
|
return __awaiter(this, void 0, void 0, function* () {
|
|
38
38
|
try {
|
|
39
39
|
const response = yield this.request('/auth/login-with-code', 'POST', { email, code }, {}, true);
|
|
40
|
+
console.log(response);
|
|
40
41
|
this.accessToken = response.access_token;
|
|
41
42
|
this.refreshToken = response.refresh_token;
|
|
42
43
|
this.user = response.user;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseClient } from './base-client';
|
|
2
|
+
import { PatientsFromIntegrationResponse } from '../types/patient.types';
|
|
3
|
+
/**
|
|
4
|
+
* Patient module for handling patient-related API operations
|
|
5
|
+
*/
|
|
6
|
+
export declare class PatientModule extends BaseClient {
|
|
7
|
+
/**
|
|
8
|
+
* Get patients from external integration (Tiaki)
|
|
9
|
+
* Returns an empty array if no integration is configured
|
|
10
|
+
*/
|
|
11
|
+
getPatientsFromIntegration(): Promise<PatientsFromIntegrationResponse>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
13
|
+
* Patient module for handling patient-related API operations
|
|
14
|
+
*/
|
|
15
|
+
export class PatientModule extends BaseClient {
|
|
16
|
+
/**
|
|
17
|
+
* Get patients from external integration (Tiaki)
|
|
18
|
+
* Returns an empty array if no integration is configured
|
|
19
|
+
*/
|
|
20
|
+
getPatientsFromIntegration() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
return this.request(`${urls.patients}/from-integration`, 'GET');
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
package/dist/src/sdk/sdk.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { DebugModule } from './modules/debug.module';
|
|
|
15
15
|
import { ExternalIntegrationModule } from './modules/external-integration.module';
|
|
16
16
|
import { WebSocketModule } from './modules/websocket.module';
|
|
17
17
|
import { ReportsModule } from './modules/reports.module';
|
|
18
|
+
import { PatientModule } from './modules/patient.module';
|
|
18
19
|
/**
|
|
19
20
|
* Main SDK class that provides access to all domain-specific modules
|
|
20
21
|
*/
|
|
@@ -34,6 +35,7 @@ export declare class ApiSDK extends BaseClient {
|
|
|
34
35
|
readonly externalIntegrations: ExternalIntegrationModule;
|
|
35
36
|
readonly websocket: WebSocketModule;
|
|
36
37
|
readonly reports: ReportsModule;
|
|
38
|
+
readonly patients: PatientModule;
|
|
37
39
|
constructor(config?: SDKConfig);
|
|
38
40
|
login(...args: Parameters<AuthModule['login']>): Promise<import("./types").LoginResponse>;
|
|
39
41
|
logout(...args: Parameters<AuthModule['logout']>): Promise<void>;
|
|
@@ -41,9 +43,6 @@ export declare class ApiSDK extends BaseClient {
|
|
|
41
43
|
changePassword(...args: Parameters<AuthModule['changePassword']>): Promise<import("./types").PasswordChangeResponse>;
|
|
42
44
|
adminChangePassword(...args: Parameters<AuthModule['adminChangePassword']>): Promise<import("./types").PasswordChangeResponse>;
|
|
43
45
|
requestLoginCode(...args: Parameters<AuthModule['requestLoginCode']>): Promise<{
|
|
44
|
-
/**
|
|
45
|
-
* Main SDK class that provides access to all domain-specific modules
|
|
46
|
-
*/
|
|
47
46
|
message: string;
|
|
48
47
|
}>;
|
|
49
48
|
loginWithCode(...args: Parameters<AuthModule['loginWithCode']>): Promise<import("./types").LoginResponse>;
|
|
@@ -207,4 +206,5 @@ export declare class ApiSDK extends BaseClient {
|
|
|
207
206
|
unsubscribe(...args: Parameters<WebSocketModule['off']>): void;
|
|
208
207
|
getCompanyDailyReportCsv(...args: Parameters<ReportsModule['getCompanyDailyReportCsv']>): Promise<string>;
|
|
209
208
|
downloadCompanyDailyReport(...args: Parameters<ReportsModule['downloadCompanyDailyReport']>): Promise<Blob>;
|
|
209
|
+
getPatientsFromIntegration(...args: Parameters<PatientModule['getPatientsFromIntegration']>): Promise<import("./types").PatientsFromIntegrationResponse>;
|
|
210
210
|
}
|
package/dist/src/sdk/sdk.js
CHANGED
|
@@ -23,6 +23,7 @@ import { DebugModule } from './modules/debug.module';
|
|
|
23
23
|
import { ExternalIntegrationModule } from './modules/external-integration.module';
|
|
24
24
|
import { WebSocketModule } from './modules/websocket.module';
|
|
25
25
|
import { ReportsModule } from './modules/reports.module';
|
|
26
|
+
import { PatientModule } from './modules/patient.module';
|
|
26
27
|
/**
|
|
27
28
|
* Main SDK class that provides access to all domain-specific modules
|
|
28
29
|
*/
|
|
@@ -45,6 +46,7 @@ export class ApiSDK extends BaseClient {
|
|
|
45
46
|
this.externalIntegrations = new ExternalIntegrationModule(config);
|
|
46
47
|
this.websocket = new WebSocketModule(config);
|
|
47
48
|
this.reports = new ReportsModule(config);
|
|
49
|
+
this.patients = new PatientModule(config);
|
|
48
50
|
}
|
|
49
51
|
// ======================
|
|
50
52
|
// BACKWARD COMPATIBILITY LAYER
|
|
@@ -824,4 +826,10 @@ export class ApiSDK extends BaseClient {
|
|
|
824
826
|
return this.reports.downloadCompanyDailyReport(...args);
|
|
825
827
|
});
|
|
826
828
|
}
|
|
829
|
+
// Patient methods
|
|
830
|
+
getPatientsFromIntegration(...args) {
|
|
831
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
832
|
+
return this.patients.getPatientsFromIntegration(...args);
|
|
833
|
+
});
|
|
834
|
+
}
|
|
827
835
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/sdk/urls.d.ts
CHANGED
package/dist/src/sdk/urls.js
CHANGED
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ export class AuthModule extends BaseClient {
|
|
|
19
19
|
await this.storage!.setItem('access_token', JSON.stringify(response.access_token));
|
|
20
20
|
await this.storage!.setItem('refresh_token', JSON.stringify(response.refresh_token));
|
|
21
21
|
await this.storage!.setItem('user', JSON.stringify(response.user));
|
|
22
|
-
|
|
22
|
+
|
|
23
23
|
return response;
|
|
24
24
|
} catch (error) {
|
|
25
25
|
await this.clearAuth();
|
|
@@ -46,6 +46,7 @@ export class AuthModule extends BaseClient {
|
|
|
46
46
|
{},
|
|
47
47
|
true
|
|
48
48
|
);
|
|
49
|
+
console.log(response);
|
|
49
50
|
this.accessToken = response.access_token;
|
|
50
51
|
this.refreshToken = response.refresh_token;
|
|
51
52
|
this.user = response.user;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseClient } from './base-client';
|
|
2
|
+
import { PatientsFromIntegrationResponse } from '../types/patient.types';
|
|
3
|
+
import urls from '../urls';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Patient module for handling patient-related API operations
|
|
7
|
+
*/
|
|
8
|
+
export class PatientModule extends BaseClient {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Get patients from external integration (Tiaki)
|
|
12
|
+
* Returns an empty array if no integration is configured
|
|
13
|
+
*/
|
|
14
|
+
async getPatientsFromIntegration(): Promise<PatientsFromIntegrationResponse> {
|
|
15
|
+
return this.request<PatientsFromIntegrationResponse>(`${urls.patients}/from-integration`, 'GET');
|
|
16
|
+
}
|
|
17
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -16,6 +16,7 @@ import { DebugModule } from './modules/debug.module';
|
|
|
16
16
|
import { ExternalIntegrationModule } from './modules/external-integration.module';
|
|
17
17
|
import { WebSocketModule } from './modules/websocket.module';
|
|
18
18
|
import { ReportsModule } from './modules/reports.module';
|
|
19
|
+
import { PatientModule } from './modules/patient.module';
|
|
19
20
|
|
|
20
21
|
/**
|
|
21
22
|
* Main SDK class that provides access to all domain-specific modules
|
|
@@ -36,6 +37,7 @@ export class ApiSDK extends BaseClient {
|
|
|
36
37
|
public readonly externalIntegrations: ExternalIntegrationModule;
|
|
37
38
|
public readonly websocket: WebSocketModule;
|
|
38
39
|
public readonly reports: ReportsModule;
|
|
40
|
+
public readonly patients: PatientModule;
|
|
39
41
|
|
|
40
42
|
constructor(config: SDKConfig = {}) {
|
|
41
43
|
super(config);
|
|
@@ -56,6 +58,7 @@ export class ApiSDK extends BaseClient {
|
|
|
56
58
|
this.externalIntegrations = new ExternalIntegrationModule(config);
|
|
57
59
|
this.websocket = new WebSocketModule(config);
|
|
58
60
|
this.reports = new ReportsModule(config);
|
|
61
|
+
this.patients = new PatientModule(config);
|
|
59
62
|
}
|
|
60
63
|
|
|
61
64
|
// ======================
|
|
@@ -701,4 +704,9 @@ export class ApiSDK extends BaseClient {
|
|
|
701
704
|
return this.reports.downloadCompanyDailyReport(...args);
|
|
702
705
|
}
|
|
703
706
|
|
|
707
|
+
// Patient methods
|
|
708
|
+
public async getPatientsFromIntegration(...args: Parameters<PatientModule['getPatientsFromIntegration']>) {
|
|
709
|
+
return this.patients.getPatientsFromIntegration(...args);
|
|
710
|
+
}
|
|
711
|
+
|
|
704
712
|
}
|
package/src/sdk/types/index.ts
CHANGED