@oystehr/sdk 3.0.6 → 3.0.8
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 +28 -12
- package/dist/cjs/client/client.d.ts +1 -1
- package/dist/cjs/config.d.ts +5 -0
- package/dist/cjs/errors/index.d.ts +4 -1
- package/dist/cjs/index.cjs +313 -155
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/index.min.cjs +1 -1
- package/dist/cjs/index.min.cjs.map +1 -1
- package/dist/cjs/resources/classes/application.d.ts +6 -5
- package/dist/cjs/resources/classes/charge.d.ts +1 -0
- package/dist/cjs/resources/classes/conversation.d.ts +6 -5
- package/dist/cjs/resources/classes/developer.d.ts +14 -6
- package/dist/cjs/resources/classes/erx.d.ts +9 -0
- package/dist/cjs/resources/classes/fax.d.ts +4 -3
- package/dist/cjs/resources/classes/fhir.d.ts +1 -0
- package/dist/cjs/resources/classes/index.d.ts +1 -1
- package/dist/cjs/resources/classes/m2m.d.ts +15 -7
- package/dist/cjs/resources/classes/messaging.d.ts +1 -0
- package/dist/cjs/resources/classes/paymentMethod.d.ts +1 -0
- package/dist/cjs/resources/classes/project.d.ts +10 -2
- package/dist/cjs/resources/classes/rcm.d.ts +4 -3
- package/dist/cjs/resources/classes/role.d.ts +6 -5
- package/dist/cjs/resources/classes/secret.d.ts +1 -0
- package/dist/cjs/resources/classes/telemed.d.ts +2 -1
- package/dist/cjs/resources/classes/transactionalSMS.d.ts +2 -1
- package/dist/cjs/resources/classes/user.d.ts +15 -7
- package/dist/cjs/resources/classes/version.d.ts +1 -0
- package/dist/cjs/resources/classes/z3.d.ts +7 -6
- package/dist/cjs/resources/classes/zambda.d.ts +9 -8
- package/dist/cjs/resources/classes/zambdaLogStream.d.ts +4 -3
- package/dist/cjs/resources/types/AccessPolicy.d.ts +8 -3
- package/dist/cjs/resources/types/ChargeIssueParams.d.ts +1 -1
- package/dist/cjs/resources/types/ChargeStatusParams.d.ts +1 -1
- package/dist/cjs/resources/types/DeveloperInviteResponse.d.ts +0 -4
- package/dist/cjs/resources/types/DeveloperListV2Params.d.ts +2 -2
- package/dist/cjs/resources/types/FaxSendParams.d.ts +1 -1
- package/dist/cjs/resources/types/M2mListV2Params.d.ts +2 -2
- package/dist/cjs/resources/types/M2mRotateSecretResponse.d.ts +1 -1
- package/dist/cjs/resources/types/RcmEligibilityCheckParams.d.ts +1 -1
- package/dist/cjs/resources/types/RoleUpdateParams.d.ts +0 -4
- package/dist/cjs/resources/types/TelemedCreateMeetingParams.d.ts +1 -1
- package/dist/cjs/resources/types/UserListV2Params.d.ts +2 -2
- package/dist/cjs/resources/types/ZambdaCreateParams.d.ts +1 -1
- package/dist/cjs/resources/types/ZambdaFunction.d.ts +1 -1
- package/dist/cjs/resources/types/ZambdaUpdateParams.d.ts +2 -2
- package/dist/cjs/resources/types/index.d.ts +2 -2
- package/dist/cjs/tests/setup/constants.d.ts +2 -6
- package/dist/cjs/tests/setup/global.d.ts +1 -0
- package/dist/esm/client/client.d.ts +1 -1
- package/dist/esm/client/client.js +4 -4
- package/dist/esm/client/client.js.map +1 -1
- package/dist/esm/config.d.ts +5 -0
- package/dist/esm/errors/index.d.ts +4 -1
- package/dist/esm/errors/index.js +18 -2
- package/dist/esm/errors/index.js.map +1 -1
- package/dist/esm/index.min.js +1 -1
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/resources/classes/application.d.ts +6 -5
- package/dist/esm/resources/classes/application.js +20 -13
- package/dist/esm/resources/classes/application.js.map +1 -1
- package/dist/esm/resources/classes/charge.d.ts +1 -0
- package/dist/esm/resources/classes/charge.js +9 -2
- package/dist/esm/resources/classes/charge.js.map +1 -1
- package/dist/esm/resources/classes/conversation.d.ts +6 -5
- package/dist/esm/resources/classes/conversation.js +17 -10
- package/dist/esm/resources/classes/conversation.js.map +1 -1
- package/dist/esm/resources/classes/developer.d.ts +14 -6
- package/dist/esm/resources/classes/developer.js +18 -11
- package/dist/esm/resources/classes/developer.js.map +1 -1
- package/dist/esm/resources/classes/erx.d.ts +9 -0
- package/dist/esm/resources/classes/erx.js +13 -6
- package/dist/esm/resources/classes/erx.js.map +1 -1
- package/dist/esm/resources/classes/fax.d.ts +4 -3
- package/dist/esm/resources/classes/fax.js +13 -6
- package/dist/esm/resources/classes/fax.js.map +1 -1
- package/dist/esm/resources/classes/fhir.d.ts +1 -0
- package/dist/esm/resources/classes/fhir.js +3 -0
- package/dist/esm/resources/classes/fhir.js.map +1 -1
- package/dist/esm/resources/classes/index.d.ts +1 -1
- package/dist/esm/resources/classes/index.js +6 -1
- package/dist/esm/resources/classes/index.js.map +1 -1
- package/dist/esm/resources/classes/m2m.d.ts +15 -7
- package/dist/esm/resources/classes/m2m.js +20 -13
- package/dist/esm/resources/classes/m2m.js.map +1 -1
- package/dist/esm/resources/classes/messaging.d.ts +1 -0
- package/dist/esm/resources/classes/messaging.js +8 -1
- package/dist/esm/resources/classes/messaging.js.map +1 -1
- package/dist/esm/resources/classes/paymentMethod.d.ts +1 -0
- package/dist/esm/resources/classes/paymentMethod.js +11 -4
- package/dist/esm/resources/classes/paymentMethod.js.map +1 -1
- package/dist/esm/resources/classes/project.d.ts +10 -2
- package/dist/esm/resources/classes/project.js +10 -3
- package/dist/esm/resources/classes/project.js.map +1 -1
- package/dist/esm/resources/classes/rcm.d.ts +4 -3
- package/dist/esm/resources/classes/rcm.js +13 -6
- package/dist/esm/resources/classes/rcm.js.map +1 -1
- package/dist/esm/resources/classes/role.d.ts +6 -5
- package/dist/esm/resources/classes/role.js +17 -10
- package/dist/esm/resources/classes/role.js.map +1 -1
- package/dist/esm/resources/classes/secret.d.ts +1 -0
- package/dist/esm/resources/classes/secret.js +11 -4
- package/dist/esm/resources/classes/secret.js.map +1 -1
- package/dist/esm/resources/classes/telemed.d.ts +2 -1
- package/dist/esm/resources/classes/telemed.js +10 -3
- package/dist/esm/resources/classes/telemed.js.map +1 -1
- package/dist/esm/resources/classes/transactionalSMS.d.ts +2 -1
- package/dist/esm/resources/classes/transactionalSMS.js +9 -2
- package/dist/esm/resources/classes/transactionalSMS.js.map +1 -1
- package/dist/esm/resources/classes/user.d.ts +15 -7
- package/dist/esm/resources/classes/user.js +20 -13
- package/dist/esm/resources/classes/user.js.map +1 -1
- package/dist/esm/resources/classes/version.d.ts +1 -0
- package/dist/esm/resources/classes/version.js +8 -1
- package/dist/esm/resources/classes/version.js.map +1 -1
- package/dist/esm/resources/classes/z3-ext.js +9 -5
- package/dist/esm/resources/classes/z3-ext.js.map +1 -1
- package/dist/esm/resources/classes/z3.d.ts +7 -6
- package/dist/esm/resources/classes/z3.js +19 -12
- package/dist/esm/resources/classes/z3.js.map +1 -1
- package/dist/esm/resources/classes/zambda-ext.js +5 -1
- package/dist/esm/resources/classes/zambda-ext.js.map +1 -1
- package/dist/esm/resources/classes/zambda.d.ts +9 -8
- package/dist/esm/resources/classes/zambda.js +23 -16
- package/dist/esm/resources/classes/zambda.js.map +1 -1
- package/dist/esm/resources/classes/zambdaLogStream.d.ts +4 -3
- package/dist/esm/resources/classes/zambdaLogStream.js +13 -6
- package/dist/esm/resources/classes/zambdaLogStream.js.map +1 -1
- package/dist/esm/resources/types/AccessPolicy.d.ts +8 -3
- package/dist/esm/resources/types/ChargeIssueParams.d.ts +1 -1
- package/dist/esm/resources/types/ChargeStatusParams.d.ts +1 -1
- package/dist/esm/resources/types/DeveloperInviteResponse.d.ts +0 -4
- package/dist/esm/resources/types/DeveloperListV2Params.d.ts +2 -2
- package/dist/esm/resources/types/FaxSendParams.d.ts +1 -1
- package/dist/esm/resources/types/M2mListV2Params.d.ts +2 -2
- package/dist/esm/resources/types/M2mRotateSecretResponse.d.ts +1 -1
- package/dist/esm/resources/types/RcmEligibilityCheckParams.d.ts +1 -1
- package/dist/esm/resources/types/RoleUpdateParams.d.ts +0 -4
- package/dist/esm/resources/types/TelemedCreateMeetingParams.d.ts +1 -1
- package/dist/esm/resources/types/UserListV2Params.d.ts +2 -2
- package/dist/esm/resources/types/ZambdaCreateParams.d.ts +1 -1
- package/dist/esm/resources/types/ZambdaFunction.d.ts +1 -1
- package/dist/esm/resources/types/ZambdaUpdateParams.d.ts +2 -2
- package/dist/esm/resources/types/index.d.ts +2 -2
- package/dist/esm/tests/setup/constants.d.ts +2 -6
- package/dist/esm/tests/setup/global.d.ts +1 -0
- package/package.json +3 -3
- package/src/client/client.ts +6 -6
- package/src/config.ts +5 -0
- package/src/errors/index.ts +18 -2
- package/src/resources/classes/application.ts +24 -13
- package/src/resources/classes/charge.ts +5 -2
- package/src/resources/classes/conversation.ts +25 -10
- package/src/resources/classes/developer.ts +32 -12
- package/src/resources/classes/erx.ts +31 -6
- package/src/resources/classes/fax.ts +9 -6
- package/src/resources/classes/fhir.ts +3 -0
- package/src/resources/classes/index.ts +5 -2
- package/src/resources/classes/m2m.ts +31 -14
- package/src/resources/classes/messaging.ts +4 -1
- package/src/resources/classes/paymentMethod.ts +7 -4
- package/src/resources/classes/project.ts +24 -4
- package/src/resources/classes/rcm.ts +9 -6
- package/src/resources/classes/role.ts +13 -10
- package/src/resources/classes/secret.ts +7 -4
- package/src/resources/classes/telemed.ts +10 -3
- package/src/resources/classes/transactionalSMS.ts +5 -2
- package/src/resources/classes/user.ts +34 -14
- package/src/resources/classes/version.ts +4 -1
- package/src/resources/classes/z3-ext.ts +10 -4
- package/src/resources/classes/z3.ts +15 -12
- package/src/resources/classes/zambda-ext.ts +5 -1
- package/src/resources/classes/zambda.ts +19 -16
- package/src/resources/classes/zambdaLogStream.ts +13 -6
- package/src/resources/types/AccessPolicy.ts +12 -3
- package/src/resources/types/ChargeIssueParams.ts +1 -1
- package/src/resources/types/ChargeStatusParams.ts +1 -1
- package/src/resources/types/DeveloperInviteResponse.ts +0 -4
- package/src/resources/types/DeveloperListV2Params.ts +2 -2
- package/src/resources/types/FaxSendParams.ts +1 -1
- package/src/resources/types/M2mListV2Params.ts +2 -2
- package/src/resources/types/M2mRotateSecretResponse.ts +1 -1
- package/src/resources/types/RcmEligibilityCheckParams.ts +1 -1
- package/src/resources/types/RoleUpdateParams.ts +0 -4
- package/src/resources/types/TelemedCreateMeetingParams.ts +1 -1
- package/src/resources/types/UserListV2Params.ts +2 -2
- package/src/resources/types/ZambdaCreateParams.ts +1 -1
- package/src/resources/types/ZambdaFunction.ts +1 -1
- package/src/resources/types/ZambdaUpdateParams.ts +2 -2
- package/src/resources/types/index.ts +2 -2
- package/dist/esm/node_modules/tslib/package.json +0 -1
- package/dist/esm/node_modules/tslib/tslib.es6.js +0 -34
- package/dist/esm/node_modules/tslib/tslib.es6.js.map +0 -1
|
@@ -3,6 +3,7 @@ import { SDKResource } from '../../client/client';
|
|
|
3
3
|
import { OystehrConfig } from '../../config';
|
|
4
4
|
import * as ext from './z3-ext';
|
|
5
5
|
export declare class Z3 extends SDKResource {
|
|
6
|
+
#private;
|
|
6
7
|
constructor(config: OystehrConfig);
|
|
7
8
|
/**
|
|
8
9
|
* Uploads a file to the bucket and key. Files should be Blobs.
|
|
@@ -22,42 +23,42 @@ export declare class Z3 extends SDKResource {
|
|
|
22
23
|
*/
|
|
23
24
|
getPresignedUrlForZ3Url: typeof ext.getPresignedUrlForZ3Url;
|
|
24
25
|
/**
|
|
25
|
-
* List all Z3 Buckets. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
26
|
+
* List all Z3 Buckets. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
26
27
|
*
|
|
27
28
|
* Access Policy Action: `Z3:ListBuckets`
|
|
28
29
|
* Access Policy Resource: `Z3:BucketName`
|
|
29
30
|
*/
|
|
30
31
|
listBuckets(request?: OystehrClientRequest): Promise<Z3ListBucketsResponse>;
|
|
31
32
|
/**
|
|
32
|
-
* Create a Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
33
|
+
* Create a Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
33
34
|
*
|
|
34
35
|
* Access Policy Action: `Z3:CreateBucket`
|
|
35
36
|
* Access Policy Resource: `Z3:BucketName`
|
|
36
37
|
*/
|
|
37
38
|
createBucket(params: Z3CreateBucketParams, request?: OystehrClientRequest): Promise<Z3CreateBucketResponse>;
|
|
38
39
|
/**
|
|
39
|
-
* Delete the Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
40
|
+
* Delete the Z3 Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
40
41
|
*
|
|
41
42
|
* Access Policy Action: `Z3:DeleteBucket`
|
|
42
43
|
* Access Policy Resource: `Z3:BucketName`
|
|
43
44
|
*/
|
|
44
45
|
deleteBucket(params: Z3DeleteBucketParams, request?: OystehrClientRequest): Promise<void>;
|
|
45
46
|
/**
|
|
46
|
-
* List all Z3 Objects at the provided path in the Bucket with the provided name [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
47
|
+
* List all Z3 Objects at the provided path in the Bucket with the provided name [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
47
48
|
*
|
|
48
49
|
* Access Policy Action: `Z3:ListObjects`
|
|
49
50
|
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
50
51
|
*/
|
|
51
52
|
listObjects(params: Z3ListObjectsParams, request?: OystehrClientRequest): Promise<Z3ListObjectsResponse>;
|
|
52
53
|
/**
|
|
53
|
-
* Get a link for downloading or uploading a Z3 Object to the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
54
|
+
* Get a link for downloading or uploading a Z3 Object to the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
54
55
|
*
|
|
55
56
|
* Access Policy Action: `Z3:PutObject` or `Z3:GetObject`
|
|
56
57
|
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
57
58
|
*/
|
|
58
59
|
getPresignedUrl(params: Z3GetPresignedUrlParams, request?: OystehrClientRequest): Promise<Z3GetPresignedUrlResponse>;
|
|
59
60
|
/**
|
|
60
|
-
* Delete the Z3 Object at the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
61
|
+
* Delete the Z3 Object at the provided path in the Bucket with the provided name. [Z3](https://docs.oystehr.com/oystehr/services/z3/) is Oystehr's built-in and fully integrated solution for file storage.
|
|
61
62
|
*
|
|
62
63
|
* Access Policy Action: `Z3:DeleteObject`
|
|
63
64
|
* Access Policy Resource: `Z3:BucketName:ObjectPath`
|
|
@@ -3,58 +3,59 @@ import { SDKResource } from '../../client/client';
|
|
|
3
3
|
import { OystehrConfig } from '../../config';
|
|
4
4
|
import * as ext from './zambda-ext';
|
|
5
5
|
export declare class Zambda extends SDKResource {
|
|
6
|
+
#private;
|
|
6
7
|
constructor(config: OystehrConfig);
|
|
7
8
|
uploadFile: typeof ext.uploadFile;
|
|
8
9
|
/**
|
|
9
|
-
* Get a list of all Zambda Functions in the Project. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
10
|
+
* Get a list of all Zambda Functions in the Project. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
10
11
|
*
|
|
11
12
|
* Access Policy Action: `Zambda:ListAllFunctions`
|
|
12
13
|
* Access Policy Resource: `Zambda:Function`
|
|
13
14
|
*/
|
|
14
15
|
list(request?: OystehrClientRequest): Promise<ZambdaListResponse>;
|
|
15
16
|
/**
|
|
16
|
-
* Create a new Zambda Function. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
17
|
+
* Create a new Zambda Function. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
17
18
|
*
|
|
18
19
|
* Access Policy Action: `Zambda:CreateFunction`
|
|
19
20
|
* Access Policy Resource: `Zambda:Function`
|
|
20
21
|
*/
|
|
21
22
|
create(params: ZambdaCreateParams, request?: OystehrClientRequest): Promise<ZambdaCreateResponse>;
|
|
22
23
|
/**
|
|
23
|
-
* Get the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
24
|
+
* Get the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
24
25
|
*
|
|
25
26
|
* Access Policy Action: `Zambda:GetFunction`
|
|
26
27
|
* Access Policy Resource: `Zambda:Function`
|
|
27
28
|
*/
|
|
28
29
|
get(params: ZambdaGetParams, request?: OystehrClientRequest): Promise<ZambdaGetResponse>;
|
|
29
30
|
/**
|
|
30
|
-
* Update the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
31
|
+
* Update the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
31
32
|
*
|
|
32
33
|
* Access Policy Action: `Zambda:UpdateFunction`
|
|
33
34
|
* Access Policy Resource: `Zambda:Function`
|
|
34
35
|
*/
|
|
35
36
|
update(params: ZambdaUpdateParams, request?: OystehrClientRequest): Promise<ZambdaUpdateResponse>;
|
|
36
37
|
/**
|
|
37
|
-
* Delete the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
38
|
+
* Delete the Zambda Function with the provided ID or name. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
38
39
|
*
|
|
39
40
|
* Access Policy Action: `Zambda:DeleteFunction`
|
|
40
41
|
* Access Policy Resource: `Zambda:Function`
|
|
41
42
|
*/
|
|
42
43
|
delete(params: ZambdaDeleteParams, request?: OystehrClientRequest): Promise<void>;
|
|
43
44
|
/**
|
|
44
|
-
* Execute the [Authenticated Zambda Function](https://docs.oystehr.com/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
45
|
+
* Execute the [Authenticated Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/authenticated/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
45
46
|
*
|
|
46
47
|
* Access Policy Action: `Zambda:InvokeFunction`
|
|
47
48
|
* Access Policy Resource: `Zambda:Function`
|
|
48
49
|
*/
|
|
49
50
|
execute(params: ZambdaExecuteParams, request?: OystehrClientRequest): Promise<ZambdaExecuteResponse>;
|
|
50
51
|
/**
|
|
51
|
-
* Execute the [Public Zambda Function](https://docs.oystehr.com/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
52
|
+
* Execute the [Public Zambda Function](https://docs.oystehr.com/oystehr/services/zambda/types/public/) with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
52
53
|
*
|
|
53
54
|
* Execute a zambda that has method http_open. This endpoint is public so there are no access policy requirements.
|
|
54
55
|
*/
|
|
55
56
|
executePublic(params: ZambdaExecutePublicParams, request?: OystehrClientRequest): Promise<ZambdaExecutePublicResponse>;
|
|
56
57
|
/**
|
|
57
|
-
* Returns a URL that is used to deploy code to the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
58
|
+
* Returns a URL that is used to deploy code to the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
58
59
|
*
|
|
59
60
|
* Access Policy Action: `Zambda:UpdateFunction`
|
|
60
61
|
* Access Policy Resource: `Zambda:Function`
|
|
@@ -2,23 +2,24 @@ import { OystehrClientRequest, ZambdaLogStreamGetParams, ZambdaLogStreamGetRespo
|
|
|
2
2
|
import { SDKResource } from '../../client/client';
|
|
3
3
|
import { OystehrConfig } from '../../config';
|
|
4
4
|
export declare class ZambdaLogStream extends SDKResource {
|
|
5
|
+
#private;
|
|
5
6
|
constructor(config: OystehrConfig);
|
|
6
7
|
/**
|
|
7
|
-
* Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
8
|
+
* Get the log streams for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
8
9
|
*
|
|
9
10
|
* Access Policy Action: `Zambda:ReadLogs`
|
|
10
11
|
* Access Policy Resource: `Zambda:Function`
|
|
11
12
|
*/
|
|
12
13
|
list(params: ZambdaLogStreamListParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamListResponse>;
|
|
13
14
|
/**
|
|
14
|
-
* Get all logs for the Zambda Function with the provided ID, filtered by any of: text in messages, minimum start date, and/or maximum end date. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
15
|
+
* Get all logs for the Zambda Function with the provided ID, filtered by any of: text in messages, minimum start date, and/or maximum end date. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
15
16
|
*
|
|
16
17
|
* Access Policy Action: `Zambda:ReadLogs`
|
|
17
18
|
* Access Policy Resource: `Zambda:Function`
|
|
18
19
|
*/
|
|
19
20
|
search(params: ZambdaLogStreamSearchParams, request?: OystehrClientRequest): Promise<ZambdaLogStreamSearchResponse>;
|
|
20
21
|
/**
|
|
21
|
-
* Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
22
|
+
* Get the logs from the specified log stream for the Zambda Function with the provided ID. [Zambdas](https://docs.oystehr.com/oystehr/services/zambda/) are functions that can be used to execute your code. They can be used to process data received from Oystehr's APIs or to perform operations on third-party services.
|
|
22
23
|
*
|
|
23
24
|
* Access Policy Action: `Zambda:ReadLogs`
|
|
24
25
|
* Access Policy Resource: `Zambda:Function`
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
export interface AccessPolicy {
|
|
2
2
|
rule: {
|
|
3
|
-
resource
|
|
4
|
-
action
|
|
5
|
-
effect
|
|
3
|
+
resource: string | string[];
|
|
4
|
+
action: string | string[];
|
|
5
|
+
effect: 'Allow' | 'Deny';
|
|
6
|
+
condition?: {
|
|
7
|
+
[k: string]: any;
|
|
8
|
+
} | {
|
|
9
|
+
[k: string]: any;
|
|
10
|
+
}[] | string | string[];
|
|
6
11
|
}[];
|
|
7
12
|
}
|
|
@@ -12,10 +12,6 @@ export interface DeveloperInviteResponse {
|
|
|
12
12
|
* The ID of the FHIR Practitioner resource that represents the developer. Also known as the Developer's "profile".
|
|
13
13
|
*/
|
|
14
14
|
practitionerId: string;
|
|
15
|
-
/**
|
|
16
|
-
* The ID of the invite
|
|
17
|
-
*/
|
|
18
|
-
invitationUrl: string;
|
|
19
15
|
/**
|
|
20
16
|
* The roles assigned to the developer.
|
|
21
17
|
*/
|
|
@@ -12,7 +12,7 @@ export interface FaxSendParams {
|
|
|
12
12
|
*/
|
|
13
13
|
recipient: string;
|
|
14
14
|
/**
|
|
15
|
-
* The sender of the fax. This must be a valid FHIR HealthcareService, Organization, Patient, Practitioner, PractitionerRole, or RelatedPerson relative reference in the format: `the-resource-type/some-valid-uuid`. This reference must be a valid resource and have your [onboarded fax number](https://docs.oystehr.com/services/fax/number/) in the `telecom` field with a `system` of `fax`.
|
|
15
|
+
* The sender of the fax. This must be a valid FHIR HealthcareService, Organization, Patient, Practitioner, PractitionerRole, or RelatedPerson relative reference in the format: `the-resource-type/some-valid-uuid`. This reference must be a valid resource and have your [onboarded fax number](https://docs.oystehr.com/oystehr/services/fax/number/) in the `telecom` field with a `system` of `fax`.
|
|
16
16
|
*/
|
|
17
17
|
sender: string;
|
|
18
18
|
}
|
|
@@ -5,7 +5,7 @@ export interface ZambdaCreateParams {
|
|
|
5
5
|
*/
|
|
6
6
|
name: string;
|
|
7
7
|
/**
|
|
8
|
-
* The trigger method for the Zambda Function determines how the Function is invoked. Learn more about the different types here, https://docs.oystehr.com/services/zambda/#types-of-zambdas.
|
|
8
|
+
* The trigger method for the Zambda Function determines how the Function is invoked. Learn more about the different types here, https://docs.oystehr.com/oystehr/services/zambda/#types-of-zambdas.
|
|
9
9
|
*/
|
|
10
10
|
triggerMethod?: 'http_auth' | 'http_open' | 'subscription' | 'cron';
|
|
11
11
|
schedule?: ZambdaSchedule;
|
|
@@ -14,7 +14,7 @@ export interface ZambdaFunction {
|
|
|
14
14
|
*/
|
|
15
15
|
status: 'Draft' | 'Pending' | 'Active' | 'Failed' | 'Inactive' | 'Validating';
|
|
16
16
|
/**
|
|
17
|
-
* The trigger method for the Zambda Function determines how the Function is invoked. Learn more about the different types here, https://docs.oystehr.com/services/zambda/#types-of-zambdas.
|
|
17
|
+
* The trigger method for the Zambda Function determines how the Function is invoked. Learn more about the different types here, https://docs.oystehr.com/oystehr/services/zambda/#types-of-zambdas.
|
|
18
18
|
*/
|
|
19
19
|
triggerMethod: 'http_auth' | 'http_open' | 'subscription' | 'cron';
|
|
20
20
|
schedule?: ZambdaSchedule;
|
|
@@ -5,13 +5,13 @@ export interface ZambdaUpdateParams {
|
|
|
5
5
|
*/
|
|
6
6
|
name?: string;
|
|
7
7
|
/**
|
|
8
|
-
* The trigger method for the Zambda Function determines how the Function is invoked. Learn more about the different types here, https://docs.oystehr.com/services/zambda/#types-of-zambdas.
|
|
8
|
+
* The trigger method for the Zambda Function determines how the Function is invoked. Learn more about the different types here, https://docs.oystehr.com/oystehr/services/zambda/#types-of-zambdas.
|
|
9
9
|
*/
|
|
10
10
|
triggerMethod?: 'http_auth' | 'http_open' | 'subscription' | 'cron';
|
|
11
11
|
schedule?: ZambdaSchedule;
|
|
12
12
|
/**
|
|
13
13
|
* The runtime to use for the Zambda Function. This property is optional and defaults to "nodejs20.x".
|
|
14
14
|
*/
|
|
15
|
-
runtime?: 'nodejs18.x' | 'nodejs20.x';
|
|
15
|
+
runtime?: 'nodejs18.x' | 'nodejs20.x' | 'nodejs22.x';
|
|
16
16
|
id: string;
|
|
17
17
|
}
|
|
@@ -103,8 +103,6 @@ export * from './ErxMedicationSearchParams';
|
|
|
103
103
|
export * from './ErxMedicationSearchResponse';
|
|
104
104
|
export * from './ErxMedicationSearchV2Params';
|
|
105
105
|
export * from './ErxMedicationSearchV2Response';
|
|
106
|
-
export * from './FaxSendParams';
|
|
107
|
-
export * from './FaxSendResponse';
|
|
108
106
|
export * from './RoleListResponse';
|
|
109
107
|
export * from './RoleCreateParams';
|
|
110
108
|
export * from './RoleCreateResponse';
|
|
@@ -164,3 +162,5 @@ export * from './ZambdaLogStreamSearchParams';
|
|
|
164
162
|
export * from './ZambdaLogStreamSearchResponse';
|
|
165
163
|
export * from './ZambdaLogStreamGetParams';
|
|
166
164
|
export * from './ZambdaLogStreamGetResponse';
|
|
165
|
+
export * from './FaxSendParams';
|
|
166
|
+
export * from './FaxSendResponse';
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
+
import { OystehrConfig } from '../../config';
|
|
1
2
|
export declare const accessToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IllhcGtmeERqb3FvVnR1YUtlcHllZyJ9.eyJpc3MiOiJodHRwczovL2Rldi1hdXRoLnphcGVoci5jb20vIiwic3ViIjoiYXV0aDB8NjQ4MjRmYTYxODY2YmVmY2NiNTU5NTY4IiwiYXVkIjpbImh0dHBzOi8vZGV2LmFwaS56YXBlaHIuY29tIiwiaHR0cHM6Ly96YXBlaHItZGV2LnVzLmF1dGgwLmNvbS91c2VyaW5mbyJdLCJpYXQiOjE2ODYyNjE2NzIsImV4cCI6MTY4NjM0ODA3MiwiYXpwIjoiZzNPV0xIb1dhUEhHWkRyd1lTYW5QdDBCcUp6ZXgzTnYiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIn0.EBSaOYp5NMJ94GZyd9cg57QWnozlN-ua4XAO3iIrPal16yWOW-_TeVgj-1j-PwAhHaxW8QoTuojMXwhWVkNUwUw1AomxFubrvL98jm871VMZTXayQRGGlZHUsREmUDWpojGKAf0wAegEPC-kSw5KAc79V5SOrcVzhTmk5AMnR1aDzck9ZbXpTCPWWmyjyf4BiCb4N3zw3Zt3iQ0c5YDKvdMa_aAKiUZ9jaOw1TnQZ4tivKsn2uVfRGPZ5WFmj7B2MQTpzw4rokHtnSYtbKb-1h5wMxsdmzy_gKMYYaiPGqkJVt1twtjH9O1nZZMSDjGQI5B96TnrVjBFm6ow8jpBKg";
|
|
2
3
|
export declare const projectId = "eb1306aa-fba5-416a-a2a4-6b69eca58d87";
|
|
3
4
|
export declare const FHIR_API_URL = "http://localhost:3030/dev";
|
|
4
5
|
export declare const PLATFORM_API_URL = "http://localhost:3031/dev";
|
|
5
6
|
export declare const PROJECT_API_URL = "http://localhost:3032/dev";
|
|
6
7
|
export declare const FHIR_VERSION: import("@zapehr/core").FhirVersion;
|
|
7
|
-
export declare const config:
|
|
8
|
-
accessToken: string;
|
|
9
|
-
projectId: string;
|
|
10
|
-
fhirApiUrl: string;
|
|
11
|
-
projectApiUrl: string;
|
|
12
|
-
};
|
|
8
|
+
export declare const config: OystehrConfig;
|
|
@@ -32,7 +32,7 @@ export type FhirFetcherResponse<T extends FhirData<FhirResource> = any> = T;
|
|
|
32
32
|
export declare class SDKResource {
|
|
33
33
|
protected readonly config: OystehrConfig;
|
|
34
34
|
constructor(config: OystehrConfig);
|
|
35
|
-
protected request(path: string, method: string): FetcherFunction;
|
|
35
|
+
protected request(path: string, method: string, baseUrlThunk: () => string): FetcherFunction;
|
|
36
36
|
protected fhirRequest<T extends FhirResource = any>(path: string, method: string): (params: any, request?: InternalClientRequest) => Promise<FhirFetcherResponse<T>>;
|
|
37
37
|
}
|
|
38
38
|
export type FetcherError = {
|
|
@@ -19,23 +19,22 @@ class SDKResource {
|
|
|
19
19
|
constructor(config) {
|
|
20
20
|
this.config = config;
|
|
21
21
|
}
|
|
22
|
-
request(path, method) {
|
|
22
|
+
request(path, method, baseUrlThunk) {
|
|
23
23
|
return (params, request) => __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const baseUrlThunk = () => { var _a; return (_a = this.config.projectApiUrl) !== null && _a !== void 0 ? _a : defaultProjectApiUrl; };
|
|
25
24
|
const configThunk = () => this.config;
|
|
26
25
|
try {
|
|
27
26
|
return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
|
|
28
27
|
}
|
|
29
28
|
catch (err) {
|
|
30
29
|
const error = err;
|
|
31
|
-
throw new OystehrSdkError({ message: error.message, code: error.code });
|
|
30
|
+
throw new OystehrSdkError({ message: error.message, code: error.code, cause: error.cause });
|
|
32
31
|
}
|
|
33
32
|
});
|
|
34
33
|
}
|
|
35
34
|
fhirRequest(path, method) {
|
|
36
35
|
return (params, request) => __awaiter(this, void 0, void 0, function* () {
|
|
37
36
|
try {
|
|
38
|
-
const baseUrlThunk = () => { var _a; return (_a = this.config.fhirApiUrl) !== null &&
|
|
37
|
+
const baseUrlThunk = () => { var _a, _b; return (_b = (_a = this.config.services) === null || _a === void 0 ? void 0 : _a.fhirApiUrl) !== null && _b !== void 0 ? _b : defaultFhirApiUrl; };
|
|
39
38
|
const configThunk = () => this.config;
|
|
40
39
|
// must await here to catch
|
|
41
40
|
return yield fetcher(baseUrlThunk, configThunk, path, method)(params, request);
|
|
@@ -47,6 +46,7 @@ class SDKResource {
|
|
|
47
46
|
throw new OystehrSdkError({
|
|
48
47
|
message: fullError.message,
|
|
49
48
|
code: fullError.code,
|
|
49
|
+
cause: fullError.cause,
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
52
|
throw new OystehrFHIRError({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sources":["../../../src/client/client.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid';\nimport { OystehrConfig } from '../config';\nimport { OystehrFHIRError, OystehrSdkError } from '../errors';\nimport { FhirBundle, FhirResource, OperationOutcome } from '../resources/types';\n\ntype HttpMethod = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';\nexport const defaultProjectApiUrl = 'https://project-api.zapehr.com/v1';\nconst defaultFhirApiUrl = 'https://fhir-api.zapehr.com';\nconst STATUS_CODES_TO_RETRY = [408, 429, 500, 502, 503, 504];\nconst ERROR_CODES_TO_RETRY = [\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ETIMEDOUT',\n 'UND_ERR_CONNECT_TIMEOUT',\n 'UND_ERR_HEADERS_TIMEOUT',\n 'UND_ERR_HEADERS_TIMEOUT',\n 'UND_ERR_SOCKET',\n];\n\n/**\n * Optional parameter that can be passed to the client methods. It allows\n * overriding the access token or project ID, and setting various headers,\n * such as 'Content-Type'.\n */\nexport interface OystehrClientRequest {\n /**\n * The access token to use for the request. If not provided, the access token from `oystehr.init()` will be used.\n */\n accessToken?: string;\n /**\n * The project ID to use for the request. If not provided, the project ID from `oystehr.init()` will be used.\n */\n projectId?: string;\n /**\n * The value of the 'Content-Type' header to use for the request.\n */\n contentType?: string;\n /**\n * Unique identifier for this request.\n */\n requestId?: string;\n}\n\ninterface InternalClientRequest extends OystehrClientRequest {\n ifMatch?: string;\n}\n\ntype FhirData<T extends FhirResource> = T | T[] | FhirBundle<T>;\nexport type FhirFetcherResponse<T extends FhirData<FhirResource> = any> = T;\n\nexport class SDKResource {\n protected readonly config: OystehrConfig;\n constructor(config: OystehrConfig) {\n this.config = config;\n }\n\n protected request(path: string, method: string): FetcherFunction {\n return async (params: any, request?: InternalClientRequest): Promise<FetcherResponse> => {\n const baseUrlThunk = (): string => this.config.projectApiUrl ?? defaultProjectApiUrl;\n const configThunk = (): OystehrConfig => this.config;\n try {\n return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);\n } catch (err: any) {\n const error = err as { message: string; code: number };\n throw new OystehrSdkError({ message: error.message, code: error.code });\n }\n };\n }\n\n protected fhirRequest<T extends FhirResource = any>(path: string, method: string) {\n return async (params: any, request?: InternalClientRequest): Promise<FhirFetcherResponse<T>> => {\n try {\n const baseUrlThunk = (): string => this.config.fhirApiUrl ?? defaultFhirApiUrl;\n const configThunk = (): OystehrConfig => this.config;\n // must await here to catch\n return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);\n } catch (err: unknown) {\n // FHIR API error messages are JSON strings\n const fullError = err as { message: string | Record<string, any>; code: number };\n if (typeof fullError.message === 'string') {\n throw new OystehrSdkError({\n message: fullError.message,\n code: fullError.code,\n });\n }\n throw new OystehrFHIRError({\n error: fullError.message as OperationOutcome,\n code: fullError.code,\n });\n }\n };\n }\n}\n\nexport type FetcherError = { message: string; code: number };\nexport type FetcherResponse = any;\nexport type FetcherFunction = (\n params?: Record<string, any> | [any] | InternalClientRequest,\n request?: InternalClientRequest\n) => Promise<FetcherResponse>;\n\nfunction isInternalClientRequest(request: Record<string, any>): request is InternalClientRequest {\n return 'accessToken' in request;\n}\n\nfunction fetcher(\n baseUrlThunk: () => string,\n configThunk: () => OystehrConfig,\n path: string,\n methodParam: string\n): FetcherFunction {\n return async (\n params?: Record<string, unknown> | [any] | InternalClientRequest,\n request?: InternalClientRequest\n ): Promise<FetcherResponse> => {\n // this function supports multiple signatures. fetcher(baseUrl, path, method)(params, request) or fetcher(baseUrl, path, method)(request)\n // or fetcher(baseUrl, path, method)(params) or fetcher(baseUrl, path, method)(). the types for this are handled by Client<Path, Methods>\n // and this is the backend implementation behind it. the heuristic we're using is that if the first param is an object with an accessToken\n // and there is no second param, assume the first one is the request object instead\n const providedParams: Record<string, unknown> | [any] =\n !!params && !request && !Array.isArray(params) && isInternalClientRequest(params)\n ? {}\n : (params as Record<string, unknown>) ?? {};\n const requestCtx =\n !!params && !request && !Array.isArray(params) && isInternalClientRequest(params)\n ? (params as InternalClientRequest)\n : request;\n const method = methodParam.toLowerCase() as HttpMethod;\n const config = configThunk();\n const fetchImpl = config.fetch ?? fetch;\n const accessToken = requestCtx?.accessToken ?? config.accessToken;\n const projectId = requestCtx?.projectId ?? configThunk().projectId;\n let finalPath = path;\n let finalParams = providedParams;\n if (!Array.isArray(providedParams)) {\n const [subbedPath, addlParams] = subParamsInPath(path, providedParams);\n finalPath = subbedPath;\n finalParams = addlParams;\n }\n finalPath = finalPath.replace(/^\\//, ''); // remove leading slash\n const baseUrlEvaluated = baseUrlThunk();\n const fullBaseUrl = baseUrlEvaluated.endsWith('/') ? baseUrlEvaluated : baseUrlEvaluated + '/';\n const url = new URL(finalPath, fullBaseUrl);\n let body: any;\n\n if (Array.isArray(finalParams)) {\n body = JSON.stringify(finalParams);\n } else if (Object.keys(finalParams).length) {\n if (method === 'get') {\n addParamsToSearch(finalParams, url.searchParams);\n } else if (requestCtx?.contentType === 'application/x-www-form-urlencoded') {\n const search = new URLSearchParams();\n addParamsToSearch(finalParams, search);\n body = search.toString();\n } else {\n body = JSON.stringify(finalParams);\n }\n } else {\n // override for rpc call\n if (requestCtx?.contentType !== 'application/x-www-form-urlencoded' && method === 'post') {\n body = '{}';\n }\n }\n\n const headers: Record<string, string> = Object.assign(\n projectId\n ? {\n 'x-zapehr-project-id': projectId,\n 'x-oystehr-project-id': projectId,\n }\n : {},\n {\n 'content-type': requestCtx?.contentType ?? 'application/json',\n },\n accessToken ? { Authorization: `Bearer ${accessToken}` } : {},\n requestCtx?.ifMatch ? { 'If-Match': requestCtx.ifMatch } : {},\n { 'x-oystehr-request-id': requestCtx?.requestId ?? uuidv4() }\n );\n const retryConfig: ConstructedRetryConfig = {\n retries: config.retry?.retries ?? 3,\n jitter: config.retry?.jitter ?? 20,\n delay: config.retry?.delay ?? 100,\n onRetry: config.retry?.onRetry,\n // Using array instead of set because the length is too short for uniqueness to be important\n retryOn: [...(config.retry?.retryOn ?? []), ...STATUS_CODES_TO_RETRY],\n };\n retryConfig.retryOn.push(...STATUS_CODES_TO_RETRY);\n return retry(async () => {\n const response = await fetchImpl(\n new Request(url, {\n method: method.toUpperCase(),\n body,\n headers,\n })\n );\n const responseBody = response.body ? await response.text() : null;\n let responseJson: Record<string, unknown> | null;\n try {\n responseJson =\n responseBody &&\n (response.headers.get('content-type')?.includes('application/json') ||\n response.headers.get('content-type')?.includes('application/fhir+json'))\n ? JSON.parse(responseBody)\n : null;\n } catch (_err) {\n // ignore JSON.parse errors\n responseJson = null;\n }\n const isError = !response.ok || response.status >= 400;\n if (isError) {\n const errObj = {\n message: responseJson?.message ?? responseJson ?? responseBody ?? response.statusText,\n code: responseJson?.code ?? response.status,\n response,\n };\n throw errObj;\n }\n return responseJson;\n }, retryConfig);\n };\n}\n\ntype ConstructedRetryConfig = Omit<NonNullable<OystehrConfig['retry']>, 'retryOn'> & {\n jitter: NonNullable<NonNullable<OystehrConfig['retry']>['jitter']>;\n delay: NonNullable<NonNullable<OystehrConfig['retry']>['delay']>;\n retryOn: NonNullable<NonNullable<OystehrConfig['retry']>['retryOn']>;\n};\nasync function retry<T>(work: (attempt: number) => Promise<T>, config: ConstructedRetryConfig): Promise<T> {\n let lastErr;\n for (const attempt of Array.from({ length: (config.retries ?? 0) + 1 }, (_, index) => index)) {\n try {\n return await work(attempt);\n } catch (e: any) {\n let isRetryable = false;\n if ('response' in e) {\n // error from API\n const err = e as FetcherError;\n isRetryable = config.retryOn.includes(err.code);\n // Removes response\n lastErr = { message: e.message, code: e.code };\n } else {\n lastErr = e;\n // error from fetch\n if ('code' in e && typeof e.code === 'string') {\n const err = e as { code: string };\n isRetryable = ERROR_CODES_TO_RETRY.includes(err.code);\n }\n }\n if (!isRetryable) {\n break;\n }\n const jitter = Math.floor(Math.random() * (config.jitter + 1));\n await new Promise((resolve) => setTimeout(resolve, config.delay + jitter));\n if (config.onRetry && attempt !== (config.retries ?? 0)) {\n config.onRetry(attempt + 1);\n }\n }\n }\n throw lastErr;\n}\n\n/**\n * Substitutes params in a path and returns the path with params substituted and any unused params.\n *\n * Uses the property names in the params object to determine the param to substitute in the path.\n *\n * @param path JSON API resource URI\n * @param params all params provided to the client method\n * @returns resource URI with params substituted and any unused params\n */\nfunction subParamsInPath(path: string, params: Record<string, unknown>): [string, Record<string, string>] {\n const unusedParams = { ...params };\n // capture everything of the form `{paramName}` and replace with the value of `params[paramName]`\n const subbedPath = path.replace(/\\{([^}]+)\\}/g, (_, paramName) => {\n delete unusedParams[paramName];\n // override for path params that are paths, indicated by a `+` at the end\n if (paramName.match(/^.*\\+$/)) {\n return params[paramName] + '';\n }\n // error if param value is empty\n if (!params[paramName] || params[paramName] === '') {\n throw new OystehrSdkError({ message: `Required path parameter is an empty string: ${paramName}`, code: 400 });\n }\n // encode search params\n if (params[paramName]) {\n return encodeURIComponent(params[paramName] + ''); // coerce to string\n }\n return '';\n });\n\n const unusedKeys = Object.keys(unusedParams);\n const addlParams = unusedKeys.length\n ? unusedKeys.reduce((acc, key) => ({ ...acc, [key]: unusedParams[key] }), {})\n : {};\n return [subbedPath, addlParams];\n}\n\n/**\n * Adds params to a URLSearchParams object in such a way as to preserve array values.\n * @param params params\n * @param search URLSearchParams object\n */\nexport function addParamsToSearch(params: Record<string, unknown>, search: URLSearchParams): void {\n for (const [key, value] of Object.entries(params)) {\n if (Array.isArray(value)) {\n value.forEach((v) => search.append(key, v as string));\n continue;\n }\n search.append(key, value as string);\n }\n}\n"],"names":["uuidv4"],"mappings":";;;;AAMO,MAAM,oBAAoB,GAAG,oCAAoC;AACxE,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AACxD,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC7D,MAAM,oBAAoB,GAAG;IAC3B,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,yBAAyB;IACzB,yBAAyB;IACzB,yBAAyB;IACzB,gBAAgB;CACjB,CAAC;MAiCW,WAAW,CAAA;AAEtB,IAAA,WAAA,CAAY,MAAqB,EAAA;AAC/B,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACtB;IAES,OAAO,CAAC,IAAY,EAAE,MAAc,EAAA;AAC5C,QAAA,OAAO,CAAO,MAAW,EAAE,OAA+B,KAA8B,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;AACtF,YAAA,MAAM,YAAY,GAAG,MAAa,EAAA,IAAA,EAAA,CAAA,CAAC,OAAA,CAAA,EAAA,GAAA,IAAI,CAAC,MAAM,CAAC,aAAa,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,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AAA,CAAG,EAAE,EAAE,CAAC;UAC3E,EAAE,CAAC;AACP,IAAA,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;AAClC,CAAC;AAED;;;;AAIG;AACa,SAAA,iBAAiB,CAAC,MAA+B,EAAE,MAAuB,EAAA;AACxF,IAAA,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACjD,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACxB,YAAA,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAW,CAAC,CAAC,CAAC;YACtD,SAAS;AACV,SAAA;AACD,QAAA,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAe,CAAC,CAAC;AACrC,KAAA;AACH;;;;"}
|
|
1
|
+
{"version":3,"file":"client.js","sources":["../../../src/client/client.ts"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid';\nimport { OystehrConfig } from '../config';\nimport { OystehrFHIRError, OystehrSdkError } from '../errors';\nimport { FhirBundle, FhirResource, OperationOutcome } from '../resources/types';\n\ntype HttpMethod = 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace';\nexport const defaultProjectApiUrl = 'https://project-api.zapehr.com/v1';\nconst defaultFhirApiUrl = 'https://fhir-api.zapehr.com';\nconst STATUS_CODES_TO_RETRY = [408, 429, 500, 502, 503, 504];\nconst ERROR_CODES_TO_RETRY = [\n 'ECONNRESET',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ETIMEDOUT',\n 'UND_ERR_CONNECT_TIMEOUT',\n 'UND_ERR_HEADERS_TIMEOUT',\n 'UND_ERR_HEADERS_TIMEOUT',\n 'UND_ERR_SOCKET',\n];\n\n/**\n * Optional parameter that can be passed to the client methods. It allows\n * overriding the access token or project ID, and setting various headers,\n * such as 'Content-Type'.\n */\nexport interface OystehrClientRequest {\n /**\n * The access token to use for the request. If not provided, the access token from `oystehr.init()` will be used.\n */\n accessToken?: string;\n /**\n * The project ID to use for the request. If not provided, the project ID from `oystehr.init()` will be used.\n */\n projectId?: string;\n /**\n * The value of the 'Content-Type' header to use for the request.\n */\n contentType?: string;\n /**\n * Unique identifier for this request.\n */\n requestId?: string;\n}\n\ninterface InternalClientRequest extends OystehrClientRequest {\n ifMatch?: string;\n}\n\ntype FhirData<T extends FhirResource> = T | T[] | FhirBundle<T>;\nexport type FhirFetcherResponse<T extends FhirData<FhirResource> = any> = T;\n\nexport class SDKResource {\n protected readonly config: OystehrConfig;\n constructor(config: OystehrConfig) {\n this.config = config;\n }\n\n protected request(path: string, method: string, baseUrlThunk: () => string): FetcherFunction {\n return async (params: any, request?: InternalClientRequest): Promise<FetcherResponse> => {\n const configThunk = (): OystehrConfig => this.config;\n try {\n return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);\n } catch (err: any) {\n const error = err as { message: string; code: number; cause?: unknown };\n throw new OystehrSdkError({ message: error.message, code: error.code, cause: error.cause });\n }\n };\n }\n\n protected fhirRequest<T extends FhirResource = any>(path: string, method: string) {\n return async (params: any, request?: InternalClientRequest): Promise<FhirFetcherResponse<T>> => {\n try {\n const baseUrlThunk = (): string => this.config.services?.fhirApiUrl ?? defaultFhirApiUrl;\n const configThunk = (): OystehrConfig => this.config;\n // must await here to catch\n return await fetcher(baseUrlThunk, configThunk, path, method)(params, request);\n } catch (err: unknown) {\n // FHIR API error messages are JSON strings\n const fullError = err as { message: string | Record<string, any>; code: number; cause?: unknown };\n if (typeof fullError.message === 'string') {\n throw new OystehrSdkError({\n message: fullError.message,\n code: fullError.code,\n cause: fullError.cause,\n });\n }\n throw new OystehrFHIRError({\n error: fullError.message as OperationOutcome,\n code: fullError.code,\n });\n }\n };\n }\n}\n\nexport type FetcherError = { message: string; code: number };\nexport type FetcherResponse = any;\nexport type FetcherFunction = (\n params?: Record<string, any> | [any] | InternalClientRequest,\n request?: InternalClientRequest\n) => Promise<FetcherResponse>;\n\nfunction isInternalClientRequest(request: Record<string, any>): request is InternalClientRequest {\n return 'accessToken' in request;\n}\n\nfunction fetcher(\n baseUrlThunk: () => string,\n configThunk: () => OystehrConfig,\n path: string,\n methodParam: string\n): FetcherFunction {\n return async (\n params?: Record<string, unknown> | [any] | InternalClientRequest,\n request?: InternalClientRequest\n ): Promise<FetcherResponse> => {\n // this function supports multiple signatures. fetcher(baseUrl, path, method)(params, request) or fetcher(baseUrl, path, method)(request)\n // or fetcher(baseUrl, path, method)(params) or fetcher(baseUrl, path, method)(). the types for this are handled by Client<Path, Methods>\n // and this is the backend implementation behind it. the heuristic we're using is that if the first param is an object with an accessToken\n // and there is no second param, assume the first one is the request object instead\n const providedParams: Record<string, unknown> | [any] =\n !!params && !request && !Array.isArray(params) && isInternalClientRequest(params)\n ? {}\n : (params as Record<string, unknown>) ?? {};\n const requestCtx =\n !!params && !request && !Array.isArray(params) && isInternalClientRequest(params)\n ? (params as InternalClientRequest)\n : request;\n const method = methodParam.toLowerCase() as HttpMethod;\n const config = configThunk();\n const fetchImpl = config.fetch ?? fetch;\n const accessToken = requestCtx?.accessToken ?? config.accessToken;\n const projectId = requestCtx?.projectId ?? configThunk().projectId;\n let finalPath = path;\n let finalParams = providedParams;\n if (!Array.isArray(providedParams)) {\n const [subbedPath, addlParams] = subParamsInPath(path, providedParams);\n finalPath = subbedPath;\n finalParams = addlParams;\n }\n finalPath = finalPath.replace(/^\\//, ''); // remove leading slash\n const baseUrlEvaluated = baseUrlThunk();\n const fullBaseUrl = baseUrlEvaluated.endsWith('/') ? baseUrlEvaluated : baseUrlEvaluated + '/';\n const url = new URL(finalPath, fullBaseUrl);\n let body: any;\n\n if (Array.isArray(finalParams)) {\n body = JSON.stringify(finalParams);\n } else if (Object.keys(finalParams).length) {\n if (method === 'get') {\n addParamsToSearch(finalParams, url.searchParams);\n } else if (requestCtx?.contentType === 'application/x-www-form-urlencoded') {\n const search = new URLSearchParams();\n addParamsToSearch(finalParams, search);\n body = search.toString();\n } else {\n body = JSON.stringify(finalParams);\n }\n } else {\n // override for rpc call\n if (requestCtx?.contentType !== 'application/x-www-form-urlencoded' && method === 'post') {\n body = '{}';\n }\n }\n\n const headers: Record<string, string> = Object.assign(\n projectId\n ? {\n 'x-zapehr-project-id': projectId,\n 'x-oystehr-project-id': projectId,\n }\n : {},\n {\n 'content-type': requestCtx?.contentType ?? 'application/json',\n },\n accessToken ? { Authorization: `Bearer ${accessToken}` } : {},\n requestCtx?.ifMatch ? { 'If-Match': requestCtx.ifMatch } : {},\n { 'x-oystehr-request-id': requestCtx?.requestId ?? uuidv4() }\n );\n const retryConfig: ConstructedRetryConfig = {\n retries: config.retry?.retries ?? 3,\n jitter: config.retry?.jitter ?? 20,\n delay: config.retry?.delay ?? 100,\n onRetry: config.retry?.onRetry,\n // Using array instead of set because the length is too short for uniqueness to be important\n retryOn: [...(config.retry?.retryOn ?? []), ...STATUS_CODES_TO_RETRY],\n };\n retryConfig.retryOn.push(...STATUS_CODES_TO_RETRY);\n return retry(async () => {\n const response = await fetchImpl(\n new Request(url, {\n method: method.toUpperCase(),\n body,\n headers,\n })\n );\n const responseBody = response.body ? await response.text() : null;\n let responseJson: Record<string, unknown> | null;\n try {\n responseJson =\n responseBody &&\n (response.headers.get('content-type')?.includes('application/json') ||\n response.headers.get('content-type')?.includes('application/fhir+json'))\n ? JSON.parse(responseBody)\n : null;\n } catch (_err) {\n // ignore JSON.parse errors\n responseJson = null;\n }\n const isError = !response.ok || response.status >= 400;\n if (isError) {\n const errObj = {\n message: responseJson?.message ?? responseJson ?? responseBody ?? response.statusText,\n code: responseJson?.code ?? response.status,\n response,\n };\n throw errObj;\n }\n return responseJson;\n }, retryConfig);\n };\n}\n\ntype ConstructedRetryConfig = Omit<NonNullable<OystehrConfig['retry']>, 'retryOn'> & {\n jitter: NonNullable<NonNullable<OystehrConfig['retry']>['jitter']>;\n delay: NonNullable<NonNullable<OystehrConfig['retry']>['delay']>;\n retryOn: NonNullable<NonNullable<OystehrConfig['retry']>['retryOn']>;\n};\nasync function retry<T>(work: (attempt: number) => Promise<T>, config: ConstructedRetryConfig): Promise<T> {\n let lastErr;\n for (const attempt of Array.from({ length: (config.retries ?? 0) + 1 }, (_, index) => index)) {\n try {\n return await work(attempt);\n } catch (e: any) {\n let isRetryable = false;\n if ('response' in e) {\n // error from API\n const err = e as FetcherError;\n isRetryable = config.retryOn.includes(err.code);\n // Removes response\n lastErr = { message: e.message, code: e.code };\n } else {\n lastErr = e;\n // error from fetch\n if ('code' in e && typeof e.code === 'string') {\n const err = e as { code: string };\n isRetryable = ERROR_CODES_TO_RETRY.includes(err.code);\n }\n }\n if (!isRetryable) {\n break;\n }\n const jitter = Math.floor(Math.random() * (config.jitter + 1));\n await new Promise((resolve) => setTimeout(resolve, config.delay + jitter));\n if (config.onRetry && attempt !== (config.retries ?? 0)) {\n config.onRetry(attempt + 1);\n }\n }\n }\n throw lastErr;\n}\n\n/**\n * Substitutes params in a path and returns the path with params substituted and any unused params.\n *\n * Uses the property names in the params object to determine the param to substitute in the path.\n *\n * @param path JSON API resource URI\n * @param params all params provided to the client method\n * @returns resource URI with params substituted and any unused params\n */\nfunction subParamsInPath(path: string, params: Record<string, unknown>): [string, Record<string, string>] {\n const unusedParams = { ...params };\n // capture everything of the form `{paramName}` and replace with the value of `params[paramName]`\n const subbedPath = path.replace(/\\{([^}]+)\\}/g, (_, paramName) => {\n delete unusedParams[paramName];\n // override for path params that are paths, indicated by a `+` at the end\n if (paramName.match(/^.*\\+$/)) {\n return params[paramName] + '';\n }\n // error if param value is empty\n if (!params[paramName] || params[paramName] === '') {\n throw new OystehrSdkError({ message: `Required path parameter is an empty string: ${paramName}`, code: 400 });\n }\n // encode search params\n if (params[paramName]) {\n return encodeURIComponent(params[paramName] + ''); // coerce to string\n }\n return '';\n });\n\n const unusedKeys = Object.keys(unusedParams);\n const addlParams = unusedKeys.length\n ? unusedKeys.reduce((acc, key) => ({ ...acc, [key]: unusedParams[key] }), {})\n : {};\n return [subbedPath, addlParams];\n}\n\n/**\n * Adds params to a URLSearchParams object in such a way as to preserve array values.\n * @param params params\n * @param search URLSearchParams object\n */\nexport function addParamsToSearch(params: Record<string, unknown>, search: URLSearchParams): void {\n for (const [key, value] of Object.entries(params)) {\n if (Array.isArray(value)) {\n value.forEach((v) => search.append(key, v as string));\n continue;\n }\n search.append(key, value as string);\n }\n}\n"],"names":["uuidv4"],"mappings":";;;;AAMO,MAAM,oBAAoB,GAAG,oCAAoC;AACxE,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AACxD,MAAM,qBAAqB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC7D,MAAM,oBAAoB,GAAG;IAC3B,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,yBAAyB;IACzB,yBAAyB;IACzB,yBAAyB;IACzB,gBAAgB;CACjB,CAAC;MAiCW,WAAW,CAAA;AAEtB,IAAA,WAAA,CAAY,MAAqB,EAAA;AAC/B,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;KACtB;AAES,IAAA,OAAO,CAAC,IAAY,EAAE,MAAc,EAAE,YAA0B,EAAA;AACxE,QAAA,OAAO,CAAO,MAAW,EAAE,OAA+B,KAA8B,SAAA,CAAA,IAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;YACtF,MAAM,WAAW,GAAG,MAAqB,IAAI,CAAC,MAAM,CAAC;YACrD,IAAI;AACF,gBAAA,OAAO,MAAM,OAAO,CAAC,YAAY,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAChF,aAAA;AAAC,YAAA,OAAO,GAAQ,EAAE;gBACjB,MAAM,KAAK,GAAG,GAAyD,CAAC;gBACxE,MAAM,IAAI,eAAe,CAAC,EAAE,OAAO,EAAE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,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;AACjD,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;AACxB,YAAA,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,CAAW,CAAC,CAAC,CAAC;YACtD,SAAS;AACV,SAAA;AACD,QAAA,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,KAAe,CAAC,CAAC;AACrC,KAAA;AACH;;;;"}
|
package/dist/esm/config.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ export interface OystehrConfig {
|
|
|
12
12
|
projectId?: string;
|
|
13
13
|
fhirApiUrl?: string;
|
|
14
14
|
projectApiUrl?: string;
|
|
15
|
+
services?: {
|
|
16
|
+
faxApiUrl?: string;
|
|
17
|
+
fhirApiUrl?: string;
|
|
18
|
+
projectApiUrl?: string;
|
|
19
|
+
};
|
|
15
20
|
/**
|
|
16
21
|
* Optionally provide a custom fetch implementation. This must conform to the
|
|
17
22
|
* built-in node.js fetch implementation (undici fetch).
|
|
@@ -2,11 +2,13 @@ import { OperationOutcome as OperationOutcomeR4B } from 'fhir/r4b';
|
|
|
2
2
|
import { OperationOutcome as OperationOutcomeR5 } from 'fhir/r5';
|
|
3
3
|
export declare class OystehrSdkError extends Error {
|
|
4
4
|
code: number;
|
|
5
|
-
constructor({ message, code }: {
|
|
5
|
+
constructor({ message, code, cause }: {
|
|
6
6
|
message: string;
|
|
7
7
|
code: number;
|
|
8
|
+
cause?: unknown;
|
|
8
9
|
});
|
|
9
10
|
toString(): string;
|
|
11
|
+
toJSON(): any;
|
|
10
12
|
}
|
|
11
13
|
export declare class OystehrFHIRError extends OystehrSdkError {
|
|
12
14
|
cause: OperationOutcomeR4B | OperationOutcomeR5;
|
|
@@ -14,4 +16,5 @@ export declare class OystehrFHIRError extends OystehrSdkError {
|
|
|
14
16
|
error: OperationOutcomeR4B | OperationOutcomeR5;
|
|
15
17
|
code: number;
|
|
16
18
|
});
|
|
19
|
+
toJSON(): any;
|
|
17
20
|
}
|
package/dist/esm/errors/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
class OystehrSdkError extends Error {
|
|
2
|
-
constructor({ message, code }) {
|
|
3
|
-
super(message);
|
|
2
|
+
constructor({ message, code, cause }) {
|
|
3
|
+
super(message, { cause });
|
|
4
4
|
Object.setPrototypeOf(this, OystehrSdkError.prototype);
|
|
5
5
|
this.code = code;
|
|
6
6
|
this.name = 'OystehrSdkError';
|
|
@@ -8,6 +8,14 @@ class OystehrSdkError extends Error {
|
|
|
8
8
|
toString() {
|
|
9
9
|
return `${this.name}: ${this.message} (code: ${this.code})`;
|
|
10
10
|
}
|
|
11
|
+
toJSON() {
|
|
12
|
+
return {
|
|
13
|
+
name: this.name,
|
|
14
|
+
message: this.message,
|
|
15
|
+
code: this.code,
|
|
16
|
+
cause: this.cause,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
11
19
|
}
|
|
12
20
|
function transformOperationOutcomeToErrorMessage(cause) {
|
|
13
21
|
var _a;
|
|
@@ -32,6 +40,14 @@ class OystehrFHIRError extends OystehrSdkError {
|
|
|
32
40
|
this.cause = error;
|
|
33
41
|
this.name = 'OystehrFHIRError';
|
|
34
42
|
}
|
|
43
|
+
toJSON() {
|
|
44
|
+
return {
|
|
45
|
+
name: this.name,
|
|
46
|
+
message: this.message,
|
|
47
|
+
code: this.code,
|
|
48
|
+
cause: this.cause,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
35
51
|
}
|
|
36
52
|
|
|
37
53
|
export { OystehrFHIRError, OystehrSdkError };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/errors/index.ts"],"sourcesContent":["import { OperationOutcome as OperationOutcomeR4B } from 'fhir/r4b';\nimport { OperationOutcome as OperationOutcomeR5 } from 'fhir/r5';\n\nexport class OystehrSdkError extends Error {\n code: number;\n constructor({ message, code }: { message: string; code: number }) {\n super(message);\n Object.setPrototypeOf(this, OystehrSdkError.prototype);\n this.code = code;\n this.name = 'OystehrSdkError';\n }\n toString(): string {\n return `${this.name}: ${this.message} (code: ${this.code})`;\n }\n}\n\nfunction transformOperationOutcomeToErrorMessage(cause: OperationOutcomeR4B | OperationOutcomeR5): string {\n const causes = [];\n for (const issue of cause.issue ?? []) {\n if (issue.details && issue.details.text) {\n causes.push(issue.details.text);\n }\n }\n if (!causes.length) {\n causes.push('Unknown FHIR error');\n }\n return causes.join(',');\n}\n\nexport class OystehrFHIRError extends OystehrSdkError {\n cause: OperationOutcomeR4B | OperationOutcomeR5;\n constructor({ error, code }: { error: OperationOutcomeR4B | OperationOutcomeR5; code: number }) {\n super({\n message: transformOperationOutcomeToErrorMessage(error as OperationOutcomeR4B | OperationOutcomeR5),\n code,\n });\n Object.setPrototypeOf(this, OystehrFHIRError.prototype);\n this.cause = error as OperationOutcomeR4B | OperationOutcomeR5;\n this.name = 'OystehrFHIRError';\n }\n}\n"],"names":[],"mappings":"AAGM,MAAO,eAAgB,SAAQ,KAAK,CAAA;AAExC,IAAA,WAAA,CAAY,EAAE,OAAO,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/errors/index.ts"],"sourcesContent":["import { OperationOutcome as OperationOutcomeR4B } from 'fhir/r4b';\nimport { OperationOutcome as OperationOutcomeR5 } from 'fhir/r5';\n\nexport class OystehrSdkError extends Error {\n code: number;\n constructor({ message, code, cause }: { message: string; code: number; cause?: unknown }) {\n super(message, { cause });\n Object.setPrototypeOf(this, OystehrSdkError.prototype);\n this.code = code;\n this.name = 'OystehrSdkError';\n }\n toString(): string {\n return `${this.name}: ${this.message} (code: ${this.code})`;\n }\n toJSON(): any {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n cause: this.cause,\n };\n }\n}\n\nfunction transformOperationOutcomeToErrorMessage(cause: OperationOutcomeR4B | OperationOutcomeR5): string {\n const causes = [];\n for (const issue of cause.issue ?? []) {\n if (issue.details && issue.details.text) {\n causes.push(issue.details.text);\n }\n }\n if (!causes.length) {\n causes.push('Unknown FHIR error');\n }\n return causes.join(',');\n}\n\nexport class OystehrFHIRError extends OystehrSdkError {\n cause: OperationOutcomeR4B | OperationOutcomeR5;\n constructor({ error, code }: { error: OperationOutcomeR4B | OperationOutcomeR5; code: number }) {\n super({\n message: transformOperationOutcomeToErrorMessage(error as OperationOutcomeR4B | OperationOutcomeR5),\n code,\n });\n Object.setPrototypeOf(this, OystehrFHIRError.prototype);\n this.cause = error as OperationOutcomeR4B | OperationOutcomeR5;\n this.name = 'OystehrFHIRError';\n }\n toJSON(): any {\n return {\n name: this.name,\n message: this.message,\n code: this.code,\n cause: this.cause,\n };\n }\n}\n"],"names":[],"mappings":"AAGM,MAAO,eAAgB,SAAQ,KAAK,CAAA;AAExC,IAAA,WAAA,CAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAsD,EAAA;AACtF,QAAA,KAAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QAC1B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,eAAe,CAAC,SAAS,CAAC,CAAC;AACvD,QAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;AACjB,QAAA,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;KAC/B;IACD,QAAQ,GAAA;AACN,QAAA,OAAO,CAAG,EAAA,IAAI,CAAC,IAAI,CAAK,EAAA,EAAA,IAAI,CAAC,OAAO,CAAW,QAAA,EAAA,IAAI,CAAC,IAAI,GAAG,CAAC;KAC7D;IACD,MAAM,GAAA;QACJ,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,KAAK,EAAE,IAAI,CAAC,KAAK;SAClB,CAAC;KACH;AACF,CAAA;AAED,SAAS,uCAAuC,CAAC,KAA+C,EAAA;;IA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