@healthcloudai/hc-settings-connector 0.0.1 → 0.0.2
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/README.md +45 -11
- package/dist/index.cjs +16 -0
- package/dist/index.d.cts +6 -11
- package/dist/index.d.ts +6 -11
- package/dist/index.js +16 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,34 +1,43 @@
|
|
|
1
1
|
# Healthcheck Settings Connector
|
|
2
2
|
|
|
3
|
-
This library provides a client for accessing user settings and profile-related data
|
|
4
|
-
|
|
3
|
+
This library provides a client for accessing **user settings and profile-related data**
|
|
4
|
+
from the Healthcheck API.
|
|
5
|
+
It is built on top of the shared Healthcheck HTTP and Login connectors.
|
|
6
|
+
---
|
|
5
7
|
|
|
6
8
|
## Features
|
|
7
9
|
|
|
8
10
|
1. Retrieve authenticated user information
|
|
9
11
|
2. Centralized access to user profile and settings data
|
|
10
|
-
3. Built on shared HttpClient and authentication layer
|
|
12
|
+
3. Built on shared Healthcheck HttpClient and authentication layer
|
|
13
|
+
|
|
14
|
+
---
|
|
11
15
|
|
|
12
16
|
## Installation
|
|
13
17
|
|
|
18
|
+
```sh
|
|
14
19
|
npm install @healthcloudai/hc-settings-connector \
|
|
15
20
|
@healthcloudai/hc-login-connector \
|
|
16
21
|
@healthcloudai/hc-http
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
---
|
|
17
25
|
|
|
18
26
|
## Import
|
|
19
27
|
|
|
28
|
+
```ts
|
|
20
29
|
import { HCSettingsClient } from "@healthcloudai/hc-settings-connector";
|
|
21
30
|
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
|
|
22
31
|
import { HttpClient } from "@healthcloudai/hc-http";
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
---
|
|
23
35
|
|
|
24
36
|
## Usage
|
|
25
37
|
|
|
26
38
|
### Configuration
|
|
27
39
|
|
|
28
|
-
|
|
29
|
-
import { HCLoginClient } from "@healthcloudai/hc-login-connector";
|
|
30
|
-
import { HttpClient } from "@healthcloudai/hc-http";
|
|
31
|
-
|
|
40
|
+
```ts
|
|
32
41
|
const httpClient = new HttpClient();
|
|
33
42
|
const authClient = new HCLoginClient(/* auth configuration */);
|
|
34
43
|
|
|
@@ -36,17 +45,42 @@ const settingsClient = new HCSettingsClient(
|
|
|
36
45
|
httpClient,
|
|
37
46
|
authClient
|
|
38
47
|
);
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Methods
|
|
39
53
|
|
|
40
54
|
### Get User Info
|
|
41
55
|
|
|
56
|
+
Retrieves information about the authenticated user, including profile and settings data.
|
|
57
|
+
|
|
58
|
+
```ts
|
|
42
59
|
await settingsClient.getUserInfo();
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
Generates a pre-signed upload URL for uploading a user profile image.
|
|
64
|
+
|
|
65
|
+
```ts
|
|
66
|
+
const image = await settingsClient.uploadUserImage({
|
|
67
|
+
extension: "jpg"
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
|
|
43
72
|
|
|
44
73
|
## How It Works
|
|
45
74
|
|
|
46
|
-
- HCLoginClient
|
|
47
|
-
-
|
|
48
|
-
-
|
|
49
|
-
-
|
|
75
|
+
- **HCLoginClient**
|
|
76
|
+
- Handles authentication
|
|
77
|
+
- Resolves base API URL
|
|
78
|
+
- Provides authorization headers
|
|
79
|
+
|
|
80
|
+
- **HttpClient**
|
|
81
|
+
- Performs all HTTP requests
|
|
50
82
|
|
|
83
|
+
- **HCSettingsClient**
|
|
84
|
+
- Exposes user settings and profile-related endpoints
|
|
51
85
|
|
|
52
86
|
|
package/dist/index.cjs
CHANGED
|
@@ -39,6 +39,22 @@ var HCSettingsClient = class {
|
|
|
39
39
|
this.auth.getAuthHeader()
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
+
async uploadUserImage(payload) {
|
|
43
|
+
var _a;
|
|
44
|
+
const response = await this.http.put(
|
|
45
|
+
`${this.auth.getBaseUrl()}/api/patient/image/cannedurl`,
|
|
46
|
+
{
|
|
47
|
+
Data: {
|
|
48
|
+
Extension: payload.extension
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
...this.auth.getAuthHeader(),
|
|
53
|
+
"Content-Type": "application/json"
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
return (_a = response.Data) != null ? _a : response;
|
|
57
|
+
}
|
|
42
58
|
};
|
|
43
59
|
|
|
44
60
|
// src/errors.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -2,16 +2,10 @@ import { HCLoginClient } from '@healthcloudai/hc-login-connector';
|
|
|
2
2
|
import { HttpClient } from '@healthcloudai/hc-http';
|
|
3
3
|
|
|
4
4
|
type Environment = "dev" | "uat" | "prod";
|
|
5
|
-
interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
interface AuthTokens {
|
|
11
|
-
accessToken: string;
|
|
12
|
-
refreshToken: string;
|
|
13
|
-
idToken: string;
|
|
14
|
-
expiresIn: number;
|
|
5
|
+
interface HCUserImage {
|
|
6
|
+
imageUrl: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
extension: string;
|
|
15
9
|
}
|
|
16
10
|
interface HCUserInfo {
|
|
17
11
|
ID?: string;
|
|
@@ -28,6 +22,7 @@ declare class HCSettingsClient {
|
|
|
28
22
|
private auth;
|
|
29
23
|
constructor(httpClient: HttpClient, authClient: HCLoginClient);
|
|
30
24
|
getUserInfo(): Promise<HCUserInfo>;
|
|
25
|
+
uploadUserImage(payload: any): Promise<HCUserImage>;
|
|
31
26
|
}
|
|
32
27
|
|
|
33
28
|
declare class ConfigError extends Error {
|
|
@@ -41,4 +36,4 @@ declare class HttpError extends Error {
|
|
|
41
36
|
constructor(status: number, message: string);
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
export { AuthError,
|
|
39
|
+
export { AuthError, ConfigError, type Environment, HCSettingsClient, type HCUserImage, type HCUserInfo, HttpError };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,16 +2,10 @@ import { HCLoginClient } from '@healthcloudai/hc-login-connector';
|
|
|
2
2
|
import { HttpClient } from '@healthcloudai/hc-http';
|
|
3
3
|
|
|
4
4
|
type Environment = "dev" | "uat" | "prod";
|
|
5
|
-
interface
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
interface AuthTokens {
|
|
11
|
-
accessToken: string;
|
|
12
|
-
refreshToken: string;
|
|
13
|
-
idToken: string;
|
|
14
|
-
expiresIn: number;
|
|
5
|
+
interface HCUserImage {
|
|
6
|
+
imageUrl: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
extension: string;
|
|
15
9
|
}
|
|
16
10
|
interface HCUserInfo {
|
|
17
11
|
ID?: string;
|
|
@@ -28,6 +22,7 @@ declare class HCSettingsClient {
|
|
|
28
22
|
private auth;
|
|
29
23
|
constructor(httpClient: HttpClient, authClient: HCLoginClient);
|
|
30
24
|
getUserInfo(): Promise<HCUserInfo>;
|
|
25
|
+
uploadUserImage(payload: any): Promise<HCUserImage>;
|
|
31
26
|
}
|
|
32
27
|
|
|
33
28
|
declare class ConfigError extends Error {
|
|
@@ -41,4 +36,4 @@ declare class HttpError extends Error {
|
|
|
41
36
|
constructor(status: number, message: string);
|
|
42
37
|
}
|
|
43
38
|
|
|
44
|
-
export { AuthError,
|
|
39
|
+
export { AuthError, ConfigError, type Environment, HCSettingsClient, type HCUserImage, type HCUserInfo, HttpError };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,22 @@ var HCSettingsClient = class {
|
|
|
10
10
|
this.auth.getAuthHeader()
|
|
11
11
|
);
|
|
12
12
|
}
|
|
13
|
+
async uploadUserImage(payload) {
|
|
14
|
+
var _a;
|
|
15
|
+
const response = await this.http.put(
|
|
16
|
+
`${this.auth.getBaseUrl()}/api/patient/image/cannedurl`,
|
|
17
|
+
{
|
|
18
|
+
Data: {
|
|
19
|
+
Extension: payload.extension
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
...this.auth.getAuthHeader(),
|
|
24
|
+
"Content-Type": "application/json"
|
|
25
|
+
}
|
|
26
|
+
);
|
|
27
|
+
return (_a = response.Data) != null ? _a : response;
|
|
28
|
+
}
|
|
13
29
|
};
|
|
14
30
|
|
|
15
31
|
// src/errors.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@healthcloudai/hc-settings-connector",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Healthcheck Settings SDK with TypeScript",
|
|
5
5
|
"author": "Healthcheck Systems Inc",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"axios": "^1.13.4",
|
|
39
|
-
"@healthcloudai/hc-login-connector": "^0.0.
|
|
40
|
-
"@healthcloudai/hc-http": "^0.0.
|
|
39
|
+
"@healthcloudai/hc-login-connector": "^0.0.2",
|
|
40
|
+
"@healthcloudai/hc-http": "^0.0.3"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react-native": ">=0.70.0"
|