@healthcloudai/hc-settings-connector 0.0.10 → 0.0.12
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 +16 -49
- package/dist/index.cjs +0 -13
- package/dist/index.d.cts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +0 -13
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ It is built on top of the shared Healthcheck HTTP and Login connectors.
|
|
|
9
9
|
## Features
|
|
10
10
|
1. Retrieve the authenticated patient dashboard
|
|
11
11
|
2. Generate canned upload URLs for selfie, ID, and insurance images
|
|
12
|
-
3. Submit uploaded
|
|
12
|
+
3. Submit uploaded identification and insurance file keys for capture
|
|
13
13
|
4. Submit patient insurance coverage details
|
|
14
14
|
5. Retrieve patient insurances
|
|
15
15
|
6. Submit driving license data
|
|
@@ -160,7 +160,7 @@ Status:
|
|
|
160
160
|
|
|
161
161
|
## Upload and capture flow
|
|
162
162
|
|
|
163
|
-
Image-related methods follow
|
|
163
|
+
Image-related methods follow an upload-first flow. Profile image uses `updateUserImage(...)` after upload, while driver license and insurance use capture methods after upload.
|
|
164
164
|
|
|
165
165
|
1. Request upload information by calling the matching canned URL method.
|
|
166
166
|
2. Upload the file bytes to the returned upload URL outside this package.
|
|
@@ -173,13 +173,20 @@ The connector does not upload file bytes. It requests upload information and the
|
|
|
173
173
|
|
|
174
174
|
## Profile image methods
|
|
175
175
|
|
|
176
|
+
Profile image methods follow this flow:
|
|
177
|
+
|
|
178
|
+
1. Call `getUserImageCannedUrl(extension)` to request upload information.
|
|
179
|
+
2. Upload the image file to the returned `ImageURL` outside this package.
|
|
180
|
+
3. Include any signed headers required by the upload URL, such as `x-amz-acl: public-read` when provided.
|
|
181
|
+
4. Call `updateUserImage(fileName)` using the returned `FileName`.
|
|
182
|
+
|
|
176
183
|
### Get User Image Canned URL
|
|
177
184
|
|
|
178
185
|
Public signature: `settingsClient.getUserImageCannedUrl(extension)`
|
|
179
186
|
|
|
180
187
|
Generates upload information for a user profile image.
|
|
181
188
|
|
|
182
|
-
Use the returned
|
|
189
|
+
Use the returned `ImageURL` to upload the image file outside this package. After upload, pass the returned `FileName` to `updateUserImage(...)`.
|
|
183
190
|
|
|
184
191
|
```ts
|
|
185
192
|
const selfieUpload = await settingsClient.getUserImageCannedUrl("jpeg");
|
|
@@ -217,54 +224,13 @@ Status:
|
|
|
217
224
|
|
|
218
225
|
---
|
|
219
226
|
|
|
220
|
-
### Capture User Photo
|
|
221
|
-
|
|
222
|
-
Public signature: `settingsClient.captureUserPhoto(fileKey)`
|
|
223
|
-
|
|
224
|
-
Submits the uploaded profile image file key after the image has been uploaded.
|
|
225
|
-
|
|
226
|
-
This method should be called after uploading the file using the upload information returned by `getUserImageCannedUrl(...)`.
|
|
227
|
-
|
|
228
|
-
```ts
|
|
229
|
-
const capturedSelfie = await settingsClient.captureUserPhoto(
|
|
230
|
-
"selfie_example.jpeg"
|
|
231
|
-
);
|
|
232
|
-
```
|
|
233
|
-
|
|
234
|
-
#### Full API request
|
|
235
|
-
|
|
236
|
-
```json
|
|
237
|
-
{
|
|
238
|
-
"Data": {
|
|
239
|
-
"Type": "userphoto",
|
|
240
|
-
"FileID": "selfie_example.jpeg"
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
#### API response
|
|
246
|
-
|
|
247
|
-
The client returns the backend response from the capture request.
|
|
248
|
-
|
|
249
|
-
```json
|
|
250
|
-
{
|
|
251
|
-
"Data": {
|
|
252
|
-
"CapturedData": null,
|
|
253
|
-
"IsCaptured": true,
|
|
254
|
-
"InsurancePackages": null
|
|
255
|
-
},
|
|
256
|
-
"ErrorMessage": null,
|
|
257
|
-
"IsOK": true
|
|
258
|
-
}
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
---
|
|
262
|
-
|
|
263
227
|
### Update User Image URL
|
|
264
228
|
|
|
265
229
|
Public signature: `settingsClient.updateUserImage(fileName)`
|
|
266
230
|
|
|
267
|
-
Updates the stored user image reference using
|
|
231
|
+
Updates the stored user image reference using the `FileName` returned by `getUserImageCannedUrl(...)`.
|
|
232
|
+
|
|
233
|
+
Call this method after uploading the image file to the returned `ImageURL`.
|
|
268
234
|
|
|
269
235
|
```ts
|
|
270
236
|
const updated = await settingsClient.updateUserImage(
|
|
@@ -685,8 +651,9 @@ The client returns the backend response from the authenticated request.
|
|
|
685
651
|
- `HCLoginClient` handles tenant configuration, authentication, and authenticated headers.
|
|
686
652
|
- `HCSettingsClient` uses the authenticated login client for the base API URL and authenticated request headers.
|
|
687
653
|
- If configured through `setApiKey(...)`, `HCSettingsClient` also includes its configured API key header with Settings connector requests.
|
|
654
|
+
- Profile image methods use `getUserImageCannedUrl(...)` to request upload information and `updateUserImage(...)` to store the uploaded image reference.
|
|
688
655
|
- Upload URL methods return generated upload information. The caller is responsible for uploading the actual file bytes outside this package.
|
|
689
|
-
-
|
|
656
|
+
- Driver license and insurance capture methods submit the uploaded file key after the file has already been uploaded.
|
|
690
657
|
|
|
691
658
|
---
|
|
692
659
|
|
|
@@ -694,9 +661,9 @@ The client returns the backend response from the authenticated request.
|
|
|
694
661
|
|
|
695
662
|
- `HCLoginClient` must be configured and logged in before calling Settings connector methods.
|
|
696
663
|
- Canned URL methods return the backend response containing upload information in `Data`.
|
|
664
|
+
- Profile image upload uses `getUserImageCannedUrl(...)` followed by `updateUserImage(...)`.
|
|
697
665
|
- After requesting upload information, the file must be uploaded outside this package before capture methods can succeed.
|
|
698
666
|
- When uploading to the returned storage URL, include any signed headers required by that URL, such as `x-amz-acl: public-read` when provided.
|
|
699
|
-
- `captureUserPhoto()` sends `Type: "userphoto"` and `FileID` inside the request body.
|
|
700
667
|
- `captureDrivingLicense()` sends the ID document file key using `Type: "identification"` and `FileID` inside the request body.
|
|
701
668
|
- `captureInsurance()` sends `Type: "healthinsurance"` and `FileID` inside the request body.
|
|
702
669
|
- `submitDrivingLicense()` submits the driving license data payload.
|
package/dist/index.cjs
CHANGED
|
@@ -108,19 +108,6 @@ var HCSettingsClient = class {
|
|
|
108
108
|
this.getJsonHeaders()
|
|
109
109
|
);
|
|
110
110
|
}
|
|
111
|
-
async captureUserPhoto(fileKey) {
|
|
112
|
-
const payload = {
|
|
113
|
-
Data: {
|
|
114
|
-
Type: "userphoto",
|
|
115
|
-
FileID: fileKey
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
return this.http.post(
|
|
119
|
-
`${this.getBaseUrl()}/patient/capture`,
|
|
120
|
-
payload,
|
|
121
|
-
this.getJsonHeaders()
|
|
122
|
-
);
|
|
123
|
-
}
|
|
124
111
|
async captureDrivingLicense(fileKey) {
|
|
125
112
|
const payload = {
|
|
126
113
|
Data: {
|
package/dist/index.d.cts
CHANGED
|
@@ -27,7 +27,7 @@ interface CoverageRequest {
|
|
|
27
27
|
Image: string;
|
|
28
28
|
}
|
|
29
29
|
type CoveragePayload = APIRequest<CoverageRequest>;
|
|
30
|
-
type CaptureType = "identification" | "healthinsurance"
|
|
30
|
+
type CaptureType = "identification" | "healthinsurance";
|
|
31
31
|
interface CaptureData {
|
|
32
32
|
Type: CaptureType;
|
|
33
33
|
FileID: string;
|
|
@@ -60,7 +60,6 @@ declare class HCSettingsClient {
|
|
|
60
60
|
getUserImageCannedUrl(extension: string): Promise<UserImage>;
|
|
61
61
|
getDrivingLicenseCannedUrl(extension: string): Promise<UserImage>;
|
|
62
62
|
getInsuranceCannedUrl(extension: string): Promise<UserImage>;
|
|
63
|
-
captureUserPhoto(fileKey: string): Promise<any>;
|
|
64
63
|
captureDrivingLicense(fileKey: string): Promise<any>;
|
|
65
64
|
captureInsurance(fileKey: string): Promise<any>;
|
|
66
65
|
submitInsurance(payload: CoverageRequest): Promise<any>;
|
package/dist/index.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ interface CoverageRequest {
|
|
|
27
27
|
Image: string;
|
|
28
28
|
}
|
|
29
29
|
type CoveragePayload = APIRequest<CoverageRequest>;
|
|
30
|
-
type CaptureType = "identification" | "healthinsurance"
|
|
30
|
+
type CaptureType = "identification" | "healthinsurance";
|
|
31
31
|
interface CaptureData {
|
|
32
32
|
Type: CaptureType;
|
|
33
33
|
FileID: string;
|
|
@@ -60,7 +60,6 @@ declare class HCSettingsClient {
|
|
|
60
60
|
getUserImageCannedUrl(extension: string): Promise<UserImage>;
|
|
61
61
|
getDrivingLicenseCannedUrl(extension: string): Promise<UserImage>;
|
|
62
62
|
getInsuranceCannedUrl(extension: string): Promise<UserImage>;
|
|
63
|
-
captureUserPhoto(fileKey: string): Promise<any>;
|
|
64
63
|
captureDrivingLicense(fileKey: string): Promise<any>;
|
|
65
64
|
captureInsurance(fileKey: string): Promise<any>;
|
|
66
65
|
submitInsurance(payload: CoverageRequest): Promise<any>;
|
package/dist/index.js
CHANGED
|
@@ -79,19 +79,6 @@ var HCSettingsClient = class {
|
|
|
79
79
|
this.getJsonHeaders()
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
async captureUserPhoto(fileKey) {
|
|
83
|
-
const payload = {
|
|
84
|
-
Data: {
|
|
85
|
-
Type: "userphoto",
|
|
86
|
-
FileID: fileKey
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
return this.http.post(
|
|
90
|
-
`${this.getBaseUrl()}/patient/capture`,
|
|
91
|
-
payload,
|
|
92
|
-
this.getJsonHeaders()
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
82
|
async captureDrivingLicense(fileKey) {
|
|
96
83
|
const payload = {
|
|
97
84
|
Data: {
|
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.12",
|
|
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.15",
|
|
40
|
+
"@healthcloudai/hc-http": "^0.0.4"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react-native": ">=0.70.0"
|